Lines Matching refs:toJson
48 cvox.KeyMap.prototype.bindings=function(){return this.bindings_};cvox.KeyMap.prototype.toJSON=function(){return JSON.stringify({bindings:this.bindings_})};cvox.KeyMap.prototype.toLocalStorage=function(){localStorage.keyBindings=this.toJSON()};cvox.KeyMap.prototype.hasCommand=function(a){if(null!=this.commandToKey_)return void 0!=this.commandToKey_[a];for(var b=0;b<this.bindings_.length;b++){var c=this.bindings_[b];if(c.command==a)return!0}return!1};
853 cvox.Spannable.prototype.toJson=function(){var a={};a.string=this.string_;a.spans=[];for(var b=0;b<this.spans_.length;++b){var c=this.spans_[b],d=goog.object.findValue(cvox.Spannable.serializableSpansByName_,function(a){return a.ctor===c.value.constructor});if(d){var e={type:d.name,start:c.start,end:c.end};d.toJson&&(e.value=d.toJson.apply(c.value));a.spans.push(e)}}return a};
855 cvox.Spannable.serializableSpansByName_[d.type],e=e.fromJson(d.value);b.setSpan(e,d.start,d.end)}return b};cvox.Spannable.registerSerializableSpan=function(a,b,c,d){a={name:b,ctor:a,fromJson:c,toJson:d};cvox.Spannable.serializableSpansByName_[b]=a};cvox.Spannable.registerStatelessSerializableSpan=function(a,b){var c={name:b,ctor:a,toJson:void 0,fromJson:function(){return new a}};cvox.Spannable.serializableSpansByName_[b]=c};cvox.Spannable.serializableSpansByName_={};cvox.NavBraille=function(a){this.text=a.text instanceof cvox.Spannable?a.text:new cvox.Spannable(a.text);this.startIndex=goog.isDef(a.startIndex)?a.startIndex:-1;this.endIndex=goog.isDef(a.endIndex)?a.endIndex:this.startIndex};cvox.NavBraille.fromText=function(a){return new cvox.NavBraille({text:a})};
857 cvox.NavBraille.prototype.toString=function(){return'NavBraille(text="'+this.text.toString()+'" startIndex="'+this.startIndex+'" endIndex="'+this.endIndex+'")'};cvox.NavBraille.prototype.toJson=function(){return{spannable:this.text.toJson(),startIndex:this.startIndex,endIndex:this.endIndex}};cvox.NavBraille.prototype.write=function(){cvox.ChromeVox.braille.write(this)};cvox.BrailleKeyCommand={PAN_LEFT:"pan_left",PAN_RIGHT:"pan_right",LINE_UP:"line_up",LINE_DOWN:"line_down",TOP:"top",BOTTOM:"bottom",ROUTING:"routing",SECONDARY_ROUTING:"secondary_routing",DOTS:"dots",STANDARD_KEY:"standard_key"};cvox.BrailleKeyEvent={};cvox.BrailleKeyEvent.keyCodeToLegacyCode=function(a){return cvox.BrailleKeyEvent.legacyKeyCodeMap_[a]};cvox.BrailleKeyEvent.keyCodeToCharValue=function(a){var b={Backspace:8,Tab:9,Enter:10};return b[a]||a.charCodeAt(0)};
869 window.JSON&&"[object JSON]"==window.JSON.toString()?cvox.ChromeVoxJSON=window.JSON:function(){function a(a){return 10>a?"0"+a:a}function b(a){e.lastIndex=0;return e.test(a)?'"'+a.replace(e,function(a){var b=h[a];return"string"===typeof b?b:"\\u"+("0000"+a.charCodeAt(0).toString(16)).slice(-4)})+'"':'"'+a+'"'}function c(a,d){var e,h,m,s,u=f,t,r=d[a];r&&"object"===typeof r&&"function"===typeof r.toJSON&&(r=r.toJSON(a));"function"===typeof k&&(r=k.call(d,a,r));switch(typeof r){case "string":return b(r);
871 (m=c(h,r))&&t.push(b(h)+(f?": ":":")+m);m=0===t.length?"{}":f?"{\n"+f+t.join(",\n"+f)+"\n"+u+"}":"{"+t.join(",")+"}";f=u;return m}}"function"!==typeof Date.prototype.toJSON&&(Date.prototype.toJSON=function(){return isFinite(this.valueOf())?this.getUTCFullYear()+"-"+a(this.getUTCMonth()+1)+"-"+a(this.getUTCDate())+"T"+a(this.getUTCHours())+":"+a(this.getUTCMinutes())+":"+a(this.getUTCSeconds())+"Z":"null"},String.prototype.toJSON=Number.prototype.toJSON=Boolean.prototype.toJSON=function(){return this.valueOf()});
892 cvox.BrailleUtil.ValueSpan.fromJson=function(a){return new cvox.BrailleUtil.ValueSpan(a.offset)};cvox.BrailleUtil.ValueSpan.prototype.toJson=function(){return this};cvox.Spannable.registerSerializableSpan(cvox.BrailleUtil.ValueSpan,"cvox.BrailleUtil.ValueSpan",cvox.BrailleUtil.ValueSpan.fromJson,cvox.BrailleUtil.ValueSpan.prototype.toJson);cvox.BrailleUtil.ValueSelectionSpan=function(){};cvox.Spannable.registerStatelessSerializableSpan(cvox.BrailleUtil.ValueSelectionSpan,"cvox.BrailleUtil.ValueSelectionSpan");
1621 cvox.ChromeVoxPrefs.prototype.sendPrefsToAllTabs=function(a,b){var c=this,d={};a&&(d.prefs=c.getPrefs());b&&(d.keyBindings=this.keyMap_.toJSON());chrome.windows.getAll({populate:!0},function(a){for(var b=0;b<a.length;b++)for(var c=a[b].tabs,h=0;h<c.length;h++)chrome.tabs.sendMessage(c[h].id,d)})};cvox.ChromeVoxPrefs.prototype.setPref=function(a,b){localStorage[a]!=b&&(localStorage[a]=b,this.sendPrefsToAllTabs(!0,!1))};