X-Git-Url: http://aleph1.co.uk/gitweb/?a=blobdiff_plain;f=web%2Fcore%2Fmodules%2Fsystem%2Fjs%2Fsystem.date.js;h=1c80ad7922ae7b457a2b36826311d5e04175c77f;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hp=678614d98c59401a45f75b8bec0e0f73a7fd6c24;hpb=a2bd1bf0c2c1f1a17d188f4dc0726a45494cefae;p=yaffs-website diff --git a/web/core/modules/system/js/system.date.js b/web/core/modules/system/js/system.date.js index 678614d98..1c80ad792 100644 --- a/web/core/modules/system/js/system.date.js +++ b/web/core/modules/system/js/system.date.js @@ -1,40 +1,24 @@ /** - * @file - * Provides date format preview feature. - */ +* DO NOT EDIT THIS FILE. +* See the following change record for more information, +* https://www.drupal.org/node/2815083 +* @preserve +**/ (function ($, Drupal, drupalSettings) { - - 'use strict'; - var dateFormats = drupalSettings.dateFormats; - /** - * Display the preview for date format entered. - * - * @type {Drupal~behavior} - * - * @prop {Drupal~behaviorAttach} attach - * Attach behavior for previewing date formats on input elements. - */ Drupal.behaviors.dateFormat = { - attach: function (context) { + attach: function attach(context) { var $context = $(context); var $source = $context.find('[data-drupal-date-formatter="source"]').once('dateFormat'); var $target = $context.find('[data-drupal-date-formatter="preview"]').once('dateFormat'); var $preview = $target.find('em'); - // All elements have to exist. if (!$source.length || !$target.length) { return; } - /** - * Event handler that replaces date characters with value. - * - * @param {jQuery.Event} e - * The jQuery event triggered. - */ function dateFormatHandler(e) { var baseValue = $(e.target).val() || ''; var dateString = baseValue.replace(/\\?(.?)/gi, function (key, value) { @@ -45,13 +29,7 @@ $target.toggleClass('js-hide', !dateString.length); } - /** - * On given event triggers the date character replacement. - */ - $source.on('keyup.dateFormat change.dateFormat input.dateFormat', dateFormatHandler) - // Initialize preview. - .trigger('keyup'); + $source.on('keyup.dateFormat change.dateFormat input.dateFormat', dateFormatHandler).trigger('keyup'); } }; - -})(jQuery, Drupal, drupalSettings); +})(jQuery, Drupal, drupalSettings); \ No newline at end of file