options_guide.js 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. (function() {
  2. $script('lib/tether/tether.js', function() {
  3. return $script('lib/shepherd.js/shepherd.min.js', function() {
  4. var targetAnchorClick, tour, tr;
  5. tr = chrome.i18n.getMessage.bind(chrome.i18n);
  6. tour = new Shepherd.Tour({
  7. defaults: {
  8. classes: 'shepherd-theme-arrows',
  9. scrollTo: true
  10. }
  11. });
  12. targetAnchorClick = {
  13. selector: '.shepherd-target a',
  14. event: 'click'
  15. };
  16. tour.addStep('fixed-profile-step', {
  17. text: tr('options_guide_fixedProfileStep'),
  18. attachTo: '.nav-profile[data-profile-type="FixedProfile"] right',
  19. scrollTo: false,
  20. advanceOn: targetAnchorClick,
  21. buttons: [
  22. {
  23. text: tr('options_guideNext'),
  24. action: tour.next
  25. }
  26. ]
  27. });
  28. tour.addStep('fixed-servers-step', {
  29. text: tr('options_guide_fixedServersStep'),
  30. attachTo: '.fixed-servers top',
  31. scrollTo: false,
  32. buttons: [
  33. {
  34. text: tr('options_guideNext'),
  35. action: tour.next
  36. }
  37. ]
  38. });
  39. tour.addStep('auto-switch-profile-step', {
  40. text: tr('options_guide_autoSwitchProfileStep'),
  41. attachTo: '.nav-profile[data-profile-type="SwitchProfile"] right',
  42. scrollTo: false,
  43. advanceOn: targetAnchorClick,
  44. buttons: [
  45. {
  46. text: tr('options_guideNext'),
  47. action: tour.next
  48. }
  49. ]
  50. });
  51. tour.addStep('add-more-profiles-step', {
  52. text: tr('options_guide_addMoreProfilesStep'),
  53. attachTo: '.nav-new-profile right',
  54. scrollTo: false,
  55. advanceOn: targetAnchorClick,
  56. buttons: [
  57. {
  58. text: tr('options_guideDone'),
  59. action: tour.next
  60. }
  61. ]
  62. });
  63. return tour.start();
  64. });
  65. });
  66. }).call(this);