User:Cacycle/wikEd dev.js: Difference between revisions

Content deleted Content added
0.9.91o (functional)
0.9.92 testing
Line 2:
 
// version info
window.wikEdProgramVersion = window.wikEdProgramVersion || '0.9.91o92';
window.wikEdProgramDate = window.wikEdProgramDate || 'AugustSeptember 2312, 2010';
 
/*
Line 59:
 
// user readable texts, copy changes to http://en.wikipedia.org/wiki/User:Cacycle/wikEd_international_en.js, also defined in wikEdDiff.js
if (typeof(wikEdTextwikEdConfig['text']) == 'undefined') { window.wikEdTextwikEdConfig['text'] = {}; }
 
//
// WikEdInitText: define built-in user interface texts
//
 
window.WikEdInitText = function() {
WikEdInitObject(wikEdTextwikEdConfig['text'], {
 
// logo
Line 76 ⟶ 73:
'wikEdLogo browser title': 'Browser not supported - wikEd {wikEdProgramVersion} ({wikEdProgramDate})',
'wikEdLogo incompatible alt': '(wikEd)',
'wikEdLogo incompatible title': 'Incompatible script or gadget: "{wikEdParameter}" - wikEd {wikEdProgramVersion} ({wikEdProgramDate})',
'wikEdLogo disabled alt': '(wikEd)',
'wikEdLogo disabled title': 'Disabled - wikEd {wikEdProgramVersion} ({wikEdProgramDate}) Click to enable',
Line 367 ⟶ 364:
'iconPage': 'All icons and images used by wikEd. Save page as <i>web page, complete</i> to download all files into one folder.<br><br>'
 
}, wikEdConfig['showMissingTranslations']);
}, wikEdShowMissingTranslations);
};
 
Line 374 ⟶ 371:
 
// use local copies of images for testing (set to true in local copy of edit page), also defined in wikEdDiff.js
if (typeof(wikEdUseLocalImageswikEdConfig['useLocalImages']) == 'undefined') { window.wikEdUseLocalImageswikEdConfig['useLocalImages'] = false; }
 
// path to local images for testing, also defined in wikEdDiff.js
if (typeof(wikEdImagePathLocalwikEdConfig['imagePathLocal']) == 'undefined') { window.wikEdImagePathLocalwikEdConfig['imagePathLocal'] = 'file:///D:/wikEd/images/'; }
 
// path to images, also defined in wikEdDiff.js
if (typeof(wikEdImagePathwikEdConfig['imagePath']) == 'undefined') { window.wikEdImagePathwikEdConfig['imagePath'] = 'http://upload.wikimedia.org/wikipedia/commons/'; }
 
// image filenames, also defined in wikEdDiff.js
if (typeof(wikEdImagewikEdConfig['image']) == 'undefined') { window.wikEdImagewikEdConfig['image'] = {}; }
 
// WikedInitImages: define built-in image URLs
window.WikedInitImages = function() {
WikEdInitImage(wikEdImagewikEdConfig['image'], {
'barDash': '5/52/WikEd_bar_dash.png',
'bold': '5/59/WikEd_bold.png',
Line 485 ⟶ 482:
 
// edit-frame css rules
if (typeof(wikEdFrameCSSwikEdConfig['frameCSS']) == 'undefined') { window.wikEdFrameCSSwikEdConfig['frameCSS'] = {}; }
 
// WikedInitFrameCSS: define built-in edit frame css
window.WikedInitFrameCSS = function() {
WikEdInitObject(wikEdFrameCSSwikEdConfig['frameCSS'], {
 
// frame
Line 721 ⟶ 718:
 
// main window css rules
if (typeof(wikEdMainCSSwikEdConfig['mainCSS']) == 'undefined') { window.wikEdMainCSSwikEdConfig['mainCSS'] = {}; }
 
// WikedInitMainCSS: define built-in main window css
window.WikedInitMainCSS = function() {
WikEdInitObject(wikEdMainCSSwikEdConfig['mainCSS'], {
 
// logo
Line 735 ⟶ 732:
 
// main window css rules for edit pages only
if (typeof(wikEdMainEditCSSwikEdConfig['mainEditCSS']) == 'undefined') { window.wikEdMainEditCSSwikEdConfig['mainEditCSS'] = {}; }
 
// WikedInitMainEditCSS: define built-in main window css for edit pages only
window.WikedInitMainEditCSS = function() {
WikEdInitObject(wikEdMainEditCSSwikEdConfig['mainEditCSS'], {
 
// combo input box
Line 872 ⟶ 869:
 
// buttons (id, class, popup title, image src, width, height, alt text, click code)
if (typeof(wikEdButtonwikEdConfig['button']) == 'undefined') { window.wikEdButtonwikEdConfig['button'] = {}; }
 
// WikedInitButton: define built-in buttons (id, class, popup title, image src, width, height, alt text, click handler code were obj is the button element)
window.WikedInitButton = function() {
WikEdInitObject(wikEdButtonwikEdConfig['button'], {
 
// workaround for mozilla 3.0 bug 441087: objId = obj.id; eventShiftKey = event.shiftKey;
 
// format top
1: ['wikEdUndo', 'wikEdButtonInactive', wikEdTextwikEdConfig['text']['wikEdUndo title'], wikEdImagewikEdConfig['image']['undo'], '16', '16', wikEdTextwikEdConfig['text']['wikEdUndo alt'], 'WikEdEditButton(obj, objId);' ],
2: ['wikEdRedo', 'wikEdButtonInactive', wikEdTextwikEdConfig['text']['wikEdRedo title'], wikEdImagewikEdConfig['image']['redo'], '16', '16', wikEdTextwikEdConfig['text']['wikEdRedo alt'], 'WikEdEditButton(obj, objId);' ],
3: ['wikEdBold', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdBold title'], wikEdImagewikEdConfig['image']['bold'], '16', '16', wikEdTextwikEdConfig['text']['wikEdBold alt'], 'WikEdEditButton(obj, objId);' ],
4: ['wikEdItalic', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdItalic title'], wikEdImagewikEdConfig['image']['italic'], '16', '16', wikEdTextwikEdConfig['text']['wikEdItalic alt'], 'WikEdEditButton(obj, objId);' ],
5: ['wikEdUnderline', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdUnderline title'], wikEdImagewikEdConfig['image']['underline'], '16', '16', wikEdTextwikEdConfig['text']['wikEdUnderline alt'], 'WikEdEditButton(obj, objId);' ],
6: ['wikEdStrikethrough', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdStrikethrough title'], wikEdImagewikEdConfig['image']['strikethrough'], '16', '16', wikEdTextwikEdConfig['text']['wikEdStrikethrough alt'], 'WikEdEditButton(obj, objId);' ],
7: ['wikEdNowiki', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdNowiki title'], wikEdImagewikEdConfig['image']['nowiki'], '16', '16', wikEdTextwikEdConfig['text']['wikEdNowiki alt'], 'WikEdEditButton(obj, objId);' ],
8: ['wikEdSuperscript', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdSuperscript title'], wikEdImagewikEdConfig['image']['superscript'], '16', '16', wikEdTextwikEdConfig['text']['wikEdSuperscript alt'], 'WikEdEditButton(obj, objId);' ],
9: ['wikEdSubscript', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdSubscript title'], wikEdImagewikEdConfig['image']['subscript'], '16', '16', wikEdTextwikEdConfig['text']['wikEdSubscript alt'], 'WikEdEditButton(obj, objId);' ],
10: ['wikEdRef', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdRef title'], wikEdImagewikEdConfig['image']['ref'], '16', '16', wikEdTextwikEdConfig['text']['wikEdRef alt'], 'if (!eventShiftKey) { WikEdEditButton(obj, \'wikEdRef\'); } else { WikEdEditButton(obj, \'wikEdRefNamed\'); }' ],
12: ['wikEdCase', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdCase title'], wikEdImagewikEdConfig['image']['case'], '16', '16', wikEdTextwikEdConfig['text']['wikEdCase alt'], 'WikEdEditButton(obj, objId);' ],
80: ['wikEdSort', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdSort title'], wikEdImagewikEdConfig['image']['sort'], '16', '16', wikEdTextwikEdConfig['text']['wikEdSort alt'], 'WikEdEditButton(obj, objId);' ],
25: ['wikEdRedirect', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdRedirect title'], wikEdImagewikEdConfig['image']['redirect'], '16', '16', wikEdTextwikEdConfig['text']['wikEdRedirect alt'], 'WikEdEditButton(obj, objId);' ],
13: ['wikEdUndoAll', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdUndoAll title'], wikEdImagewikEdConfig['image']['undoAll'], '16', '16', wikEdTextwikEdConfig['text']['wikEdUndoAll alt'], 'WikEdEditButton(obj, objId);' ],
14: ['wikEdRedoAll', 'wikEdButtonInactive', wikEdTextwikEdConfig['text']['wikEdRedoAll title'], wikEdImagewikEdConfig['image']['redoAll'], '16', '16', wikEdTextwikEdConfig['text']['wikEdRedoAll alt'], 'WikEdEditButton(obj, objId);' ],
 
// format bottom
15: ['wikEdWikiLink', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdWikiLink title'], wikEdImagewikEdConfig['image']['wikiLink'], '16', '16', wikEdTextwikEdConfig['text']['wikEdWikiLink alt'], 'WikEdEditButton(obj, objId);' ],
16: ['wikEdWebLink', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdWebLink title'], wikEdImagewikEdConfig['image']['webLink'], '16', '16', wikEdTextwikEdConfig['text']['wikEdWebLink alt'], 'WikEdEditButton(obj, objId);' ],
17: ['wikEdHeading', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdHeading title'], wikEdImagewikEdConfig['image']['heading'], '16', '16', wikEdTextwikEdConfig['text']['wikEdHeading alt'], 'if (!eventShiftKey) { WikEdEditButton(obj, \'wikEdIncreaseHeading\'); } else { WikEdEditButton(obj, \'wikEdDecreaseHeading\'); }' ],
19: ['wikEdBulletList', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdBulletList title'], wikEdImagewikEdConfig['image']['bulletList'], '16', '16', wikEdTextwikEdConfig['text']['wikEdBulletList alt'], 'if (!eventShiftKey) { WikEdEditButton(obj, \'wikEdIncreaseBulletList\'); } else { WikEdEditButton(obj, \'wikEdDecreaseBulletList\'); }' ],
20: ['wikEdNumberList', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdNumberList title'], wikEdImagewikEdConfig['image']['numberList'], '16', '16', wikEdTextwikEdConfig['text']['wikEdNumberList alt'], 'if (!eventShiftKey) { WikEdEditButton(obj, \'wikEdIncreaseNumberList\'); } else { WikEdEditButton(obj, \'wikEdDecreaseNumberList\'); }' ],
21: ['wikEdIndentList', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdIndentList title'], wikEdImagewikEdConfig['image']['indentList'], '16', '16', wikEdTextwikEdConfig['text']['wikEdIndentList alt'], 'if (!eventShiftKey) { WikEdEditButton(obj, \'wikEdIncreaseIndentList\'); } else { WikEdEditButton(obj, \'wikEdDecreaseIndentList\'); }' ],
22: ['wikEdDefinitionList', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdDefinitionList title'], wikEdImagewikEdConfig['image']['definitionList'], '16', '16', wikEdTextwikEdConfig['text']['wikEdDefinitionList alt'], 'WikEdEditButton(obj, objId);' ],
23: ['wikEdImage', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdImage title'], wikEdImagewikEdConfig['image']['image'], '16', '16', wikEdTextwikEdConfig['text']['wikEdImage alt'], 'WikEdEditButton(obj, objId);' ],
24: ['wikEdTable', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdTable title'], wikEdImagewikEdConfig['image']['table'], '16', '16', wikEdTextwikEdConfig['text']['wikEdTable alt'], 'WikEdEditButton(obj, objId);' ],
11: ['wikEdReferences', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdReferences title'], wikEdImagewikEdConfig['image']['references'], '16', '16', wikEdTextwikEdConfig['text']['wikEdReferences alt'], 'if (!eventShiftKey) { WikEdEditButton(obj, objId); } else { WikEdEditButton(obj, \'wikEdReferencesSection\'); }' ],
 
// wikify, textify
26: ['wikEdWikify', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdWikify title'], wikEdImagewikEdConfig['image']['wikify'], '16', '16', wikEdTextwikEdConfig['text']['wikEdWikify alt'], 'WikEdEditButton(obj, objId);' ],
27: ['wikEdTextify', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdTextify title'], wikEdImagewikEdConfig['image']['textify'], '16', '16', wikEdTextwikEdConfig['text']['wikEdTextify alt'], 'if (eventShiftKey) { WikEdEditButton(obj, objId, \'shift\'); } else { WikEdEditButton(obj, objId); }' ],
 
// control top
77: ['wikEdRefHide', 'wikEdButtonUnchecked', wikEdTextwikEdConfig['text']['wikEdRefHide title'], wikEdImagewikEdConfig['image']['refHide'], '16', '16', wikEdTextwikEdConfig['text']['wikEdRefHide alt'], 'WikEdButton(obj, objId, true);' ],
29: ['wikEdTextZoom', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdTextZoom title'], wikEdImagewikEdConfig['image']['textZoom'], '16', '16', wikEdTextwikEdConfig['text']['wikEdTextZoom alt'], 'if (!eventShiftKey) { WikEdButton(obj, \'wikEdTextZoomDown\'); } else { WikEdButton(obj, \'wikEdTextZoomUp\'); }' ],
30: ['wikEdClearHistory', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdClearHistory title'], wikEdImagewikEdConfig['image']['clearHistory'], '16', '16', wikEdTextwikEdConfig['text']['wikEdClearHistory alt'], 'WikEdButton(obj, objId);' ],
31: ['wikEdScrollToPreview', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdScrollToPreview title'], wikEdImagewikEdConfig['image']['scrollToPreviewDown'], '16', '16', wikEdTextwikEdConfig['text']['wikEdScrollToPreview alt'], 'WikEdButton(obj, objId);' ],
32: ['wikEdScrollToEdit', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdScrollToEdit title'], wikEdImagewikEdConfig['image']['scrollToEditDown'], '16', '16', wikEdTextwikEdConfig['text']['wikEdScrollToEdit alt'], 'WikEdButton(obj, objId);' ],
 
// control bottom
33: ['wikEdUseWikEd', 'wikEdButtonChecked', wikEdTextwikEdConfig['text']['wikEdUseWikEd title'], wikEdImagewikEdConfig['image']['useWikEd'], '16', '16', wikEdTextwikEdConfig['text']['wikEdUseWikEd alt'], 'WikEdButton(obj, objId, true);' ],
34: ['wikEdHighlightSyntax', 'wikEdButtonUnchecked', wikEdTextwikEdConfig['text']['wikEdHighlightSyntax title'], wikEdImagewikEdConfig['image']['highlightSyntax'], '16', '16', wikEdTextwikEdConfig['text']['wikEdHighlightSyntax alt'], 'WikEdButton(obj, objId, true);' ],
35: ['wikEdSource', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdSource title'], wikEdImagewikEdConfig['image']['source'], '16', '16', wikEdTextwikEdConfig['text']['wikEdSource alt'], 'WikEdEditButton(obj, objId);' ],
75: ['wikEdCloseToolbar', 'wikEdButtonUnchecked', wikEdTextwikEdConfig['text']['wikEdCloseToolbar title'], wikEdImagewikEdConfig['image']['closeToolbar'], '16', '16', wikEdTextwikEdConfig['text']['wikEdCloseToolbar alt'], 'WikEdButton(obj, objId, true);' ],
36: ['wikEdUsing', 'wikEdButtonUnchecked', wikEdTextwikEdConfig['text']['wikEdUsing title'], wikEdImagewikEdConfig['image']['using'], '16', '16', wikEdTextwikEdConfig['text']['wikEdUsing alt'], 'WikEdButton(obj, objId, true);' ],
37: ['wikEdFullScreen', 'wikEdButtonUnchecked', wikEdTextwikEdConfig['text']['wikEdFullScreen title'], wikEdImagewikEdConfig['image']['fullScreen'], '16', '16', wikEdTextwikEdConfig['text']['wikEdFullScreen alt'], 'WikEdButton(obj, objId, true);' ],
79: ['wikEdTableMode', 'wikEdButtonUnchecked', wikEdTextwikEdConfig['text']['wikEdTableMode title'], wikEdImagewikEdConfig['image']['tableMode'], '16', '16', wikEdTextwikEdConfig['text']['wikEdTableMode alt'], 'WikEdButton(obj, objId, true);' ],
 
// find top
39: ['wikEdFindAll', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdFindAll title'], wikEdImagewikEdConfig['image']['findAll'], '16', '16', wikEdTextwikEdConfig['text']['wikEdFindAll alt'], 'WikEdEditButton(obj, objId);' ],
40: ['wikEdFindPrev', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdFindPrev title'], wikEdImagewikEdConfig['image']['findPrev'], '16', '16', wikEdTextwikEdConfig['text']['wikEdFindPrev alt'], 'WikEdEditButton(obj, objId);' ],
41: ['wikEdFindNext', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdFindNext title'], wikEdImagewikEdConfig['image']['findNext'], '16', '16', wikEdTextwikEdConfig['text']['wikEdFindNext alt'], 'if (eventShiftKey) { WikEdEditButton(obj, objId, \'shift\'); } else { WikEdEditButton(obj, objId); }' ],
43: ['wikEdJumpPrev', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdJumpPrev title'], wikEdImagewikEdConfig['image']['jumpPrev'], '16', '16', wikEdTextwikEdConfig['text']['wikEdJumpPrev alt'], 'WikEdEditButton(obj, objId);' ],
44: ['wikEdJumpNext', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdJumpNext title'], wikEdImagewikEdConfig['image']['jumpNext'], '16', '16', wikEdTextwikEdConfig['text']['wikEdJumpNext alt'], 'WikEdEditButton(obj, objId);' ],
 
// find bottom
46: ['wikEdReplaceAll', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdReplaceAll title'], wikEdImagewikEdConfig['image']['replaceAll'], '16', '16', wikEdTextwikEdConfig['text']['wikEdReplaceAll alt'], 'WikEdEditButton(obj, objId);' ],
47: ['wikEdReplacePrev', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdReplacePrev title'], wikEdImagewikEdConfig['image']['replacePrev'], '16', '16', wikEdTextwikEdConfig['text']['wikEdReplacePrev alt'], 'WikEdEditButton(obj, objId);' ],
48: ['wikEdReplaceNext', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdReplaceNext title'], wikEdImagewikEdConfig['image']['replaceNext'], '16', '16', wikEdTextwikEdConfig['text']['wikEdReplaceNext alt'], 'if (eventShiftKey) { WikEdEditButton(obj, objId, \'shift\'); } else { WikEdEditButton(obj, objId); }' ],
49: ['wikEdCaseSensitive', 'wikEdButtonUnchecked', wikEdTextwikEdConfig['text']['wikEdCaseSensitive title'], wikEdImagewikEdConfig['image']['caseSensitive'], '16', '16', wikEdTextwikEdConfig['text']['wikEdCaseSensitive alt'], 'WikEdButton(obj, objId, true);' ],
50: ['wikEdRegExp', 'wikEdButtonUnchecked', wikEdTextwikEdConfig['text']['wikEdRegExp title'], wikEdImagewikEdConfig['image']['regExp'], '16', '16', wikEdTextwikEdConfig['text']['wikEdRegExp alt'], 'WikEdButton(obj, objId, true);' ],
51: ['wikEdFindAhead', 'wikEdButtonUnchecked', wikEdTextwikEdConfig['text']['wikEdFindAhead title'], wikEdImagewikEdConfig['image']['findAhead'], '16', '16', wikEdTextwikEdConfig['text']['wikEdFindAhead alt'], 'WikEdButton(obj, objId, true);' ],
 
// fix top
52: ['wikEdFixBasic', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdFixBasic title'], wikEdImagewikEdConfig['image']['fixBasic'], '16', '16', wikEdTextwikEdConfig['text']['wikEdFixBasic alt'], 'WikEdEditButton(obj, objId);' ],
53: ['wikEdFixHtml', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdFixHtml title'], wikEdImagewikEdConfig['image']['fixHtml'], '16', '16', wikEdTextwikEdConfig['text']['wikEdFixHtml alt'], 'WikEdEditButton(obj, objId);' ],
54: ['wikEdFixCaps', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdFixCaps title'], wikEdImagewikEdConfig['image']['fixCaps'], '16', '16', wikEdTextwikEdConfig['text']['wikEdFixCaps alt'], 'WikEdEditButton(obj, objId);' ],
55: ['wikEdFixUnicode', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdFixUnicode title'], wikEdImagewikEdConfig['image']['fixUnicode'], '16', '16', wikEdTextwikEdConfig['text']['wikEdFixUnicode alt'], 'WikEdEditButton(obj, objId);' ],
81: ['wikEdFixRedirect', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdFixRedirect title'], wikEdImagewikEdConfig['image']['fixRedirect'], '16', '16', wikEdTextwikEdConfig['text']['wikEdFixRedirect alt'], 'WikEdEditButton(obj, objId);' ],
56: ['wikEdFixAll', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdFixAll title'], wikEdImagewikEdConfig['image']['fixAll'], '16', '16', wikEdTextwikEdConfig['text']['wikEdFixAll alt'], 'WikEdEditButton(obj, objId);' ],
57: ['wikEdFixRegExTypo', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdFixRegExTypo title'], wikEdImagewikEdConfig['image']['fixRegExTypo'], '16', '16', wikEdTextwikEdConfig['text']['wikEdFixRegExTypo alt'], 'WikEdEditButton(obj, objId);' ],
 
// fix bottom
58: ['wikEdFixDashes', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdFixDashes title'], wikEdImagewikEdConfig['image']['fixDash'], '16', '16', wikEdTextwikEdConfig['text']['wikEdFixDashes alt'], 'WikEdEditButton(obj, objId);' ],
59: ['wikEdFixPunct', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdFixPunct title'], wikEdImagewikEdConfig['image']['fixPunct'], '16', '16', wikEdTextwikEdConfig['text']['wikEdFixPunct alt'], 'WikEdEditButton(obj, objId);' ],
60: ['wikEdFixMath', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdFixMath title'], wikEdImagewikEdConfig['image']['fixMath'], '16', '16', wikEdTextwikEdConfig['text']['wikEdFixMath alt'], 'WikEdEditButton(obj, objId);' ],
61: ['wikEdFixChem', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdFixChem title'], wikEdImagewikEdConfig['image']['fixChem'], '16', '16', wikEdTextwikEdConfig['text']['wikEdFixChem alt'], 'WikEdEditButton(obj, objId);' ],
62: ['wikEdFixUnits', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdFixUnits title'], wikEdImagewikEdConfig['image']['fixUnits'], '16', '16', wikEdTextwikEdConfig['text']['wikEdFixUnits alt'], 'WikEdEditButton(obj, objId);' ],
 
// preview top
65: ['wikEdClose', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdClose title'], wikEdImagewikEdConfig['image']['close'], '16', '16', wikEdTextwikEdConfig['text']['wikEdClose alt'], 'WikEdButton(obj, objId);' ],
66: ['wikEdScrollToPreview2', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdScrollToPreview2 title'], wikEdImagewikEdConfig['image']['scrollToPreviewDown'], '16', '16', wikEdTextwikEdConfig['text']['wikEdScrollToPreview2 alt'], 'WikEdButton(obj, objId);' ],
67: ['wikEdScrollToEdit2', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdScrollToEdit2 title'], wikEdImagewikEdConfig['image']['scrollToEdit'], '16', '16', wikEdTextwikEdConfig['text']['wikEdScrollToEdit2 alt'], 'WikEdButton(obj, objId);' ],
 
// preview bottom
70: ['wikEdClose2', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdClose2 title'], wikEdImagewikEdConfig['image']['close'], '16', '16', wikEdTextwikEdConfig['text']['wikEdClose2 alt'], 'WikEdButton(obj, objId);' ],
71: ['wikEdScrollToPreview3', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdScrollToPreview3 title'], wikEdImagewikEdConfig['image']['scrollToPreview'], '16', '16', wikEdTextwikEdConfig['text']['wikEdScrollToPreview3 alt'], 'WikEdButton(obj, objId);' ],
72: ['wikEdScrollToEdit3', 'wikEdButton', wikEdTextwikEdConfig['text']['wikEdScrollToEdit3 title'], wikEdImagewikEdConfig['image']['scrollToEdit'], '16', '16', wikEdTextwikEdConfig['text']['wikEdScrollToEdit3 alt'], 'WikEdButton(obj, objId);' ],
 
// jump
78: ['wikEdDiff', 'wikEdButtonUnchecked', wikEdTextwikEdConfig['text']['wikEdDiff title'], wikEdImagewikEdConfig['image']['wikEdDiff'], '16', '16', wikEdTextwikEdConfig['text']['wikEdDiff alt'], 'WikEdButton(obj, objId, true);' ],
74: ['wikEdScrollToEdit4', 'wikEdButtonSolo', wikEdTextwikEdConfig['text']['wikEdScrollToEdit4 title'], wikEdImagewikEdConfig['image']['scrollToEditDown'], '16', '16', wikEdTextwikEdConfig['text']['wikEdScrollToEdit4 alt'], 'WikEdButton(obj, objId);' ],
 
// dummy
76: ['wikEdDummy', 'wikEdButtonDummy', '', wikEdImagewikEdConfig['image']['dummy'], '16', '16', '', '' ]
});
};
 
// button access keys
if (typeof(wikEdButtonKeywikEdConfig['buttonKey']) == 'undefined') { window.wikEdButtonKeywikEdConfig['buttonKey'] = {}; }
 
// WikedInitButtonKey: define accesskeys for edit buttons (wikEd button number: [key string, JS key code])
window.WikedInitButtonKey = function() {
WikEdInitObject(wikEdButtonKeywikEdConfig['buttonKey'], {
26: ['b', 66], // wikify
27: ['o', 79], // textify
Line 995 ⟶ 992:
 
// button bars (id, class, button numbers)
if (typeof(wikEdButtonBarwikEdConfig['buttonBar']) == 'undefined') { window.wikEdButtonBarwikEdConfig['buttonBar'] = {}; }
 
// WikedInitButtonBar: define built-in button bars (id outer, class outer, id inner, class inner, height, grip title, button numbers)
window.WikedInitButtonBar = function() {
WikEdInitObject(wikEdButtonBarwikEdConfig['buttonBar'], {
'format': ['wikEdButtonBarFormat', 'wikEdButtonBarFormat', 'wikEdButtonsFormat', 'wikEdButtonsFormat', 44, wikEdTextwikEdConfig['text']['wikEdGripFormat title'], [1,2,3,4,5,6,7,8,9,10,12,13,14,'br',15,16,17,19,20,21,22,23,24,11,80,25,76] ],
'textify': ['wikEdButtonBarTextify', 'wikEdButtonBarTextify', 'wikEdButtonsTextify', 'wikEdButtonsTextify', 44, wikEdTextwikEdConfig['text']['wikEdGripTextify title'], [26,'br',27] ],
'custom1': ['wikEdButtonBarCustom1', 'wikEdButtonBarCustom1', 'wikEdButtonsCustom1', 'wikEdButtonsCustom1', 44, wikEdTextwikEdConfig['text']['wikEdGripCustom1 title'], [ ] ],
'find': ['wikEdButtonBarFind', 'wikEdButtonBarFind', 'wikEdButtonsFind', 'wikEdButtonsFind', 44, wikEdTextwikEdConfig['text']['wikEdGripFind title'], [39,40,'find',41,76,43,44,'br',46,47,'replace',48,49,50,51] ],
'fix': ['wikEdButtonBarFix', 'wikEdButtonBarFix', 'wikEdButtonsFix', 'wikEdButtonsFix', 44, wikEdTextwikEdConfig['text']['wikEdGripFix title'], [52,53,54,55,56,81,'br',58,59,60,61,62,57] ],
'custom2': ['wikEdButtonBarCustom2', 'wikEdButtonBarCustom2', 'wikEdButtonsCustom2', 'wikEdButtonsCustom2', 44, wikEdTextwikEdConfig['text']['wikEdGripCustom2 title'], [ ] ],
'control': ['wikEdButtonBarControl', 'wikEdButtonBarControl', 'wikEdButtonsControl', 'wikEdButtonsControl', 44, wikEdTextwikEdConfig['text']['wikEdGripControl title'], [77,29,30,35,31,32,'br',33,34,79,75,36,78,37] ],
'preview': ['wikEdButtonBarPreview', 'wikEdButtonBarPreview', 'wikEdButtonsPreview', 'wikEdButtonsPreview', 0, null, [66,67,65] ],
'preview2': ['wikEdButtonBarPreview2', 'wikEdButtonBarPreview2', 'wikEdButtonsPreview2', 'wikEdButtonsPreview2', 0, null, [71,72,70] ],
Line 1,014 ⟶ 1,011:
 
// history length for find, replace, and summary fields
if (typeof(wikEdHistoryLengthwikEdConfig['historyLength']) == 'undefined') { window.wikEdHistoryLengthwikEdConfig['historyLength'] = {}; }
window.WikedInitHistoryLength = function() {
wikEdHistoryLength['find'] = 10;
WikEdInitObject(wikEdConfig['historyLength'], {
wikEdHistoryLength['replace'] = 10;
'find': 10,
wikEdHistoryLength['summary'] = 10;
'replace': 10,
'summary': 10
});
};
 
// presets for combo input fields dropdown options, {wikEdUsing} appends a link to this script
if (typeof(wikEdComboPresetOptionswikEdConfig['comboPresetOptions']) == 'undefined') { window.wikEdComboPresetOptionswikEdConfig['comboPresetOptions'] = {}; }
if (typeof(wikEdComboPresetOptionswikEdConfig['comboPresetOptions']['summary']) == 'undefined') { window.wikEdComboPresetOptionswikEdConfig['comboPresetOptions']['summary'] = wikEdTextwikEdConfig['text']['wikEdPresetSummary']; }
 
// text for summary link to this script
if (typeof(wikEdSummaryUsingwikEdConfig['summaryUsing']) == 'undefined') { window.wikEdSummaryUsingwikEdConfig['summaryUsing'] = wikEdTextwikEdConfig['text']['wikEdSummaryUsing']; }
 
// expiration time span for permanent cookies in seconds
if (typeof(wikEdCookieExpireSecwikEdConfig['cookieExpireSec']) == 'undefined') { window.wikEdCookieExpireSecwikEdConfig['cookieExpireSec'] = 1 * 30 * 24 * 60 * 60; }
 
// disable wikEd preset
if (typeof(wikEdDisabledPresetwikEdConfig['disabledPreset']) == 'undefined') { window.wikEdDisabledPresetwikEdConfig['disabledPreset'] = false; }
 
// find ahead as you type checkbox preset
if (typeof(wikEdFindAheadSelectedwikEdConfig['findAheadSelected']) == 'undefined') { window.wikEdFindAheadSelectedwikEdConfig['findAheadSelected'] = true; }
 
// highlight syntax preset
if (typeof(wikEdHighlightSyntaxPresetwikEdConfig['highlightSyntaxPreset']) == 'undefined') { window.wikEdHighlightSyntaxPresetwikEdConfig['highlightSyntaxPreset'] = true; }
 
// enable wikEd preset
if (typeof(wikEdUseWikEdPresetwikEdConfig['useWikEdPreset']) == 'undefined') { window.wikEdUseWikEdPresetwikEdConfig['useWikEdPreset'] = true; }
 
// add '...using wikEd' to summary preset
if (typeof(wikEdUsingPresetwikEdConfig['usingPreset']) == 'undefined') { window.wikEdUsingPresetwikEdConfig['usingPreset'] = false; }
 
// scroll to edit field on non-preview pages
if (typeof(wikEdScrollToEditwikEdConfig['scrollToEdit']) == 'undefined') { window.wikEdScrollToEditwikEdConfig['scrollToEdit'] = true; }
 
// focus the edit field on non-preview pages
if (typeof(wikEdFocusEditwikEdConfig['focusEdit']) == 'undefined') { window.wikEdFocusEditwikEdConfig['focusEdit'] = true; }
 
// wikEdDiff preset
if (typeof(wikEdDiffPresetwikEdConfig['diffPreset']) == 'undefined') { window.wikEdDiffPresetwikEdConfig['diffPreset'] = false; }
 
// fullscreen mode preset
if (typeof(wikEdFullScreenModePresetwikEdConfig['fullScreenModePreset']) == 'undefined') { window.wikEdFullScreenModePresetwikEdConfig['fullScreenModePreset'] = false; }
 
// show MediaWiki toolbar preset
if (typeof(wikEdCloseToolbarPresetwikEdConfig['closeToolbarPreset']) == 'undefined') { window.wikEdCloseToolbarPresetwikEdConfig['closeToolbarPreset'] = false; }
 
// hide ref tags preset
if (typeof(wikEdRefHidePresetwikEdConfig['refHidePreset']) == 'undefined') { window.wikEdRefHidePresetwikEdConfig['refHidePreset'] = false; }
 
// text size adjustment for edit window (percentage)
if (typeof(wikEdTextSizeAdjustwikEdConfig['textSizeAdjust']) == 'undefined') { window.wikEdTextSizeAdjustwikEdConfig['textSizeAdjust'] = 100; }
 
// remove invisible syntax highlighting comments after closing tag
if (typeof(wikEdRemoveHighlightCommentswikEdConfig['removeHighlightComments']) == 'undefined') { window.wikEdRemoveHighlightCommentswikEdConfig['removeHighlightComments'] = true; }
 
// show the text-to-source button for testing purposes
if (typeof(wikEdShowSourceButtonwikEdConfig['showSourceButton']) == 'undefined') { window.wikEdShowSourceButtonwikEdConfig['showSourceButton'] = false; }
 
// show the using-wikEd button
if (typeof(wikEdShowUsingButtonwikEdConfig['showUsingButton']) == 'undefined') { window.wikEdShowUsingButtonwikEdConfig['showUsingButton'] = false; }
 
// the wikEd help page link to be displayed after the editing help link, an empty string disables the link
if (typeof(wikEdHelpPageLinkwikEdConfig['helpPageLink']) == 'undefined') { window.wikEdHelpPageLinkwikEdConfig['helpPageLink'] = wikEdTextwikEdConfig['text']['wikEdHelpPageLink']; }
 
// enable external diff script
if (typeof(wikEdLoadDiffScriptwikEdConfig['loadDiffScript']) == 'undefined') { window.wikEdLoadDiffScriptwikEdConfig['loadDiffScript'] = true; }
 
// enable external wikEdDiff script
if (typeof(wikEdLoadDiffwikEdConfig['loadDiff']) == 'undefined') { window.wikEdLoadDiffwikEdConfig['loadDiff'] = true; }
 
// enable external InstaView script
if (typeof(wikEdLoadInstaViewwikEdConfig['loadInstaView']) == 'undefined') { window.wikEdLoadInstaViewwikEdConfig['loadInstaView'] = true; }
 
// enable external IERange script
if (typeof(wikEdLoadIERangewikEdConfig['loadIERange']) == 'undefined') { window.wikEdLoadIERangewikEdConfig['loadIERange'] = true; }
 
// RegExTypoFix rules page, the address must have the exact same ___domain name as the used wiki
if (typeof(wikEdRegExTypoFixURLwikEdConfig['regExTypoFixURL']) == 'undefined') { window.wikEdRegExTypoFixURLwikEdConfig['regExTypoFixURL'] = wikEdHomeBaseUrlwikEdConfig['homeBaseUrl'] + 'w/index.php?title=Wikipedia:AutoWikiBrowser/Typos&action=raw'; }
 
// enable RegExTypoFix button (http://en.wikipedia.org/wiki/User:Mboverload/RegExTypoFix)
if (typeof(wikEdRegExTypoFixwikEdConfig['regExTypoFix']) == 'undefined') { window.wikEdRegExTypoFixwikEdConfig['regExTypoFix'] = false; }
 
// enable highlighting as links
if (typeof(wikEdFollowHighlightedLinkswikEdConfig['followHighlightedLinks']) == 'undefined') { window.wikEdFollowHighlightedLinkswikEdConfig['followHighlightedLinks'] = false; }
 
// skip the browser detection to run wikEd under IE and Opera
if (typeof(wikEdSkipBrowserTestwikEdConfig['skipBrowserTest']) == 'undefined') { window.wikEdSkipBrowserTestwikEdConfig['skipBrowserTest'] = false; }
 
// skip the script test that disables wikEd if certain scripts are present
if (typeof(wikEdConfig['skipScriptTest']) == 'undefined') { wikEdConfig['skipScriptTest'] = false; }
 
// skip the read-only detection
if (typeof(wikEdConfig['skipReadOnlyTest']) == 'undefined') { wikEdConfig['skipReadOnlyTest'] = false; }
 
// button access keys
if (typeof(wikEdConfig['incompatibleScripts']) == 'undefined') { wikEdConfig['incompatibleScripts'] = {}; }
 
// WikedInitButtonKey: define accesskeys for edit buttons (wikEd button number: [key string, JS key code])
window.WikedInitIncompatibleScripts = function() {
WikEdInitObject(wikEdConfig['incompatibleScripts'], {
'CKEditor': 'ckeditor.js',
'FCKEditor': 'fckeditor.js'
});
};
 
// set the button bar grip width in px
if (typeof(wikEdButtonBarGripWidthwikEdConfig['buttonBarGripWidth']) == 'undefined') { window.wikEdButtonBarGripWidthwikEdConfig['buttonBarGripWidth'] = 8; }
 
// enable local preview (Pilaf's InstaView)
if (typeof(wikEdUseLocalPreviewwikEdConfig['useLocalPreview']) == 'undefined') { window.wikEdUseLocalPreviewwikEdConfig['useLocalPreview'] = true; }
 
// allow ajax requests from local copy for testing, also defined in wikEdDiff.js
if (typeof(wikEdAllowLocalAjaxwikEdConfig['allowLocalAjax']) == 'undefined') { window.wikEdAllowLocalAjaxwikEdConfig['allowLocalAjax'] = false; }
 
// enable server preview (Ajax)
if (typeof(wikEdUseAjaxPreviewwikEdConfig['useAjaxPreview']) == 'undefined') { window.wikEdUseAjaxPreviewwikEdConfig['useAjaxPreview'] = true; }
 
// enable appending '<references/> for Ajax section previews
if (typeof(wikEdSectionPreviewRefswikEdConfig['SectionPreviewRefs']) == 'undefined') { window.wikEdSectionPreviewRefswikEdConfig['SectionPreviewRefs'] = true; }
 
// enable auto update (Ajax)
if (typeof(wikEdAutoUpdatewikEdConfig['autoUpdate']) == 'undefined') { window.wikEdAutoUpdatewikEdConfig['autoUpdate'] = true; }
 
// hours between update check (monobook.js)
if (typeof(wikEdAutoUpdateHourswikEdConfig['autoUpdateHours']) == 'undefined') { window.wikEdAutoUpdateHourswikEdConfig['autoUpdateHours'] = 20; }
 
// hours between update check (Greasemonkey)
if (typeof(wikEdAutoUpdateHoursGMwikEdConfig['autoUpdateHoursGM']) == 'undefined') { window.wikEdAutoUpdateHoursGMwikEdConfig['autoUpdateHoursGM'] = 40; }
 
// auto update: version url (Ajax)
if (typeof(wikEdAutoUpdateUrlwikEdConfig['autoUpdateUrl']) == 'undefined') { window.wikEdAutoUpdateUrlwikEdConfig['autoUpdateUrl'] = wikEdHomeBaseUrlwikEdConfig['homeBaseUrl'] + 'w/index.php?title=User:Cacycle/wikEd_current_version&action=raw&maxage=0'; }
 
// auto update: script url for Greasemonkey update
if (typeof(wikEdAutoUpdateScriptUrlwikEdConfig['autoUpdateScriptUrl']) == 'undefined') { window.wikEdAutoUpdateScriptUrlwikEdConfig['autoUpdateScriptUrl'] = wikEdHomeBaseUrlwikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Cacycle/wikEd.user.js'; }
 
// show complete unshortened article text for local diff, also defined in wikEdDiff.js
if (typeof(wikEdFullDiffwikEdConfig['fullDiff']) == 'undefined') { window.wikEdFullDiffwikEdConfig['fullDiff'] = false; }
 
// make links ctrl-clickable
if (typeof(wikEdLinkifywikEdConfig['linkify']) == 'undefined') { window.wikEdLinkifywikEdConfig['linkify'] = true; }
 
// hide refs and templates in newbie mode
if (typeof(wikEdHideContentwikEdConfig['hideContent']) == 'undefined') { window.wikEdHideContentwikEdConfig['hideContent'] = true; }
 
// wikify table parameters, replaces original table parameters with this string
if (typeof(wikEdWikifyTableParameterswikEdConfig['wikifyTableParameters']) == 'undefined') { window.wikEdWikifyTableParameterswikEdConfig['wikifyTableParameters'] = ''; }
 
// do not rearrange page elements
if (typeof(wikEdNoRearrangewikEdConfig['noRearrange']) == 'undefined') { window.wikEdNoRearrangewikEdConfig['noRearrange'] = false; }
 
// use French rules for fix punctuation
if (typeof(wikEdFixPunctFrenchwikEdConfig['fixPunctFrench']) == 'undefined') { window.wikEdFixPunctFrenchwikEdConfig['fixPunctFrench'] = false; }
 
// wikEdSetupHookwikEdConfig['setupHook'], executed after wikEd has been set up, usage: wikEdSetupHookwikEdConfig['setupHook'].push(YourFunction);
if (typeof(wikEdSetupHookwikEdConfig['setupHook']) == 'undefined') { window.wikEdSetupHookwikEdConfig['setupHook'] = []; }
 
// wikEdOnHookwikEdConfig['onHook'], executed after wikEd has been re-enabled by logo click, usage: wikEdOnHookwikEdConfig['onHook'].push(YourFunction);
if (typeof(wikEdOnHookwikEdConfig['onHook']) == 'undefined') { window.wikEdOnHookwikEdConfig['onHook'] = []; }
 
// wikEdOffHookwikEdConfig['offHook'], executed after wikEd has been disabled by logo click, usage: wikEdOffHookwikEdConfig['offHook'].push(YourFunction);
if (typeof(wikEdOffHookwikEdConfig['offHook']) == 'undefined') { window.wikEdOffHookwikEdConfig['offHook'] = []; }
 
// wikEdTextareaHookwikEdConfig['textareaHook'], executed after classic textarea has been enabled by user, usage: wikEdTextareaHookwikEdConfig['textareaHook'].push(YourFunction);
if (typeof(wikEdTextareaHookwikEdConfig['textareaHook']) == 'undefined') { window.wikEdTextareaHookwikEdConfig['textareaHook'] = []; }
 
// wikEdFrameHookwikEdConfig['frameHook'], executed after wikEd edit frame has been enabled by user, usage: wikEdFrameHookwikEdConfig['frameHook'].push(YourFunction);
if (typeof(wikEdFrameHookwikEdConfig['frameHook']) == 'undefined') { window.wikEdFrameHookwikEdConfig['frameHook'] = []; }
 
// custom edit form id instead of 'editform'
if (typeof(wikEdCustomEditFormIdwikEdConfig['customEditFormId']) == 'undefined') { window.wikEdCustomEditFormIdwikEdConfig['customEditFormId'] = ''; }
 
// custom textarea id instead of 'wpTextbox1'
if (typeof(wikEdCustomTextAreaIdwikEdConfig['customTextAreaId']) == 'undefined') { window.wikEdCustomTextAreaIdwikEdConfig['customTextAreaId'] = ''; }
 
// custom save button id instead of 'wpSave'
if (typeof(wikEdCustomSaveButtonIdwikEdConfig['customSaveButtonId']) == 'undefined') { window.wikEdCustomSaveButtonIdwikEdConfig['customSaveButtonId'] = ''; }
 
// show table mode togle button
if (typeof(wikEdShowTableModeButtonwikEdConfig['showTableModeButton']) == 'undefined') { window.wikEdShowTableModeButtonwikEdConfig['showTableModeButton'] = false; }
 
// maximal time for syntax highlighting in ms
if (typeof(wikEdMaxHighlightTimewikEdConfig['maxHighlightTime']) == 'undefined') { window.wikEdMaxHighlightTimewikEdConfig['maxHighlightTime'] = 3000; }
 
// first char of article names is case sensitive (e.g. Wiktionary)
if (typeof(wikEdArticlesCaseSensitivewikEdConfig['articlesCaseSensitive']) == 'undefined') { window.wikEdArticlesCaseSensitivewikEdConfig['articlesCaseSensitive'] = false; }
 
// force immediate update if this version string is newer
if (typeof(wikEdForcedUpdatewikEdConfig['forcedUpdate']) == 'undefined') { window.wikEdForcedUpdatewikEdConfig['forcedUpdate'] = ''; }
 
// display highlighting error messages in text
if (typeof(wikEdHighlightErrorwikEdConfig['highlightError']) == 'undefined') { window.wikEdHighlightErrorwikEdConfig['highlightError'] = false; }
 
// display preview of files in text
if (typeof(wikEdFilePreviewwikEdConfig['filePreview']) == 'undefined') { window.wikEdFilePreviewwikEdConfig['filePreview'] = true; }
 
// file preview image size in pixels
if (typeof(wikEdFilePreviewSizewikEdConfig['filePreviewSize']) == 'undefined') { window.wikEdFilePreviewSizewikEdConfig['filePreviewSize'] = 75; }
 
// file preview image size in pixels
if (typeof(wikEdAntiHighlightBleedingwikEdConfig['antiHighlightBleeding']) == 'undefined') { window.wikEdAntiHighlightBleedingwikEdConfig['antiHighlightBleeding'] = true; }
 
// do not hide templates shorter than this number of chars
if (typeof(wikEdTemplNoHideLengthwikEdConfig['templNoHideLength']) == 'undefined') { window.wikEdTemplNoHideLengthwikEdConfig['templNoHideLength'] = 40; }
 
// debug window maximal length in chars
if (typeof(wikEdDebugMaxLengthwikEdConfig['debugMaxLength']) == 'undefined') { window.wikEdDebugMaxLengthwikEdConfig['debugMaxLength'] = 50000; }
 
// debug display of DOM nodes: maximal length of innerHTML in chars
if (typeof(wikEdDebugInnerHtmlLengthwikEdConfig['debugInnerHtmlLength']) == 'undefined') { window.wikEdDebugInnerHtmlLengthwikEdConfig['debugInnerHtmlLength'] = 150; }
 
return;
};
 
// user configurable variables needed during start up
 
// init config
if (typeof(wikEdConfig) == 'undefined') { window.wikEdConfig = {}; }
 
// wikEd code home base URL for https compatibility
if (typeof(wikEdHomeBaseUrlStandardwikEdConfig['homeBaseUrlStandard']) == 'undefined') { window.wikEdHomeBaseUrlStandardwikEdConfig['homeBaseUrlStandard'] = 'http://en.wikipedia.org/'; }
if (typeof(wikEdHomeBaseUrlSecurewikEdConfig['homeBaseUrlSecure']) == 'undefined') { window.wikEdHomeBaseUrlSecurewikEdConfig['homeBaseUrlSecure'] = 'https://secure.wikimedia.org/wikipedia/en/'; }
 
// set wikEd home base url depending on current page address: standard (http:) or secure (https:)
if (window.___location.protocol == 'https:') {
wikEdConfig['homeBaseUrl'] = wikEdConfig['homeBaseUrlSecure'];
window.wikEdHomeBaseUrl = wikEdHomeBaseUrlSecure;
}
else {
wikEdConfig['homeBaseUrl'] = wikEdConfig['homeBaseUrlStandard'];
window.wikEdHomeBaseUrl = wikEdHomeBaseUrlStandard;
}
 
// diff script URL
if (typeof(wikEdDiffScriptSrcwikEdConfig['diffScriptSrc']) == 'undefined') { window.wikEdDiffScriptSrcwikEdConfig['diffScriptSrc'] = wikEdHomeBaseUrlwikEdConfig['homeBaseUrl'] + 'w/index.php?title=User:Cacycle/diff.js&action=raw&ctype=text/javascript'; }
 
// wikEdDiff script URL, also defined in wikEdDiff.js
if (typeof(wikEdDiffSrcwikEdConfig['diffSrc']) == 'undefined') { window.wikEdDiffSrcwikEdConfig['diffSrc'] = wikEdHomeBaseUrlwikEdConfig['homeBaseUrl'] + 'w/index.php?title=User:Cacycle/wikEdDiff.js&action=raw&ctype=text/javascript'; }
 
// InstaView script URL
if (typeof(wikEdInstaViewSrcwikEdConfig['instaViewSrc']) == 'undefined') { window.wikEdInstaViewSrcwikEdConfig['instaViewSrc'] = wikEdHomeBaseUrlwikEdConfig['homeBaseUrl'] + 'w/index.php?title=User:Pilaf/include/instaview.js&action=raw&ctype=text/javascript'; }
 
// IERange script URL (MS IE compatibility library)
if (typeof(wikEdIERangeSrcwikEdConfig['IERangeSrc']) == 'undefined') { window.wikEdIERangeSrcwikEdConfig['IERangeSrc'] = wikEdHomeBaseUrlwikEdConfig['homeBaseUrl'] + 'w/index.php?title=User:Cacycle/ierange.js&action=raw&ctype=text/javascript'; }
 
// wikEd-as-gadget detection, set to true if gadget script name is not MediaWiki:Gadget-wikEd.js
if (typeof(wikEdGadgetwikEdConfig['gadget']) == 'undefined') { window.wikEdGadgetwikEdConfig['gadget'] = null; }
 
// duplicate edit warnings from the top of the page to above the edit window
if (typeof(wikEdDoCloneWarningswikEdConfig['doCloneWarnings']) == 'undefined') { window.wikEdDoCloneWarningswikEdConfig['doCloneWarnings'] = true; }
 
// startup debugging
if (typeof(wikEdConfig['debugStartUp']) == 'undefined') { wikEdConfig['debugStartUp'] = ''; }
 
// show missing translations
if (typeof(wikEdConfig['showMissingTranslations']) == 'undefined') { wikEdConfig['showMissingTranslations'] = false; }
 
// content language default, also used for wikEd UI localization
if (typeof(wikEdConfig['languageDefault']) == 'undefined') { window.wikEdConfig['languageDefault'] = ''; }
 
// load external translation
if (typeof(wikEdConfig['loadTranslation']) == 'undefined') { window.wikEdConfig['loadTranslation'] = true; }
 
// translation javascript URLs
if (typeof(wikEdConfig['translations']) == 'undefined') { wikEdConfig['translations'] = {}; }
 
// WikedInitTranslations: define translation javascript URLs ('': internal default)
window.WikedInitTranslations = function() {
WikEdInitObject(wikEdConfig['translations'], {
'en': '',
'ar': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:ترجمان05/wikEd_international_ar.js',
'zh-hans': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Shibo77/wikEd_international_zh.js',
'zh-hant': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Quest_for_Truth/wikEd_international_zh-hant.js',
'cs': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Sevela.p/wikEd_international_cs.js',
'nl': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Jeronevw/wikEd_international_nl.js',
'eo': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:ArnoLagrange/wikEd-eo.js',
'fi': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Ejs-80/wikEd international fi.js',
'fr': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Leag/wikEd-fr.js',
'de': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Matthias_M./wikEd_international_de.js',
'he': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:שמוליק/wikEd_international_he.js',
'hu': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Csörföly D/wikEd-hu.js',
'it': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Jalo/wikEd_international_it.js',
'ja': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Hatukanezumi/wikEd_international_ja.js',
'ko': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Ilovesabbath/wikEd_international_ko.js',
'dsb': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Michalwiki/wikEd_international_dsb.js',
'ms': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Aviator/wikEd_international_ms.js',
'no': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Dvyjones/wikEd_international_no.js',
'nn': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Frokor/wikEd_international_nn.js',
'pl': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Konradek/wikEd_international_pl.js',
'pt': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Mosca/wikEd_international_pt.js',
'ro': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Roamataa/wikEd_international_ro.js',
'scn': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Meloscn/wikEd_international_scn.js',
'sk': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Helix84/wikEd_international_sk.js',
'sl': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Eleassar/wikEd_international_sl.js',
'es': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Axelei/wikEd_international_es.js',
'sv': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Where_next_Columbus?/wikEd_international_sv.js',
'hsb': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Michalwiki/wikEd_international_hsb.js',
'tr': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Vito_Genovese/wikEd_international_tr.js',
'vi': wikEdConfig['homeBaseUrl'] + 'w/index.php?action=raw&ctype=text/javascript&title=User:Vinhtantran/wikEd_international_vi.js'
});
};
 
// Mediawiki page and skin detection, logo placement
if (typeof(wikEdConfig['MediaWikiSkinIds']) == 'undefined') { wikEdConfig['MediaWikiSkinIds'] = {}; }
 
// WikedInitMediaWikiSkinIds: define Mediawiki page and skin detection, logo placement
// format: skin name: [ dom element to add logo to ('': top right), logo to this list or list contained in this parent element, rearrange page elements, [skin detection element id list] ],
window.WikedInitMediaWikiSkinIds = function() {
WikEdInitObject(wikEdConfig['MediaWikiSkinIds'], {
 
// monobook, also detects simple and myskin
monobook: [ 'p-personal', true, true, ['column-content', 'content', 'bodyContent', 'siteSub', 'contentSub', 'column-one', 'p-cactions'] ],
 
// vector (see https://bugzilla.wikimedia.org/show_bug.cgi?id=19527)
vector_old: [ 'personal', true, true, ['content', 'bodyContent', 'siteSub', 'contentSub', 'left-navigation', 'namespaces'] ],
vector_new: [ 'p-personal', true, true, ['content', 'bodyContent', 'siteSub', 'contentSub', 'left-navigation', 'p-namespaces', 'p-cactions'] ],
 
// citizendium.org
pinkwich5: [ 'p-personal', true, true, ['column-content', 'content', 'bodycontent', 'sitesub', 'contentSub', 'column-one', 'p-cactions'] ],
 
// other MediaWiki skins
standard: [ 'quickbar', false, true, ['content', 'topbar', 'article', 'footer', 'pagestats'] ],
nostalgia: [ 'topbar', false, true, ['content', 'specialpages', 'article', 'footer'] ],
cologneblue: [ 'quickbar', false, true, ['content', 'topbar', 'sitetitle', 'sitesub', 'article', 'footer'] ],
modern: [ 'p-personal', true, true, ['mw_header', 'mw_main', 'mw_contentwrapper'] ],
 
// wikia.com
monaco: [ 'userData', false, false, ['background_strip', 'siteSub', 'contentSub', 'monaco_footer'] ],
quartz: [ 'welcome', false, true, ['articleWrapper', 'bodyContent', 'siteSub', 'contentSub', 'sidebar'] ],
searchwikia: [ 'header-li-buttons', false, true, ['header', 'header-container', 'header-go-button', 'article-container', 'article', 'article-text'] ],
 
// custom skins developed on wiki.mozilla.org and developer.mozilla.org
cavendish: [ '', false, true, ['internal', 'container', 'header', 'contentTop', 'mBody', 'side', 'nav', 'siteSub', 'contentSub'] ],
devmo: [ 'personal', false, true, ['developer-mozilla-org', 'container', 'header', 'navigation', 'bar', 'page', 'sidebar', 'sidebarslideup', 'contentTop', 'siteSub', 'contentSub'] ],
 
// custom skins
gumax: [ 'gumax-p-login', true, true, ['gumax-header', 'gumax-content-body'] ],
 
// custom MediaWiki identifier
mediawiki: [ '', false, false, ['mediawiki'] ]
});
};
 
//
Line 1,255 ⟶ 1,369:
window.wikEdDisabled = true;
window.wikEdUploadEdit = false;
window.wikEdViewDeleted = false;
window.wikEdLanguage = '';
window.wikEdWatchlistEdit = false;
Line 1,288 ⟶ 1,403:
window.wikEdTextareaContainer = null;
window.wikEdToolbar = null;
window.wikEdTextarea = null;
window.wikEdEditForm = null;
window.wikEdFrameInner = null;
window.wikEdFrameOuter = null;
Line 1,315 ⟶ 1,428:
window.wikEdInsertWrapper = null;
 
// edit form fields
window.wikEdEditForm = null;
window.wikEdEdittime = null;
window.wikEdEditToken = null;
window.wikEdTextarea = null;
 
window.wikEdButtonsWrapperWidth = {};
window.wikEdButtonBarFormat = null;
window.wikEdButtonBarTextify = null;
Line 1,349 ⟶ 1,469:
window.wikEdDiffPreviewButton = null;
window.wikEdSummaryLabel = null;
 
window.wikEdGetGlobalNode = null;
 
window.WikEdHighlightNamedHideButtonsStylesheet = null;
Line 1,383 ⟶ 1,501:
window.wikEdPreviewIsAjax = null;
window.wikEdButtonKeyCode = [];
if (typeof(wikEdWikiGlobals) == 'undefined') { window.wikEdWikiGlobals = []; }
window.wikEdDirection = null;
window.wikEdTextSize = 0;
Line 1,405 ⟶ 1,522:
window.wikEdTableMode = false;
window.wikEdCleanNodes = false;
window.wikEdReadOnly = false;
 
// unicode fixing and char highlighting
Line 1,487 ⟶ 1,605:
};
 
// variables needed during startup, might be called multiple times
 
// startup debugging
if (typeof(wikEdDebugStartUp) == 'undefined') { window.wikEdDebugStartUp = ''; }
 
// show missing translations
if (typeof(wikEdShowMissingTranslations) == 'undefined') { window.wikEdShowMissingTranslations = false; }
 
// hash of loaded scripts, also defined in wikEdDiff.js
Line 1,500 ⟶ 1,612:
if (typeof(wikEdPageLoaded) == 'undefined') { window.wikEdPageLoaded = false; }
 
// browser and os identificationidentificationr
if (typeof(wikEdBrowserName) == 'undefined') { window.wikEdBrowserName = ''; }
if (typeof(wikEdBrowserFlavor) == 'undefined') { window.wikEdBrowserFlavor = ''; }
Line 1,510 ⟶ 1,622:
if (typeof(wikEdWebKit) == 'undefined') { window.wikEdWebKit = false; }
if (typeof(wikEdChrome) == 'undefined') { window.wikEdChrome = false; }
if (typeof(wikEdGreasemonkey) == 'undefined') { window.wikEdGreasemonkey = nullfalse; }
if (typeof(wikEdPlatform) == 'undefined') { window.wikEdPlatform = null; }
 
// global variables via Greasemonkey ___location hack
// content language default, also used for wikEd UI localization
if (typeof(wikEdLanguageDefaultwikEdWikiGlobals) == 'undefined') { window.wikEdLanguageDefaultwikEdWikiGlobals = ''{}; }
if (typeof(wikEdText) == 'undefined') { wikEdText = {}; }
 
// define global variables
// load external translation
if (typeof(wikEdLoadTranslationwgServer) == 'undefined') { window.wikEdLoadTranslationwgServer = truenull; }
if (typeof(wgTitle) == 'undefined') { window.wgTitle = null; }
 
if (typeof(wgCanonicalNamespace) == 'undefined') { window.wgCanonicalNamespace = null; }
// translation javascript URLs
if (typeof(wikEdTranslationswgArticlePath) == 'undefined') { window.wikEdTranslationswgArticlePath = {}null; }
if (typeof(wgScript) == 'undefined') { window.wgScript = null; }
 
if (typeof(wgScriptPath) == 'undefined') { window.wgScriptPath = null; }
// WikedInitTranslations: define translation javascript URLs ('': internal default)
if (typeof(wgUserName) == 'undefined') { window.wgUserName = null; }
window.WikedInitTranslations = function() {
if (typeof(wgCurRevisionId) == 'undefined') { window.wgCurRevisionId = null; }
WikEdInitObject(wikEdTranslations, {
if (typeof(wgScript) == 'undefined') { window.wgScript = null; }
'en': '',
if (typeof(wgContentLanguage) == 'undefined') { window.wgContentLanguage = null; }
'ar': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:ترجمان05/wikEd_international_ar.js',
if (typeof(wgUserLanguage) == 'undefined') { window.wgUserLanguage = null; }
'zh-hans': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Shibo77/wikEd_international_zh.js',
if (typeof(wgEnableAPI) == 'undefined') { window.wgEnableAPI = null; }
'zh-hant': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Quest_for_Truth/wikEd_international_zh-hant.js',
if (typeof(wgPageName) == 'undefined') { window.wgPageName = null; }
'cs': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Sevela.p/wikEd_international_cs.js',
if (typeof(wgNamespaceIds) == 'undefined') { window.wgNamespaceIds = null; }
'nl': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Jeronevw/wikEd_international_nl.js',
if (typeof(wgFormattedNamespaces) != 'undefined') { window.wgFormattedNamespaces = null; }
'eo': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:ArnoLagrange/wikEd-eo.js',
'fi': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Ejs-80/wikEd international fi.js',
'fr': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Leag/wikEd-fr.js',
'de': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Matthias_M./wikEd_international_de.js',
'he': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:שמוליק/wikEd_international_he.js',
'hu': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Csörföly D/wikEd-hu.js',
'it': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Jalo/wikEd_international_it.js',
'ja': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Hatukanezumi/wikEd_international_ja.js',
'ko': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Ilovesabbath/wikEd_international_ko.js',
'dsb': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Michalwiki/wikEd_international_dsb.js',
'ms': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Aviator/wikEd_international_ms.js',
'no': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Dvyjones/wikEd_international_no.js',
'nn': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Frokor/wikEd_international_nn.js',
'pl': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Konradek/wikEd_international_pl.js',
'pt': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Mosca/wikEd_international_pt.js',
'ro': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Roamataa/wikEd_international_ro.js',
'scn': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Meloscn/wikEd_international_scn.js',
'sk': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Helix84/wikEd_international_sk.js',
'sl': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Eleassar/wikEd_international_sl.js',
'es': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Axelei/wikEd_international_es.js',
'sv': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Where_next_Columbus?/wikEd_international_sv.js',
'hsb': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Michalwiki/wikEd_international_hsb.js',
'tr': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Vito_Genovese/wikEd_international_tr.js',
'vi': wikEdHomeBaseUrl + 'w/index.php?action=raw&ctype=text/javascript&title=User:Vinhtantran/wikEd_international_vi.js'
});
};
 
 
 
// Mediawiki page and skin detection, logo placement
if (typeof(wikEdMediaWikiSkinIds) == 'undefined') { window.wikEdMediaWikiSkinIds = {}; }
 
// WikedInitMediaWikiSkinIds: define Mediawiki page and skin detection, logo placement
// format: skin name: [ dom element to add logo to ('': top right), logo to this list or list contained in this parent element, rearrange page elements, [skin detection element id list] ],
window.WikedInitMediaWikiSkinIds = function() {
WikEdInitObject(wikEdMediaWikiSkinIds, {
 
// monobook, also detects simple and myskin
monobook: [ 'p-personal', true, true, ['column-content', 'content', 'bodyContent', 'siteSub', 'contentSub', 'column-one', 'p-cactions'] ],
 
// vector (see https://bugzilla.wikimedia.org/show_bug.cgi?id=19527)
vector_old: [ 'personal', true, true, ['content', 'bodyContent', 'siteSub', 'contentSub', 'left-navigation', 'namespaces'] ],
vector_new: [ 'p-personal', true, true, ['content', 'bodyContent', 'siteSub', 'contentSub', 'left-navigation', 'p-namespaces', 'p-cactions'] ],
 
// citizendium.org
pinkwich5: [ 'p-personal', true, true, ['column-content', 'content', 'bodycontent', 'sitesub', 'contentSub', 'column-one', 'p-cactions'] ],
 
// other MediaWiki skins
standard: [ 'quickbar', false, true, ['content', 'topbar', 'article', 'footer', 'pagestats'] ],
nostalgia: [ 'topbar', false, true, ['content', 'specialpages', 'article', 'footer'] ],
cologneblue: [ 'quickbar', false, true, ['content', 'topbar', 'sitetitle', 'sitesub', 'article', 'footer'] ],
modern: [ 'p-personal', true, true, ['mw_header', 'mw_main', 'mw_contentwrapper'] ],
 
// wikia.com
monaco: [ 'userData', false, false, ['background_strip', 'siteSub', 'contentSub', 'monaco_footer'] ],
quartz: [ 'welcome', false, true, ['articleWrapper', 'bodyContent', 'siteSub', 'contentSub', 'sidebar'] ],
searchwikia: [ 'header-li-buttons', false, true, ['header', 'header-container', 'header-go-button', 'article-container', 'article', 'article-text'] ],
 
// custom skins developed on wiki.mozilla.org and developer.mozilla.org
cavendish: [ '', false, true, ['internal', 'container', 'header', 'contentTop', 'mBody', 'side', 'nav', 'siteSub', 'contentSub'] ],
devmo: [ 'personal', false, true, ['developer-mozilla-org', 'container', 'header', 'navigation', 'bar', 'page', 'sidebar', 'sidebarslideup', 'contentTop', 'siteSub', 'contentSub'] ],
 
// custom skins
gumax: [ 'gumax-p-login', true, true, ['gumax-header', 'gumax-content-body'] ],
 
// custom MediaWiki identifier
mediawiki: [ '', false, false, ['mediawiki'] ]
});
};
 
// skins
if (typeof(wikEdLogoContainerId) == 'undefined') { window.wikEdLogoContainerId = ''; }
if (typeof(wikEdRearrange) == 'undefined') { window.wikEdRearrange = false; }
Line 1,606 ⟶ 1,652:
if (typeof(wikEdSkin) == 'undefined') { window.wikEdSkin = ''; }
 
// various
// non-configurable variables
if (typeof(wikEdGreasemonkeyToHead) == 'undefined') { window.wikEdGreasemonkeyToHead = false; }
if (typeof(wikEdGotGlobalsHook) == 'undefined') { window.wikEdGotGlobalsHook = []; }
window.wikEdTranslationLoaded = false;
if (typeof(wikEdLoadingTranslation) == 'undefined') { window.wikEdLoadingTranslation = false; }
if (typeof(wikEdWebStorage) == 'undefined') { window.wikEdWebStorage = false; }
 
 
Line 1,615 ⟶ 1,663:
//
 
window.WikEdInitObject = function(arraytarget, presetsource, showMissing) {
 
for (var key in presetsource) {
if (arraytypeof(target[key]) == null'undefined') {
arraytarget[key] = presetsource[key];
 
// show missing array entries
if (showMissing == true) {
if (typeof(arraytarget[key]) == 'string') {
wikEdDebugStartUpwikEdConfig['debugStartUp'] += '\t\t\t\'' + key + '\': \'' + arraytarget[key].replace(/\n/g, '\\n') + '\',\n';
}
}
}
}
return;
};
 
 
//
// WikEdAddToObject: add or replace properties, replace existing values
//
 
window.WikEdAddToObject = function(target, source) {
for (var key in source) {
target[key] = source[key];
}
return;
};
Line 1,641 ⟶ 1,700:
 
for (var key in preset) {
if (typeof(array[key]) == null'undefined') {
 
// remove MediaWiki path prefixes and add local path
if (wikEdUseLocalImageswikEdConfig['useLocalImages'] == true) {
array[key] = wikEdImagePathLocalwikEdConfig['imagePathLocal'] + preset[key].replace(/^[0-9a-f]+\/[0-9a-f]+\//, '');
}
 
// add path
else {
array[key] = wikEdImagePathwikEdConfig['imagePath'] + preset[key];
}
}
Line 1,744 ⟶ 1,803:
}
 
// detect if run as a bodyhead script added by Greasemonkey installer
if (document.getElementById('WikEdHeadScript') != null) {
wikEdGreasemonkeyToHead = true;
}
 
// check if this runs under Greasemonkey
// load external wikEd translation and language settings
if (typeof(GM_getValue) == 'function') {
if ( (wikEdLoadTranslation == true) && (wikEdTranslationLoaded == false) ) {
wikEdGreasemonkey = true;
var contentLang = WikEdGetGlobal('wgContentLanguage') || '';
}
var userLang = WikEdGetGlobal('wgUserLanguage') || '';
 
if ( (wikEdLanguageDefault != '') || (userLang != '') || (contentLang != '') ) {
// parse global-context (MediaWiki) variables into hash (for Greasemonkey)
window.addEventListener('message', WikEdGetGlobalsReceiver, false);
var globalNames = [, 'skin', 'wgServer', 'wgTitle', 'wgCanonicalNamespace', 'wgArticlePath', 'wgScript', 'wgScriptPath', 'wgUserName', 'wgCurRevisionId', 'wgScript', 'wgContentLanguage', 'wgUserLanguage', 'wgEnableAPI', 'wgPageName', 'wgNamespaceIds', 'wgFormattedNamespaces'];
if (wikEdGreasemonkey == true) {
globalNames.push('wikEdConfig', 'wikEdText');
}
 
// copy custom config settings and text after values have arrived
var gotGlobalsHook = [
function() {
if (wikEdGreasemonkey == true) {
WikEdAddToObject(wikEdConfig, wikEdWikiGlobals['wikEdConfig']);
WikEdAddToObject(wikEdText, wikEdWikiGlobals['wikEdText']);
}
return;
}
];
 
// and load translations when done
if ( (wikEdConfig['loadTranslation'] == true) && (wikEdLoadingTranslation == false) ) {
gotGlobalsHook.push(WikEdLoadTranslations);
}
 
// parse globals (asynchronous)
WikEdGetGlobals(globalNames, gotGlobalsHook);
 
// check for web storage
if (typeof(window.localStorage) == 'object') {
wikEdWebStorage = true;
}
 
// schedule the setup routine
WikEdAddEventListener(window, 'load', WikEdSetup, false);
 
return;
};
 
 
//
// WikEdLoadTranslations: load external wikEd translation and language settings
//
 
window.WikEdLoadTranslations = function() {
 
if ( (wikEdConfig['loadTranslation'] == true) && (wikEdLoadingTranslation == false) ) {
var contentLang = wikEdWikiGlobals['wgContentLanguage'] || '';
var userLang = wikEdWikiGlobals['wgUserLanguage'] || '';
if ( (wikEdConfig['languageDefault'] != '') || (userLang != '') || (contentLang != '') ) {
 
// simplified Chinese
Line 1,769 ⟶ 1,876:
 
WikedInitTranslations();
var scriptUrl = wikEdTranslationswikEdConfig[wikEdLanguageDefault'translations'][wikEdConfig['languageDefault']] || '';
if (scriptUrl == '') {
scriptUrl = wikEdTranslationswikEdConfig['translations'][userLang] || '';
if (scriptUrl == '') {
scriptUrl = wikEdTranslationswikEdConfig['translations'][contentLang] || '';
}
}
if (scriptUrl != '') {
WikEdAppendScript(scriptUrl, function(); {
 
wikEdTranslationLoaded = true;
// copy custom text after values have arrived
var gotGlobalsHook = function() {
WikEdAddToObject(wikEdText, wikEdWikiGlobals['wikEdText']);
return;
};
 
// parse globals (asynchronous)
WikEdGetGlobals(['wikEdText'], [gotGlobalsHook]);
wikEdLoadingTranslation = true;
});
}
}
}
 
// schedule the setup routine
WikEdAddEventListener(window, 'load', WikEdSetup, false);
 
return;
};
Line 1,795 ⟶ 1,908:
 
window.WikEdSetup = function() {
 
WikEdRemoveEventListener(window, 'load', WikEdSetup, false);
 
Line 1,817 ⟶ 1,931:
 
// ignore other diff.js scripts
if ( (scriptName == 'diff.js') && (scriptSrc != wikEdDiffScriptSrcwikEdConfig['diffScriptSrc']) ) {
continue;
}
Line 1,843 ⟶ 1,957:
 
// detect wikEd running as a gadget
if (wikEdGadgetwikEdConfig['gadget'] == null) {
if (wikEdExternalScripts['MediaWiki:Gadget-wikEd.js'] == true) {
wikEdGadgetwikEdConfig['gadget'] = true;
}
}
Line 1,859 ⟶ 1,973:
// detect MediaWiki page and its skin
WikedInitMediaWikiSkinIds();
for (var skin in wikEdMediaWikiSkinIdswikEdConfig['MediaWikiSkinIds']) {
if (wikEdMediaWikiSkinIdswikEdConfig['MediaWikiSkinIds'].hasOwnProperty(skin) == true) {
var logoContainerId = wikEdMediaWikiSkinIdswikEdConfig['MediaWikiSkinIds'][skin][0];
var logoToList = wikEdMediaWikiSkinIdswikEdConfig['MediaWikiSkinIds'][skin][1];
var rearrange = wikEdMediaWikiSkinIdswikEdConfig['MediaWikiSkinIds'][skin][2];
var skinIds = wikEdMediaWikiSkinIdswikEdConfig['MediaWikiSkinIds'][skin][3];
for (var i = 0; i < skinIds.length; i ++) {
if (document.getElementById(skinIds[i]) == null) {
Line 1,887 ⟶ 2,001:
// initialize user configurable variables
WikEdInitGlobalConfigs();
 
// import custom text and translations
WikEdAddToObject(wikEdConfig['text'], wikEdText);
 
// do not rearrange page elements
if (wikEdNoRearrangewikEdConfig['noRearrange'] != false) {
wikEdRearrange = false;
}
Line 1,895 ⟶ 2,012:
// initialize non-configurable variables
WikEdInitGlobals();
 
// parse global MediaWiki globals into hash
var variable = ['wgServer', 'wgTitle', 'wgCanonicalNamespace', 'wgArticlePath', 'wgScript', 'wgScriptPath', 'wgUserName', 'wgCurRevisionId', 'wgScript', 'wgContentLanguage', 'wgUserLanguage', 'wgEnableAPI', 'wgPageName'];
for (var i = 0; i < variable.length; i ++) {
wikEdWikiGlobals[ variable[i] ] = WikEdGetGlobal(variable[i]);
}
 
// check for updates
Line 1,912 ⟶ 2,023:
 
// add stylesheet definitions
WikEdApplyCSS(document, wikEdMainCSSwikEdConfig['mainCSS']);
 
// add image path to image filename
Line 1,969 ⟶ 2,080:
 
// load the external diff script if not already done
if ( (wikEdLoadDiffScriptwikEdConfig['loadDiffScript'] == true) && (wikEdExternalScripts['diff.js'] == null) ) {
if (typeof(WDiffString) == 'undefined') {
WikEdAppendScript(wikEdDiffScriptSrcwikEdConfig['diffScriptSrc']);
}
wikEdExternalScripts['diff.js'] = true;
Line 1,977 ⟶ 2,088:
 
// load the external wikEdDiff script if not already done
if ( (wikEdLoadDiffwikEdConfig['loadDiff'] == true) && (wikEdExternalScripts['wikEdDiff.js'] == null) ) {
if (typeof(WikEdDiff) == 'undefined') {
WikEdAppendScript(wikEdDiffSrcwikEdConfig['diffSrc']);
}
wikEdExternalScripts['wikEdDiff.js'] = true;
Line 1,986 ⟶ 2,097:
// load the MS IE selection/range compatibility library IERange
if (wikEdMSIE == true) {
if ( (wikEdLoadIERangewikEdConfig['loadIERange'] == true) && (wikEdExternalScripts['ierange.js'] == null) ) {
if (typeof(DOMUtils) == 'undefined') {
WikEdAppendScript(wikEdIERangeSrcwikEdConfig['IERangeSrc']);
}
wikEdExternalScripts['ierange.js'] = true;
Line 1,995 ⟶ 2,106:
 
// check if disabled
wikEdDisabled = WikEdGetSavedSetting('wikEdDisabled', wikEdDisabledPresetwikEdConfig['disabledPreset']);
if (wikEdDisabled == true) {
wikEdUseWikEd = false;
Line 2,018 ⟶ 2,129:
// ___location search string function: put all used images and icons on an empty page
if (window.___location.search.match(/(\?|&)wikEd=iconPage\b/i) != null) {
var str = wikEdTextwikEdConfig['text']['iconPage'];
for (var imageKey in wikEdImagewikEdConfig['image']) {
if (wikEdImagewikEdConfig['image'].hasOwnProperty(imageKey) == true) {
var imageAddress = wikEdImagewikEdConfig['image'][imageKey];
if (typeof(imageAddress) == 'string') {
str += '<img src="' + imageAddress + '"> ';
Line 2,106 ⟶ 2,217:
 
// browser or version not supported, set error message and exit
if ( (wikEdBrowserNotSupported == true) && (wikEdSkipBrowserTestwikEdConfig['skipBrowserTest'] == false) ) {
WikEdSetLogo('browser');
return;
}
 
// get the textarea and other form elements
var array = document.getElementsByName('wpEdittime');
if (array[0] != null) {
wikEdEdittime = array[0].value
}
var array = document.getElementsByName('wpEditToken');
if (array[0] != null) {
wikEdEditToken = array[0].value
}
 
// page type detection
 
// detect custom formedit elementspage
if (wikEdCustomEditFormIdwikEdConfig['customEditFormId'] != '') {
wikEdEditForm = document.getElementById(wikEdCustomEditFormIdwikEdConfig['customEditFormId']);
}
if (wikEdCustomTextAreaIdwikEdConfig['customTextAreaId'] != '') {
wikEdTextarea = document.getElementById(wikEdCustomTextAreaIdwikEdConfig['customTextAreaId']);
}
if (wikEdCustomSaveButtonIdwikEdConfig['customSaveButtonId'] != '') {
wikEdSaveButton = document.getElementById(wikEdCustomwikEdSaveButtonId);
}
 
// detect standard formedit elementspage
if (wikEdTextarea == null) {
wikEdTextarea = document.getElementsByName('wpTextbox1')[0];
Line 2,134 ⟶ 2,255:
wikEdSaveButton = document.getElementById('wpSave');
}
wikEdDiffPreviewButton = document.getElementById('wpDiff');
wikEdPreviewButton = document.getElementById('wpPreview');
 
// detect MediaWiki Semantic Forms extension support
if (wikEdTextarea == null) {
wikEdEditForm = document.getElementsByName('createbox')[0];
Line 2,141 ⟶ 2,264:
}
 
// detect edit raw watchlist page
if ( (wikEdEditForm == null) || (wikEdTextarea == null) ) {
wikEdTextarea = document.getElementById('titles');
if (wikEdTextarea != null) {
Line 2,171 ⟶ 2,294:
}
 
// checkdetect if it is an editupload page
if ( (wikEdTextarea == null) || (wikEdEditForm == null) || (wikEdSaveButton == null) ) {
 
// check if this is an upload page
wikEdTextarea = document.getElementsByName('wpUploadDescription')[0];
wikEdEditForm = document.getElementById('mw-upload-form');
wikEdSaveButton = document.getElementsByName('wpUpload')[0];
if ( (wikEdTextarea =!= null) ||&& (wikEdEditForm =!= null) ||&& (wikEdSaveButton =!= null) ) {
wikEdUploadEdit = true;
wikEdRearrange = false;
}
}
 
 
// set error indicator
// detect view and restore deleted pages
WikEdSetLogo();
if ( (wikEdTextarea == null) || (wikEdEditForm == null) || (wikEdSaveButton == null) ) {
return;
wikEdTextarea = document.getElementsByTagName('textarea')[0];
if (wikEdTextarea != null) {
 
// get form
var node = document.getElementsByName('preview')[0];
while (node != null) {
node = node.parentNode;
if (node.tagName == 'FORM') {
break;
}
}
wikEdEditForm = node;
if (wikEdEditForm != null) {
wikEdPreviewButton = document.getElementsByName('preview')[0];
wikEdViewDeleted = true;
wikEdRearrange = false;
}
}
}
 
// set page detection error indicator
if ( (wikEdTextarea == null) || (wikEdEditForm == null) ) {
WikEdSetLogo();
return;
}
 
// check if the textarea is read-only
if (wikEdConfig['skipReadOnlyTest'] == false) {
if ( (WikEdGetAttribute(wikEdTextarea, 'readonly') != null) || (wikEdSaveButton == null) ) {
wikEdReadOnly = true;
}
wikEdUploadEdit = true;
wikEdRearrange = false;
}
 
Line 2,194 ⟶ 2,347:
WikedInitButtonKey();
WikedInitButtonBar();
WikedInitHistoryLength();
WikedInitIncompatibleScripts();
 
// check for incompatible scripts
if (wikEdConfig['skipScriptTest'] == false) {
var scriptNames = '';
for (var key in wikEdConfig['incompatibleScripts']) {
if (wikEdConfig['incompatibleScripts'].hasOwnProperty(key) == true) {
var generalName = key;
var scriptName = wikEdConfig['incompatibleScripts'][key];
if (wikEdExternalScripts[scriptName] == true) {
if (scriptNames != '') {
scriptNames += ', ';
}
scriptNames += generalName;
}
}
}
if (scriptNames != '') {
WikEdSetLogo('incompatible', scriptNames);
return;
}
}
 
// define Unicode characters for fixing function
Line 2,214 ⟶ 2,390:
 
// load the external InstaView script
if ( (wikEdGreasemonkey == false) && (wikEdLoadInstaViewwikEdConfig['loadInstaView'] == true) && (wikEdExternalScripts['instaview.js'] == null) ) {
if (typeof(InstaView) == 'undefined') {
WikEdAppendScript(wikEdInstaViewSrcwikEdConfig['instaViewSrc']);
}
wikEdExternalScripts['instaview.js'] = true;
}
else if ( (wikEdGreasemonkey == false) || (wikEdLoadInstaViewwikEdConfig['loadInstaView'] != true) ) {
wikEdUseLocalPreviewwikEdConfig['useLocalPreview'] = false;
}
 
Line 2,250 ⟶ 2,426:
 
// add stylesheet definitions
WikEdApplyCSS(document, wikEdMainEditCSSwikEdConfig['mainEditCSS']);
 
// get button settings from saved settings
wikEdUsing = WikEdGetSavedSetting('wikEdSummaryUsing', wikEdUsingPresetwikEdConfig['usingPreset']);
wikEdUseWikEd = ! WikEdGetSavedSetting('wikEdUseClassic', ! wikEdUseWikEdPresetwikEdConfig['useWikEdPreset']);
wikEdHighlightSyntax = ! WikEdGetSavedSetting('wikEdSyntaxOff', ! wikEdHighlightSyntaxPresetwikEdConfig['highlightSyntaxPreset']);
wikEdFullScreenMode = WikEdGetSavedSetting('wikEdFullscreen', wikEdFullScreenModePresetwikEdConfig['fullScreenModePreset']);
wikEdCloseToolbar = WikEdGetSavedSetting('wikEdCloseToolbar', wikEdCloseToolbarPresetwikEdConfig['closeToolbarPreset']);
wikEdRefHide = WikEdGetSavedSetting('wikEdRefHide', wikEdRefHidePresetwikEdConfig['refHidePreset']);
wikEdDiff = WikEdGetSavedSetting('wikEdDiff', wikEdDiffPresetwikEdConfig['diffPreset']);
wikEdTableMode = false;
 
Line 2,328 ⟶ 2,504:
inputWrapperClass = 'wikEdInputWrapper';
}
 
 
// check if we use the wikEdEditor user interface of the vector skin
Line 2,489 ⟶ 2,664:
wikEdInputWrapper.appendChild(wikEdLocalPrevWrapper);
}
else if (wikEdSaveButton != null) {
else {
wikEdSaveButton.parentNode.appendChild(wikEdLocalPrevWrapper);
}
else if (wikEdPreviewButton != null) {
wikEdPreviewButton.parentNode.appendChild(wikEdLocalPrevWrapper);
}
else if (wikEdDiffPreviewButton != null) {
wikEdDiffPreviewButton.parentNode.appendChild(wikEdLocalPrevWrapper);
}
 
Line 2,516 ⟶ 2,697:
 
// display startup error messages
if (wikEdDebugStartUpwikEdConfig['debugStartUp'] != '') {
WikEdDebug(wikEdDebugStartUpwikEdConfig['debugStartUp']);
}
 
Line 2,588 ⟶ 2,769:
 
// move edit options after submit buttons; crashes Mozilla when appended after filling the iframe
wikEdDiffPreviewButton = document.getElementById('wpDiff');
wikEdPreviewButton = document.getElementById('wpPreview');
if (wikEdRearrange == true) {
if (wikEdDiffPreviewButton != null) {
Line 2,664 ⟶ 2,843:
html += ' spellcheck="false"';
}
if (wikEdReadOnly == false) {
 
html += ' onload="var doc = window.document; doc.designMode = \'on\'; ';
}
html += 'try { doc.execCommand(\'styleWithCSS\', 0, false); } catch (e) { ';
html += 'try { doc.execCommand(\'useCSS\', 0, true); } catch (e) { ';
Line 2,693 ⟶ 2,873:
 
// turn on designmode before adding content
if ( (onloadWorkaround == false) && (wikEdReadOnly == false) ) {
wikEdFrameDocument.designMode = 'on';
try { wikEdFrameDocument.execCommand('styleWithCSS', 0, false); } catch (e) {
Line 2,716 ⟶ 2,896:
// generate button bars and add them to the buttons wrapper
// form wrapper has been added against summary input submit defaulting to this button
if (wikEdReadOnly == false) {
wikEdButtonBarFormat = MakeButtonBar(wikEdButtonBar['format']);
wikEdButtonsWrapper.appendChild( wikEdButtonBarFormat = MakeButtonBar(wikEdConfig['buttonBar']['format']);
wikEdButtonsWrapper.appendChild(wikEdButtonBarFormat);
 
wikEdButtonBarTextify = MakeButtonBar(wikEdButtonBarwikEdConfig['buttonBar']['textify']);
wikEdButtonsWrapper.appendChild(wikEdButtonBarTextify);
}
 
wikEdButtonBarControl = MakeButtonBar(wikEdButtonBarwikEdConfig['buttonBar']['control']);
wikEdButtonsWrapper.appendChild(wikEdButtonBarControl);
 
if (wikEdButtonBarwikEdConfig['buttonBar']['custom1'][6].length > 0) {
wikEdButtonBarCustom1 = MakeButtonBar(wikEdButtonBarwikEdConfig['buttonBar']['custom1']);
wikEdButtonsWrapper.appendChild(wikEdButtonBarCustom1);
}
 
wikEdButtonBarFind = MakeButtonBar(wikEdButtonBarwikEdConfig['buttonBar']['find']);
wikEdButtonsWrapper.appendChild(wikEdButtonBarFind);
 
if (wikEdReadOnly == false) {
wikEdButtonBarFix = MakeButtonBar(wikEdButtonBar['fix']);
wikEdButtonBarFix = MakeButtonBar(wikEdConfig['buttonBar']['fix']);
wikEdButtonsWrapper.appendChild(wikEdButtonBarFix);
wikEdButtonsWrapper.appendChild(wikEdButtonBarFix);
}
 
if (wikEdButtonBarwikEdConfig['buttonBar']['custom2'][6].length > 0) {
wikEdButtonBarCustom2 = MakeButtonBar(wikEdButtonBarwikEdConfig['buttonBar']['custom2']);
wikEdButtonsWrapper.appendChild(wikEdButtonBarCustom2);
}
Line 2,752 ⟶ 2,936:
 
// add preview box top bar to submit wrapper
wikEdButtonBarPreview = MakeButtonBar(wikEdButtonBarwikEdConfig['buttonBar']['preview']);
if (wikEdRearrange == true) {
wikEdSubmitWrapper.insertBefore(wikEdButtonBarPreview, wikEdSubmitWrapper.firstChild);
Line 2,768 ⟶ 2,952:
wikEdPreviewBox.className = 'wikEdPreviewBox';
div.appendChild(wikEdPreviewBox);
wikEdButtonBarPreview2 = MakeButtonBar(wikEdConfig['buttonBar']['preview2']);
 
wikEdButtonBarPreview2 = MakeButtonBar(wikEdButtonBar['preview2']);
wikEdLocalPrevWrapper.appendChild(wikEdButtonBarPreview2);
}
Line 2,777 ⟶ 2,960:
if (wikiPreview != null) {
if (wikiPreview.firstChild != null) {
wikEdButtonBarJump = MakeButtonBar(wikEdButtonBarwikEdConfig['buttonBar']['jump']);
wikiPreview.insertBefore(wikEdButtonBarJump, wikiPreview.firstChild);
}
Line 2,795 ⟶ 2,978:
wikEdLocalPreview = document.createElement('button');
wikEdLocalPreview.id = 'wikEdLocalPreview';
wikEdLocalPreview.title = wikEdTextwikEdConfig['text']['wikEdLocalPreview title'];
wikEdLocalPreview.className = 'wikEdLocalPreview';
 
var localPreviewImg = document.createElement('img');
localPreviewImg.id = 'wikEdLocalPreviewImg';
localPreviewImg.src = wikEdImagewikEdConfig['image']['preview'];
localPreviewImg.alt = wikEdTextwikEdConfig['text']['wikEdLocalPreviewImg alt'];
localPreviewImg.title = wikEdTextwikEdConfig['text']['wikEdLocalPreview title'];
wikEdLocalPreview.appendChild(localPreviewImg);
 
Line 2,808 ⟶ 2,991:
wikEdPreviewButton.parentNode.insertBefore(wikEdLocalPreview, wikEdPreviewButton.nextSibling);
}
else if (wikEdSaveButton != null) {
else {
wikEdSaveButton.parentNode.insertBefore(wikEdLocalPreview, wikEdSaveButton.nextSibling);
}
Line 2,816 ⟶ 2,999:
wikEdLocalDiff = document.createElement('button');
wikEdLocalDiff.id = 'wikEdLocalDiff';
wikEdLocalDiff.title = wikEdTextwikEdConfig['text']['wikEdLocalDiff title'];
wikEdLocalDiff.className = 'wikEdLocalDiff';
 
var localDiffImg = document.createElement('img');
localDiffImg.id = 'wikEdLocalDiffImg';
localDiffImg.src = wikEdImagewikEdConfig['image']['diff'];
localDiffImg.alt = wikEdTextwikEdConfig['text']['wikEdLocalDiffImg alt'];
localDiffImg.title = wikEdTextwikEdConfig['text']['wikEdLocalDiff title'];
 
wikEdLocalDiff.appendChild(localDiffImg);
Line 2,842 ⟶ 3,025:
WikEdButton(document.getElementById('wikEdCaseSensitive'), 'wikEdCaseSensitive', null, false);
WikEdButton(document.getElementById('wikEdRegExp'), 'wikEdRegExp', null, false);
WikEdButton(document.getElementById('wikEdFindAhead'), 'wikEdFindAhead', null, wikEdFindAheadSelectedwikEdConfig['findAheadSelected']);
WikEdButton(document.getElementById('wikEdClose'), 'wikEdClose', null, false, 'wikEdButton');
WikEdButton(document.getElementById('wikEdClose2'), 'wikEdClose2', null, false, 'wikEdButton');
Line 2,848 ⟶ 3,031:
 
// hide typo fix button until typo fix rules are loaded and parsed
var fixRegExTypo = document.getElementById('wikEdFixRegExTypo').style.display = 'none';
if (fixRegExTypo != null) {
fixRegExTypo.style.display = 'none';
}
 
// hide buttons if API is not available
if ( (wikEdWikiGlobals['wgEnableAPI'] != true) && (wikEdWikiGlobals['wgEnableAPI'] != 'true') ) {
var fixRedirect = document.getElementById('wikEdFixRedirect').style.display = 'none';
if (fixRedirect != null) {
fixRedirect.style.display = 'none';
}
}
 
Line 2,865 ⟶ 3,054:
wikEdClearSummary.id = 'wikEdClearSummary';
wikEdClearSummary.className = 'wikEdClearSummary';
wikEdClearSummary.alt = wikEdTextwikEdConfig['text']['wikEdClearSummary alt'];
wikEdClearSummary.title = wikEdTextwikEdConfig['text']['wikEdClearSummary title'];
wikEdClearSummary.style.height = (wikEdSummaryText.clientHeight + 1) +'px';
clearSummaryForm.appendChild(wikEdClearSummary);
Line 2,872 ⟶ 3,061:
wikEdClearSummaryImg = document.createElement('img');
wikEdClearSummaryImg.id = 'wikEdClearSummaryImg';
wikEdClearSummaryImg.src = wikEdImagewikEdConfig['image']['clearSummary'];
wikEdClearSummaryImg.alt = 'Clear summary';
wikEdClearSummary.appendChild(wikEdClearSummaryImg);
Line 2,903 ⟶ 3,092:
// shorten submit button texts
if (wikEdPreviewButton != null) {
wikEdPreviewButton.value = wikEdTextwikEdConfig['text']['shortenedPreview'];
}
if (wikEdDiffPreviewButton != null) {
wikEdDiffPreviewButton.value = wikEdTextwikEdConfig['text']['shortenedChanges'];
}
 
Line 2,914 ⟶ 3,103:
wikEdInputElement['find'] = new Object(wikEdFindText);
wikEdSelectElement['find'] = new Object(document.getElementById('wikEdFindSelect'));
wikEdSelectElement['find'].title = wikEdTextwikEdConfig['text']['wikEdFindSelect title'];
 
wikEdFieldHist ['replace'] = [];
Line 2,920 ⟶ 3,109:
wikEdInputElement['replace'] = new Object(wikEdReplaceText);
wikEdSelectElement['replace'] = new Object(document.getElementById('wikEdReplaceSelect'));
wikEdSelectElement['replace'].title = wikEdTextwikEdConfig['text']['wikEdReplaceSelect title'];
 
if (wikEdSummaryInputWrapper != null) {
Line 2,927 ⟶ 3,116:
wikEdInputElement['summary'] = new Object(wikEdSummaryText);
wikEdSelectElement['summary'] = new Object(document.getElementById('wikEdSummarySelect'));
wikEdSelectElement['summary'].title = wikEdTextwikEdConfig['text']['wikEdSummarySelect title'];
}
 
Line 2,936 ⟶ 3,125:
 
// hide the button bars per saved setting
WikEdButtonBarInitif (wikEdButtonBarFormat != null); {
WikEdButtonBarInit(wikEdButtonBarTextifywikEdButtonBarFormat);
}
WikEdButtonBarInit(wikEdButtonBarControl);
if (wikEdButtonBarTextify != null) {
WikEdButtonBarInit(wikEdButtonBarTextify);
}
if (wikEdButtonBarControl != null) {
WikEdButtonBarInit(wikEdButtonBarControl);
}
if (wikEdButtonBarCustom1 != null) {
WikEdButtonBarInit(wikEdButtonBarCustom1);
}
WikEdButtonBarInitif (wikEdButtonBarFind != null); {
WikEdButtonBarInit(wikEdButtonBarFixwikEdButtonBarFind);
}
if (wikEdButtonBarFix != null) {
WikEdButtonBarInit(wikEdButtonBarFix);
}
if (wikEdButtonBarCustom2 != null) {
WikEdButtonBarInit(wikEdButtonBarCustom2);
Line 2,953 ⟶ 3,152:
// add a link to the wikEd help page
if (wikEdRearrange == true) {
if ( (wikEdHelpPageLinkwikEdConfig['helpPageLink'] != '') && (wikEdHelpPageLinkwikEdConfig['helpPageLink'] != null) ) {
var editHelpParent = wikEdDiffPreviewButton;
while (editHelpParent != null) {
Line 2,975 ⟶ 3,174:
wikEdHelpSpan.id = 'wikEdHelpSpan';
wikEdHelpSpan.className = 'wikEdHelpSpan';
wikEdHelpSpan.innerHTML = wikEdHelpPageLinkwikEdConfig['helpPageLink'].replace(/\{wikEdHomeBaseUrl\}/g, wikEdHomeBaseUrlwikEdConfig['homeBaseUrl']);
editHelpParent.insertBefore(wikEdHelpSpan, editHelp.nextSibling);
 
Line 2,987 ⟶ 3,186:
 
// copy page warnings above edit window
if (wikEdDoCloneWarningswikEdConfig['doCloneWarnings'] == true) {
if ( (wikEdClonedWarnings == false) && (wikEdPreviewPage == false) && (/(.*\n){2}/.test(wikEdOrigVersion) ) == true) {
var divs = document.getElementsByTagName('div');
Line 3,015 ⟶ 3,214:
wikEdDirection = WikEdGetStyle(document.body, 'direction');
wikEdFrameBody.style.direction = wikEdDirection;
WikEdApplyCSS(wikEdFrameDocument, wikEdFrameCSSwikEdConfig['frameCSS']);
WikEdHighlightNamedHideButtonsStylesheet = new WikEdStyleSheet(wikEdFrameDocument);
 
Line 3,024 ⟶ 3,223:
 
// adjust font size (px)
wikEdTextSizeInit = parseFloat(WikEdGetStyle(wikEdTextarea, 'fontSize')) * wikEdTextSizeAdjustwikEdConfig['textSizeAdjust'] / 100;
wikEdTextSize = wikEdTextSizeInit;
wikEdFrameBody.style.fontSize = wikEdTextSize + 'px';
Line 3,042 ⟶ 3,241:
 
// focus the input field
if (wikEdFocusEditwikEdConfig['focusEdit'] == true) {
if (wikEdUseWikEd == true) {
wikEdFrameWindow.focus();
Line 3,058 ⟶ 3,257:
 
// scroll
if ( (wikEdFullScreenMode == false) && (wikEdScrollToEditwikEdConfig['scrollToEdit'] == true) ) {
window.scroll(0, WikEdGetOffsetTop(wikEdEditForm) - 2);
}
Line 3,109 ⟶ 3,308:
 
// set button bar grip area events
if (wikEdButtonBarFormat != null) {
WikEdAddEventListener(wikEdButtonBarFormat.firstChild.firstChild, 'click', WikEdButtonBarGripHandler, false);
}
WikEdAddEventListener(wikEdButtonBarTextify.firstChild.firstChild, 'click', WikEdButtonBarGripHandler, false);
if (wikEdButtonBarTextify != null) {
WikEdAddEventListener(wikEdButtonBarControl.firstChild.firstChild, 'click', WikEdButtonBarGripHandler, false);
WikEdAddEventListener(wikEdButtonBarTextify.firstChild.firstChild, 'click', WikEdButtonBarGripHandler, false);
}
if (wikEdButtonBarControl != null) {
WikEdAddEventListener(wikEdButtonBarControl.firstChild.firstChild, 'click', WikEdButtonBarGripHandler, false);
}
if (wikEdButtonBarCustom1 != null) {
if (wikEdButtonBarCustom1.firstChild.firstChild != null) {
Line 3,117 ⟶ 3,322:
}
}
if (wikEdButtonBarFind != null) {
WikEdAddEventListener(wikEdButtonBarFind.firstChild.firstChild, 'click', WikEdButtonBarGripHandler, false);
}
WikEdAddEventListener(wikEdButtonBarFix.firstChild.firstChild, 'click', WikEdButtonBarGripHandler, false);
if (wikEdButtonBarFix != null) {
WikEdAddEventListener(wikEdButtonBarFix.firstChild.firstChild, 'click', WikEdButtonBarGripHandler, false);
}
if (wikEdButtonBarCustom2 != null) {
if (wikEdButtonBarCustom2.firstChild.firstChild != null) {
Line 3,220 ⟶ 3,429:
resizeGripImage.id = 'wikEdResizeGrip';
WikEdAddEventListener(resizeGripImage, 'load', WikEdResizeGripLoadHandler, true);
resizeGripImage.src = wikEdImagewikEdConfig['image']['resizeGrip'];
 
// run scheduled custom functions
WikEdExecuteHook(wikEdSetupHookwikEdConfig['setupHook']);
 
// load and parse RegExTypoFix rules if the button is enabled
Line 3,245 ⟶ 3,454:
 
// check if autoupdate is enabled
if (wikEdAutoUpdatewikEdConfig['autoUpdate'] != true) {
return;
}
Line 3,251 ⟶ 3,460:
// check for forced update check
var forcedUpdate = false;
if (wikEdForcedUpdatewikEdConfig['forcedUpdate'] != '') {
 
// get version numbers from strings
var currentVersion = WikEdVersionToNumber(wikEdProgramVersion);
var forcedVersion = WikEdVersionToNumber(wikEdForcedUpdatewikEdConfig['forcedUpdate']);
 
// schedule forced update check
Line 3,283 ⟶ 3,492:
var diffHours = (currentDate - lastCheckDate) / 1000 / 60 / 60;
if (wikEdGreasemonkey == true) {
if (diffHours > wikEdAutoUpdateHoursGMwikEdConfig['autoUpdateHoursGM']) {
regularUpdate = true;
}
}
else if (diffHours > wikEdAutoUpdateHourswikEdConfig['autoUpdateHours']) {
regularUpdate = true;
}
Line 3,297 ⟶ 3,506:
// save current update check date
WikEdSetPersistent('wikEdAutoUpdate', currentDate.toUTCString(), 0, '/');
 
 
// make the ajax request
var requestMethod = 'GET';
WikEdAjaxRequest('GET', wikEdAutoUpdateUrl, null, null, null, null, function(ajax) {
var requestUrl = wikEdConfig['autoUpdateUrl'];
var postFields = null;
var overrideMimeType = null;
WikEdAjaxRequest(requestMethod, requestUrl, postFields, overrideMimeType, function(ajax, obj) {
 
// get response
Line 3,343 ⟶ 3,557:
// update Greasemonkey script by navigating to the script code page
if (wikEdGreasemonkey == true) {
var updatePopup = wikEdTextwikEdConfig['text']['wikEdGreasemonkeyAutoUpdate'];
updatePopup = updatePopup.replace(/\{updateURL\}/g, wikEdAutoUpdateUrlwikEdConfig['autoUpdateUrl']);
alert(updatePopup);
window.___location.href = wikEdAutoUpdateScriptUrlwikEdConfig['autoUpdateScriptUrl'];
}
 
Line 3,364 ⟶ 3,578:
 
// load RegExTypoFix rules per Ajax if enabled
if ( (wikEdRegExTypoFixwikEdConfig['regExTypoFix'] == false) || (wikEdReadOnly == true) &&|| (wikEdTypoRulesFind.length ==> 0) ) {
return;
}
 
// make the ajax request
var requestMethod = 'GET';
WikEdAjaxRequest('GET', wikEdRegExTypoFixURL, null, null, null, null, function(ajax) {
var requestUrl = wikEdConfig['regExTypoFixURL'];
var postFields = null;
var overrideMimeType = null;
WikEdAjaxRequest(requestMethod, requestUrl, postFields, overrideMimeType, function(ajax) {
 
// get response
var rulesTxt = ajax.responseText;
 
// parse regexp rules
var regExp = new RegExp('^<Typo +word="(.+?)" +find="(.+?)" +replace="(.+?)" +/>', 'gim');
while ( (regExpMatch = regExp.exec(rulesTxt)) != null) {
 
// check if this is a valid regexp
var regExpFind;
try {
regExpFind = new RegExp(regExpMatch[2], 'gm');
}
catch (err) {
continue;
}
 
// save regexp and replace
wikEdTypoRulesFind.push(regExpFind);
wikEdTypoRulesReplace.push(regExpMatch[3]);
}
 
// display typo fix button
if (wikEdTypoRulesFind.length > 0) {
document.getElementById('wikEdFixRegExTypo').style.display = 'inline';
}
return;
});
}
return;
};
Line 3,524 ⟶ 3,743:
 
if ( (wikEdUsing == true) && (text != '') ) {
if (text.lastIndexOf(wikEdSummaryUsingwikEdConfig['summaryUsing']) < 0) {
if (wikEdAddNewSection != true) {
text += ' ' + wikEdSummaryUsingwikEdConfig['summaryUsing'];
}
}
Line 3,659 ⟶ 3,878:
 
event.stopPropagation();
 
var grip = event.target;
var gripWrapper = grip.parentNode;
Line 3,664 ⟶ 3,884:
var barInnerWrapper = gripWrapper.parentNode;
var bar = barInnerWrapper.parentNode;
 
if (event.type == 'click') {
buttonsWrapper.style.position = 'static';
 
// hide the buttons bar
if (buttonsWrapper.minimizedclassName != true'wikEdButtonBarButtonsWrapperHidden') {
buttonsWrapper.className = 'wikEdButtonBarButtonsWrapperHidden';
barInnerWrapper.className = 'wikEdButtonBarInnerWrapperHidden';
gripWrapper.className = 'wikEdButtonBarGripWrapperHidden';
wikEdButtonsWrapperWidth[bar.id] = buttonsWrapper.offsetWidth;
buttonsWrapper.className = 'wikEdButtonBarButtonsWrapperHidden';
buttonsWrapper.widthOriginal = buttonsWrapper.offsetWidth;
buttonsWrapper.style.display = 'none';
buttonsWrapper.minimized = true;
WikEdAddEventListener(grip, 'mouseover', WikEdButtonBarGripHandler, false);
WikEdSetPersistent(bar.id + 'Hidden', '1', 0, '/');
Line 3,682 ⟶ 3,900:
// unhide the buttons bar
else {
buttonsWrapper.className = 'wikEdButtonBarButtonsWrapperVisible';
barInnerWrapper.className = 'wikEdButtonBarInnerWrapperVisible';
gripWrapper.className = 'wikEdButtonBarGripWrapperVisible';
buttonsWrapper.className = 'wikEdButtonBarButtonsWrapperVisible';
buttonsWrapper.style.display = 'block';
buttonsWrapper.minimized = false;
WikEdRemoveEventListener(grip, 'mouseover', WikEdButtonBarGripHandler, false);
WikEdSetPersistent(bar.id + 'Hidden', '0', 0, '/');
Line 3,694 ⟶ 3,911:
// show the buttons bar on mouseover
else if (event.type == 'mouseover') {
if (buttonsWrapper.minimizedclassName == true'wikEdButtonBarButtonsWrapperHidden') {
WikEdAddEventListener(bar, 'mouseout', WikEdButtonBarHandler, false);
 
// show buttons to the right
if (bar.offsetParent.clientWidth > grip.offsetLeft + grip.offsetWidth + buttonsWrapperwikEdButtonsWrapperWidth[bar.widthOriginalid]) {
buttonsWrapper.style.left = (grip.offsetLeft + grip.offsetWidth) + 'px';
}
Line 3,704 ⟶ 3,921:
// show buttons to the left
else {
buttonsWrapper.style.left = (gripWrapper.offsetLeft - buttonsWrapperwikEdButtonsWrapperWidth[bar.widthOriginalid]) + 'px';
}
 
Line 3,732 ⟶ 3,949:
 
var bar = event.currentTarget;
 
var barInnerWrapper = bar.firstChild;
var gripWrapper = barInnerWrapper.firstChild;
Line 3,740 ⟶ 3,958:
// hide the buttons
if (event.type == 'mouseout') {
if (buttonsWrapper.minimizedclassName == true'wikEdButtonBarButtonsWrapperHidden') {
 
// filter the events for mouseouts actually leaving the bar
Line 3,919 ⟶ 4,137:
 
// check if disabled
if (wikEdAntiHighlightBleedingwikEdConfig['antiHighlightBleeding'] != true) {
return;
}
Line 4,383 ⟶ 4,601:
 
if (state == 'error') {
wikEdLogo.src = wikEdImagewikEdConfig['image']['error'];
wikEdLogo.alt = wikEdTextwikEdConfig['text']['wikEdLogo error alt'];
wikEdLogo.title = wikEdTextwikEdConfig['text']['wikEdLogo error title'];
}
else if (state == 'browser') {
wikEdLogo.src = wikEdImagewikEdConfig['image']['browser'];
wikEdLogo.alt = wikEdTextwikEdConfig['text']['wikEdLogo browser alt'];
wikEdLogo.title = wikEdTextwikEdConfig['text']['wikEdLogo browser title'];
}
else if (state == 'incompatible') {
wikEdLogo.src = wikEdImagewikEdConfig['image']['incompatible'];
wikEdLogo.alt = wikEdTextwikEdConfig['text']['wikEdLogo incompatible alt'];
wikEdLogo.title = wikEdTextwikEdConfig['text']['wikEdLogo incompatible title'];
}
else {
if (wikEdDisabled == true) {
wikEdLogo.src = wikEdImagewikEdConfig['image']['disabled'];
wikEdLogo.alt = wikEdTextwikEdConfig['text']['wikEdLogo disabled alt'];
wikEdLogo.title = wikEdTextwikEdConfig['text']['wikEdLogo disabled title'];
}
else {
wikEdLogo.src = wikEdImagewikEdConfig['image']['logo'];
wikEdLogo.alt = wikEdTextwikEdConfig['text']['wikEdLogo alt'];
wikEdLogo.title = wikEdTextwikEdConfig['text']['wikEdLogo title'];
}
}
var version = wikEdProgramVersion;
if (wikEdGadgetwikEdConfig['gadget'] == true) {
version += ' G';
}
Line 4,417 ⟶ 4,635:
}
else if (wikEdGreasemonkeyToHead == true) {
version += ' GMGMH';
}
wikEdLogo.title = wikEdLogo.title.replace(/\{wikEdParameter\}/g, parameter);
Line 4,465 ⟶ 4,683:
break;
default:
var currButton = wikEdButtonwikEdConfig['button'][buttonNo];
if (typeof(currButton) != 'object') {
alert('Loading error: The button "' + buttonNumbers[i] + '" is not defined.');
}
if ( (currButton[0] == 'wikEdSource') && (wikEdShowSourceButtonwikEdConfig['showSourceButton'] != true) ) {
break;
}
else if ( (currButton[0] == 'wikEdUsing') && (wikEdShowUsingButtonwikEdConfig['showUsingButton'] != true) ) {
break;
}
else if ( (currButton[0] == 'wikEdTableMode') && (wikEdShowTableModeButtonwikEdConfig['showTableModeButton'] != true) ) {
break;
}
Line 4,481 ⟶ 4,699:
// add accesskey information to button title and
var accessKey = '';
if (wikEdButtonKeywikEdConfig['buttonKey'][buttonNo] != null) {
accessKey = ' [' + wikEdTextwikEdConfig['text']['alt-shift'] + wikEdButtonKeywikEdConfig['buttonKey'][buttonNo][0] + ']';
 
// initialize wikEdButtonKeyCode[keyCode] = id
wikEdButtonKeyCode[ (wikEdButtonKeywikEdConfig['buttonKey'][buttonNo][1]) ] = currButton[0];
}
 
Line 4,509 ⟶ 4,727:
var html = '';
if (gripTitle != null) {
var gripStyle = 'width: ' + wikEdButtonBarGripWidthwikEdConfig['buttonBarGripWidth'] + 'px; ';
if (barHeight > 0) {
gripStyle += 'height: ' + barHeight + 'px; ';
Line 4,561 ⟶ 4,779:
gripWrapper.className = 'wikEdButtonBarGripWrapperHidden';
buttonsWrapper.className = 'wikEdButtonBarButtonsWrapperHidden';
buttonsWrapperwikEdButtonsWrapperWidth[bar.widthOriginalid] = buttonsWrapper.offsetWidth;
buttonsWrapper.style.display = 'none';
WikEdAddEventListener(grip, 'mouseover', WikEdButtonBarGripHandler, true);
Line 4,603 ⟶ 4,821:
}
}
if (wikEdButtonBarFormat.style.display != 'block';null) {
wikEdButtonBarTextify wikEdButtonBarFormat.style.display = 'block';
}
if (wikEdButtonBarTextify != null) {
wikEdButtonBarTextify.style.display = 'block';
}
if (wikEdButtonBarCustom1 != null) {
wikEdButtonBarCustom1.style.display = 'block';
}
if (wikEdButtonBarFind.style.display != 'block';null) {
wikEdButtonBarFix wikEdButtonBarFind.style.display = 'block';
}
if (wikEdButtonBarFix != null) {
wikEdButtonBarFix.style.display = 'block';
}
if (wikEdButtonBarCustom2 != null) {
wikEdButtonBarCustom2.style.display = 'block';
}
if (wikEdButtonBarControl.style.display != 'block';null) {
wikEdButtonBarControl.style.display = 'block';
}
wikEdFrameBody.scrollTop = scrollRatio * wikEdFrameBody.scrollHeight;
}
Line 4,639 ⟶ 4,867:
wikEdTextarea.style.display = 'block';
 
if (wikEdToolbarwikEdToolbarWrapper != null) {
wikEdToolbarWrapper.style.display = 'block';
}
if (wikEdButtonBarFormat.style.display != 'none';null) {
wikEdButtonBarTextify wikEdButtonBarFormat.style.display = 'none';
}
if (wikEdButtonBarTextify != null) {
wikEdButtonBarTextify.style.display = 'none';
}
if (wikEdButtonBarCustom1 != null) {
wikEdButtonBarCustom1.style.display = 'none';
}
if (wikEdButtonBarFind.style.display != 'none';null) {
wikEdButtonBarFix wikEdButtonBarFind.style.display = 'none';
}
if (wikEdButtonBarFix != null) {
wikEdButtonBarFix.style.display = 'none';
}
if (wikEdButtonBarCustom2 != null) {
wikEdButtonBarCustom2.style.display = 'none';
}
if (wikEdButtonBarControl.style.display != 'block';null) {
wikEdButtonBarControl.style.display = 'block';
}
wikEdTextarea.scrollTop = scrollRatio * wikEdTextarea.scrollHeight;
}
Line 4,805 ⟶ 5,043:
wikEdPreviewBox.style.height = previewHeight + 'px';
}
wikEdPreviewBox.innerHTML = wikEdTextwikEdConfig['text']['wikEdPreviewLoading'];
wikEdLocalPrevWrapper.style.display = 'inline';
 
// prepare ajax preview
wikEdPreviewIsAjax = false;
var postDatabodyData = wikEdTextarea.value;
 
// Opera 0.9.51
postDatabodyData = postDatabodyData.replace(/\r\n|\n\r|\r/g, '\n');
 
if (wikEdUseAjaxPreviewwikEdConfig['useAjaxPreview'] == true) {
var livePreview = true;
 
// articles on watchlist preview page
if (wikEdWatchlistEdit == true) {
postDatabodyData = postDatabodyData.replace(/\n{1}/g, '\n\n');
postDatabodyData = postDatabodyData.replace(/(.+)/g,
function (p, p1) {
if (/[\#<>\[\]\|\{\}]/.test(p1) == true) {
Line 4,832 ⟶ 5,070:
// postfix (User_talk) or prefix (Discussion_Utilisateur), test for xxx_ vs. _xxx (all ASCII non-letters as separator)
// Firefox 3.6.7 + Greasemonkey 0.8.20100408.06: invalid range with \{-‰ and \x8f-™
if (/[ -\/\:-\@\[-\`\{-\x88‰‹\x8d\x8f-\x98™›\x9d\xa0-»¿×÷]/.test(wikEdTextwikEdConfig['text']['talk namespace suffix']) == true) {
talk = article.replace(/([^:]*)/, wikEdTextwikEdConfig['text']['talk namespace suffix'] + '$1');
}
else {
talk = article.replace(/([^:]*)/, '$1' + wikEdTextwikEdConfig['text']['talk namespace suffix']);
}
}
else {
talk = wikEdTextwikEdConfig['text']['talk namespace'] + ':' + article;
}
var uriArticle = article.replace(/ /g, '_');
Line 4,847 ⟶ 5,085:
uriArticle = uriArticle.replace(/\'/g, '%27');
var hist = wikEdWikiGlobals['wgServer'] + wikEdWikiGlobals['wgScript'] + '?title=' + uriArticle + '&action=history';
return('[[:' + p1 + ']]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;([[:' + talk + '|' + wikEdTextwikEdConfig['text']['talk page'] + ']], [' + hist + ' ' + wikEdTextwikEdConfig['text']['history page'] + '])');
}
);
Line 4,860 ⟶ 5,098:
if (section.length > 0) {
if (/\d+/.test(section[0].value) == true) {
if (/<ref[^>\/]*>.*?<\/ref[^>]*>/i.test(postDatabodyData) == true) {
if (/<references\b[^>]*>/i.test(postDatabodyData) == false) {
postDatabodyData += '<div class="wikEdPreviewRefs"><references/></div>';
}
}
Line 4,871 ⟶ 5,109:
// GesHI syntax highlighting support, GeSHi css is only provided dynamically and not for &live
// so request a full preview and attach css to page, remember already loaded GeSHi languages
while ( (regExpMatch = /<(source|syntaxhighlight)\b[^>]*?lang\s*=\s*(\"|\')(\w+)\2/gi.exec(postDatabodyData)) != null) {
var lang = regExpMatch[3];
if (wikEdGeSHiCSS['wikEd' + lang] == null) {
Line 4,882 ⟶ 5,120:
 
// make the ajax request
WikEdAjaxPreview(postDatabodyData, WikEdLocalPreviewAjaxHandler, livePreview);
}
WED(2);
 
// prepare a local preview (Pilaf's InstaView), will be overwritten by Ajax version
if ( (wikEdUseLocalPreviewwikEdConfig['useLocalPreview'] == true) && (typeof(InstaView) == 'object') ) {WED(1);
InstaView.conf.user.name = wikEdWikiGlobals['wgUserName'];
var text = wikEdTextarea.value;
Line 4,938 ⟶ 5,176:
// call external diff program
var diffText = WDiffString(wikEdOrigVersion, currentVersion);
if (wikEdFullDiffwikEdConfig['fullDiff'] != true) {
diffText = WDiffShortenOutput(diffText);
}
Line 5,008 ⟶ 5,246:
 
// run scheduled custom functions
WikEdExecuteHook(wikEdFrameHookwikEdConfig['frameHook']);
}
 
Line 5,019 ⟶ 5,257:
 
// run scheduled custom functions
WikEdExecuteHook(wikEdTextareaHookwikEdConfig['textareaHook']);
}
break;
Line 5,648 ⟶ 5,886:
case 'wikEdReferences':
case 'wikEdReferencesSection':
var ref = wikEdTextwikEdConfig['text']['wikEdReferencesSection'];
ref = ref.replace(/</g, '&lt;');
ref = ref.replace(/>/g, '&gt;');
Line 6,011 ⟶ 6,249:
case 'wikEdImage':
if (obj.changed.plain != '') {
obj.changed.plain = '[[Image:<span class="wikEdInsertHere">' + wikEdTextwikEdConfig['text']['image filename'] + '</span>|thumb|<span class="wikEdInsertHere">' + wikEdTextwikEdConfig['text']['image width'] + '</span>px|' + obj.changed.plain + ']]';
}
else {
obj.changed.plain = '[[Image:<span class="wikEdInsertHere">' + wikEdTextwikEdConfig['text']['image filename'] + '</span>|thumb|<span class="wikEdInsertHere">' + wikEdTextwikEdConfig['text']['image width'] + '</span>px|<span class="wikEdInsertHere"> </span>]]';
if (obj.focusWord != null) {
if (obj.focusWord.plain != '') {
Line 6,031 ⟶ 6,269:
}
else if (wikEdTableMode == true) {
obj.changed.plain = '\n<table class="wikitable" border="1"><caption><span class="wikEdInsertHere">' + wikEdTextwikEdConfig['text']['table caption'] + '</span></caption><tr><th><span class="wikEdinserthere">' + wikEdTextwikEdConfig['text']['table heading'] + '</span></th><th><span class="wikEdinserthere">' + wikEdTextwikEdConfig['text']['table heading'] + '</span></th></tr><tr><td><span class="wikEdInsertHere">' + wikEdTextwikEdConfig['text']['table cell'] + '</span></td><td><span class="wikEdInsertHere">' + wikEdTextwikEdConfig['text']['table cell'] + '</span></td></tr><tr><td><span class="wikEdInsertHere">' + wikEdTextwikEdConfig['text']['table cell'] + '</span></td><td><span class="wikEdInsertHere">' + wikEdTextwikEdConfig['text']['table cell'] + '</span></td></tr></table>\n';
if (obj.focusLine.plain != '') {
obj.changed.plain = '\n' + obj.changed.plain + '\n';
Line 6,037 ⟶ 6,275:
}
else {
obj.changed.plain = '\n{| class="wikitable" border="1"\n|+ <span class="wikEdInsertHere">' + wikEdTextwikEdConfig['text']['table caption'] + '</span>\n! <span class="wikEdinserthere">' + wikEdTextwikEdConfig['text']['table heading'] + '</span> !! <span class="wikEdInsertHere">' + wikEdTextwikEdConfig['text']['table heading'] + '</span>\n|-\n| <span class="wikEdInsertHere">' + wikEdTextwikEdConfig['text']['table cell'] + '</span> || <span class="wikEdInsertHere">' + wikEdTextwikEdConfig['text']['table cell'] + '</span>\n|-\n| <span class="wikEdInsertHere">' + wikEdTextwikEdConfig['text']['table cell'] + '</span> || <span class="wikEdInsertHere">' + wikEdTextwikEdConfig['text']['table cell'] + '</span>\n|}\n';
if (obj.focusLine.plain != '') {
obj.changed.plain = '\n' + obj.changed.plain + '\n';
Line 6,066 ⟶ 6,304:
}
else {
linkTarget = '<span class="wikEdInsertHere">' + wikEdTextwikEdConfig['text']['redirect article link'] + '</span>';
}
 
Line 6,378 ⟶ 6,616:
break;
case 'wikEdFixRegExTypo':
if ( (wikEdRegExTypoFixwikEdConfig['regExTypoFix'] == true) && (wikEdTypoRulesFind.length > 0) ) {
WikEdFixTypos(obj.changed);
}
Line 6,723 ⟶ 6,961:
 
// parse response into file url cache
var regExpFile = new RegExp('\\n((Image|File|' + wikEdTextwikEdConfig['text']['wikicode Image'] + '|' + wikEdTextwikEdConfig['text']['wikicode File'] + '):[^ ]+) +(\\d+) +(.*)', 'ig');
var regExpMatch;
while ( (regExpMatch = regExpFile.exec(html)) != null) {
Line 6,741 ⟶ 6,979:
}
else {
fileObj.url = wikEdImagewikEdConfig['image']['noFile'];
fileObj.width = 16;
fileObj.height = 16;
Line 6,849 ⟶ 7,087:
var inputOffset = WikEdGetOffsetTop(wikEdInputWrapper);
var editOffset = WikEdGetOffsetTop(wikEdEditWrapper);
var submitOffset = WikEdGetOffsetTop(wikEdSaveButton)0;
if (wikEdSaveButton != null) {
submitOffset = WikEdGetOffsetTop(wikEdSaveButton);
}
else if (wikEdPreviewButton != null) {
submitOffset = WikEdGetOffsetTop(wikEdPreviewButton);
}
else if (wikEdDiffPreviewButton != null) {
submitOffset = WikEdGetOffsetTop(wikEdDiffPreviewButton);
}
var editHeight = wikEdEditWrapper.clientHeight;
 
Line 6,877 ⟶ 7,124:
// window.clearTimeout(wikEdLinkifyTimeoutId);
// wikEdLinkifyTimeoutId = null;
if (wikEdLinkifywikEdConfig['linkify'] != true) {
return;
}
Line 6,916 ⟶ 7,163:
rules += '.wikEdRefButtonShow' + i + ' { border: 1px solid; border-color: #000 #e8e8e8 #e8e8e8 #000; background: #c8c4c0; }\n';
 
rules += '.wikEdRefButton' + i + ':before, .wikEdRefButtonShow' + i + ':before { content: "' + wikEdTextwikEdConfig['text']['hideRef'] + ' ' + wikEdReferenceArray[i].text + '"; line-height: 0.75em; font-size: 65%; color: #000; font-family: sans-serif; }\n';
 
wikEdReferenceArray[i].added = true;
Line 6,930 ⟶ 7,177:
rules += '.wikEdTemplButtonShow' + i + ' { border: 1px solid; border-color: #000 #e8e8e8 #e8e8e8 #000; background: #c8c4c0; }\n';
 
rules += '.wikEdTemplButton' + i + ':before, .wikEdTemplButtonShow' + i + ':before { content: "' + wikEdTextwikEdConfig['text']['hideTempl'] + ' ' + wikEdTemplateArray[i].text + '"; line-height: 0.75em; font-size: 65%; color: #000; font-family: sans-serif; }\n';
 
wikEdTemplateArray[i].added = true;
Line 6,967 ⟶ 7,214:
window.WikEdHideAddHandlers = function() {
 
if ( (wikEdHideContentwikEdConfig['hideContent'] != true) || (wikEdRefHide != true) ) {
return;
}
Line 7,119 ⟶ 7,366:
 
hideButton.className = hideButtonClass;
hideButton.title = wikEdTextwikEdConfig['text'][hideButtonClass.replace(/\d+$/g, '') + 'Tooltip'];
 
WikEdAddEventListener(hideButton, 'mouseover', WikEdHideShowHandler, true);
Line 7,140 ⟶ 7,387:
 
hideButton.className = hideButtonClass;
hideButton.title = wikEdTextwikEdConfig['text'][hideButtonClass.replace(/\d+$/g, '') + 'Tooltip'];
 
WikEdRemoveEventListener(hideButton, 'mouseover', WikEdHideShowHandler, true);
Line 7,988 ⟶ 8,235:
 
// uppercase well known headings
var regExp = new RegExp('\\n=+ ' + wikEdTextwikEdConfig['text']['External links'] + '? =+\\n', 'gi');
obj.plain = obj.plain.replace(regExp, '\n== ' + wikEdTextwikEdConfig['text']['External links'] + ' ==\n');
regExp = new RegExp('\\n=+ ' + wikEdTextwikEdConfig['text']['See also'] + ' =+\\n', 'gi');
obj.plain = obj.plain.replace(regExp, '\n== ' + wikEdTextwikEdConfig['text']['See also'] + ' ==\n');
regExp = new RegExp('\\n=+ ' + wikEdTextwikEdConfig['text']['References'] + '? =+\\n', 'gi');
obj.plain = obj.plain.replace(regExp, '\n== ' + wikEdTextwikEdConfig['text']['References'] + ' ==\n');
 
// add space after * # : ; (list) and after {| |- |+ | (table), spare #REDIRECT
Line 8,013 ⟶ 8,260:
var tableflag = false;
 
for (var i = 0; i < lines.length; i ++) {
var line = lines[i];
 
Line 8,038 ⟶ 8,285:
 
// empty line before and after images
var regExp = new RegExp('^(\\[\\[(Image|File|' + wikEdTextwikEdConfig['text']['wikicode Image'] + '|' + wikEdTextwikEdConfig['text']['wikicode File'] + '):.*?\\]\\])', 'ig');
line = line.replace(regExp, '\n$1');
 
regExp = new RegExp('(\\[\\[(Image|File|' + wikEdTextwikEdConfig['text']['wikicode Image'] + '|' + wikEdTextwikEdConfig['text']['wikicode File'] + '):.*?(\\[\\[.*?\\]\\].*?)*\\]\\])$', 'ig');
line = line.replace(regExp, '$1\n');
 
Line 8,084 ⟶ 8,331:
 
// empty line before and after categories
var regExp = new RegExp('( |\\n)*(\\[\\[(Category|' + wikEdTextwikEdConfig['text']['wikicode Category'] + ')\\s*:[^\\n]*?\\]\\])( |\\n)*', 'gi');
obj.plain = obj.plain.replace(regExp, '\n\n$2\n\n');
 
// categories not separated by empty lines (lookahead)
regExp = new RegExp('(\\[\\[(Category|' + wikEdTextwikEdConfig['text']['wikicode Category'] + ')\\s*:[^\\n]*?\\]\\])\\n*(?=\\[\\[(Category|' + wikEdTextwikEdConfig['text']['wikicode Category'] + ')\\s*:[^\\n]*?\\]\\])', 'gi');
obj.plain = obj.plain.replace(regExp, '$1\n');
 
Line 8,132 ⟶ 8,379:
);
 
if (wikEdFixPunctFrenchwikEdConfig['fixPunctFrench'] == true) {
obj.plain = obj.plain.replace(/(«) *()/g, '$1 ');
obj.plain = obj.plain.replace(/ *(»)/g, ' $1');
Line 8,237 ⟶ 8,484:
 
// check if api is enabled
if ( ( (wikEdWikiGlobals['wgEnableAPI'] != true) && (wikEdWikiGlobals['wgEnableAPI'] != 'true') ) || (wikEdScriptURL == '') ) {
return;
}
Line 8,245 ⟶ 8,492:
 
// get wiki links
var urllinks = '';
 
// 1 [[ 2 2 3 34# 4 5 6 6 5 ]] 1
var regExpLink = /(\[\[\s*(:?)\s*([^\n#<>\[\]\{\}\|]+)(\s*#[^\n\[\]\|]*?)?(\s*\|(.|\s)*?)?\]\]\s*)/g;
while ( (regExpMatch = regExpLink.exec(obj.plain)) != null) {
urllinks += encodeURIComponent(regExpMatch[3] + '|');
}
if (links == '') {
 
// no wikilinks found
if (url == '') {
return;
}
 
// prepare the request
var postFields = {};
postFields['titles'] = links;
postFields['redirects'] = 'true';
postFields['format'] = 'xml';
postFields['action'] = 'query';
if (wikEdEdittime != null) {
postFields['wikEdEdittime'] = wikEdEdittime;
}
if (wikEdEditToken != null) {
postFields['wpEditToken'] = wikEdEditToken;
}
var requestUrl = wikEdScriptURL + 'api.php';
var requestMethod = 'POST';
var overrideMimeType = undefined;//'text/html';
 
// make the ajax request
WikEdAjaxRequest(requestMethod, requestUrl, postFields, overrideMimeType, function(ajax, obj) {
url = wikEdScriptURL + 'api.php?action=query&redirects&format=xml&titles=' + url;
WikEdAjaxRequest('GET', url, null, null, null, null, function(ajax, obj) {
 
// get response
var txt = ajax.responseText;
 
if ( (regExpMatch = txt.match(/<redirects>((.|\s)*?)<\/redirects>/)) != null) {
var redirects = regExpMatch[1];
Line 8,347 ⟶ 8,606:
 
// lowercase link target if link text starts with lowercase (main space only)
if (wikEdArticlesCaseSensitivewikEdConfig['articlesCaseSensitive'] == false) {
if (/:/.test(linkTarget) != true) {
if (article.charAt(0).toLowerCase() == article.charAt(0)) {
Line 8,772 ⟶ 9,031:
 
// uppercase images
var regExp = new RegExp('(\\[\\[)(Image|File|' + wikEdTextwikEdConfig['text']['wikicode Image'] + '|' + wikEdTextwikEdConfig['text']['wikicode File'] + '):([\\wŠŒŽšœžŸÀ-ÖØ-öø-\\u0220\\u0222-\\u0233ΆΈΉΊΌΎΏΑ-ΡΣ-ώ\\u0400-\\u0481\\u048a-\\u04ce\\u04d0-\\u04f5\\u04f8\\u04f9])([^\\n]*\\]\\])', 'igm');
obj.plain = obj.plain.replace(regExp,
function (p, p1, p2, p3, p4) {
Line 9,321 ⟶ 9,580:
function (p, p1, p2) {
var table = '\x00\x00{|';
if (wikEdWikifyTableParameterswikEdConfig['wikifyTableParameters'] != '') {
table += ' ' + wikEdWikifyTableParameterswikEdConfig['wikifyTableParameters'];
}
else {
Line 9,493 ⟶ 9,752:
 
// category link
var regExp = new RegExp('^(Category|' + wikEdTextwikEdConfig['text']['wikicode Category'] + ')\\s*:(.*)', 'i');
regExpMatch = regExp.exec(linkArticle);
if (regExpMatch != null) {
return('[[' + wikEdTextwikEdConfig['text']['wikicode Category'] + ':' + regExpMatch[1].charAt(0).toUpperCase() + linkText.substr(1) + ']]');
}
 
Line 9,557 ⟶ 9,816:
 
// clean up MediaWiki category list
var regExp = new RegExp('<span\\b[^>]*>(\\[\\[(Category|' + wikEdTextwikEdConfig['text']['wikicode Category'] + ')\\s*:[^\\]]+\\]\\])<\\/span>[\\s\\x00\\|]*', 'gi');
obj.html = obj.html.replace(regExp, '$1\x00');
 
Line 9,597 ⟶ 9,856:
imgLink = regExpMatch[1];
if (imgLink != '') {
return('[[' + wikEdTextwikEdConfig['text']['wikicode Image'] + ':' + imgLink + imgWidth + imgAlt + ']]');
}
}
Line 10,041 ⟶ 10,300:
 
// remove highlighting error messages
if (wikEdHighlightErrorwikEdConfig['highlightError'] == true) {
obj.html = obj.html.replace(/<span\b[^>]*?\bclass=\"wikEdHighlightErrorwikEdConfig['highlightError']\"[^>]*>.*?<\/span><!--wikEdHighlightErrorwikEdConfig['highlightError']-->/g, '');
}
 
Line 10,218 ⟶ 10,477:
['(^\\s*)#REDIRECT(?=\\s*\\[\\[)', 'redirect', 'block'], // redirect
 
['\\[\\[(?=(Image|File|' + wikEdTextwikEdConfig['text']['wikicode Image'] + '|' + wikEdTextwikEdConfig['text']['wikicode File'] + ')\\s*:\\s*)', 'file', 'open'], // file link start /// add translation
['\\[\\[', 'link', 'open'], // wikilink, category start with interlink detection
['\\]\\]', 'doubleCloseBracket', 'close'], // wikilink, category, file link, redirect end
Line 10,298 ⟶ 10,557:
window.WikEdHighlightSyntax = function(obj, noTimeOut) {
 
// start timer to cancel after wikEdMaxHighlightTimewikEdConfig['maxHighlightTime'] ms
var highlightStartDate = new Date();
 
Line 10,383 ⟶ 10,642:
while ( (parseObj.regExpMatch = wikEdParseObj.regExpTags.exec(obj.html)) != null) {
 
// cancel highlighting after wikEdMaxHighlightTimewikEdConfig['maxHighlightTime'] ms
if (noTimeOut != true) {
var currentDate = new Date();
if ( (currentDate - highlightStartDate) > wikEdMaxHighlightTimewikEdConfig['maxHighlightTime']) {
break;
}
Line 10,456 ⟶ 10,715:
var errorText;
if (parseObj.lastOpenTag == 'link') {
errorText = wikEdTextwikEdConfig['text']['wikEdErrorCodeInLinkName'];
}
else if (parseObj.lastOpenTag == 'template') {
errorText = wikEdTextwikEdConfig['text']['wikEdErrorCodeInTemplName'];
}
else if (parseObj.lastOpenTag == 'parameter') {
errorText = wikEdTextwikEdConfig['text']['wikEdErrorCodeInParamName'];
}
WikEdHighlightMarkLastOpenNode(errorText, parseObj);
Line 10,557 ⟶ 10,816:
break;
default:
parseObj.tree.push( { 'start': tagFrom, 'tagLength': tagLength, 'type': 'error', 'left': wikEdTextwikEdConfig['text']['wikEdErrorBoldItalic'] } );
break;
}
Line 10,645 ⟶ 10,904:
'tagLength': node.tagLength,
'type': 'error',
'left': wikEdTextwikEdConfig['text']['wikEdErrorTemplParam']
} );
redefinedTag = 'spare';
Line 10,698 ⟶ 10,957:
'tagLength': openNode.tagLength,
'type': 'error',
'left': wikEdTextwikEdConfig['text']['wikEdErrorTemplParamAmbig']
} );
parseObj.tree.push( {
Line 10,704 ⟶ 10,963:
'tagLength': tagLength,
'type': 'error',
'left': wikEdTextwikEdConfig['text']['wikEdErrorTemplParamAmbig']
} );
}
Line 10,714 ⟶ 10,973:
'tagLength': openNode.tagLength,
'type': 'error',
'left': wikEdTextwikEdConfig['text']['wikEdErrorTemplParam']
} );
parseObj.tree.push( {
Line 10,720 ⟶ 10,979:
'tagLength': tagLength,
'type': 'error',
'left': wikEdTextwikEdConfig['text']['wikEdErrorTemplParam']
} );
}
Line 10,962 ⟶ 11,221:
// unrecognized tag
default:
parseObj.tree.push( { 'start': tagFrom, 'tagLength': tagLength, 'type': 'error', 'left': wikEdTextwikEdConfig['text']['wikEdErrorNoHandler'] } );
}
 
Line 10,976 ⟶ 11,235:
// mark remaining unmatched opening tags
while ( (parseObj.lastOpenNode != 0) && (parseObj.lastOpenNode != null) ) {
WikEdHighlightMarkLastOpenNode(wikEdTextwikEdConfig['text']['wikEdErrorNoClose'], parseObj);
}
}
Line 11,044 ⟶ 11,303:
 
// get file previews
if ( (wikEdFilePreviewwikEdConfig['filePreview'] == true) && (wikEdFilePreviewRequest != '') ) {
WikEdAjaxPreview(wikEdFilePreviewRequest, WikEdFilePreviewAjaxHandler);
wikEdFilePreviewRequest = '';
Line 11,061 ⟶ 11,320:
 
// remove comments
if (wikEdRemoveHighlightCommentswikEdConfig['removeHighlightComments'] == true) {
obj.html = obj.html.replace(/<!--wikEd[\w\/]+-->/g, '');
}
Line 11,204 ⟶ 11,463:
'tagLength': tagLength,
'type': 'error',
'left': wikEdTextwikEdConfig['text']['wikEdErrorNoOpen']
} );
}
Line 11,237 ⟶ 11,496:
(node.tag == 'boldItalic')
) {
WikEdHighlightMarkLastOpenNode(wikEdTextwikEdConfig['text']['wikEdErrorNewline'], parseObj);
WikEdHighlightGetLevel(parseObj);
}
Line 11,292 ⟶ 11,551:
nodeNo = node.parent;
node.type = 'error';
node.left = wikEdTextwikEdConfig['text']['wikEdErrorNoClose'];
node.parent = null;
}
Line 11,306 ⟶ 11,565:
'tagLength': tagLength,
'type': 'error',
'left': wikEdTextwikEdConfig['text']['wikEdErrorNoOpen']
} );
break;
Line 11,338 ⟶ 11,597:
 
// convert opening tag to error
WikEdHighlightMarkLastOpenNode(wikEdTextwikEdConfig['text']['wikEdErrorTemplHeading'], parseObj);
 
parseObj.tree.push( {
Line 11,344 ⟶ 11,603:
'tagLength': tagLength,
'type': 'error',
'left': wikEdTextwikEdConfig['text']['wikEdErrorTemplHeading']
} );
break;
Line 11,578 ⟶ 11,837:
 
// linkify
var regExpCasing = new RegExp('(^|\\:)' + wikEdTextwikEdConfig['text']['wikicode Category'] + '(\\:|$)', 'i');
nsClean = nsClean.replace(regExpCasing, '$1' + wikEdTextwikEdConfig['text']['wikicode Category'] + '$2');
if (nsClean == ':') {
nsClean = '';
Line 11,586 ⟶ 11,845:
}
}
if (nsClean.toLowerCase() == wikEdTextwikEdConfig['text']['wikicode Category'].toLowerCase() + ':') {
insertLeft = '<span class="wikEdCat"' + follow + '><span class="wikEdLinkTag">';
insertRight = '</span><!--wikEdLinkTag--><span class="wikEdCatName">';
Line 11,601 ⟶ 11,860:
case 'file':
var previewCode = '';
var regExpFile = new RegExp('^\\s*(Image|File|' + wikEdTextwikEdConfig['text']['wikicode Image'] + '|' + wikEdTextwikEdConfig['text']['wikicode File'] + ')\\s*:\\s*([^\\|\\n]*)', 'i');
var regExpMatch = regExpFile.exec(innerPlain);
if (regExpMatch == null) {
Line 11,613 ⟶ 11,872:
 
// add file preview box
if (wikEdFilePreviewwikEdConfig['filePreview'] == true) {
 
// get image size
var filePreviewSize = wikEdFilePreviewSizewikEdConfig['filePreviewSize'];
var regExpMatch;
if ( (regExpMatch = /\|(\d+)px(\||$)/.exec(innerPlain)) != null) {
var size = parseInt(regExpMatch[1]);
if ( (size > 0) && (size < wikEdFilePreviewSizewikEdConfig['filePreviewSize']) ) {
filePreviewSize = size;
}
Line 11,646 ⟶ 11,905:
wikEdFilePreviewIds[wikEdFilePreviewNo] = file + filePreviewSize;
}
previewCode = '<span class="wikEdFilePreview" id="wikEdFilePreview' + wikEdFilePreviewNo + '" style="' + style + '" title="' + wikEdTextwikEdConfig['text']['wikEdFilePreview'] + '(' + file + ')"></span><!--wikEdFilePreview-->';
wikEdFilePreviewNo ++;
}
Line 11,667 ⟶ 11,926:
case 'template':
 
// do not hide templates if it has no parameters or if it shorter than wikEdTemplNoHideLengthwikEdConfig['templNoHideLength'] chars
if ( (innerPlain.indexOf('|') == -1) || (innerPlain.length < wikEdTemplNoHideLengthwikEdConfig['templNoHideLength']) ) {
node.noHide = true;
}
Line 11,680 ⟶ 11,939:
var follow = '';
 
// 12 mod 2 : 1 34 : 4 5 namespace 53 6 template 6 7 89 param 98
var regExpTempl = new RegExp('^\\s*((' + wikEdTemplModifier + ')\\:\\s*)?((\\:\\s*)?([^\\:\\|\\[\\]\\{\\}\\s\\x00\\x01]*\\s*\\:))?\\s*([^\\:\\n\\x00\\x01\\{\\}]+?)\\s*(\\|((.|\\n)*?))?\\s*$', 'gi');
 
Line 11,691 ⟶ 11,950:
if (regExpMatch[1] != null) {
mod = regExpMatch[1];
interClean = intermod.replace(/\s+$/g, '');
interClean = inter.replace(/:$/g, '');
}
Line 11,782 ⟶ 12,041:
}
else if (ns == '') {
 
ns = wikEdText['wikicode Template'] + ':';
// no Template: addition for subpage linking
if (template.indexOf('/') != 0) {
ns = wikEdConfig['text']['wikicode Template'] + ':';
}
}
follow = ' ' + WikEdHighlightLinkify(ns, template);
Line 11,807 ⟶ 12,070:
}
}
insertLeft = '<span class="wikEdTemplContainer"><button class="' + hideButtonClass + wikEdTemplateArray.length + '" title="' + wikEdTextwikEdConfig['text']['wikEdTemplButtonTooltip'] + '"></button><!--wikEdTemplButton--></span><!--wikEdTemplContainer-->';
wikEdTemplateArray.push( {'text': template, 'added': false} );
}
Line 11,879 ⟶ 12,142:
break;
case 'p':
insertLeft = '<span class="wikEdHtmlUnknown" title="' + wikEdTextwikEdConfig['text']['wikEdErrorHtmlUnknown'] + '">';
pushRight = '</span><!--wikEdHtmlUnknown-->';
break;
Line 11,905 ⟶ 12,168:
if (wikEdRefHide == true) {
if (refName != '') {
insertLeft = '<span class="wikEdRefContainer"><button class="wikEdRefButton' + wikEdReferenceArray.length + '" title="' + wikEdTextwikEdConfig['text']['wikEdRefButtonTooltip'] + '"></button><!--wikEdRefButton--></span><!--wikEdRefContainer-->';
wikEdReferenceArray.push( {'text': refName, 'added': false} );
}
else {
insertLeft = '<span class="wikEdRefContainer"><button class="wikEdRefButton" title="' + wikEdTextwikEdConfig['text']['wikEdRefButtonTooltip'] + '"></button><!--wikEdRefButton--></span><!--wikEdRefContainer-->';
}
}
Line 11,922 ⟶ 12,185:
case 'heading':
var heading = innerPlain.replace(/^\s+|\s+$/g, '');
if ( (heading == wikEdTextwikEdConfig['text']['See also']) || (heading == wikEdTextwikEdConfig['text']['References']) || (heading == wikEdTextwikEdConfig['text']['External links']) ) {
insertLeft = '<span class="wikEdHeadingWP">';
}
Line 12,067 ⟶ 12,330:
break;
case 'p':
insertLeft = '<span class="wikEdHtmlUnknown" title="' + wikEdTextwikEdConfig['text']['wikEdErrorHtmlUnknown'] + '">';
pushRight = '</span><!--wikEdHtmlUnknown-->';
break;
Line 12,162 ⟶ 12,425:
break;
case 'signature':
var title = wikEdTextwikEdConfig['text']['wikEdSignature' + tagLength];
insertLeft = '<span class="wikEdSignature" title="' + title + '">';
insertRight = '</span><!--wikEdSignature-->';
Line 12,209 ⟶ 12,472:
break;
case 'htmlUnknown':
insertLeft = '<span class="wikEdHtmlUnknown" title="' + wikEdTextwikEdConfig['text']['wikEdErrorHtmlUnknown'] + '">';
pushRight = '</span><!--wikEdHtmlUnknown-->';
break;
Line 12,225 ⟶ 12,488:
if (wikEdRefHide == true) {
if (refName != '') {
insertLeft = '<span class="wikEdRefContainer"><button class="wikEdRefButton' + wikEdReferenceArray.length + '" title="' + wikEdTextwikEdConfig['text']['wikEdRefButtonTooltip'] + '"></button><!--wikEdRefButton--></span><!--wikEdRefContainer-->';
wikEdReferenceArray.push( {'text': refName + ' ↑', 'added': false} );
}
else {
insertLeft = '<span class="wikEdRefContainer"><button class="wikEdRefButton" title="' + wikEdTextwikEdConfig['text']['wikEdRefButtonTooltip'] + '"></button><!--wikEdRefButton--></span><!--wikEdRefContainer-->';
}
}
Line 12,378 ⟶ 12,641:
if (character != null) {
if (wikEdRefHide == true) {
insertLeft = '<span class="wikEdCharEntityContainer"><button class="wikEdCharEntityButton' + wikEdCharEntityArray.length + '" title="' + wikEdTextwikEdConfig['text']['wikEdCharEntityButtonTooltip'] + '"></button><!--wikEdCharEntityButton--></span><!--wikEdCharEntityContainer-->';
wikEdCharEntityArray.push( {'text': character, 'added': false} );
}
Line 12,392 ⟶ 12,655:
case 'error':
insertLeft = '<span class="wikEdError" title="' + node.left + '">';
if (wikEdHighlightErrorwikEdConfig['highlightError'] == true) {
insertLeft += '<span class="wikEdHighlightError">' + node.left + '</span><!--wikEdHighlightError-->';
}
Line 12,526 ⟶ 12,789:
window.WikEdHighlightLinkify = function(linkPrefix, linkTitle, linkUrl) {
 
if (wikEdLinkifywikEdConfig['linkify'] != true) {
return('');
}
Line 12,581 ⟶ 12,844:
}
 
// [[/subpage]] refers to a subpage of the current page, [[#section]] to a section of the current page
if ( (linkPrefix == '') && ( (linkTitle.indexOf('/') == 0) || (linkTitle.indexOf('#') == 0) ) ) {
subpage = true;
}
Line 12,630 ⟶ 12,893:
var titleClick;
if (wikEdPlatform == 'mac') {
titleClick = wikEdTextwikEdConfig['text']['followLinkMac'];
}
else {
titleClick = wikEdTextwikEdConfig['text']['followLink'];
}
linkParam += 'id="wikEdLinkify' + wikEdLinkifyArray.length + '" title="' + linkPopup + ' ' + titleClick + '"';
Line 12,970 ⟶ 13,233:
 
// run scheduled custom functions
WikEdExecuteHook(wikEdOnHookwikEdConfig['onHook']);
}
}
Line 13,015 ⟶ 13,278:
 
// run scheduled custom functions
WikEdExecuteHook(wikEdOffHookwikEdConfig['offHook']);
}
}
Line 13,397 ⟶ 13,660:
 
// remove new value if it is a preset value
if (wikEdComboPresetOptionswikEdConfig['comboPresetOptions'][field] != null) {
var i = 0;
while (i < wikEdComboPresetOptionswikEdConfig['comboPresetOptions'][field].length) {
if (wikEdComboPresetOptionswikEdConfig['comboPresetOptions'][field][i] == wikEdFieldHist[field][0]) {
wikEdFieldHist[field].shift();
break;
Line 13,411 ⟶ 13,674:
 
// cut history number to maximal history length
wikEdFieldHist[field] = wikEdFieldHist[field].slice(0, wikEdHistoryLengthwikEdConfig['historyLength'][field]);
 
// save history to settings
Line 13,471 ⟶ 13,734:
// add preset entries
var startPreset = 0;
if (wikEdComboPresetOptionswikEdConfig['comboPresetOptions'][field] != null) {
startPreset = j;
for (var i = 0; i < wikEdComboPresetOptionswikEdConfig['comboPresetOptions'][field].length; i ++) {
if (wikEdComboPresetOptionswikEdConfig['comboPresetOptions'][field][i] != null) {
 
// replace spaces with nbsp to allow for multiple, leading, and trailing spaces
wikEdComboPresetOptionswikEdConfig['comboPresetOptions'][field][i] = wikEdComboPresetOptionswikEdConfig['comboPresetOptions'][field][i].replace(/ /g, '\xa0');
 
// select a dropdown value
if (wikEdComboPresetOptionswikEdConfig['comboPresetOptions'][field][i] == wikEdInputElement[field].value) {
selectedOption = j;
}
 
option = document.createElement('option');
option.text = wikEdComboPresetOptionswikEdConfig['comboPresetOptions'][field][i].replace(/ /g, '\xa0');
if (field == 'summary') {
option.text = option.text.replace(/\{wikEdUsing\}/g, wikEdSummaryUsingwikEdConfig['summaryUsing']);
}
wikEdSelectElement[field].options[j++] = option;
Line 13,715 ⟶ 13,978:
 
var getStr = '';
 
// get a value from web storage
if (wikEdWebStorage == true) {
getStr = localStorage.getItem(name);
}
 
// get a Greasemonkey persistent value
else if (wikEdGreasemonkey == true) {
getStr = GM_getValue(name, '');
}
Line 13,734 ⟶ 14,002:
 
window.WikEdSetPersistent = function(name, value, expires, path, ___domain, secure) {
 
 
// set a value in web storage
if (wikEdWebStorage == true) {
if (expires == -1) {
localStorage.removeItem(name, '');
}
else {
localStorage.setItem(name, value);
}
}
 
// set a Greasemonkey persistent value
else if (wikEdGreasemonkey == true) {
if (expires == -1) {
GM_setValue(name, '');
Line 13,799 ⟶ 14,078:
else if (expires == 0) {
var cookieExpire = new Date();
expires = cookieExpire.setTime(cookieExpire.getTime() + wikEdCookieExpireSecwikEdConfig['cookieExpireSec'] * 1000);
expires = cookieExpire.toUTCString();
}
Line 13,848 ⟶ 14,127:
//
 
window.WikEdAppendScript = function(scriptUrl, onLoadFunction) {
 
var head = document.getElementsByTagName('head')[0];
var script = document.createElement('script');
script.setAttribute('type =', 'text/javascript');
script.setAttribute('src =', scriptUrl);
head.appendChild(script);
if (onLoadFunction != null) {
WikEdAddEventListener(script, 'load', onLoadFunction, false);
}
return;
};
Line 14,189 ⟶ 14,471:
ruleStyle = ruleStyle.replace(/\{wikEdImage:(\w+)\}/g,
function (p, p1) {
return(wikEdImagewikEdConfig['image'][p1]);
}
);
Line 14,196 ⟶ 14,478:
ruleStyle = ruleStyle.replace(/\{wikEdText:(\w+)\}/g,
function (p, p1) {
return(wikEdTextwikEdConfig['text'][p1]);
}
);
Line 14,322 ⟶ 14,604:
//
 
window.WikEdAjaxPreview = function(postDatatextValue, ResponseHandler, livePreview) {
 
// prepare the requesturl
var requestUrl;
var boundary = '--(fR*3briuStOum6#v)--';
if ( (wikEdUploadEdit == true) || (wikEdWatchlistEdit == true) || (wikEdViewDeleted == true) ) {
postData = '--' + boundary + '\nContent-Disposition: form-data; name="wpTextbox1"\n\n' + postData + '\n--' + boundary;
requestUrl = wikEdWikiGlobals['wgServer'] + wikEdWikiGlobals['wgScript'] + '?title=wikEdPreview&action=submit';
 
var formAction;
if ( (wikEdUploadEdit == true) || (wikEdWatchlistEdit == true) ) {
formAction = wikEdWikiGlobals['wgServer'] + wikEdWikiGlobals['wgScript'] + '?title=wikEdPreview&action=submit';
}
else {
formActionrequestUrl = wikEdEditForm.action;
}
 
if (wikEdEditForm.wpEdittime != null) {
// prepare the form fields
formAction += '&wpEdittime=' + wikEdEditForm.wpEdittime.value;
var postFields = {};
postFields['wpTextbox1'] = textValue;
if (wikEdEdittime != null) {
postFields['wikEdEdittime'] = wikEdEdittime;
}
if (wikEdEditForm.wpEditTokenwikEdEditToken != null) {
formAction += postFields['&wpEditToken='] += encodeURIComponent(wikEdEditForm.wpEditToken.value)wikEdEditToken;
}
formActionpostFields['wpPreview'] += '&wpPreview=true';
if (livePreview != false) {
formActionpostFields['live'] += '&livetrue';
}
 
// make the ajax request
var requestMethod = 'POST';
WikEdAjaxRequest('POST', formAction, 'Content-Type', 'multipart/form-data; boundary=' + boundary, postData, 'text/html', ResponseHandler);
var overrideMimeType = 'text/html';
WikEdAjaxRequest(requestMethod, requestUrl, postFields, overrideMimeType, ResponseHandler);
 
return;
Line 14,358 ⟶ 14,643:
//
 
window.WikEdAjaxRequest = function(requestMethod, requestUrl, headerName, headerValue, bodyDatapostFields, overrideMimeType, responseHandlerResponseHandler) {
 
var request;
 
// generate body data from form field object
var headerName = null;
var headerValue = null;
var bodyData = '';
if (requestMethod == 'POST') {
 
//create boundary
var boundary = WikEdCreateRandomString(12);
 
// POST header
headerName = 'Content-Type';
headerValue = 'multipart/form-data; boundary=' + boundary;
 
// assemble body data
for (var fieldName in postFields) {
if (postFields.hasOwnProperty(fieldName) == true) {
var fieldValue = postFields[fieldName];
bodyData += '--' + boundary + '\r\n';
bodyData += 'Content-Disposition: form-data; name="' + fieldName + '"\r\n\r\n' + fieldValue + '\r\n';
}
}
bodyData += '--' + boundary + '--\r\n';
}
 
// use Greasemonkey GM_xmlhttpRequest
if (wikEdGreasemonkey == true) {
var headerObj = { 'User-Agent': navigator.userAgent };
 
var headerArray = { 'User-Agent': navigator.userAgent };
if (headerName != null) {
headerArrayheaderObj[headerName] = headerValue;
}
 
request = new GM_xmlhttpRequest({
// workaround for Error: Greasemonkey access violation: unsafeWindow cannot call GM_xmlhttpRequest.
'method': requestMethod,
// see http://wiki.greasespot.net/Greasemonkey_access_violation
'url': requestUrl,
setTimeout(function() {
'headers': headerArray,
new GM_xmlhttpRequest({
'data': bodyData,
'method': requestMethod,
'onreadystatechange':
'url': requestUrl,
function(ajax) {
'overrideMimeType': overrideMimeType,
if (ajax.readyState != 4) {
'headers': headerObj,
'data': bodyData,
'onreadystatechange':
function(ajax) {
if (ajax.readyState != 4) {
return;
}
ResponseHandler(ajax);
return;
}
});
responseHandler(ajax);
return}, 0);
}
});
}
 
Line 14,389 ⟶ 14,703:
 
// allow ajax request from local copy for testing
if (wikEdAllowLocalAjaxwikEdConfig['allowLocalAjax'] == true) {
if (typeof(netscape) == 'object') {
netscape.security.PrivilegeManager.enablePrivilege('UniversalBrowserRead');
Line 14,396 ⟶ 14,710:
 
// new ajax request object
if (typeof(XMLHttpRequest) == 'object') {
try {
request = new XMLHttpRequest();
}
 
// IE
else if (typeof(ActiveXObject) == 'object') {
 
// IE 6
catch(err) {
try {
request = new ActiveXObject('Microsoft.XMLHTTP');
Line 14,415 ⟶ 14,731:
}
}
}
if (request == null) {
return;
}
request.open(requestMethod, requestUrl, true);
Line 14,436 ⟶ 14,755:
return;
}
responseHandlerResponseHandler(request);
return;
};
Line 14,445 ⟶ 14,764:
 
//
// WikEdGetGlobalWikEdGetGlobals: accesscopy valuesglobal of globalcontext variables frominto Greasemonkey scripts using the '___location hack'context (code copied to wikEdDiff.js)
// uses Greasemonkey postMessage ___location hack and JSON encoding
//
 
window.WikEdGetGlobalWikEdGetGlobals = function(globalNamenames, gotGlobalsHook) {
 
var globalValue;
if ( (typeof(window.postMessage) != 'function') || (typeof(JSON) != 'object') ) {
if (wikEdGreasemonkey == true) {
return;
if (wikEdGetGlobalNode == null) {
wikEdGetGlobalNode = document.getElementById('wikEdGetGlobalNode');
}
if (wikEdGetGlobalNode == null) {
wikEdGetGlobalNode = document.createElement('textarea');
wikEdGetGlobalNode.id = 'wikEdGetGlobalNode';
wikEdGetGlobalNode.style.display = 'none';
wikEdGetGlobalNode.style.visibility = 'hidden';
document.body.appendChild(wikEdGetGlobalNode);
}
___location.href = 'javascript:void(typeof(' + globalName + ')!=\'undefined\'?(' + globalName + '!=null?(document.getElementById(\'wikEdGetGlobalNode\').value=' + globalName + '.toString()):null):null)';
globalValue = wikEdGetGlobalNode.value;
}
 
else {
// set ___location href to execute code in global context
try {
var locationHackCode = 'var globalObj = {};';
globalValue = eval(globalName + '.toString();');
if (gotGlobalsHook != null) {
}
wikEdGotGlobalsHook.push(gotGlobalsHook);
catch(err) { }
locationHackCode += 'globalObj.hookNumber = ' + (wikEdGotGlobalsHook.length - 1) + ';';
}
locationHackCode += 'globalObj.wikEdGetGlobals = {};';
return(globalValue);
for (var i = 0; i < names.length; i ++) {
locationHackCode += ''
+ 'if (typeof(' + names[i] + ') != \'undefined\') {'
+ ' globalObj.wikEdGetGlobals[\'' + names[i] + '\'] = ' + names[i] + ';'
+ '}';
}
locationHackCode += ''
+ 'var globalObjStr = JSON.stringify(globalObj);'
+ 'window.postMessage(globalObjStr, \'' + window.___location.protocol + '//' + window.___location.host + '\');'
+ 'void(0);';
___location.href = 'javascript:' + locationHackCode;
return;
};
 
 
//
// WikEdGetGlobalsReceiver: event handler for WikEdGetGlobals postMessage
//
 
window.WikEdGetGlobalsReceiver = function(event) {
 
if (event.source != window) {
return;
}
if (event.origin != window.___location.protocol + '//' + window.___location.host) {
return;
}
if (event.data != '') {
var globalObj = JSON.parse(event.data);
var globals = globalObj.wikEdGetGlobals;
if (globals != null) {
for (var key in globals) {
if (globals.hasOwnProperty(key) == true) {
wikEdWikiGlobals[key] = globals[key];
}
}
 
// run scheduled functions only once
if (globalObj.hookNumber != null) {
WikEdExecuteHook(wikEdGotGlobalsHook[globalObj.hookNumber], true);
}
}
}
return;
}
 
 
Line 14,541 ⟶ 14,894:
window.WikEdAddEventListener = function(domElement, eventType, eventHandler, useCapture) {
 
if (domElement !== null) {
return;
if (typeof(domElement.addEventListener) == 'function') {
}
domElement.addEventListener(eventType, eventHandler, useCapture);
if (typeof(domElement.addEventListener) == 'function') {
}
domElement.addEventListener(eventType, eventHandler, useCapture);
else {
}
domElement['wikEd' + eventType + eventHandler] = eventHandler;
else {
domElement[eventType + eventHandler] = function() {
domElement['wikEd' + eventType + eventHandler] = eventHandler;
var eventRootElement = document;
domElement[eventType + eventHandler] = function() {
if (document.addEventListener == null) {
var eventRootElement = windowdocument;
if (document.addEventListener == null) {
}
eventRootElement = window;
domElement['wikEd' + eventType + eventHandler](eventRootElement.event);
};
domElement.attachEvent(['onwikEd' + eventType, domElement[eventType + eventHandler] (eventRootElement.event);
};
domElement.attachEvent('on' + eventType, domElement[eventType + eventHandler] );
}
return;
Line 14,567 ⟶ 14,921:
window.WikEdRemoveEventListener = function(domElement, eventType, eventHandler, useCapture) {
 
if (domElement == null) {
return;
}
if (typeof(domElement.removeEventListener) == 'function') {
domElement.removeEventListener(eventType, eventHandler, useCapture);
Line 14,731 ⟶ 15,088:
}
};
 
 
//
// WikEdCreateRandomString: create random string of specified length and character set
//
 
window.WikEdCreateRandomString = function(strLength, charSet) {
 
if (charSet == null) {
charSet = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_';
}
var str = '';
for (var i = 0; i < strLength; i ++) {
str += charSet.charAt(Math.floor(Math.random() * charSet.length));
}
return(str);
}
 
 
Line 14,782 ⟶ 15,156:
// whole parse tree up
else if ( (typeof(object.tree) == 'object') && (typeof(object.lastOpenNode) == 'number') ) {
xxxx;
value = ': Parse tree upwards:\n';
var parseTreeIndex = object.lastOpenNode;
Line 14,835 ⟶ 15,210:
if ( (object.innerHTML != null) && (object.innerHTML != '') ) {
var html = object.innerHTML;
if (html.length > wikEdDebugInnerHtmlLengthwikEdConfig['debugInnerHtmlLength']) {
html = html.substr(0, wikEdDebugInnerHtmlLengthwikEdConfig['debugInnerHtmlLength'] - 3) + '...';
}
value += ', innerHTML: "' + html + '"';
Line 14,880 ⟶ 15,255:
// cut text if having reached maximum length
value = objectName + value + '\n';
if (wikEdDebug.value.length > wikEdDebugMaxLengthwikEdConfig['debugMaxLength']) {
wikEdDebug.value = value + wikEdDebug.value.substr(0, wikEdDebugMaxLengthwikEdConfig['debugMaxLength'] * 2 / 3);
}
else {
Line 14,972 ⟶ 15,347:
//
 
window.WikEdExecuteHook = function(functionsHook, onlyOnce) {
 
for (var i = 0; i < functionsHook.length; i ++) {
functionsHook[i]();
}
if (onlyOnce == true) {
functionsHook = [];
}
return;
Line 15,336 ⟶ 15,714:
};
 
 
// call wikEd startup
// call wikEd on startup, but not for the iframe under Greasemonkey
WikEdStartup();
if (window == top) {
WikEdStartup();
}
 
 
// </nowiki></pre>