mirror of
https://github.com/GrammaticalFramework/gf-core.git
synced 2026-05-16 06:32:51 -06:00
Simple Translation Tool: initial support for editing source segments in the minibar
This commit is contained in:
@@ -1,29 +1,4 @@
|
||||
|
||||
// Grammars are stored locally in the browser using localStorage.
|
||||
// See http://diveintohtml5.info/storage.html
|
||||
//Needs ../js/localstorage.js
|
||||
|
||||
function supports_html5_storage() {
|
||||
try {
|
||||
return 'localStorage' in window && window['localStorage'] !== null;
|
||||
} catch (e) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
var local={
|
||||
prefix:"gf.editor.simple.grammar",
|
||||
get: function (name,def) {
|
||||
var id=this.prefix+name
|
||||
return localStorage[id] ? JSON.parse(localStorage[id]) : def;
|
||||
},
|
||||
put: function (name,value) {
|
||||
var id=this.prefix+name;
|
||||
localStorage[id]=JSON.stringify(value);
|
||||
},
|
||||
remove: function(name) {
|
||||
var id=this.prefix+name;
|
||||
localStorage.removeItem(id);
|
||||
},
|
||||
get count() { return this.get("count",0); },
|
||||
set count(v) { this.put("count",v); }
|
||||
}
|
||||
var local=appLocalStorage("gf.editor.simple.grammar")
|
||||
|
||||
Reference in New Issue
Block a user