This commit is contained in:
斟酌 鵬兄 2016-04-04 01:12:11 +08:00
parent 9e0af1531f
commit 6674931273

View File

@ -23,6 +23,8 @@
var Uploader = __import( "Astro.Blog.AstroEdit.Uploader" ); var Uploader = __import( "Astro.Blog.AstroEdit.Uploader" );
/** @type {Astro.Blog.AstroEdit.SiteLibrary} */ /** @type {Astro.Blog.AstroEdit.SiteLibrary} */
var SiteLibrary = __import( "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 // calls the smart bar
var SmartInput = __import( "Astro.Blog.AstroEdit.SmartInput" ); var SmartInput = __import( "Astro.Blog.AstroEdit.SmartInput" );
@ -100,6 +102,35 @@
Dand.id( "ae_drop_btn" ).onclick = function () { article.drop(); };; Dand.id( "ae_drop_btn" ).onclick = function () { article.drop(); };;
adjustLayout(); 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 () var adjustLayout = function ()