Merge pull request #7543 from monishdeb/CRM-17770
[civicrm-core.git] / js / crm.ajax.js
index 96a6df73770fa27bcdff0b86b2d89602678f84f3..91565ef6030ff35b0dbb79c59ad9cfd51964f473 100644 (file)
     return url;
   };
 
-  // @deprecated
-  $.extend ({'crmURL':
-    function (p, params) {
-      CRM.console('warn', 'Calling crmURL from jQuery is deprecated. Please use CRM.url() instead.');
-      return CRM.url(p, params);
-    }
-  });
-
   $.fn.crmURL = function () {
     return this.each(function() {
       if (this.href) {
@@ -55,6 +47,7 @@
 
   /**
    * AJAX api
+   * @link http://wiki.civicrm.org/confluence/display/CRMDOC/AJAX+Interface#AJAXInterface-CRM.api3
    */
   CRM.api3 = function(entity, action, params, status) {
     if (typeof(entity) === 'string') {
     })($.extend({}, settings, options));
   };
 
-  /**
-   * Backwards compatible with jQuery fn
-   * @deprecated
-   */
-  $.fn.crmAPI = function(entity, action, params, options) {
-    CRM.console('warn', 'Calling crmAPI from jQuery is deprecated. Please use CRM.api3() instead.');
-    return CRM.api.call(this, entity, action, params, options);
-  };
-
   $.widget('civi.crmSnippet', {
     options: {
       url: null,
             label = $el.is('input') ? $el.attr('value') : $el.text(),
             identifier = $el.attr('name') || $el.attr('href');
           if (!identifier || identifier === '#' || $.inArray(identifier, added) < 0) {
-            var $icon = $el.find('.icon'),
+            var $icon = $el.find('.icon, .crm-i'),
               button = {'data-identifier': identifier, text: label, click: function() {
                 $el[0].click();
               }};
             if ($icon.length) {
               button.icons = {primary: $icon.attr('class')};
             } else {
-              var action = $el.attr('crm-icon') || ($el.hasClass('cancel') ? 'times' : 'check');
-              button.icons = {primary: 'fa-' + action};
+              var action = $el.attr('crm-icon') || ($el.hasClass('cancel') ? 'fa-times' : 'fa-check');
+              button.icons = {primary: action};
             }
             buttons.push(button);
             added.push(identifier);