view.add(stepTwo);
Label stepThree = new Label(view.newChildId(), "Step Three");
view.add(stepThree);
TourBehavior tourBehavior = new TourBehavior() {
@Override
protected CharSequence createExtraConfig() {
return "if ( tour.ended() ) {\n"
+ " $('<div class=\"alert alert-info\">\\\n"
+ " <button type=\"button\" class=\"close\" data-dismiss=\"alert\">×</button>\\\n"
+ " You ended the demo tour. <a href=\"\" class=\"restart\">Restart the demo tour.</a>\\\n"
+ " </div>').prependTo(\".content\").alert();\n"
+ " }\n" + "\n"
+ " $(\".restart\").click(function (e) {\n"
+ " e.preventDefault();\n" + " tour.restart();\n"
+ " $(this).parents(\".alert\").alert(\"close\");\n"
+ " });";
}
};
tourBehavior
.addStep(new TourStep()
.title(Model.of("Step One Title"))
.element(stepOne)
.content(
Model.of("Some longer help content <strong> for step <span style='color: red'>1</span>.")));
tourBehavior
.addStep(new TourStep()
.title(new ResourceModel("tour.step.two"))
.element(stepTwo)
.placement(TooltipConfig.Placement.left)
.content(
Model.of("Some longer help content <strong> for step <span style='color: red'>2</span>."))
.backdrop(true));
tourBehavior
.addStep(new TourStep()
.title(Model.of("Step Three Title"))
.element(stepThree)
.placement(TooltipConfig.Placement.left)
.content(