Content deleted Content added
No edit summary |
0.9.14b |
||
Line 3:
/*
Name: wikEd (wikEd.js)
Version: wikEd 0.9.x (beta) (
What: Comfortable JavaScript in-browser editor for Wikipedia and other MediaWikis
Update: press SHIFT-Reload to update to the newest version
Line 16:
// version information
var wikEdProgramVersion = '0.9.
var wikEdProgramDate = '
Line 512:
'wikify': '9/9f/WikEd_wikify.png',
'wikiLink': '2/21/WikEd_wikilink.png'
});
// buttons (id, class, popup title, image src, width, height, alt text, onClick and parameters)
var wikEdButton = wikEdButton || [];
WikEdInitObject(wikEdButton, {
// format top
1: ['wikEdUndo', 'wikEdButtonInactive', wikEdText['wikEdUndo title'], wikEdImage['undo'], '16', '16', wikEdText['wikEdUndo alt'], 'javascript:WikEdEditButton(this.id);' ],
2: ['wikEdRedo', 'wikEdButtonInactive', wikEdText['wikEdRedo title'], wikEdImage['redo'], '16', '16', wikEdText['wikEdRedo alt'], 'javascript:WikEdEditButton(this.id);' ],
3: ['wikEdBold', 'wikEdButton', wikEdText['wikEdBold title'], wikEdImage['bold'], '16', '16', wikEdText['wikEdBold alt'], 'javascript:WikEdEditButton(this.id);' ],
4: ['wikEdItalic', 'wikEdButton', wikEdText['wikEdItalic title'], wikEdImage['italic'], '16', '16', wikEdText['wikEdItalic alt'], 'javascript:WikEdEditButton(this.id);' ],
5: ['wikEdUnderline', 'wikEdButton', wikEdText['wikEdUnderline title'], wikEdImage['underline'], '16', '16', wikEdText['wikEdUnderline alt'], 'javascript:WikEdEditButton(this.id);' ],
6: ['wikEdStrikethrough', 'wikEdButton', wikEdText['wikEdStrikethrough title'], wikEdImage['strikethrough'], '16', '16', wikEdText['wikEdStrikethrough alt'], 'javascript:WikEdEditButton(this.id);' ],
7: ['wikEdNowiki', 'wikEdButton', wikEdText['wikEdNowiki title'], wikEdImage['nowiki'], '16', '16', wikEdText['wikEdNowiki alt'], 'javascript:WikEdEditButton(this.id);' ],
8: ['wikEdSuperscript', 'wikEdButton', wikEdText['wikEdSuperscript title'], wikEdImage['superscript'], '16', '16', wikEdText['wikEdSuperscript alt'], 'javascript:WikEdEditButton(this.id);' ],
9: ['wikEdSubscript', 'wikEdButton', wikEdText['wikEdSubscript title'], wikEdImage['subscript'], '16', '16', wikEdText['wikEdSubscript alt'], 'javascript:WikEdEditButton(this.id);' ],
10: ['wikEdCase', 'wikEdButton', wikEdText['wikEdCase title'], wikEdImage['case'], '16', '16', wikEdText['wikEdCase alt'], 'javascript:WikEdEditButton(this.id);' ],
11: ['wikEdUndoAll', 'wikEdButton', wikEdText['wikEdUndoAll title'], wikEdImage['undoAll'], '16', '16', wikEdText['wikEdUndoAll alt'], 'javascript:WikEdEditButton(this.id);' ],
12: ['wikEdRedoAll', 'wikEdButtonInactive', wikEdText['wikEdRedoAll title'], wikEdImage['redoAll'], '16', '16', wikEdText['wikEdRedoAll alt'], 'javascript:WikEdEditButton(this.id);' ],
13: ['wikEdUpdateSyntax', 'wikEdButton', wikEdText['wikEdUpdateSyntax title'], wikEdImage['updateSyntax'], '16', '16', wikEdText['wikEdUpdateSyntax alt'], 'javascript:WikEdEditButton(this.id);' ],
// format bottom
14: ['wikEdWikiLink', 'wikEdButton', wikEdText['wikEdWikiLink title'], wikEdImage['wikiLink'], '16', '16', wikEdText['wikEdWikiLink alt'], 'javascript:WikEdEditButton(this.id);' ],
15: ['wikEdWebLink', 'wikEdButton', wikEdText['wikEdWebLink title'], wikEdImage['webLink'], '16', '16', wikEdText['wikEdWebLink alt'], 'javascript:WikEdEditButton(this.id);' ],
16: ['wikEdDecreaseHeading', 'wikEdButton', wikEdText['wikEdDecreaseHeading title'], wikEdImage['decreaseHeading'], '16', '16', wikEdText['wikEdDecreaseHeading alt'], 'javascript:WikEdEditButton(this.id);' ],
17: ['wikEdIncreaseHeading', 'wikEdButton', wikEdText['wikEdIncreaseHeading title'], wikEdImage['increaseHeading'], '16', '16', wikEdText['wikEdIncreaseHeading alt'], 'javascript:WikEdEditButton(this.id);' ],
18: ['wikEdBulletList', 'wikEdButton', wikEdText['wikEdBulletList title'], wikEdImage['bulletList'], '16', '16', wikEdText['wikEdBulletList alt'], 'javascript:WikEdEditButton(this.id);' ],
19: ['wikEdNumberList', 'wikEdButton', wikEdText['wikEdNumberList title'], wikEdImage['numberList'], '16', '16', wikEdText['wikEdNumberList alt'], 'javascript:WikEdEditButton(this.id);' ],
20: ['wikEdIndentList', 'wikEdButton', wikEdText['wikEdIndentList title'], wikEdImage['indentList'], '16', '16', wikEdText['wikEdIndentList alt'], 'javascript:WikEdEditButton(this.id);' ],
21: ['wikEdDefinitionList', 'wikEdButton', wikEdText['wikEdDefinitionList title'], wikEdImage['definitionList'], '16', '16', wikEdText['wikEdDefinitionList alt'], 'javascript:WikEdEditButton(this.id);' ],
22: ['wikEdImage', 'wikEdButton', wikEdText['wikEdImage title'], wikEdImage['image'], '16', '16', wikEdText['wikEdImage alt'], 'javascript:WikEdEditButton(this.id);' ],
23: ['wikEdTable', 'wikEdButton', wikEdText['wikEdTable title'], wikEdImage['table'], '16', '16', wikEdText['wikEdTable alt'], 'javascript:WikEdEditButton(this.id);' ],
24: ['wikEdRedirect', 'wikEdButton', wikEdText['wikEdRedirect title'], wikEdImage['redirect'], '16', '16', wikEdText['wikEdRedirect alt'], 'javascript:WikEdEditButton(this.id);' ],
25: ['wikEdWikify', 'wikEdButton', wikEdText['wikEdWikify title'], wikEdImage['wikify'], '16', '16', wikEdText['wikEdWikify alt'], 'javascript:WikEdEditButton(this.id);' ],
26: ['wikEdTextify', 'wikEdButton', wikEdText['wikEdTextify title'], wikEdImage['textify'], '16', '16', wikEdText['wikEdTextify alt'], 'javascript:WikEdEditButton(this.id);' ],
// control top
27: ['wikEdTextZoom', 'wikEdButton', wikEdText['wikEdTextZoom title'], wikEdImage['textZoom'], '16', '16', wikEdText['wikEdTextZoom alt'], 'javascript:WikEdButton(this.id);' ],
28: ['wikEdClearHistory', 'wikEdButton', wikEdText['wikEdClearHistory title'], wikEdImage['clearHistory'], '16', '16', wikEdText['wikEdClearHistory alt'], 'javascript:WikEdButton(this.id);' ],
29: ['wikEdScrollToButtons', 'wikEdButton', wikEdText['wikEdScrollToButtons title'], wikEdImage['scrollToButtons'], '16', '16', wikEdText['wikEdScrollToButtons alt'], 'javascript:WikEdButton(this.id);' ],
30: ['wikEdScrollToInput', 'wikEdButton', wikEdText['wikEdScrollToInput title'], wikEdImage['scrollToText'], '16', '16', wikEdText['wikEdScrollToInput alt'], 'javascript:WikEdButton(this.id);' ],
// control bottom
31: ['wikEdUseWikEd', 'wikEdButtonChecked', wikEdText['wikEdUseWikEd title'], wikEdImage['useWikEd'], '16', '16', wikEdText['wikEdUseWikEd alt'], 'javascript:WikEdButton(this.id, true);' ],
32: ['wikEdHighlightSyntax', 'wikEdButtonUnchecked', wikEdText['wikEdHighlightSyntax title'], wikEdImage['highlightSyntax'], '16', '16', wikEdText['wikEdHighlightSyntax alt'], 'javascript:WikEdButton(this.id, true);' ],
33: ['wikEdSource', 'wikEdButton', wikEdText['wikEdSource title'], wikEdImage['source'], '16', '16', wikEdText['wikEdSource alt'], 'javascript:WikEdEditButton(this.id);' ],
34: ['wikEdUsing', 'wikEdButtonUnchecked', wikEdText['wikEdUsing title'], wikEdImage['using'], '16', '16', wikEdText['wikEdUsing alt'], 'javascript:WikEdButton(this.id, true);' ],
35: ['wikEdFullScreen', 'wikEdButton', wikEdText['wikEdFullScreen title'], wikEdImage['fullScreen'], '16', '16', wikEdText['wikEdFullScreen alt'], 'javascript:WikEdButton(this.id, true);' ],
// find top
36: ['wikEdGetFind', 'wikEdButton', wikEdText['wikEdGetFind title'], wikEdImage['getFind'], '16', '16', wikEdText['wikEdGetFind alt'], 'javascript:WikEdEditButton(this.id);" ondblclick="javascript:WikEdEditButton(this.id);' ],
37: ['wikEdFindAll', 'wikEdButton', wikEdText['wikEdFindAll title'], wikEdImage['findAll'], '16', '16', wikEdText['wikEdFindAll alt'], 'javascript:WikEdEditButton(this.id);' ],
38: ['wikEdFindPrev', 'wikEdButton', wikEdText['wikEdFindPrev title'], wikEdImage['findPrev'], '16', '16', wikEdText['wikEdFindPrev alt'], 'javascript:WikEdEditButton(this.id);' ],
39: ['wikEdFindNext', 'wikEdButton', wikEdText['wikEdFindNext title'], wikEdImage['findNext'], '16', '16', wikEdText['wikEdFindNext alt'], 'javascript:WikEdEditButton(this.id);' ],
40: ['wikEdUpdown', 'wikEdButton', wikEdText['wikEdUpdown title'], wikEdImage['jumpTopBottom'], '16', '16', wikEdText['wikEdUpdown alt'], 'javascript:WikEdEditButton(this.id);' ],
41: ['wikEdPrevPos', 'wikEdButtonInactive', wikEdText['wikEdPrevPos title'], wikEdImage['prevPos'], '16', '16', wikEdText['wikEdPrevPos alt'], 'javascript:WikEdEditButton(this.id);' ],
42: ['wikEdLastPos', 'wikEdButtonInactive', wikEdText['wikEdLastPos title'], wikEdImage['lastPos'], '16', '16', wikEdText['wikEdLastPos alt'], 'javascript:WikEdEditButton(this.id);' ],
// find bottom
43: ['wikEdClearFind', 'wikEdButton', wikEdText['wikEdClearFind title'], wikEdImage['clearFind'], '16', '16', wikEdText['wikEdClearFind alt'], 'javascript:WikEdButton(this.id);' ],
44: ['wikEdReplaceAll', 'wikEdButton', wikEdText['wikEdReplaceAll title'], wikEdImage['replaceAll'], '16', '16', wikEdText['wikEdReplaceAll alt'], 'javascript:WikEdEditButton(this.id);' ],
45: ['wikEdReplacePrev', 'wikEdButton', wikEdText['wikEdReplacePrev title'], wikEdImage['replacePrev'], '16', '16', wikEdText['wikEdReplacePrev alt'], 'javascript:WikEdEditButton(this.id);' ],
46: ['wikEdReplaceNext', 'wikEdButton', wikEdText['wikEdReplaceNext title'], wikEdImage['replaceNext'], '16', '16', wikEdText['wikEdReplaceNext alt'], 'javascript:WikEdEditButton(this.id);' ],
47: ['wikEdCaseSensitive', 'wikEdButtonUnchecked', wikEdText['wikEdCaseSensitive title'], wikEdImage['caseSensitive'], '16', '16', wikEdText['wikEdCaseSensitive alt'], 'javascript:WikEdButton(this.id, true);' ],
48: ['wikEdRegExp', 'wikEdButtonUnchecked', wikEdText['wikEdRegExp title'], wikEdImage['regExp'], '16', '16', wikEdText['wikEdRegExp alt'], 'javascript:WikEdButton(this.id, true);' ],
49: ['wikEdFindAhead', 'wikEdButtonUnchecked', wikEdText['wikEdFindAhead title'], wikEdImage['findAhead'], '16', '16', wikEdText['wikEdFindAhead alt'], 'javascript:WikEdButton(this.id, true);' ],
// fix top
50: ['wikEdFixBasic', 'wikEdButton', wikEdText['wikEdFixBasic title'], wikEdImage['fixBasic'], '16', '16', wikEdText['wikEdFixBasic alt'], 'javascript:WikEdEditButton(this.id);' ],
51: ['wikEdFixHtml', 'wikEdButton', wikEdText['wikEdFixHtml title'], wikEdImage['fixHtml'], '16', '16', wikEdText['wikEdFixHtml alt'], 'javascript:WikEdEditButton(this.id);' ],
52: ['wikEdFixCaps', 'wikEdButton', wikEdText['wikEdFixCaps title'], wikEdImage['fixCaps'], '16', '16', wikEdText['wikEdFixCaps alt'], 'javascript:WikEdEditButton(this.id);' ],
53: ['wikEdfixUnicode', 'wikEdButton', wikEdText['wikEdfixUnicode title'], wikEdImage['fixUnicode'], '16', '16', wikEdText['wikEdfixUnicode alt'], 'javascript:WikEdEditButton(this.id);' ],
54: ['wikEdFixAll', 'wikEdButton', wikEdText['wikEdFixAll title'], wikEdImage['fixAll'], '16', '16', wikEdText['wikEdFixAll alt'], 'javascript:WikEdEditButton(this.id);' ],
55: ['wikEdFixRegExTypo', 'wikEdButton', wikEdText['wikEdFixRegExTypo title'], wikEdImage['fixRegExTypo'], '16', '16', wikEdText['wikEdFixRegExTypo alt'], 'javascript:WikEdEditButton(this.id);' ],
// fix bottom
56: ['wikEdFixDashes', 'wikEdButton', wikEdText['wikEdFixDashes title'], wikEdImage['fixDash'], '16', '16', wikEdText['wikEdFixDashes alt'], 'javascript:WikEdEditButton(this.id);' ],
57: ['wikEdFixPunct', 'wikEdButton', wikEdText['wikEdFixPunct title'], wikEdImage['fixPunct'], '16', '16', wikEdText['wikEdFixPunct alt'], 'javascript:WikEdEditButton(this.id);' ],
58: ['wikEdFixMath', 'wikEdButton', wikEdText['wikEdFixMath title'], wikEdImage['fixMath'], '16', '16', wikEdText['wikEdFixMath alt'], 'javascript:WikEdEditButton(this.id);' ],
59: ['wikEdFixChem', 'wikEdButton', wikEdText['wikEdFixChem title'], wikEdImage['fixChem'], '16', '16', wikEdText['wikEdFixChem alt'], 'javascript:WikEdEditButton(this.id);' ],
60: ['wikEdFixUnits', 'wikEdButton', wikEdText['wikEdFixUnits title'], wikEdImage['fixUnits'], '16', '16', wikEdText['wikEdFixUnits alt'], 'javascript:WikEdEditButton(this.id);' ],
// preview
61: ['wikEdPreview', 'wikEdButton', wikEdText['wikEdPreview title'], wikEdImage['preview'], '16', '16', wikEdText['wikEdPreview alt'], 'javascript:WikEdButton(this.id);' ],
62: ['wikEdDiff', 'wikEdButton', wikEdText['wikEdDiff title'], wikEdImage['diff'], '16', '16', wikEdText['wikEdDiff alt'], 'javascript:WikEdButton(this.id);' ],
63: ['wikEdClose', 'wikEdButton', wikEdText['wikEdClose title'], wikEdImage['close'], '16', '16', wikEdText['wikEdClose alt'], 'javascript:WikEdButton(this.id);' ],
64: ['wikEdScrollToButtons2', 'wikEdButton', wikEdText['wikEdScrollToButtons2 title'], wikEdImage['scrollToButtons'], '16', '16', wikEdText['wikEdScrollToButtons2 alt'], 'javascript:WikEdButton(this.id);' ],
65: ['wikEdScrollToInput2', 'wikEdButton', wikEdText['wikEdScrollToInput2 title'], wikEdImage['scrollToText'], '16', '16', wikEdText['wikEdScrollToInput2 alt'], 'javascript:WikEdButton(this.id);' ],
// preview2
66: ['wikEdPreview2', 'wikEdButton', wikEdText['wikEdPreview2 title'], wikEdImage['preview'], '16', '16', wikEdText['wikEdPreview2 alt'], 'javascript:WikEdButton(this.id);' ],
67: ['wikEdDiff2', 'wikEdButton', wikEdText['wikEdDiff2 title'], wikEdImage['diff'], '16', '16', wikEdText['wikEdDiff2 alt'], 'javascript:WikEdButton(this.id);' ],
68: ['wikEdClose2', 'wikEdButton', wikEdText['wikEdClose2 title'], wikEdImage['close'], '16', '16', wikEdText['wikEdClose2 alt'], 'javascript:WikEdButton(this.id);' ],
69: ['wikEdScrollToButtons3', 'wikEdButton', wikEdText['wikEdScrollToButtons3 title'], wikEdImage['scrollToButtons'], '16', '16', wikEdText['wikEdScrollToButtons3 alt'], 'javascript:WikEdButton(this.id);' ],
70: ['wikEdScrollToInput3', 'wikEdButton', wikEdText['wikEdScrollToInput3 title'], wikEdImage['scrollToText'], '16', '16', wikEdText['wikEdScrollToInput3 alt'], 'javascript:WikEdButton(this.id);' ],
// jump
71: ['wikEdScrollToButtons4', 'wikEdButtonSolo', wikEdText['wikEdScrollToButtons4 title'], wikEdImage['scrollToButtons'], '16', '16', wikEdText['wikEdScrollToButtons4 alt'], 'javascript:WikEdButton(this.id);' ],
72: ['wikEdScrollToInput4', 'wikEdButtonSolo', wikEdText['wikEdScrollToInput4 title'], wikEdImage['scrollToText'], '16', '16', wikEdText['wikEdScrollToInput4 alt'], 'javascript:WikEdButton(this.id);' ]
});
// button bars (id, class, button numbers)
var wikEdButtonBar = wikEdButtonBar || [];
WikEdInitObject(wikEdButtonBar, {
'format': ['wikEdButtonsFormat', 'wikEdButtonsFormat', [1,2,3,4,5,6,7,8,9,10,11,12,13,'br',14,15,16,17,18,19,20,21,22,23,24,25,26] ],
'control': ['wikEdButtonsControl', 'wikEdButtonsControl', [27,28,29,30,'br',31,32,33,34,35] ],
'find': ['wikEdButtonsFind', 'wikEdButtonsFind', [36,37,38,'find',39,40,41,42,'br',43,44,45,'replace',46,47,48,49] ],
'fix': ['wikEdButtonsFix', 'wikEdButtonsFix', [50,51,52,53,54,55,'br',56,57,58,59,60] ],
'preview': ['wikEdButtonsPreview', 'wikEdButtonsPreview', [61,62,63,64,65] ],
'preview2': ['wikEdButtonsPreview2', 'wikEdButtonsPreview2', [66,67,68,69,70] ],
'jump': ['wikEdButtonsJump', 'wikEdButtonsJump', [71,72] ]
});
Line 1,054 ⟶ 1,165:
// add wikEd buttons to buttons wrapper
var html = '';
// format buttons
html += MakeButtonBar(wikEdButtonBar['format']);
// wikEd control buttons
html += MakeButtonBar(wikEdButtonBar['control']);
// find / replace buttons
html += MakeButtonBar(wikEdButtonBar['find']);
// fixing buttons
html += MakeButtonBar(wikEdButtonBar['fix']);
html += '<br style="clear: both;">';
Line 1,177 ⟶ 1,198:
// add preview box top bar to submit wrapper
var buttonsPreview = document.createElement('div');
buttonsPreview.id = 'wikEdButtonsPreview';
buttonsPreview.className = 'wikEdButtonsPreview';
html = MakeButtonBar(wikEdButtonBar['preview']);
buttonsPreview.innerHTML = html;
Line 1,198 ⟶ 1,217:
html += '</div>';
html += '</div>';
html += MakeButtonBar(wikEdButtonBar['preview2']);
wikEdLocalPrevWrapper.innerHTML = html;
Line 1,220 ⟶ 1,232:
buttonsJump.className = 'wikEdButtonsJump';
html = MakeButtonBar(wikEdButtonBar['jump']);
buttonsJump.innerHTML = html;
Line 1,557 ⟶ 1,567:
return;
}
//
// MakeButtonBar: generate button bar html code
//
function MakeButtonBar(bar) {
var html = '<div id="' + bar[0] + '" class="' + bar[1] + '">';
for each (buttonNo in bar[2]) {
switch (buttonNo) {
case 'br':
html += '<br />';
break;
case 'find':
html += '<span class="wikEdFindComboInput" id="wikEdFindComboInput">';
html += '<input class="wikEdCombo" id="wikEdFindText" type="text" value="" onfocus="javascript:this.setSelectionRange(0, this.textLength);">';
html += '<select class="wikEdCombo" id="wikEdFindSelect" onfocus="javascript:WikEdSetComboOptions(\'find\')" onChange="javascript:WikEdChangeComboInput(\'find\');">';
html += '</select>';
html += '</span>';
break;
case 'replace':
html += '<span class="wikEdReplaceComboInput" id="wikEdReplaceComboInput">';
html += '<input class="wikEdCombo" id="wikEdReplaceText" type="text" value="" onfocus="this.setSelectionRange(0, this.textLength);">';
html += '<select class="wikEdCombo" id="wikEdReplaceSelect" onfocus="WikEdSetComboOptions(\'replace\')" onChange="javascript:WikEdChangeComboInput(\'replace\');">';
html += '</select>';
html += '</span>';
default:
if ( (wikEdButton[0] != 'wikEdSource') || (wikEdShowSourceButton == true) ) {
html += '<img id="' + wikEdButton[0] + '" class="' + wikEdButton[1] + '" title="' + wikEdButton[2] + '" src="' + wikEdButton[3] + '" width="' + wikEdButton[4] + '" height="' + wikEdButton[5] + '" alt="' + wikEdButton[6] + '" onClick="' + wikEdButton[7] + '">';
}
break;
}
}
html += '</div>';
return(html);
}
Line 1,999 ⟶ 2,046:
break;
// wikify
case 'wikEdWikify':
WikEdGetText(obj, 'selection');
if (obj.selection.plain != '') {
Line 2,008 ⟶ 2,054:
else {
WikEdGetText(obj, 'whole');
obj.changed = obj.whole;
}
break;
// textify: selection / whole, without wikifying
case 'wikEdTextify':
WikEdGetText(obj, 'selection', true);
if (obj.selection.plain != '') {
obj.changed = obj.selection;
}
else {
WikEdGetText(obj, 'whole', true);
obj.changed = obj.whole;
}
Line 2,451 ⟶ 2,509:
// textify: strip html from pasted content
case 'wikEdTextify':
WikEdTextify(obj.changed);
break;
// get inner html without wikifying
if (obj.
obj.selection.range = obj.sel.getRangeAt(obj.sel.rangeCount - 1);
var documentFragment = obj.selection.range.cloneContents();
WikEdGetInnerHTML(objTextify, documentFragment);
}
else {
obj.changed.
obj.changed.range.setStartBefore(wikEdFrameBody.firstChild);
obj.changed.range.setEndAfter(wikEdFrameBody.lastChild);
WikEdGetInnerHTML(objTextify, wikEdFrameBody);
}
break;
Line 2,917 ⟶ 2,978:
//
function WikEdGetText(obj, whichFragment, noWikify) {
// get selection object
Line 2,951 ⟶ 3,012:
WikEdGetInnerHTML(obj.whole, wikEdFrameBody);
obj.whole.code = obj.whole.html;
WikEdRemoveHighlightingWikify(obj.whole, noWikify);
obj.whole.plain = obj.whole.html;
obj.whole.plain = obj.whole.plain.replace(/<br\b[^>]*>/g, '\n');
obj.whole.plain = obj.whole.plain.replace(/\u00a0/g, ' ');
}
}
Line 2,973 ⟶ 3,032:
WikEdGetInnerHTML(obj.selection, documentFragment);
obj.selection.code = obj.selection.html;
WikEdRemoveHighlightingWikify(obj.selection, noWikify);
obj.selection.plain = obj.selection.html;
obj.selection.plain = obj.selection.plain.replace(/<br\b[^>]*>/g, '\n');
Line 2,999 ⟶ 3,058:
WikEdGetInnerHTML(obj.focusWord, documentFragment);
obj.focusWord.code = obj.focusWord.html;
WikEdRemoveHighlightingWikify(obj.focusWord, noWikify);
obj.focusWord.plain = obj.focusWord.html;
obj.focusWord.plain = obj.focusWord.plain.replace(/<br\b[^>]*>/g, '\n');
Line 3,008 ⟶ 3,067:
WikEdGetInnerHTML(obj.focusLine, documentFragment);
obj.focusLine.code = obj.focusLine.html;
WikEdRemoveHighlightingWikify(obj.focusLine, noWikify);
obj.focusLine.plain = obj.focusLine.html;
obj.focusLine.plain = obj.focusLine.plain.replace(/<br\b[^>]*>/g, '\n');
Line 3,036 ⟶ 3,095:
WikEdGetInnerHTML(obj.selectionWord, documentFragment);
obj.selectionWord.code = obj.selectionWord.html;
WikEdRemoveHighlightingWikify(obj.selectionWord, noWikify);
obj.selectionWord.plain = obj.selectionWord.html;
obj.selectionWord.plain = obj.selectionWord.plain.replace(/<br\b[^>]*>/g, '\n');
Line 3,045 ⟶ 3,104:
WikEdGetInnerHTML(obj.selectionLine, documentFragment);
obj.selectionLine.code = obj.selectionLine.html;
WikEdRemoveHighlightingWikify(obj.selectionLine, noWikify);
obj.selectionLine.plain = obj.selectionLine.html;
obj.selectionLine.plain = obj.selectionLine.plain.replace(/<br\b[^>]*>/g, '\n');
Line 3,149 ⟶ 3,208:
}
//
Line 3,986 ⟶ 4,043:
//
function WikEdRemoveHighlightingWikify(obj, noWikify) {
if (obj.html != '') {
Line 3,994 ⟶ 4,051:
// wikify, don't allow many attributes
if ( (obj.htmlCode == true) && (noWikify != true) ) {
WikEdWikifyHTML(obj, false);
}
Line 4,877 ⟶ 4,934:
// <nowiki> <math> <noinclude> <includeonly> <ref> <references> wiki markup
obj.html = obj.html.replace(/((<)(nowiki|math|gallery|noinclude|includeonly|ref|references)\b.*?(>)(.*?)(<)\/
// URLs, allowed chars: \w / . & ? = - @ # % ~ + (; allowed because of & and common misuse)
Line 4,886 ⟶ 4,943:
}
);
// URLs with text
obj.html = obj.html.replace(/(\[)( *<span class=\"wikEdURLLink\">.*?<\!--wikEdURLLink--> *)([^\]\n]*?)( *\])/gi,
Line 4,901 ⟶ 4,957:
}
);
// [[Image: ]] images
var regExpImg = new RegExp('(\\[\\[)(' + wikEdText['wikicode Image'] + ' *: *)([^\\]\\[\\|]*? *)(\\|(\\[[^\\]]*\\]|\\[\\[[^\\]]*\\]\\]|[^\\[\\]\\|]+|\\|)*)(\\]\\])', 'gi');
|