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) {
/**
* 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,
.dialog(settings.dialog)
.parent().find('.ui-dialog-titlebar')
.append($('<a class="crm-dialog-titlebar-print ui-dialog-titlebar-close" title="'+ts('Print window')+'" target="_blank" style="right:3.8em;"/>')
- .button({icons: {primary: 'ui-icon-print'}, text: false}));
+ .button({icons: {primary: 'fa-print'}, text: false}));
}
// Add handlers to new or existing dialog
if ($(settings.target).data('uiDialog')) {
var id = widget.attr('id') + '-unsaved-alert',
title = widget.dialog('option', 'title'),
alert = CRM.alert('<p>' + ts('%1 has not been saved.', {1: title}) + '</p><p><a href="#" id="' + id + '">' + ts('Restore') + '</a></p>', ts('Unsaved Changes'), 'alert unsaved-dialog', {expires: 60000});
- $('#' + id).button({icons: {primary: 'ui-icon-arrowreturnthick-1-w'}}).click(function(e) {
+ $('#' + id).button({icons: {primary: 'fa-undo'}}).click(function(e) {
widget.attr('data-unsaved-changes', 'false').dialog('open');
e.preventDefault();
});
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') ? 'close' : 'check');
- button.icons = {primary: 'ui-icon-' + action};
+ var action = $el.attr('crm-icon') || ($el.hasClass('cancel') ? 'fa-times' : 'fa-check');
+ button.icons = {primary: action};
}
buttons.push(button);
added.push(identifier);