Overview
Comment:Mise à jour dépendance éditeur de texte
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk | stable
Files: files | file ages | folders
SHA1: cf42e13369075c5982663f2224bcb5bfcadade42
User & Date: bohwaz on 2019-10-06 21:08:53
Other Links: manifest | tags
Context
2019-10-06
21:32
Mise à jour scripts minifiés check-in: 31850bf084 user: bohwaz tags: trunk
21:08
Mise à jour dépendance éditeur de texte check-in: cf42e13369 user: bohwaz tags: trunk, stable
21:07
Ajouter le suffixe de version pour les scripts et CSS chargés dynamiquement check-in: d8b1c1638c user: bohwaz tags: trunk
Changes

Modified src/www/admin/static/scripts/code_editor.min.js from [89cf1ff3b6] to [265e7b62f2].

cannot compute difference between binary files

Modified src/www/admin/static/scripts/text_editor.min.js from [1c434850a5] to [757efe7963].

1
(function(){window.textEditor=function(a){if(!document.getElementById(a))throw new Error("Invalid ID parameter: "+a);this.id=a;this.textarea=document.getElementById(a);this.shortcuts=[];this._key_map={8:'backspace',9:'tab',13:'enter',16:'shift',17:'ctrl',18:'alt',20:'capslock',27:'esc',32:'space',33:'pageup',34:'pagedown',35:'end',36:'home',37:'left',38:'up',39:'right',40:'down',45:'ins',46:'del',91:'meta',93:'meta',224:'meta',106:false,107:false,109:false,110:false,111:false,186:false,187:false,188:false,189:false,190:false,191:false,192:false,219:false,220:false,221:false,222:false};for(var b=1;b<20;++b)this._key_map[111+b]='f'+b;for(b=0;b<=9;++b)this._key_map[b+96]=b;this.preventKeyPress=false;this.textarea.addEventListener('keydown',this.keyEvent.bind(this),true);this.textarea.addEventListener('keypress',this.keyEvent.bind(this),true);};textEditor.prototype.keyEvent=function(a){var a=a||window.event;if(this.preventKeyPress&&a.type=='keypress'){this.preventKeyPress=false;return this.preventDefault(a);}for(var b in this.shortcuts){var c=this.shortcuts[b];if(a.metaKey)continue;if((a.ctrlKey&&!c.ctrl)||(c.ctrl&&!a.ctrlKey))continue;if((a.shiftKey&&!c.shift)||(c.shift&&!a.shiftKey))continue;if((a.altKey&&!c.alt)||(c.alt&&!a.altKey))continue;if(!(b=this.matchKeyPress(c.key,a)))continue;if(typeof c.callback!='function'){var d=(c.ctrl?'Ctrl-':'')+(c.alt?'Alt-':'');d+=(c.shift?'Shift-':'')+c;throw new Error("Invalid callback type for shortcut "+d);}var e=c.callback.call(this,a,b);if(a.type=='keydown'&&e)this.preventKeyPress=true;return e?this.preventDefault(a):true;}return true;};textEditor.prototype.matchKeyPress=function(a,b){if(b.which==null)var c=b.keyCode;else if(b.which!=0&&b.charCode!=0)var c=b.charCode;else return false;if(this._key_map[c]==a)return true;else if(a.toUpperCase()==String.fromCharCode(c).toUpperCase())return true;else return false;};textEditor.prototype.preventDefault=function(a){if(a.preventDefault)a.preventDefault();if(a.stopPropagation)a.stopPropagation();a.returnValue=false;a.cancelBubble=true;return false;};textEditor.prototype.getSelection=function(){var a=this.textarea;if('selectionStart' in a){var b=a.selectionEnd-a.selectionStart;return{start:a.selectionStart,end:a.selectionEnd,length:b,text:a.value.substr(a.selectionStart,b)};}else if(document.selection){a.focus();var c=document.selection.createRange();var d=a.createTextRange();var e=d.duplicate();e.moveToBookmark(c.getBookmark());d.setEndPoint('EndToStart',e);if(c==null||d==null)return{start:a.value.length,end:a.value.length,length:0,text:''};var f=c.text.replace(/[\r\n]/g,'.');var g=a.value.replace(/[\r\n]/g,'.');var h=g.indexOf(f,d.text.length);return{start:h,end:h+f.length,length:f.length,text:c.text};}else return{start:a.value.length,end:a.value.length,length:0,text:''};};textEditor.prototype.replaceSelection=function(a,b){var c=this.textarea;var d=a.start;var e=d+b.length;c.value=c.value.substr(0,d)+b+c.value.substr(a.end,c.value.length);this.setSelection(d,e);return{start:d,end:e,length:b.length,text:b};};textEditor.prototype.insertAtPosition=function(a,b,c){var d=a+b.length;var e=this.textarea;e.value=e.value.substr(0,a)+b+e.value.substr(a,e.value.length-a);if(!c)c=d;return this.setSelection(c,c);};textEditor.prototype.setSelection=function(a,b){var c=this.textarea;if('selectionStart' in c){c.focus();c.selectionStart=a;c.selectionEnd=b;}else if(document.selection){c.focus();var d=c.createTextRange();var e=a;for(i=0;i<e;i++)if(c.value[i].search(/[\r\n]/)!=-1)a=a-.5;e=b;for(i=0;i<e;i++)if(c.value[i].search(/[\r\n]/)!=-1)b=b-.5;d.moveEnd('textedit',-1);d.moveStart('character',a);d.moveEnd('character',b-a);d.select();}return this.getSelection();};textEditor.prototype.scrollToSelection=function(a){var b=this.textarea;var c=b.value.substr(a.end);b.value=b.value.substr(0,a.end);b.scrollTop=100000;var d=b.scrollTop;b.value+=c;b.scrollTop=d;this.setSelection(a.start,a.end);};textEditor.prototype.wrapSelection=function(a,b,c){var d=this.textarea;var e=d.scrollTop;var f=a.text;var a=this.replaceSelection(a,b+f+c);if(f=='')a=this.setSelection(a.start+b.length,a.start+b.length);d.scrollTop=e;return a;};}());
|
1
(function(){window.textEditor=function(a){if(!document.getElementById(a))throw new Error("Invalid ID parameter: "+a);this.id=a;this.textarea=document.getElementById(a);this.shortcuts=[];if(!('selectionStart' in this.textarea))return false;this.textarea.addEventListener('keydown',this.keyEvent.bind(this),true);this.textarea.addEventListener('keypress',this.keyEvent.bind(this),true);return true;};textEditor.prototype.keyEvent=function(a){var a=a||window.event;for(var b in this.shortcuts){var c=this.shortcuts[b];if(a.metaKey)continue;if((a.ctrlKey&&!c.ctrl)||(c.ctrl&&!a.ctrlKey))continue;if((a.shiftKey&&!c.shift)||(c.shift&&!a.shiftKey))continue;if((a.altKey&&!c.alt)||(c.alt&&!a.altKey))continue;if(!(b=this.matchKeyPress(c.key,a)))continue;if(typeof c.callback!='function'){var d=(c.ctrl?'Ctrl-':'')+(c.alt?'Alt-':'');d+=(c.shift?'Shift-':'')+c;throw new Error("Invalid callback type for shortcut "+d);}var e=c.callback.call(this,a,b);return e?this.preventDefault(a):true;}return true;};textEditor.prototype.matchKeyPress=function(a,b){if(b.defaultPrevented||!b.key)return false;a=a.toLowerCase();return(b.key.toLowerCase()==a)?a:false;};textEditor.prototype.preventDefault=function(a){if(a.preventDefault)a.preventDefault();if(a.stopPropagation)a.stopPropagation();if(a.stopImmediatePropagation)a.stopImmediatePropagation();a.returnValue=false;a.cancelBubble=true;return false;};textEditor.prototype.getSelection=function(){var a=this.textarea;var b=a.selectionEnd-a.selectionStart;return{start:a.selectionStart,end:a.selectionEnd,length:b,text:a.value.substr(a.selectionStart,b)};};textEditor.prototype.replaceSelection=function(a,b){var c=this.textarea;var d=a.start;var e=d+b.length;c.value=c.value.substr(0,d)+b+c.value.substr(a.end,c.value.length);this.setSelection(d,e);return{start:d,end:e,length:b.length,text:b};};textEditor.prototype.insertAtPosition=function(a,b,c){var d=a+b.length;var e=this.textarea;e.value=e.value.substr(0,a)+b+e.value.substr(a,e.value.length-a);if(!c)c=d;return this.setSelection(c,c);};textEditor.prototype.setSelection=function(a,b){var c=this.textarea;c.focus();c.selectionStart=a;c.selectionEnd=b;return this.getSelection();};textEditor.prototype.scrollToSelection=function(a){var b=this.textarea;var c=b.value.substr(a.end);b.value=b.value.substr(0,a.end);b.scrollTop=100000;var d=b.scrollTop;b.value+=c;b.scrollTop=d;this.setSelection(a.start,a.end);};textEditor.prototype.wrapSelection=function(a,b,c){var d=this.textarea;var e=d.scrollTop;var f=a.text;var a=this.replaceSelection(a,b+f+c);if(f=='')a=this.setSelection(a.start+b.length,a.start+b.length);d.scrollTop=e;return a;};}());