mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-29 19:57:41 +00:00
commit
c496c93c64
2 changed files with 12 additions and 12 deletions
|
|
@ -8,7 +8,7 @@ String.prototype.kmwCodePointToCodeUnit=function(a){if(null===a)return null;var
|
|||
String.prototype.kmwBMPNextChar=function(a){return 0>a||a>=(""+this).length-1?null:a+1};String.prototype.kmwBMPPrevChar=function(a){return 0>=a||a>(""+this).length?null:a-1};String.prototype.kmwBMPCodePointToCodeUnit=function(a){return a};String.prototype.kmwBMPCodeUnitToCodePoint=function(a){return a};String.prototype.kmwBMPLength=function(){return(""+this).length};String.prototype.kmwBMPSubstr=function(a,b){var c=""+this;return-1<a?c.substr(a,b):c.substr(c.length+a,-a)};
|
||||
String.kmwEnableSupplementaryPlane=function(a){var b=String.prototype;String._kmwFromCharCode=a?String.kmwFromCharCode:String.fromCharCode;b._kmwCharAt=a?b.kmwCharAt:b.charAt;b._kmwCharCodeAt=a?b.kmwCharCodeAt:b.charCodeAt;b._kmwIndexOf=a?b.kmwIndexOf:b.indexOf;b._kmwLastIndexOf=a?b.kmwLastIndexOf:b.lastIndexOf;b._kmwSlice=a?b.kmwSlice:b.slice;b._kmwSubstring=a?b.kmwSubstring:b.substring;b._kmwSubstr=a?b.kmwSubstr:b.kmwBMPSubstr;b._kmwLength=a?b.kmwLength:b.kmwBMPLength;b._kmwNextChar=a?b.kmwNextChar:
|
||||
b.kmwBMPNextChar;b._kmwPrevChar=a?b.kmwPrevChar:b.kmwBMPPrevChar;b._kmwCodePointToCodeUnit=a?b.kmwCodePointToCodeUnit:b.kmwBMPCodePointToCodeUnit;b._kmwCodeUnitToCodePoint=a?b.kmwCodeUnitToCodePoint:b.kmwBMPCodeUnitToCodePoint};
|
||||
var __BUILD__=402;
|
||||
var __BUILD__=403;
|
||||
(function(){var b=(window.tavultesoft={}).keymanweb={_TitleElement:null,_Enabled:1,_IE:0,legacy:0,_IsActivatingKeymanWebUI:0,_JustActivatedKeymanWebUI:0,_IgnoreNextSelChange:0,_Selection:null,_SelectionControl:null,_KeyboardStubs:[],dfltStub:null,_Keyboards:[],_ActiveKeyboard:null,_ActiveStub:null,_LoadingInternalName:null,_AnyIndices:[],_DeadKeys:[],_ActiveControl:null,_Controls:[],_AttachedElements:[],_ActiveElement:null,_LastActiveElement:null,_DfltStyle:"",_MasterDocument:null,_HotKeys:[],focusTimer:null,
|
||||
focusing:!1,resizing:!1,sortedInputs:[],inputList:[],languageList:null,languagesPending:[],deferredStubs:[],deferredKRS:[],deferredKR:[],loadTimer:null,waiting:null,warned:!1,baseFont:"sans-serif",appliedFont:"",embeddedFonts:[],fontCheckTimer:null,srcPath:"",rootPath:"",mustReloadKeyboard:!1,fullInitialization:!0};b.initialized=0;b.build=__BUILD__;b.version="2.0";b.helpURL="http://help.keyman.com/go";window.KeymanWeb=b;var a=b.util={},h=b.osk={ready:!1};b.ui={};b.setDefaultDeviceOptions=function(){};
|
||||
b.getStyleSheetPath=function(b){return b};b.getKeyboardPath=function(b){return b};b.KC_=function(){return""};b.handleRotationEvents=function(){};b.alignInputs=function(){};b.refreshElementContent=null;h.highlightSubKeys=function(){};h.createKeyTip=function(){};h.optionKey=function(){};h.showKeyTip=function(){};h.registerPopup=function(){return!1};h.waitForFonts=function(){return!0};b.options={root:"",resources:"",keyboards:"",fonts:"",attachType:"",ui:null};a.events=[];a.currentEvents=[];h=document.getElementsByTagName("script");
|
||||
|
|
@ -231,16 +231,16 @@ d.top;a._DivVKbd&&(b.width=a.width,b.height=a.height);h.saveCookie("KeymanWeb_On
|
|||
"block")},1E3)):g.pending&&(c[1].innerHTML="",g.pending=!1,g.style.display="none")}};b.getStyleSheetPath=function(a){return h.getOption("resources")+"osk/"+a};b.getKeyboardPath=function(a){return(/^(([.]\/)|([.][.]\/)|(\/))|(:)/.test(a)?"":b.options.keyboards)+a};b.keyboardUnavailable=function(a){return window.setTimeout(function(){h.wait(!1);var g=b._KeyboardStubs[a],c=g.KN,g=g.KL,c=c.replace(/\s*keyboard\s*/i,"");h.alert("Sorry, the "+c+" keyboard for "+g+" is not currently available!",b.setDfltKeyboard);
|
||||
0<a&&(g=b._KeyboardStubs[0],b._SetActiveKeyboard(g.KI,g.KLC,!0))},1E4)};b.KC_=function(a,g,c){var d,e=c.body?c:c.ownerDocument;if(i.touchable)return b.getTextBeforeCaret(c)._kmwSubstr(-a)._kmwSubstr(0,g);if(b.legacy)return c.value._kmwSubstr(c.length-a,g);if(e&&(d=e.defaultView)&&d.getSelection&&("on"==e.designMode.toLowerCase()||"true"==c.contentEditable||"plaintext-only"==c.contentEditable||""===c.contentEditable)){if(c=d.getSelection(),3==c.focusNode.nodeType)return c.focusOffset>2*a?c.focusNode.substringData(c.focusOffset-
|
||||
2*a,2*a)._kmwSubstr(-a)._kmwSubstr(0,g):c.focusNode.substringData(0,c.focusOffset)._kmwSubstr(-a)._kmwSubstr(0,g)}else{if(c.setSelectionRange){if(c._KeymanWebSelectionStart)d=c._KeymanWebSelectionStart;else{if(null===b._CachedSelectionStart||c.selectionStart!==b._LastCachedSelection)b._LastCachedSelection=c.selectionStart,b._CachedSelectionStart=c.value._kmwCodeUnitToCodePoint(c.selectionStart),b._CachedSelectionEnd=c.value._kmwCodeUnitToCodePoint(c.selectionEnd);d=b._CachedSelectionStart}return d<
|
||||
a?c.value._kmwSubstr(0,d):c.value._kmwSubstring(d-a,d-a+g)}if(e&&(d=e.selection))return c=d.createRange(),c.moveStart("character",-2*a),c.text._kmwSubstr(-a)._kmwSubstring(0,g)}return""};b.alignInputs=function(a){if(i.touchable)for(var g=0;g<b.inputList.length;g++)a?(b.updateInput(b.inputList[g]),b.inputList[g].style.visibility="visible",0<b.inputList[g].base.textContent.length&&(b.inputList[g].base.style.visibility="hidden")):(b.inputList[g].style.visibility="hidden",b.inputList[g].base.style.visibility=
|
||||
"visible")};a.highlightSubKeys=function(b,g,c){if(!(null==b||null==b.subKeys)){var d,e,f,i,k,m,o,l=document.getElementById("kmw-popup-keys");5<a.touchY-c&&null==l&&(a.subkeyDelayTimer&&window.clearTimeout(a.subkeyDelayTimer),a.showSubKeys(b),l=document.getElementById("kmw-popup-keys"));for(d=0;d<b.subKeys.length;d++)try{e=l.childNodes[d].firstChild,f=h._GetAbsoluteX(e),i=h._GetAbsoluteY(e),k=f+e.offsetWidth,m=i+e.offsetHeight,o=g>f&&g<k&&c>i&&c<m,a.highlightKey(e,o),o&&a.highlightKey(b,!1)}catch(p){}}};
|
||||
a.optionKey=function(h,g,c){c&&(0<=g.indexOf("K_LOPT")?a.showLanguageMenu():0<=g.indexOf("K_ROPT")&&(b._IsActivatingKeymanWebUI=0,a._Hide(!0),b.hideCaret(),b._LastActiveElement=0))};a.createKeyTip=function(){"phone"==i.formFactor&&(null==a.keytip&&(a.keytip=h._CreateElement("DIV"),a.keytip.className="kmw-keytip",a.keytip.id="kmw-keytip",a.keytip.style.pointerEvents="none",a.keytip.appendChild(h._CreateElement("CANVAS")),a.keytip.appendChild(h._CreateElement("SPAN")),a.keytip.key=null,a.keytip.state=
|
||||
!1),a._Box.appendChild(a.keytip))};a.showKeyTip=function(b,g){var c=a.keytip;if(!(null==c||b==c.key&&g==c.state)){var d=document.getElementById("kmw-popup-keys"),d=d&&"visible"==d.style.visibility;if(g&&!d){for(var e=h._GetAbsoluteY(a._Box),f=a._Box.offsetHeight,d=h._GetAbsoluteX(b),i=h._GetAbsoluteY(b),k=b.offsetWidth,m=b.offsetHeight,o=b.firstChild,l=c.style,p=c.childNodes[1],q=p.style,w=0,t=c.firstChild,s=0;s<b.childNodes.length&&!(o=b.childNodes[s],a.hasClass(o,"kmw-key-text"));s++);t.width=1.6*
|
||||
k;t.height=2.3*m;l.top="auto";l.bottom=e+f-i-m+"px";l.textAlign="center";l.overflow="visible";l.fontFamily=h.getStyleValue(o,"font-family");l.width=t.width+"px";l.height=t.height+"px";e=h.getStyleInt(o,"font-size");0!=e&&(l.fontSize=1.8*e+"px");p.textContent=o.textContent;q.display="block";q.position="absolute";q.textAlign="center";q.width="100%";q.top="2%";q.bottom="auto";o=(t.width-k)/2;d<o?(w=-1,d+=o):d>window.innerWidth-k-o&&(w=1,d-=o);a.drawPreview(t,k,m,w);l.left=d-o+"px";l.display="block"}else c.style.display=
|
||||
"none";c.key=b;c.state=g}};a.drawPreview=function(a,b,c,d){var c=a.getContext("2d"),e=(a.width-b)/2,f=a.height,h=0,k=e,m=b+e,b=b+2*e,o=0.5*f,l=0.6*f,p=8;"Android"==i.OS&&(p=3);switch(d){case -1:k-=e;m-=e;b-=e;break;case 1:h+=e,k+=e,m+=e}c.clearRect(0,0,a.width,a.height);"Android"==i.OS?(k=m=(k+m)/2,c.fillStyle="#999"):c.fillStyle="#ffffff";c.lineWidth="1";c.strokeStyle="#cccccc";c.save();c.beginPath();c.moveTo(h+p,0);c.arcTo(b,0,b,p,p);"Android"==i.OS?(c.arcTo(b,o,m,l,p),c.arcTo(m,l,k,l,p)):(c.arcTo(b,
|
||||
o,m,l,p),c.arcTo(m,l,m-p,f,p),c.arcTo(m,f,k,f,p),c.arcTo(k,f,k,l-p,p));c.arcTo(k,l,h,o-p,p);c.arcTo(h,o,h,p,p);c.arcTo(h,0,h+p,0,p);c.fill();c.stroke();c.restore()};a.addCallout=function(b){if("phone"!=i.formFactor||"iOS"!=i.OS)return null;var g=h._CreateElement("DIV"),c=g.style;g.id="kmw-popup-callout";a._Box.appendChild(g);var d=b.offsetLeft,e=b.offsetWidth,f=b.offsetHeight;c.top=b.offsetTop-6+"px";c.left=d+"px";c.width=e+"px";c.height=f+6+"px";return g};b.handleRotationEvents=function(){"iOS"==
|
||||
i.OS&&h.attachDOMEvent(window,"orientationchange",b.rotateDevice);"Android"==i.OS&&(a.wasVisible=a.isVisible,"onmozorientationchange"in screen?h.attachDOMEvent(screen,"mozorientationchange",a.hideNow):h.attachDOMEvent(window,"orientationchange",a.hideNow),h.attachDOMEvent(window,"resize",function(){b.alignInputs(!0);a.hideLanguageList();a._Load();a.wasVisible&&a._Show()}))};b.rotateDevice=function(){a.hideLanguageList();a._Visible&&(a.adjustHeights(),"phone"==i.formFactor&&"Android"==i.OS&&window.setTimeout(function(){window.scrollTo(0,
|
||||
1)},1E3))};a.waitForFonts=function(a,g){if("undefined"==typeof a&&"undefined"==typeof g||"undefined"==typeof a.files&&"undefined"==typeof g.files)return!0;var c=h.checkFontDescriptor(a),d=h.checkFontDescriptor(g);if(c&&d)return!0;b.fontCheckTimer=window.setInterval(function(){h.checkFontDescriptor(a)&&h.checkFontDescriptor(g)&&(window.clearInterval(b.fontCheckTimer),b.fontCheckTimer=null,b.alignInputs(!0))},100);window.setTimeout(function(){b.fontCheckTimer&&(window.clearInterval(b.fontCheckTimer),
|
||||
b.fontCheckTimer=null,b.alignInputs(!0))},5E3);return!1}})();(function(){var b=window.tavultesoft.keymanweb,a=b.util,h=b.osk,i=a.device;b.TSS_LAYER=33;b.TSS_PLATFORM=31;b._BeepObjects=[];b._BeepTimeout=0;b.KSF=b.KSF=function(){b._IgnoreNextSelChange=1};b.KT=b.KT=function(a,g){b.cachedContext.reset();var c=b._LastActiveElement,d,e,f;d=!1;null!=c&&(d=c._KeymanWebSelectionStart,e=c._KeymanWebSelectionEnd,f=b._Selection,b._IsActivatingKeymanWebUI=1,b._IgnoreNextSelChange=100,b._FocusLastActiveElement(),b._IsMozillaEditableIframe(c,0)&&(c=c.documentElement),document.selection&&
|
||||
a?(Array(a-d+1).join("\ufffe")+c.value._kmwSubstr(0,d))._kmwSubstr(0,g):c.value._kmwSubstring(d-a,d-a+g)}if(e&&(d=e.selection))return c=d.createRange(),c.moveStart("character",-2*a),c.text._kmwSubstr(-a)._kmwSubstring(0,g)}return""};b.alignInputs=function(a){if(i.touchable)for(var g=0;g<b.inputList.length;g++)a?(b.updateInput(b.inputList[g]),b.inputList[g].style.visibility="visible",0<b.inputList[g].base.textContent.length&&(b.inputList[g].base.style.visibility="hidden")):(b.inputList[g].style.visibility=
|
||||
"hidden",b.inputList[g].base.style.visibility="visible")};a.highlightSubKeys=function(b,g,c){if(!(null==b||null==b.subKeys)){var d,e,f,i,k,m,o,l=document.getElementById("kmw-popup-keys");5<a.touchY-c&&null==l&&(a.subkeyDelayTimer&&window.clearTimeout(a.subkeyDelayTimer),a.showSubKeys(b),l=document.getElementById("kmw-popup-keys"));for(d=0;d<b.subKeys.length;d++)try{e=l.childNodes[d].firstChild,f=h._GetAbsoluteX(e),i=h._GetAbsoluteY(e),k=f+e.offsetWidth,m=i+e.offsetHeight,o=g>f&&g<k&&c>i&&c<m,a.highlightKey(e,
|
||||
o),o&&a.highlightKey(b,!1)}catch(p){}}};a.optionKey=function(h,g,c){c&&(0<=g.indexOf("K_LOPT")?a.showLanguageMenu():0<=g.indexOf("K_ROPT")&&(b._IsActivatingKeymanWebUI=0,a._Hide(!0),b.hideCaret(),b._LastActiveElement=0))};a.createKeyTip=function(){"phone"==i.formFactor&&(null==a.keytip&&(a.keytip=h._CreateElement("DIV"),a.keytip.className="kmw-keytip",a.keytip.id="kmw-keytip",a.keytip.style.pointerEvents="none",a.keytip.appendChild(h._CreateElement("CANVAS")),a.keytip.appendChild(h._CreateElement("SPAN")),
|
||||
a.keytip.key=null,a.keytip.state=!1),a._Box.appendChild(a.keytip))};a.showKeyTip=function(b,g){var c=a.keytip;if(!(null==c||b==c.key&&g==c.state)){var d=document.getElementById("kmw-popup-keys"),d=d&&"visible"==d.style.visibility;if(g&&!d){for(var e=h._GetAbsoluteY(a._Box),f=a._Box.offsetHeight,d=h._GetAbsoluteX(b),i=h._GetAbsoluteY(b),k=b.offsetWidth,m=b.offsetHeight,o=b.firstChild,l=c.style,p=c.childNodes[1],q=p.style,w=0,t=c.firstChild,s=0;s<b.childNodes.length&&!(o=b.childNodes[s],a.hasClass(o,
|
||||
"kmw-key-text"));s++);t.width=1.6*k;t.height=2.3*m;l.top="auto";l.bottom=e+f-i-m+"px";l.textAlign="center";l.overflow="visible";l.fontFamily=h.getStyleValue(o,"font-family");l.width=t.width+"px";l.height=t.height+"px";e=h.getStyleInt(o,"font-size");0!=e&&(l.fontSize=1.8*e+"px");p.textContent=o.textContent;q.display="block";q.position="absolute";q.textAlign="center";q.width="100%";q.top="2%";q.bottom="auto";o=(t.width-k)/2;d<o?(w=-1,d+=o):d>window.innerWidth-k-o&&(w=1,d-=o);a.drawPreview(t,k,m,w);
|
||||
l.left=d-o+"px";l.display="block"}else c.style.display="none";c.key=b;c.state=g}};a.drawPreview=function(a,b,c,d){var c=a.getContext("2d"),e=(a.width-b)/2,f=a.height,h=0,k=e,m=b+e,b=b+2*e,o=0.5*f,l=0.6*f,p=8;"Android"==i.OS&&(p=3);switch(d){case -1:k-=e;m-=e;b-=e;break;case 1:h+=e,k+=e,m+=e}c.clearRect(0,0,a.width,a.height);"Android"==i.OS?(k=m=(k+m)/2,c.fillStyle="#999"):c.fillStyle="#ffffff";c.lineWidth="1";c.strokeStyle="#cccccc";c.save();c.beginPath();c.moveTo(h+p,0);c.arcTo(b,0,b,p,p);"Android"==
|
||||
i.OS?(c.arcTo(b,o,m,l,p),c.arcTo(m,l,k,l,p)):(c.arcTo(b,o,m,l,p),c.arcTo(m,l,m-p,f,p),c.arcTo(m,f,k,f,p),c.arcTo(k,f,k,l-p,p));c.arcTo(k,l,h,o-p,p);c.arcTo(h,o,h,p,p);c.arcTo(h,0,h+p,0,p);c.fill();c.stroke();c.restore()};a.addCallout=function(b){if("phone"!=i.formFactor||"iOS"!=i.OS)return null;var g=h._CreateElement("DIV"),c=g.style;g.id="kmw-popup-callout";a._Box.appendChild(g);var d=b.offsetLeft,e=b.offsetWidth,f=b.offsetHeight;c.top=b.offsetTop-6+"px";c.left=d+"px";c.width=e+"px";c.height=f+6+
|
||||
"px";return g};b.handleRotationEvents=function(){"iOS"==i.OS&&h.attachDOMEvent(window,"orientationchange",b.rotateDevice);"Android"==i.OS&&(a.wasVisible=a.isVisible,"onmozorientationchange"in screen?h.attachDOMEvent(screen,"mozorientationchange",a.hideNow):h.attachDOMEvent(window,"orientationchange",a.hideNow),h.attachDOMEvent(window,"resize",function(){b.alignInputs(!0);a.hideLanguageList();a._Load();a.wasVisible&&a._Show()}))};b.rotateDevice=function(){a.hideLanguageList();a._Visible&&(a.adjustHeights(),
|
||||
"phone"==i.formFactor&&"Android"==i.OS&&window.setTimeout(function(){window.scrollTo(0,1)},1E3))};a.waitForFonts=function(a,g){if("undefined"==typeof a&&"undefined"==typeof g||"undefined"==typeof a.files&&"undefined"==typeof g.files)return!0;var c=h.checkFontDescriptor(a),d=h.checkFontDescriptor(g);if(c&&d)return!0;b.fontCheckTimer=window.setInterval(function(){h.checkFontDescriptor(a)&&h.checkFontDescriptor(g)&&(window.clearInterval(b.fontCheckTimer),b.fontCheckTimer=null,b.alignInputs(!0))},100);
|
||||
window.setTimeout(function(){b.fontCheckTimer&&(window.clearInterval(b.fontCheckTimer),b.fontCheckTimer=null,b.alignInputs(!0))},5E3);return!1}})();(function(){var b=window.tavultesoft.keymanweb,a=b.util,h=b.osk,i=a.device;b.TSS_LAYER=33;b.TSS_PLATFORM=31;b._BeepObjects=[];b._BeepTimeout=0;b.KSF=b.KSF=function(){b._IgnoreNextSelChange=1};b.KT=b.KT=function(a,g){b.cachedContext.reset();var c=b._LastActiveElement,d,e,f;d=!1;null!=c&&(d=c._KeymanWebSelectionStart,e=c._KeymanWebSelectionEnd,f=b._Selection,b._IsActivatingKeymanWebUI=1,b._IgnoreNextSelChange=100,b._FocusLastActiveElement(),b._IsMozillaEditableIframe(c,0)&&(c=c.documentElement),document.selection&&
|
||||
null!=f&&f.select(),c._KeymanWebSelectionStart=d,c._KeymanWebSelectionEnd=e,b._IgnoreNextSelChange=0,null!=a&&b.KO(0,c,a),"undefined"!=typeof g&&b.KDO(0,c,g),c._KeymanWebSelectionStart=null,c._KeymanWebSelectionEnd=null,d=!0);return d};b.KR=b.KR=function(j){b.loadTimer&&j.KI==b._LoadingInternalName&&(window.clearTimeout(b.loadTimer),b.loadTimer=null);if(b.initialized){var g,c=b._ActiveStub;if(!c||!("KI"in c)||c.KI!=j.KI)for(g=0;g<b._KeyboardStubs.length;g++){c=b._KeyboardStubs[g];if(j.KI==c.KI)break;
|
||||
c=null}null==b._ActiveStub&&null!=c&&(b._ActiveStub=c);for(g=0;g<b._Keyboards.length;g++)if(j.KI==b._Keyboards[g].KI)return;b._Keyboards=b._push(b._Keyboards,j);b._LoadingInternalName==j.KI&&(b.doBeforeKeyboardChange(j.KI,c.KLC),b._ActiveKeyboard=j,null!=b._LastActiveElement&&(b._JustActivatedKeymanWebUI=1,b._SetTargDir(b._LastActiveElement)),b._LoadingInternalName=null,j.KL="undefined"!=typeof c.KL?c.KL:"",j.KLC="undefined"!=typeof c.KLC?c.KLC:"",j.KR="undefined"!=typeof c.KR?c.KR:"",j.KRC="undefined"!=
|
||||
typeof c.KRC?c.KRC:"",j.KC="undefined"!=typeof c.KC?c.KC:"",j.KCC="undefined"!=typeof c.KCC?c.KCC:"",j.KD="undefined"!=typeof c.KD?c.KD:"",j.KS="undefined"!=typeof c.KS?c.KS:0,String.kmwEnableSupplementaryPlane(c&&(c.KS&&1==c.KS||"Hieroglyphic"==j.KN)),b.saveCurrentKeyboard(j.KI,c.KLC),h._Load(),"function"==typeof a.wait&&a.wait(!1));b.doKeyboardLoaded(j.KI)}else b.deferredKR.push(j)};b.KRS=b.KRS=function(a){var g;if(b.initialized){null==b.dfltStub&&(b.dfltStub=a);"undefined"==typeof a.KLC&&(a.KLC=
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
402
|
||||
403
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue