src/myams/resources/js/ext/ace/ext-keybinding_menu.min.js
changeset 0 f05d7aea098a
child 5 c9c69b13d884
equal deleted inserted replaced
-1:000000000000 0:f05d7aea098a
       
     1 ace.define("ace/ext/menu_tools/overlay_page",["require","exports","module","ace/lib/dom"],function(e,o,t){"use strict";var l=e("../../lib/dom");l.importCssString("#ace_settingsmenu, #kbshortcutmenu {background-color: #F7F7F7;color: black;box-shadow: -5px 4px 5px rgba(126, 126, 126, 0.55);padding: 1em 0.5em 2em 1em;overflow: auto;position: absolute;margin: 0;bottom: 0;right: 0;top: 0;z-index: 9991;cursor: default;}.ace_dark #ace_settingsmenu, .ace_dark #kbshortcutmenu {box-shadow: -20px 10px 25px rgba(126, 126, 126, 0.25);background-color: rgba(255, 255, 255, 0.6);color: black;}.ace_optionsMenuEntry:hover {background-color: rgba(100, 100, 100, 0.1);transition: all 0.3s}.ace_closeButton {background: rgba(245, 146, 146, 0.5);border: 1px solid #F48A8A;border-radius: 50%;padding: 7px;position: absolute;right: -8px;top: -8px;z-index: 100000;}.ace_closeButton{background: rgba(245, 146, 146, 0.9);}.ace_optionsMenuKey {color: darkslateblue;font-weight: bold;}.ace_optionsMenuCommand {color: darkcyan;font-weight: normal;}.ace_optionsMenuEntry input, .ace_optionsMenuEntry button {vertical-align: middle;}.ace_optionsMenuEntry button[ace_selected_button=true] {background: #e7e7e7;box-shadow: 1px 0px 2px 0px #adadad inset;border-color: #adadad;}.ace_optionsMenuEntry button {background: white;border: 1px solid lightgray;margin: 0px;}.ace_optionsMenuEntry button:hover{background: #f0f0f0;}"),t.exports.overlayPage=function(e,o,t,n,r,a){function i(e){27===e.keyCode&&c.click()}t=t?"top: "+t+";":"",r=r?"bottom: "+r+";":"",n=n?"right: "+n+";":"",a=a?"left: "+a+";":"";var c=document.createElement("div"),d=document.createElement("div");c.style.cssText="margin: 0; padding: 0; position: fixed; top:0; bottom:0; left:0; right:0;z-index: 9990; background-color: rgba(0, 0, 0, 0.3);",c.addEventListener("click",function(){document.removeEventListener("keydown",i),c.parentNode.removeChild(c),e.focus(),c=null}),document.addEventListener("keydown",i),d.style.cssText=t+n+r+a,d.addEventListener("click",function(e){e.stopPropagation()});var s=l.createElement("div");s.style.position="relative";var u=l.createElement("div");u.className="ace_closeButton",u.addEventListener("click",function(){c.click()}),s.appendChild(u),d.appendChild(s),d.appendChild(o),c.appendChild(d),document.body.appendChild(c),e.blur()}}),ace.define("ace/ext/menu_tools/get_editor_keyboard_shortcuts",["require","exports","module","ace/lib/keys"],function(e,o,t){"use strict";var n=e("../../lib/keys");t.exports.getEditorKeybordShortcuts=function(e){n.KEY_MODS;var a=[],i={};return e.keyBinding.$handlers.forEach(function(e){var o=e.commandKeyBinding;for(var t in o){var n=t.replace(/(^|-)\w/g,function(e){return e.toUpperCase()}),r=o[t];Array.isArray(r)||(r=[r]),r.forEach(function(e){"string"!=typeof e&&(e=e.name),i[e]?i[e].key+="|"+n:(i[e]={key:n,command:e},a.push(i[e]))})}}),a}}),ace.define("ace/ext/keybinding_menu",["require","exports","module","ace/editor","ace/ext/menu_tools/overlay_page","ace/ext/menu_tools/get_editor_keyboard_shortcuts"],function(a,e,o){"use strict";var t=a("ace/editor").Editor;o.exports.init=function(e){t.prototype.showKeyboardShortcuts=function(){!function(e){if(!document.getElementById("kbshortcutmenu")){var o=a("./menu_tools/overlay_page").overlayPage,t=(0,a("./menu_tools/get_editor_keyboard_shortcuts").getEditorKeybordShortcuts)(e),n=document.createElement("div"),r=t.reduce(function(e,o){return e+'<div class="ace_optionsMenuEntry"><span class="ace_optionsMenuCommand">'+o.command+'</span> : <span class="ace_optionsMenuKey">'+o.key+"</span></div>"},"");n.id="kbshortcutmenu",n.innerHTML="<h1>Keyboard Shortcuts</h1>"+r+"</div>",o(e,n,"0","0","0",null)}}(this)},e.commands.addCommands([{name:"showKeyboardShortcuts",bindKey:{win:"Ctrl-Alt-h",mac:"Command-Alt-h"},exec:function(e,o){e.showKeyboardShortcuts()}}])}}),ace.require(["ace/ext/keybinding_menu"],function(e){"object"==typeof module&&"object"==typeof exports&&module&&(module.exports=e)});