diff --git a/src/apps/callflows/app.js b/src/apps/callflows/app.js index 0e18cac..eb0fb16 100644 --- a/src/apps/callflows/app.js +++ b/src/apps/callflows/app.js @@ -20,7 +20,8 @@ define(function(require){ './submodules/vmbox/vmbox', './submodules/featurecodes/featurecodes', './submodules/temporalset/temporalset', - './submodules/callcenter/callcenter' + './submodules/callcenter/callcenter', + 'bootstraptour' ]); var app = { @@ -147,12 +148,81 @@ define(function(require){ .append(callflowsTemplate); container.find('.search-query').focus(); - self.hackResize(callflowsTemplate); + + if($('.js-callflows-list .list-element').length === 0) { + self.initGuideTour(); + } } }); }, + initGuideTour: function() { + var self = this; + var i18n = self.i18n.active(); + + self.tour = new Tour({ + name: 'callflow-guide', + backdrop: true, + debug: true, + template: '' + + '
' + + '
' + + '

' + + '
' + + '
' + + '' + + '' + + '
' + + '
', + steps: [ + { + element: '.js-callflow-edition .js-list-add', + placement: 'right', + content: i18n.callflows.guide.addCallflow, + onShown: function (tour) { + $('.popover').find('[data-role="prev"]').remove(); + }, + onNext: function (tour) { + $('.js-callflow-edition .js-list-add').click(); + } + }, + { + element: '#ws_callflow .js-add-number', + placement: 'bottom', + content: i18n.callflows.guide.addNumber, + onShown: function (tour) { + $('.popover').find('[data-role="prev"]').remove(); + }, + onNext: function (tour) { + $('#ws_callflow .js-add-number').click(); + tour.end(); + } + }, + { + element: '#ws_cf_tools > div', + placement: 'left', + content: i18n.callflows.guide.dragAndDropAction, + onShown: function (tour) { + $('.popover').find('[data-role="next"],[data-role="prev"]').remove(); + } + } + ]}); + + self.tour.init(); + if(self.tour.ended()) { + self.tour.restart(); + } + + if(self.tour.getCurrentStep() !== 0) { + self.tour.goTo(0); + } + }, + bindCallflowsEvents: function(template, container) { var self = this, callflowList = template.find('.list-container .list'), @@ -173,6 +243,17 @@ define(function(require){ .addClass('edition-mode'); self.editCallflow(); + + if($('.js-callflows-list .list-element').length === 0) { + if(self.tour.ended()) { + self.tour.restart(); + } + if(self.tour.getCurrentStep() !== 1) { + self.tour.goTo(1); + } + } else { + delete self.tour; + } }); // Edit Callflow @@ -910,7 +991,7 @@ define(function(require){ delete self.original_flow; // clear original_flow - $('#callflow-view .callflow_help').hide(); + $('.js-callflow-intro').hide(); self.resetFlow(); @@ -1390,6 +1471,9 @@ define(function(require){ } $('.number_column.empty', node_html).click(function() { + if(self.tour) { + self.tour.end(); + } self.listNumbers(function(phoneNumbers) { var parsedNumbers = []; @@ -1479,6 +1563,16 @@ define(function(require){ popup.dialog('close'); self.repaintFlow(); + + if(self.tour + && $('#ws_callflow .number_column').not('.js-add-number').length === 1) { + if(self.tour.ended()) { + self.tour.restart(); + } + if(self.tour.getCurrentStep() !== 2) { + self.tour.goTo(2); + } + } } else { monster.ui.alert(self.i18n.active().oldCallflows.you_didnt_select); @@ -1772,6 +1866,9 @@ define(function(require){ $(this).addClass('inactive'); }, drag: function () { + if(self.tour) { + self.tour.end(); + } $('.callflow_helpbox_wrapper', '#callflow-view').hide(); }, stop: function () { diff --git a/src/apps/callflows/i18n/en-US.json b/src/apps/callflows/i18n/en-US.json index 9ee7419..5d97d99 100644 --- a/src/apps/callflows/i18n/en-US.json +++ b/src/apps/callflows/i18n/en-US.json @@ -1130,6 +1130,15 @@ "thereIsCurrentlyNoUser": "There is currently no user in this queue", "userLabel": "Users list", "selectQueue": "Select Queue" + }, + "introTitle": "What is Callflow?", + "introDescription": "A callflow defines what happens when someone dials an extension or phone number.", + "guide": { + "addCallflow": "Click this button to create new callflow", + "addNumber": "Click this button to add phone or extension number into callflow
When someone dials these number, they will behave according to the way you set up the callflow in the next step.", + "dragAndDropAction": "Drag actions from the actions panel to the callflow box. You can customize a callflow by adding more actions.
", + "nextBtnText": "Next ยป", + "endTourBtnText": "Close" } }, "oldCallflows": { diff --git a/src/apps/callflows/style/app.css b/src/apps/callflows/style/app.css index c610d91..e6bbef1 100644 --- a/src/apps/callflows/style/app.css +++ b/src/apps/callflows/style/app.css @@ -10,6 +10,7 @@ @import url('../submodules/featurecodes/featurecodes.css'); @import url('../submodules/temporalset/temporalset.css'); @import url('../submodules/callcenter/callcenter.css'); +@import url('../../../css/vendor/bootstrap-tour.css'); /* style.css */ #ws_callflow > .callflow { float: left; @@ -20,7 +21,7 @@ } #ws_callflow .callflow .root > .top_bar { - background: #22A5FF; + background: #0081D6; height: 25px; text-align: left; border-radius: 6px 6px 0 0; @@ -43,16 +44,12 @@ } #ws_callflow .callflow .root > .content .number_row { - background-image: url(static/images/nav_line_horizontal.jpg); - background-position: bottom; - background-repeat: repeat-x; - height: 32px; - background-color: #303039; + height: 30px; + background: #0081D6; + border-top: 1px solid white; } #ws_callflow .callflow .root > .content .number_row:last-child { - background: none; - background-color: #303039; height: 30px; border-radius: 0px 0px 2px 2px; } @@ -69,15 +66,13 @@ } #ws_callflow .callflow .root > .content .number_column.full { - width: 312px; + width: 100%; text-align: center; } #ws_callflow .callflow .root > .content .number_column.second { - width: 163px; - background-image: url(static/images/nav_line.jpg); - background-position: left; - background-repeat: repeat-y; + width: 162px; + border-left: 1px solid white; } #ws_callflow .callflow .root > .content .number_column.first { @@ -85,10 +80,15 @@ } #ws_callflow .callflow .root > .content .number_column.empty { - color: #A0A0A0; + color: white; cursor: default; } +#ws_callflow .callflow .root > .content .number_column.add-number { + cursor: pointer; + background: #22A5FF; +} + #ws_callflow .callflow .root > .content .number_column .delete { background-image: url(static/images/btn_delete.png); background-repeat: no-repeat; @@ -103,10 +103,6 @@ cursor: pointer; } -#ws_callflow .callflow .root > .content .number_column .delete:hover { - background-image: url(static/images/btn_delete_blue.png); -} - #ws_callflow .callflow .node { display: inline-block; cursor: -moz-grab; @@ -129,10 +125,7 @@ right: 0px; padding: 5px; cursor: pointer; -} - -#ws_callflow .callflow .node .node-options .delete:hover { - background-image: url(static/images/btn_delete_blue.png); + color: #555; } #ws_callflow .tool .fa { @@ -142,7 +135,7 @@ #ws_callflow .tools .category { text-align: center; - background: #22A5FF; + background: #0081D6; background-position: top center; cursor: default; border-bottom: 1px solid white; @@ -150,7 +143,7 @@ #ws_callflow .tools .category .content { background-color: white; - border: 1px solid #22A5FF; + border: 1px solid #0081D6; padding: 1px 0px 3px; } @@ -187,7 +180,7 @@ } #ws_callflow .tools .inactive .open:hover { - background: #0081D6; + background: #22A5FF; } #ws_callflow .tools .inactive .open::before { @@ -224,15 +217,16 @@ z-index: 19; height: 53px; border-radius: 6px; - background: #22A5FF; + background: #0081D6; color: white; - border: 1px solid #22A5FF; + border: 1px solid #0081D6; padding-top: 7px; + width: 76px; } #ws_callflow .tools .tool .action:hover { - background: #0081D6; - border: 1px solid #0081D6; + background: #22A5FF; + border: 1px solid #22A5FF; } #ws_callflow .tools .app_list_nav { @@ -240,9 +234,9 @@ } #ws_callflow .callflow .icons_black.node { - width: 143px; + width: 132px; height: 84px; - background: #303039; + background: #0081D6; border-radius: 6px; } @@ -319,19 +313,20 @@ } #ws_callflow .a_link_option { - color: #EEE; - font-size: 12px; + color: white; + font-size: 17px; + display: block; + padding: 2px 0; } #ws_callflow .div_option { display: inline-block; - height: 15px; - line-height: 15px; + line-height: 1; width: 131px; - background-color: #474747; - margin: 0; - padding: 0; - border: 1px solid #303030; + background-color: #22A5FF; + margin: 0 0 2px; + padding: 2px 0; + border: 1px solid #22A5FF; border-radius: 2px; } @@ -492,16 +487,13 @@ overflow: visible; } -#callflow_container .callflow-help, .popup_help .callflow-help { - background: url(static/images/callflow_help.gif) no-repeat center; - height: 644px; - width: 847px; - margin: 20px auto auto; - border-radius: 10px; +#callflow_container .callflow-intro { + padding: 0 0 0 40px; } -#callflow_container .callflow-content.edition-mode .callflow-help { - display: none; +#callflow_container .callflow-intro .callflow-intro-title { + font-weight: normal; + font-size: 23px; } #callflow_container .callflow-content.listing-mode #ws_callflow { @@ -598,8 +590,8 @@ } #ws_callflow .tools .search-box { - border-left: 1px solid #22A5FF; - border-right: 1px solid #22A5FF; + border-left: 1px solid #0081D6; + border-right: 1px solid #0081D6; position: relative; } @@ -636,7 +628,7 @@ } #ws_callflow .title { - background: #22A5FF; + background: #0081D6; font-size: 15px; height: 25px; line-height: 25px; @@ -648,7 +640,8 @@ #callflow_container .wrapper_callflow_buttons { display: block; - width: 322px; + width: 100%; + text-align: center; margin: auto; margin-bottom: 5px; } @@ -657,7 +650,7 @@ width: 114px; text-align: center; display: inline-block; - margin-left: 0px; + margin-left: 0; } #callflow_container .wrapper_callflow_buttons .monster-button:first-child { @@ -703,13 +696,13 @@ } @-webkit-keyframes pulse-box { - 0% { box-shadow: 0px 0px 0px #0081D6 inset, 0px 0px 0px #0081D6; } - 100% { box-shadow: 0px 0px 30px #0081D6 inset, 0px 0px 10px #0081D6; } + 0% { box-shadow: 0px 0px 0px #09DB4B inset, 0px 0px 0px #09DB4B; } + 100% { box-shadow: 0px 0px 30px #09DB4B inset, 0px 0px 10px #09DB4B; } } @keyframes pulse-box { - 0% { box-shadow: 0px 0px 0px #0081D6 inset, 0px 0px 0px #0081D6; } - 100% { box-shadow: 0px 0px 30px #0081D6 inset, 0px 0px 10px #0081D6; } + 0% { box-shadow: 0px 0px 0px #09DB4B inset, 0px 0px 0px #09DB4B; } + 100% { box-shadow: 0px 0px 30px #09DB4B inset, 0px 0px 10px #09DB4B; } } /* JR's customization */ @@ -1644,14 +1637,14 @@ .callflows-port .monster-button-success, #callflow_container .monster-button-success { color: white; - border-color: #22A5FF; - background: #22A5FF; + border-color: #09A74B; + background: #09A74B; } .callflows-port .monster-button-success:hover, #callflow_container .monster-button-success:hover { - border-color: #0081D6; - background: #0081D6; + border-color: #18B65A; + background: #18B65A; } .callflows-port .items-selector .box-selector .item-selector { @@ -1748,3 +1741,21 @@ background: transparent; color: #22A5FF; } + +.callflows-drag-and-drop { + width: 285px; + height: 148px; + background: url('static/images/callflows-drag-and-drop.gif') no-repeat; +} + + +/* + * Bootstrap guide tour - override styles + */ +.popover[class*="tour-"] { + min-width: 350px; +} + +.tour-backdrop { + opacity: 0.6; +} \ No newline at end of file diff --git a/src/apps/callflows/style/static/images/callflow_help.gif b/src/apps/callflows/style/static/images/callflow_help.gif deleted file mode 100644 index 7608000..0000000 Binary files a/src/apps/callflows/style/static/images/callflow_help.gif and /dev/null differ diff --git a/src/apps/callflows/style/static/images/callflows-drag-and-drop.gif b/src/apps/callflows/style/static/images/callflows-drag-and-drop.gif new file mode 100644 index 0000000..1e8344f Binary files /dev/null and b/src/apps/callflows/style/static/images/callflows-drag-and-drop.gif differ diff --git a/src/apps/callflows/views/callflow-manager.html b/src/apps/callflows/views/callflow-manager.html index fc72a7d..327f9fb 100644 --- a/src/apps/callflows/views/callflow-manager.html +++ b/src/apps/callflows/views/callflow-manager.html @@ -4,11 +4,11 @@ -
+
{{ i18n.callflows.addCallflow }}
-
+
    @@ -32,7 +32,12 @@
    -
    +
    +

    + {{ i18n.callflows.introTitle }} +

    +

    {{ i18n.callflows.introDescription }}

    +
    diff --git a/src/apps/callflows/views/layout.html b/src/apps/callflows/views/layout.html index c353df5..49d42dd 100644 --- a/src/apps/callflows/views/layout.html +++ b/src/apps/callflows/views/layout.html @@ -38,5 +38,5 @@
    -
    +
    \ No newline at end of file diff --git a/src/apps/callflows/views/rowNumber.html b/src/apps/callflows/views/rowNumber.html index 240d4af..e19a37d 100644 --- a/src/apps/callflows/views/rowNumber.html +++ b/src/apps/callflows/views/rowNumber.html @@ -39,9 +39,9 @@ {{/compare}}
    -
    {{ i18n.oldCallflows.click_to_add_number }}
    +
    {{ i18n.oldCallflows.click_to_add_number }}
    {{else}} -
    {{ i18n.oldCallflows.click_to_add_number }}
    +
    {{ i18n.oldCallflows.click_to_add_number }}
    {{/if}} {{/if}}
    diff --git a/src/css/vendor/bootstrap-tour.css b/src/css/vendor/bootstrap-tour.css new file mode 100644 index 0000000..ce650de --- /dev/null +++ b/src/css/vendor/bootstrap-tour.css @@ -0,0 +1,55 @@ +/* ======================================================================== + * bootstrap-tour - v0.11.0 + * http://bootstraptour.com + * ======================================================================== + * Copyright 2012-2015 Ulrich Sossou + * + * ======================================================================== + * Licensed under the MIT License (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://opensource.org/licenses/MIT + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== + */ + +.tour-backdrop { + position: absolute; + z-index: 1100; + background-color: #000; + opacity: 0.8; + filter: alpha(opacity=80); +} +.popover[class*="tour-"] { + z-index: 1102; +} +.popover[class*="tour-"] .popover-navigation { + padding: 9px 14px; + overflow: hidden; +} +.popover[class*="tour-"] .popover-navigation *[data-role="end"] { + float: right; +} +.popover[class*="tour-"] .popover-navigation *[data-role="prev"], +.popover[class*="tour-"] .popover-navigation *[data-role="next"], +.popover[class*="tour-"] .popover-navigation *[data-role="end"] { + cursor: pointer; +} +.popover[class*="tour-"] .popover-navigation *[data-role="prev"].disabled, +.popover[class*="tour-"] .popover-navigation *[data-role="next"].disabled, +.popover[class*="tour-"] .popover-navigation *[data-role="end"].disabled { + cursor: default; +} +.popover[class*="tour-"].orphan { + position: fixed; + margin-top: 0; +} +.popover[class*="tour-"].orphan .arrow { + display: none; +} diff --git a/src/js/vendor/bootstrap-tour.min.js b/src/js/vendor/bootstrap-tour.min.js new file mode 100644 index 0000000..7a18302 --- /dev/null +++ b/src/js/vendor/bootstrap-tour.min.js @@ -0,0 +1,22 @@ +/* ======================================================================== + * bootstrap-tour - v0.12.0 + * http://bootstraptour.com + * ======================================================================== + * Copyright 2012-2015 Ulrich Sossou + * + * ======================================================================== + * Licensed under the MIT License (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * https://opensource.org/licenses/MIT + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + * ======================================================================== + */ + +var bind=function(t,e){return function(){return t.apply(e,arguments)}};!function(t,e){"function"==typeof define&&define.amd?define(["jquery"],function(o){return t.Tour=e(o)}):"object"==typeof exports?module.exports=e(require("jquery")):t.Tour=e(t.jQuery)}(window,function(t){var e;return e=window.document,function(){function o(e){this._showPopoverAndOverlay=bind(this._showPopoverAndOverlay,this);var o;try{o=window.localStorage}catch(t){o=!1}this._options=t.extend({name:"tour",steps:[],container:"body",autoscroll:!0,keyboard:!0,storage:o,debug:!1,backdrop:!1,backdropContainer:"body",backdropPadding:0,redirect:!0,orphan:!1,duration:!1,delay:!1,basePath:"",template:'',afterSetState:function(t,e){},afterGetState:function(t,e){},afterRemoveState:function(t){},onStart:function(t){},onEnd:function(t){},onShow:function(t){},onShown:function(t){},onHide:function(t){},onHidden:function(t){},onNext:function(t){},onPrev:function(t){},onPause:function(t,e){},onResume:function(t,e){},onRedirectError:function(t){}},e),this._force=!1,this._inited=!1,this._current=null,this.backdrops=[]}return o.prototype.addSteps=function(t){var e,o,n;for(e=0,o=t.length;e

    ",next:e===this._options.steps.length-1?-1:e+1,prev:e-1,animation:!0,container:this._options.container,autoscroll:this._options.autoscroll,backdrop:this._options.backdrop,backdropContainer:this._options.backdropContainer,backdropPadding:this._options.backdropPadding,redirect:this._options.redirect,reflexElement:this._options.steps[e].element,backdropElement:this._options.steps[e].element,orphan:this._options.orphan,duration:this._options.duration,delay:this._options.delay,template:this._options.template,onShow:this._options.onShow,onShown:this._options.onShown,onHide:this._options.onHide,onHidden:this._options.onHidden,onNext:this._options.onNext,onPrev:this._options.onPrev,onPause:this._options.onPause,onResume:this._options.onResume,onRedirectError:this._options.onRedirectError},this._options.steps[e])},o.prototype.init=function(t){return this._force=t,this.ended()?(this._debug("Tour ended, init prevented."),this):(this.setCurrentStep(),this._initMouseNavigation(),this._initKeyboardNavigation(),this._onResize(function(t){return function(){return t.showStep(t._current)}}(this)),this._onScroll(function(t){return function(){return t._showPopoverAndOverlay(t._current)}}(this)),null!==this._current&&this.showStep(this._current),this._inited=!0,this)},o.prototype.start=function(t){var e;return null==t&&(t=!1),this._inited||this.init(t),null===this._current&&(e=this._makePromise(null!=this._options.onStart?this._options.onStart(this):void 0),this._callOnPromiseDone(e,this.showStep,0)),this},o.prototype.next=function(){var t;return t=this.hideStep(this._current,this._current+1),this._callOnPromiseDone(t,this._showNextStep)},o.prototype.prev=function(){var t;return t=this.hideStep(this._current,this._current-1),this._callOnPromiseDone(t,this._showPrevStep)},o.prototype.goTo=function(t){var e;return e=this.hideStep(this._current,t),this._callOnPromiseDone(e,this.showStep,t)},o.prototype.end=function(){var o,n;return o=function(o){return function(n){if(t(e).off("click.tour-"+o._options.name),t(e).off("keyup.tour-"+o._options.name),t(window).off("resize.tour-"+o._options.name),t(window).off("scroll.tour-"+o._options.name),o._setState("end","yes"),o._inited=!1,o._force=!1,o._clearTimer(),null!=o._options.onEnd)return o._options.onEnd(o)}}(this),n=this.hideStep(this._current),this._callOnPromiseDone(n,o)},o.prototype.ended=function(){return!this._force&&!!this._getState("end")},o.prototype.restart=function(){return this._removeState("current_step"),this._removeState("end"),this._removeState("redirect_to"),this.start()},o.prototype.pause=function(){var t;return(t=this.getStep(this._current))&&t.duration?(this._paused=!0,this._duration-=(new Date).getTime()-this._start,window.clearTimeout(this._timer),this._debug("Paused/Stopped step "+(this._current+1)+" timer ("+this._duration+" remaining)."),null!=t.onPause?t.onPause(this,this._duration):void 0):this},o.prototype.resume=function(){var t;return(t=this.getStep(this._current))&&t.duration?(this._paused=!1,this._start=(new Date).getTime(),this._duration=this._duration||t.duration,this._timer=window.setTimeout(function(t){return function(){return t._isLast()?t.next():t.end()}}(this),this._duration),this._debug("Started step "+(this._current+1)+" timer with duration "+this._duration),null!=t.onResume&&this._duration!==t.duration?t.onResume(this,this._duration):void 0):this},o.prototype.hideStep=function(e,o){var n,i,r,s;if(s=this.getStep(e))return this._clearTimer(),r=this._makePromise(null!=s.onHide?s.onHide(this,e):void 0),i=function(n){return function(i){var r,a;if((r=t(s.element)).data("bs.popover")||r.data("popover")||(r=t("body")),r.popover("destroy").removeClass("tour-"+n._options.name+"-element tour-"+n._options.name+"-"+e+"-element").removeData("bs.popover"),s.reflex&&t(s.reflexElement).removeClass("tour-step-element-reflex").off(n._reflexEvent(s.reflex)+".tour-"+n._options.name),s.backdrop&&((a=null!=o&&n.getStep(o))&&a.backdrop&&a.backdropElement===s.backdropElement||n._hideOverlayElement(s)),null!=s.onHidden)return s.onHidden(n)}}(this),n=s.delay.hide||s.delay,"[object Number]"==={}.toString.call(n)&&n>0?(this._debug("Wait "+n+" milliseconds to hide the step "+(this._current+1)),window.setTimeout(function(t){return function(){return t._callOnPromiseDone(r,i)}}(this),n)):this._callOnPromiseDone(r,i),r},o.prototype.showStep=function(t){var o,n,i,r,s,a;return this.ended()?(this._debug("Tour ended, showStep prevented."),this):(a=this.getStep(t))&&(s=t0?(this._debug("Wait "+i+" milliseconds to show the step "+(this._current+1)),window.setTimeout(function(t){return function(){return t._callOnPromiseDone(n,r)}}(this),i)):this._callOnPromiseDone(n,r),n):void 0},o.prototype.getCurrentStep=function(){return this._current},o.prototype.setCurrentStep=function(t){return null!=t?(this._current=t,this._setState("current_step",t)):(this._current=this._getState("current_step"),this._current=null===this._current?null:parseInt(this._current,10)),this},o.prototype.redraw=function(){return this._showOverlayElement(this.getStep(this.getCurrentStep()))},o.prototype._setState=function(t,e){var o;if(this._options.storage){o=this._options.name+"_"+t;try{this._options.storage.setItem(o,e)}catch(t){t.code===DOMException.QUOTA_EXCEEDED_ERR&&this._debug("LocalStorage quota exceeded. State storage failed.")}return this._options.afterSetState(o,e)}return null==this._state&&(this._state={}),this._state[t]=e},o.prototype._removeState=function(t){var e;return this._options.storage?(e=this._options.name+"_"+t,this._options.storage.removeItem(e),this._options.afterRemoveState(e)):null!=this._state?delete this._state[t]:void 0},o.prototype._getState=function(t){var e,o;return this._options.storage?(e=this._options.name+"_"+t,o=this._options.storage.getItem(e)):null!=this._state&&(o=this._state[t]),void 0!==o&&"null"!==o||(o=null),this._options.afterGetState(t,o),o},o.prototype._showNextStep=function(){var t,e,o;return o=this.getStep(this._current),e=function(t){return function(e){return t.showStep(o.next)}}(this),t=this._makePromise(null!=o.onNext?o.onNext(this):void 0),this._callOnPromiseDone(t,e)},o.prototype._showPrevStep=function(){var t,e,o;return o=this.getStep(this._current),e=function(t){return function(e){return t.showStep(o.prev)}}(this),t=this._makePromise(null!=o.onPrev?o.onPrev(this):void 0),this._callOnPromiseDone(t,e)},o.prototype._debug=function(t){if(this._options.debug)return window.console.log("Bootstrap Tour '"+this._options.name+"' | "+t)},o.prototype._isRedirect=function(t,e,o){var n;return!(null==t||""===t||!("[object RegExp]"==={}.toString.call(t)&&!t.test(o.origin)||"[object String]"==={}.toString.call(t)&&this._isHostDifferent(t,o)))||(n=[o.pathname,o.search,o.hash].join(""),null!=e&&""!==e&&("[object RegExp]"==={}.toString.call(e)&&!e.test(n)||"[object String]"==={}.toString.call(e)&&this._isPathDifferent(e,n)))},o.prototype._isHostDifferent=function(t,e){switch({}.toString.call(t)){case"[object RegExp]":return!t.test(e.origin);case"[object String]":return this._getProtocol(t)!==this._getProtocol(e.href)||this._getHost(t)!==this._getHost(e.href);default:return!0}},o.prototype._isPathDifferent=function(t,e){return this._getPath(t)!==this._getPath(e)||!this._equal(this._getQuery(t),this._getQuery(e))||!this._equal(this._getHash(t),this._getHash(e))},o.prototype._isJustPathHashDifferent=function(t,e,o){var n;return(null==t||""===t||!this._isHostDifferent(t,o))&&(n=[o.pathname,o.search,o.hash].join(""),"[object String]"==={}.toString.call(e)&&(this._getPath(e)===this._getPath(n)&&this._equal(this._getQuery(e),this._getQuery(n))&&!this._equal(this._getHash(e),this._getHash(n))))},o.prototype._redirect=function(o,n,i){var r;return t.isFunction(o.redirect)?o.redirect.call(this,i):(r="[object String]"==={}.toString.call(o.host)?""+o.host+i:i,this._debug("Redirect to "+r),this._getState("redirect_to")!==""+n?(this._setState("redirect_to",""+n),e.location.href=r):(this._debug("Error redirection loop to "+i),this._removeState("redirect_to"),null!=o.onRedirectError?o.onRedirectError(this):void 0))},o.prototype._isOrphan=function(e){return null==e.element||!t(e.element).length||t(e.element).is(":hidden")&&"http://www.w3.org/2000/svg"!==t(e.element)[0].namespaceURI},o.prototype._isLast=function(){return this._current").parent().html()},o.prototype._reflexEvent=function(t){return"[object Boolean]"==={}.toString.call(t)?"click":t},o.prototype._reposition=function(o,n){var i,r,s,a,h,p,u;if(a=o[0].offsetWidth,r=o[0].offsetHeight,u=o.offset(),h=u.left,p=u.top,(i=t(e).outerHeight()-u.top-o.outerHeight())<0&&(u.top=u.top+i),(s=t("html").outerWidth()-u.left-o.outerWidth())<0&&(u.left=u.left+s),u.top<0&&(u.top=0),u.left<0&&(u.left=0),o.offset(u),"bottom"===n.placement||"top"===n.placement){if(h!==u.left)return this._replaceArrow(o,2*(u.left-h),a,"left")}else if(p!==u.top)return this._replaceArrow(o,2*(u.top-p),r,"top")},o.prototype._center=function(e){return e.css("top",t(window).outerHeight()/2-e.outerHeight()/2)},o.prototype._replaceArrow=function(t,e,o,n){return t.find(".arrow").css(n,e?50*(1-e/o)+"%":"")},o.prototype._scrollIntoView=function(e){var o,n,i,r,s,a,h,p;if(h=this.getStep(e),!(o=t(h.element)).length)return this._showPopoverAndOverlay(e);switch(n=t(window),s=o.offset().top,r=o.outerHeight(),p=n.height(),a=0,h.placement){case"top":a=Math.max(0,s-p/2);break;case"left":case"right":a=Math.max(0,s+r/2-p/2);break;case"bottom":a=Math.max(0,s+r-p/2)}return this._debug("Scroll into view. ScrollTop: "+a+". Element offset: "+s+". Window height: "+p+"."),i=0,t("body, html").stop(!0,!0).animate({scrollTop:Math.ceil(a)},function(t){return function(){if(2==++i)return t._showPopoverAndOverlay(e),t._debug("Scroll into view.\nAnimation end element offset: "+o.offset().top+".\nWindow height: "+n.height()+".")}}(this))},o.prototype._onResize=function(e,o){return t(window).on("resize.tour-"+this._options.name,function(){return clearTimeout(o),o=setTimeout(e,100)})},o.prototype._onScroll=function(e,o){return t(window).on("scroll.tour-"+this._options.name,function(){return clearTimeout(o),o=setTimeout(e,100)})},o.prototype._initMouseNavigation=function(){var o;return o=this,t(e).off("click.tour-"+this._options.name,".popover.tour-"+this._options.name+" *[data-role='prev']").off("click.tour-"+this._options.name,".popover.tour-"+this._options.name+" *[data-role='next']").off("click.tour-"+this._options.name,".popover.tour-"+this._options.name+" *[data-role='end']").off("click.tour-"+this._options.name,".popover.tour-"+this._options.name+" *[data-role='pause-resume']").on("click.tour-"+this._options.name,".popover.tour-"+this._options.name+" *[data-role='next']",function(t){return function(e){return e.preventDefault(),t.next()}}(this)).on("click.tour-"+this._options.name,".popover.tour-"+this._options.name+" *[data-role='prev']",function(t){return function(e){if(e.preventDefault(),t._current>0)return t.prev()}}(this)).on("click.tour-"+this._options.name,".popover.tour-"+this._options.name+" *[data-role='end']",function(t){return function(e){return e.preventDefault(),t.end()}}(this)).on("click.tour-"+this._options.name,".popover.tour-"+this._options.name+" *[data-role='pause-resume']",function(e){var n;return e.preventDefault(),(n=t(this)).text(o._paused?n.data("pause-text"):n.data("resume-text")),o._paused?o.resume():o.pause()})},o.prototype._initKeyboardNavigation=function(){if(this._options.keyboard)return t(e).on("keyup.tour-"+this._options.name,function(t){return function(e){if(e.which)switch(e.which){case 39:return e.preventDefault(),t._isLast()?t.next():t.end();case 37:if(e.preventDefault(),t._current>0)return t.prev()}}}(this))},o.prototype._makePromise=function(e){return e&&t.isFunction(e.then)?e:null},o.prototype._callOnPromiseDone=function(t,e,o){return t?t.then(function(t){return function(n){return e.call(t,o)}}(this)):e.call(this,o)},o.prototype._showBackground=function(o,n){var i,r,s,a,h,p,u,l,c;for(s=t(e).height(),c=t(e).width(),l=[],a=0,h=(u=["top","bottom","left","right"]).length;a",{class:"tour-backdrop "+p}),t(o.backdropContainer).append(i),p){case"top":l.push(i.height(n.offset.top>0?n.offset.top:0).width(c).offset({top:0,left:0}));break;case"bottom":l.push(i.offset({top:n.offset.top+n.height,left:0}).height(s-(n.offset.top+n.height)).width(c));break;case"left":l.push(i.offset({top:n.offset.top,left:0}).height(n.height).width(n.offset.left>0?n.offset.left:0));break;case"right":l.push(i.offset({top:n.offset.top,left:n.offset.left+n.width}).height(n.height).width(c-(n.offset.left+n.width)));break;default:l.push(void 0)}return l},o.prototype._showOverlayElement=function(e){var o,n;return 0===(o=t(e.backdropElement)).length?n={width:0,height:0,offset:{top:0,left:0}}:(n={width:o.innerWidth(),height:o.innerHeight(),offset:o.offset()},o.addClass("tour-step-backdrop"),e.backdropPadding&&(n=this._applyBackdropPadding(e.backdropPadding,n))),this._showBackground(e,n)},o.prototype._hideOverlayElement=function(e){var o,n,i;t(e.backdropElement).removeClass("tour-step-backdrop"),i=this.backdrops;for(n in i)(o=i[n])&&void 0!==o.remove&&o.remove();return this.backdrops=[]},o.prototype._applyBackdropPadding=function(t,e){return"object"==typeof t?(null==t.top&&(t.top=0),null==t.right&&(t.right=0),null==t.bottom&&(t.bottom=0),null==t.left&&(t.left=0),e.offset.top=e.offset.top-t.top,e.offset.left=e.offset.left-t.left,e.width=e.width+t.left+t.right,e.height=e.height+t.top+t.bottom):(e.offset.top=e.offset.top-t,e.offset.left=e.offset.left-t,e.width=e.width+2*t,e.height=e.height+2*t),e},o.prototype._clearTimer=function(){return window.clearTimeout(this._timer),this._timer=null,this._duration=null},o.prototype._getProtocol=function(t){return(t=t.split("://")).length>1?t[0]:"http"},o.prototype._getHost=function(t){return t=t.split("//"),(t=t.length>1?t[1]:t[0]).split("/")[0]},o.prototype._getPath=function(t){return t.replace(/\/?$/,"").split("?")[0].split("#")[0]},o.prototype._getQuery=function(t){return this._getParams(t,"?")},o.prototype._getHash=function(t){return this._getParams(t,"#")},o.prototype._getParams=function(t,e){var o,n,i,r,s;if(1===(r=t.split(e)).length)return{};for(s={},o=0,n=(r=r[1].split("&")).length;o