// install ] in-browser text editor
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js'
+ '&action=raw&ctype=text/javascript');
/*
== Ki/bekapcsoló függvények ==
*/
// switch off wikEd frame
window.switchOffWikEd = function switchOffWikEd() {
if ( typeof wikEd === 'object' && wikEd.useWikEd === true ) {
var marker_start = '####wiked_cursor_marker_start####';
var marker_end = '####wiked_cursor_marker_end####';
try {
insertTags( marker_start, marker_end, '' );
} catch ( err ) {}
wikEd.UpdateTextarea();
wikEd.SetEditArea( false );
wikEd.useWikEd = false;
wikEd.SetPersistent( 'wikEdUseClassic', '1', 0, '/' );
wikEd.switchOff = true;
var tb = $( '#wpTextbox1' );
var tbSelectionStart = tb.value.indexOf( marker_start );
tb.value = tb.value.replace( marker_start, '' );
var tbSelectionEnd = tb.value.indexOf( marker_end );
tb.value = tb.value.replace( marker_end, '' );
tb.selectionStart = tbSelectionStart;
tb.selectionEnd = tbSelectionEnd;
}
};
/* switch on wikEd frame */
window.switchOnWikEd = function switchOnWikEd() {
if ( typeof wikEd === 'object' && wikEd.switchOff === true ) {
wikEd.UpdateFrame();
wikEd.SetEditArea( true );
wikEd.useWikEd = true;
wikEd.SetPersistent( 'wikEdUseClassic', '0', 0, '/' );
wikEd.ExecuteHook( wikEd.config.frameHook );
wikEd.switchOff = false;
}
};