// Instance the tour
var stepCookieVal = getCookie("tour" + version);
var isPrev = false;
var tour = new Tour(
{
debug : true,
template : "<div class='popover'> <div class='arrow'></div> <h3 class='popover-title my-tour-title'></h3> <div class='popover-content'></div> <div class='popover-navigation'> <div class='btn-group'> <button class='btn btn-sm btn-default' data-role='prev'>« 上一步</button> <button class='btn btn-sm btn-default' data-role='next'>下一步 »</button> <button class='btn btn-sm btn-default' data-role='pause-resume' data-pause-text='Pause' data-resume-text='Resume'>Pause</button> </div> <button class='btn btn-sm btn-default' data-role='end'>结束向导</button> </div> </div>",
steps : [
{
element : "#list-group-div",
animation : true,
title : "活动报名引导",
placement : "bottom",
backdrop : true,
content : "欢迎首次访问改版后的活动报名系统中,下面进入新功能指导!"
},
{
element : "#cookieDetailTd",
animation : true,
title : "活动报名引导",
placement : "top",
backdrop : true,
content : "这是我们的第一步,你需要填写一个你在策花园中的cookie,<span class='text text-danger'>请仔细阅读!</span>"
},
{
element : "#cookieTextarea",
animation : true,
title : "活动报名引导",
placement : "top",
backdrop : true,
content : "请按照上一步的说明拷贝你的cookie到文本框中吧,<span class='text text-danger'>如果你之前已经拷贝过了,我们会读取默认的cookie不用再次拷贝了哦</span>"
},
{
element : "#autoDiscoverBtn",
animation : true,
backdrop : true,
title : "活动报名引导",
placement : "top",
content : "点击这里可以自动探索健身活动,如果你还需要探索其他的活动,请在左侧手动输入活动的列表页地址!"
}, {
element : "#urlInput1",
animation : true,
backdrop : true,
title : "活动报名引导",
placement : "top",
content : "这里就是我们探索到的第一个活动地址!"
}, {
element : "#urlInput2",
animation : true,
backdrop : true,
title : "活动报名引导",
placement : "bottom",
content : "这里就是我们探索到的第二个活动地址!"
}, {
element : "#isAutoSignUpCheckbox",
animation : true,
backdrop : true,
title : "活动报名引导",
placement : "top",
content : "勾选上这个后,就可以在查询活动时,自动报名已经开放的活动!"
}, {
element : "#submitBtn",
animation : true,
backdrop : true,
title : "活动报名引导",
placement : "top",
content : "进入到这里就是我们的最后一步了,痛快的点击它吧~!"
} ],
onStart : function(tour) {
if (stepCookieVal == tour._options.steps.length) {
tour.end();
} else {
}
},
onPrev : function(tour) {
isPrev = true
},
onNext : function(tour) {
isPrev = false;
},
onShown : function(tour) {
var stepIndex = tour.getCurrentStep();
if (stepCookieVal > tour.getCurrentStep()
&& isPrev == false) {
tour.goTo(new Number(stepCookieVal));
} else {
setCookie("tour" + version, stepIndex);
}
},
onEnd : function(tour) {
setCookie("tour" + version, tour._options.steps.length);
}
});
// Initialize the tour
tour.init();
// Start the tour
tour.restart();