aboutsummaryrefslogtreecommitdiffstats
path: root/offline-submit/john-resig-offline-app-stub.js
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@redhat.com>2010-03-05 20:13:03 +0100
committerMatěj Cepl <mcepl@redhat.com>2010-03-05 20:13:03 +0100
commitc08add1575c2899641188561fc0970d9b8f94302 (patch)
tree6554ee1294ca7ac45d451c6182aaa8d4de94a755 /offline-submit/john-resig-offline-app-stub.js
parentfcca737f372432da3d9bdb3f3ec1ee0eac6abe69 (diff)
downloadbugzilla-triage-c08add1575c2899641188561fc0970d9b8f94302.tar.gz
Remove unnecessary junk
Diffstat (limited to 'offline-submit/john-resig-offline-app-stub.js')
-rw-r--r--offline-submit/john-resig-offline-app-stub.js43
1 files changed, 0 insertions, 43 deletions
diff --git a/offline-submit/john-resig-offline-app-stub.js b/offline-submit/john-resig-offline-app-stub.js
deleted file mode 100644
index b9d6160..0000000
--- a/offline-submit/john-resig-offline-app-stub.js
+++ /dev/null
@@ -1,43 +0,0 @@
-// stub for the offline application in pseudocode
-// from http://ejohn.org/blog/offline-events/
-
-function saveData( item ){
- if ( navigator.onLine ) {
- saveToServer( item );
- } else {
- toSave.push( item );
- }
-}
-
-function loadData( item ){
- if ( navigator.onLine ) {
- return loadFromServer( item );
- } else {
- var result = loadFromQueue( item );
- if ( !result ) {
- displayError();
- toLoad.push( item );
- }
- return result;
- }
-}
-
-setInterval(function(){
- if ( navigator.onLine ) {
- var item = predictNextItemToBeLoaded();
- loadData( item );
- }
-}, 5000);
-
-window.ononline = function(){
- toSave.forEach( saveData );
- toLoad.forEach( loadData );
-};
-
-window.onload = function(){
- document.getElementById("myform").onsubmit = function(){
- saveData( this );
- return false;
- };
-};
-