1(function($, doc) { 2 3 "use strict"; 4 5 var UI = $.UIkit || {}; 6 7 if (UI.fn) { 8 return; 9 } 10 11 UI.fn = function(command, options) { 12 13 var args = arguments, cmd = command.match(/^([a-z\-]+)(?:\.([a-z]+))?/i), component = cmd[1], method = cmd[2]; 14 15 if (!UI[component]) { 16 $.error("UIkit component [" + component + "] does not exist."); 17 return this; 18 } 19 20 return this.each(function() { 21 var $this = $(this), data = $this.data(component); 22 if (!data) $this.data(component, (data = new UI[component](this, method ? undefined : options))); 23 if (method) data[method].apply(data, Array.prototype.slice.call(args, 1)); 24 }); 25 }; 26 27 UI.version = '1.2.0'; 28 29 UI.support = {}; 30 UI.support.transition = (function() { 31 32 var transitionEnd = (function() { 33 34 var element = doc.body || doc.documentElement, 35 transEndEventNames = { 36 WebkitTransition: 'webkitTransitionEnd', 37 MozTransition: 'transitionend', 38 OTransition: 'oTransitionEnd otransitionend', 39 transition: 'transitionend' 40 }, name; 41 42 for (name in transEndEventNames) { 43 if (element.style[name] !== undefined) { 44 return transEndEventNames[name]; 45 } 46 } 47 48 }()); 49 50 return transitionEnd && { end: transitionEnd }; 51 52 })(); 53 54 UI.support.touch = (('ontouchstart' in window) || window.DocumentTouch && document instanceof window.DocumentTouch); 55 UI.support.mutationobserver = (window.MutationObserver || window.WebKitMutationObserver || window.MozMutationObserver || null); 56 57 58 UI.Utils = {}; 59 60 UI.Utils.debounce = function(func, wait, immediate) { 61 var timeout; 62 return function() { 63 var context = this, args = arguments; 64 var later = function() { 65 timeout = null; 66 if (!immediate) func.apply(context, args); 67 }; 68 var callNow = immediate && !timeout; 69 clearTimeout(timeout); 70 timeout = setTimeout(later, wait); 71 if (callNow) func.apply(context, args); 72 }; 73 }; 74 75 UI.Utils.options = function(string) { 76 77 if ($.isPlainObject(string)) return string; 78 79 var start = (string ? string.indexOf("{") : -1), options = {}; 80 81 if (start != -1) { 82 try { 83 options = (new Function("", "var json = " + string.substr(start) + "; return JSON.parse(JSON.stringify(json));"))(); 84 } catch (e) {} 85 } 86 87 return options; 88 }; 89 90 $.UIkit = UI; 91 $.fn.uk = UI.fn; 92 93 $.UIkit.langdirection = $("html").attr("dir") == "rtl" ? "right" : "left"; 94 95 $(function(){ 96 97 $(doc).trigger("uk-domready"); 98 99 // Check for dom modifications 100 if(!UI.support.mutationobserver) return; 101 102 var observer = new UI.support.mutationobserver(UI.Utils.debounce(function(mutations) { 103 $(doc).trigger("uk-domready"); 104 }, 300)); 105 106 // pass in the target node, as well as the observer options 107 observer.observe(document.body, { childList: true, subtree: true }); 108 }); 109 110 111})(jQuery, document);
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.