From fc0327677aee40d9c3459600c80b88ba3fe622ce Mon Sep 17 00:00:00 2001 From: Brian Federle Date: Tue, 3 Apr 2012 15:34:57 -0700 Subject: [PATCH] Cleanup whitespace + indentation for UI widgets --- ui/scripts/ui-custom/dashboard.js | 20 ++-- ui/scripts/ui-custom/enableStaticNAT.js | 6 +- ui/scripts/ui-custom/installWizard.js | 16 +-- ui/scripts/ui-custom/instanceWizard.js | 102 ++++++++-------- ui/scripts/ui-custom/ipRules.js | 54 ++++----- ui/scripts/ui-custom/login.js | 10 +- ui/scripts/ui-custom/physicalResources.js | 132 ++++++++++----------- ui/scripts/ui-custom/projects.js | 18 +-- ui/scripts/ui-custom/recurringSnapshots.js | 10 +- ui/scripts/ui-custom/securityRules.js | 6 +- ui/scripts/ui-custom/zoneChart.js | 66 ++++------- ui/scripts/ui-custom/zoneWizard.js | 60 +++++----- ui/scripts/ui/core.js | 30 ++--- ui/scripts/ui/dialog.js | 86 +++++++------- ui/scripts/ui/events.js | 2 +- ui/scripts/ui/utils.js | 50 ++++---- ui/scripts/ui/widgets/cloudBrowser.js | 8 +- ui/scripts/ui/widgets/dataTable.js | 2 +- ui/scripts/ui/widgets/detailView.js | 68 +++++------ ui/scripts/ui/widgets/listView.js | 132 ++++++++++----------- ui/scripts/ui/widgets/multiEdit.js | 76 ++++++------ ui/scripts/ui/widgets/notifications.js | 2 +- ui/scripts/ui/widgets/overlay.js | 4 +- ui/scripts/ui/widgets/treeView.js | 8 +- 24 files changed, 477 insertions(+), 491 deletions(-) diff --git a/ui/scripts/ui-custom/dashboard.js b/ui/scripts/ui-custom/dashboard.js index e5ab1f1b955..d312e0605c0 100644 --- a/ui/scripts/ui-custom/dashboard.js +++ b/ui/scripts/ui-custom/dashboard.js @@ -8,7 +8,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// +// // Automatically generated by addcopyright.py at 04/03/2012 (function($, cloudStack) { cloudStack.uiCustom.dashboard = function() { @@ -44,14 +44,14 @@ maximizeIfSelected: true, complete: function($newPanel) { $newPanel.detailView($.extend(true, {}, - cloudStack.sections.dashboard.admin.zoneDetailView, - { - $browser: $browser, - context: $.extend(true, {}, cloudStack.context, { - physicalResources: [{ id: item.zoneID }] - }) - } - )); + cloudStack.sections.dashboard.admin.zoneDetailView, + { + $browser: $browser, + context: $.extend(true, {}, cloudStack.context, { + physicalResources: [{ id: item.zoneID }] + }) + } + )); } }); }); @@ -59,7 +59,7 @@ $.each(item, function(arrayKey, arrayValue) { if (!arrayValue) arrayValue = ''; - + var $arrayElem = $li.find('[data-list-item=' + arrayKey + ']'); $arrayElem.each(function() { diff --git a/ui/scripts/ui-custom/enableStaticNAT.js b/ui/scripts/ui-custom/enableStaticNAT.js index a075e0f1dc9..ef645f43f0e 100644 --- a/ui/scripts/ui-custom/enableStaticNAT.js +++ b/ui/scripts/ui-custom/enableStaticNAT.js @@ -8,7 +8,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// +// // Automatically generated by addcopyright.py at 04/03/2012 (function(cloudStack, $) { cloudStack.uiCustom.enableStaticNAT = function(args) { @@ -74,12 +74,12 @@ 'input[type=radio]:checked, input[type=checkbox]:checked' ).size()) { cloudStack.dialog.notice({ message: _l('message.select.instance')}); - + return false; } var complete = args.complete; - + $dataList.fadeOut(function() { action({ context: $.extend(true, {}, context, { diff --git a/ui/scripts/ui-custom/installWizard.js b/ui/scripts/ui-custom/installWizard.js index 27687cee7b0..bf837d9dba4 100644 --- a/ui/scripts/ui-custom/installWizard.js +++ b/ui/scripts/ui-custom/installWizard.js @@ -8,7 +8,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// +// // Automatically generated by addcopyright.py at 04/03/2012 (function($, cloudStack) { var installWizard = function(args) { @@ -217,7 +217,7 @@ $('

').html(_l('label.installWizard.title')), $('

').html(_l('label.installWizard.subtitle')) ) - ); + ); }, /** @@ -232,7 +232,7 @@ */ nextButton: function(label, options) { var $button = options && !options.type ? - $('
').addClass('button goTo').html(label) : + $('
').addClass('button goTo').html(label) : $('').attr({ type: 'submit' }).addClass('button goTo').val(label); return $button; @@ -307,12 +307,12 @@ return false; }); - + return $intro.append($title, $subtitle, $copy, $continue); }, - + intro: function(args) { var $intro = $('
').addClass('intro what-is-cloudstack'); var $title = $('
').addClass('title').html(_l('label.what.is.cloudstack')); @@ -519,7 +519,7 @@ select: function(args) { args.response.success({ data: [ { id: 'XenServer', description: 'XenServer' }, - { id: 'KVM', description: 'KVM'} + { id: 'KVM', description: 'KVM'} ]}); } }, @@ -666,9 +666,9 @@ launchInfo: function(args) { var $intro = $('
').addClass('intro'); var $title = $('
').addClass('title') - .html(_l('label.congratulations')); + .html(_l('label.congratulations')); var $subtitle = $('
').addClass('subtitle') - .html(_l('label.installWizard.click.launch')); + .html(_l('label.installWizard.click.launch')); var $continue = elems.nextButton(_l('label.launch')); var $prev = elems.prevButton(_l('label.back')); diff --git a/ui/scripts/ui-custom/instanceWizard.js b/ui/scripts/ui-custom/instanceWizard.js index ec7870520aa..4cb42477c80 100644 --- a/ui/scripts/ui-custom/instanceWizard.js +++ b/ui/scripts/ui-custom/instanceWizard.js @@ -8,7 +8,7 @@ // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. -// +// // Automatically generated by addcopyright.py at 04/03/2012 (function($, cloudStack) { /** @@ -82,39 +82,39 @@ var id = this[fields.id]; var $select = $('
') - .addClass('select') - .append( - $('') - .attr({ - type: (function(type) { - return type ? type : 'radio'; - })(options ? options.type : null), - name: name, - 'wizard-field': options['wizard-field'] - }) - .val(id) - .click(function() { - var $radio = $(this).closest('.select').find('input[type=radio]'); + .addClass('select') + .append( + $('') + .attr({ + type: (function(type) { + return type ? type : 'radio'; + })(options ? options.type : null), + name: name, + 'wizard-field': options['wizard-field'] + }) + .val(id) + .click(function() { + var $radio = $(this).closest('.select').find('input[type=radio]'); - if ($radio.is(':checked') && !$(this).is(':checked')) { - if (!$radio.closest('.select').index()) { - return false; - } else { - $radio - .closest('.select') - .siblings().filter(':first') - .find('input[type=radio]').click(); - } - } + if ($radio.is(':checked') && !$(this).is(':checked')) { + if (!$radio.closest('.select').index()) { + return false; + } else { + $radio + .closest('.select') + .siblings().filter(':first') + .find('input[type=radio]').click(); + } + } - return true; - }) - ) - .append( - $('
').addClass('select-desc') - .append($('
').addClass('name').html(this[fields.name])) - .append($('
').addClass('desc').html(this[fields.desc])) - ); + return true; + }) + ) + .append( + $('
').addClass('select-desc') + .append($('
').addClass('name').html(this[fields.name])) + .append($('
').addClass('desc').html(this[fields.desc])) + ); $selects.append($select); @@ -195,7 +195,7 @@ 'select-iso': function($step, formData) { var originalValues = function(formData) { var $inputs = $step.find('.wizard-step-conditional:visible') - .find('input[type=radio]'); + .find('input[type=radio]'); var $selected = $inputs.filter(function() { return $(this).val() == formData.templateid; }); @@ -235,12 +235,12 @@ // Create hypervisor select $selects.find('input').bind('click', function() { var $select = $(this).closest('.select'); - - //$select.siblings().removeClass('selected').find('.hypervisor').remove(); //SelectISO has 3 tabs now. This line only remove hypervisor div in the same tab, not enough. The following 3 lines will remove hypervisor div in all of 3 tabs. - $("#instance-wizard-featured-isos .select-container div.selected").removeClass('selected').find('div.hypervisor').remove(); - $("#instance-wizard-community-isos .select-container div.selected").removeClass('selected').find('div.hypervisor').remove(); - $("#instance-wizard-my-isos .select-container div.selected").removeClass('selected').find('div.hypervisor').remove(); - + + //$select.siblings().removeClass('selected').find('.hypervisor').remove(); //SelectISO has 3 tabs now. This line only remove hypervisor div in the same tab, not enough. The following 3 lines will remove hypervisor div in all of 3 tabs. + $("#instance-wizard-featured-isos .select-container div.selected").removeClass('selected').find('div.hypervisor').remove(); + $("#instance-wizard-community-isos .select-container div.selected").removeClass('selected').find('div.hypervisor').remove(); + $("#instance-wizard-my-isos .select-container div.selected").removeClass('selected').find('div.hypervisor').remove(); + $select.addClass('selected').append( $('
').addClass('hypervisor') .append($('