From e1f05567cc7067c6e0c91f13b097cca00b97d676 Mon Sep 17 00:00:00 2001 From: eileen Date: Mon, 13 May 2013 14:28:03 +1200 Subject: [PATCH] CRM-12595 fix formatting in js files --- js/Audit/audit.js | 42 ++++++++++++++++---------------- js/jquery/jquery.crmasmselect.js | 10 ++++---- js/jquery/jquery.crmeditable.js | 14 +++++------ js/jquery/jquery.crmtemplate.js | 7 +++--- 4 files changed, 36 insertions(+), 37 deletions(-) diff --git a/js/Audit/audit.js b/js/Audit/audit.js index c505d4be2a..7b3eabe28f 100644 --- a/js/Audit/audit.js +++ b/js/Audit/audit.js @@ -26,28 +26,28 @@ function selectActivity(i) { - // deselect current selection - j = document.forms["Report"].currentSelection.value; - ele = document.getElementById("civicase-audit-activity-" + j); - ele.className = "activity"; - ele = document.getElementById("civicase-audit-header-" + j); - ele.style.display = "none"; - ele = document.getElementById("civicase-audit-body-" + j); - ele.style.display = "none"; + // deselect current selection + j = document.forms["Report"].currentSelection.value; + ele = document.getElementById("civicase-audit-activity-" + j); + ele.className = "activity"; + ele = document.getElementById("civicase-audit-header-" + j); + ele.style.display = "none"; + ele = document.getElementById("civicase-audit-body-" + j); + ele.style.display = "none"; - if ( i != 1 ) { - cj('#civicase-audit-activity-1').removeClass('activity selected'); - cj('#civicase-audit-activity-1').addClass('activity'); - cj('#civicase-audit-header-1').css({"display":"none"}); - cj('#civicase-audit-body-1').css({"display":"none"}); + if ( i != 1 ) { + cj('#civicase-audit-activity-1').removeClass('activity selected'); + cj('#civicase-audit-activity-1').addClass('activity'); + cj('#civicase-audit-header-1').css({"display":"none"}); + cj('#civicase-audit-body-1').css({"display":"none"}); } - // select selected one - ele = document.getElementById("civicase-audit-activity-" + i); - ele.className = "activity selected"; - ele = document.getElementById("civicase-audit-header-" + i); - ele.style.display = "block"; - ele = document.getElementById("civicase-audit-body-" + i); - ele.style.display = "block"; - document.forms["Report"].currentSelection.value = i; + // select selected one + ele = document.getElementById("civicase-audit-activity-" + i); + ele.className = "activity selected"; + ele = document.getElementById("civicase-audit-header-" + i); + ele.style.display = "block"; + ele = document.getElementById("civicase-audit-body-" + i); + ele.style.display = "block"; + document.forms["Report"].currentSelection.value = i; } diff --git a/js/jquery/jquery.crmasmselect.js b/js/jquery/jquery.crmasmselect.js index 2fd084cbd4..902e09907f 100644 --- a/js/jquery/jquery.crmasmselect.js +++ b/js/jquery/jquery.crmasmselect.js @@ -1,9 +1,9 @@ /* * Alternate Select Multiple (asmSelect) 1.0.4a beta - jQuery Plugin * http://www.ryancramer.com/projects/asmselect/ - * + * * Copyright (c) 2009 by Ryan Cramer - http://www.ryancramer.com - * + * * Dual licensed under the MIT (MIT-LICENSE.txt) * and GPL (GPL-LICENSE.txt) licenses. * @@ -17,11 +17,11 @@ listType: 'ul', // Ordered list 'ol', or unordered list 'ul' sortable: false, // Should the list be sortable? - highlight: false, // Use the highlight feature? + highlight: false, // Use the highlight feature? animate: false, // Animate the the adding/removing of items in the list? addItemTarget: 'bottom', // Where to place new selected items in list: top or bottom hideWhenAdded: false, // Hide the option when added to the list? works only in FF - debugMode: false, // Debug mode keeps original select visible + debugMode: false, // Debug mode keeps original select visible removeLabel: 'X', // Text used in the "remove" link highlightAddedLabel: 'Added: ', // Text that precedes highlight of added item @@ -40,7 +40,7 @@ respectParents: false // Force selection of "parent" option items }; - $.extend(options, customOptions); + $.extend(options, customOptions); return this.each(function(index) { diff --git a/js/jquery/jquery.crmeditable.js b/js/jquery/jquery.crmeditable.js index a963a36eab..fea1a794f7 100644 --- a/js/jquery/jquery.crmeditable.js +++ b/js/jquery/jquery.crmeditable.js @@ -72,8 +72,8 @@ // param in : a dom object that contains the field name as a class crmf-xxx var getFieldName = function (field) { if ($(field).data('field')) { - return $(field).data('field'); - } + return $(field).data('field'); + } var fieldName=field.className.match(/crmf-(\S*)/)[1]; if (!fieldName) { console && console.log && console.log("Couldn't get the crm-editable field name to modify. You need to set crmf-{field_name} or data-{field_name}"); @@ -160,13 +160,13 @@ console && console.log && console.log("Couldn't get the entity id. You need to set class='crm-entity' id='{entityName}-{id}'"); formSettings.entity=e[1]; formSettings.id=e[2]; - } + } if ($i.hasClass('crm-dialog')) { $i.click (function () { var $n=$('
Loading
').appendTo('body'); $n.dialog ({modal:true,width:500}); $n.crmForm (formSettings); - return false; + return false; }); } else { $i.click (function () { @@ -178,7 +178,7 @@ return false; }; $n.crmForm (formSettings); - return false; + return false; }); } return; @@ -297,7 +297,7 @@ $this.html("
Saving...
"); return true; }, - success:function(response) { + success:function(response) { if (response.indexOf('crm-error') >= 0) { // we got an error, re-display the page $this.html(response); formLoaded(target); @@ -308,7 +308,7 @@ settings.success(response); } } - }).append(''+destination).trigger('load'); + }).append(''+destination).trigger('load'); settings.load(target); }; diff --git a/js/jquery/jquery.crmtemplate.js b/js/jquery/jquery.crmtemplate.js index 9f68ba9366..a91433406f 100644 --- a/js/jquery/jquery.crmtemplate.js +++ b/js/jquery/jquery.crmtemplate.js @@ -2,7 +2,7 @@ /* applies the tpl (a selector of a template) to the data and puts it as the html of the object * it triggers two events - * assign (to be able to alter the data) + * assign (to be able to alter the data) * render (after the html has been added to the dom) to allow jquery event initialisations * options.method = html (or after or before or any html injection jquery method * @@ -11,7 +11,7 @@ $.fn.crmTemplate = function(tpl,data,options) { var settings = $.extend( { - 'method': 'html', + 'method': 'html', }, options); var mustacheTpl = $(tpl); @@ -20,8 +20,7 @@ return this.each(function() { //$(this).html($.mustache(mustacheTpl.html(),data)).trigger('render',data); $(this)[settings.method]($.mustache(mustacheTpl.html(),data)).trigger('render',data); - //mustacheTpl.trigger ('render',data); - + //mustacheTpl.trigger ('render',data); }); }; })( jQuery ); -- 2.25.1