WRMCB=function(e){var c=console;if(c&&c.log&&c.error){c.log('Error running batched script.');c.error(e);}} ; try { /* module-key = 'com.atlassian.confluence.extra.team-calendars:mycalendar-tour-resources', location = 'com/atlassian/confluence/extra/calendar3/components/local-stogare/local-storage.js' */ define("tc/localStorage",["jquery"],function(e){var c=function(){return{getItem:function(h){e.cookie(h)},setItem:function(i,j,h){e.cookie(i,j,h)}}}();var g="team-calendars",a=Confluence.storageManager?Confluence.storageManager(g):(localStorage?localStorage:c),b=AJS.Meta.get("remote-user"),d="confluence."+b+"."+g;var f=function(h){return Confluence.storageManager?h:d+"."+h};return{getItem:function(h){return a.getItem(f(h))},setItem:function(i,j,h){try{a.setItem(f(i),j,h)}catch(k){console.log(k)}}}}); }catch(e){WRMCB(e)}; ; try { /* module-key = 'com.atlassian.confluence.extra.team-calendars:mycalendar-tour-resources', location = 'com/atlassian/confluence/extra/calendar3/components/local-stogare/local-storage-compat.js' */ require(["tc/localStorage"],function(a){Confluence.TeamCalendars.LocalStorage=a}); }catch(e){WRMCB(e)}; ; try { /* module-key = 'com.atlassian.confluence.extra.team-calendars:mycalendar-tour-resources', location = 'com/atlassian/confluence/extra/calendar3/components/my-calendar-tour/my-calendar-tour.js' */ define("tc/myCalendarTour",["jquery","underscore","tc/localStorage"],function(n,C,s){var j="team.calendar";var d=j+".tour";var h=false;var p=false;var r=true;var e=d+".currentLegIndex";var m=d+".currentAttachedCalendar";var x=d+".done";var l="div[data-sub-calendar-id='#calendarID']";var t=function(F){var G=F.calendarID;if(!G){return null}return l.replace("#calendarID",G)};var b={selectMenuItem:function(G,I){var H=t(G);if(!H){return}var F=H+I;n(F).parent().addClass("active")},unSelectMenuItem:function(G,I){var H=t(G);if(!H){return}var F=H+I;n(F).parent().removeClass("active")}};var c={openMenu:function(F){var G=t(F);if(n(G+" .subcalendar-dropdown-menu.parent-subCalendar.active").size()>0){return}n(G+" .subcalendar-dropdown-menu .subcalendar-dropdown-menu-button .aui-button.aui-button-compact").click()},closeMenu:function(F){var G=t(F);if(n(G+" .subcalendar-dropdown-menu.parent-subCalendar.active").size()>0){r=false;n(".calendar-panel").click()}},hightLightEditMenuItem:function(F){return b.selectMenuItem(F," .parent-subCalendar a.subcalendar-edit")},unHightLightEditMenuItem:function(F){return b.unSelectMenuItem(F," .parent-subCalendar a.subcalendar-edit")},hightLightRestrictionMenuItem:function(F){return b.selectMenuItem(F," .parent-subCalendar a.subcalendar-restrict")},unHightLightRestrictionMenuItem:function(F){return b.unSelectMenuItem(F," .parent-subCalendar a.subcalendar-restrict")},hightLightShareMenuItem:function(F){return b.selectMenuItem(F," .parent-subCalendar a.subcalendar-share-or-embed")},unHightLightShareMenuItem:function(F){return b.unSelectMenuItem(F," .parent-subCalendar a.subcalendar-share-or-embed")}};var z=function(F){i(F);a(F);A(F)};var k=function(F){w(F);E(F);D()};var a=function(F){n(document).on("keydown",B)};var E=function(F){n(document).off("keydown",B)};var B=function(F){if(F.keyCode===27){p=true;u.stop()}};var i=function(G){var F=this;if(!h){n("body").on("click."+d,function(I){var H=n(I.target);if(!r){r=true;return}if(H.closest(".tourbus-leg-inner").length===0){p=true;G.stop()}});h=true}};var w=function(F){if(h){n("body").off("click."+d)}h=false};var A=function(F){n(window).bind("resize."+d,function(G){F.repositionLegs()})};var D=function(){n(window).unbind("resize."+d)};var v=function(F){var G=t({calendarID:F});if(n(G).is(G)){C.each(n("ol.tourbus-legs li.tc-tour-dynamic"),function(J){var I=n(J);var H=I.data("el");I.attr("data-el",G+" "+H)});return true}return false};var g=function(G,F){if(!G||!F){AJS.log("Team Calendar tour - could not execute action because invalid calendarID or actionsString");return}C.each(F.split(" "),function(I){var H=c[I];if(H){AJS.log("Team Calendar tour - leg actions - "+I);H({calendarID:G});AJS.log("Team Calendar tour - leg actions - "+I+" done")}})};var o=function(){AJS.log("Team Calendar tour - mark as DONE");s.setItem(x,"done")};var y=function(){return s.getItem(x)==="done"};var q=function(){if(AJS.dropDown.current&&AJS.dropDown.current.hide){AJS.log("Team Calendar tour - hidding dropdown menu");AJS.dropDown.current.hide()}};var f=undefined;var u=undefined;return{tcStorage:s,tourBus:u,start:function(G){if(n(".aui-message.error.license-invalid").size()>0){AJS.log("Team Calendar tour - is available when license is valid");return}if(y()){AJS.log("Team Calendar tour - is already done");return}if(n(".plugin-calendar-container.page").size()>0){AJS.log("Team Calendar tour - is only available on MyCalendar");return}if(!G){G=s.getItem(m)}else{s.setItem(e,0);s.setItem(m,G)}var F=s.getItem(e);if(!F){F=0}if(!v(G)){AJS.log("Team Calendar tour - could not attached to target elements");return}if(u){p=true;q();u.stop();u.destroy();p=false}f=n("#my-calendar-tour").tourbus({startAt:F,onDepart:function(H){AJS.log("Team Calendar tour - depart");z(H)},onStop:function(H){AJS.log("Team Calendar tour - stop");k(H);c.closeMenu({calendarID:G});if(!p){o();s.setItem(e,0);Confluence.TeamCalendars.fireEventForAnalytics("tour.finish",{stepNumber:-1});p=false}},onLegStart:function(L,N){AJS.log("Team Calendar tour - leg start");s.setItem(e,N.currentLegIndex);var M=L.$el.find(".order");var I=N.currentLegIndex;var H=M.html();H=H.replace("#legIndex",++I);H=H.replace("#totalLegs",N.totalLegs);M.html(H);AJS.log("Team Calendar tour - leg - executing before actions");var J=L.$original.data("before-leg-actions");g(G,J);AJS.log("Team Calendar tour - leg start - before actions executed");L.reposition();var K={stepNumber:N.currentLegIndex};Confluence.TeamCalendars.fireEventForAnalytics("tour.step",K)},onLegEnd:function(I,J){AJS.log("Team Calendar tour - leg end");AJS.log("Team Calendar tour - leg - executing after actions");var H=I.$original.data("after-leg-actions");g(G,H);AJS.log("Team Calendar tour - leg end - after actions executed")},leg:{zindex:2400,width:270,margin:15}});u=f.data("tourbus");if(!u.running){u.depart()}},stop:function(){if(u){o();u.stop()}},softStop:function(){if(u){o();u.hideLeg()}},destroy:function(){if(u){u.destroy()}},showLeg:function(F){if(u){u.showLeg(F)}},hideLeg:function(){if(u){u.hideLeg();var F={stepNumber:u.currentLegIndex}}},isShowCustomEventTypeFrom:function(G){if(y()){return false}var F=s.getItem(m);if(F===""||!F){return false}var H=s.getItem(e);if(H!=="0"){return false}if(F!==G){return false}return true},reposition:function(){if(u&&!y()){u.repositionLegs()}}}}); }catch(e){WRMCB(e)}; ; try { /* module-key = 'com.atlassian.confluence.extra.team-calendars:mycalendar-tour-resources', location = 'com/atlassian/confluence/extra/calendar3/components/my-calendar-tour/my-calendar-tour.soy' */ // This file was automatically generated from my-calendar-tour.soy. // Please don't edit this file by hand. /** * @fileoverview Templates in namespace Confluence.TeamCalendars.Templates. */ if (typeof Confluence == 'undefined') { var Confluence = {}; } if (typeof Confluence.TeamCalendars == 'undefined') { Confluence.TeamCalendars = {}; } if (typeof Confluence.TeamCalendars.Templates == 'undefined') { Confluence.TeamCalendars.Templates = {}; } Confluence.TeamCalendars.Templates.calendarTourContent = function(opt_data, opt_ignored) { return ''; }; if (goog.DEBUG) { Confluence.TeamCalendars.Templates.calendarTourContent.soyTemplateName = 'Confluence.TeamCalendars.Templates.calendarTourContent'; } }catch(e){WRMCB(e)}; ; try { /* module-key = 'com.atlassian.confluence.extra.team-calendars:mycalendar-tour-resources', location = 'com/atlassian/confluence/extra/calendar3/components/my-calendar-tour/my-calendar-tour-compat.js' */ require(["tc/myCalendarTour"],function(a){if(!Confluence.TeamCalendars){Confluence.TeamCalendars={}}Confluence.TeamCalendars.CalendarTour=function(){return a}}); }catch(e){WRMCB(e)};