From 68f9b40a80ef77c2e3c37a227e283d164187aa64 Mon Sep 17 00:00:00 2001 From: rolux Date: Thu, 22 Dec 2011 12:54:30 +0530 Subject: [PATCH] use new form element syntax --- static/js/api/pandora.js | 4 ++-- static/js/pandora/allItems.js | 2 +- static/js/pandora/contactForm.js | 4 +--- static/js/pandora/folderList.js | 2 +- static/js/pandora/sectionButtons.js | 9 +++++---- static/js/pandora/sectionSelect.js | 9 +++++---- static/js/pandora/sectionbar.js | 6 +++--- 7 files changed, 18 insertions(+), 18 deletions(-) diff --git a/static/js/api/pandora.js b/static/js/api/pandora.js index ca746b448..2055533a2 100755 --- a/static/js/api/pandora.js +++ b/static/js/api/pandora.js @@ -133,11 +133,11 @@ function constructList() { .html(app.actions[id].code[1].replace('/\n/
\n/g')) .hide(); var $button = new Ox.Button({ - title: [ + type: "image" + values: [ {id: "one", title: "right"}, {id: "two", title: "down"}, ], - type: "image" }) .addClass("margin") .click(function() { $code.toggle()}) diff --git a/static/js/pandora/allItems.js b/static/js/pandora/allItems.js index 5c53da71b..0a331c490 100644 --- a/static/js/pandora/allItems.js +++ b/static/js/pandora/allItems.js @@ -3,7 +3,7 @@ pandora.ui.allItems = function() { var that = Ox.Element() - .addClass('OxSelectable' + (pandora.user.ui._list ? '' : ' OxSelected')) + .addClass('OxSelectableElement' + (pandora.user.ui._list ? '' : ' OxSelected')) .css({ height: '16px', cursor: 'default', diff --git a/static/js/pandora/contactForm.js b/static/js/pandora/contactForm.js index fdb35eb46..ce7c0c6af 100644 --- a/static/js/pandora/contactForm.js +++ b/static/js/pandora/contactForm.js @@ -66,9 +66,7 @@ pandora.ui.contactForm = function() { .css({width: width + 'px'}) .bindEvent({ validate: function(data) { - $sendButton.options({ - disabled: !data.valid - }); + $sendButton.options({disabled: !data.valid}); } }) .appendTo(that), diff --git a/static/js/pandora/folderList.js b/static/js/pandora/folderList.js index 7bddb9752..0f67089ea 100644 --- a/static/js/pandora/folderList.js +++ b/static/js/pandora/folderList.js @@ -279,7 +279,7 @@ pandora.ui.folderList = function(id) { } else if (id == 'favorite' || (id == 'featured' && pandora.user.level == 'admin')) { // this makes the button trigger a change event, // which is already being handled in folders.js - pandora.$ui.manageListsButton[id].options({selected: true}); + pandora.$ui.manageListsButton[id].options({value: true}); /* if (!pandora.site.sectionFolders.items[i].showBrowser) { pandora.site.sectionFolders.items[i].showBrowser = true; diff --git a/static/js/pandora/sectionButtons.js b/static/js/pandora/sectionButtons.js index d705642f9..8e4bb8313 100644 --- a/static/js/pandora/sectionButtons.js +++ b/static/js/pandora/sectionButtons.js @@ -3,12 +3,13 @@ pandora.ui.sectionButtons = function() { var that = Ox.ButtonGroup({ buttons: [ - {id: 'items', selected: pandora.user.ui.section == 'items', title: pandora.site.itemName.plural}, - {id: 'edits', selected: pandora.user.ui.section == 'edits', title: 'Edits', disabled: true}, - {id: 'texts', selected: pandora.user.ui.section == 'texts', title: 'Texts', disabled: true} + {id: 'items', title: pandora.site.itemName.plural}, + {id: 'edits', title: 'Edits', disabled: true}, + {id: 'texts', title: 'Texts', disabled: true} ], id: 'sectionButtons', - selectable: true + selectable: true, + value: pandora.user.ui.section }).css({ float: 'left', margin: '4px' diff --git a/static/js/pandora/sectionSelect.js b/static/js/pandora/sectionSelect.js index 81da14fef..4a03da6c6 100644 --- a/static/js/pandora/sectionSelect.js +++ b/static/js/pandora/sectionSelect.js @@ -5,10 +5,11 @@ pandora.ui.sectionSelect = function() { var that = Ox.Select({ id: 'sectionSelect', items: [ - {checked: pandora.user.ui.section == 'items', id: 'items', title: pandora.site.itemName.plural}, - {checked: pandora.user.ui.section == 'edits', id: 'edits', title: 'Edits', disabled: true}, - {checked: pandora.user.ui.section == 'texts', id: 'texts', title: 'Texts', disabled: true} - ] + {id: 'items', title: pandora.site.itemName.plural}, + {id: 'edits', title: 'Edits', disabled: true}, + {id: 'texts', title: 'Texts', disabled: true} + ], + value: pandora.user.ui.section }).css({ float: 'left', margin: '4px' diff --git a/static/js/pandora/sectionbar.js b/static/js/pandora/sectionbar.js index 2b0728636..8809559d8 100644 --- a/static/js/pandora/sectionbar.js +++ b/static/js/pandora/sectionbar.js @@ -5,9 +5,9 @@ pandora.ui.sectionbar = function(mode) { size: 24 }) .append( - mode == 'buttons' ? - pandora.$ui.sectionButtons = pandora.ui.sectionButtons() : - pandora.$ui.sectionSelect = pandora.ui.sectionSelect() + mode == 'buttons' + ? pandora.$ui.sectionButtons = pandora.ui.sectionButtons() + : pandora.$ui.sectionSelect = pandora.ui.sectionSelect() ); that.toggle = function() {