aboutsummaryrefslogtreecommitdiff
path: root/includes/js/dojox/storage/demos/helloworld.html
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-14 15:39:19 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-14 15:39:19 +0000
commit1c5685d68f1b73270fb814fe04cbb490eb90ba5f (patch)
tree3d3ada08a934b96fc31531f1327690d7edc6f766 /includes/js/dojox/storage/demos/helloworld.html
parent104d59099e048688c4dbac37d72137006e396558 (diff)
downloadsemanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.gz
semanticscuttle-1c5685d68f1b73270fb814fe04cbb490eb90ba5f.tar.bz2
Minor fix: Remove DOJO library (60Mo) replaced by link to Google CDN (online DOJO library)
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@159 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dojox/storage/demos/helloworld.html')
-rw-r--r--includes/js/dojox/storage/demos/helloworld.html90
1 files changed, 0 insertions, 90 deletions
diff --git a/includes/js/dojox/storage/demos/helloworld.html b/includes/js/dojox/storage/demos/helloworld.html
deleted file mode 100644
index 44fd739..0000000
--- a/includes/js/dojox/storage/demos/helloworld.html
+++ /dev/null
@@ -1,90 +0,0 @@
-<html>
- <head>
- <script src="../../../dojo/dojo.js"></script>
- <script src="../storage-browser.js"></script>
-
- <script>
- dojo.require("dojox.storage");
-
- function runDemo(){
- // setup event handlers
- dojo.byId("saveButton").onclick = saveValue;
-
- // write out what our storage provider is for debugging
- dojo.byId("currentProvider").innerHTML =
- dojox.storage.manager.currentProvider.declaredClass;
-
- loadValues();
- }
-
- function loadValues(){
- // get any values that were saved before and write them into the page
- var results = dojox.storage.get("myValues");
-
- if(results){
- var printMe = "<ul>";
- for(var i = 0; i < results.length; i++){
- printMe += "<li>" + results[i] + "</li>";
- }
- printMe += "</ul>";
- dojo.byId("allValues").innerHTML = printMe;
- }
- }
-
- function saveValue(){
- var value = dojo.byId("saveValue").value;
- if(value == undefined || value === ""){
- alert("Please enter a correct value");
- return;
- }
-
- // get the old values first, since we are saving everything
- // as one key
- var results = dojox.storage.get("myValues");
- if(!results){
- results = new Array();
- }
-
- // add new value
- results.push(value);
-
- dojox.storage.put("myValues", results, function(status, keyName){
- if(status == dojox.storage.FAILED){
- alert("You do not have permission to store data for this web site.");
- }else if(status == dojox.storage.SUCCESS){
- loadValues();
- }
- });
- }
-
- // wait until the storage system is finished loading
- if(!dojox.storage.manager.isInitialized()){
- dojo.connect(dojox.storage.manager, "loaded", runDemo);
- }else{
- dojo.connect(dojo, "loaded", runDemo);
- }
- </script>
- </head>
-
- <body>
- <h1>Dojo Storage Hello World</h1>
-
- <p>Simple Dojo Storage example. Enter values below to have them
- persisted in Dojo Storage; refresh browser page or close browser
- and then return to this page to see the values again. Note that
- Dojo Storage will not work from file:// URLs.</p>
-
- <h2>Save Values:</h2>
- <div>
- <input id="saveValue" type="text"></input>
- <button id="saveButton">Save Value</button>
- </div>
-
- <h2>All Saved Values:</h2>
- <p id="allValues"></p>
-
- <p>Using Dojo Storage Provider (autodetected):
- <span id="currentProvider"></span>
- <p>
- </body>
-</html> \ No newline at end of file