From e44a7e37b6c7b5961adaffc62b9042b8d442938e Mon Sep 17 00:00:00 2001 From: mensonge Date: Thu, 13 Nov 2008 09:49:11 +0000 Subject: New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f --- includes/js/dojox/off/resources/learnhow.js | 43 +++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 includes/js/dojox/off/resources/learnhow.js (limited to 'includes/js/dojox/off/resources/learnhow.js') diff --git a/includes/js/dojox/off/resources/learnhow.js b/includes/js/dojox/off/resources/learnhow.js new file mode 100644 index 0000000..82d5506 --- /dev/null +++ b/includes/js/dojox/off/resources/learnhow.js @@ -0,0 +1,43 @@ +window.onload = function(){ + // get the app name from our URL + var href = window.location.href; + var matches = href.match(/appName=([a-z0-9 \%]*)/i); + var appName = "Application"; + if(matches && matches.length > 0){ + appName = decodeURIComponent(matches[1]); + } + + // set it in our UI + var appNameSpan = document.getElementById("dot-learn-how-app-name"); + appNameSpan.innerHTML = ""; + appNameSpan.appendChild(document.createTextNode(appName)); + + // if we need an offline cache, and we already have one installed, + // update the UI + matches = href.match(/hasOfflineCache=(true|false)/); + var hasOfflineCache = false; + if(matches && matches.length > 0){ + hasOfflineCache = matches[1]; + // convert to boolean + hasOfflineCache = (hasOfflineCache == "true") ? true : false; + } + if(hasOfflineCache == true){ + // delete the download and install steps + var downloadStep = document.getElementById("dot-download-step"); + var installStep = document.getElementById("dot-install-step"); + downloadStep.parentNode.removeChild(downloadStep); + installStep.parentNode.removeChild(installStep); + } + + // get our run link info and update the UI + matches = href.match(/runLink=([^\&]*)\&runLinkText=([^\&]*)/); + if(matches && matches.length > 0){ + var runLink = decodeURIComponent(matches[1]); + var runLinkElem = document.getElementById("dot-learn-how-run-link"); + runLinkElem.setAttribute("href", runLink); + + var runLinkText = decodeURIComponent(matches[2]); + runLinkElem.innerHTML = ""; + runLinkElem.appendChild(document.createTextNode(runLinkText)); + } +} -- cgit v1.2.3