1 |
85ad3d82
|
Assos Assos
|
(function ($) {
|
2 |
|
|
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
|
|
|
7 |
|
|
Drupal.hideEmailAdministratorCheckbox = function () {
|
8 |
|
|
|
9 |
|
|
if ($('#edit-update-status-module-1').is(':checked')) {
|
10 |
|
|
$('.form-item-update-status-module-2').show();
|
11 |
|
|
}
|
12 |
|
|
else {
|
13 |
|
|
$('.form-item-update-status-module-2').hide();
|
14 |
|
|
}
|
15 |
|
|
|
16 |
|
|
|
17 |
|
|
$('#edit-update-status-module-1').change( function () {
|
18 |
|
|
$('.form-item-update-status-module-2').toggle();
|
19 |
|
|
});
|
20 |
|
|
};
|
21 |
|
|
|
22 |
|
|
|
23 |
|
|
|
24 |
|
|
|
25 |
|
|
|
26 |
|
|
|
27 |
|
|
|
28 |
|
|
|
29 |
|
|
Drupal.behaviors.cleanURLsSettingsCheck = {
|
30 |
|
|
attach: function (context, settings) {
|
31 |
|
|
|
32 |
|
|
|
33 |
|
|
|
34 |
|
|
if (!($('#edit-clean-url').length) || $('#edit-clean-url.install').once('clean-url').length) {
|
35 |
|
|
return;
|
36 |
|
|
}
|
37 |
|
|
var url = settings.basePath + 'admin/config/search/clean-urls/check';
|
38 |
|
|
$.ajax({
|
39 |
|
|
url: location.protocol + '//' + location.host + url,
|
40 |
|
|
dataType: 'json',
|
41 |
|
|
success: function () {
|
42 |
|
|
|
43 |
|
|
location = settings.basePath +"admin/config/search/clean-urls";
|
44 |
|
|
}
|
45 |
|
|
});
|
46 |
|
|
}
|
47 |
|
|
};
|
48 |
|
|
|
49 |
|
|
|
50 |
|
|
|
51 |
|
|
|
52 |
|
|
|
53 |
|
|
|
54 |
|
|
|
55 |
|
|
|
56 |
|
|
Drupal.cleanURLsInstallCheck = function () {
|
57 |
|
|
var url = location.protocol + '//' + location.host + Drupal.settings.basePath + 'admin/config/search/clean-urls/check';
|
58 |
|
|
|
59 |
|
|
|
60 |
|
|
$.ajax({
|
61 |
|
|
async: false,
|
62 |
|
|
url: url,
|
63 |
|
|
dataType: 'json',
|
64 |
|
|
success: function () {
|
65 |
|
|
|
66 |
|
|
$('#edit-clean-url').attr('value', 1);
|
67 |
|
|
}
|
68 |
|
|
});
|
69 |
|
|
};
|
70 |
|
|
|
71 |
|
|
|
72 |
|
|
|
73 |
|
|
|
74 |
|
|
|
75 |
|
|
|
76 |
|
|
Drupal.behaviors.copyFieldValue = {
|
77 |
|
|
attach: function (context, settings) {
|
78 |
|
|
for (var sourceId in settings.copyFieldValue) {
|
79 |
|
|
$('#' + sourceId, context).once('copy-field-values').bind('blur', function () {
|
80 |
|
|
|
81 |
|
|
var targetIds = settings.copyFieldValue[sourceId];
|
82 |
|
|
|
83 |
|
|
for (var delta in targetIds) {
|
84 |
|
|
var targetField = $('#' + targetIds[delta]);
|
85 |
|
|
if (targetField.val() == '') {
|
86 |
|
|
targetField.val(this.value);
|
87 |
|
|
}
|
88 |
|
|
}
|
89 |
|
|
});
|
90 |
|
|
}
|
91 |
|
|
}
|
92 |
|
|
};
|
93 |
|
|
|
94 |
|
|
|
95 |
|
|
|
96 |
|
|
|
97 |
|
|
Drupal.behaviors.dateTime = {
|
98 |
|
|
attach: function (context, settings) {
|
99 |
|
|
for (var fieldName in settings.dateTime) {
|
100 |
|
|
if (settings.dateTime.hasOwnProperty(fieldName)) {
|
101 |
|
|
(function (fieldSettings, fieldName) {
|
102 |
|
|
var source = '#edit-' + fieldName;
|
103 |
|
|
var suffix = source + '-suffix';
|
104 |
|
|
|
105 |
|
|
|
106 |
|
|
$('input' + source, context).once('date-time').keyup(function () {
|
107 |
|
|
var input = $(this);
|
108 |
134c7813
|
Mathieu Schiano
|
var url = fieldSettings.lookup + (/\?/.test(fieldSettings.lookup) ? '&format=' : '?format=') + encodeURIComponent(input.val());
|
109 |
85ad3d82
|
Assos Assos
|
$.getJSON(url, function (data) {
|
110 |
|
|
$(suffix).empty().append(' ' + fieldSettings.text + ': <em>' + data + '</em>');
|
111 |
|
|
});
|
112 |
|
|
});
|
113 |
|
|
})(settings.dateTime[fieldName], fieldName);
|
114 |
|
|
}
|
115 |
|
|
}
|
116 |
|
|
}
|
117 |
|
|
};
|
118 |
|
|
|
119 |
|
|
|
120 |
|
|
|
121 |
|
|
|
122 |
|
|
|
123 |
|
|
Drupal.behaviors.pageCache = {
|
124 |
|
|
attach: function (context, settings) {
|
125 |
|
|
$('#edit-cache-0', context).change(function () {
|
126 |
|
|
$('#page-compression-wrapper').hide();
|
127 |
|
|
$('#cache-error').hide();
|
128 |
|
|
});
|
129 |
|
|
$('#edit-cache-1', context).change(function () {
|
130 |
|
|
$('#page-compression-wrapper').show();
|
131 |
|
|
$('#cache-error').hide();
|
132 |
|
|
});
|
133 |
|
|
$('#edit-cache-2', context).change(function () {
|
134 |
|
|
$('#page-compression-wrapper').show();
|
135 |
|
|
$('#cache-error').show();
|
136 |
|
|
});
|
137 |
|
|
}
|
138 |
|
|
};
|
139 |
|
|
|
140 |
|
|
})(jQuery); |