1/* global jQuery, Drupal */ 2(function (window, document, $) { 3 "use strict"; 4 5 // --- Storage defaults --- 6 window.DYAUS_ADDONS_STORAGE = window.DYAUS_ADDONS_STORAGE || { 7 mouse_helper: 1, 8 mouse_helper_delay: 1, 9 mouse_helper_centered: 0, 10 mobile_breakpoint_mousehelper_off: 0, 11 msg_mouse_helper_anchor: 'Go to' 12 }; 13 14 // --- Globals the helper expects --- 15 window.dyaus_addons_request_animation_frame = window.dyaus_addons_request_animation_frame || function () { 16 return window.requestAnimationFrame 17 ? window.requestAnimationFrame.bind(window) 18 : function (cb) { return setTimeout(cb, 16); }; 19 }; 20 window.dyaus_addons_window_width = function () { return window.innerWidth || document.documentElement.clientWidth; }; 21 window.dyaus_addons_window_height = function () { return window.innerHeight || document.documentElement.clientHeight; }; 22 window.dyaus_addons_window_scroll_left = function () { return window.pageXOffset || document.documentElement.scrollLeft || 0; }; 23 window.dyaus_addons_window_scroll_top = function () { return window.pageYOffset || document.documentElement.scrollTop || 0; }; 24 window.dyaus_addons_apply_filters = function (_name, val) { return val; }; 25 window.dyaus_addons_chg_class_by_prefix = function (cls, prefix, repl) { 26 return (cls || '').split(' ').filter(function (c) { return c.indexOf(prefix) !== 0; }).concat(repl ? [repl] : []).join(' '); 27 }; 28 window.dyaus_addons_wrap_chars = function (text, before, after) { 29 return (text || '').split('').map(function (c) { return before + c + after; }).join(''); 30 }; 31 window.dyaus_addons_transition_end = function () { return 'transitionend'; }; 32 33 function fireInit() { 34 // Fire both names to cover whichever your helper listens for 35 $(document).trigger('action.init_dyaus_addons'); 36 $(document).trigger('action.init_trx_addons'); 37 } 38 39 Drupal.behaviors.mouseHelperInit = { 40 attach: function (context) { 41 // Add helper element once per page 42 if (!$('.dyaus_addons_mouse_helper').length) { 43 $('body').append('<span class="dyaus_addons_mouse_helper"></span>'); 44 } 45 46 // Update caches the helper uses 47 $(document).trigger('action.init_hidden_elements'); 48 49 // Init the helper 50 fireInit(); 51 52 // Re-init after AJAX renders 53 $(document).on('ajaxComplete.dyausMouseHelper', function () { 54 $(document).trigger('action.got_ajax_response'); 55 fireInit(); 56 }); 57 58 // Safety: re-fire once after a short delay 59 setTimeout(fireInit, 50); 60 } 61 }; 62 63})(window, document, jQuery);
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.