aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/TakeATour/js/custom.patch
blob: c372de036ececc516d01763691604df30aa70b5a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
--- bootstrap-tour-standalone.js.orig	2015-02-10 14:28:55.000000000 +0100
+++ bootstrap-tour-standalone.js	2015-02-10 14:35:03.000000000 +0100
@@ -870,9 +870,15 @@
                 return step.path;
             }
           }).call(_this);
-          current_path = [document.location.pathname, document.location.hash].join('');
+          current_path = document.location.href;
           if (_this._isRedirect(path, current_path)) {
+            if ({}.toString.call(path) === "[object RegExp]") {
+             _this._redirect(step, path);
+          }
+          else {
+            path = document.location.protocol+'//'+path;
             _this._redirect(step, path);
+          }
             return;
           }
           if (_this._isOrphan(step)) {
@@ -887,6 +893,14 @@
             }
             _this._debug("Show the orphan step " + (_this._current + 1) + ". Orphans option is true.");
           }
+        if (step.title  === "" & step.content  === "") {
+            if (skipToPrevious) {
+              _this._showPrevStep();
+            } else {
+              _this._showNextStep();
+            }
+            return;
+        }
           if (step.backdrop) {
             _this._showBackdrop(!_this._isOrphan(step) ? step.element : void 0);
           }
@@ -1023,7 +1037,7 @@
     };
 
     Tour.prototype._isRedirect = function(path, currentPath) {
-      return (path != null) && path !== '' && (({}.toString.call(path) === '[object RegExp]' && !path.test(currentPath)) || ({}.toString.call(path) === '[object String]' && path.replace(/\?.*$/, '').replace(/\/?$/, '') !== currentPath.replace(/\/?$/, '')));
+      return (path != null) && path !== '' && (({}.toString.call(path) === '[object RegExp]' && !path.test(currentPath)) || ({}.toString.call(path) === '[object String]' && path !== currentPath.replace("http://", "").replace("https://", "")));
     };
 
     Tour.prototype._redirect = function(step, path) {