1/** 2 * @file 3 * Global utilities. 4 * 5 */ 6(function ($,jQuery) { 7 8 'use strict'; 9 10 //////////////// CKEditor settings 11 Drupal.behaviors.stackCkeditor = { 12 attach: function (context, settings) { 13 // Alter CKEditor config to allow empty tags 14 if (typeof CKEDITOR !== "undefined") { 15 CKEDITOR.dtd.$removeEmpty['i'] = false; 16 CKEDITOR.dtd.$removeEmpty['span'] = false; 17 console.log('Ckeditor log', CKEDITOR.dtd); 18 } 19 } 20 }; 21 22 //////////////// Disable input on Layout Paragraph Builder 23 Drupal.behaviors.stackLPB = { 24 attach: function (context, settings) { 25 $('.js-lpb-component .block-contact textarea, .js-lpb-component .block-contact input, .js-lpb-component .block-simplenews input, .js-lpb-component .block-user input').each(function() { 26 var thisElement = $(this); 27 thisElement.attr('disabled', 'disabled'); 28 }); 29 } 30 }; 31 32 //////////////// Move form labels to placeholders 33 Drupal.behaviors.stackForms = { 34 attach: function (context, settings) { 35 $("form.contact-form :input, form.user-form :input, form.user-login-form :input, form.user-pass :input, .block-simplenews form :input").each(function(index, elem) { 36 var eId = $(elem).attr("id"); 37 var label = null; 38 if (eId && (label = $(elem).parents("form").find("label[for="+eId+"]")).length == 1) { 39 $(elem).attr("placeholder", $(label).html()); 40 $(label).remove(); 41 } 42 }); 43 } 44 }; 45})(jQuery, Drupal);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.