- Destroy all ckeditors
- Set F10 bindings for VimArea
(function() {
if( window[ "CKEDITOR" ] )
Object.values( CKEDITOR.instances ).forEach( x => x.destroy() );
try
{
window.VimArea = BotanJS.import( "Components.Vim.VimArea" );
}
catch( ex )
{
var sc = document.createElement( "script" );
sc.src = "//astrojs.k8s.astropenguin.net/ojs/Components.Vim.VimArea"; // Last modified: 2022.04.19
document.head.appendChild( sc );
}
var _waitf = function()
{
try
{
window.VimArea = BotanJS.import( "Components.Vim.VimArea" );
}
catch( ex )
{
return;
}
clearInterval( _waitf );
window.VimArea = BotanJS.import( "Components.Vim.VimArea" );
var d = BotanJS.import( "Dandelion" );
var f10Binding = function ( e )
{
e = e || window.event;
if ( e.keyCode ) code = e.keyCode;
else if ( e.which ) code = e.which;
if ( code == 121 ) // F10, change this value to any key you like
{
e.preventDefault();
var node = document.activeElement;
if( node.nodeName == "TEXTAREA" )
{
new VimArea( node, true );
}
}
};
if(document.addEventListener) document.addEventListener('keydown', f10Binding, false);
else if(document.attachEvent) document.attachEvent('onkeydown', f10Binding);
else document.onkeydown = f10Binding;
};
var k = setInterval( _waitf, 100 );
} )();
textarea[data-vimarea="1"] {
font-size: 1.5em;
}
/* //s.botanical.astropenguin.net/ocss/Components.Vim.VimArea */