123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140 |
- (function ($) {
- Drupal.hideEmailAdministratorCheckbox = function () {
-
- if ($('#edit-update-status-module-1').is(':checked')) {
- $('.form-item-update-status-module-2').show();
- }
- else {
- $('.form-item-update-status-module-2').hide();
- }
-
- $('#edit-update-status-module-1').change( function () {
- $('.form-item-update-status-module-2').toggle();
- });
- };
- Drupal.behaviors.cleanURLsSettingsCheck = {
- attach: function (context, settings) {
-
-
-
- if (!($('#edit-clean-url').length) || $('#edit-clean-url.install').once('clean-url').length) {
- return;
- }
- var url = settings.basePath + 'admin/config/search/clean-urls/check';
- $.ajax({
- url: location.protocol + '//' + location.host + url,
- dataType: 'json',
- success: function () {
-
- location = settings.basePath +"admin/config/search/clean-urls";
- }
- });
- }
- };
- Drupal.cleanURLsInstallCheck = function () {
- var url = location.protocol + '//' + location.host + Drupal.settings.basePath + 'admin/config/search/clean-urls/check';
-
-
- $.ajax({
- async: false,
- url: url,
- dataType: 'json',
- success: function () {
-
- $('#edit-clean-url').attr('value', 1);
- }
- });
- };
- Drupal.behaviors.copyFieldValue = {
- attach: function (context, settings) {
- for (var sourceId in settings.copyFieldValue) {
- $('#' + sourceId, context).once('copy-field-values').bind('blur', function () {
-
- var targetIds = settings.copyFieldValue[sourceId];
-
- for (var delta in targetIds) {
- var targetField = $('#' + targetIds[delta]);
- if (targetField.val() == '') {
- targetField.val(this.value);
- }
- }
- });
- }
- }
- };
- Drupal.behaviors.dateTime = {
- attach: function (context, settings) {
- for (var fieldName in settings.dateTime) {
- if (settings.dateTime.hasOwnProperty(fieldName)) {
- (function (fieldSettings, fieldName) {
- var source = '#edit-' + fieldName;
- var suffix = source + '-suffix';
-
- $('input' + source, context).once('date-time').keyup(function () {
- var input = $(this);
- var url = fieldSettings.lookup + (/\?/.test(fieldSettings.lookup) ? '&format=' : '?format=') + encodeURIComponent(input.val());
- $.getJSON(url, function (data) {
- $(suffix).empty().append(' ' + fieldSettings.text + ': <em>' + data + '</em>');
- });
- });
- })(settings.dateTime[fieldName], fieldName);
- }
- }
- }
- };
-
- Drupal.behaviors.pageCache = {
- attach: function (context, settings) {
- $('#edit-cache-0', context).change(function () {
- $('#page-compression-wrapper').hide();
- $('#cache-error').hide();
- });
- $('#edit-cache-1', context).change(function () {
- $('#page-compression-wrapper').show();
- $('#cache-error').hide();
- });
- $('#edit-cache-2', context).change(function () {
- $('#page-compression-wrapper').show();
- $('#cache-error').show();
- });
- }
- };
- })(jQuery);
|