1/*jslint unparam: true, browser: true, indent: 2 */ 2 3(function ($, window, document, undefined) { 4 'use strict'; 5 6 Foundation.libs.joyride = { 7 name : 'joyride', 8 9 version : '4.2.2', 10 11 defaults : { 12 expose : false, // turn on or off the expose feature 13 modal : false, // Whether to cover page with modal during the tour 14 tipLocation : 'bottom', // 'top' or 'bottom' in relation to parent 15 nubPosition : 'auto', // override on a per tooltip bases 16 scrollSpeed : 300, // Page scrolling speed in milliseconds, 0 = no scroll animation 17 timer : 0, // 0 = no timer , all other numbers = timer in milliseconds 18 startTimerOnClick : true, // true or false - true requires clicking the first button start the timer 19 startOffset : 0, // the index of the tooltip you want to start on (index of the li) 20 nextButton : true, // true or false to control whether a next button is used 21 tipAnimation : 'fade', // 'pop' or 'fade' in each tip 22 pauseAfter : [], // array of indexes where to pause the tour after 23 exposed : [], // array of expose elements 24 tipAnimationFadeSpeed: 300, // when tipAnimation = 'fade' this is speed in milliseconds for the transition 25 cookieMonster : false, // true or false to control whether cookies are used 26 cookieName : 'joyride', // Name the cookie you'll use 27 cookieDomain : false, // Will this cookie be attached to a domain, ie. '.notableapp.com' 28 cookieExpires : 365, // set when you would like the cookie to expire. 29 tipContainer : 'body', // Where will the tip be attached 30 postRideCallback : function (){}, // A method to call once the tour closes (canceled or complete) 31 postStepCallback : function (){}, // A method to call after each step 32 preStepCallback : function (){}, // A method to call before each step 33 preRideCallback : function (){}, // A method to call before the tour starts (passed index, tip, and cloned exposed element) 34 postExposeCallback : function (){}, // A method to call after an element has been exposed 35 template : { // HTML segments for tip layout 36 link : '<a href="#close" class="joyride-close-tip">×</a>', 37 timer : '<div class="joyride-timer-indicator-wrap"><span class="joyride-timer-indicator"></span></div>', 38 tip : '<div class="joyride-tip-guide"><span class="joyride-nub"></span></div>', 39 wrapper : '<div class="joyride-content-wrapper"></div>', 40 button : '<a href="#" class="small button joyride-next-tip"></a>', 41 modal : '<div class="joyride-modal-bg"></div>', 42 expose : '<div class="joyride-expose-wrapper"></div>', 43 exposeCover: '<div class="joyride-expose-cover"></div>' 44 }, 45 exposeAddClass : '' // One or more space-separated class names to be added to exposed element 46 }, 47 48 settings : {}, 49 50 init : function (scope, method, options) { 51 this.scope = scope || this.scope; 52 Foundation.inherit(this, 'throttle data_options scrollTo scrollLeft delay'); 53 54 if (typeof method === 'object') { 55 $.extend(true, this.settings, this.defaults, method); 56 } else { 57 $.extend(true, this.settings, this.defaults, options); 58 } 59 60 if (typeof method !== 'string') { 61 if (!this.settings.init) this.events(); 62 63 return this.settings.init; 64 } else { 65 return this[method].call(this, options); 66 } 67 }, 68 69 events : function () { 70 var self = this; 71 72 $(this.scope) 73 .on('click.joyride', '.joyride-next-tip, .joyride-modal-bg', function (e) { 74 e.preventDefault(); 75 76 if (this.settings.$li.next().length < 1) { 77 this.end(); 78 } else if (this.settings.timer > 0) { 79 clearTimeout(this.settings.automate); 80 this.hide(); 81 this.show(); 82 this.startTimer(); 83 } else { 84 this.hide(); 85 this.show(); 86 } 87 88 }.bind(this)) 89 90 .on('click.joyride', '.joyride-close-tip', function (e) { 91 e.preventDefault(); 92 this.end(); 93 }.bind(this)); 94 95 $(window).on('resize.fndtn.joyride', self.throttle(function () { 96 if ($('[data-joyride]').length > 0 && self.settings.$next_tip) { 97 if (self.settings.exposed.length > 0) { 98 var $els = $(self.settings.exposed); 99 100 $els.each(function () { 101 var $this = $(this); 102 self.un_expose($this); 103 self.expose($this); 104 }); 105 } 106 107 if (self.is_phone()) { 108 self.pos_phone(); 109 } else { 110 self.pos_default(false, true); 111 } 112 } 113 }, 100)); 114 115 this.settings.init = true; 116 }, 117 118 start : function () { 119 var self = this, 120 $this = $(this.scope).find('[data-joyride]'), 121 integer_settings = ['timer', 'scrollSpeed', 'startOffset', 'tipAnimationFadeSpeed', 'cookieExpires'], 122 int_settings_count = integer_settings.length; 123 124 if (!this.settings.init) this.init(); 125 126 // non configureable settings 127 this.settings.$content_el = $this; 128 this.settings.$body = $(this.settings.tipContainer); 129 this.settings.body_offset = $(this.settings.tipContainer).position(); 130 this.settings.$tip_content = this.settings.$content_el.find('> li'); 131 this.settings.paused = false;
132 this.settings.attempts = 0; 133 134 this.settings.tipLocationPatterns = { 135 top: ['bottom'], 136 bottom: [], // bottom should not need to be repositioned 137 left: ['right', 'top', 'bottom'], 138 right: ['left', 'top', 'bottom'] 139 }; 140 141 // can we create cookies? 142 if (typeof $.cookie !== 'function') { 143 this.settings.cookieMonster = false; 144 } 145 146 // generate the tips and insert into dom. 147 if (!this.settings.cookieMonster || this.settings.cookieMonster && $.cookie(this.settings.cookieName) === null) { 148 this.settings.$tip_content.each(function (index) { 149 var $this = $(this); 150 $.extend(true, self.settings, self.data_options($this)); 151 // Make sure that settings parsed from data_options are integers where necessary 152 for (var i = int_settings_count - 1; i >= 0; i--) { 153 self.settings[integer_settings[i]] = parseInt(self.settings[integer_settings[i]], 10); 154 } 155 self.create({$li : $this, index : index}); 156 }); 157 158 // show first tip 159 if (!this.settings.startTimerOnClick && this.settings.timer > 0) { 160 this.show('init'); 161 this.startTimer(); 162 } else { 163 this.show('init'); 164 } 165 166 } 167 }, 168 169 resume : function () { 170 this.set_li(); 171 this.show(); 172 }, 173 174 tip_template : function (opts) { 175 var $blank, content; 176 177 opts.tip_class = opts.tip_class || ''; 178 179 $blank = $(this.settings.template.tip).addClass(opts.tip_class); 180 content = $.trim($(opts.li).html()) + 181 this.button_text(opts.button_text) + 182 this.settings.template.link + 183 this.timer_instance(opts.index); 184 185 $blank.append($(this.settings.template.wrapper)); 186 $blank.first().attr('data-index', opts.index); 187 $('.joyride-content-wrapper', $blank).append(content); 188 189 return $blank[0]; 190 }, 191 192 timer_instance : function (index) { 193 var txt; 194 195 if ((index === 0 && this.settings.startTimerOnClick && this.settings.timer > 0) || this.settings.timer === 0) { 196 txt = ''; 197 } else { 198 txt = this.outerHTML($(this.settings.template.timer)[0]); 199 } 200 return txt; 201 }, 202 203 button_text : function (txt) { 204 if (this.settings.nextButton) { 205 txt = $.trim(txt) || 'Next'; 206 txt = this.outerHTML($(this.settings.template.button).append(txt)[0]); 207 } else { 208 txt = ''; 209 } 210 return txt; 211 }, 212 213 create : function (opts) { 214 var buttonText = opts.$li.attr('data-button') || opts.$li.attr('data-text'), 215 tipClass = opts.$li.attr('class'), 216 $tip_content = $(this.tip_template({ 217 tip_class : tipClass, 218 index : opts.index, 219 button_text : buttonText, 220 li : opts.$li 221 })); 222 223 $(this.settings.tipContainer).append($tip_content); 224 }, 225 226 show : function (init) { 227 var $timer = null; 228 229 // are we paused? 230 if (this.settings.$li === undefined 231 || ($.inArray(this.settings.$li.index(), this.settings.pauseAfter) === -1)) { 232 233 // don't go to the next li if the tour was paused 234 if (this.settings.paused) { 235 this.settings.paused = false; 236 } else { 237 this.set_li(init); 238 } 239 240 this.settings.attempts = 0; 241 242 if (this.settings.$li.length && this.settings.$target.length > 0) { 243 if (init) { //run when we first start 244 this.settings.preRideCallback(this.settings.$li.index(), this.settings.$next_tip); 245 if (this.settings.modal) { 246 this.show_modal(); 247 } 248 } 249 250 this.settings.preStepCallback(this.settings.$li.index(), this.settings.$next_tip); 251 252 if (this.settings.modal && this.settings.expose) { 253 this.expose(); 254 } 255 256 this.settings.tipSettings = $.extend(this.settings, this.data_options(this.settings.$li)); 257 258 this.settings.timer = parseInt(this.settings.timer, 10); 259 260 this.settings.tipSettings.tipLocationPattern = this.settings.tipLocationPatterns[this.settings.tipSett
260ings.tipLocation]; 261 262 // scroll if not modal 263 if (!/body/i.test(this.settings.$target.selector)) { 264 this.scroll_to(); 265 } 266 267 if (this.is_phone()) { 268 this.pos_phone(true); 269 } else { 270 this.pos_default(true); 271 } 272 273 $timer = this.settings.$next_tip.find('.joyride-timer-indicator'); 274 275 if (/pop/i.test(this.settings.tipAnimation)) { 276 277 $timer.width(0); 278 279 if (this.settings.timer > 0) { 280 281 this.settings.$next_tip.show(); 282 283 this.delay(function () { 284 $timer.animate({ 285 width: $timer.parent().width() 286 }, this.settings.timer, 'linear'); 287 }.bind(this), this.settings.tipAnimationFadeSpeed); 288 289 } else { 290 this.settings.$next_tip.show(); 291 292 } 293 294 295 } else if (/fade/i.test(this.settings.tipAnimation)) { 296 297 $timer.width(0); 298 299 if (this.settings.timer > 0) { 300 301 this.settings.$next_tip 302 .fadeIn(this.settings.tipAnimationFadeSpeed) 303 .show(); 304 305 this.delay(function () { 306 $timer.animate({ 307 width: $timer.parent().width() 308 }, this.settings.timer, 'linear'); 309 }.bind(this), this.settings.tipAnimationFadeSpeed); 310 311 } else { 312 this.settings.$next_tip.fadeIn(this.settings.tipAnimationFadeSpeed); 313 314 } 315 } 316 317 this.settings.$current_tip = this.settings.$next_tip; 318 319 // skip non-existant targets 320 } else if (this.settings.$li && this.settings.$target.length < 1) { 321 322 this.show(); 323 324 } else { 325 326 this.end(); 327 328 } 329 } else { 330 331 this.settings.paused = true; 332 333 } 334 335 }, 336 337 is_phone : function () { 338 if (Modernizr) { 339 return Modernizr.mq('only screen and (max-width: 767px)') || $('.lt-ie9').length > 0; 340 } 341 342 return (this.settings.$window.width() < 767); 343 }, 344 345 hide : function () { 346 if (this.settings.modal && this.settings.expose) { 347 this.un_expose(); 348 } 349 350 if (!this.settings.modal) { 351 $('.joyride-modal-bg').hide(); 352 } 353 354 // Prevent scroll bouncing...wait to remove from layout 355 this.settings.$current_tip.css('visibility', 'hidden'); 356 setTimeout($.proxy(function() { 357 this.hide(); 358 this.css('visibility', 'visible'); 359 }, this.settings.$current_tip), 0); 360 this.settings.postStepCallback(this.settings.$li.index(), 361 this.settings.$current_tip); 362 }, 363 364 set_li : function (init) { 365 if (init) { 366 this.settings.$li = this.settings.$tip_content.eq(this.settings.startOffset); 367 this.set_next_tip(); 368 this.settings.$current_tip = this.settings.$next_tip; 369 } else { 370 this.settings.$li = this.settings.$li.next(); 371 this.set_next_tip(); 372 } 373 374 this.set_target(); 375 }, 376 377 set_next_tip : function () { 378 this.settings.$next_tip = $(".joyride-tip-guide[data-index='" + this.settings.$li.index() + "']"); 379 this.settings.$next_tip.data('closed', ''); 380 }, 381 382 set_target : function () { 383 var cl = this.settings.$li.attr('data-class'), 384 id = this.settings.$li.attr('data-id'), 385 $sel = function () { 386 if (id) { 387 return $(document.getElementById(id)); 388 } else if (cl) { 389 return $('.' + cl).first(); 390 } else { 391 return $('body'); 392 } 393 }; 394 395 this.settings.$target = $sel(); 396 }, 397 398 scroll_to : function () { 399 var window_half, tipOffset; 400 401 window_half = $(window).height() / 2; 402 tipOffset = Math.ceil(this.settings.$target.offset().top - window_half + this.outerHeight(this.settings.$next_tip)); 403 if (tipOffset > 0) { 404 this.scrollTo($('html, body'), tipOffset, this.settings.scrollSpeed); 405 } 406 }, 407 408 paused : function () { 409 return ($.inArray((this.settings.$li.index() + 1), this.settings.pauseAfter) === -1); 410 }, 411 412 restart : function () { 413 this.hide(); 414 this.settings.$li = undefined; 415 this.show('init'); 416 }, 417 418 pos_default : function (init, resizing) { 419 var half_fold = Math.ceil($(window).height() / 2), 420 tip_position = this.settings.$next_tip.offset(), 421 $nub = this.settings.$next_tip.find('.joyride-nub'), 422 nub_width = Math.ceil(this.outerWidth($nub) / 2),
423 nub_height = Math.ceil(this.outerHeight($nub) / 2), 424 toggle = init || false; 425 426 // tip must not be "display: none" to calculate position 427 if (toggle) { 428 this.settings.$next_tip.css('visibility', 'hidden'); 429 this.settings.$next_tip.show(); 430 } 431 432 if (typeof resizing === 'undefined') { 433 resizing = false; 434 } 435 436 if (!/body/i.test(this.settings.$target.selector)) { 437 438 if (this.bottom()) { 439 var leftOffset = this.settings.$target.offset().left; 440 if (Foundation.rtl) { 441 leftOffset = this.settings.$target.offset().width - this.settings.$next_tip.width() + leftOffset; 442 } 443 this.settings.$next_tip.css({ 444 top: (this.settings.$target.offset().top + nub_height + this.outerHeight(this.settings.$target)), 445 left: leftOffset}); 446 447 this.nub_position($nub, this.settings.tipSettings.nubPosition, 'top'); 448 449 } else if (this.top()) { 450 var leftOffset = this.settings.$target.offset().left; 451 if (Foundation.rtl) { 452 leftOffset = this.settings.$target.offset().width - this.settings.$next_tip.width() + leftOffset; 453 } 454 this.settings.$next_tip.css({ 455 top: (this.settings.$target.offset().top - this.outerHeight(this.settings.$next_tip) - nub_height), 456 left: leftOffset}); 457 458 this.nub_position($nub, this.settings.tipSettings.nubPosition, 'bottom'); 459 460 } else if (this.right()) { 461 462 this.settings.$next_tip.css({ 463 top: this.settings.$target.offset().top, 464 left: (this.outerWidth(this.settings.$target) + this.settings.$target.offset().left + nub_width)}); 465 466 this.nub_position($nub, this.settings.tipSettings.nubPosition, 'left'); 467 468 } else if (this.left()) { 469 470 this.settings.$next_tip.css({ 471 top: this.settings.$target.offset().top, 472 left: (this.settings.$target.offset().left - this.outerWidth(this.settings.$next_tip) - nub_width)}); 473 474 this.nub_position($nub, this.settings.tipSettings.nubPosition, 'right'); 475 476 } 477 478 if (!this.visible(this.corners(this.settings.$next_tip)) && this.settings.attempts < this.settings.tipSettings.tipLocationPattern.length) { 479 480 $nub.removeClass('bottom') 481 .removeClass('top') 482 .removeClass('right') 483 .removeClass('left'); 484 485 this.settings.tipSettings.tipLocation = this.settings.tipSettings.tipLocationPattern[this.settings.attempts]; 486 487 this.settings.attempts++; 488 489 this.pos_default(); 490 491 } 492 493 } else if (this.settings.$li.length) { 494 495 this.pos_modal($nub); 496 497 } 498 499 if (toggle) { 500 this.settings.$next_tip.hide(); 501 this.settings.$next_tip.css('visibility', 'visible'); 502 } 503 504 }, 505 506 pos_phone : function (init) { 507 var tip_height = this.outerHeight(this.settings.$next_tip), 508 tip_offset = this.settings.$next_tip.offset(), 509 target_height = this.outerHeight(this.settings.$target), 510 $nub = $('.joyride-nub', this.settings.$next_tip), 511 nub_height = Math.ceil(this.outerHeight($nub) / 2), 512 toggle = init || false; 513 514 $nub.removeClass('bottom') 515 .removeClass('top') 516 .removeClass('right') 517 .removeClass('left'); 518 519 if (toggle) { 520 this.settings.$next_tip.css('visibility', 'hidden'); 521 this.settings.$next_tip.show(); 522 } 523 524 if (!/body/i.test(this.settings.$target.selector)) { 525 526 if (this.top()) { 527 528 this.settings.$next_tip.offset({top: this.settings.$target.offset().top - tip_height - nub_height}); 529 $nub.addClass('bottom'); 530 531 } else { 532 533 this.settings.$next_tip.offset({top: this.settings.$target.offset().top + target_height + nub_height}); 534 $nub.addClass('top'); 535 536 } 537 538 } else if (this.settings.$li.length) { 539 this.pos_modal($nub); 540 } 541 542 if (toggle) { 543 this.settings.$next_tip.hide(); 544 this.settings.$next_tip.css('visibility', 'visible'); 545 } 546 }, 547 548 pos_modal : function ($nub) { 549 this.center(); 550 $nub.hide(); 551 552 this.show_modal(); 553 }, 554 555 show_modal : function () { 556 if (!this.settings.$next_tip.data('closed')) { 557 var joyridemodalbg = $('.joyride-modal-bg'); 558 if (joyridemodalbg.length < 1) { 559 $('body').append(this.settings.template.modal).show(); 560 } 561 562 if (/pop/i.test(this.settings.tipAnimation)) { 563 joyridemodalbg.show(); 564 } else { 565 joyridemodalbg.fadeIn(this.settings.tipAnimationFadeSpeed); 566 } 567 } 568 }, 569 570 expose : function () { 571 var expose, 572 exposeCover, 573 el, 574 origCSS, 575 origClasses, 576 randId = 'expose-'+Math.floor(Math.random()*10000); 577 578 if (arguments.length > 0 && arguments[0] instanceof $) { 579 el = arguments[0]; 580 } else if(this.settings.$target && !/body/i.test(this.settings.$target.selector)){ 581 el = this.settings.$target; 582 } else { 583 return false;
584 } 585 586 if(el.length < 1){ 587 if(window.console){ 588 console.error('element not valid', el); 589 } 590 return false; 591 } 592 593 expose = $(this.settings.template.expose); 594 this.settings.$body.append(expose); 595 expose.css({ 596 top: el.offset().top, 597 left: el.offset().left, 598 width: this.outerWidth(el, true), 599 height: this.outerHeight(el, true) 600 }); 601 602 exposeCover = $(this.settings.template.exposeCover); 603 604 origCSS = { 605 zIndex: el.css('z-index'), 606 position: el.css('position') 607 }; 608 609 origClasses = el.attr('class') == null ? '' : el.attr('class'); 610 611 el.css('z-index',parseInt(expose.css('z-index'))+1); 612 613 if (origCSS.position == 'static') { 614 el.css('position','relative'); 615 } 616 617 el.data('expose-css',origCSS); 618 el.data('orig-class', origClasses); 619 el.attr('class', origClasses + ' ' + this.settings.exposeAddClass); 620 621 exposeCover.css({ 622 top: el.offset().top, 623 left: el.offset().left, 624 width: this.outerWidth(el, true), 625 height: this.outerHeight(el, true) 626 }); 627 628 this.settings.$body.append(exposeCover); 629 expose.addClass(randId); 630 exposeCover.addClass(randId); 631 el.data('expose', randId); 632 this.settings.postExposeCallback(this.settings.$li.index(), this.settings.$next_tip, el); 633 this.add_exposed(el); 634 }, 635 636 un_expose : function () { 637 var exposeId, 638 el, 639 expose , 640 origCSS, 641 origClasses, 642 clearAll = false; 643 644 if (arguments.length > 0 && arguments[0] instanceof $) { 645 el = arguments[0]; 646 } else if(this.settings.$target && !/body/i.test(this.settings.$target.selector)){ 647 el = this.settings.$target; 648 } else { 649 return false; 650 } 651 652 if(el.length < 1){ 653 if (window.console) { 654 console.error('element not valid', el); 655 } 656 return false; 657 } 658 659 exposeId = el.data('expose'); 660 expose = $('.' + exposeId); 661 662 if (arguments.length > 1) { 663 clearAll = arguments[1]; 664 } 665 666 if (clearAll === true) { 667 $('.joyride-expose-wrapper,.joyride-expose-cover').remove(); 668 } else { 669 expose.remove(); 670 } 671 672 origCSS = el.data('expose-css'); 673 674 if (origCSS.zIndex == 'auto') { 675 el.css('z-index', ''); 676 } else { 677 el.css('z-index', origCSS.zIndex); 678 } 679 680 if (origCSS.position != el.css('position')) { 681 if(origCSS.position == 'static') {// this is default, no need to set it. 682 el.css('position', ''); 683 } else { 684 el.css('position', origCSS.position); 685 } 686 } 687 688 origClasses = el.data('orig-class'); 689 el.attr('class', origClasses); 690 el.removeData('orig-classes'); 691 692 el.removeData('expose'); 693 el.removeData('expose-z-index'); 694 this.remove_exposed(el); 695 }, 696 697 add_exposed: function(el){ 698 this.settings.exposed = this.settings.exposed || []; 699 if (el instanceof $ || typeof el === 'object') { 700 this.settings.exposed.push(el[0]); 701 } else if (typeof el == 'string') { 702 this.settings.exposed.push(el); 703 } 704 }, 705 706 remove_exposed: function(el){ 707 var search, count; 708 if (el instanceof $) { 709 search = el[0] 710 } else if (typeof el == 'string'){ 711 search = el; 712 } 713 714 this.settings.exposed = this.settings.exposed || []; 715 count = this.settings.exposed.length; 716 717 for (var i=0; i < count; i++) { 718 if (this.settings.exposed[i] == search) { 719 this.settings.exposed.splice(i, 1); 720 return; 721 } 722 } 723 }, 724 725 center : function () { 726 var $w = $(window); 727 728 this.settings.$next_tip.css({ 729 top : ((($w.height() - this.outerHeight(this.settings.$next_tip)) / 2) + $w.scrollTop()), 730 left : ((($w.width() - this.outerWidth(this.settings.$next_tip)) / 2) + this.scrollLeft($w)) 731 }); 732 733 return true; 734 }, 735 736 bottom : function () { 737 return /bottom/i.test(this.settings.tipSettings.tipLocation); 738 }, 739 740 top : function () {
741 return /top/i.test(this.settings.tipSettings.tipLocation); 742 }, 743 744 right : function () { 745 return /right/i.test(this.settings.tipSettings.tipLocation); 746 }, 747 748 left : function () { 749 return /left/i.test(this.settings.tipSettings.tipLocation); 750 }, 751 752 corners : function (el) { 753 var w = $(window), 754 window_half = w.height() / 2, 755 //using this to calculate since scroll may not have finished yet. 756 tipOffset = Math.ceil(this.settings.$target.offset().top - window_half + this.settings.$next_tip.outerHeight()), 757 right = w.width() + this.scrollLeft(w), 758 offsetBottom = w.height() + tipOffset, 759 bottom = w.height() + w.scrollTop(), 760 top = w.scrollTop(); 761 762 if (tipOffset < top) { 763 if (tipOffset < 0) { 764 top = 0; 765 } else { 766 top = tipOffset; 767 } 768 } 769 770 if (offsetBottom > bottom) { 771 bottom = offsetBottom; 772 } 773 774 return [ 775 el.offset().top < top, 776 right < el.offset().left + el.outerWidth(), 777 bottom < el.offset().top + el.outerHeight(), 778 this.scrollLeft(w) > el.offset().left 779 ]; 780 }, 781 782 visible : function (hidden_corners) { 783 var i = hidden_corners.length; 784 785 while (i--) { 786 if (hidden_corners[i]) return false; 787 } 788 789 return true; 790 }, 791 792 nub_position : function (nub, pos, def) { 793 if (pos === 'auto') { 794 nub.addClass(def); 795 } else { 796 nub.addClass(pos); 797 } 798 }, 799 800 startTimer : function () { 801 if (this.settings.$li.length) { 802 this.settings.automate = setTimeout(function () { 803 this.hide(); 804 this.show(); 805 this.startTimer(); 806 }.bind(this), this.settings.timer); 807 } else { 808 clearTimeout(this.settings.automate); 809 } 810 }, 811 812 end : function () { 813 if (this.settings.cookieMonster) { 814 $.cookie(this.settings.cookieName, 'ridden', { expires: this.settings.cookieExpires, domain: this.settings.cookieDomain }); 815 } 816 817 if (this.settings.timer > 0) { 818 clearTimeout(this.settings.automate); 819 } 820 821 if (this.settings.modal && this.settings.expose) { 822 this.un_expose(); 823 } 824 825 this.settings.$next_tip.data('closed', true); 826 827 $('.joyride-modal-bg').hide(); 828 this.settings.$current_tip.hide(); 829 this.settings.postStepCallback(this.settings.$li.index(), this.settings.$current_tip); 830 this.settings.postRideCallback(this.settings.$li.index(), this.settings.$current_tip); 831 $('.joyride-tip-guide').remove(); 832 }, 833 834 outerHTML : function (el) { 835 // support FireFox < 11 836 return el.outerHTML || new XMLSerializer().serializeToString(el); 837 }, 838 839 off : function () { 840 $(this.scope).off('.joyride'); 841 $(window).off('.joyride'); 842 $('.joyride-close-tip, .joyride-next-tip, .joyride-modal-bg').off('.joyride'); 843 $('.joyride-tip-guide, .joyride-modal-bg').remove(); 844 clearTimeout(this.settings.automate); 845 this.settings = {}; 846 }, 847 848 reflow : function () {} 849 }; 850}(Foundation.zj, this, this.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.