1/** 2 * @file The core file for the events calendar plugin javascript. 3 * This file must load on all front facing events pages and be the first file loaded after vendor dependencies. 4 * @version 3.0 5 */ 6 7/** 8 * @namespace tribe_ev 9 * @desc The tribe_ev namespace that stores all custom functions, data, application state and an empty events object to bind custom events to. 10 * This Object Literal namespace loads for all tribe events pages and is by design fully public so that themers can hook in and/or extend anything they want from their own files. 11 * @example <caption>Test for tribe_ev in your own js and then run one of our functions.</caption> 12 * jQuery(document).ready(function ($) { 13 * if (Object.prototype.hasOwnProperty.call(window, 'tribe_ev')) { 14 * if(tribe_ev.fn.get_category() === 'Cats'){ 15 * alert('Meow!'); 16 * } 17 * } 18 * }); 19 */ 20 21var tribe_ev = window.tribe_ev || {}; 22 23/** 24 * @define {boolean} tribe_debug 25 * @global tribe_debug is used both by closure compiler to strip debug code on min and as a failsafe short circuit if compiler fails to strip all debug strings. 26 * @desc Setup safe enhanced console logging. See the link to get the available methods, then prefix with this short circuit: 'tribe_debug && '. tribe_debug is aliased in all tribe js doc readys as 'dbug'. 27 * @link http://benalman.com/code/projects/javascript-debug/docs/files/ba-debug-js.html 28 * @example <caption>EG: Place this at the very bottom of the doc ready for tribe-events.js. ALWAYS short circuit with 'tribe_debug && ' or 'dbug &&' if aliased as such.</caption> * 29 * tribe_debug && debug.info('tribe-events.js successfully loaded'); 30 */ 31 32var tribe_debug = true; 33 34/*! 35 * this debug code is stripped out by closure compiler so it is not present in the .min versions. 36 */ 37 38if(tribe_debug){ 39 40 /*! 41 * JavaScript Debug - v0.4 - 6/22/2010 42 * http://benalman.com/projects/javascript-debug-console-log/ 43 * 44 * Copyright (c) 2010 "Cowboy" Ben Alman 45 * Dual licensed under the MIT and GPL licenses. 46 * http://benalman.com/about/license/ 47 * 48 * With lots of help from Paul Irish! 49 * http://paulirish.com/ 50 */ 51 52 window.debug = (function () { 53 var window = this, 54 aps = Array.prototype.slice, 55 con = window.console, 56 that = {}, 57 callback_func, 58 callback_force, 59 log_level = 9, 60 log_methods = [ 'error', 'warn', 'info', 'debug', 'log' ], 61 pass_methods = 'assert clear count dir dirxml exception group groupCollapsed groupEnd profile profileEnd table time timeEnd trace'.split(' '), 62 idx = pass_methods.length, 63 logs = []; 64 65 while (--idx >= 0) { 66 (function (method) { 67 68 that[ method ] = function () { 69 log_level !== 0 && con && con[ method ] 70 && con[ method ].apply(con, arguments); 71 } 72 73 })(pass_methods[idx]); 74 } 75 76 idx = log_methods.length; 77 while (--idx >= 0) { 78 (function (idx, level) { 79 80 that[ level ] = function () { 81 var args = aps.call(arguments), 82 log_arr = [ level ].concat(args); 83 84 logs.push(log_arr); 85 exec_callback(log_arr); 86 87 if (!con || !is_level(idx)) { 88 return; 89 } 90 91 con.firebug ? con[ level ].apply(window, args) 92 : con[ level ] ? con[ level ](args) 93 : con.log(args); 94 }; 95 96 })(idx, log_methods[idx]); 97 } 98 99 function exec_callback(args) { 100 if (callback_func && (callback_force || !con || !con.log)) { 101 callback_func.apply(window, args); 102 } 103 } 104 105 that.setLevel = function (level) { 106 log_level = typeof level === 'number' ? level : 9; 107 }; 108 109 function is_level(level) { 110 return log_level > 0 111 ? log_level > level 112 : log_methods.length + log_level <= level; 113 } 114 115 that.setCallback = function () { 116 var args = aps.call(arguments), 117 max = logs.length, 118 i = max; 119 120 callback_func = args.shift() || null; 121 callback_force = typeof args[0] === 'boolean' ? args.shift() : false; 122 123 i -= typeof args[0] === 'number' ? args.shift() : max; 124 125 while (i < max) { 126 exec_callback(logs[i++]); 127 } 128 }; 129 130 return that; 131 })(); 132 133 if (Object.prototype.hasOwnProperty.call(window, 'tribe_ev')) { 134 tribe_ev.diagnostics = { 135 init: [] 136 }; 137 } 138} 139 140/** 141 * @global 142 * @desc Test for localstorage support. Returns false if not available and tribe_storage as a method if true. 143 * @example 144 * if (tribe_storage) { 145 * tribe_storage.setItem('cats', 'hairball'); 146 * tribe_storage.getItem('cats'); 147 * } 148 */ 149 150var tribe_storage, t_fail, t_uid; 151try { 152 t_uid = new Date; 153 (tribe_storage = window.localStorage).setItem(t_uid, t_uid); 154 t_fail = tribe_storage.getItem(t_uid) != t_uid; 155 tribe_storage.removeItem(t_uid); 156 t_fail && (tribe_storage = false); 157} catch (e) {} 158 159/* 160 * Date Format 1.2.3 161 * (c) 2007-2009 Steven Levithan <stevenlevithan.com> 162 * MIT license 163 * 164 * Includes enhancements by Scott Trenda <scott.trenda.net> 165 * and Kris Kowal <cixar.com/~kris.kowal/> 166 * 167 * Accepts a date, a mask, or a date and a mask. 168 * Returns a formatted version of the given date. 169 * The date defaults to the current date/time. 170 * The mask defaults to dateFormat.masks.default. 171 */ 172 173var tribeDateFormat = function () { 174 var token = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZ]|"[^"]*"|'[^']*'/g, 175 timezone = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g, 176 timezoneClip = /[^-+\dA-Z]/g, 177 pad = function (val, len) { 178 val = String(val); 179 len = len || 2; 180 while (val.length < len) val = "0" + val; 181 return val; 182 }; 183 184 // Regexes and supporting functions are cached through closure 185 return function (date, mask, utc) { 186 var dF = tribeDateFormat; 187 188 // You can't provide utc if you skip other args (use the "UTC:" mask prefix) 189 if (arguments.length == 1 && Object.prototype.toString.call(date) == "[object String]" && !/\d/.test(date)) { 190 mask = date; 191 date = undefined; 192 } 193 194 if (typeof date === 'string') 195 date = date.replace(/-/g, "/"); 196 197 // Passing date through Date applies Date.parse, if necessary 198 date = date ? new Date(date) : new Date; 199 if (isNaN(date)) 200 return; 201 202 mask = String(dF.masks[mask] || mask || dF.masks["default"]); 203 204 // Allow setting the utc argument via the mask 205 if (mask.slice(0, 4) == "UTC:") { 206 mask = mask.slice(4); 207 utc = true; 208 } 209 210 var _ = utc ? "getUTC" : "get", 211 d = date[_ + "Date"](), 212 D = date[_ + "Day"](), 213 m = date[_ + "Month"](), 214 y = date[_ + "FullYear"](), 215 H = date[_ + "Hours"](), 216 M = date[_ + "Minutes"](), 217 s = date[_ + "Seconds"](), 218 L = date[_ + "Milliseconds"](), 219 o = utc ? 0 : date.getTimezoneOffset(), 220 flags = { 221 d: d, 222 dd: pad(d), 223 ddd: dF.i18n.dayNames[D], 224 dddd: dF.i18n.dayNames[D + 7], 225 m: m + 1, 226 mm: pad(m + 1), 227 mmm: dF.i18n.monthNames[m], 228 mmmm: dF.i18n.monthNames[m + 12], 229 yy: String(y).slice(2), 230 yyyy: y, 231 h: H % 12 || 12, 232 hh: pad(H % 12 || 12), 233 H: H, 234 HH: pad(H), 235 M: M, 236 MM: pad(M), 237 s: s, 238 ss: pad(s), 239 l: pad(L, 3), 240 L: pad(L > 99 ? Math.round(L / 10) : L), 241 t: H < 12 ? "a" : "p", 242 tt: H < 12 ? "am" : "pm", 243 T: H < 12 ? "A" : "P", 244 TT: H < 12 ? "AM" : "PM", 245 Z: utc ? "UTC" : (String(date).match(timezone) || [""]).pop().replace(timezoneClip, ""), 246 o: (o > 0 ? "-" : "+") + pad(Math.floor(Math.abs(o) / 60) * 100 + Math.abs(o) % 60, 4), 247 S: ["th", "st", "nd", "rd"][d % 10 > 3 ? 0 : (d % 100 - d % 10 != 10) * d % 10] 248 }; 249 250 return mask.replace(token, function ($0) { 251 return $0 in flags ? flags[$0] : $0.slice(1, $0.length - 1); 252 }); 253 }; 254}(); 255 256tribeDateFormat.masks = { 257 "default" : "ddd mmm dd yyyy HH:MM:ss", 258 "tribeQuery" : "yyyy-mm-dd", 259 "tribeMonthQuery": "yyyy-mm", 260 "0" : 'yyyy-mm-dd', 261 "1" : 'm/d/yyyy', 262 "2" : 'mm/dd/yyyy', 263 "3" : 'd/m/yyyy', 264 "4" : 'dd/mm/yyyy', 265 "5" : 'm-d-yyyy', 266 "6" : 'mm-dd-yyyy', 267 "7" : 'd-m-yyyy', 268 "8" : 'dd-mm-yyyy', 269 "m0" : 'yyyy-mm', 270 "m1" : 'm/yyyy', 271 "m2" : 'mm/yyyy', 272 "m3" : 'm/yyyy', 273 "m4" : 'mm/yyyy', 274 "m5" : 'm-yyyy', 275 "m6" : 'mm-yyyy', 276 "m7" : 'm-yyyy', 277 "m8" : 'mm-yyyy' 278 279}; 280 281tribeDateFormat.i18n = { 282 dayNames: [ 283 "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", 284 "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday" 285 ], 286 monthNames: [ 287 "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", 288 "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "
288November", "December" 289 ] 290}; 291 292Date.prototype.format = function (mask, utc) { 293 return tribeDateFormat(this, mask, utc); 294}; 295 296(function(){ 297 298/** 299 * @function tribe_tmpl 300 * @desc Javascript templating function based on John Resigs micro-templating approach and expanded upon by cho45. Tags and function name changed here to avoid conflicts. 301 * @param id The javascript template 302 * @param data The data object 303 */ 304 305 /** 306 * https://github.com/cho45/micro-template.js 307 * (c) cho45 http://cho45.github.com/mit-license 308 */ 309 function tribe_tmpl(id, data) { 310 var me = arguments.callee; 311 if (!me.cache[id]) me.cache[id] = (function () { 312 var name = id, string = /^[\w\-]+$/.test(id) ? me.get(id): (name = 'template(string)', id); // no warnings 313 var line = 1, body = ( 314 "try { " + 315 (me.variable ? "var " + me.variable + " = this.stash;" : "with (this.stash) { ") + 316 "this.ret += '" + 317 string. 318 replace(/\[\[/g, '\x11').replace(/\]\]/g, '\x13'). // if you want other tag, just edit this line 319 replace(/'(?![^\x11\x13]+?\x13)/g, '\\x27'). 320 replace(/^\s*|\s*$/g, ''). 321 replace(/\n/g, function () { return "';\nthis.line = " + (++line) + "; this.ret += '\\n" }). 322 replace(/\x11=raw(.+?)\x13/g, "' + ($1) + '"). 323 replace(/\x11=(.+?)\x13/g, "' + this.escapeHTML($1) + '"). 324 replace(/\x11(.+?)\x13/g, "'; $1; this.ret += '") + 325 "'; " + (me.variable ? "" : "}") + "return this.ret;" + 326 "} catch (e) { throw 'TemplateError: ' + e + ' (on " + name + "' + ' line ' + this.line + ')'; } " + 327 "//@ sourceURL=" + name + "\n" // source map 328 ).replace(/this\.ret \+= '';/g, ''); 329 var func = new Function(body); 330 var map = { '&' : '&', '<' : '<', '>' : '>', '\x22' : '"', '\x27' : ''' }; 331 var escapeHTML = function (string) { return (''+string).replace(/[&<>\'\"]/g, function (_) { return map[_] }) }; 332 return function (stash) { return func.call(me.context = { escapeHTML: escapeHTML, line: 1, ret : '', stash: stash }) }; 333 })(); 334 return data ? me.cache[id](data) : me.cache[id]; 335 } 336 tribe_tmpl.cache = {}; 337 tribe_tmpl.get = function (id) { return document.getElementById(id).innerHTML }; 338 339 /** 340 * Extended template function: 341 * requires: basic template() function 342 * provides: 343 * include(id) 344 * wrapper(id, function () {}) 345 */ 346 function tribe_tmpl_extended(id, data) { 347 var fun = function (data) { 348 data.include = function (name, args) { 349 var stash = {}; 350 for (var key in tribe_tmpl.context.stash) if (tribe_tmpl.context.stash.hasOwnProperty(key)) { 351 stash[key] = tribe_tmpl.context.stash[key]; 352 } 353 if (args) for (var key in args) if (args.hasOwnProperty(key)) { 354 stash[key] = args[key]; 355 } 356 var context = tribe_tmpl.context; 357 context.ret += tribe_tmpl(name, stash); 358 tribe_tmpl.context = context; 359 }; 360 361 data.wrapper = function (name, fun) { 362 var current = tribe_tmpl.context.ret; 363 tribe_tmpl.context.ret = ''; 364 fun.apply(tribe_tmpl.context); 365 var content = tribe_tmpl.context.ret; 366 var orig_content = tribe_tmpl.context.stash.content; 367 tribe_tmpl.context.stash.content = content; 368 tribe_tmpl.context.ret = current + tribe_tmpl(name, tribe_tmpl.context.stash); 369 tribe_tmpl.context.stash.content = orig_content; 370 }; 371 372 return tribe_tmpl(id, data); 373 }; 374 375 return data ? fun(data) : fun; 376 } 377 378 tribe_tmpl.get = function (id) { 379 var fun = tribe_tmpl_extended.get; 380 return fun ? fun(id) : document.getElementById(id).innerHTML; 381 }; 382 383 this.tribe_tmpl = tribe_tmpl; 384 this.tribe_tmpl_extended = tribe_tmpl_extended; 385 386 387})(); 388 389/** 390 * @external "jQuery.fn" 391 * @desc The jQuery plugin namespace. 392 */ 393 394 395(function ($, undefined) { 396 397 /** 398 * @function external:"jQuery.fn".tribe_clear_form 399 * @desc Clear a forms inputs with jquery. 400 * @example <caption>Clear a form with the forms id as a selector.</caption> 401 * $('#myForm').tribe_clear_form(); 402 */ 403 $.fn.tribe_clear_form = function () { 404 return this.each(function () { 405 var type = this.type, tag = this.tagName.toLowerCase(); 406 if (tag == 'form') 407 return $(':input', this).tribe_clear_form(); 408 if (type == 'text' || type == 'password' || tag == 'textarea') 409 this.value = ''; 410 else if (type == 'checkbox' || type == 'radio') 411 this.checked = false;
412 else if (tag == 'select') 413 this.selectedIndex = 0; 414 }); 415 }; 416 /** 417 * @function external:"jQuery.fn".tribe_has_attr 418 * @desc Check if a given element has an attribute. 419 * @example if($('#myLink').tribe_has_attr('data-cats')) {true} else {false} 420 */ 421 $.fn.tribe_has_attr = function (name) { 422 return this.attr(name) !== undefined; 423 }; 424 /** 425 * @function external:"jQuery.fn".tribe_spin 426 * @desc Shows loading spinners for events ajax interactions. 427 * @example $('#myElement').tribe_spin(); 428 */ 429 $.fn.tribe_spin = function () { 430 var $loadingImg = $('.tribe-events-ajax-loading:first').clone().addClass('tribe-events-active-spinner'); 431 $loadingImg.prependTo('#tribe-events-content'); 432 $(this).addClass('tribe-events-loading').css('opacity', .25) 433 }; 434 435 if ( "undefined" !== typeof $.fn.datepicker ) { 436 var datepicker = $.fn.datepicker.noConflict(); 437 $.fn.bootstrapDatepicker = datepicker; 438 } 439 440 if ( "undefined" !== typeof tribe_bootstrap_datepicker_strings && tribe_bootstrap_datepicker_strings.dates != null ) 441 $.fn.bootstrapDatepicker.dates['en'] = tribe_bootstrap_datepicker_strings.dates; 442 443})(jQuery); 444 445(function (window, document, $, dbug, undefined) { 446 /** 447 * @namespace tribe_ev.fn 448 * @desc tribe_ev.fn namespace stores all the custom functions used throughout the core events plugin. 449 */ 450 tribe_ev.fn = { 451 /** 452 * @function tribe_ev.fn.current_date 453 * @desc tribe_ev.fn.current_date simply gets the current date in javascript and formats it to yyyy-mm-dd for use were needed. 454 * @example var right_now = tribe_ev.fn.current_date(); 455 */ 456 current_date: function () { 457 458 var today = new Date(), 459 dd = today.getDate(), 460 mm = today.getMonth() + 1, 461 yyyy = today.getFullYear(); 462 463 if (dd < 10) { 464 dd = '0' + dd 465 } 466 if (mm < 10) { 467 mm = '0' + mm 468 } 469 return yyyy + '-' + mm + '-' + dd; 470 }, 471 /** 472 * @function tribe_ev.fn.disable_inputs 473 * @desc tribe_ev.fn.disable_inputs disables all inputs of a specified type inside a parent element, and also disables select2 selects if it discovers any. 474 * @param {String} parent The top level element you would like all child inputs of the specified type to be disabled for. 475 * @param {String} type A single or comma separated string of the type of inputs you would like disabled. 476 * @example <caption>Disable all inputs and selects for #myForm.</caption> 477 * tribe_ev.fn.disable_inputs( '#myForm', 'input, select' ); 478 */ 479 disable_inputs: function (parent, type) { 480 $(parent).find(type).prop('disabled', true); 481 if ($(parent).find('.select2-container').length) { 482 $(parent).find('.select2-container').each(function () { 483 var s2_id = $(this).attr('id'); 484 var $this = $('#' + s2_id); 485 $this.select2("disable"); 486 }); 487 } 488 }, 489 /** 490 * @function tribe_ev.fn.disable_empty 491 * @desc tribe_ev.fn.disable_empty disables all empty inputs of a specified type inside a parent element. 492 * @param {String} parent The top level element you would like all empty child inputs of the specified type to be disabled for. 493 * @param {String} type A single or comma separated string of the type of empty inputs you would like disabled. 494 * @example <caption>Disable all empty inputs and selects for #myForm.</caption> 495 * tribe_ev.fn.disable_empty( '#myForm', 'input, select' ); 496 */ 497 disable_empty: function (parent, type) { 498 $(parent).find(type).each(function () { 499 if ($(this).val() === '') { 500 $(this).prop('disabled', true); 501 } 502 }); 503 }, 504 /** 505 * @function tribe_ev.fn.enable_inputs 506 * @desc tribe_ev.fn.enable_inputs enables all inputs of a specified type inside a parent element, and also enables select2 selects if it discovers any. 507 * @param {String} parent The top level element you would like all child inputs of the specified type to be disabled for. 508 * @param {String} type A single or comma separated string of the type of inputs you would like enabled. 509 * @example <caption>Enable all inputs and selects for #myForm.</caption> 510 * tribe_ev.fn.enable_inputs( '#myForm', 'input, select' ); 511 */ 512 enable_inputs: function (parent, type) { 513 $(parent).find(type).prop('disabled', false); 514 if ($(parent).find('.select2-container').length) { 515 $(parent).find('.select2-container').each(function () { 516 var s2_id = $(this).attr('id'); 517 var $this = $('#' + s2_id); 518 $this.select2("enable"); 519 }); 520 } 521 }, 522 /** 523 * @function tribe_ev.fn.execute_resize 524 * @desc tribe_ev.fn.execute_resize groups together functions that should execute at the end of the window resize event. 525 */ 526 execute_resize: function () { 527 528 var prev_width = tribe_ev.data.v_width; 529 tribe_ev.fn.update_viewport_variables(); 530 if(prev_width !== tribe_ev.data.v_width){ 531 tribe_ev.fn.mobile_class(); 532 $(tribe_ev.events).trigger('tribe_ev_resizeComplete'); 533 } 534 535 }, 536 /** 537 * @function tribe_ev.fn.get_base_url 538 * @desc tribe_ev.fn.get_base_url can be used on any events view to get the base_url for that view, even when on a category subset for that view. 539 * @returns {String} Either an empty string or base url if data-baseurl is found on #tribe-events-header. 540 * @example var base_url = tribe_ev.fn.get_base_url(); 541 */ 542 get_base_url: function () { 543 var base_url = '', 544 $event_header = $('#tribe-events-header'); 545 if ($event_header.length){ 546 base_url = $event_header.data('baseurl'); 547 } 548 return base_url; 549 }, 550 /** 551 * @function tribe_ev.fn.get_category 552 * @desc tribe_ev.fn.get_category can be used on any events view to get the category for that view. 553 * @returns {String} Either an empty string or category slug if data-category is found on #tribe-events. 554 * @example var cat = tribe_ev.fn.get_category(); 555 */ 556 get_category: function () { 557 if (tribe_ev.fn.is_category()) 558 return $('#tribe-events').data('category'); 559 else 560 return ''; 561 }, 562 /** 563 * @function tribe_ev.fn.get_day 564 * @desc tribe_ev.fn.get_day can be used to check the event bar for a day value that was set by the user when using the datepicker. 565 * @returns {String|Number} Either an empty string or day number if #tribe-bar-date-day has a val() set by user interaction. 566 * @example var day = tribe_ev.fn.get_day(); 567 */ 568 get_day: function () { 569 var dp_day = ''; 570 if ($('#tribe-bar-date').length) { 571 dp_day = $('#tribe-bar-date-day').val(); 572 } 573 dbug && debug.info('TEC Debug: tribe_ev.fn.get_day returned this date: "' + dp_day + '".'); 574 return dp_day; 575 }, 576 /** 577 * @function tribe_ev.fn.get_params 578 * @desc tribe_ev.fn.get_params returns the params of the current document.url. 579 * @returns {String} any url params sans "?". 580 * @example var params = tribe_ev.fn.get_params(); 581 */ 582 get_params: function () { 583 return location.search.substr(1); 584 }, 585 /** 586 * @function tribe_ev.fn.get_url_param 587 * @desc tribe_ev.fn.get_url_param returns the value of a passed param name if set. 588 * @param {String} name The name of the url param value desired. 589 * @returns {String|Null} the value of a parameter if set or null if not. 590 * @example var param = tribe_ev.fn.get_url_param('category'); 591 */ 592 get_url_param: function (name) { 593 return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search) || [, ""])[1].replace(/\+/g, '%20')) || null; 594 }, 595 /** 596 * @function tribe_ev.fn.in_params 597 * @desc tribe_ev.fn.in_params returns the value of a passed param name if set. 598 * @param {String} params The parameter string you would like to search for a term. 599 * @param {String} term The name of the url param value you are checking for. 600 * @returns {Number} Returns index if term is present in params, or -1 if not found. 601 * @example 602 * if (tribe_ev.fn.in_params(tribe_ev.data.params, "tabby") >= 0)){ 603 * // tabby is in params 604 * } else { 605 * // tabby is not in params 606 * } 607 */ 608 in_params: function (params, term) { 609 return params.toLowerCase().indexOf(term); 610 }, 611 /** 612 * @function tribe_ev.fn.invalid_date
613 * @desc tribe_ev.fn.invalid_date tests a date object and confirms if it is actually valid by forcing parseDate on it. 614 * @returns {Boolean} Returns true if date is invalid, false if valid. 615 * @example if(tf.invalid_date(ts.date)) return; 616 */ 617 invalid_date: function(date){ 618 619 date = new Date(date); 620 return isNaN(date); 621 622 }, 623 invalid_date_in_params: function(params){ 624 625 if(params.hasOwnProperty('tribe-bar-date')){ 626 var date = new Date(params['tribe-bar-date']); 627 return isNaN(date); 628 } 629 return false; 630 631 }, 632 /** 633 * @function tribe_ev.fn.is_category 634 * @desc tribe_ev.fn.is_category test for whether the view is a category subpage in the pretty permalink system. 635 * @returns {Boolean} Returns true if category page, false if not. 636 * @example if (tribe_ev.fn.is_category()){ true } else { false } 637 */ 638 is_category: function () { 639 var $tribe_events = $('#tribe-events'); 640 return ($tribe_events.length && $tribe_events.tribe_has_attr('data-category') && $tribe_events.data('category') !== '') ? true : false; 641 }, 642 /** 643 * @function tribe_ev.fn.mobile_class 644 * @desc tribe_ev.fn.mobile_class adds or removes a mobile class from the body element based on the mobile breakpoint. 645 */ 646 mobile_class: function(){ 647 var $body = $('body'); 648 649 if(tribe_ev.data.v_width <= tribe_ev.data.mobile_break) 650 $body.addClass('tribe-mobile'); 651 else 652 $body.removeClass('tribe-mobile'); 653 }, 654 /** 655 * @function tribe_ev.fn.parse_string 656 * @desc tribe_ev.fn.parse_string converts a string to an object. 657 * @param {String} string The string to be converted. 658 * @returns {Object} Returns mapped object. 659 * @example if (tribe_ev.fn.is_category()){ true } else { false } 660 */ 661 parse_string: function (string) { 662 var map = {}; 663 if (string && string != 'undefined') { 664 string.replace(/([^&=]+)=?([^&]*)(?:&+|$)/g, function (match, key, value) { 665 (map[key] = map[key] || []).push(value); 666 }); 667 dbug && debug.info('TEC Debug: tribe_ev.fn.parse_string returned this map:', map); 668 } 669 return map; 670 }, 671 /** 672 * @function tribe_ev.fn.pre_ajax 673 * @desc tribe_ev.fn.pre_ajax allows for functions to be executed before ajax begins. 674 * @param {Function} callback The callback function, expected to be an ajax function for one of our views. 675 */ 676 pre_ajax: function (callback) { 677 if (callback && typeof( callback ) === "function") { 678 callback(); 679 } 680 }, 681 /** 682 * @function tribe_ev.fn.scroll_to 683 * @desc tribe_ev.fn.scroll_to animates the body to the target with the passed duration and offset. 684 * @param {String} target the id of the target to scroll the body to. 685 * @param {Number} offset the vertical offset from the target.. 686 * @param {Number} duration the duration of the scroll animation. 687 */ 688 scroll_to: function (target, offset, duration) { 689 $('html, body').stop().animate({scrollTop: $(target).offset().top - offset}, {duration: duration}); 690 }, 691 /** 692 * @function tribe_ev.fn.serialize 693 * @desc tribe_ev.fn.serialize serializes the passed input types. Enable/disable stack in place to protect inputs during process, especially for live ajax mode. 694 * @param {String} form The form element. 695 * @param {String} type The input types to be serialized. 696 * @returns {String} Returns a param string of populated inputs. 697 * @example tribe_ev.fn.serialize('#myForm', 'input, select'); 698 */ 699 serialize: function (form, type) { 700 tribe_ev.fn.enable_inputs(form, type); 701 tribe_ev.fn.disable_empty(form, type); 702 var params = $(form).serialize(); 703 tribe_ev.fn.disable_inputs(form, type); 704 dbug && params && debug.info('TEC Debug: tribe_ev.fn.serialize returned these params: "' + params); 705 return params; 706 }, 707 /** 708 * @function tribe_ev.fn.set_form 709 * @desc tribe_ev.fn.set_form takes a param string and sets a forms inputs to the values received. Extended in the Query Filters plugin. 710 * @param {String} params The params to be looped over and applied to the named input. Needed for back button browser history when forms are outside of the ajax area. 711 * @example <caption>Set all inputs in a form(s) to the values in a param string retrieved from the history object on popstate.</caption> 712 * $(window).on('popstate', function (event) { 713 * var state = event.originalEvent.state; 714 * if (state) { 715 * tribe_ev.state.params = state.tribe_params;
716 * // do something magical to restore query state like ajax, then set the forms to match the history state like so: 717 * tribe_ev.fn.set_form(tribe_ev.state.params); 718 * } 719 * }); 720 */ 721 set_form: function (params) { 722 //alert('set_form func of tribe-event.js on back button.'); 723 var $body = $('body'), 724 $tribe_bar = $('#tribe-bar-form'); 725 //alert($body); 726 //alert($body.attr('class')); 727 $body.addClass('tribe-reset-on'); 728 729 //WPB-2666 + WPB-2679 730 //alert(site_GlobalArr["siteURL"] + ' >> ' + site_GlobalArr["sitePjax"] + ' >> ' + site_GlobalArr["pageFlag"]); 731 if (site_GlobalArr["sitePjax"] && site_GlobalArr["sitePjax"] != 'undefined') { 732 if (site_GlobalArr["sitePjax"] == 'yes') { 733 if (site_GlobalArr["pageFlag"] && site_GlobalArr["pageFlag"] != 'undefined') { 734 if (site_GlobalArr["pageFlag"] == 'category_list_page') { 735 document.title = 'Category Page'; 736 $body.addClass('archive category category-local_news category-1478 custom-background site-bg desktop gecko tribe-theme-parent-cumulus-master tribe-theme-child-cumulus-master-wplj page-template-archive-php tribe-reset-on'); 737 } 738 else if (site_GlobalArr["pageFlag"] == 'upcoming_events_list_page') { 739 document.title = 'Upcoming Events'; 740 $body.addClass('custom-background site-bg tribe-filter-live desktop gecko events-list events-archive tribe-theme-parent-cumulus-master tribe-theme-child-cumulus-master-wplj tribe-events-page-template tribe-is-responsive tribe-reset-on'); 741 } 742 } 743 else { 744 var siteURL_value = window.location.href; 745 siteURL_value = siteURL_value.replace("http://", ""); siteURL_value = siteURL_value.replace("https://", ""); 746 var tempArr = siteURL_value.split('/'); 747 if (tempArr[1] == 'category') { 748 document.title = 'Category Page'; 749 $body.addClass('archive category category-local_news category-1478 custom-background site-bg desktop gecko tribe-theme-parent-cumulus-master tribe-theme-child-cumulus-master-wplj page-template-archive-php tribe-reset-on'); 750 } 751 else if (tempArr[1] == 'events') { 752 document.title = 'Upcoming Events'; 753 $body.addClass('custom-background site-bg tribe-filter-live desktop gecko events-list events-archive tribe-theme-parent-cumulus-master tribe-theme-child-cumulus-master-wplj tribe-events-page-template tribe-is-responsive tribe-reset-on'); 754 } 755 } 756 } 757 } 758 759 //alert('test comes here.....'); 760 //alert($tribe_bar.length); 761 if ($tribe_bar.length) { 762 $tribe_bar.tribe_clear_form(); 763 } 764 765 //alert(params); 766 if (params && params != 'undefined') { 767 768 } 769 else { 770 /*params = { 771 action: 'tribe_list', 772 tribe_paged: 1 773 };*/ 774 params = 'action=tribe_list&tribe_paged=1'; 775 } 776 //alert(params); 777 778 params = tribe_ev.fn.parse_string(params); 779 //alert(params); 780 781 $.each(params, function (key, value) { 782 if (key !== 'action') { 783 var name = decodeURI(key), 784 $target = ''; 785 if (value.length === 1) { 786 if ($('[name="' + name + '"]').is('input[type="text"], input[type="hidden"]')) { 787 $('[name="' + name + '"]').val(value); 788 } else if ($('[name="' + name + '"][value="' + value + '"]').is(':checkbox, :radio')) { 789 $('[name="' + name + '"][value="' + value + '"]').prop("checked", true); 790 } else if ($('[name="' + name + '"]').is('select')) { 791 $('select[name="' + name + '"] option[value="' + value + '"]').attr('selected', true); 792 } 793 } else { 794 for (var i = 0; i < value.length; i++) { 795 $target = $('[name="' + name + '"][value="' + value[i] + '"]'); 796 if ($target.is(':checkbox, :radio')) { 797 $target.prop("checked", true); 798 } else { 799 $('select[name="' + name + '"] option[value="' + value[i] + '"]').attr('selected', true); 800 } 801 } 802 } 803 } 804 }); 805 806 $body.removeClass('tribe-reset-on'); 807 808 dbug && debug.info('TEC Debug: tribe_ev.fn.set_form fired these params: "' + params); 809 }, 810 /** 811 * @function tribe_ev.fn.setup_ajax_timer 812 * @desc tribe_ev.fn.setup_ajax_timer is a simple function to add a delay to the execution of a passed callback function, in our
812case ajax hence the name. 813 * @param {Function} callback Used to delay ajax execution when in live ajax mode. 814 * @example <caption>Run some crazy ajax.</caption> 815 * tribe_ev.fn.setup_ajax_timer( function() { 816 * run_some_crazy_ajax(); 817 * }); 818 */ 819 setup_ajax_timer: function (callback) { 820 var timer = 500; 821 clearTimeout(tribe_ev.state.ajax_timer); 822 if (!tribe_ev.tests.reset_on()) { 823 tribe_ev.state.ajax_timer = setTimeout(function () { 824 callback(); 825 }, timer); 826 dbug && debug.info('TEC Debug: tribe_ev.fn.setup_ajax_timer fired with a timeout of "' + timer + '" ms'); 827 } 828 }, 829 /** 830 * @function tribe_ev.fn.snap 831 * @desc tribe_ev.fn.snap uses jquery to bind a handler to a trigger_parent which uses bubbling of a click event from the trigger to position the document to the passed container. Has an offset of -120 px to get some breathing room. 832 * @param {String} container the jquery selector to send the document to. 833 * @param {String} trigger_parent the persistent element to bind the handler to. 834 * @param {String} trigger the trigger for the click event 835 * @example <caption>"Snap" the document 120 px above the tribe bar when a footer nav link is clicked.</caption> 836 * tribe_ev.fn.snap('#tribe-bar-form', '#tribe-events', '#tribe-events-footer a'); 837 */ 838 snap: function (container, trigger_parent, trigger) { 839 $(trigger_parent).on('click', trigger, function (e) { 840 e.preventDefault(); 841 $('html, body').animate({scrollTop: $(container).offset().top - 120}, {duration: 0}); 842 }); 843 }, 844 845 /** 846 * @function tribe_ev.fn.tooltips 847 * @desc tribe_ev.fn.tooltips binds the event handler that covers all tooltip hover events for the various views. Extended in tribe-events-pro.js for the pro views. One of the reasons both these files must load FIRST in the tribe events js stack at all times. 848 * @example <caption>It's really not that hard... Get yourself inside a doc ready and...</caption> 849 * tribe_ev.fn.tooltips(); 850 */ 851 tooltips: function () { 852 $('#tribe-events').on('mouseenter', 'div[id*="tribe-events-event-"], div.event-is-recurring',function () { 853 854 var bottomPad = 0, 855 $this = $(this), 856 $body = $('body'), 857 $tip; 858 859 if ($body.hasClass('events-gridview')) { // Cal View Tooltips 860 bottomPad = $this.find('a').outerHeight() + 18; 861 } else if ($body.is('.single-tribe_events, .events-list, .tribe-events-day')) { // Single/List View Recurring Tooltips 862 bottomPad = $this.outerHeight() + 12; 863 } else if ($body.is('.tribe-events-photo')) { // Photo View 864 bottomPad = $this.outerHeight() + 10; 865 } 866 867 // Widget Tooltips 868 if ($this.parents('.tribe-events-calendar-widget').length) { 869 bottomPad = $this.outerHeight() - 6; 870 } 871 if (!$body.hasClass('tribe-events-week')) { 872 if($body.hasClass('events-gridview')){ 873 $tip = $this.find('.tribe-events-tooltip'); 874 875 if(!$tip.length){ 876 var data = $this.data('tribejson'); 877 878 if (typeof data == 'string') 879 data = $.parseJSON(data); 880 881 $this 882 .append(tribe_tmpl('tribe_tmpl_tooltip', data)); 883 884 $tip = $this.find('.tribe-events-tooltip'); 885 886 $tip.css('bottom', bottomPad).show(); 887 } else { 888 $tip.css('bottom', bottomPad).show(); 889 } 890 } else { 891 $this.find('.tribe-events-tooltip').css('bottom', bottomPad).show(); 892 } 893 } 894 895 }).on('mouseleave', 'div[id*="tribe-events-event-"], div[id*="tribe-events-daynum-"]:has(a), div.event-is-recurring', function () { 896 $(this).find('.tribe-events-tooltip').stop(true, false).fadeOut(200); 897 }); 898 }, 899 /** 900 * @function tribe_ev.fn.update_picker 901 * @desc tribe_ev.fn.update_picker Updates the custom bootstrapDatepicker if it and the event bar is present, or only the event bar input if it is present. 902 * @param {String} date The date string to update picker or input with. 903 * @example <caption>Bind a handler that updates the datepicker if present with the date, in this case harvested from a data attribute on the link.</caption> 904 * $('#tribe-events').on('click', '.tribe-events-nav-previous a', function (e) { 905 * e.preventDefault(); 906 * var $this = $(this); 907 * tribe_ev.state.date = $this.attr("data-day"); 908 * tribe_ev.fn.update_picker(tribe_ev.state.date); 909 * }); 910 */ 911 update_picker: function (date) { 912 var $bar_date = $("#tribe-bar-date"); 913 if ($().bootstrapDatepicker && $bar_date.length) { 914 // for ie8 and under 915 tribe_ev.state.updating_picker = true; 916 if (window.attachEvent && !window.addEventListener) { 917 $bar_date.bootstrapDatepicker("remove"); 918 $bar_date.val(''); 919 $bar_date.bootstrapDatepicker(tribe_ev.data.datepicker_opts); 920 } 921 $bar_date.bootstrapDatepicker("setDate", date); 922 tribe_ev.state.updating_picker = false;
923 dbug && debug.info('TEC Debug: tribe_ev.fn.update_picker sent "' + date + '" to the boostrapDatepicker'); 924 } else if ($bar_date.length) { 925 $bar_date.val(date); 926 dbug && debug.warn('TEC Debug: tribe_ev.fn.update_picker sent "' + date + '" to ' + $bar_date); 927 } else { 928 929 dbug && debug.warn('TEC Debug: tribe_ev.fn.update_picker couldnt send "' + date + '" to any object.'); 930 } 931 }, 932 /** 933 * @function tribe_ev.fn.update_viewport_variables 934 * @desc tribe_ev.fn.update_viewport_variables surprisingly updates the viewport variables stored in the tribe_ev.data object. 935 */ 936 update_viewport_variables: function () { 937 tribe_ev.data.v_height = $(window).height(); 938 tribe_ev.data.v_width = $(window).width(); 939 }, 940 /** 941 * @function tribe_ev.fn.url_path 942 * @desc tribe_ev.fn.url_path strips query vars from a url passed to it using js split on the ? character. 943 * @param {String} url The url to remove all vars from. 944 * @returns {String} Returns a url devoid of any query vars. 945 * @example <caption>Get the query var free version of an href attribute.</caption> 946 * $('#tribe-events').on('click', '.tribe-events-nav-next', function (e) { 947 * e.preventDefault(); 948 * tribe_ev.data.cur_url = tribe_ev.fn.url_path($(this).attr('href')); 949 * }); 950 */ 951 url_path: function (url) { 952 return url.split("?")[0]; 953 }, 954 /** 955 * @function tribe_ev.fn.equal_height 956 * @desc tribe_ev.fn.equal_height gets the tallest height of a set of elements and sets them to the same height. 957 * @param {Object} $group The group of elements to get and set tallest height from. 958 * @example <caption>Get and set the height to the tallest of a set of elements.</caption> 959 * $('#tribe-events .columns').tribe_ev.fn.equal_height(); 960 */ 961 equal_height: function ($group) { 962 var tallest = 0; 963 $group.css('height', 'auto'); 964 $group.each(function () { 965 var this_height = $(this).outerHeight(); 966 if (this_height > tallest) { 967 tallest = this_height; 968 } 969 }); 970 setTimeout(function() { 971 $group.css('height', tallest); 972 }, 100); 973 } 974 975 }; 976 977 /** 978 * @namespace tribe_ev 979 * @desc tribe_ev.tests namespace stores all the custom tests used throughout the core events plugin. 980 */ 981 982 tribe_ev.tests = { 983 /** 984 * @function tribe_ev.tests.live_ajax 985 * @desc tribe_ev.tests.live_ajax tests if live ajax is enabled in the events settings tab by checking the data attribute data-live_ajax on #tribe-events in the front end. 986 * @example <caption>Very easy test to use. In a doc ready:</caption> 987 * if (tribe_ev.tests.live_ajax()) { 988 * // live ajax is on 989 * ) else { 990 * // live ajax is off 991 * } 992 */ 993 live_ajax: function () { 994 var $tribe_events = $('#tribe-events'); 995 return ($tribe_events.length && $tribe_events.tribe_has_attr('data-live_ajax') && $tribe_events.data('live_ajax') == '1') ? true : false; 996 }, 997 /** 998 * @function tribe_ev.tests.map_view 999 * @desc tribe_ev.tests.map_view test if we are on map view. 1000 * @example <caption>Test if we are on map view</caption> 1001 * if (tribe_ev.tests.map_view()) { 1002 * // we are on map view 1003 * ) 1004 */ 1005 map_view: function () { 1006 return ( typeof GeoLoc !== 'undefined' && GeoLoc.map_view ) ? true : false; 1007 }, 1008 /** 1009 * @function tribe_ev.tests.no_bar 1010 * @desc tribe_ev.tests.has_bar tests if the events bar is enabled on the front end. 1011 * @example <caption>Very easy test to use. In a doc ready:</caption> 1012 * if (tribe_ev.tests.no_bar()) { 1013 * // no event bar 1014 * ) else { 1015 * // has event bar 1016 * } 1017 */ 1018 no_bar: function(){ 1019 return $('body').is('.tribe-bar-is-disabled'); 1020 }, 1021 /** 1022 * @type Boolean tribe_ev.tests.pushstate 1023 * @desc tribe_ev.tests.pushstate checks if the history object is available safely and returns true or false. 1024 * @example <caption>Execute an if else on the presence of pushstate</caption> 1025 * if (tribe_ev.tests.pushstate) { 1026 * // pushstate is available 1027 * ) else { 1028 * // pushstate is not available 1029 * } 1030 */ 1031 pushstate: !!(window.history && history.pushState), 1032 /** 1033 * @function tribe_ev.tests.reset_on 1034 * @desc tribe_ev.tests.reset_on tests if any other function is currently disabling a tribe ajax function. 1035 * @example <caption>In another handler that will be triggering a tribe ajax function:</caption> 1036 * if (!tribe_ev.tests.reset_on()) { 1037 * // reset is not occuring so lets run some other ajax 1038 * ) 1039 */ 1040 reset_on: function () { 1041 return $('body').is('.tribe-reset-on'); 1042 }, 1043 /** 1044 * @function tribe_ev.tests.starting_delim 1045 * @desc tribe_ev.tests.starting_delim is used by events url forming functions to determine if "?" is already present. It then sets the delimiter for the next part of the url concatenation to "?" if not found and "&" if it is. 1046 * @example <caption>Test and set delimiter during url string concatenation.</caption> 1047 * tribe_ev.state.cur_url += tribe_ev.tests.starting_delim + tribe_ev.state.url_params; 1048 */ 1049 starting_delim: function () { 1050 return tribe_ev.state.cur_url.indexOf('?') != -1 ? '&' : '?'; 1051 }, 1052 /** 1053 * @type Boolean tribe_ev.tests.webkit 1054 * @desc tribe_ev.tests.webkit checks if webkit is the browser in use and returns true or false. 1055 * @example <caption>Execute an if else on the presence of pushstate</caption> 1056 * if (tribe_ev.tests.webkit) { 1057 * // is webkit 1058 * ) else { 1059 * // is not webkit 1060 * } 1061 */ 1062 webkit: 'WebkitAppearance' in document.documentElement.style 1063 }; 1064 1065 /** 1066 * @namespace tribe_ev 1067 * @desc tribe_ev.data stores information that is sometimes used internally and also contains useful data for themers. 1068 */ 1069 1070 tribe_ev.data = { 1071 ajax_response: {}, 1072 base_url: '', 1073 cur_url: tribe_ev.fn.url_path(document.URL), 1074 cur_date: tribe_ev.fn.current_date(), 1075 datepicker_formats: { 1076 'main':['yyyy-mm-dd','m/d/yyyy','mm/dd/yyyy','d/m/yyyy','dd/mm/yyyy','m-d-yyyy','mm-dd-yyyy','d-m-yyyy','dd-mm-yyyy'], 1077 'month':['yyyy-mm','m/yyyy','mm/yyyy','m/yyyy','mm/yyyy','m-yyyy','mm-yyyy','m-yyyy','mm-yyyy'] 1078 }, 1079 datepicker_opts: {}, 1080 initial_url: tribe_ev.fn.url_path(document.URL), 1081 mobile_break: 768, 1082 params: tribe_ev.fn.get_params(), 1083 v_height:0, 1084 v_width:0 1085 }; 1086 1087 /** 1088 * @namespace tribe_ev 1089 * @desc tribe_ev.events is an empty object used to attach all tribe custom events to. 1090 */ 1091 1092 tribe_ev.events = {}; 1093 1094 /** 1095 * @namespace tribe_ev 1096 * @desc tribe_ev.state is mainly used in events ajax operations, though a few variables are set on doc ready. 1097 */ 1098 1099 tribe_ev.state = { 1100 ajax_running : false, 1101 ajax_timer : 0, 1102 ajax_trigger : '', 1103 category : '', 1104 date : '', 1105 datepicker_format: '0', 1106 do_string : false, 1107 filters : false, 1108 filter_cats : false, 1109 initial_load : true, 1110 mdate : '', 1111 paged : 1, 1112 page_title : '', 1113 params : {}, 1114 popping : false, 1115 pushstate : true, 1116 pushcount : 0, 1117 recurrence : false, 1118 updating_picker : false, 1119 url_params : {}, 1120 view : '', 1121 view_target : '' 1122 }; 1123 1124})(window, document, jQuery, tribe_debug); 1125 1126//(function (window, document, $, td, te, tf, ts, tt, dbug) { 1127var ITM_TEVENT = window.ITM_TEVENT || {}; 1128ITM_TEVENT.ITM_OneCmsTribeEventLoad = false;
1129ITM_TEVENT.ITM_OneCmsTribeEventLoad_Flag = ''; 1130 1131jQuery(document).ready(function( $ ){ 1132 readyFn_TribeEvent( jQuery, 'document.ready' ); 1133 ITM_TEVENT.ITM_OneCmsTribeEventLoad_Flag = 'document.ready'; 1134}); 1135 1136function readyFn_TribeEvent( $, flagCheck = '') { 1137 if (ITM_TEVENT.ITM_OneCmsTribeEventLoad) { 1138 window.console.log('ITM_OneCmsTribeEventLoad return : '+flagCheck); 1139 window.console.log('ITM_OneCmsTribeEventLoad_Flag : '+ITM_TEVENT.ITM_OneCmsTribeEventLoad_Flag); 1140 //return; 1141 } 1142 1143 //we need to call only once. if pjax and or document.ready above. 1144 ITM_TEVENT.ITM_OneCmsTribeEventLoad = true; 1145 1146 $ = jQuery 1147 td = tribe_ev.data 1148 te = tribe_ev.events 1149 tf = tribe_ev.fn 1150 ts = tribe_ev.state 1151 tt = tribe_ev.tests 1152 dbug = tribe_debug 1153 1154 //$(document).ready(function () { 1155 1156 //dbug && debug.info('TEC Debug: Tribe Events JS init, Init Timer started from tribe-events.js.'); 1157 1158 tf.update_viewport_variables(); 1159 1160 var $body = $('body'), 1161 $tribe_events = $('#tribe-events'), 1162 $tribe_content = $('#tribe-events-content'), 1163 $tribe_events_header = $('#tribe-events-header'), 1164 resize_timer; 1165 1166 1167 $tribe_events.removeClass('tribe-no-js'); 1168 ts.category = tf.get_category(); 1169 td.base_url = tf.get_base_url(); 1170 ts.page_title = document.title; 1171 1172 var tribe_display = tf.get_url_param('tribe_event_display'); 1173 1174 if (tribe_display) { 1175 ts.view = tribe_display; 1176 } else if ($tribe_events_header.length && $tribe_events_header.tribe_has_attr('data-view')) { 1177 ts.view = $tribe_events_header.data('view'); 1178 } 1179 1180 if($tribe_events.tribe_has_attr('data-datepicker_format') && $tribe_events.attr('data-datepicker_format').length === 1) 1181 ts.datepicker_format = $tribe_events.attr('data-datepicker_format'); 1182 1183 ts.view && dbug && debug.time('Tribe JS Init Timer'); 1184 1185 1186 1187 1188 1189 /** 1190 * 1191 * Themers can override the mobile break with an override in function.php 1192 * 1193 add_action( 'tribe_events_mobile_breakpoint', 'mobile_breakpoint' ); 1194 function mobile_breakpoint() { 1195 return 500; 1196 } 1197 */ 1198 1199 if($tribe_events.length && $tribe_events.tribe_has_attr('data-mobilebreak')) 1200 td.mobile_break = parseInt($tribe_events.attr('data-mobilebreak')); 1201 1202 if($tribe_events.length && td.mobile_break > 0) 1203 $body.addClass('tribe-is-responsive'); 1204 1205 /* Let's hide the widget calendar if we find more than one instance */ 1206 $(".tribe-events-calendar-widget").not(":eq(0)").hide(); 1207 1208 tf.tooltips(); 1209 tf.mobile_class(); 1210 1211 //remove border on list view event before month divider 1212 function list_find_month_last_event() { 1213 if ($('.tribe-events-list').length) { 1214 $('.tribe-events-list-separator-month').prev('.vevent').addClass('tribe-event-end-month'); 1215 } 1216 } 1217 list_find_month_last_event(); 1218 // remove events header subnav pagination if no results 1219 if ($('.tribe-events-list .tribe-events-notices').length) { 1220 $('#tribe-events-header .tribe-events-sub-nav').empty(); 1221 } 1222 1223 //remove border on list view event before month divider 1224 if ($('.tribe-events-list').length) { 1225 $('.tribe-events-list-separator-month').prev('.vevent').addClass('tribe-event-end-month'); 1226 } 1227 1228 // ajax complete function to remove active spinner 1229 $(te).on( 'tribe_ev_ajaxSuccess', function() { 1230 $('.tribe-events-active-spinner').remove(); 1231 list_find_month_last_event(); 1232 }); 1233 1234 /** 1235 * @function tribe_ical_url 1236 * @desc tribe_ical_url This function adds required params to the ical url. Runs on doc ready, and hooks into 'tribe_ev_ajaxSuccess' also. 1237 */ 1238 1239 function tribe_ical_url() { 1240 var url = document.URL, 1241 separator = '?'; 1242 1243 if (url.indexOf('?') > 0) 1244 separator = '&'; 1245 1246 var new_link = url + separator + 'ical=1' + '&' + 'tribe_display=' + ts.view; 1247 1248 $('a.tribe-events-ical').attr('href', new_link); 1249 } 1250 1251 $(te).on("tribe_ev_ajaxSuccess", function () { 1252 tribe_ical_url(); 1253 }); 1254 1255 tribe_ical_url(); 1256 1257 $(window) 1258 .resize(function () { 1259 1260 clearTimeout(resize_timer); 1261 resize_timer = setTimeout(tf.execute_resize, 200); 1262 1263 }); 1264 1265 if(dbug){ 1266 debug.groupCollapsed('TEC Debug: Browser and events settings information:'); 1267 debug.log('User agent reported as: "' + navigator.userAgent); 1268 debug.log('Live ajax returned its state as: "' + tt.live_ajax()); 1269 ts.view && debug.log('Tribe js detected the view to be: "' + ts.view); 1270 debug.log('Supports pushstate: "' + tt.pushstate); 1271 debug.groupEnd(); 1272 debug.info('TEC Debug: tribe-events.js successfully loaded'); 1273 } 1274 } 1275 //}); 1276//})(window, document, jQuery, tribe_ev.data, tribe_ev.events, tribe_ev.fn, tribe_ev.state, tribe_ev.tests, tribe_debug);
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.