1 2 3 4 5 6 7jQuery.fn.extend({ 8 everyTime: function(interval, label, fn, times, belay) { 9 return this.each(function() { 10 jQuery.timer.add(this, interval, label, fn, times, belay); 11 }); 12 }, 13 oneTime: function(interval, label, fn) { 14 return this.each(function() { 15 jQuery.timer.add(this, interval, label, fn, 1); 16 }); 17 }, 18 stopTime: function(label, fn) { 19 return this.each(function() { 20 jQuery.timer.remove(this, label, fn); 21 }); 22 } 23}); 24 25jQuery.event.special 26 27jQuery.extend({ 28 timer: { 29 global: [], 30 guid: 1, 31 dataKey: "jQuery.timer", 32 regex: /^([0-9]+(?:\.[0-9]*)?)\s*(.*s)?$/, 33 powers: { 34 // Yeah this is major overkill... 35 'ms': 1, 36 'cs': 10, 37 'ds': 100, 38 's': 1000, 39 'das': 10000, 40 'hs': 100000, 41 'ks': 1000000 42 }, 43 timeParse: function(value) { 44 if (value == undefined || value == null) 45 return null; 46 var result = this.regex.exec(jQuery.trim(value.toString())); 47 if (result[2]) { 48 var num = parseFloat(result[1]); 49 var mult = this.powers[result[2]] || 1; 50 return num * mult; 51 } else { 52 return value; 53 } 54 }, 55 add: function(element, interval, label, fn, times, belay) { 56 var counter = 0; 57 58 if (jQuery.isFunction(label)) { 59 if (!times) 60 times = fn; 61 fn = label; 62 label = interval; 63 } 64 65 interval = jQuery.timer.timeParse(interval); 66 67 if (typeof interval != 'number' || isNaN(interval) || interval <= 0) 68 return; 69 70 if (times && times.constructor != Number) { 71 belay = !!times; 72 times = 0; 73 } 74 75 times = times || 0; 76 belay = belay || false; 77 78 var timers = jQuery.data(element, this.dataKey) || jQuery.data(element, this.dataKey, {}); 79 80 if (!timers[label]) 81 timers[label] = {}; 82 83 fn.timerID = fn.timerID || this.guid++; 84 85 var handler = function() { 86 if (belay && this.inProgress) 87 return; 88 this.inProgress = true; 89 if ((++counter > times && times !== 0) || fn.call(element, counter) === false) 90 jQuery.timer.remove(element, label, fn); 91 this.inProgress = false; 92 }; 93 94 handler.timerID = fn.timerID; 95 96 if (!timers[label][fn.timerID]) 97 timers[label][fn.timerID] = window.setInterval(handler,interval); 98 99 this.global.push( element ); 100 101 }, 102 remove: function(element, label, fn) { 103 var timers = jQuery.data(element, this.dataKey), ret; 104 105 if ( timers ) { 106 107 if (!label) { 108 for ( label in timers ) 109 this.remove(element, label, fn); 110 } else if ( timers[label] ) { 111 if ( fn ) { 112 if ( fn.timerID ) { 113 window.clearInterval(timers[label][fn.timerID]); 114 delete timers[label][fn.timerID]; 115 } 116 } else { 117 for ( var fn in timers[label] ) { 118 window.clearInterval(timers[label][fn]); 119 delete timers[label][fn]; 120 } 121 } 122 123 for ( ret in timers[label] ) break; 124 if ( !ret ) { 125 ret = null; 126 delete timers[label]; 127 } 128 } 129 130 for ( ret in timers ) break; 131 if ( !ret ) 132 jQuery.removeData(element, this.dataKey); 133 } 134 } 135 } 136}); 137 138jQuery(window).bind("unload", function() { 139 jQuery.each(jQuery.timer.global, function(index, item) { 140 jQuery.timer.remove(item); 141 }); 142}); 143 144 $(document).ready(function(){ 145 $('#photos').galleryView({ 146 panel_width: 468, 147 panel_height: 232, 148 frame_width: 85, 149 frame_height: 60, 150 background_color:'#ccc', 151 border: 'none', 152 pause_on_hover: true, 153 nav_theme: 'custom' 154 }); 155 }); 156 157 158 159 160 161 162 163 164$(document).ready(function(){ 165 166 //When you click on a link with class of poplight and the href starts with a # 167 $('a.poplight[href^=#]').click(function() { 168 var popID = $(this).attr('rel'); //Get Popup Name 169 var popURL = $(this).attr('href'); //Get Popup href to define size 170 171 //Pull Query & Variables from href URL 172 var query= popURL.split('?'); 173 var dim= query[1].split('&'); 174 var popWidth = dim[0].split('=')[1]; //Gets the first query string value 175 176 //Fade in the Popup and add close button 177 $('#' + popID).fadeIn().css({ 'width': Number( popWidth ) }).prepend(''); 178 179 //Define margin for center alignment (vertical + horizontal) - we add 80 to the height/width to accomodate for the padding + border width defined in the css 180 var popMargTop = ($('#' + popID).height() + 80) / 2; 181 var popMargLeft = ($('#' + popID).width() + 80) / 2; 182 183 //Apply Margin to Popup 184 $('#' + popID).css({ 185 'margin-top' : -popMargTop, 186 'margin-left' : -popMargLeft 187 });
188 189 //Fade in Background 190 $('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag. 191 $('#fade').css({'filter' : 'alpha(opacity=70)'}).fadeIn(); //Fade in the fade layer 192 193 return false; 194 }); 195 196 197 //Close Popups and Fade Layer 198 $('a.close, #fade').live('click', function() { //When clicking on the close or fade layer... 199 $('#fade , .popup_block').fadeOut(function() { 200 $('#fade, a.close').remove(); 201 }); //fade them both out 202 203 return false; 204 }); 205 206 207});
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.