forked from Botanical/BotanJS
Vim Init
This commit is contained in:
parent
9e0af1531f
commit
6674931273
@ -23,6 +23,8 @@
|
||||
var Uploader = __import( "Astro.Blog.AstroEdit.Uploader" );
|
||||
/** @type {Astro.Blog.AstroEdit.SiteLibrary} */
|
||||
var SiteLibrary = __import( "Astro.Blog.AstroEdit.SiteLibrary" );
|
||||
/** @type {Components.Vim.VimArea} */
|
||||
var VimArea = __import( "Components.Vim.VimArea" );
|
||||
|
||||
// calls the smart bar
|
||||
var SmartInput = __import( "Astro.Blog.AstroEdit.SmartInput" );
|
||||
@ -100,6 +102,35 @@
|
||||
Dand.id( "ae_drop_btn" ).onclick = function () { article.drop(); };;
|
||||
|
||||
adjustLayout();
|
||||
|
||||
VimTrigger();
|
||||
};
|
||||
|
||||
var VimTrigger = function()
|
||||
{
|
||||
var f10Binding = function ( e )
|
||||
{
|
||||
e = e || window.event;
|
||||
if ( e.keyCode ) code = e.keyCode;
|
||||
else if ( e.which ) code = e.which;
|
||||
|
||||
if ( code == 121 )
|
||||
{
|
||||
e.preventDefault();
|
||||
var node = document.activeElement;
|
||||
if( node.nodeName == "TEXTAREA" )
|
||||
{
|
||||
new VimArea( node );
|
||||
node.blur();
|
||||
node.focus();
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
//Attach the var with the event = function
|
||||
if(document.addEventListener) document.addEventListener('keydown', f10Binding, false);
|
||||
else if(document.attachEvent) document.attachEvent('onkeydown', f10Binding);
|
||||
else document.onkeydown = f10Binding;
|
||||
};
|
||||
|
||||
var adjustLayout = function ()
|
||||
|
Loading…
Reference in New Issue
Block a user