1/** 2 * This file is part of OXID eShop Community Edition. 3 * 4 * OXID eShop Community Edition is free software: you can redistribute it and/or modify 5 * it under the terms of the GNU General Public License as published by 6 * the Free Software Foundation, either version 3 of the License, or 7 * (at your option) any later version. 8 * 9 * OXID eShop Community Edition is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with OXID eShop Community Edition. If not, see <http://www.gnu.org/licenses/>. 16 * 17 * @link http://www.oxid-esales.com 18 * @copyright (C) OXID eSales AG 2003-2015 19 * @version OXID eShop CE 20 */ 21 22/** 23 * jQuery plugin for countdown 24 * usage is: 25 * $(SELECTOR) 26 * .countdown( 27 * function(count, element, container) { 28 * CALLBACK FUNCTION CODE 29 * } 30 * ); 31 * where the SELECTOR should return elements with time information in format hh:mm:ss 32 * if CALLBACK function returns a jQuery container, it is replaced from the next iteration 33 */ 34jQuery.fn.countdown = function(callback, start) { 35 36 if(jQuery(this).length == 0 ){ return false;} 37 var rs = this; 38 var go = false; 39 var dt = new Date(); 40 41 if(start) { 42 this.each( 43 function(){ 44 var ms = this.innerHTML.split(':'); 45 var sc = Number(ms[0]) * 60 * 60 + Number(ms[1]) * 60 + Number(ms[2]); 46 var rs_new = null; 47 if (callback) { 48 rs_new = callback(sc, this, rs); 49 if (rs_new) { 50 rs = rs_new; 51 } 52 } 53 if(sc>=1){ 54 sc--; 55 dt.setTime(sc*1000); 56 var hh = dt.getUTCHours(); if(hh < 10){hh = '0'+hh;} 57 var mm = dt.getUTCMinutes(); if(mm < 10){mm = '0'+mm;} 58 var ss = dt.getUTCSeconds(); if(ss < 10){ss = '0'+ss;} 59 this.innerHTML = String( hh+":"+mm+":"+ss ); 60 go = true; 61 } 62 } 63 ); 64 }else{ 65 go = true; 66 } 67 if(go){ 68 window.setTimeout( function() {jQuery(rs).countdown(callback, true);}, 1000); 69 } 70 return this; 71};
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.