Sha256: 05c40c3f8d5071420ecb1e70eeca090cb9ed872e5310c7f9fecf902f83d52614
Contents?: true
Size: 1.45 KB
Versions: 1
Compression:
Stored size: 1.45 KB
Contents
<a id="applink1" href="#{@url.url}">Opening the awesome event now!</a> :javascript function simulateClick(elId) { var evt; var el = document.getElementById(elId); if (document.createEvent) { evt = document.createEvent("MouseEvents"); evt.initMouseEvent("click", true, true, window, 0, 0, 0, 0, 0, false, false, false, false, 0, null); } (evt) ? el.dispatchEvent(evt) : (el.click && el.click()); } var appstorefail = "itms://itunes.apple.com/us/app/tminus-make-share-countdown/id507726329?mt=8"; function applink(fail){ return function(){ var clickedAt = +new Date; // During tests on 3g/3gs this timeout fires immediately if less than 500ms. setTimeout(function(){ // To avoid failing on return to MobileSafari, ensure freshness! if (+new Date - clickedAt < 2000){ window.location = fail; } }, 500); }; } var ref = document.referrer, host = ref.split('/')[2], regexp = /(www\.)?twitter.com/, match = host.match(regexp); if(ref && !regexp.test(location.host)) { if(match) { var button = document.getElementById("applink1") simulateClick("applink1"); } else { document.getElementById("applink1").onclick = applink(appstorefail); var button = document.getElementById("applink1") simulateClick("applink1"); } var button = document.getElementById("applink1") simulateClick("applink1"); }
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
tmin_test-0.0.3 | views/redirect.haml |