MediaWiki:Gadget-edit-form.js
Uwaga: aby zobaczyć zmiany po opublikowaniu, może zajść potrzeba wyczyszczenia pamięci podręcznej przeglądarki.
- Firefox / Safari: Przytrzymaj Shift podczas klikania Odśwież bieżącą stronę, lub naciśnij klawisze Ctrl+F5, lub Ctrl+R (⌘-R na komputerze Mac)
- Google Chrome: Naciśnij Ctrl-Shift-R (⌘-Shift-R na komputerze Mac)
- Internet Explorer / Edge: Przytrzymaj Ctrl, jednocześnie klikając Odśwież, lub naciśnij klawisze Ctrl+F5
- Opera: Naciśnij klawisze Ctrl+F5.
// adaptacja projektu formularza [[Wikipedysta:ToSter/ed.onefile.js]] autorstwa [[User:ToSter]]
var Ed, EUtil, EUi, EKeyboard, EApi, EAutomator, EConstants, EStr, EParser,
ESectionParser, ESpecialChars, EPrinter;
Ed = {
code: '',
content: {},
parseContentToSections: function() {
Ed.content.sections = EParser.getSections( Ed.code );
},
parseSectionsToSubsections: function() {
var id, sec;
for ( id in Ed.content.sections ) {
if ( Ed.content.sections.hasOwnProperty( id ) ) {
sec = Ed.content.sections[ id ];
ESectionParser.parse( sec );
}
}
},
init: function() {
var tbox, oldform;
EConstants.init();
tbox = $( '#wpTextbox1' );
oldform = $( '.wikiEditor-ui' );
if ( !tbox.length || !oldform.length ) {
return;
}
Ed.code = tbox.textSelection( 'getContents' );
Ed.parseContentToSections();
Ed.parseSectionsToSubsections();
EUi.prepareForm( oldform, tbox );
},
resetNew: function() {
var tbox = $( '#wpTextbox1' );
Ed.content = {};
Ed.code = tbox.textSelection( 'getContents' );
Ed.parseContentToSections();
Ed.parseSectionsToSubsections();
EUi.reset();
}
};
mw.libs.editForm = {
Ed: Ed, EUtil: EUtil, EUi: EUi, EKeyboard: EKeyboard, EApi: EApi,
EAutomator: EAutomator, EConstants: EConstants, EStr: EStr, EParser: EParser,
ESectionParser: ESectionParser, ESpecialChars: ESpecialChars, EPrinter: EPrinter
};