mirror of
https://github.com/Doodle3D/doodle3d-client.git
synced 2024-11-16 15:47:55 +01:00
1 line
13 KiB
JavaScript
1 line
13 KiB
JavaScript
|
!function(a,b,c){"use strict";var d={version:"2.1",tipLocation:"bottom",nubPosition:"auto",scroll:!0,scrollSpeed:300,timer:0,autoStart:!1,startTimerOnClick:!0,startOffset:0,nextButton:!0,tipAnimation:"fade",pauseAfter:[],tipAnimationFadeSpeed:300,cookieMonster:!1,cookieName:"joyride",cookieDomain:!1,cookiePath:!1,localStorage:!1,localStorageKey:"joyride",tipContainer:"body",modal:!1,expose:!1,postExposeCallback:a.noop,preRideCallback:a.noop,postRideCallback:a.noop,preStepCallback:a.noop,postStepCallback:a.noop,template:{link:'<a href="#close" class="joyride-close-tip">X</a>',timer:'<div class="joyride-timer-indicator-wrap"><span class="joyride-timer-indicator"></span></div>',tip:'<div class="joyride-tip-guide"><span class="joyride-nub"></span></div>',wrapper:'<div class="joyride-content-wrapper" role="dialog"></div>',button:'<a href="#" class="joyride-next-tip"></a>',modal:'<div class="joyride-modal-bg"></div>',expose:'<div class="joyride-expose-wrapper"></div>',exposeCover:'<div class="joyride-expose-cover"></div>'}},e=e||!1,f={},g={init:function(c){return this.each(function(){a.isEmptyObject(f)?(f=a.extend(!0,d,c),f.document=b.document,f.$document=a(f.document),f.$window=a(b),f.$content_el=a(this),f.$body=a(f.tipContainer),f.body_offset=a(f.tipContainer).position(),f.$tip_content=a("> li",f.$content_el),f.paused=!1,f.attempts=0,f.tipLocationPatterns={top:["bottom"],bottom:[],left:["right","top","bottom"],right:["left","top","bottom"]},g.jquery_check(),a.isFunction(a.cookie)||(f.cookieMonster=!1),f.cookieMonster&&a.cookie(f.cookieName)||f.localStorage&&g.support_localstorage()&&localStorage.getItem(f.localStorageKey)||(f.$tip_content.each(function(b){g.create({$li:a(this),index:b})}),f.autoStart&&(!f.startTimerOnClick&&f.timer>0?(g.show("init"),g.startTimer()):g.show("init"))),f.$document.on("click.joyride",".joyride-next-tip, .joyride-modal-bg",function(a){a.preventDefault(),f.$li.next().length<1?g.end():f.timer>0?(clearTimeout(f.automate),g.hide(),g.show(),g.startTimer()):(g.hide(),g.show())}),f.$document.on("click.joyride",".joyride-close-tip",function(a){a.preventDefault(),g.end()}),f.$window.bind("resize.joyride",function(){if(f.$li){if(f.exposed&&f.exposed.length>0){var b=a(f.exposed);b.each(function(){var b=a(this);g.un_expose(b),g.expose(b)})}g.is_phone()?g.pos_phone():g.pos_default()}})):g.restart()})},resume:function(){g.set_li(),g.show()},nextTip:function(){f.$li.next().length<1?g.end():f.timer>0?(clearTimeout(f.automate),g.hide(),g.show(),g.startTimer()):(g.hide(),g.show())},tip_template:function(b){var c,d,e;return b.tip_class=b.tip_class||"",c=a(f.template.tip).addClass(b.tip_class),d=a.trim(a(b.li).html())+g.button_text(b.button_text)+f.template.link+g.timer_instance(b.index),e=a(f.template.wrapper),b.li.attr("data-aria-labelledby")&&e.attr("aria-labelledby",b.li.attr("data-aria-labelledby")),b.li.attr("data-aria-describedby")&&e.attr("aria-describedby",b.li.attr("data-aria-describedby")),c.append(e),c.first().attr("data-index",b.index),a(".joyride-content-wrapper",c).append(d),c[0]},timer_instance:function(b){var c;return c=0===b&&f.startTimerOnClick&&f.timer>0||0===f.timer?"":g.outerHTML(a(f.template.timer)[0])},button_text:function(b){return f.nextButton?(b=a.trim(b)||"Next",b=g.outerHTML(a(f.template.button).append(b)[0])):b="",b},create:function(b){var c=b.$li.attr("data-button")||b.$li.attr("data-text"),d=b.$li.attr("class"),e=a(g.tip_template({tip_class:d,index:b.index,button_text:c,li:b.$li}));a(f.tipContainer).append(e)},show:function(b){var d,e,h={},i=[],j=0,k=null;if(f.$li===c||-1===a.inArray(f.$li.index(),f.pauseAfter))if(f.paused?f.paused=!1:g.set_li(b),f.attempts=0,f.$li.length&&f.$target.length>0){for(b&&(f.preRideCallback(f.$li.index(),f.$next_tip),f.modal&&g.show_modal()),f.preStepCallback(f.$li.index(),f.$next_tip),i=(f.$li.data("options")||":").split(";"),j=i.length,d=j-1;d>=0;d--)e=i[d].split(":"),2===e.length&&(h[a.trim(e[0])]=a.trim(e[1]));f.tipSettings=a.extend({},f,h),f.tipSettings.tipLocationPattern=f.tipLocationPatterns[f.tipSettings.tipLocation],f.modal&&f.expose&&g.expose(),!/
|