Legacy js cleanup - change cj to $ within closures
authorColeman Watts <coleman@civicrm.org>
Fri, 8 Aug 2014 14:30:26 +0000 (15:30 +0100)
committerColeman Watts <coleman@civicrm.org>
Fri, 8 Aug 2014 16:13:47 +0000 (17:13 +0100)
85 files changed:
CRM/Admin/Form/Setting/Mapping.php
CRM/Contribute/Form/Contribution.php
CRM/Pledge/Form/Pledge.php
templates/CRM/Activity/Form/Activity.tpl
templates/CRM/Activity/Form/Search.tpl
templates/CRM/Activity/Form/Search/Common.tpl
templates/CRM/Admin/Form/Preferences/Display.tpl
templates/CRM/Admin/Form/ScheduleReminders.tpl
templates/CRM/Admin/Form/Setting/Mapping.tpl
templates/CRM/Admin/Form/Setting/Smtp.tpl
templates/CRM/Admin/Page/Extensions.tpl
templates/CRM/Admin/Page/MessageTemplates.tpl
templates/CRM/Admin/Page/Navigation.tpl
templates/CRM/Admin/Page/Tag.tpl
templates/CRM/Batch/Form/Entry.js
templates/CRM/Batch/Form/Entry.tpl
templates/CRM/Block/RecentlyViewed.tpl
templates/CRM/Campaign/Form/Gotv.tpl
templates/CRM/Campaign/Form/Petition.tpl
templates/CRM/Campaign/Form/Petition/Block.tpl
templates/CRM/Campaign/Form/ResultOptions.tpl
templates/CRM/Campaign/Form/Search/Campaign.tpl
templates/CRM/Campaign/Form/Search/Petition.tpl
templates/CRM/Campaign/Form/Search/Survey.tpl
templates/CRM/Campaign/Form/Survey/Main.tpl
templates/CRM/Case/Form/Activity.tpl
templates/CRM/Case/Form/ActivityChangeStatusJs.tpl
templates/CRM/Contact/Form/Edit/CommunicationPreferences.tpl
templates/CRM/Contact/Form/Edit/Lock.tpl
templates/CRM/Contact/Form/Inline/CommunicationPreferences.tpl
templates/CRM/Contact/Form/Merge.tpl
templates/CRM/Contact/Form/Search/Criteria/Basic.tpl
templates/CRM/Contact/Form/Search/Criteria/ChangeLog.tpl
templates/CRM/Contact/Form/Search/Criteria/Location.tpl
templates/CRM/Contact/Form/ShareAddress.tpl
templates/CRM/Contact/Import/Form/MapTable.tpl
templates/CRM/Contact/Page/Dashlet.tpl
templates/CRM/Contribute/Form/AdditionalInfo/Premium.tpl
templates/CRM/Contribute/Form/Contribution.tpl
templates/CRM/Contribute/Form/Contribution/MembershipBlock.tpl
templates/CRM/Contribute/Form/Contribution/OnBehalfOf.tpl
templates/CRM/Contribute/Form/Contribution/PremiumBlock.tpl
templates/CRM/Contribute/Form/ContributionPage/AddProduct.tpl
templates/CRM/Contribute/Form/ContributionPage/Amount.tpl
templates/CRM/Contribute/Form/ContributionPage/Premium.tpl
templates/CRM/Contribute/Page/PaymentInfo.tpl
templates/CRM/Core/BillingBlock.tpl
templates/CRM/Custom/Form/ChangeFieldType.tpl
templates/CRM/Custom/Form/Group.tpl
templates/CRM/Event/Form/EventFees.tpl
templates/CRM/Event/Form/ManageEvent/Fee.tpl
templates/CRM/Event/Form/ManageEvent/ScheduleReminders.tpl
templates/CRM/Event/Form/Participant.tpl
templates/CRM/Event/Form/ParticipantFeeSelection.tpl
templates/CRM/Event/Form/Task/Batch.tpl
templates/CRM/Financial/Form/Export.tpl
templates/CRM/Mailing/Form/Count.tpl
templates/CRM/Mailing/Form/InsertTokens.tpl
templates/CRM/Mailing/Form/Schedule.tpl
templates/CRM/Mailing/Form/Settings.tpl
templates/CRM/Mailing/Page/Event.tpl
templates/CRM/Member/Form/Membership.tpl
templates/CRM/Member/Form/MembershipBlock.tpl
templates/CRM/Member/Form/MembershipRenewal.tpl
templates/CRM/Member/Form/MembershipType.tpl
templates/CRM/Pledge/Form/Pledge.tpl
templates/CRM/Price/Form/LineItem.tpl
templates/CRM/Profile/Form/Dynamic.tpl
templates/CRM/Profile/Form/Search.tpl
templates/CRM/Queue/Page/Runner.tpl
templates/CRM/Report/Form/Criteria.tpl
templates/CRM/Report/Form/Event/ParticipantListing.tpl
templates/CRM/Report/Form/Instance.tpl
templates/CRM/Report/Form/Layout/Graph.tpl
templates/CRM/SMS/Form/Schedule.tpl
templates/CRM/UF/Form/Block.tpl
templates/CRM/UF/Form/Field.tpl
templates/CRM/UF/Page/Group.tpl
templates/CRM/common/TrackingFields.tpl
templates/CRM/common/additionalBlocks.tpl
templates/CRM/common/batchCopy.tpl
templates/CRM/common/jcalendar.tpl
templates/CRM/common/jsortable.tpl
templates/CRM/common/paymentBlock.tpl
tools/extensions/org.civicrm.search.activity/templates/ActivitySearch.tpl

index 5fd5e83a18b12cdfbf3374115caa534b34e0c233..e368e64cacbe489cb64c34f02cc86f93877af62c 100644 (file)
@@ -50,9 +50,9 @@ class CRM_Admin_Form_Setting_Mapping extends CRM_Admin_Form_Setting {
 
     $map = CRM_Core_SelectValues::mapProvider();
     $geo = CRM_Core_SelectValues::geoProvider();
-    $this->addElement('select', 'mapProvider', ts('Mapping Provider'), array('' => '- select -') + $map, array('onChange' => 'showHideMapAPIkey( this.value );'));
+    $this->addElement('select', 'mapProvider', ts('Mapping Provider'), array('' => '- select -') + $map, array('class' => 'crm-select2'));
     $this->add('text', 'mapAPIKey', ts('Map Provider Key'), NULL);
-    $this->addElement('select', 'geoProvider', ts('Geocoding Provider'), array('' => '- select -') + $geo);
+    $this->addElement('select', 'geoProvider', ts('Geocoding Provider'), array('' => '- select -') + $geo, array('class' => 'crm-select2'));
     $this->add('text', 'geoAPIKey', ts('Geo Provider Key'), NULL);
 
     parent::buildQuickForm();
index 8ce805bc96182ecad9ed6e85b3f3d16ac4a31f6a..cfefe62ec1350d9bbff73cddf1892aa13cd33ed8 100644 (file)
@@ -667,7 +667,7 @@ class CRM_Contribute_Form_Contribution extends CRM_Contribute_Form_AbstractEditP
     $this->assign('entityID', $this->_id);
 
     if ($this->_context == 'standalone') {
-      $this->addEntityRef('contact_id', ts('Contact'), array('create' => TRUE), TRUE);
+      $this->addEntityRef('contact_id', ts('Contact'), array('create' => TRUE, 'api' => array('extra' => array('email'))), TRUE);
     }
 
     $attributes = CRM_Core_DAO::getAttribute('CRM_Contribute_DAO_Contribution');
index a847c6556c2a614eb84db4321a78c6bfd71f5431..6db57883b363a6f6f8d7cecbf2347ad436750cfb 100644 (file)
@@ -247,7 +247,7 @@ class CRM_Pledge_Form_Pledge extends CRM_Core_Form {
     }
 
     if ($this->_context == 'standalone') {
-      $this->addEntityRef('contact_id', ts('Contact'), array('create' => TRUE), TRUE);
+      $this->addEntityRef('contact_id', ts('Contact'), array('create' => TRUE, 'api' => array('extra' => array('email'))), TRUE);
     }
 
     $showAdditionalInfo = FALSE;
index 4436b894e9f878abd9700602f4ad2c678635b264..62bb3afe51f2de569e7edc0f0859ebec97b81314 100644 (file)
       {literal}
         <script type="text/javascript">
           CRM.$(function($) {
-            cj('.crm-accordion-body').each( function() {
+            $('.crm-accordion-body').each( function() {
               //open tab if form rule throws error
-              if ( cj(this).children( ).find('span.crm-error').text( ).length > 0 ) {
-                cj(this).parent('.collapsed').crmAccordionToggle();
+              if ( $(this).children( ).find('span.crm-error').text( ).length > 0 ) {
+                $(this).parent('.collapsed').crmAccordionToggle();
               }
             });
             $('#swap_target_assignee').click(function() {
index 5a458693f425e797202fea68d631c48a70952aa1..c0fe4cbeccd997464cdf80cc15d73b92e72c63bf 100644 (file)
 {literal}
   <script type="text/javascript">
     CRM.$(function($) {
-      var roleId = cj('input[name=activity_role]:checked', '#Search').val();
+      var roleId = $('input[name=activity_role]:checked', '#Search').val();
       if (roleId) {
-        cj('.description .option-' + roleId).show();
+        $('.description .option-' + roleId).show();
       }
 
+      $('[name=activity_role]:input').change(function() {
+        $('.description .contact-name-option').hide();
+        if ($(this).is(':checked')) {
+          $('.description .option-' + $(this).val()).show();
+        }
+      }).change();
     });
 
-    cj('[name=activity_role]:input').change(function () {
-      cj('.description .contact-name-option').hide();
-      if (cj(this).is(':checked')) {
-        cj('.description .option-' + cj(this).val()).show();
-      }
-    }).change();
 
   </script>
 {/literal}
index d775f68390b177b8f150439f6e6c635dbcd11c86..a2e32dcc685353867a11481f4e4ccb0f60da23d9 100644 (file)
@@ -148,17 +148,17 @@ campaignContext="componentSearch" campaignTrClass='' campaignTdClass=''}
   CRM.$(function($) {
     //Searchable activity custom fields which extend ALL activity types are always displayed in the form
     //hence hide remaining activity custom data
-    cj('#activityCustom').children( ).each( function( ) {
-      cj('#'+cj(this).attr('id')+' div').each( function( ) {
-        if (cj(this).children( ).attr('id')) {
-          var activityCustomdataGroup = cj(this).attr('id');  //div id
-          var fieldsetId = cj(this).children( ).attr('id');  // fieldset id
+    $('#activityCustom').children( ).each( function( ) {
+      $('#'+$(this).attr('id')+' div').each( function( ) {
+        if ($(this).children( ).attr('id')) {
+          var activityCustomdataGroup = $(this).attr('id');  //div id
+          var fieldsetId = $(this).children( ).attr('id');  // fieldset id
           var splitFieldsetId = fieldsetId.split("\ 1");
           var splitFieldsetLength = splitFieldsetId.length;  //length of fieldset
           var show = 0;
           //setdefault activity custom data group if corresponding activity type is checked
-          cj('#Activity div').each(function( ) {
-            var checkboxId = cj(this).children().attr('id');  //activity type element name
+          $('#Activity div').each(function( ) {
+            var checkboxId = $(this).children().attr('id');  //activity type element name
             if (document.getElementById( checkboxId ).checked ) {
               var element = checkboxId.split('[');
               var splitElement = element[1].split(']');  // get activity type id
@@ -173,16 +173,12 @@ campaignContext="componentSearch" campaignTrClass='' campaignTdClass=''}
             }
           });
           if (show < 1) {
-            cj('#'+activityCustomdataGroup).hide( );
+            $('#'+activityCustomdataGroup).hide( );
           }
         }
       });
     });
   });
-</script>
-
-
-<script type="text/javascript">
 
   function showCustomData(chkbox) {
   if (document.getElementById(chkbox).checked) {
index faf3b1c3834a63915ac1375a0dd42fe3b1d92eb6..5b61d2c680ba3e0af0f04966e7473552412ec35b 100644 (file)
   {literal}
     <script type="text/javascript">
       CRM.$(function($) {
-        cj("#contactEditBlocks").sortable({
-          placeholder: 'ui-state-highlight',
-          update: getSorting
-        });
-        cj("#contactEditOptions").sortable({
-          placeholder: 'ui-state-highlight',
-          update: getSorting
-        });
-      });
-
-      function getSorting(e, ui) {
-        var params = new Array();
-        var y = 0;
-        var items = cj("#contactEditBlocks li");
-        if (items.length > 0) {
-          for (var y = 0; y < items.length; y++) {
-            var idState = items[y].id.split('-');
-            params[y + 1] = idState[1];
+        function getSorting(e, ui) {
+          var params = [];
+          var y = 0;
+          var items = $("#contactEditBlocks li");
+          if (items.length > 0) {
+            for (var y = 0; y < items.length; y++) {
+              var idState = items[y].id.split('-');
+              params[y + 1] = idState[1];
+            }
           }
-        }
 
-        items = cj("#contactEditOptions li");
-        if (items.length > 0) {
-          for (var x = 0; x < items.length; x++) {
-            var idState = items[x].id.split('-');
-            params[x + y + 1] = idState[1];
+          items = $("#contactEditOptions li");
+          if (items.length > 0) {
+            for (var x = 0; x < items.length; x++) {
+              var idState = items[x].id.split('-');
+              params[x + y + 1] = idState[1];
+            }
           }
+          $('#contact_edit_preferences').val(params.toString());
         }
-        cj('#contact_edit_preferences').val(params.toString());
-      }
+        
+        $("#contactEditBlocks, #contactEditOptions").sortable({
+          placeholder: 'ui-state-highlight',
+          update: getSorting
+        });
+      });
     </script>
   {/literal}
 {/if}
index 1dfe67dfc1fd5da7561e3a6b2ad82c27a921f478..fb8cbae96f560d6983663612204a9d7def300f8f 100644 (file)
     var entityMapping = eval({/literal}{$entityMapping}{literal});
     var recipientMapping = eval({/literal}{$recipientMapping}{literal});
 
-    cj('#absolute_date_display').change( function() {
-        if(cj('#absolute_date_display').val()) {
-            cj('#relativeDate').hide();
-            cj('#relativeDateRepeat').hide();
-            cj('#repeatFields').hide();
-        } else {
-            cj('#relativeDate').show();
-            cj('#relativeDateRepeat').show();
-        }
-    });
 
     CRM.$(function($) {
-        if (cj('#absolute_date_display').val()) {
-            cj('#relativeDate').hide();
-            cj('#relativeDateRepeat').hide();
-            cj('#repeatFields').hide();
-         }
+      $('#absolute_date_display').change(function() {
+        if($('#absolute_date_display').val()) {
+          $('#relativeDate').hide();
+          $('#relativeDateRepeat').hide();
+          $('#repeatFields').hide();
+        } else {
+          $('#relativeDate').show();
+          $('#relativeDateRepeat').show();
+        }
+      });
+      
+      if ($('#absolute_date_display').val()) {
+        $('#relativeDate, #relativeDateRepeat, #repeatFields').hide();
+      }
 
-         cj('#entity_0').change( function( ) {
-              buildSelect("start_action_date");
+      $('#entity_0').change( function( ) {
+        buildSelect("start_action_date");
         buildSelect("end_date");
         buildSelect1("recipient");
-         });
-     });
+        showHideLimitTo();
+      });
 
-  CRM.$(function($) {
-    loadMsgBox();
-    cj('#mode').change(function () {
       loadMsgBox();
-    });
+      $('#mode').change(loadMsgBox);
 
-    showHideLimitTo();
-    cj('#entity_0').change(function () {
       showHideLimitTo();
+
+      if ($('#is_recipient_listing').val()) {
+        $('#recipientList').show();
+      }
+      else {
+        $('#recipientList').hide();
+      }
+      $('#recipient').change(populateRecipient);
     });
-  });
 
   function loadMsgBox() {
     if (cj('#mode').val() == 'Email' || cj('#mode').val() == 0){
     }
   }
 
-  CRM.$(function($) {
-    if (cj('#is_recipient_listing').val()) {
-      cj('#recipientList').show();
-    }
-    else {
-      cj('#recipientList').hide();
-    }
-    cj('#recipient').change(function () {
-      populateRecipient();
-    });
-  });
-
   function populateRecipient( ) {
     var recipient = cj("#recipient option:selected").val();
     var entity = cj("#entity_0 option:selected").val();
index bdb6e786c1e76abbe5d113a38eb27ac3c4be675c..b48a52d6cc25c95d3aa290eb28cab1b81ca317a9 100644 (file)
 {literal}
 <script type="text/javascript">
 CRM.$(function($) {
-  showHideMapAPIkey( cj('#mapProvider').val( ) );
-});
-function showHideMapAPIkey( mapProvider ) {
-  if ( mapProvider && ( mapProvider == 'OpenStreetMaps' ) ) {
-    cj('#Mapping tr.crm-map-form-block-mapAPIKey').hide( );
-  } else {
-    cj('#Mapping tr.crm-map-form-block-mapAPIKey').show( );
+  function showHideMapAPIkey() {
+    var mapProvider = $(this).val();
+    if ( !mapProvider || ( mapProvider === 'OpenStreetMaps' ) ) {
+      $('#Mapping tr.crm-map-form-block-mapAPIKey').hide( );
+    } else {
+      $('#Mapping tr.crm-map-form-block-mapAPIKey').show( );
+    }
   }
-}
+  $('#mapProvider').each(showHideMapAPIkey).change(showHideMapAPIkey);
+});
 </script>
 {/literal}
index bf3d06c09b761a5d7f102860e21ec2f814f2e51f..db97144c8cfe9f6ff6e2fdee42a229e0a9e5133a 100644 (file)
 {literal}
 <script type="text/javascript">
     CRM.$(function($) {
-      var mailSetting = cj("input[name='outBound_option']:checked").val( );
+      var mailSetting = $("input[name='outBound_option']:checked").val( );
 
       var archiveWarning = "{/literal}{ts escape='js'}WARNING: You are switching from a testing mode (Redirect to Database) to a live mode. Check Mailings > Archived Mailings, and delete any test mailings that are not in Completed status prior to running the mailing cron job for the first time. This will ensure that test mailings are not actually sent out.{/ts}{literal}"
 
-        showHideMailOptions( cj("input[name='outBound_option']:checked").val( ) ) ;
+        showHideMailOptions( $("input[name='outBound_option']:checked").val( ) ) ;
 
         function showHideMailOptions( value ) {
             switch( value ) {
               case "0":
-                cj("#bySMTP").show( );
-                cj("#bySendmail").hide( );
-                cj("#_qf_Smtp_refresh_test").show( );
+                $("#bySMTP").show( );
+                $("#bySendmail").hide( );
+                $("#_qf_Smtp_refresh_test").show( );
                 if (mailSetting == '5') {
                   alert(archiveWarning);
                 }
               break;
               case "1":
-                cj("#bySMTP").hide( );
-                cj("#bySendmail").show( );
-                cj("#_qf_Smtp_refresh_test").show( );
+                $("#bySMTP").hide( );
+                $("#bySendmail").show( );
+                $("#_qf_Smtp_refresh_test").show( );
                 if (mailSetting == '5') {
                   alert(archiveWarning);
                 }
               break;
               case "3":
-                cj('.mailoption').hide();
-                cj("#_qf_Smtp_refresh_test").show( );
+                $('.mailoption').hide();
+                $("#_qf_Smtp_refresh_test").show( );
                 if (mailSetting == '5') {
                   alert(archiveWarning);
                 }
               break;
               default:
-                cj("#bySMTP").hide( );
-                cj("#bySendmail").hide( );
-                cj("#_qf_Smtp_refresh_test").hide( );
+                $("#bySMTP").hide( );
+                $("#bySendmail").hide( );
+                $("#_qf_Smtp_refresh_test").hide( );
             }
         }
 
-        cj("input[name='outBound_option']").click( function( ) {
-            showHideMailOptions( cj(this).val( ) );
+        $("input[name='outBound_option']").click( function( ) {
+            showHideMailOptions( $(this).val( ) );
         });
     });
 
index bf7021136a40edf6388956f471466a1ed6e0b054..9f307940bc82fa3b8c99976cda65b69726df049b 100644 (file)
@@ -85,8 +85,8 @@
     {literal}
     <script type="text/javascript">
       CRM.$(function($) {
-          cj('.collapsed').click( function( ) {
-              var currentObj = cj( this );
+          $('.collapsed').click( function( ) {
+              var currentObj = $( this );
               if ( currentObj.hasClass( 'expanded') ) {
                   currentObj.removeClass( 'expanded' );
                   currentObj.parent( ).parent( ).next( ).hide( );
     {literal}
 
     CRM.$(function($) {
-      var tabIndex = cj('#tab_' + selectedTab).prevAll().length;
-      cj("#mainTabContainer").tabs({active: tabIndex});
-      cj(".crm-tab-button").addClass("ui-corner-bottom");
+      var tabIndex = $('#tab_' + selectedTab).prevAll().length;
+      $("#mainTabContainer").tabs({active: tabIndex});
+      $(".crm-tab-button").addClass("ui-corner-bottom");
     });
     {/literal}
     </script>
     {literal}
     <script type="text/javascript">
     CRM.$(function($) {
-      cj('.crm-extensions-refresh').click(function(event){
+      $('.crm-extensions-refresh').click(function(event){
         event.stopPropagation();
         CRM.alert('', '{/literal}{ts escape="js"}Refreshing...{/ts}{literal}', 'crm-msg-loading', {expires: 0});
         CRM.api('Extension', 'refresh', {}, {
index 23ea5bde5de0df86af08c2207b49980b5c253a4a..a779df5dfa955b2dd03cbc35c298a623887ed393 100644 (file)
     {if $selectedChild}selectedTab = '{$selectedChild}';{/if}
     {literal}
       CRM.$(function($) {
-        var tabIndex = cj('#tab_' + selectedTab).prevAll().length
-        cj("#mainTabContainer").tabs( {active: tabIndex} );
+        var tabIndex = $('#tab_' + selectedTab).prevAll().length
+        $("#mainTabContainer").tabs( {active: tabIndex} );
       });
     {/literal}
   </script>
index a058ff84b25fb2b586d2718c6d2a0a34b7727d6f..3fce13160c01f1d6cb35736a20db22546c38d6f4 100644 (file)
     }
   </style>
   <script type="text/javascript">
-  CRM.$(function($) {
-    cj("#navigation-tree").jstree({
-    plugins : [ "themes", "json_data", "dnd","ui", "crrm","contextmenu" ],
-    json_data  : {
-      ajax:{
-        dataType : "json",
-        url : {/literal}"{crmURL p='civicrm/ajax/menu' h=0 q='key='}{crmKey name='civicrm/ajax/menu'}"{literal}
-      },
-      progressive_render: true
-    },
-    themes: {
-      "theme": 'classic',
-      "dots": true,
-      "icons": false,
-      "url": CRM.config.resourceBase + 'packages/jquery/plugins/jstree/themes/classic/style.css'
-    },
-    rules : {
-      droppable : [ "tree-drop" ],
-      multiple : true,
-      deletable : "all",
-      draggable : "all"
-    },
-    crrm  :  {
-      move: {
-        check_move: function(m) {
-          var homeMenuId = {/literal}"{$homeMenuId}"{literal};
-          if ( cj( m.r[0] ).attr('id').replace("node_","") == homeMenuId ||
-            cj( m.o[0] ).attr('id').replace("node_","") == homeMenuId ) {
-            return false;
-          } else {
-            return true;
+    CRM.$(function($) {
+      $("#navigation-tree").jstree({
+        plugins: [ "themes", "json_data", "dnd","ui", "crrm","contextmenu" ],
+        json_data: {
+          ajax:{
+            dataType: "json",
+            url: {/literal}"{crmURL p='civicrm/ajax/menu' h=0 q='key='}{crmKey name='civicrm/ajax/menu'}"{literal}
+          },
+          progressive_render: true
+        },
+        themes: {
+          "theme": 'classic',
+          "dots": true,
+          "icons": false,
+          "url": CRM.config.resourceBase + 'packages/jquery/plugins/jstree/themes/classic/style.css'
+        },
+        rules: {
+          droppable: [ "tree-drop" ],
+          multiple: true,
+          deletable: "all",
+          draggable: "all"
+        },
+        crrm: {
+          move: {
+            check_move: function(m) {
+              var homeMenuId = {/literal}"{$homeMenuId}"{literal};
+              if ( $( m.r[0] ).attr('id').replace("node_","") == homeMenuId ||
+                $( m.o[0] ).attr('id').replace("node_","") == homeMenuId ) {
+                return false;
+              } else {
+                return true;
+              }
+            }
           }
-        }
-      }
-    },
-    contextmenu : {
-      items: {
-        create : false,
-          ccp : {
-            label   : "{/literal}{ts escape='js'}Edit{/ts}{literal}",
-            visible : function (node, obj) { if(node.length != 1) return false;
-              return obj.check("renameable", node); },
-            action  : function (node, obj) {
-              var nid = cj(node).prop('id');
-              var nodeID = nid.substr( 5 );
-              var editURL = {/literal}"{crmURL p='civicrm/admin/menu' h=0 q='action=update&reset=1&id='}"{literal} + nodeID;
-              CRM.loadForm(editURL).on('crmFormSuccess', function() {
-                cj("#navigation-tree").jstree('refresh');
-                cj("#reset-menu").show( );
-              });
-            },
-            submenu : false
+        },
+        contextmenu: {
+          items: {
+            create: false,
+            ccp: {
+              label : "{/literal}{ts escape='js'}Edit{/ts}{literal}",
+              visible: function (node, obj) { if(node.length != 1) return false;
+                return obj.check("renameable", node); },
+              action: function (node, obj) {
+                var nid = $(node).prop('id');
+                var nodeID = nid.substr( 5 );
+                var editURL = {/literal}"{crmURL p='civicrm/admin/menu' h=0 q='action=update&reset=1&id='}"{literal} + nodeID;
+                CRM.loadForm(editURL).on('crmFormSuccess', function() {
+                  $("#navigation-tree").jstree('refresh');
+                  $("#reset-menu").show( );
+                });
+              },
+              submenu: false
+            }
           }
-      }
-    }
-
-    }).bind("rename.jstree", function ( e,node ) {
-      var nodeID  = node.rslt.obj.attr('id').replace("node_","");
-      var newName = node.rslt.new_name;
-      var postURL = {/literal}"{crmURL p='civicrm/ajax/menutree' h=0 q='key='}{crmKey name='civicrm/ajax/menutree'}"{literal};
-      cj.get( postURL + '&type=rename&id=' + nodeID + '&data=' + newName,
-        function (data) {
-          cj("#reset-menu").show( );
         }
-      );
-
-    }).bind("remove.jstree", function ( e,node ) {
-      var menuName  = node.rslt.obj.find('a').first( ).text( );
-      var nodeID  = node.rslt.obj.attr('id').replace("node_","");
 
-      // don't allow deleting of home
-      var homeMenuId = {/literal}"{$homeMenuId}"{literal};
-      if ( nodeID == homeMenuId ) {
-        var cannotDeleteMsg = {/literal}"{ts escape='js'}You cannot delete this menu item:{/ts}" + " "{literal} + menuName;
-        CRM.alert( cannotDeleteMsg, {/literal}"{ts escape='js'}Cannot Delete{/ts}"{literal} );
-        cj("#navigation-tree").jstree('refresh');
-        return false;
-      }
-      var deleteMsg = {/literal}"{ts escape='js'}Are you sure you want to delete this menu item:{/ts}" + " "{literal} + menuName + {/literal}" ? {ts}This action can not be undone.{/ts}"{literal};
-      var isDelete  = confirm( deleteMsg );
-      if ( isDelete ) {
+      }).bind("rename.jstree", function ( e,node ) {
+        var nodeID  = node.rslt.obj.attr('id').replace("node_","");
+        var newName = node.rslt.new_name;
         var postURL = {/literal}"{crmURL p='civicrm/ajax/menutree' h=0 q='key='}{crmKey name='civicrm/ajax/menutree'}"{literal};
-        cj.get( postURL + '&type=delete&id=' + nodeID,
+        $.get( postURL + '&type=rename&id=' + nodeID + '&data=' + newName,
           function (data) {
-            cj("#reset-menu").show( );
+            $("#reset-menu").show( );
           }
         );
-      } else {
-        cj("#navigation-tree").jstree('refresh');
-      }
 
-    }).bind("move_node.jstree", function ( e,node ) {
-      node.rslt.o.each(function (i) {
-      var nodeID = node.rslt.o.attr('id').replace("node_","");
-      var refID  = node.rslt.np.attr('id').replace("node_","");
-      if (isNaN( refID ) ){ refID =''; }
-      var ps = node.rslt.cp+i;
-      var postURL = {/literal}"{crmURL p='civicrm/ajax/menutree' h=0 q='key='}{crmKey name='civicrm/ajax/menutree'}"{literal};
-        cj.get( postURL + '&type=move&id=' +  nodeID + '&ref_id=' + refID + '&ps='+ps,
-          function (data) {
-            cj("#reset-menu").show( );
-          });
+      }).bind("remove.jstree", function( e,node ) {
+        var menuName  = node.rslt.obj.find('a').first( ).text( );
+        var nodeID  = node.rslt.obj.attr('id').replace("node_","");
+
+        // don't allow deleting of home
+        var homeMenuId = {/literal}"{$homeMenuId}"{literal};
+        if ( nodeID == homeMenuId ) {
+          var cannotDeleteMsg = {/literal}"{ts escape='js'}You cannot delete this menu item:{/ts}" + " "{literal} + menuName;
+          CRM.alert( cannotDeleteMsg, {/literal}"{ts escape='js'}Cannot Delete{/ts}"{literal} );
+          $("#navigation-tree").jstree('refresh');
+          return false;
+        }
+        var deleteMsg = {/literal}"{ts escape='js'}Are you sure you want to delete this menu item:{/ts}" + " "{literal} + menuName + {/literal}" ? {ts}This action can not be undone.{/ts}"{literal};
+        var isDelete  = confirm( deleteMsg );
+        if ( isDelete ) {
+          var postURL = {/literal}"{crmURL p='civicrm/ajax/menutree' h=0 q='key='}{crmKey name='civicrm/ajax/menutree'}"{literal};
+          $.get( postURL + '&type=delete&id=' + nodeID,
+            function (data) {
+              $("#reset-menu").show( );
+            }
+          );
+        } else {
+          $("#navigation-tree").jstree('refresh');
+        }
+
+      }).bind("move_node.jstree", function ( e,node ) {
+        node.rslt.o.each(function (i) {
+          var nodeID = node.rslt.o.attr('id').replace("node_","");
+          var refID  = node.rslt.np.attr('id').replace("node_","");
+          if (isNaN( refID ) ){ refID =''; }
+          var ps = node.rslt.cp+i;
+          var postURL = {/literal}"{crmURL p='civicrm/ajax/menutree' h=0 q='key='}{crmKey name='civicrm/ajax/menutree'}"{literal};
+          $.get( postURL + '&type=move&id=' +  nodeID + '&ref_id=' + refID + '&ps='+ps,
+            function (data) {
+              $("#reset-menu").show( );
+            });
+        });
       });
-    });
-    $('#new-menu-item a.button')
-      .on('click', CRM.popup)
-      .on('crmPopupFormSuccess', function() {
+      $('#new-menu-item a.button')
+        .on('click', CRM.popup)
+        .on('crmPopupFormSuccess', function() {
           $("#navigation-tree").jstree('refresh');
           $("#reset-menu").show();
-      });
-  });
+        });
+    });
 </script>
 {/literal}
 {/if}
index f2ea634f9c43ced8f0672e2dfb57feba1c466291..6d4e302bc1db3866aa72020ea81a85c32841605f 100644 (file)
@@ -147,10 +147,9 @@ CRM.$(function($) {
           $("input[name=select_merge_tag]", this).crmError(ts('Select a tag'));
           return false;
         }
-        /* send synchronous request so that disabling any actions for slow servers*/
         var postUrl = {/literal}"{crmURL p='civicrm/ajax/mergeTags' h=0 }"{literal};
         var data = {fromId: tag.id, toId: toId, key:{/literal}"{crmKey name='civicrm/ajax/mergeTags'}"{literal}};
-        cj.ajax({
+        $.ajax({
           type: "POST",
           url: postUrl,
           data: data,
index 3fe3693d5ee8b7ca14d8d3e8ee3fd3d99f9f4669..28df468717296925375752efa6cd7df956e7c4c2 100644 (file)
@@ -1,24 +1,24 @@
 //@todo functions partially moved from tpl but still need an enclosure / cleanup
 // jslinting etc
 CRM.$(function($) {
-  cj('.selector-rows').change(function () {
+  $('.selector-rows').change(function () {
     var options = {
       'url': CRM.url('civicrm/ajax/batch')
     };
 
-    cj("#Entry").ajaxSubmit(options);
+    $("#Entry").ajaxSubmit(options);
 
     // validate rows
-    checkColumns(cj(this));
+    checkColumns($(this));
   });
 
-  cj('input[name^="soft_credit_contact["]').change(function(){
-    var rowNum = cj(this).attr('id').replace('soft_credit_contact_','');
-    var totalAmount = cj('#field_'+rowNum+'_total_amount').val();
+  $('input[name^="soft_credit_contact["]').change(function(){
+    var rowNum = $(this).attr('id').replace('soft_credit_contact_','');
+    var totalAmount = $('#field_'+rowNum+'_total_amount').val();
     //assign total amount as default soft credit amount
-    cj('#soft_credit_amount_'+ rowNum).val(totalAmount);
+    $('#soft_credit_amount_'+ rowNum).val(totalAmount);
     //assign soft credit type default value if any
-    cj('#field_'+rowNum+'_soft_credit_type').val(cj('#sct_default_id').val());
+    $('#field_'+rowNum+'_soft_credit_type').val($('#sct_default_id').val());
   });
 
   // validate rows
@@ -27,7 +27,7 @@ CRM.$(function($) {
   //calculate the actual total for the batch
   calculateActualTotal();
 
-  cj('input[id*="_total_amount"]').bind('keyup change', function () {
+  $('input[id*="_total_amount"]').bind('keyup change', function () {
     calculateActualTotal();
   });
 
@@ -36,35 +36,35 @@ CRM.$(function($) {
     hideSendReceipt();
 
     // hide the receipt date if send receipt is checked
-    cj('input[id*="][send_receipt]"]').change(function () {
-      showHideReceipt(cj(this));
+    $('input[id*="][send_receipt]"]').change(function () {
+      showHideReceipt($(this));
     });
 
   }
   else{
-    cj('select[id^="member_option_"]').each(function () {
-      if (cj(this).val() == 1) {
-        cj(this).prop('disabled', true);
+    $('select[id^="member_option_"]').each(function () {
+      if ($(this).val() == 1) {
+        $(this).prop('disabled', true);
       }
     });
 
   // set payment info accord to membership type
-  cj('select[id*="_membership_type_0"]').change(function () {
-    setPaymentBlock(cj(this), null);
+  $('select[id*="_membership_type_0"]').change(function () {
+    setPaymentBlock($(this), null);
   });
 
-  cj('select[id*="_membership_type_1"]').change(function () {
-    setPaymentBlock(cj(this), cj(this).val());
+  $('select[id*="_membership_type_1"]').change(function () {
+    setPaymentBlock($(this), $(this).val());
   });
 
   }
 
   // line breaks between radio buttons and checkboxes
-  cj('input.form-radio').next().after('<br />');
-  cj('input.form-checkbox').next().after('<br />');
+  $('input.form-radio').next().after('<br />');
+  $('input.form-checkbox').next().after('<br />');
 
   //set the focus on first element
-  cj('#primary_contact_1').focus();
+  $('#primary_contact_1').focus();
 
 });
 
index 90c43bd65f1db87918d15e5989da8a20b90cd343..a3bb2a852b5fee9b33f5ccd2b492931a0361f56b 100644 (file)
 {literal}
 <script type="text/javascript">
 CRM.$(function($) {
-  cj('.selector-rows').change(function () {
+  $('.selector-rows').change(function () {
     var options = {
       'url': {/literal}"{crmURL p='civicrm/ajax/batch' h=0}"{literal}
     };
 
-    cj("#Entry").ajaxSubmit(options);
+    $("#Entry").ajaxSubmit(options);
   });
 
-  cj('#crm-container').on('keyup change', '*.selector-rows', function () {
+  $('#crm-container').on('keyup change', '*.selector-rows', function () {
     // validate rows
-    checkColumns(cj(this));
+    checkColumns($(this));
   });
 
   // validate rows
@@ -126,7 +126,7 @@ CRM.$(function($) {
   //calculate the actual total for the batch
   calculateActualTotal();
 
-  cj('input[id*="_total_amount"]').bind('keyup change', function () {
+  $('input[id*="_total_amount"]').bind('keyup change', function () {
     calculateActualTotal();
   });
 
@@ -135,34 +135,34 @@ CRM.$(function($) {
   hideSendReceipt();
 
   // hide the receipt date if send receipt is checked
-  cj('input[id*="][send_receipt]"]').change(function () {
-    showHideReceipt(cj(this));
+  $('input[id*="][send_receipt]"]').change(function () {
+    showHideReceipt($(this));
   });
 
   {/literal}{else}{literal}
-  cj('select[id^="member_option_"]').each(function () {
-    if (cj(this).val() == 1) {
-      cj(this).prop('disabled', true);
+  $('select[id^="member_option_"]').each(function () {
+    if ($(this).val() == 1) {
+      $(this).prop('disabled', true);
     }
   });
 
   // set payment info accord to membership type
-  cj('select[id*="_membership_type_0"]').change(function () {
-    setPaymentBlock(cj(this), null);
+  $('select[id*="_membership_type_0"]').change(function () {
+    setPaymentBlock($(this), null);
   });
 
-  cj('select[id*="_membership_type_1"]').change(function () {
-    setPaymentBlock(cj(this), cj(this).val());
+  $('select[id*="_membership_type_1"]').change(function () {
+    setPaymentBlock($(this), $(this).val());
   });
 
   {/literal}{/if}{literal}
 
   // line breaks between radio buttons and checkboxes
-  cj('input.form-radio').next().after('<br />');
-  cj('input.form-checkbox').next().after('<br />');
+  $('input.form-radio').next().after('<br />');
+  $('input.form-checkbox').next().after('<br />');
 
   //set the focus on first element
-  cj('#primary_contact_1').focus();
+  $('#primary_contact_1').focus();
 
 });
 
@@ -290,7 +290,7 @@ function updateContactInfo(blockNo, prefix) {
   var contactId = cj(contactHiddenElement).val();
 
   var returnProperties = '';
-  var profileFields = new Array();
+  var profileFields = [];
   {/literal}
   {if $contactFields}
   {foreach from=$contactFields item=val key=fldName}
index 2c65ec024a528a4c79103dc32649ac440115a4d0..6d6cfcd619a11f56279d9324bad8969504ef7af8 100644 (file)
@@ -46,9 +46,9 @@
 {literal}
 <script type="text/javascript">
     CRM.$(function($) {
-      if (cj('#crm-recently-viewed').offset().left > 150) {
-        cj('#crm-recently-viewed').removeClass('left').addClass('right');
-          }
+      if ($('#crm-recently-viewed').offset().left > 150) {
+        $('#crm-recently-viewed').removeClass('left').addClass('right');
+      }
     });
 </script>
 {/literal}
index 45446c613de8a528483c29013ef33027c1f732c7..6db4c0979c77ac8ff412d5712e473fcdefcdb58f 100755 (executable)
@@ -137,7 +137,7 @@ function loadVoterList( )
       var dataLength = aoData.length;
 
       var count = 1;
-      var searchCriteria = new Array( 'campaign_search_voter_for' );
+      var searchCriteria = ['campaign_search_voter_for'];
 
       //get the search criteria.
                         var searchParams = {/literal}{$searchParams}{literal};
index cca8e77cb939d5b08284d0fb7cf57c7eb8ca18d8..4dc49dd7a8d15d40e7dc266fd237d3a44d55ec8d 100644 (file)
     //show edit profile field links
     CRM.$(function($) {
       // show edit for both contact and activity profile
-      cj('select[id$="profile_id"]').change(function () {
-        buildLinks(cj(this), cj(this).val());
+      $('select[id$="profile_id"]').change(function () {
+        buildLinks($(this), $(this).val());
       });
 
       // make sure we set edit links for both profiles when form loads
-      cj('select[id$="profile_id"]').each(function (e) {
-        buildLinks(cj(this), cj(this).val());
+      $('select[id$="profile_id"]').each(function (e) {
+        buildLinks($(this), $(this).val());
       });
     });
   </script>
index faa9f72fc1ba87b4efabe7442298a8fea212edd3..7472e9bce8ce77c02e1a80aa040c555dd9a756e4 100644 (file)
 {literal}
   <script type="text/javascript">
 
-cj(document).ready(function(){
-  cj('#selector tr:even').addClass('odd-row ');
-  cj('#selector tr:odd ').addClass('even-row');
+CRM.$(function($) {
+  $('#selector tr:even').addClass('odd-row ');
+  $('#selector tr:odd ').addClass('even-row');
 });
 
   </script>
index e8ab4965e70d969f8e58b5d573b3255e24ce0616..1572347c73cfb1d206c5a368c20f1a21f691403e 100644 (file)
@@ -88,8 +88,8 @@
 </tr>
 
 <script type="text/javascript">
-    var showRows   = new Array({$showBlocks});
-    var hideBlocks = new Array({$hideBlocks});
+    var showRows   = [{$showBlocks}];
+    var hideBlocks = [{$hideBlocks}];
     var rowcounter = 0;
     var surveyId   = {if $surveyId}{$surveyId}{else}''{/if};
 
index 0fa3a7f083c561f91581739252428a751928cb13..821a1807bb2abe1c7bb655d0fd08a092db67ae27 100755 (executable)
     noRecordFoundMsg += '<div class="qill">';
 
     var count = 0;
-    var searchQill = new Array();
+    var searchQill = [];
     for (param in searchParams) {
       if (val = CRM.$('#' + param).val()) {
         if (param == 'status_id') {
         var dataLength = aoData.length;
 
         var count = 1;
-        var searchCriteria = new Array();
+        var searchCriteria = [];
 
         //get the search criteria.
         var searchParams = {/literal}{$searchParams}{literal};
index 8781688ed13907582ec9faf3da2914494e0f7437..40be7c322fffcafee7307021707d72f3879ebf77 100755 (executable)
@@ -164,7 +164,7 @@ function loadPetitionList( )
      noRecordFoundMsg += '<div class="qill">';
 
      var count = 0;
-     var searchQill = new Array( );
+     var searchQill = [];
      for ( param in searchParams ) {
        if ( val = CRM.$( '#' + param ).val( ) ) {
          if ( param == 'petition_campaign_id' ) val = campaigns[val];
@@ -216,7 +216,7 @@ function loadPetitionList( )
       var dataLength = aoData.length;
 
       var count = 1;
-      var searchCriteria = new Array( );
+      var searchCriteria = [];
 
       //get the search criteria.
                         var searchParams = {/literal}{$searchParams}{literal};
index 33e58e18160cbb55500cb5d115c1859b9287de80..e3c5fe4b16910b3ab290a2644b21ca792e5af7c1 100755 (executable)
@@ -173,7 +173,7 @@ function loadSurveyList( )
      noRecordFoundMsg += '<div class="qill">';
 
      var count = 0;
-     var searchQill = new Array( );
+     var searchQill = [];
      for ( param in searchParams ) {
        if ( val = CRM.$( '#' + param ).val( ) ) {
          if ( param == 'activity_type_id' ) val = surveyTypes[val];
@@ -231,7 +231,7 @@ function loadSurveyList( )
       var dataLength = aoData.length;
 
       var count = 1;
-      var searchCriteria = new Array( );
+      var searchCriteria = [];
 
       //get the search criteria.
                         var searchParams = {/literal}{$searchParams}{literal};
index 17a08d406941febc0738e87ee1853e23f9016632..c53f2173a57a6f87bbc449fd301be3735dfaa82f 100644 (file)
     //show edit profile field links
     CRM.$(function($) {
         // show edit for profile
-        cj('select[id="profile_id"]').change( function( ) {
-            buildLinks( cj(this), cj(this).val());
+        $('select[id="profile_id"]').change( function( ) {
+            buildLinks( $(this), $(this).val());
         });
 
         // show edit links on form loads
-        var profileField =  cj('select[id="profile_id"]');
+        var profileField =  $('select[id="profile_id"]');
         buildLinks( profileField, profileField.val());
     });
 </script>
 {include file="CRM/common/customData.tpl" includeWysiwygEditor=true}
 {literal}
   <script type="text/javascript">
-    cj(document).ready(function() {
+    CRM.$(function($) {
       {/literal}
         CRM.buildCustomData( 'Survey' );
       {literal}
index 40681ec53a65b8bc373c12225d0f35cefe25030f..fb222caf2b3fefc85ca0e59737be7520440e9a05 100644 (file)
     {literal}
     <script type="text/javascript">
       CRM.$(function($) {
-        cj('.crm-with-contact').click(function(){
-          cj('#with-contacts-widget').toggle();
-          cj('#with-clients').toggle();
+        $('.crm-with-contact').click(function() {
+          $('#with-contacts-widget').toggle();
+          $('#with-clients').toggle();
           return false;
         });
       });
index 26111bb0e5884fa992fbb3869af6cb64b26ee646..4cfcbda5d569538222c840f26ce51909a3eba001 100644 (file)
@@ -41,7 +41,7 @@
 
         $el.load(CRM.url('civicrm/case/changeactivitystatus'), data, function() {
           $el.unblock().trigger('crmLoad');
-          cj("#activity_change_status").val(current_status_id);
+          $("#activity_change_status").val(current_status_id);
         });
 
         CRM.confirm({
index 8c9152bc0df6da856f77d3ad9f5bf1a4983f258a..8400c2cb4c5d223a601bdac5614599eadcccc8b2 100644 (file)
 CRM.$(function($) {
     var fields = new Array( 'postal_greeting', 'addressee', 'email_greeting');
     for ( var i = 0; i < 3; i++ ) {
-        cj( "#" + fields[i] + "_id").change( function( ) {
-            var fldName = cj(this).attr( 'id' );
-            if ( cj(this).val( ) == 4 ) {
-                cj("#greetings1").show( );
-                cj("#greetings2").show( );
-                cj( "#" + fldName + "_html").show( );
-                cj( "#" + fldName + "_label").show( );
+        $( "#" + fields[i] + "_id").change( function( ) {
+            var fldName = $(this).attr( 'id' );
+            if ( $(this).val( ) == 4 ) {
+                $("#greetings1").show( );
+                $("#greetings2").show( );
+                $( "#" + fldName + "_html").show( );
+                $( "#" + fldName + "_label").show( );
             } else {
-                cj( "#" + fldName + "_html").hide( );
-                cj( "#" + fldName + "_label").hide( );
-                cj( "#" + fldName.slice(0, -3) + "_custom" ).val('');
+                $( "#" + fldName + "_html").hide( );
+                $( "#" + fldName + "_label").hide( );
+                $( "#" + fldName.slice(0, -3) + "_custom" ).val('');
             }
         });
     }
 });
 
 function showGreeting( element ) {
-    cj("#" + element ).show( );
-    cj("#" + element + '_display' ).hide( );
+    $("#" + element ).show( );
+    $("#" + element + '_display' ).hide( );
 
     // TO DO fix for custom greeting
     var fldName = '#' + element + '_id';
-    if ( cj( fldName ).val( ) == 4 ) {
-        cj("#greetings1").show( );
-        cj("#greetings2").show( );
-        cj( fldName + "_html").show( );
-        cj( fldName + "_label").show( );
+    if ( $( fldName ).val( ) == 4 ) {
+        $("#greetings1").show( );
+        $("#greetings2").show( );
+        $( fldName + "_html").show( );
+        $( fldName + "_label").show( );
     }
 }
 
index 371887edfcf3347ecaa548347f590b4e4e614094..bca56db29bc36cd1888f4130106367d60af9844c 100644 (file)
@@ -1,23 +1,23 @@
 {literal}
 <script type="text/javascript">
 CRM.$(function($) {
-  if (cj('#update_modified_date').length == 0) {
+  if ($('#update_modified_date').length == 0) {
     return;
   }
-  cj('<br>')
-    .appendTo(cj('#update_modified_date'));
-  cj('<button>')
+  $('<br>')
+    .appendTo($('#update_modified_date'));
+  $('<button>')
     .text("{/literal}{ts}Save Anyway{/ts}{literal}")
     .click(function() {
-      cj('input[name="modified_date"]').val(
-              cj('#update_modified_date').attr('data:latest_modified_date')
+      $('input[name="modified_date"]').val(
+              $('#update_modified_date').attr('data:latest_modified_date')
       );
-      cj('.crm-form-block .crm-form-submit.default').first().click();
+      $('.crm-form-block .crm-form-submit.default').first().click();
       return false;
     })
-    .appendTo(cj('#update_modified_date'))
+    .appendTo($('#update_modified_date'))
     ;
-  cj('<button>')
+  $('<button>')
     .text("{/literal}{ts}Reload Page{/ts}{literal}")
     .click(function() {
       window.location.href = CRM.url('civicrm/contact/add', {
@@ -27,7 +27,7 @@ CRM.$(function($) {
       });
       return false;
     })
-    .appendTo(cj('#update_modified_date'))
+    .appendTo($('#update_modified_date'))
     ;
 });
 </script>
index 0e7e3ae67cfe1a2a2371320c1dd153b8b38616ce..2e713af264eaf2ae3e2f066e61e1ef7b92d127b4 100644 (file)
 {literal}
 <script type="text/javascript">
 CRM.$(function($) {
-    var fields = new Array( 'postal_greeting', 'addressee', 'email_greeting');
+    var fields = ['postal_greeting', 'addressee', 'email_greeting'];
     for ( var i = 0; i < 3; i++ ) {
-      cj( "#" + fields[i] + "_id").change( function( ) {
-        var fldName = cj(this).attr( 'id' );
-        if ( cj(this).val( ) == 4 ) {
-          cj("#greetings1").show( );
-          cj("#greetings2").show( );
-          cj( "#" + fldName + "_html").show( );
-          cj( "#" + fldName + "_label").show( );
+      $( "#" + fields[i] + "_id").change( function( ) {
+        var fldName = $(this).attr( 'id' );
+        if ( $(this).val( ) == 4 ) {
+          $("#greetings1").show( );
+          $("#greetings2").show( );
+          $( "#" + fldName + "_html").show( );
+          $( "#" + fldName + "_label").show( );
         } else {
-          cj( "#" + fldName + "_html").hide( );
-          cj( "#" + fldName + "_label").hide( );
-          cj( "#" + fldName.slice(0, -3) + "_custom" ).val('');
+          $( "#" + fldName + "_html").hide( );
+          $( "#" + fldName + "_label").hide( );
+          $( "#" + fldName.slice(0, -3) + "_custom" ).val('');
         }
       });
     }
index f74e218b4ad4f6adeda853fbd87c3a61e5fd5211..ae6eb0ac7cb2b4d3845ac3f52ad2775bba34f2f7 100644 (file)
@@ -143,10 +143,10 @@ You will need to manually delete that user (click on the link to open Drupal Use
 {literal}
 <script type="text/javascript">
 
-cj(document).ready(function(){
-    cj('table td input.form-checkbox').each(function() {
+  CRM.$(function($) {
+    $('table td input.form-checkbox').each(function() {
        var ele = null;
-       var element = cj(this).attr('id').split('_',3);
+       var element = $(this).attr('id').split('_',3);
 
        switch ( element['1'] ) {
            case 'addressee':
@@ -160,13 +160,13 @@ cj(document).ready(function(){
        }
 
        if( ele ) {
-          cj(this).on('click', function() {
-            var val = cj(this).prop('checked');
-            cj('input' + ele + ', input' + ele + '_custom').prop('checked', val);
+          $(this).on('click', function() {
+            var val = $(this).prop('checked');
+            $('input' + ele + ', input' + ele + '_custom').prop('checked', val);
           });
        }
     });
-});
+  });
 
 </script>
 {/literal}
index e4664a1e43b0427218e9cf2a717a64005a940f5c..9a091dd1b990dc102c9533e3885d999b44ec874a 100644 (file)
         <script type="text/javascript">
         CRM.$(function($) {
           function showGroupSearch(){
-            cj('#grouptypeselect').hide();
-            cj('#groupselect').show();
-            cj('#group_type').select2('val', '');
+            $('#grouptypeselect').hide();
+            $('#groupselect').show();
+            $('#group_type').select2('val', '');
           }
           function showGroupTypeSearch(){
-            cj('#groupselect').hide();
-            cj('#grouptypeselect').show();
-            cj('#group').select2('val', '');
+            $('#groupselect').hide();
+            $('#grouptypeselect').show();
+            $('#group').select2('val', '');
           }
-          cj('#searchbygrouptype').click(function() {
+          $('#searchbygrouptype').click(function() {
               showGroupTypeSearch();
           });
-          cj('#searchbygroup').click(function() {
+          $('#searchbygroup').click(function() {
               showGroupSearch();
           });
 
-          if (cj('#group_type').val() ) {
+          if ($('#group_type').val() ) {
             showGroupTypeSearch();
           }
           else {
index 6b4b5d9924c71c9da5e8777daf1270ab6c88517f..429311d91c7a7d64d4653e1554d97a18d12a129e 100644 (file)
 {literal}
   <script type="text/javascript">
     CRM.$(function($) {
+      function updateChangeLogLabels() {
+        var changeType = $('input[name=log_date]:checked').val();
+        if (changeType == 2) {
+          $('.addedBy').hide();
+          $('.modifiedBy').show();
+        }
+        else {
+          if (changeType == 1) {
+            $('.addedBy').show();
+            $('.modifiedBy').hide();
+          }
+        }
+      }
+      $('[name=log_date]:input').change(updateChangeLogLabels);
       updateChangeLogLabels();
     });
 
-    cj('[name=log_date]:input').change(function () {
-      updateChangeLogLabels();
-    });
 
-    function updateChangeLogLabels() {
-      var changeType = cj('input[name=log_date]:checked').val();
-      if (changeType == 2) {
-        cj('.addedBy').hide();
-        cj('.modifiedBy').show();
-      }
-      else {
-        if (changeType == 1) {
-          cj('.addedBy').show();
-          cj('.modifiedBy').hide();
-        }
-      }
-    }
   </script>
 {/literal}
index 4f3c67434f368503c1454117e4d03b42b156c9b2..44f914b4fe108c9bb45120e681b0f02bfa6cb86a 100644 (file)
@@ -142,9 +142,9 @@ function processAddressFields( name, loadData ) {
 }
 
 CRM.$(function($) {
-  if (  cj('#street_name').val( ).length > 0 ||
-        cj('#street_unit').val( ).length > 0 ||
-        cj('#street_number').val( ).length > 0 ) {
+  if (  $('#street_name').val( ).length > 0 ||
+        $('#street_unit').val( ).length > 0 ||
+        $('#street_number').val( ).length > 0 ) {
     processAddressFields( 'addressElements', 1 );
   }
 }
index 19358ad2c823adc17bf76127c247d8e5f5c933c3..60e3d6cb5e5c1afcc5deb3eceb9c1aaab473c9c4 100644 (file)
 
 {literal}
 <script type="text/javascript">
-  function showHideSharedAddress( blockNo, showSelect ) {
-    // based on checkbox, show or hide
-    if ( cj( '#address\\[' + blockNo + '\\]\\[use_shared_address\\]' ).prop('checked') ) {
-      if ( showSelect && cj( '#shared-address-display-' + blockNo ).length == 0 ) {
-        cj( '#shared-address-' + blockNo ).show( );
+  CRM.$(function($) {
+
+    function showHideSharedAddress( blockNo, showSelect ) {
+      // based on checkbox, show or hide
+      if ( $( '#address\\[' + blockNo + '\\]\\[use_shared_address\\]' ).prop('checked') ) {
+        if ( showSelect && $( '#shared-address-display-' + blockNo ).length == 0 ) {
+          $( '#shared-address-' + blockNo ).show( );
+        }
+        $( 'table#address_table_' + blockNo ).hide( );
+        $( '#shared-address-display-' + blockNo ).show( );
+        $( '#shared-address-display-name-' + blockNo ).show( );
+        $( '#shared-address-display-cancel-' + blockNo ).hide( );
+        $( '.crm-address-custom-set-block-' + blockNo).hide( );
+      } else {
+        $( '#shared-address-' + blockNo ).hide( );
+        $( 'table#address_table_' + blockNo ).show( );
+        $( '#shared-address-display-' + blockNo ).hide( );
+        $( '#shared-address-display-name-' + blockNo ).hide( );
+        $( '#shared-address-display-cancel-' + blockNo ).hide( );
+        $( '.crm-address-custom-set-block-' + blockNo).show( );
       }
-      cj( 'table#address_table_' + blockNo ).hide( );
-      cj( '#shared-address-display-' + blockNo ).show( );
-      cj( '#shared-address-display-name-' + blockNo ).show( );
-      cj( '#shared-address-display-cancel-' + blockNo ).hide( );
-      cj( '.crm-address-custom-set-block-' + blockNo).hide( );
-    } else {
-      cj( '#shared-address-' + blockNo ).hide( );
-      cj( 'table#address_table_' + blockNo ).show( );
-      cj( '#shared-address-display-' + blockNo ).hide( );
-      cj( '#shared-address-display-name-' + blockNo ).hide( );
-      cj( '#shared-address-display-cancel-' + blockNo ).hide( );
-      cj( '.crm-address-custom-set-block-' + blockNo).show( );
     }
-  }
-
-CRM.$(function($) {
     var blockNo = {/literal}{$blockId}{literal};
 
     // call this when form loads
     showHideSharedAddress( blockNo, true );
 
     // handle check / uncheck of checkbox
-    cj( '#address\\[' + blockNo + '\\]\\[use_shared_address\\]' ).click( function( ) {
+    $( '#address\\[' + blockNo + '\\]\\[use_shared_address\\]' ).click( function( ) {
       showHideSharedAddress( blockNo, true );
     });
 
@@ -87,8 +87,8 @@ CRM.$(function($) {
     var contactHiddenElement = 'input[name="address[' + blockNo +'][master_contact_id]"]';
 
     // observe changes
-    cj( contactHiddenElement ).change(function( ) {
-      var sharedContactId = cj( this ).val( );
+    $( contactHiddenElement ).change(function( ) {
+      var sharedContactId = $( this ).val( );
       if ( !sharedContactId || isNaN( sharedContactId ) ) {
         return;
       }
@@ -96,23 +96,23 @@ CRM.$(function($) {
       var addressHTML = '';
       var postUrl = {/literal}"{crmURL p='civicrm/ajax/inline' h=0}"{literal};
 
-      cj.post( postUrl, {
-        'contact_id': sharedContactId,
-        'type': 'method',
-        'async': false,
-        'class_name': 'CRM_Contact_Page_AJAX',
-        'fn_name': 'getAddressDisplay'
+      $.post( postUrl, {
+          'contact_id': sharedContactId,
+          'type': 'method',
+          'async': false,
+          'class_name': 'CRM_Contact_Page_AJAX',
+          'fn_name': 'getAddressDisplay'
         },
         function( response ) {
           if ( response ) {
             var selected = 'checked';
             var addressExists = false;
 
-            cj.each( response, function( i, val ) {
+            $.each( response, function( i, val ) {
               if ( i > 1 ) {
                 selected = '';
               } else {
-                cj( 'input[name="address[' + blockNo + '][master_id]"]' ).val( val.id );
+                $( 'input[name="address[' + blockNo + '][master_id]"]' ).val( val.id );
               }
 
               addressHTML = addressHTML + '<input type="radio" name="selected_shared_address-'+ blockNo +'" value=' + val.id + ' ' + selected +'>' + val.display_text + '<br/>';
@@ -121,23 +121,23 @@ CRM.$(function($) {
             });
 
             if ( addressExists  ) {
-              cj( '#shared-address-' + blockNo + ' .shared-address-list' ).remove( );
-              cj( '#shared-address-' + blockNo ).append( '<tr class="shared-address-list"><td></td><td>' + addressHTML + '</td></tr>');
-              cj( 'input[name^=selected_shared_address-]' ).click( function( ) {
+              $( '#shared-address-' + blockNo + ' .shared-address-list' ).remove( );
+              $( '#shared-address-' + blockNo ).append( '<tr class="shared-address-list"><td></td><td>' + addressHTML + '</td></tr>');
+              $( 'input[name^=selected_shared_address-]' ).click( function( ) {
 
-              // get the block id
-              var elemId = cj(this).attr( 'name' ).split('-');
-              cj( 'input[name="address[' + elemId[1] + '][master_id]"]' ).val( cj(this).val( ) );
+                // get the block id
+                var elemId = $(this).attr( 'name' ).split('-');
+                $( 'input[name="address[' + elemId[1] + '][master_id]"]' ).val( $(this).val( ) );
               });
             } else {
               var helpText = {/literal}"{ts escape='js'}Selected contact does not have an address. Please edit that contact to add an address, or select a different contact.{/ts}"{literal};
-              cj( '#shared-address-' + blockNo + ' .shared-address-list' ).remove( );
-              cj( '#shared-address-' + blockNo ).append( '<tr class="shared-address-list"><td></td><td>' + helpText + '</td></tr>');
+              $( '#shared-address-' + blockNo + ' .shared-address-list' ).remove( );
+              $( '#shared-address-' + blockNo ).append( '<tr class="shared-address-list"><td></td><td>' + helpText + '</td></tr>');
             }
           }
         },'json');
     });
-});
+  });
 </script>
 {/literal}
 
index 799b5742a8bd6d440b95d96d66de30c9fd2ef105..a8b781546e246eeaf481d6fde7ba6bcedf0d160a 100644 (file)
       CRM.$(function($) {
         var defaultLocationType = "{/literal}{$defaultLocationType}{literal}";
         if (defaultLocationType.length) {
-          cj('#map-field').on('change', 'select[id^="mapper"][id$="_0"]', function() {
-            var select = cj(this).next();
-            cj('option', select).each(function() {
-              if (cj(this).attr('value') == defaultLocationType
-              && cj(this).text() == "{/literal}{$defaultLocationTypeLabel}{literal}") {
+          $('#map-field').on('change', 'select[id^="mapper"][id$="_0"]', function() {
+            var select = $(this).next();
+            $('option', select).each(function() {
+              if ($(this).attr('value') == defaultLocationType
+              && $(this).text() == "{/literal}{$defaultLocationTypeLabel}{literal}") {
                 select.val(defaultLocationType);
               }
             });
index 216edee77bd45b08ae9015db58670fd8a6ab19c6..394f51c5d512a846eea6b1e5cf0698d38af8c1eb 100644 (file)
 <script type="text/javascript">
   CRM.$(function($) {
       var currentReSortEvent;
-    cj(".dash-column").sortable({
+    $(".dash-column").sortable({
       connectWith: '.dash-column',
       update: saveSorting
     });
 
-    cj(".portlet").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all")
+    $(".portlet").addClass("ui-widget ui-widget-content ui-helper-clearfix ui-corner-all")
       .find(".portlet-header")
         .addClass("ui-widget-header ui-corner-all")
         .end()
       .find(".portlet-content");
 
-    cj(".dash-column").disableSelection();
+    $(".dash-column").disableSelection();
 
     function saveSorting(e, ui) {
             // this is to prevent double post call
@@ -86,8 +86,8 @@
                 dashletColumns = Array();
 
                 // build post params
-                cj('div[id^=existing-dashlets-col-]').each( function( i ) {
-                    cj(this).find('.portlet-header').each( function( j ) {
+                $('div[id^=existing-dashlets-col-]').each( function( i ) {
+                    $(this).find('.portlet-header').each( function( j ) {
                         var elementID = this.id;
                         var idState = elementID.split('-');
                         params['columns[' + i + '][' + idState[0] + ']'] = idState[1];
                 var postUrl = {/literal}"{crmURL p='civicrm/ajax/dashboard' h=0 }"{literal};
                 params['op'] = 'save_columns';
                 params['key'] = {/literal}"{crmKey name='civicrm/ajax/dashboard'}"{literal};
-                cj.post( postUrl, params, function(response, status) {
+                $.post( postUrl, params, function(response, status) {
                     // TO DO show done / disable escape action
                 });
             }
         }
 
-        cj('.delete-dashlet').click( function( ) {
+        $('.delete-dashlet').click( function( ) {
             var message = {/literal}'{ts escape="js"}Do you want to remove this dashlet as an "Available Dashlet", AND delete it from all user dashboards?{/ts}'{literal};
             if ( confirm( message) ) {
-                var dashletID = cj(this).parent().attr('id');
+                var dashletID = $(this).parent().attr('id');
                 var idState = dashletID.split('-')
 
                 // Build a list of params to post to the server.
                 var postUrl = {/literal}"{crmURL p='civicrm/ajax/dashboard' h=0 }"{literal};
                 params['op'] = 'delete_dashlet';
                 params['key'] = {/literal}"{crmKey name='civicrm/ajax/dashboard'}"{literal};
-                cj.post( postUrl, params, function(response, status) {
+                $.post( postUrl, params, function(response, status) {
                     // delete dom object
-                    cj('#' + dashletID ).parent().remove();
+                    $('#' + dashletID ).parent().remove();
                 });
             }
         });
index afbcc184eac40c4f2c3e83103cd94b1b4f63512d..c271373fa838ba8e803e00b628bb0ce591e804b8 100644 (file)
@@ -59,7 +59,7 @@
                var min_amount = document.getElementById("min_amount");
 
 
-               var amount = new Array();
+               var amount = [];
                amount[0] = '';
 
                if( product_id > 0 ) {
index 151b154bf6be0250eee66f0a35c0a11cb4731ce9..df3efb4a9b3195334cdf3a100a63e6e61ddc67bc 100644 (file)
@@ -85,9 +85,6 @@
       <td class="font-size12pt label"><strong><strong>{ts}Contributor{/ts}</strong></td><td class="font-size12pt"><strong>{$displayName}</strong></td>
     </tr>
     {else}
-      {if !$contributionMode and !$email and $outBound_option != 2}
-        {assign var='profileCreateCallback' value=1 }
-      {/if}
       <td class="label">{$form.contact_id.label}</td>
       <td>{$form.contact_id.html}</td>
     {/if}
     {if $context eq 'standalone' and $outBound_option != 2 }
       {literal}
       CRM.$(function($) {
-        cj("#contact_id").change( function( ) {
-          checkEmail( );
-        });
+
+        var $form = $("#{/literal}{$form.formName}{literal}");
+        $("#contact_id", $form).change(checkEmail);
         checkEmail( );
+
+        function checkEmail( ) {
+          var data = $("#contact_id", $form).select2('data');
+          if (data && data.extra && data.extra.email && data.extra.email.length) {
+            $("#email-receipt", $form).show();
+            $("#email-address", $form).html(data.extra.email);
+          }
+          else {
+            $("#email-receipt", $form).hide();
+          }
+        }
+
         showHideByValue( 'is_email_receipt', '', 'receiptDate', 'table-row', 'radio', true);
         showHideByValue( 'is_email_receipt', '', 'fromEmail', 'table-row', 'radio', false );
       });
 
-      function checkEmail( ) {
-        var contactID = cj("#contact_id").val();
-        if (contactID) {
-          var postUrl = "{/literal}{crmURL p='civicrm/ajax/checkemail' h=0}{literal}";
-          cj.post( postUrl, {contact_id: contactID},
-            function (response) {
-              if (response) {
-                cj("#email-receipt").show( );
-                cj("#email-address").html(response);
-              }
-              else {
-                cj("#email-receipt").hide( );
-              }
-            }
-          );
-        }
-        else {
-          cj("#email-receipt").hide( );
-        }
-      }
-
-      function profileCreateCallback( blockNo ) {
-        checkEmail( );
-      }
     {/literal}
     {/if}
   </script>
index feb71e9af2346311dc467139361ed9ec07b0339a..1c8dab03df15741d1485c42d81021d6d942751e1 100644 (file)
 CRM.$(function($) {
     //if price set is set we use below below code to show for showing auto renew
     var autoRenewOption =  {/literal}'{$autoRenewOption}'{literal};
-    cj('#allow_auto_renew').hide();
+    $('#allow_auto_renew').hide();
     if ( autoRenewOption == 1 ) {
-        cj('#allow_auto_renew').show();
+        $('#allow_auto_renew').show();
     } else if ( autoRenewOption == 2 ) {
-        var autoRenew = cj("#auto_renew");
+        var autoRenew = $("#auto_renew");
         autoRenew.prop('checked',  true );
         autoRenew.attr( 'readonly', true );
-        cj('#allow_auto_renew').show();
+        $('#allow_auto_renew').show();
     }
 });
 </script>
index 38773cf2b5571ad4b256e780928864babb0b90dc..b9181ecc6d37559725c9431269fd469cd81ba837 100644 (file)
@@ -296,9 +296,9 @@ function selectCreateOrg( orgOption, reset ) {
 {if $membershipContactID}
 {literal}
   CRM.$(function($) {
-    cj('#organization_id').val("{/literal}{$membershipContactName}{literal}");
-    cj('#organization_name').val("{/literal}{$membershipContactName}{literal}");
-    cj('#onbehalfof_id').val("{/literal}{$membershipContactID}{literal}");
+    $('#organization_id').val("{/literal}{$membershipContactName}{literal}");
+    $('#organization_name').val("{/literal}{$membershipContactName}{literal}");
+    $('#onbehalfof_id').val("{/literal}{$membershipContactID}{literal}");
     setLocationDetails( "{/literal}{$membershipContactID}{literal}" );
   });
 {/literal}
index 96f5c6bcac1de08f33ef0814692bc7ea00ce1929..ea9f21a8fa94c656a04a1d472ceec4a49554026d 100644 (file)
 
         // select a new premium
         function select_premium(premium_id) {
-          if(cj(premium_id).length) {
+          if($(premium_id).length) {
             // hide other active premium
-            cj('.premium-full').hide();
-            cj('.premium-short').show();
+            $('.premium-full').hide();
+            $('.premium-short').show();
             // show this one
-            cj('.premium-short', cj(premium_id)).hide();
-            cj('.premium-full', cj(premium_id)).show();
+            $('.premium-short', $(premium_id)).hide();
+            $('.premium-full', $(premium_id)).show();
             // record this one
             var id_parts = premium_id.split('-');
-            cj('#selectProduct').val(id_parts[1]);
+            $('#selectProduct').val(id_parts[1]);
           }
         }
 
         // click premium to select
-        cj('.premium-short').click(function(){
-          select_premium( '#'+cj(cj(this).parent()).attr('id') );
+        $('.premium-short').click(function(){
+          select_premium( '#'+$($(this).parent()).attr('id') );
         });
 
         // select the default premium
-        var premium_id = cj('#selectProduct').val();
+        var premium_id = $('#selectProduct').val();
         if(premium_id == '') premium_id = 'no_thanks';
         select_premium('#premium_id-'+premium_id);
 
           }
 
           // see if other amount exists and has a value
-          if(cj('.other_amount-content input').length) {
-            amount = Number(cj('.other_amount-content input').val());
+          if($('.other_amount-content input').length) {
+            amount = Number($('.other_amount-content input').val());
             if(isNaN(amount))
               amount = 0;
           }
 
           function check_price_set(price_set_radio_buttons) {
             if (!amount) {
-              cj(price_set_radio_buttons).each(function(){
-                if (cj(this).prop('checked')) {
-                  amount = cj(this).attr('data-amount');
+              $(price_set_radio_buttons).each(function(){
+                if ($(this).prop('checked')) {
+                  amount = $(this).attr('data-amount');
                   if (typeof amount !== "undefined") {
                     amount = Number(amount);
                   }
         function update_premiums() {
           var amount = get_amount();
 
-          cj('.premium').each(function(){
-            var min_contribution = cj(this).attr('min_contribution');
+          $('.premium').each(function(){
+            var min_contribution = $(this).attr('min_contribution');
             if(amount < min_contribution) {
-              cj(this).addClass('premium-disabled');
+              $(this).addClass('premium-disabled');
             } else {
-              cj(this).removeClass('premium-disabled');
+              $(this).removeClass('premium-disabled');
             }
           });
         }
-        cj('.other_amount-content input').change(update_premiums);
-        cj('input, #priceset').change(update_premiums);
+        $('.other_amount-content input').change(update_premiums);
+        $('input, #priceset').change(update_premiums);
         update_premiums();
 
         // build a list of price sets
         var amounts = [];
         var price_sets = {};
-        cj('input, #priceset  select,#priceset').each(function(){
+        $('input, #priceset  select,#priceset').each(function(){
           if (this.tagName == 'SELECT') {
-            var selectID = cj(this).attr('id');
-            var selectvalues = JSON.parse(cj(this).attr('price'));
+            var selectID = $(this).attr('id');
+            var selectvalues = JSON.parse($(this).attr('price'));
             Object.keys(selectvalues).forEach(function (key) {
               var option = selectvalues[key].split(optionSep);
               amount = Number(option[0]);
             });
           }
           else {
-            var amount = Number(cj(this).attr('data-amount'));
+            var amount = Number($(this).attr('data-amount'));
             if (!isNaN(amount)) {
               amounts.push(amount);
 
-             var id = cj(this).attr('id');
+             var id = $(this).attr('id');
              price_sets[amount] = '#'+id;
             }
           }
         amounts.sort(function(a,b){return a - b});
 
         // make contribution instead buttons work
-        cj('.premium-full-disabled input').click(function(){
-          var amount = Number(cj(this).attr('amount'));
+        $('.premium-full-disabled input').click(function(){
+          var amount = Number($(this).attr('amount'));
           if (price_sets[amount]) {
-            if (!cj(price_sets[amount]).length) {
+            if (!$(price_sets[amount]).length) {
               var option =  price_sets[amount].split('-');
-              cj(option[0]).val(option[1]);
-              cj(option[0]).trigger('change');
+              $(option[0]).val(option[1]);
+              $(option[0]).trigger('change');
             }
-            else if (cj(price_sets[amount]).attr('type') == 'checkbox') {
-               cj(price_sets[amount]).prop("checked",true);
+            else if ($(price_sets[amount]).attr('type') == 'checkbox') {
+               $(price_sets[amount]).prop("checked",true);
                if ((typeof totalfee !== 'undefined') && (typeof display == 'function')) {
                  if (totalfee > 0) {
                    totalfee += amount;
                }
              }
              else {
-               cj(price_sets[amount]).click();
-               cj(price_sets[amount]).trigger('click');
+               $(price_sets[amount]).click();
+               $(price_sets[amount]).trigger('click');
              }
           } else {
             // is there an other amount input box?
-            if(cj('.other_amount-section input').length) {
+            if($('.other_amount-section input').length) {
               // is this a membership form with separate payment?
               if(is_separate_payment) {
                 var current_amount = 0;
-                if(cj('#priceset input[type="radio"]:checked').length) {
-                  current_amount = Number(cj('#priceset input[type="radio"]:checked').attr('data-amount'));
+                if($('#priceset input[type="radio"]:checked').length) {
+                  current_amount = Number($('#priceset input[type="radio"]:checked').attr('data-amount'));
                   if(!current_amount) current_amount = 0;
                 }
                 var new_amount = amount - current_amount;
-                cj('.other_amount-section input').val(new_amount.toFixed(2));
+                $('.other_amount-section input').val(new_amount.toFixed(2));
               } else {
-                cj('.other_amount-section input').click();
-                cj('.other_amount-section input').val(cj(this).attr('amount'));
+                $('.other_amount-section input').click();
+                $('.other_amount-section input').val($(this).attr('amount'));
               }
             } else {
               // find the next best price set
                 selected_price_set = amounts[amounts.length-1];
               }
 
-              if (!cj(price_sets[selected_price_set]).length) {
+              if (!$(price_sets[selected_price_set]).length) {
                 var option =  price_sets[selected_price_set].split('-');
-                cj(option[0]).val(option[1]);
-                cj(option[0]).trigger('change');
+                $(option[0]).val(option[1]);
+                $(option[0]).trigger('change');
               }
-              else if (cj(price_sets[selected_price_set]).attr('type') == 'checkbox') {
-                cj(price_sets[selected_price_set]).prop("checked",true);
+              else if ($(price_sets[selected_price_set]).attr('type') == 'checkbox') {
+                $(price_sets[selected_price_set]).prop("checked",true);
                 if ((typeof totalfee !== 'undefined') && (typeof display == 'function')) {
                   if (totalfee > 0) {
                     totalfee += amount;
                 }
              }
              else {
-               cj(price_sets[selected_price_set]).click();
-               cj(price_sets[selected_price_set]).trigger('click');
+               $(price_sets[selected_price_set]).click();
+               $(price_sets[selected_price_set]).trigger('click');
              }
             }
           }
 
         // validation of premiums
         var error_message = '{/literal}{ts escape="js"}You must contribute more to get that item{/ts}{literal}';
-        cj.validator.addMethod('premiums', function(value, element, params){
-          var premium_id = cj('#selectProduct').val();
-          var premium$ = cj('#premium_id-'+premium_id);
+        $.validator.addMethod('premiums', function(value, element, params){
+          var premium_id = $('#selectProduct').val();
+          var premium$ = $('#premium_id-'+premium_id);
           if(premium$.length) {
             if(premium$.hasClass('premium-disabled')) {
               return false;
 
         // add validation rules
         CRM.validate.functions.push(function(){
-          cj('#selectProduct').rules('add', 'premiums');
+          $('#selectProduct').rules('add', 'premiums');
         });
 
         // need to use jquery validate's ignore option, so that it will not ignore hidden fields
index 354be5427d7f88e0f1ab4f0ca614089ea6cf0fe3..6141e3f66ed5e0d9904458af070de9c573694f7a 100644 (file)
 {/if} {* $action ne view *}
 </div>
 
-<script language="JavaScript" type="text/javascript">
+<script type="text/javascript">
 {literal}
-function getFinancialType()
-{
-{/literal}
-   productID         = "#product_id";
-   financialTypeID    = "#financial_type_id"
-   callbackURL        = "{crmURL p='civicrm/ajax/rest' h=0 q='className=CRM_Financial_Page_AJAX&fnName=jqFinancialType'}"
-{literal}
-
-          var check          = cj(productID).val();
-          callbackURL = callbackURL+"&_value="+check;
-                cj.ajax({
-                         url: callbackURL,
-                         context: document.body,
-                         success: function( data, textStatus ){
-       data = eval(data);//get json array
-                              if ( data != null ) {
-             cj(financialTypeID).val(data);
-
-           }
-
-      }
-           });
 
-  }
+  CRM.$(function($) {
 
-cj(document).ready(function(){
+    function getFinancialType() {
+      var callbackURL = CRM.url('civicrm/ajax/rest', {
+        className: 'CRM_Financial_Page_AJAX',
+        fnName: 'jqFinancialType',
+        _value: $("#product_id").val()
+      });
+      $.ajax({
+        url: callbackURL,
+        success: function( data, textStatus ){
+          data = eval(data);//get json array
+          if ( data != null ) {
+            $("#financial_type_id").val(data);
+  
+          }
+  
+        }
+      });
+  
+    }
     getFinancialType();
 
-    cj("#product_id").change( function(){
-         getFinancialType();
-    });
+    $("#product_id").change(getFinancialType);
 });
 {/literal}
 </script>
index 4cec3180a6ae7926a512ce7ae6594a0773658e9e..187f83423820cc4dd7a226455890893cf12276ed 100644 (file)
 
 {literal}
 <script type="text/javascript">
-   var paymentProcessorMapper = new Array( );
+   var paymentProcessorMapper = [];
      {/literal}
        {if $recurringPaymentProcessor}
            {foreach from=$recurringPaymentProcessor item="paymentProcessor" key="index"}{literal}
index f73b93cf3ba73d13d349d2c689f2e62693f5d0e5..82616899a6a9e16898aa01a923a6bdcc77953f1d 100644 (file)
   CRM.$(function($) {
 
     // bind click event to premiums_active checkbox
-    cj('#premiums_active').click(function () {
+    $('#premiums_active').click(function () {
       premiumBlock();
     });
 
     // hide premium setting if premium block is not enabled
-    if (!cj('#premiums_active').prop('checked')) {
-      cj('#premiumSettings').hide();
+    if (!$('#premiums_active').prop('checked')) {
+      $('#premiumSettings').hide();
     }
   });
 
index 812233877a0283d739d056402316950947327f59..8c4cc47e4383d4ee0c6e2487e95af97357032ab6 100644 (file)
 {literal}
 <script type='text/javascript'>
 CRM.$(function($) {
-  if (cj("#payment-info").length) {
+  if ($("#payment-info").length) {
     var dataUrl = {/literal}'{crmURL p="civicrm/payment/view" h=0 q="action=browse&id=$participantId&cid=`$contactId`&component=event&context=payment_info&snippet=4"}'{literal};
-    cj.ajax({
+    $.ajax({
       url: dataUrl,
       async: false,
       success: function(html) {
-        cj("#payment-info").html(html).trigger('crmLoad');
+        $("#payment-info").html(html).trigger('crmLoad');
       }
     });
 
-    cj('.total_amount-section').remove();
+    $('.total_amount-section').remove();
   }
 });
 </script>
index 85a4efe456234221f0262fe4d7b9c11caf711bc3..d3d2f91d009408ac5dba4fb825325e0bcbb7ed8b 100644 (file)
@@ -176,11 +176,11 @@ CRM.$(function($) {
   var address_fields = {/literal}{$profileAddressFields|@json_encode}{literal};
   var input_ids = {};
   var select_ids = {};
-  var orig_id = field = field_name = null;
+  var orig_id, field, field_name;
 
   // build input ids
-  cj('.billing_name_address-section input').each(function(i){
-    orig_id = cj(this).attr('id');
+  $('.billing_name_address-section input').each(function(i){
+    orig_id = $(this).attr('id');
     field = orig_id.split('-');
     field_name = field[0].replace('billing_', '');
     if(field[1]) {
@@ -189,16 +189,16 @@ CRM.$(function($) {
       }
     }
   });
-  if(cj('#first_name').length)
+  if($('#first_name').length)
     input_ids['#first_name'] = '#billing_first_name';
-  if(cj('#middle_name').length)
+  if($('#middle_name').length)
     input_ids['#middle_name'] = '#billing_middle_name';
-  if(cj('#last_name').length)
+  if($('#last_name').length)
     input_ids['#last_name'] = '#billing_last_name';
 
   // build select ids
-  cj('.billing_name_address-section select').each(function(i){
-    orig_id = cj(this).attr('id');
+  $('.billing_name_address-section select').each(function(i){
+    orig_id = $(this).attr('id');
     field = orig_id.split('-');
     field_name = field[0].replace('billing_', '').replace('_id', '');
     if(field[1]) {
@@ -211,82 +211,82 @@ CRM.$(function($) {
   // detect if billing checkbox should default to checked
   var checked = true;
   for(var id in input_ids) {
-    var orig_id = input_ids[id];
-    if(cj(id).val() != cj(orig_id).val()) {
+    orig_id = input_ids[id];
+    if($(id).val() != $(orig_id).val()) {
       checked = false;
       break;
     }
   }
   for(var id in select_ids) {
-    var orig_id = select_ids[id];
-    if(cj(id).val() != cj(orig_id).val()) {
+    orig_id = select_ids[id];
+    if($(id).val() != $(orig_id).val()) {
       checked = false;
       break;
     }
   }
   if(checked) {
-    cj('#billingcheckbox').prop('checked', true);
-    cj('.billing_name_address-group').hide();
+    $('#billingcheckbox').prop('checked', true);
+    $('.billing_name_address-group').hide();
   }
 
   // onchange handlers for non-billing fields
   for(var id in input_ids) {
-    var orig_id = input_ids[id];
-    cj(id).change(function(){
-      var id = '#'+cj(this).attr('id');
+    orig_id = input_ids[id];
+    $(id).change(function(){
+      var id = '#'+$(this).attr('id');
       var orig_id = input_ids[id];
 
       // if billing checkbox is active, copy other field into billing field
-      if(cj('#billingcheckbox').prop('checked')) {
-        cj(orig_id).val( cj(id).val() );
-      };
+      if($('#billingcheckbox').prop('checked')) {
+        $(orig_id).val( $(id).val() );
+      }
     });
-  };
+  }
   for(var id in select_ids) {
-    var orig_id = select_ids[id];
-    cj(id).change(function(){
-      var id = '#'+cj(this).attr('id');
+    orig_id = select_ids[id];
+    $(id).change(function(){
+      var id = '#'+$(this).attr('id');
       var orig_id = select_ids[id];
 
       // if billing checkbox is active, copy other field into billing field
-      if(cj('#billingcheckbox').prop('checked')) {
-        cj(orig_id+' option').prop('selected', false);
-        cj(orig_id+' option[value="'+cj(id).val()+'"]').prop('selected', true);
-      };
+      if($('#billingcheckbox').prop('checked')) {
+        $(orig_id+' option').prop('selected', false);
+        $(orig_id+' option[value="'+$(id).val()+'"]').prop('selected', true);
+      }
 
       if(orig_id == '#billing_country_id-5') {
-        cj(orig_id).change();
+        $(orig_id).change();
       }
     });
-  };
+  }
 
 
   // toggle show/hide
-  cj('#billingcheckbox').click(function(){
+  $('#billingcheckbox').click(function(){
     if(this.checked) {
-      cj('.billing_name_address-group').hide(200);
+      $('.billing_name_address-group').hide(200);
 
       // copy all values
       for(var id in input_ids) {
-        var orig_id = input_ids[id];
-        cj(orig_id).val( cj(id).val() );
-      };
+        orig_id = input_ids[id];
+        $(orig_id).val( $(id).val() );
+      }
       for(var id in select_ids) {
-        var orig_id = select_ids[id];
-        cj(orig_id+' option').prop('selected', false);
-        cj(orig_id+' option[value="'+cj(id).val()+'"]').prop('selected', true);
-      };
+        orig_id = select_ids[id];
+        $(orig_id+' option').prop('selected', false);
+        $(orig_id+' option[value="'+$(id).val()+'"]').prop('selected', true);
+      }
     } else {
-      cj('.billing_name_address-group').show(200);
+      $('.billing_name_address-group').show(200);
     }
   });
 
   // remove spaces, dashes from credit card number
-  cj('#credit_card_number').change(function(){
-    var cc = cj('#credit_card_number').val()
+  $('#credit_card_number').change(function(){
+    var cc = $('#credit_card_number').val()
       .replace(/ /g, '')
       .replace(/-/g, '');
-    cj('#credit_card_number').val(cc);
+    $('#credit_card_number').val(cc);
   });
 });
 {/literal}
index 467026328953da449264717be24c4f368359d8af..50c444755c3c3bc39fcf173768c28aecaf65c701 100644 (file)
 </div>
 {literal}
 <script type="text/Javascript">
-  var srcHtmlType = '{/literal}{$srcHtmlType}{literal}';
-  var singleValOps = new Array('Text', 'Select', 'Radio', 'Autocomplete-Select');
-  var multiValOps  = new Array('CheckBox', 'Multi-Select', 'AdvMulti-Select');
   function checkCustomDataField( ) {
+    var srcHtmlType = '{/literal}{$srcHtmlType}{literal}';
+    var singleValOps = ['Text', 'Select', 'Radio', 'Autocomplete-Select'];
+    var multiValOps  = ['CheckBox', 'Multi-Select', 'AdvMulti-Select'];
     var dstHtmlType = cj('#dst_html_type').val( );
     if ( !dstHtmlType ) {
       return true;
index 4697876fe2d26de645ef403bdfae579473bcdf78..e4b3d042db2880e52b8f74774f60d8d353384d9b 100644 (file)
@@ -88,7 +88,7 @@
 CRM.$(function($) {
 
   showHideStyle();
-  cj('#extends_0').change(function() {
+  $('#extends_0').change(function() {
     showHideStyle();
   });
 
@@ -96,64 +96,64 @@ CRM.$(function($) {
   if (isGroupEmpty) {
     showRange(true);
   }
-  cj('#is_multiple').click(function() {
+  $('#is_multiple').click(function() {
     showRange();
   });
 
   function showHideStyle() {
     var isShow  = false;
-    var extend  = cj('#extends_0').val();
+    var extend  = $('#extends_0').val();
 
     var contactTypes    = {/literal}{$contactTypes}{literal};
     var showStyle       = "{/literal}{$showStyle}{literal}";
     var showMultiple    = "{/literal}{$showMultiple}{literal}";
     var showMaxMultiple = "{/literal}{$showMaxMultiple}{literal}";
 
-    if (cj.inArray(extend, contactTypes) >= 0) {
+    if ($.inArray(extend, contactTypes) >= 0) {
       isShow  = true;
     }
 
     if (isShow) {
-      cj("tr#style").show();
-      cj("tr#is_multiple").show();
-      if (cj('#is_multiple :checked').length) {
-        cj("tr#multiple").show();
+      $("tr#style").show();
+      $("tr#is_multiple").show();
+      if ($('#is_multiple :checked').length) {
+        $("tr#multiple").show();
       }
     }
     else {
-      cj("tr#style").hide();
-      cj("tr#is_multiple").hide();
-      cj("tr#multiple").hide();
+      $("tr#style").hide();
+      $("tr#is_multiple").hide();
+      $("tr#multiple").hide();
     }
 
     if (showStyle) {
-      cj("tr#style").show();
+      $("tr#style").show();
     }
 
     if (showMultiple) {
-      cj("tr#style").show();
-      cj("tr#is_multiple").show();
+      $("tr#style").show();
+      $("tr#is_multiple").show();
     }
 
     if (!showMaxMultiple) {
-      cj("tr#multiple").hide();
+      $("tr#multiple").hide();
     }
-    else if(cj( '#is_multiple').prop('checked')) {
-      cj("tr#multiple").show();
+    else if($( '#is_multiple').prop('checked')) {
+      $("tr#multiple").show();
     }
   }
 
   function showRange(onFormLoad) {
-    if(cj("#is_multiple :checked").length) {
-      cj("tr#multiple").show();
-      cj('#collapse_display').prop('checked', '');
-      cj("select#style option[value='Tab with table']").prop("selected", true);
+    if($("#is_multiple :checked").length) {
+      $("tr#multiple").show();
+      $('#collapse_display').prop('checked', '');
+      $("select#style option[value='Tab with table']").prop("selected", true);
     }
     else {
-      cj('#collapse_display').prop('checked', 'checked');
-      cj("tr#multiple").hide();
+      $('#collapse_display').prop('checked', 'checked');
+      $("tr#multiple").hide();
       if (!onFormLoad) {
-        cj("select#style option[value='Inline']").prop("selected", true);
+        $("select#style option[value='Inline']").prop("selected", true);
       }
     }
   }
index 2c1e44ec7056346ed8750ce8a33e7cbbc4d7a184..afff593cd7fafe85b76a8fbf534ac990eaff64b6 100644 (file)
 <script type="text/javascript">
 {literal}
 CRM.$(function($) {
-    cj("#contact_id").change( function( ) {
+    $("#contact_id").change( function( ) {
         checkEmail( );
     } );
     checkEmail( );
index 2d4e0842055d27e1487c67f85691e4e39d2783b2..fd5c965cf748ac60213f18f9b6b617aa0671e892 100644 (file)
                 <script type="text/javascript">
                 {literal}
                     CRM.$(function($) {
-                        cj('#discounted_label_1').focus( );
+                        $('#discounted_label_1').focus( );
                     });
                 {/literal}
                 </script>
index 405774df9693f338a75568682110ec5ddeafea51..9b9ba3462358f9bcba3597d779389a2fc0dcf5e8 100755 (executable)
     <script type='text/javascript'>
       CRM.$(function($) {
         populateRecipient();
-        cj('#recipient').click( function( ) {
+        $('#recipient').click( function( ) {
           populateRecipient();
         });
       });
index c08bfe874bd5a5f07c0b077c40edb0bd30d5a721..cad2d9da89c68e3e3fad4902676592edb9a74e90 100644 (file)
     {literal}
     <script type="text/javascript">
 
-    var fieldOptionsFull = new Array( );
+    var fieldOptionsFull = [];
     {/literal}
     {foreach from=$priceSet.fields item=fldElement key=fldId}
       {if $fldElement.options}
         {foreach from=$fldElement.options item=fldOptions key=opId}
           {if $fldOptions.is_full}
             {literal}
-              fieldOptionsFull[{/literal}{$fldId}{literal}] = new Array( );
+              fieldOptionsFull[{/literal}{$fldId}{literal}] = [];
             fieldOptionsFull[{/literal}{$fldId}{literal}][{/literal}{$opId}{literal}] = 1;
           {/literal}
           {/if}
 
     if ( fieldOptionsFull.length > 0 ) {
       CRM.$(function($) {
-        cj("input,#priceset select,#priceset").each(function () {
-          if ( cj(this).attr('price') ) {
-            switch( cj(this).attr('type') ) {
+        $("input,#priceset select,#priceset").each(function () {
+          if ( $(this).attr('price') ) {
+            switch( $(this).attr('type') ) {
               case 'checkbox':
               case 'radio':
-                cj(this).click( function() {
+                $(this).click( function() {
                   validatePriceField(this);
                 });
                 break;
 
               case 'select-one':
-                cj(this).change( function() {
+                $(this).change( function() {
                   validatePriceField(this);
                 });
                 break;
               case 'text':
-                cj(this).bind( 'keyup', function() { validatePriceField(this) });
+                $(this).bind( 'keyup', function() { validatePriceField(this) });
                 break;
             }
           }
               <td class="font-size12pt view-value">{$displayName}&nbsp;</td>
             </tr>
             {else}
-            {if !$participantMode and !$email and $outBound_option != 2 }
-              {assign var='profileCreateCallback' value=1}
-            {/if}
             <tr class="crm-participant-form-contact-id">
               <td class="label">{$form.contact_id.label}</td>
               <td>{$form.contact_id.html}</td>
   }
 
   {/literal}
-  {if $profileCreateCallback}
-    {literal}
-    function profileCreateCallback( blockNo ) {
-      if( cj('#event_id').val( ) &&  cj('#email-receipt').length > 0 ) {
-        checkEmail( );
-      }
-    }
-    {/literal}
-  {/if}
 </script>
 
 {/if} {* end of main event block*}
index e6838e2f2ec4bf02967c8b572f26e0cb9e9674aa..50f84fb49cc6e425c237263b351f268ddbc011b8 100644 (file)
@@ -86,7 +86,7 @@ function populatebalanceFee(updatedAmt, onlyStatusUpdate) {
 }
 
 CRM.$(function($) {
-  var updatedFeeUnFormatted = cj('#pricevalue').text();
+  var updatedFeeUnFormatted = $('#pricevalue').text();
   var updatedAmt = parseFloat(updatedFeeUnFormatted.replace(/[^0-9-.]/g, ''));
 
   populatebalanceFee(updatedAmt, true);
index daa9633093e7e0738a4a41d2666068af31bba714..7e14d5aeed0d53f46c0be1d775ab2a8ae6265a5e 100644 (file)
@@ -93,9 +93,9 @@
  * Function to update participant status
  */
 CRM.$(function($) {
-   cj('#status_change').change( function() {
-      if ( cj(this).val() ) {
-        cj('.crm-copy-fields [name^="field["][name*="[participant_status]"]').val( cj(this).val() );
+   $('#status_change').change( function() {
+      if ( $(this).val() ) {
+        $('.crm-copy-fields [name^="field["][name*="[participant_status]"]').val( $(this).val() );
       }
    });
 
index 1368a541ad3479e17c8acea4116ca90b4500982d..03940dc20f079ac1586cd217083193d482b03d62 100644 (file)
 {literal}
 <script type="text/javascript">
   CRM.$(function($) {
-    cj('input[name="export_format"]').filter('[value=IIF]').prop('checked', true);
-    cj('#_qf_Export_next').click(function(){
-      cj(this).hide();
-      cj('#_qf_Export_cancel').val('{/literal}{ts}Done{/ts}{literal}');
+    $('input[name="export_format"]').filter('[value=IIF]').prop('checked', true);
+    $('#_qf_Export_next').click(function(){
+      $(this).hide();
+      $('#_qf_Export_cancel').val('{/literal}{ts}Done{/ts}{literal}');
     });
   });
 </script>
index 4be3523f5fdab6f983c249f781f8604076850263..6c6b74c5580746fe57ad0b38637ff2a2db6fbc16 100644 (file)
   </div>
 {literal}
 <script type="text/javascript">
-cj("#popupContainer").hide();
-cj("#button").click(function(){
-  cj("#popupContainer").dialog({
-    title: "Selected Contacts",
-    width:700,
-    height:500,
-    modal: true,
-    overlay: {
-                 opacity: 0.5,
-                  background: "black"
-                  }
-     });
-  });
-
-    CRM.$(function($) {
-        var count = 0; var columns=''; var sortColumn = '';
 
-        cj('#selectedRecords th').each( function( ) {
-          if ( cj(this).attr('class') == 'contact_details' ) {
-      sortColumn += '[' + count + ', "asc" ],';
-      columns += '{"sClass": "contact_details"},';
-    } else {
-      columns += '{ "bSortable": false },';
-    }
-    count++;
-  });
+  CRM.$(function($) {
+    $("#popupContainer").hide();
+    $("#button").click(function() {
+      $("#popupContainer").dialog({
+        title: "Selected Contacts",
+        width:700,
+        height:500,
+        modal: true
+      });
+    });
+    var count = 0; var columns=''; var sortColumn = '';
 
-  columns    = columns.substring(0, columns.length - 1 );
-  sortColumn = sortColumn.substring(0, sortColumn.length - 1 );
-  eval('sortColumn =[' + sortColumn + ']');
-  eval('columns =[' + columns + ']');
+    $('#selectedRecords th').each( function( ) {
+      if ( $(this).attr('class') == 'contact_details' ) {
+        sortColumn += '[' + count + ', "asc" ],';
+        columns += '{"sClass": "contact_details"},';
+      } else {
+        columns += '{ "bSortable": false },';
+      }
+      count++;
+    });
 
-  //load jQuery data table.
-        cj('#selectedRecords').dataTable( {
-    "sPaginationType": "full_numbers",
-    "bJQueryUI"  : true,
-    "aaSorting"  : sortColumn,
-    "aoColumns"  : columns,
-    "bFilter"    : false
-        });
+    columns    = columns.substring(0, columns.length - 1 );
+    sortColumn = sortColumn.substring(0, sortColumn.length - 1 );
+    eval('sortColumn =[' + sortColumn + ']');
+    eval('columns =[' + columns + ']');
 
+    //load jQuery data table.
+    $('#selectedRecords').dataTable( {
+      "sPaginationType": "full_numbers",
+      "bJQueryUI"  : true,
+      "aaSorting"  : sortColumn,
+      "aoColumns"  : columns,
+      "bFilter"    : false
     });
 
+  });
+
 </script>
 {/literal}
 {/if}
index 7ad51d80322451b28571cafbff82bf10addc9d3e..cf5ebcd07ca9b52027687665da32b6d4c184ba45 100644 (file)
@@ -253,7 +253,7 @@ if ( isMailing ) {
   {literal}
     CRM.$(function($) {
       if ( isMailing ) {
-        cj('div.html').hover(
+        $('div.html').hover(
           function( ) {
             if ( tinyMCE.get(html_message) ) {
               tinyMCE.get(html_message).onKeyUp.add(function() {
@@ -276,7 +276,7 @@ if ( isMailing ) {
   {literal}
     CRM.$(function($) {
       if ( isMailing ) {
-        cj('div.html').hover(
+        $('div.html').hover(
           verify,
           verify
         );
@@ -347,7 +347,7 @@ CRM.$(function($) {
       }
     }
     else {
-      cj( "#"+ html_message ).replaceSelection( token );
+      $( "#"+ html_message ).replaceSelection( token );
     }
   }
 
@@ -361,29 +361,29 @@ CRM.$(function($) {
       placeholder: '{/literal}{ts escape='js'}Insert Token{/ts}{literal}'
     });
 
-  cj('.accordion .head').addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ");
-  cj('.resizable-textarea textarea').css( 'width', '99%' );
-  cj('.grippie').css( 'margin-right', '3px');
-  cj('.accordion .head').hover( function() { cj(this).addClass( "ui-state-hover");
-  }, function() { cj(this).removeClass( "ui-state-hover");
+  $('.accordion .head').addClass( "ui-accordion-header ui-helper-reset ui-state-default ui-corner-all ");
+  $('.resizable-textarea textarea').css( 'width', '99%' );
+  $('.grippie').css( 'margin-right', '3px');
+  $('.accordion .head').hover( function() { $(this).addClass( "ui-state-hover");
+  }, function() { $(this).removeClass( "ui-state-hover");
   }).bind('click', function() {
-    var checkClass = cj(this).find('span').attr( 'class' );
+    var checkClass = $(this).find('span').attr( 'class' );
     var len        = checkClass.length;
     if ( checkClass.substring( len - 1, len ) == 's' ) {
-      cj(this).find('span').removeClass().addClass('ui-icon ui-icon-triangle-1-e');
-      cj("span#help"+cj(this).find('span').attr('id')).hide();
+      $(this).find('span').removeClass().addClass('ui-icon ui-icon-triangle-1-e');
+      $("span#help"+$(this).find('span').attr('id')).hide();
     }
     else {
-      cj(this).find('span').removeClass().addClass('ui-icon ui-icon-triangle-1-s');
-      cj("span#help"+cj(this).find('span').attr('id')).show();
+      $(this).find('span').removeClass().addClass('ui-icon ui-icon-triangle-1-s');
+      $("span#help"+$(this).find('span').attr('id')).show();
     }
-    cj(this).next().toggle(); return false;
+    $(this).next().toggle(); return false;
   }).next().hide();
-  cj('span#html').removeClass().addClass('ui-icon ui-icon-triangle-1-s');
-  cj("div.html").show();
+  $('span#html').removeClass().addClass('ui-icon ui-icon-triangle-1-s');
+  $("div.html").show();
 
   if ( !isMailing ) {
-    cj("div.text").show();
+    $("div.text").show();
   }
 
   function setSignature() {
@@ -433,12 +433,12 @@ CRM.$(function($) {
       }, 'json');
     }
   }
-  if (!cj().find('div.crm-error').text()) {
-    cj(window).load(function () {
+  if (!$().find('div.crm-error').text()) {
+    $(window).load(function () {
       setSignature();
     });
   }
-  cj("#fromEmailAddress").change( function( ) {
+  $("#fromEmailAddress").change( function( ) {
     setSignature( );
   });
 });
index 80fdc36e24cafcab23bb1e8faa6022ddffa63221..64f65c4cd6a71895a29f2a9f447f2bdd93ce800e 100644 (file)
 <script type="text/javascript">
 {literal}
 CRM.$(function($) {
-   cj('#start_date_display').change( function( ) {
-       if ( cj(this).val( ) ) {
-          cj('#now').prop('checked', false );
+   $('#start_date_display').change( function( ) {
+       if ( $(this).val( ) ) {
+          $('#now').prop('checked', false );
        }
    });
-   cj('#now').change( function( ) { 
-       if ( cj('#now').prop('checked', true ) ) {
-          cj('#start_date_display').val( '' );
-          cj('#start_date').val( '' );
-          cj('#start_date_time').val( '' );
+   $('#now').change( function( ) { 
+       if ( $('#now').prop('checked', true ) ) {
+          $('#start_date_display').val( '' );
+          $('#start_date').val( '' );
+          $('#start_date_time').val( '' );
        }
    });
 });
index 4a1c1d4398d316437cf095cce8e19f5ae7e9a7c2..06a1b9b3df3c06a5622d0b1193a0e5150e6f5917 100644 (file)
 
 CRM.$(function($) {
   // hide all the selects that contains only one option
-  cj('.crm-message-select select').each(function (){
-    if (cj(this).find('option').size() == 1) {
-      cj(this).parent().parent().hide();
+  $('.crm-message-select select').each(function (){
+    if ($(this).find('option').size() == 1) {
+      $(this).parent().parent().hide();
     }
   });
-  if (!cj('#override_verp').prop('checked')){
-    cj('.crm-mailing-settings-form-block-forward_replies,.crm-mailing-settings-form-block-auto_responder').hide();
+  if (!$('#override_verp').prop('checked')){
+    $('.crm-mailing-settings-form-block-forward_replies,.crm-mailing-settings-form-block-auto_responder').hide();
   }
-  cj('#override_verp').click(function(){
-      cj('.crm-mailing-settings-form-block-forward_replies,.crm-mailing-settings-form-block-auto_responder').toggle();
-       if (!cj('#override_verp').prop('checked')) {
-             cj('#forward_replies, #auto_responder').prop('checked', false);
+  $('#override_verp').click(function(){
+      $('.crm-mailing-settings-form-block-forward_replies,.crm-mailing-settings-form-block-auto_responder').toggle();
+       if (!$('#override_verp').prop('checked')) {
+             $('#forward_replies, #auto_responder').prop('checked', false);
            }
     });
 
index e2cb09113d9389cc54ac826edc58ced868a17b33..741144a3af13ba59844fa5940cf9edad55760871 100644 (file)
@@ -72,7 +72,7 @@
   <script type="text/javascript">
     var totalPages = {/literal}{$pager->_totalPages}{literal};
     CRM.$(function($) {
-      cj("#crm-container .crm-pager input.crm-form-submit").click(function () {
+      $("#crm-container .crm-pager input.crm-form-submit").click(function () {
         submitPagerData(this);
       });
     });
index 56af3df465915598f5d3ad95f620c7bb3b1d3185..77229a2dbb145b307594fba06a15453feb50644a 100644 (file)
@@ -38,7 +38,7 @@
   {literal}
   <script type="text/javascript">
   CRM.$(function($) {
-    var membershipValues = new Array;
+    var membershipValues = [];
     {/literal}{foreach from=$optionsMembershipTypes item=memType key=opId}{literal}
       membershipValues[{/literal}{$opId}{literal}] = {/literal}{$memType}{literal};
     {/literal}{/foreach}{literal}
@@ -85,9 +85,6 @@
             <td class="font-size12pt label"><strong>{ts}Member{/ts}</strong></td><td class="font-size12pt"><strong>{$displayName}</strong></td>
           </tr>
         {else}
-          {if !$membershipMode and !$emailExists and $outBound_option != 2}
-            {assign var='profileCreateCallback' value=1 }
-          {/if}
           <td class="label">{$form.contact_id.label}</td>
           <td>{$form.contact_id.html}</td>
         {/if}
       }
     }
 
-    var lastMembershipTypes = new Array;
-    var optionsMembershipTypes = new Array;
+    var lastMembershipTypes = [];
+    var optionsMembershipTypes = [];
 
     // function to load custom data for selected membership types through priceset
     function processMembershipPriceset( membershipValues, autoRenewOption, reload ) {
-      var currentMembershipType = new Array;
+      var currentMembershipType = [];
       var count = 0;
       var loadCustomData = 0;
       if ( membershipValues ) {
       }
 
       if ( reload ) {
-        lastMembershipTypes = new Array;
+        lastMembershipTypes = [];
         {/literal}{if $allowAutoRenew}{literal}
         cj('#autoRenew').hide();
         var autoRenew = cj("#auto_renew");
index 5e4feb6f24dede21606a333441aaefcfe254de60..868501502330dfd34218b2fdc6e87a1b60957aeb 100644 (file)
     CRM.$(function($) {
         //show/hide membership block
         showHideMembershipBlock();
-        cj('#member_is_active').click( function() {
+        $('#member_is_active').click( function() {
             showHideMembershipBlock();
         });
 
         //show/ hide blocks if price set is selected
         checkIfPriceSetIsSelected( );
-        cj('#member_price_set_id').change( function(){
+        $('#member_price_set_id').change( function(){
             checkIfPriceSetIsSelected( );
         });
     });
index 17b220ae30170b6c013db5719318808fbd5324fa..c817bef7b206ffc29eebca1a3404aefa7f97c460 100644 (file)
 {literal}
   <script type="text/javascript">
     CRM.$(function($) {
-      cj('#membershipOrgType').hide();
-      cj('#changeNumTerms').hide();
+      $('#membershipOrgType').hide();
+      $('#changeNumTerms').hide();
       {/literal}
       CRM.buildCustomData('{$customDataType}');
       {if $customDataSubType}
index 689df9e91399c3e35163b582f389ecfb56eb4c12..214daf71b165adb0c413a968003041f21d832b7c 100644 (file)
 <script type="text/javascript">
 CRM.$(function($) {
   showHidePeriodSettings();
-  cj('#duration_unit').change(function(){
+  $('#duration_unit').change(function(){
     showHidePeriodSettings();
   });
 
-  cj('#period_type').change(function(){
+  $('#period_type').change(function(){
     showHidePeriodSettings();
   });
 
   {/literal}
   {if $action eq 2}
   {literal}
-    showHideMaxRelated(cj('#relationship_type_id').val());
-    cj('#relationship_type_id').change(function(){
-      showHideMaxRelated(cj('#relationship_type_id').val());
+    showHideMaxRelated($('#relationship_type_id').val());
+    $('#relationship_type_id').change(function(){
+      showHideMaxRelated($('#relationship_type_id').val());
     });
   {/literal}{else}{literal}
-    showHideMaxRelated(cj('#relationship_type_id :selected').val());
-    cj('#relationship_type_id').change(function(){
-      showHideMaxRelated(cj('#relationship_type_id :selected').val());
+    showHideMaxRelated($('#relationship_type_id :selected').val());
+    $('#relationship_type_id').change(function(){
+      showHideMaxRelated($('#relationship_type_id :selected').val());
     });
   {/literal}{/if}{literal}
 });
index df073bb0587514793e200cf5693bb4eaf3a640c9..2052ba67225610512fd635079a45bab0a76cc406 100644 (file)
@@ -59,9 +59,6 @@
    {else}
       <table class="form-layout-compressed">
         {if $context eq 'standalone'}
-          {if !$email and $outBound_option != 2}
-            {assign var='profileCreateCallback' value=1 }
-          {/if}
           <tr class="crm-pledge-form-contact-id">
             <td class="label">{$form.contact_id.label}</td>
             <td>{$form.contact_id.html}</td>
@@ -245,35 +242,25 @@ function loadPanes( id ) {
     {if $context eq 'standalone' and $outBound_option != 2 }
     {literal}
     CRM.$(function($) {
-        cj("#contact_1").blur( function( ) {
-            checkEmail( );
-        });
-        checkEmail( );
-  showHideByValue( 'is_acknowledge', '', 'acknowledgeDate', 'table-row', 'radio', true);
-  showHideByValue( 'is_acknowledge', '', 'fromEmail', 'table-row', 'radio', false );
+      var $form = $("#{/literal}{$form.formName}{literal}");
+      $("#contact_id", $form).change(checkEmail);
+      checkEmail( );
+
+      function checkEmail( ) {
+        var data = $("#contact_id", $form).select2('data');
+        if (data && data.extra && data.extra.email && data.extra.email.length) {
+          $("#acknowledgment-receipt", $form).show();
+          $("#email-address", $form).html(data.extra.email);
+        }
+        else {
+          $("#acknowledgment-receipt", $form).hide();
+        }
+      }
+
+      showHideByValue( 'is_acknowledge', '', 'acknowledgeDate', 'table-row', 'radio', true);
+      showHideByValue( 'is_acknowledge', '', 'fromEmail', 'table-row', 'radio', false );
     });
-    function checkEmail( ) {
-        var contactID = cj("input[name='contact_select_id[1]']").val();
-        if ( contactID ) {
-            var postUrl = "{/literal}{crmURL p='civicrm/ajax/checkemail' h=0}{literal}";
-            cj.post( postUrl, {contact_id: contactID},
-                function ( response ) {
-                    if ( response ) {
-                        cj("#acknowledgment-receipt").show( );
-                        cj("#email-address").html( response );
-                    } else {
-                        cj("#acknowledgment-receipt").hide( );
-                    }
-                }
-            );
-        } else {
-    cj("#acknowledgment-receipt").hide( );
-  }
-    }
 
-    function profileCreateCallback( blockNo ) {
-        checkEmail( );
-    }
     {/literal}
     {/if}
 </script>
index d2ae77d6d33cb6ff06eae6da286bf112a0fcd536..c583f2b66b3e72b0e212bd30906c6bf11e6e4556 100644 (file)
@@ -83,7 +83,7 @@
        <td class="left"><h5 class='editPayment'></h5>
 {literal}
 <script type="text/javascript">
-cj(document).ready(function(){
+CRM.$(function($) {
   cj(document).on('blur', '.distribute', function() {
    var totalAmount = 0;
    cj('.distribute').each(function (){
index 83565003632684dbe30c49423b11d274d958e672..0d9784f35611911c04130d8141c32b80626005cc 100644 (file)
@@ -265,7 +265,7 @@ invert              = 0
 {literal}
 <script type="text/javascript">
 
-cj(document).ready(function(){
+CRM.$(function($) {
   cj('#selector tr:even').addClass('odd-row ');
   cj('#selector tr:odd ').addClass('even-row');
 });
index c690b58990a7a9b1b0209e31a35fd08616d07bce..110c10d4917543a4e1bd883a988c468e7c59f5ef 100644 (file)
 {literal}
   <script type="text/javascript">
     CRM.$(function($) {
-      cj('#selector tr:even').addClass('odd-row ');
-      cj('#selector tr:odd ').addClass('even-row');
+      $('#selector tr:even').addClass('odd-row ');
+      $('#selector tr:odd ').addClass('even-row');
     });
   </script>
 {/literal}
index dc9705e9664288d398b27a9eec8947487b48bfca..f8b2cb09a6b4b9f3b6af837dbd26e7d65dd6eff1 100644 (file)
@@ -28,32 +28,32 @@ CRM.$(function($) {
     }
     
     var pct = 100 * queueRunnerData.completed / (queueRunnerData.completed + queueRunnerData.numberOfItems);
-    cj("#crm-queue-runner-progress").progressbar({ value: pct });
+    $("#crm-queue-runner-progress").progressbar({ value: pct });
     
     if (data.is_error) {
-      cj("#crm-queue-runner-buttonset").show();
+      $("#crm-queue-runner-buttonset").show();
       if (queueRunnerData.isEnded) {
-        cj('#crm-queue-runner-skip').button('disable');
+        $('#crm-queue-runner-skip').button('disable');
       }
-      cj('#crm-queue-runner-title').text('Error: ' + data.last_task_title);
+      $('#crm-queue-runner-title').text('Error: ' + data.last_task_title);
     } else if (!data.is_continue && queueRunnerData.numberOfItems == 0) {
-      cj('#crm-queue-runner-title').text('Done');
+      $('#crm-queue-runner-title').text('Done');
     } else {
-      cj('#crm-queue-runner-title').text('Executed: ' + data.last_task_title);
+      $('#crm-queue-runner-title').text('Executed: ' + data.last_task_title);
     }
     
     if (data.exception) {
-      cj('#crm-queue-runner-message').html('');
-      cj('<div></div>').html(data.exception).prependTo('#crm-queue-runner-message');
+      $('#crm-queue-runner-message').html('');
+      $('<div></div>').html(data.exception).prependTo('#crm-queue-runner-message');
     }
     
   };
   
   var handleError = function(jqXHR, textStatus, errorThrown) {
     // Do this regardless of whether the response was well-formed
-    cj("#crm-queue-runner-buttonset").show();
+    $("#crm-queue-runner-buttonset").show();
     
-    var data = cj.parseJSON(jqXHR.responseText)
+    var data = $.parseJSON(jqXHR.responseText)
     if (data) {
       displayResponseData(data);
     }
@@ -80,7 +80,7 @@ CRM.$(function($) {
   
   // Dequeue and execute the next item
   var runNext = function() {
-    cj.ajax({
+    $.ajax({
       type: 'POST',
       url: (queueRunnerData.isEnded ? queueRunnerData.onEndAjax : queueRunnerData.runNextAjax),
       data: {
@@ -88,7 +88,7 @@ CRM.$(function($) {
       },
       dataType: 'json',
       beforeSend: function(jqXHR, settings) {
-          cj("#crm-queue-runner-buttonset").hide();
+          $("#crm-queue-runner-buttonset").hide();
       },
       error: handleError,
       success: handleSuccess
@@ -96,13 +96,13 @@ CRM.$(function($) {
   }
   
   var retryNext = function() {
-    cj('#crm-queue-runner-message').html('');
+    $('#crm-queue-runner-message').html('');
     runNext();
   }
   
   // Dequeue and the next item, then move on to runNext for the subsequent items
   var skipNext = function() {
-    cj.ajax({
+    $.ajax({
       type: 'POST',
       url: queueRunnerData.skipNextAjax,
       data: {
@@ -110,8 +110,8 @@ CRM.$(function($) {
       },
       dataType: 'json',
       beforeSend: function(jqXHR, settings) {
-        cj('#crm-queue-runner-message').html('');
-        cj("#crm-queue-runner-buttonset").hide();
+        $('#crm-queue-runner-message').html('');
+        $("#crm-queue-runner-buttonset").hide();
       },
       error: handleError,
       success: handleSuccess
@@ -120,25 +120,25 @@ CRM.$(function($) {
   
   // Set up the UI
   
-  cj("#crm-queue-runner-progress").progressbar({ value: 0 });
+  $("#crm-queue-runner-progress").progressbar({ value: 0 });
   if (queueRunnerData.buttons.retry == 1) {
-  cj("#crm-queue-runner-retry").button({
+  $("#crm-queue-runner-retry").button({
     text: false,
     icons: {primary: 'ui-icon-refresh'}
   }).click(retryNext);
   } else {
-    cj("#crm-queue-runner-retry").remove();
+    $("#crm-queue-runner-retry").remove();
   }
   if (queueRunnerData.buttons.skip == 1) {
-  cj("#crm-queue-runner-skip").button({
+  $("#crm-queue-runner-skip").button({
     text: false,
     icons: {primary: 'ui-icon-seek-next'}
   }).click(skipNext);
   } else {
-    cj("#crm-queue-runner-skip").remove();
+    $("#crm-queue-runner-skip").remove();
   }
-  cj("#crm-queue-runner-buttonset").buttonset();
-  cj("#crm-queue-runner-buttonset").hide();
+  $("#crm-queue-runner-buttonset").buttonset();
+  $("#crm-queue-runner-buttonset").hide();
   window.setTimeout(runNext, 50);
 });
 
index b3fa82d23d865918675014be89a5b9508ec876ac..2679bf054cf7bdc855e58f3195bdaef6a0aebff8 100644 (file)
             }
         }
 
-    cj(document).ready(function(){
-      cj('.crm-report-criteria-groupby input:checkbox').click(function() {
-        cj('#fields_' + this.id.substr(10)).prop('checked', this.checked);
+    CRM.$(function($) {
+      $('.crm-report-criteria-groupby input:checkbox').click(function() {
+        $('#fields_' + this.id.substr(10)).prop('checked', this.checked);
       });
       {/literal}{if $displayToggleGroupByFields}{literal}
-      cj('.crm-report-criteria-field input:checkbox').click(function() {
-        cj('#group_bys_' + this.id.substr(7)).prop('checked', this.checked);
+      $('.crm-report-criteria-field input:checkbox').click(function() {
+        $('#group_bys_' + this.id.substr(7)).prop('checked', this.checked);
       });
       {/literal}{/if}{literal}
     });
index fd2472d3152b58a3f50a5853cf6236dd555750bf..7519db6d23688e01851383416bde63da675660d1 100644 (file)
 
 {literal}
 <script type="text/javascript">
-  cj(document).ready(function(){
-    cj('#birth_date_from').attr('startOffset',200);
-    cj('#birth_date_from').attr('endoffset',0);
-    cj('#birth_date_to').attr('startOffset',200);
-    cj('#birth_date_to').attr('endoffset',0);
+  CRM.$(function($) {
+    $('#birth_date_from, #birth_date_to').attr({startOffset: '200', endoffset: '0'});
   });
 </script>
 {/literal}
index 301da14aa769df9baebcf72047676aa7672f9eff..2fc9f42fd8f397dd00d7bba5feacd0290651a964 100644 (file)
   });
   CRM.$(function($) {
       var formName = {/literal}"{$form.formName}"{literal};
-      cj('#_qf_' + formName + '_submit_save').click (
+      $('#_qf_' + formName + '_submit_save').click (
           function(){
-              if ( cj('#is_navigation').prop('checked') && cj('#parent_id').val() == '') {
+              if ( $('#is_navigation').prop('checked') && $('#parent_id').val() == '') {
                   var confirmMsg = {/literal}'{ts escape="js"}You have chosen to include this report in the Navigation Menu without selecting a Parent Menu item from the dropdown. This will add the report to the top level menu bar. Are you sure you want to continue?{/ts}'{literal}
                   return confirm(confirmMsg);
               }
           }
       );
-      cj('#_qf_' + formName + '_submit_next').click (
+      $('#_qf_' + formName + '_submit_next').click (
           function(){
-              if ( cj('#title').data('initial_value') == cj('#title').val() ) {
+              if ( $('#title').data('initial_value') == $('#title').val() ) {
                   var confirmMsg = {/literal}'{ts escape="js"}You are saving a copy of this report with the same report title. Are you sure you want to continue?{/ts}'{literal}
                   return confirm(confirmMsg);
               }
index c23920f0f2197f3d34f30f1ce73790c912d32ae0..5936a356cb0048a24c67733cbbfc23f59ddf900d 100644 (file)
@@ -50,7 +50,7 @@
    CRM.$(function($) {
      buildChart( );
 
-     cj("input[id$='submit_print'],input[id$='submit_pdf']").bind('click', function(e){
+     $("input[id$='submit_print'],input[id$='submit_pdf']").bind('click', function(e){
        // image creator php file path and append image name
        var url = CRM.url('civicrm/report/chart', 'name=' + '{/literal}{$chartId}{literal}' + '.png');
 
index 86679daeb77202ce48af2d27d10f353cdde64639..950db84a3e36088d5194fd17c43ff9e8ef16ad7d 100644 (file)
 
 {literal}
 CRM.$(function($) {
-   cj('#start_date_display').change( function( ) { 
-       if ( cj(this).val( ) ) {
-          cj('#now').prop('checked', false );
+   $('#start_date_display').change( function( ) { 
+       if ( $(this).val( ) ) {
+          $('#now').prop('checked', false );
        }
    });
-   cj('#now').change( function( ) { 
-       if ( cj('#now').prop('checked', true ) ) {
-          cj('#start_date_display').val( '' );
-          cj('#start_date').val( '' );
-          cj('#start_date_time').val( '' );
+   $('#now').change( function( ) { 
+       if ( $('#now').prop('checked', true ) ) {
+          $('#start_date_display').val( '' );
+          $('#start_date').val( '' );
+          $('#start_date_time').val( '' );
        }
    });
 });
index a7763289b698026624f13c7c2a423dda5d99edb2..e49f3c257791f892c7bd2afa92c518f3195b56f2 100644 (file)
 {literal}
 <script type="text/javascript">
   CRM.$(function($) {
-    cj('#selector tr:even').addClass('odd-row ');
-    cj('#selector tr:odd ').addClass('even-row');
+    $('#selector tr:even').addClass('odd-row');
+    $('#selector tr:odd ').addClass('even-row');
   });
 </script>
 {/literal}
index 02f4572378a4595b919225e1a878fcfb27061cb6..067cf5ddee06b7040c329020d3cc7eed1d3834b7 100644 (file)
 
 {literal}
 <script type="text/javascript">
-var otherModule = new Array( );
-{/literal}{foreach from=$otherModules item="mval" key="mkey"}{literal}
-otherModule[{/literal}{$mkey}{literal}] = '{/literal}{$mval}{literal}';
-{/literal}{/foreach}{literal}
 
 CRM.$(function($) {
+  var otherModule = {/literal}{$otherModules|@json_encode}{literal};
   if ( $.inArray( "Profile", otherModule ) > -1 && $.inArray( "Search Profile", otherModule ) == -1 ){
     $('#profile_visibility').show();
   }
index 21289ec4821264f3d6584de20f2793d0696369b2..bcdd8cc6d4709cfdfcce3d65d2fb389c906dc083 100644 (file)
   <script type='text/javascript'>
       CRM.$(function($) {ldelim}
         var selectedTab = '{if $selectedChild}{$selectedChild}{else}user-profiles{/if}';
-        var tabIndex = cj('#tab_' + selectedTab).prevAll().length;
+        var tabIndex = $('#tab_' + selectedTab).prevAll().length;
         {literal}
-        cj("#mainTabContainer").tabs( {active: tabIndex} );
+        $("#mainTabContainer").tabs( {active: tabIndex} );
       });
     {/literal}
   </script>
index 6dbff68fc2e15ad948de0ad5f77e9065ab1ee57e..30ea784edc41ce33a13506bf005c1e03e7ed2b56 100644 (file)
@@ -29,7 +29,7 @@
 CRM.$(function($) {
 {/literal}
     {foreach from=$trackingFields key=trackingFieldName item=dontCare}
-       cj("#{$trackingFieldName}").parent().parent().hide( );
+       $("#{$trackingFieldName}").parent().parent().hide( );
     {/foreach}
 {literal}
   }
index 45adc63e4d883a27169173b2abcbf5fb31da0587..c0cbaf0ad74fed11d93c4c170919ef955ceeaf9c 100644 (file)
@@ -177,7 +177,7 @@ function clearFirstBlock( blockName , blockId ) {
 }
 
 function getAddressBlock( position ) {
-   var addressBlockIds = new Array();
+   var addressBlockIds = [];
    var i = 0;
    switch ( position ) {
         case 'last':
index 8103142b1fe012e526ddbdc0855669d50a0f1491..2b6456b6fc12cd2f1e50ed0e51622d2e016f3c9f 100644 (file)
 {literal}
 <script type="text/javascript">
   CRM.$(function($) {
-    //bind the click event for action icon
-    cj('.action-icon').click( function( ) {
-      copyFieldValues( cj(this).attr('fname') );
-    });
-  });
-
-  /**
-   * This function use to copy fieldsi
-   *
-   * @param fname string field name
-   * @return void
-   */
-  function copyFieldValues( fname ) {
-    // this is the most common pattern for elements, so first check if it exits
-    // this check field starting with "field[" and contains [fname] and is not
-    // hidden ( for checkbox hidden element is created )
-    var elementId    = cj('.crm-copy-fields [name^="field["][name*="[' + fname +']"][type!=hidden]');
-
-    // get the first element and it's value
-    var firstElement = elementId.eq(0);
-    var firstElementValue = firstElement.val();
-
-    //console.log( elementId );
-    //console.log( firstElement );
-    //console.log( firstElementValue );
-
-    //check if it is date element
-    var isDateElement     = elementId.attr('format');
-
-    // check if it is wysiwyg element
-    var editor = elementId.attr('editor');
-
-    //get the element type
-    var elementType       = elementId.attr('type');
-
-    // set the value for all the elements, elements needs to be handled are
-    // select, checkbox, radio, date fields, text, textarea, multi-select
-    // wysiwyg editor, advanced multi-select ( to do )
-    if ( elementType == 'radio' ) {
-      firstElementValue = elementId.filter(':checked').eq(0).val();
-      elementId.filter("[value=" + firstElementValue + "]").prop("checked",true).change();
-    }
-    else if ( elementType == 'checkbox' ) {
-      // handle checkbox
-      // get the entity id of first element
-      var firstEntityId = cj('.crm-copy-fields > tbody > tr');
-
-      if ( firstEntityId.length == 0 ) {
-        firstEntityId = firstElement.closest('div.crm-grid-row');
+    /**
+     * This function use to copy fields
+     *
+     * @param fname string field name
+     * @return void
+     */
+    function copyFieldValues( fname ) {
+      // this is the most common pattern for elements, so first check if it exits
+      // this check field starting with "field[" and contains [fname] and is not
+      // hidden ( for checkbox hidden element is created )
+      var elementId    = $('.crm-copy-fields [name^="field["][name*="[' + fname +']"][type!=hidden]');
+
+      // get the first element and it's value
+      var firstElement = elementId.eq(0);
+      var firstElementValue = firstElement.val();
+
+      //check if it is date element
+      var isDateElement     = elementId.attr('format');
+
+      // check if it is wysiwyg element
+      var editor = elementId.attr('editor');
+
+      //get the element type
+      var elementType       = elementId.attr('type');
+
+      // set the value for all the elements, elements needs to be handled are
+      // select, checkbox, radio, date fields, text, textarea, multi-select
+      // wysiwyg editor, advanced multi-select ( to do )
+      if ( elementType == 'radio' ) {
+        firstElementValue = elementId.filter(':checked').eq(0).val();
+        elementId.filter("[value=" + firstElementValue + "]").prop("checked",true).change();
       }
+      else if ( elementType == 'checkbox' ) {
+        // handle checkbox
+        // get the entity id of first element
+        var firstEntityId = $('.crm-copy-fields > tbody > tr');
 
-      firstEntityId = firstEntityId.attr('entity_id');
+        if ( firstEntityId.length == 0 ) {
+          firstEntityId = firstElement.closest('div.crm-grid-row');
+        }
 
-      var firstCheckElement = cj('.crm-copy-fields [type=checkbox][name^="field['+ firstEntityId +']['+ fname +']"][type!=hidden]');
+        firstEntityId = firstEntityId.attr('entity_id');
 
-      if ( firstCheckElement.length > 1 ) {
-        // lets uncheck all the checkbox except first one
-        cj('.crm-copy-fields [type=checkbox][name^="field["][name*="[' + fname +']"][type=checkbox]:not([name^="field['+ firstEntityId +']['+ fname +']["])').prop('checked', false);
+        var firstCheckElement = $('.crm-copy-fields [type=checkbox][name^="field['+ firstEntityId +']['+ fname +']"][type!=hidden]');
 
-        //here for each checkbox for first row, check if it is checked and set remaining checkboxes
-        firstCheckElement.each(function() {
-          if (cj(this).prop('checked') ) {
-            var elementName = cj(this).attr('name');
-            var correctIndex = elementName.split('field['+ firstEntityId +']['+ fname +'][');
-            correctIndexValue = correctIndex[1].replace(']', '');
-            cj('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']['+ correctIndexValue+']"][type!=hidden]').prop('checked',true).change();
-          }
-        });
-      }
-      else {
-        if ( firstCheckElement.prop('checked') ) {
-          cj('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']"][type!=hidden]').prop('checked',true).change();
+        if ( firstCheckElement.length > 1 ) {
+          // lets uncheck all the checkbox except first one
+          $('.crm-copy-fields [type=checkbox][name^="field["][name*="[' + fname +']"][type=checkbox]:not([name^="field['+ firstEntityId +']['+ fname +']["])').prop('checked', false);
+
+          //here for each checkbox for first row, check if it is checked and set remaining checkboxes
+          firstCheckElement.each(function() {
+            if ($(this).prop('checked') ) {
+              var elementName = $(this).attr('name');
+              var correctIndex = elementName.split('field['+ firstEntityId +']['+ fname +'][');
+              correctIndexValue = correctIndex[1].replace(']', '');
+              $('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']['+ correctIndexValue+']"][type!=hidden]').prop('checked',true).change();
+            }
+          });
         }
         else {
-          cj('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']"][type!=hidden]').prop('checked', false).change();
+          if ( firstCheckElement.prop('checked') ) {
+            $('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']"][type!=hidden]').prop('checked',true).change();
+          }
+          else {
+            $('.crm-copy-fields [type=checkbox][name^="field["][name*="['+ fname +']"][type!=hidden]').prop('checked', false).change();
+          }
         }
       }
-    }
-    else if ( editor ) {
+      else if ( editor ) {
         var firstElementId = firstElement.attr('id');
         switch ( editor ) {
           case 'ckeditor':
 
             // copy first element content to all the elements
             elementId.each( function() {
-              var elemtId = cj(this).attr('id');
+              var elemtId = $(this).attr('id');
               oEditor = CKEDITOR.instances[elemtId];
               oEditor.setData( htmlContent );
             });
 
             // copy first element content to all the elements
             elementId.each( function() {
-              var elemtId = cj(this).attr('id');
+              var elemtId = $(this).attr('id');
               tinyMCE.get( elemtId ).setContent( htmlContent );
             });
             break;
         if (elementId.is('select') === true && firstElement.parent().find(':input').select().index() >= 1 && firstElement.parent().find('select').select().index < 1) {
           // its a multiselect case
           firstElement.parent().find(':input').select().each( function(count) {
-            var firstElementValue = cj(this).val();
-            var elementId = cj('.crm-copy-fields [name^="field["][name*="[' + fname +'][' + count + '"][type!=hidden]');
+            var firstElementValue = $(this).val();
+            var elementId = $('.crm-copy-fields [name^="field["][name*="[' + fname +'][' + count + '"][type!=hidden]');
             elementId.val(firstElementValue).not(":first").change();
           });
         }
         }
       }
 
-    // since we use different display field for date we also need to set it.
-    // also check for date time field and set the value correctly
-    if ( isDateElement ) {
-      copyValuesDate( fname );
+      // since we use different display field for date we also need to set it.
+      // also check for date time field and set the value correctly
+      if ( isDateElement ) {
+        copyValuesDate( fname );
+      }
+    }
+
+    /**
+     * Special function to handle setting values for date fields
+     *
+     * @param fname string field name
+     * @return void
+     */
+    function copyValuesDate(fname) {
+      var fnameDisplay = fname + '_display';
+      var fnameTime    = fname + '_time';
+
+      var displayElement = $('.crm-copy-fields [name^="field_"][name$="_' + fnameDisplay +'"][type!=hidden]');
+      var timeElement    = $('.crm-copy-fields [name^="field["][name*="[' + fnameTime +']"][type!=hidden]');
+
+      displayElement.val( displayElement.eq(0).val() );
+      timeElement.val( timeElement.eq(0).val() );
     }
-  }
-
-  /**
-   * Special function to handle setting values for date fields
-   *
-   * @param fname string field name
-   * @return void
-   */
-  function copyValuesDate(fname) {
-    var fnameDisplay = fname + '_display';
-    var fnameTime    = fname + '_time';
-
-    var displayElement = cj('.crm-copy-fields [name^="field_"][name$="_' + fnameDisplay +'"][type!=hidden]');
-    var timeElement    = cj('.crm-copy-fields [name^="field["][name*="[' + fnameTime +']"][type!=hidden]');
-
-    displayElement.val( displayElement.eq(0).val() );
-    timeElement.val( timeElement.eq(0).val() );
-  }
+
+    //bind the click event for action icon
+    $('.action-icon').click(function( ) {
+      copyFieldValues($(this).attr('fname'));
+    });
+  });
+
 
 </script>
 {/literal}
index b4e25f3d0dbd02e30298f4fdd47330ee1aa42daf..ea6560f6b61530fb93d5c5fc7dcdf1b7436f8ea2 100644 (file)
       var element_time  = "#{$elementId}_time";
       {if $timeElement}
           element_time  = "#{$timeElement}";
-          var time_format   = cj( element_time ).attr('timeFormat');
+          var time_format   = $( element_time ).attr('timeFormat');
           {literal}
-              cj(element_time).timeEntry({ show24Hours : time_format, spinnerImage: '' });
+              $(element_time).timeEntry({ show24Hours : time_format, spinnerImage: '' });
           {/literal}
       {/if}
       var currentYear = new Date().getFullYear();
       var alt_field   = '#{$elementId}';
-      cj( alt_field ).hide();
-      var date_format = cj( alt_field ).attr('format');
+      $( alt_field ).hide();
+      var date_format = $( alt_field ).attr('format');
 
       var altDateFormat = 'mm/dd/yy';
       {literal}
       }
 
       if ( !( ( date_format == 'M yy' ) || ( date_format == 'yy' ) || ( date_format == 'yy-mm' ) ) ) {
-          cj( element_date ).addClass( 'dpDate' );
+          $( element_date ).addClass( 'dpDate' );
       }
 
       {/literal}
-      var yearRange   = currentYear - parseInt( cj( alt_field ).attr('startOffset') );
+      var yearRange   = currentYear - parseInt( $( alt_field ).attr('startOffset') );
           yearRange  += ':';
-          yearRange  += currentYear + parseInt( cj( alt_field ).attr('endOffset'  ) );
+          yearRange  += currentYear + parseInt( $( alt_field ).attr('endOffset'  ) );
       {literal}
 
-      var startRangeYr = currentYear - parseInt( cj( alt_field ).attr('startOffset') );
-      var endRangeYr = currentYear + parseInt( cj( alt_field ).attr('endOffset'  ) );
+      var startRangeYr = currentYear - parseInt( $( alt_field ).attr('startOffset') );
+      var endRangeYr = currentYear + parseInt( $( alt_field ).attr('endOffset'  ) );
 
       var lcMessage = {/literal}"{$config->lcMessages}"{literal};
       var localisation = lcMessage.split('_');
-      var dateValue = cj(alt_field).val( );
-      cj(element_date).datepicker({
+      var dateValue = $(alt_field).val( );
+      $(element_date).datepicker({
                                     closeAtTop        : true,
                                     dateFormat        : date_format,
                                     changeMonth       : true,
       // set default value to display field, setDefault param for datepicker
       // is not working hence using below logic
       // parse the date
-      var displayDateValue = cj.datepicker.parseDate( altDateFormat, dateValue );
+      var displayDateValue = $.datepicker.parseDate( altDateFormat, dateValue );
 
       // format date according to display field
-      displayDateValue = cj.datepicker.formatDate( date_format, displayDateValue );
-      cj( element_date).val( displayDateValue );
+      displayDateValue = $.datepicker.formatDate( date_format, displayDateValue );
+      $( element_date).val( displayDateValue );
       //support unsaved-changes warning: CRM-14353
-      cj( element_date).data('crm-initial-value', displayDateValue);
+      $( element_date).data('crm-initial-value', displayDateValue);
 
-      cj(element_date).click( function( ) {
+      $(element_date).click( function( ) {
           hideYear( this );
       });
-      cj('.ui-datepicker-trigger').click( function( ) {
-          hideYear( cj(this).prev() );
+      $('.ui-datepicker-trigger').click( function( ) {
+          hideYear( $(this).prev() );
       });
       function hideYear( element ) {
-        var format = cj( element ).attr('format');
+        var format = $( element ).attr('format');
         if ( format == 'dd-mm' || format == 'mm/dd' ) {
-          cj(".ui-datepicker-year").css('display', 'none');
+          $(".ui-datepicker-year").css('display', 'none');
         }
       }
-      cj(alt_field + ',' + element_date + ',' + element_time).on('blur change', function() {
-        var vis = cj(alt_field).val() || cj(element_time).val() ? '' : 'hidden';
-        cj(this).siblings('.crm-clear-link').css('visibility', vis);
+      $(alt_field + ',' + element_date + ',' + element_time).on('blur change', function() {
+        var vis = $(alt_field).val() || $(element_time).val() ? '' : 'hidden';
+        $(this).siblings('.crm-clear-link').css('visibility', vis);
       });
-      cj(alt_field).change();
+      $(alt_field).change();
     });
 
     {/literal}
index 1491a16b6a53a0cbe6bb4418e58c205e4bed8b69..44da77eec7a1e01ba57b183518985ff96681d19a 100644 (file)
 *}
 {literal}
 <script type="text/javascript">
-CRM.$(function($) {
-// for date sorting see http://wiki.civicrm.org/confluence/display/CRMDOC/Sorting+Date+Fields+in+dataTables+Widget
-var useAjax = {/literal}{if $useAjax}1{else}0{/if}{literal};
-var sortEnabled = true;
-var sourceUrl = '';
-var useClass  = 'display';
+  CRM.$(function($) {
 
-var tcount =1;
-if ( useAjax ) {
- {/literal}{if isset($sourceUrl)}sourceUrl = "{$sourceUrl}";{/if}{literal}
- useClass = 'pagerDisplay';
- tcount =5;
-}
+    function getElementClass(element) {
+      return $(element).attr('class') || '';
+    }
 
-var tableId = '';
-var count   = 1;
+    // fetch the occurrence of element
+    function getRowId(row,str) {
+      var optionId;
+      $.each( row, function(i, n) {
+        if( str === $(n).attr('class') ) {
+          optionId = i;
+        }
+      });
+      return optionId;
+    }
+    
+    // for date sorting see http://wiki.civicrm.org/confluence/display/CRMDOC/Sorting+Date+Fields+in+dataTables+Widget
+    var useAjax = {/literal}{if $useAjax}1{else}0{/if}{literal};
+    var sortEnabled = true;
+    var sourceUrl = '';
+    var useClass  = 'display';
 
-//rename id of table with sequence
-//and create the object for navigation
-cj('table.' + useClass).each(function(){
-    cj(this).attr('id','option' + tcount + count);
-    tableId += count + ',';
-    count++;
-});
+    var tcount =1;
+    if ( useAjax ) {
+      {/literal}{if isset($sourceUrl)}sourceUrl = "{$sourceUrl}";{/if}{literal}
+      useClass = 'pagerDisplay';
+      tcount =5;
+    }
+
+    var tableId = '';
+    var count   = 1;
+    
+    //rename id of table with sequence
+    //and create the object for navigation
+    $('table.' + useClass).each(function(){
+      $(this).attr('id','option' + tcount + count);
+      tableId += count + ',';
+      count++;
+    });
 
-//remove last comma
-tableId = tableId.substring(0, tableId.length - 1 );
-eval('tableId =[' + tableId + ']');
+    //remove last comma
+    tableId = tableId.substring(0, tableId.length - 1 );
+    eval('tableId =[' + tableId + ']');
 
-  cj.each(tableId, function(i,n){
-    tabId = '#option' + tcount + n;
-    //get the object of first tr data row.
-    tdObject = cj(tabId + ' tr:nth(1) td');
-    var id = -1; var count = 0; var columns=''; var sortColumn = '';
-    //build columns array for sorting or not sorting
-    cj(tabId + ' th').each( function( ) {
-        var option = cj(this).prop('id').split("_");
+    $.each(tableId, function(i,n){
+      tabId = '#option' + tcount + n;
+      //get the object of first tr data row.
+      tdObject = $(tabId + ' tr:nth(1) td');
+      var id = -1; var count = 0; var columns=''; var sortColumn = '';
+      //build columns array for sorting or not sorting
+      $(tabId + ' th').each( function( ) {
+        var option = $(this).prop('id').split("_");
         option  = ( option.length > 1 ) ? option[1] : option[0];
         stype   = 'numeric';
         switch( option ) {
-            case 'sortable':
-                sortColumn += '[' + count + ', "asc" ],';
-                columns += '{"sClass": "'+ getElementClass( this ) +'"},';
+          case 'sortable':
+            sortColumn += '[' + count + ', "asc" ],';
+            columns += '{"sClass": "'+ getElementClass( this ) +'"},';
             break;
-            case 'date':
-                stype = 'date';
-            case 'order':
-                if ( cj(this).attr('class') == 'sortable' ){
-                    sortColumn += '[' + count + ', "asc" ],';
-                }
-                sortId   = getRowId(tdObject, cj(this).attr('id') +' hiddenElement' );
-                sortEnabled = true;
-                columns += '{ "render": function ( data, type, row ) { return "<div style=\'display:none\'>"+ data +"</div>" + row[sortId] ; }, "targets": sortColumn,"bUseRendered": false},';
+          case 'date':
+            stype = 'date';
+          case 'order':
+            if ( $(this).attr('class') == 'sortable' ){
+              sortColumn += '[' + count + ', "asc" ],';
+            }
+            sortId   = getRowId(tdObject, $(this).attr('id') +' hiddenElement' );
+            sortEnabled = true;
+            columns += '{ "render": function ( data, type, row ) { return "<div style=\'display:none\'>"+ data +"</div>" + row[sortId] ; }, "targets": sortColumn,"bUseRendered": false},';
             break;
-            case 'nosort':
-                columns += '{ "bSortable": false, "sClass": "'+ getElementClass( this ) +'"},';
+          case 'nosort':
+            columns += '{ "bSortable": false, "sClass": "'+ getElementClass( this ) +'"},';
             break;
-            case 'currency':
-                columns += '{ "sType": "currency" },';
+          case 'currency':
+            columns += '{ "sType": "currency" },';
             break;
-            case 'link':
-                columns += '{"sType": "html"},';
+          case 'link':
+            columns += '{"sType": "html"},';
             break;
-            default:
-                if ( cj(this).text() ) {
-                    columns += '{"sClass": "'+ getElementClass( this ) +'"},';
-                } else {
-                    columns += '{ "bSortable": false },';
-                }
+          default:
+            if ( $(this).text() ) {
+              columns += '{"sClass": "'+ getElementClass( this ) +'"},';
+            } else {
+              columns += '{ "bSortable": false },';
+            }
             break;
         }
         count++;
-  });
-  columns    = columns.substring(0, columns.length - 1 );
-  sortColumn = sortColumn.substring(0, sortColumn.length - 1 );
-  eval('sortColumn =[' + sortColumn + ']');
-  eval('columns =[' + columns + ']');
+      });
+      columns    = columns.substring(0, columns.length - 1 );
+      sortColumn = sortColumn.substring(0, sortColumn.length - 1 );
+      eval('sortColumn =[' + sortColumn + ']');
+      eval('columns =[' + columns + ']');
 
-        var currTable = cj(tabId);
-        if (currTable) {
-            // contains the dataTables master records
-            var s = cj(document).dataTableSettings;
-            if (s != 'undefined') {
-                var len = s.length;
-                for (var i=0; i < len; i++) {
-                    // if already exists, remove from the array
-                    if (s[i].sInstance = tabId) {
-                        s.splice(i,1);
-              }
-              }
+      var currTable = $(tabId);
+      if (currTable) {
+        // contains the dataTables master records
+        var s = $(document).dataTableSettings;
+        if (s != 'undefined') {
+          var len = s.length;
+          for (var i=0; i < len; i++) {
+            // if already exists, remove from the array
+            if (s[i].sInstance = tabId) {
+              s.splice(i,1);
+            }
+          }
         }
-  }
+      }
 
-    var noRecordFoundMsg  = {/literal}'{ts escape="js"}There are no records.{/ts}'{literal};
+      var noRecordFoundMsg  = {/literal}'{ts escape="js"}There are no records.{/ts}'{literal};
 
-    oTable = null;
-    if ( useAjax ) {
-      oTable = cj(tabId).dataTable({
-              "bFilter"    : false,
-              "bAutoWidth" : false,
-              "aaSorting"  : sortColumn,
-              "aoColumns"  : columns,
-              "bProcessing": true,
-              "bJQueryUI"  : true,
-              "asStripClasses" : [ "odd-row", "even-row" ],
-              "sPaginationType": "full_numbers",
-              "sDom"       : '<"crm-datatable-pager-top"lfp>rt<"crm-datatable-pager-bottom"ip>',
-              "bServerSide": true,
-              "sAjaxSource": sourceUrl,
-              "oLanguage":{"sEmptyTable"  : noRecordFoundMsg,
-              "sZeroRecords" : noRecordFoundMsg },
+      oTable = null;
+      if ( useAjax ) {
+        oTable = $(tabId).dataTable({
+          "bFilter"    : false,
+          "bAutoWidth" : false,
+          "aaSorting"  : sortColumn,
+          "aoColumns"  : columns,
+          "bProcessing": true,
+          "bJQueryUI"  : true,
+          "asStripClasses" : [ "odd-row", "even-row" ],
+          "sPaginationType": "full_numbers",
+          "sDom"       : '<"crm-datatable-pager-top"lfp>rt<"crm-datatable-pager-bottom"ip>',
+          "bServerSide": true,
+          "sAjaxSource": sourceUrl,
+          "oLanguage":{"sEmptyTable"  : noRecordFoundMsg,
+            "sZeroRecords" : noRecordFoundMsg },
 
-              {/literal}{if !empty($callBack)}{literal}
-              "fnDrawCallback": function() { checkSelected(); },
-              {/literal}{/if}{literal}
+          {/literal}{if !empty($callBack)}{literal}
+          "fnDrawCallback": function() { checkSelected(); },
+          {/literal}{/if}{literal}
 
-              "fnServerData": function ( sSource, aoData, fnCallback ) {
-                cj.ajax( {
-                  "dataType": 'json',
-                  "type": "POST",
-                  "url": sSource,
-                  "data": aoData,
-                  "success": fnCallback
-                });
-              }
-         });
-    } else {
-      oTable = cj(tabId).dataTable({
-                "aaSorting"    : sortColumn,
-                "bPaginate"    : false,
-                "bLengthChange": true,
-                "bFilter"      : false,
-                "bInfo"        : false,
-                "asStripClasses" : [ "odd-row", "even-row" ],
-                "bAutoWidth"   : false,
-                "aoColumns"   : columns,
-                "bSort" : sortEnabled,
-            "oLanguage":{"sEmptyTable"  : noRecordFoundMsg,
-                         "sZeroRecords" : noRecordFoundMsg }
-              });
-    }
-    var object;
+          "fnServerData": function ( sSource, aoData, fnCallback ) {
+            $.ajax( {
+              "dataType": 'json',
+              "type": "POST",
+              "url": sSource,
+              "data": aoData,
+              "success": fnCallback
+            });
+          }
+        });
+      } else {
+        oTable = $(tabId).dataTable({
+          "aaSorting"    : sortColumn,
+          "bPaginate"    : false,
+          "bLengthChange": true,
+          "bFilter"      : false,
+          "bInfo"        : false,
+          "asStripClasses" : [ "odd-row", "even-row" ],
+          "bAutoWidth"   : false,
+          "aoColumns"   : columns,
+          "bSort" : sortEnabled,
+          "oLanguage":{"sEmptyTable"  : noRecordFoundMsg,
+            "sZeroRecords" : noRecordFoundMsg }
+        });
+      }
+      var object;
 
     });
-});
-
-function getElementClass( element ) {
-if( cj(element).attr('class') )   return cj(element).attr('class');
-return '';
-}
-
-//function to fetch the occurence of element
-function getRowId(row,str){
- cj.each( row, function(i, n) {
-    if( str === cj(n).attr('class') ) {
-        optionId = i;
-    }
- });
-return optionId;
-}
+  });
 
-//plugin to sort on currency
-var symbol = "{/literal}{$config->defaultCurrencySymbol($config->defaultSymbol)}{literal}";
-cj.fn.dataTableExt.oSort['currency-asc']  = function(a,b) {
-  var x = (a == "-") ? 0 : a.replace( symbol, "" );
-  var y = (b == "-") ? 0 : b.replace( symbol, "" );
-  x = parseFloat( x );
-  y = parseFloat( y );
-  return ((x < y) ? -1 : ((x > y) ?  1 : 0));
-};
+  //plugin to sort on currency
+  var symbol = "{/literal}{$config->defaultCurrencySymbol($config->defaultSymbol)}{literal}";
+  cj.fn.dataTableExt.oSort['currency-asc']  = function(a,b) {
+    var x = (a == "-") ? 0 : a.replace( symbol, "" );
+    var y = (b == "-") ? 0 : b.replace( symbol, "" );
+    x = parseFloat( x );
+    y = parseFloat( y );
+    return ((x < y) ? -1 : ((x > y) ?  1 : 0));
+  };
 
-cj.fn.dataTableExt.oSort['currency-desc'] = function(a,b) {
-  var x = (a == "-") ? 0 : a.replace( symbol, "" );
-  var y = (b == "-") ? 0 : b.replace( symbol, "" );
-  x = parseFloat( x );
-  y = parseFloat( y );
-  return ((x < y) ?  1 : ((x > y) ? -1 : 0));
-};
+  cj.fn.dataTableExt.oSort['currency-desc'] = function(a,b) {
+    var x = (a == "-") ? 0 : a.replace( symbol, "" );
+    var y = (b == "-") ? 0 : b.replace( symbol, "" );
+    x = parseFloat( x );
+    y = parseFloat( y );
+    return ((x < y) ?  1 : ((x > y) ? -1 : 0));
+  };
 </script>
 {/literal}
index 8cb3c8a32b7c987bcada71a9dade6adff2c7786a..d9f04277324527627dee029e8b010289ca09aef3 100644 (file)
@@ -59,10 +59,10 @@ function buildPaymentBlock( type ) {
 }
 
 CRM.$(function($) {
-    cj('.crm-group.payment_options-group').show();
+    $('.crm-group.payment_options-group').show();
 
-    cj('input[name="payment_processor"]').change( function() {
-        buildPaymentBlock( cj(this).val() );
+    $('input[name="payment_processor"]').change( function() {
+        buildPaymentBlock( $(this).val() );
     });
 });
 
index 473ca8b47ac4918d2be7bd0f0c4c003a1f2f0f95..f66785dbcdb17cb3b6913bfa862963780c5571e8 100644 (file)
 {/if}
 </div>
 {/if}
-{literal}
-<script type="text/javascript">
-CRM.$(function($) {
-   cj().crmaccordions(); 
-});
-</script>
-{/literal}