diff options
Diffstat (limited to 'website/resources/js/main.js')
-rw-r--r-- | website/resources/js/main.js | 31 |
1 files changed, 29 insertions, 2 deletions
diff --git a/website/resources/js/main.js b/website/resources/js/main.js index 35d0620d..3ad77958 100644 --- a/website/resources/js/main.js +++ b/website/resources/js/main.js @@ -1,7 +1,30 @@ "use strict"; (function($) { - swfobject.registerObject("player", "9.0.98", "videos/expressInstall.swf"); + function clickToTap() { + if (matchMedia && matchMedia('(hover: none)').matches) $(".clickToTap").each(function() { + var x = $(this); + if (x.text() === "Click") x.text("Tap"); + else x.text("tap"); + }); + } + + function clickForVideo() { + var cfv = $("#clickForVideo"); + var f = function() { + if (!cfv.is(":visible")) return; + cfv.hide(); + $("#demoVideo").show().get(0).play(); + }; + + cfv.css("cursor", "pointer").on("click", f).on("touchstart", function() { + $(this).data("moved", 0); + }).on("touchmove", function() { + $(this).data("moved", 1); + }).on("touchend", function() { + if ($(this).data("moved") === 0) f(); + }); + } function toKey(href) { var lnk = "__savedContent_" + href.replace(/\//g, '_'); @@ -14,7 +37,7 @@ if (self.data("clc")) return; var href = self.attr("href"); self.data("clc", true); - if (!href || href.substr(0, 4) === "http") return; + if (!href || href.substr(0, 4) === "http" || href === "/api/") return; var ext = href.substr(href.length - 4, 4); if (ext === ".xml" || ext === ".jar") return; self.on("click", function(evt) { @@ -63,6 +86,8 @@ $("#main-section").replaceWith(newH); collapseMenu(); $("a").each(captureLinkClick); + }, error: function() { + window.location = u; } }); } @@ -70,4 +95,6 @@ } $(ajaxFeaturePages); + $(clickToTap); + $(clickForVideo); })($); |