diff --git a/js/app.js b/js/app.js index a15445c..d481b54 100644 --- a/js/app.js +++ b/js/app.js @@ -300,7 +300,7 @@ function loadVideo(videoFile) { Ox.oshash(videoFile, function(hash) { videoHash = hash; var storageKey = 'txt_' + videoHash; - if (storageKey in storage) { + if (storageKey in localStorage) { loadTxt(); } }); diff --git a/js/classes.js b/js/classes.js index 1490f30..53ad5ec 100644 --- a/js/classes.js +++ b/js/classes.js @@ -1,6 +1,5 @@ var url = "https://speedtrans.pad.ma"; -var storage = window.localStorage; //elem = string (elementId to make TextArea) var TextArea = function(elem) { @@ -381,16 +380,16 @@ User.prototype.init = function() { User.prototype.set_pref = function(key, val) { var that = this; - storage[key] = val; + localStorage[key] = val; this.callbacks[key](val); } User.prototype.get_pref = function(key) { var that = this; - if (typeof storage[key] === 'undefined') { - storage[key] = that.defaults[key]; + if (typeof localStorage[key] === 'undefined') { + localStorage[key] = that.defaults[key]; } - return storage[key]; + return localStorage[key]; } User.prototype.set_prefs = function(keyvals) { @@ -412,12 +411,12 @@ User.prototype.get_prefs = function(keys) { User.prototype.set_txt = function(filename, txt) { var that = this; - storage['txt_' + filename] = txt; + localStorage['txt_' + filename] = txt; } User.prototype.get_txt = function(filename) { var that = this; - return storage['txt_' + filename]; + return localStorage['txt_' + filename]; } function loadCuts(url, id) {