CheckStyle cleanup
authorColeman Watts <coleman@civicrm.org>
Mon, 9 Feb 2015 15:24:52 +0000 (10:24 -0500)
committerColeman Watts <coleman@civicrm.org>
Mon, 9 Feb 2015 15:24:52 +0000 (10:24 -0500)
CRM/Contact/Page/AJAX.php
js/Common.js

index 256c1f8be921635b9e84bd7544a1f523da3e6cfe..81aef571076d655c6493e74f3244b99ebced784c 100644 (file)
@@ -975,7 +975,7 @@ LIMIT {$offset}, {$rowCount}
           $mergeParams .= "&gid={$gid}";
         }
 
-        $searchRows[$mainId]['actions'] = '<a class="action-item crm-hover-button" href="'. CRM_Utils_System::url('civicrm/contact/merge', $mergeParams) . '">' . ts('merge') . '</a>';
+        $searchRows[$mainId]['actions'] = '<a class="action-item crm-hover-button" href="' . CRM_Utils_System::url('civicrm/contact/merge', $mergeParams) . '">' . ts('merge') . '</a>';
         $searchRows[$mainId]['actions'] .= "<a class='action-item crm-hover-button crm-notDuplicate' href='#' onClick=\"processDupes( {$main['srcID']}, {$main['dstID']}, 'dupe-nondupe', 'dupe-listing'); return false;\">" . ts('not a duplicate') . "</a>";
       }
       else {
index 04d471e42194673e133f0ee3f3b212b7233aed44..3f87471d95866736ffdec5c68ba8ac6625eb1815 100644 (file)
@@ -1,5 +1,5 @@
 // https://civicrm.org/licensing
-var CRM = CRM || {};
+if (!CRM) CRM = {};
 var cj = CRM.$ = jQuery;
 CRM._ = _;
 
@@ -17,8 +17,8 @@ function ts(text, params) {
   if (d && CRM[d] && CRM[d][text]) {
     text = CRM[d][text];
   }
-  else if (CRM['strings'][text]) {
-    text = CRM['strings'][text];
+  else if (CRM.strings[text]) {
+    text = CRM.strings[text];
   }
   if (typeof(params) === 'object') {
     for (var i in params) {
@@ -44,7 +44,7 @@ function ts(text, params) {
  * @param elementType Value to set display style to for showBlocks (e.g. 'block' or 'table-row' or ...)
  */
 function on_load_init_blocks(showBlocks, hideBlocks, elementType) {
-  if (elementType == null) {
+  if (!elementType) {
     elementType = 'block';
   }
 
@@ -54,7 +54,7 @@ function on_load_init_blocks(showBlocks, hideBlocks, elementType) {
   for (i = 0; i < showBlocks.length; i++) {
     myElement = document.getElementById(showBlocks[i]);
     /* getElementById returns null if element id doesn't exist in the document */
-    if (myElement != null) {
+    if (myElement) {
       myElement.style.display = elementType;
     }
     else {
@@ -66,7 +66,7 @@ function on_load_init_blocks(showBlocks, hideBlocks, elementType) {
   for (i = 0; i < hideBlocks.length; i++) {
     myElement = document.getElementById(hideBlocks[i]);
     /* getElementById returns null if element id doesn't exist in the document */
-    if (myElement != null) {
+    if (myElement) {
       myElement.style.display = 'none';
     }
     else {
@@ -200,6 +200,7 @@ CRM.strings = CRM.strings || {};
 
 (function ($, _, undefined) {
   "use strict";
+  /* jshint validthis: true */
 
   // Theme classes for unattached elements
   $.fn.select2.defaults.dropdownCssClass = $.ui.dialog.prototype.options.dialogClass = 'crm-container';
@@ -1049,12 +1050,12 @@ CRM.strings = CRM.strings || {};
       expires: 0
     };
     if ($(this).length) {
-      if (title == '') {
+      if (title === '') {
         var label = $('label[for="' + $(this).attr('name') + '"], label[for="' + $(this).attr('id') + '"]').not('[generated=true]');
         if (label.length) {
           label.addClass('crm-error');
           var $label = label.clone();
-          if (text == '' && $('.crm-marker', $label).length > 0) {
+          if (text === '' && $('.crm-marker', $label).length > 0) {
             text = $('.crm-marker', $label).attr('title');
           }
           $('.crm-marker', $label).remove();