spiegel-keyman/web/testing/issue2924/testvariable.js
Marc Durdin 670f20a5f7 chore(web): add baseline old version keyboard
Adds oldtestvariable.js to demonstrate old, broken behaviour with
predictive text and variable stores.
2021-09-27 10:32:53 +10:00

1 line
No EOL
2 KiB
JavaScript

if(typeof keyman === 'undefined') {console.log('Keyboard requires KeymanWeb 10.0 or later');if(typeof tavultesoft !== 'undefined') tavultesoft.keymanweb.util.alert("This keyboard requires KeymanWeb 10.0 or later");} else {KeymanWeb.KR(new Keyboard_testvariable());}function Keyboard_testvariable(){this._v=(typeof keyman!="undefined"&&typeof keyman.version=="string")?parseInt(keyman.version,10):9;this.KI="Keyboard_testvariable";this.KN="testvariable";this.KMINVER="10.0";this.KV={F:' 1em "Arial"',K102:0};this.KV.KLS={"default": ["","","","","","","","","","","","","","","","","","","","Reveal","","","","","","","","","","","","","","Set","","","","","","","","","","","","","","","","","","Clear","","","","","","","","","","","","",""]};this.KV.BK=(function(x){var e=Array.apply(null,Array(65)).map(String.prototype.valueOf,""),r=[],v,i,m=['default','shift','ctrl','shift-ctrl','alt','shift-alt','ctrl-alt','shift-ctrl-alt'];for(i=m.length-1;i>=0;i--)if((v=x[m[i]])||r.length)r=(v?v:e).slice().concat(r);return r})(this.KV.KLS);this.KDU=0;this.KH='';this.KM=0;this.KBVER="1.0";this.KMBM=0x0000;this.KVKL={"tablet":{"displayUnderlying":false,"layer":[{"id":"default","row":[{"id":"1","key":[{"id":"K_S","text":"Set"},{"id":"K_C","text":"Clear"},{"id":"K_R","text":"Reveal"},{"width":"100","id":"K_BKSP","sp":"1","text":"*BkSp*"}]},{"id":"2","key":[{"width":"140","id":"K_LOPT","sp":"1","text":"*Menu*"},{"id":"K_SPACE"},{"width":"145","id":"K_ENTER","sp":"1","text":"*Enter*"}]}]}]}};this.s9=KeymanWeb.KLOAD(this.KI,"myVar","1");this.s13="1";this.s14="0";this.s15="1";this.s16="1";this.KVER="15.0.105.0";this.KVS=['s9'];this.gs=function(t,e) {return this.g0(t,e);};this.g0=function(t,e) {var k=KeymanWeb,r=0,m=0;if(k.KKM(e,16384,67)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"(-)");this.s9=this.s14;}}else if(k.KKM(e,16384,82)) {if(this.s9===this.s15){r=m=1;k.KDC(0,t);k.KO(-1,t,"+");}else if(this.s9!==this.s16){r=m=1;k.KDC(0,t);k.KO(-1,t,"-");}}else if(k.KKM(e,16384,83)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"(+)");this.s9=this.s13;}}return r;};}