1// Avoid `console` errors in browsers that lack a console. 2(function() { 3 var method; 4 var noop = function () {}; 5 var methods = [ 6 'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error', 7 'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log', 8 'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd', 9 'timeStamp', 'trace', 'warn' 10 ]; 11 var length = methods.length; 12 var console = (window.console = window.console || {}); 13 14 while (length--) { 15 method = methods[length]; 16 17 // Only stub undefined methods. 18 if (!console[method]) { 19 console[method] = noop; 20 } 21 } 22}()); 23 24// Place any jQuery/helper plugins in here. 25 26/* ========================================================================== 27 Visiblity Toggle 28 ========================================================================== */ 29 30jQuery.fn.visible = function() { 31 return this.css('visibility', 'visible'); 32}; 33 34jQuery.fn.invisible = function() { 35 return this.css('visibility', 'hidden'); 36}; 37 38jQuery.fn.visibilityToggle = function() { 39 return this.css('visibility', function(i, visibility) { 40 return (visibility == 'visible') ? 'hidden' : 'visible'; 41 }); 42}; 43 44 45/* ========================================================================== 46 closestStyle 47 ========================================================================== */ 48 49// $().closestStyle() 50// find the closest CSS style of a parent for a DOM element and apply it 51// to the selected element. I use this mainly before calling 52// .effect('highlight') so the backgroundColor will mesh properly. 53// @example: 54// $('.row').closestStyle('backgroundColor').effect('highlight'); 55// 56// Gist: https://gist.github.com/lifo101/3169552.js 57 58(function($){ 59 $.fn.closestStyle = function(attr, val){ 60 var me = $(this); 61 me.parents().each(function(i){ 62 var c = $(this).css(attr); 63 if (c != 'transparent') { 64 me.css(attr, c); 65 return false; // stop 66 } 67 return true; // strict compliance 68 }); 69 return this; 70 }; 71})(jQuery); 72 73 74/* ========================================================================== 75 viewportIsSmall 76 ========================================================================== */ 77 78function viewportIsSmall() { 79 if ( jQuery(window).width() < 640 ) 80 return true; 81 else 82 return false; 83}
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.