Content deleted Content added
0.9.8 |
0.9.12rc |
||
Line 1:
/* <pre><nowiki>
/*
Name: wikEd (wikEd.js)
Version: wikEd 0.9 (beta) (
What: Comfortable JavaScript editor for Wikipedia and other MediaWikis
Update: press SHIFT-Reload to update to the newest version
Homepage: http://en.wikipedia.org/wiki/User:Cacycle/wikEd
Line 9 ⟶ 10:
Code: http://en.wikipedia.org/wiki/User:Cacycle/wikEd.js
Author: Cacycle (http://en.wikipedia.org/wiki/User:Cacycle)
Browsers: The program works ONLY for Mozilla-based browsers (Mozilla, Mozilla Firefox, and Mozilla SeaMonkey)
License: This code has been released into the public ___domain
Important: This file might have to be saved as UTF-16 in your editor to preserve the Unicode characters at the end
*/
// version information
var wikEdProgramVersion = '0.9.
var wikEdProgramDate = '
Line 30 ⟶ 25:
// user readable texts, preset as wikEdText[''] = '';
// copy changes to http://en.wikipedia.org/wiki/User:Cacycle/wikEd_international_en.js
var wikEdText = wikEdText || [];
WikEdInitObject(wikEdText, {
// logo
'wikEdLogo alt': 'WikEd',
'wikEdLogo title': 'WikEd {wikEdProgramVersion} ({wikEdProgramDate}) Click to disable',
'wikEdLogo error alt': 'WikEd error',
'wikEdLogo error title': 'Loading error - WikEd {wikEdProgramVersion} ({wikEdProgramDate}) Click to disable',
'wikEdLogo disabled alt': '(WikEd)',
'wikEdLogo disabled title': 'Disabled - WikEd {wikEdProgramVersion} ({wikEdProgramDate}) Click to enable',
// standard preview jumper
'wikEdScrollToButtons4 alt': 'Scroll buttons',
'wikEdScrollToButtons4 title': 'Scroll to edit buttons',
'wikEdScrollToInput4 alt': 'Scroll edit',
'wikEdScrollToInput4 title': 'Scroll to edit window',
// formatting buttons, top row
'wikEdUndo alt': 'Undo',
'wikEdUndo title': 'Undo',
'wikEdRedo alt': 'Redo',
'wikEdRedo title': 'Redo',
'wikEdBold alt': 'Bold',
'wikEdBold title': 'Bold text',
'wikEdItalic alt': 'Italic',
'wikEdItalic title': 'Italic text',
'wikEdUnderline alt': 'Underline',
'wikEdUnderline title': 'Underline text',
'wikEdStrikethrough alt': 'Strikethrough',
'wikEdStrikethrough title': 'Strikethrough text',
'wikEdNowiki alt': 'Nowiki',
'wikEdNowiki title': 'Nowiki markup text',
'wikEdSuperscript alt': 'Superscript',
'wikEdSuperscript title': 'Superscript text',
'wikEdSubscript alt': 'Subscript',
'wikEdSubscript title': 'Subscript text',
'wikEdCase alt': 'Case',
'wikEdCase title': 'Toggle between lowercase, uppercase first, and uppercase',
'wikEdUndoAll alt': 'Undo all',
'wikEdUndoAll title': 'Undo all changes',
'wikEdRedoAll alt': 'Redo all',
'wikEdRedoAll title': 'Redo all changes',
'wikEdUpdateSyntax alt': 'Syntax',
'wikEdUpdateSyntax title': 'Update syntax highlighting',
// formatting buttons, bottom row
'wikEdWikiLink alt': 'Link',
'wikEdWikiLink title': 'Wiki link',
'wikEdWebLink alt': 'Weblink',
'wikEdWebLink title': 'External weblink',
'wikEdDecreaseHeading alt': 'Heading-',
'wikEdDecreaseHeading title': 'Decrease heading levels',
'wikEdIncreaseHeading alt': 'Heading+',
'wikEdIncreaseHeading title': 'Increase heading levels',
'wikEdBulletList alt': 'Bullet list',
'wikEdBulletList title': 'Bulleted list',
'wikEdNumberList alt': 'Number list',
'wikEdNumberList title': 'Numbered list',
'wikEdIndentList alt': 'Indent list',
'wikEdIndentList title': 'Indented list',
'wikEdDefinitionList alt': 'Def list',
'wikEdDefinitionList title': 'Definition list',
'wikEdImage alt': 'Image',
'wikEdImage title': 'Image',
'wikEdTable alt': 'Table',
'wikEdTable title': 'Table',
'wikEdRedirect alt': 'Redirect',
'wikEdRedirect title': 'Create redirect, deletes whole text',
'wikEdWikify alt': 'Wikify',
'wikEdWikify title': 'Wikify pasted content',
'wikEdTextify alt': 'Textify',
'wikEdTextify title': 'Convert pasted content to plain text',
// wikEd control buttons, top row
'wikEdTextZoom alt': 'Text zoom',
'wikEdTextZoom title': 'Text zoom cycling',
'wikEdClearHistory alt': 'Clear history',
'wikEdClearHistory title': 'Clear the find, replace, and summary history',
'wikEdScrollToButtons alt': 'Scroll buttons',
'wikEdScrollToButtons title': 'Scroll to edit buttons',
'wikEdScrollToInput alt': 'Scroll edit',
'wikEdScrollToInput title': 'Scroll to edit window',
// wikEd control buttons, bottom row
'wikEdUseWikEd alt': 'Use wikEd',
'wikEdUseWikEd title': 'Toggle between classic text area and wikEd',
'wikEdHighlightSyntax alt': 'Syntax',
'wikEdHighlightSyntax title': 'Toggle automatic syntax highlighting',
'wikEdSource alt': 'Source',
'wikEdSource title': 'Show the source code for testing purposes',
'wikEdUsing alt': 'Using',
'wikEdUsing title': 'Automatically add \'\'…using wikEd\'\' to summaries',
'wikEdFullScreen alt': 'Fullscreen',
'wikEdFullScreen title': 'Toggle the fullscreen mode',
// find and replace buttons, top row
'wikEdGetFind alt': 'Get find',
'wikEdGetFind title': 'Copy selection to find field (double click: copy selection to find and to replace field)',
'wikEdFindAll alt': 'Find all',
'wikEdFindAll title': 'Not yet implemented. Find all matches in whole text or selection',
'wikEdFindPrev alt': 'Find prev',
'wikEdFindPrev title': 'Find previous match',
'wikEdFindNext alt': 'Find next',
'wikEdFindNext title': 'Find next match',
'wikEdUpdown alt': 'Jump up/down',
'wikEdUpdown title': 'Jump to the top / bottom',
'wikEdPrevPos alt': 'Jump prev',
'wikEdPrevPos title': 'Jump to previously changed position',
'wikEdLastPos alt': 'Jump next',
'wikEdLastPos title': 'Jump back to last position',
// find and replace buttons, bottom row
'wikEdGetFind alt': 'Get find + replace',
'wikEdGetFind title': 'Copy selection to find and replace fields',
'wikEdClearFind alt': 'Clear find',
'wikEdClearFind title': 'Clear the find field (to search for selected text)',
'wikEdReplaceAll alt': 'Replace all',
'wikEdReplaceAll title': 'Not yet implemented. Replace all matches in whole text or selection',
'wikEdReplacePrev alt': 'Replace prev',
'wikEdReplacePrev title': 'Replace previous match',
'wikEdReplaceNext alt': 'Replace next',
'wikEdReplaceNext title': 'Replace next match',
'wikEdCaseSensitive alt': 'Case sensitive',
'wikEdCaseSensitive title': 'Search is case sensitive',
'wikEdRegExp alt': 'RegExp',
'wikEdRegExp title': 'Search field is a regular expression',
'wikEdFindAhead alt': 'Find ahead',
'wikEdFindAhead title': 'Find ahead as you type (case-insensitive non-regexp search)',
// fix buttons, top row
'wikEdFixBasic alt': 'Fix basic',
'wikEdFixBasic title': 'Fix blanks and empty lines, also done by other fixing functions',
'wikEdFixHtml alt': 'Fix html',
'wikEdFixHtml title': 'Fix html to wikicode',
'wikEdFixCaps alt': 'Fix caps',
'wikEdFixCaps title': 'Fix caps in headers and lists',
'wikEdfixUnicode alt': 'Fix Unicode',
'wikEdfixUnicode title': 'Fix Unicode character representations',
'wikEdFixAll alt': 'Fix all',
'wikEdFixAll title': 'Fix basic, html, capitalization, and Unicode',
'wikEdFixRegExTypo alt': 'Fix typos',
'wikEdFixRegExTypo title': 'Fix typos using the AutoWikiBrowser RegExTypoFixer rules',
// fix buttons, bottom row
'wikEdFixDashes alt': 'Fix dashes',
'wikEdFixDashes title': 'Fix dashes',
'wikEdFixPunct alt': 'Fix puntuation',
'wikEdFixPunct title': 'Fix spaces before puntuation',
'wikEdFixMath alt': 'Fix math',
'wikEdFixMath title': 'Fix math',
'wikEdFixChem alt': 'Fix chem',
'wikEdFixChem title': 'Fix chemical formulas',
'wikEdFixUnits alt': 'Fix units',
'wikEdFixUnits title': 'Fix units',
// summary buttons
'wikEdClearSummary alt': 'Clear summary',
'wikEdClearSummary title': 'Clear the summary field',
'wikEdPresetSummary': [
'copyedit', 'reply', 'article created', 'intro rewrite',
'linkfix', 'fixing typos', 'removing linkspam', 'reverting test',
'reverting vandalism', 'formatting source text', '{wikEdUsing}'
],
'wikEdSummaryUsing': '…using [[User:Cacycle/wikEd|wikEd]]',
// submit buttons
'wikEdLocalPreviewImg alt': 'Preview below',
'wikEdLocalPreview title': 'Show preview below',
'wikEdLocalDiffImg alt': 'Changes below',
'wikEdLocalDiff title': 'Show current changes below',
'wikEdHelpPageLink': ' | <a href="http://en.wikipedia.org/wiki/User:Cacycle/wikEd_help" target="helpwindow">wikEd help</a>',
// preview and changes buttons, top
'wikEdPreview alt': 'Preview title',
'wikEdPreview title': 'Show preview below',
'wikEdDiff alt': 'Changes title',
'wikEdDiff title': 'Show current changes below',
'wikEdClose alt': 'Close title',
'wikEdClose title': 'Close preview box',
'wikEdScrollToButtons2 alt': 'Scroll buttons',
'wikEdScrollToButtons2 title': 'Scroll to edit buttons',
'wikEdScrollToInput2 alt': 'Scroll edit',
'wikEdScrollToInput2 title': 'Scroll to edit window',
// preview and changes buttons, bottom
'wikEdPreview2 alt': 'Preview title',
'wikEdPreview2 title': 'Show preview above',
'wikEdDiff2 alt': 'Changes title',
'wikEdDiff2 title': 'Show current changes above',
'wikEdClose alt': 'Close title',
'wikEdClose title': 'Close preview box',
'wikEdScrollToButtons3 alt': 'Scroll buttons',
'wikEdScrollToButtons3 title': 'Scroll to edit buttons',
'wikEdScrollToInput3 alt': 'Scroll edit',
'wikEdScrollToInput3 title': 'Scroll to edit window',
// formatting functions
'image filename': 'filename',
'image width': 'width',
'table caption': 'caption',
'table heading': 'heading',
'table cell': 'cell',
'redirect article link': 'article link',
// fixing functions
'External links': 'External links',
'See also': 'See also',
'References': 'References',
// language specific wiki code
'wikicode Image': 'Image',
'wikicode Category': 'Category',
// shortened button texts
'shortenedPreview': 'Preview',
'shortenedChanges': 'Changes'
});
// edit-frame css rules, preset as wikEdFrameCSS[''] = '';
var wikEdFrameCSS = wikEdFrameCSS || [];
WikEdInitObject(wikEdFrameCSS, {
// frame body
'body': 'background: #FFFFFF; margin: 0px; padding: 0.2em; overflow: -moz-scrollbars-vertical; overflow-x: auto; font-family: monospace;',
// syntax highlighting
// horizontal rule
// wiki code
// headings
// tables
// list
// space-pre
// wiki links, images, categories, templates
// interlanguage
// name
// text and parameters
// insert wikicode here
// invisibles, control chars, and strange spaces
});
// main window css rules, preset as wikEdMainCSS[''] = '';
var wikEdMainCSS = wikEdMainCSS || [];
WikEdInitObject(wikEdMainCSS, {
// combo input box
'.wikEdCombo': 'font-size: smaller; padding-left: 0.1em; padding-right: 0.1em; margin-left: 0.1em; margin-right: 0.1em; height: 1.6em; vertical-align: bottom;',
// wikEd button areas
'.wikEdButtonsPreview2': 'background: #d4d0cc; border: 1px black solid; padding: 0.1em; margin: 0.2em 0 0.4em 0; float: right;',
'.wikEdButtonsJump': 'padding: 0.1em; margin: 0 0 0 0.6em; float: right;',
// wikEd buttons
'.wikEdButtonChecked' // preview box
// find field
// replace field
// summary field
// space around submit buttons
// frame
// summary
// input wrapper
// other wrappers
'.wikEdSummaryInputWrapper': 'display: inline;',
'.wikEdSummaryOptions': 'display: inline;',
'.wikEdSubmitWrapper': '',
'.wikEdSubmitButtonsWrapper': '',
'.wikEdLocalPrevWrapper': '',
'.wikEdInsertWrapper': '',
// various
'.wikEdHelpSpan': '',
'#editpage-specialchars': 'clear: both;'
});
// use local copies of images for testing (set to true in local copy of edit page)
var wikEdUseLocalImages = wikEdUseLocalImages || false;
// path to local images for testing
var wikEdImagePathLocal = wikEdImagePathLocal || 'file:///D:/wikEd/images/';
// path to images
var wikEdImagePath = wikEdImagePath || 'http://upload.wikimedia.org/wikipedia/commons/';
// image filenames
var wikEdImage = wikEdImage || [];
// image URLs, preset as wikEdImage[''] = '';
WikEdInitObject(wikEdImage, {
'blank': '5/51/WikEd_blank.png',
'bold': '5/59/WikEd_bold.png',
'bulletList': '6/62/WikEd_bullet_list.png',
'case': 'a/aa/WikEd_case.png',
'caseSensitive': '0/0d/WikEd_case_sensitive.png',
'clearFind': 'f/f0/WikEd_clear_find.png',
'clearHistory': 'c/c8/WikEd_clear_history.png',
'clearSummary': '2/2c/WikEd_clear_summary.png',
'close': '9/97/WikEd_close.png',
'ctrl': '1/10/WikEd_ctrl.png',
'decreaseHeading': '7/72/WikEd_decrease_heading.png',
'definitionList': 'f/f5/WikEd_definition_list.png',
'diff': 'd/db/WikEd_diff.png',
'disabled': '0/07/WikEd_disabled.png',
'error': '3/3e/WikEd_error.png',
'findAhead': '3/34/WikEd_find_ahead.png',
'findAll': '7/75/WikEd_find_all.png',
'findNext': 'a/ad/WikEd_find_next.png',
'findPrev': 'f/f5/WikEd_find_prev.png',
'fixAll': '8/86/WikEd_fix_all.png',
'fixBasic': '3/30/WikEd_fix_basic.png',
'fixCaps': '0/00/WikEd_fix_caps.png',
'fixUnicode': 'd/d4/WikEd_fix_unicode.png',
'fixChem': 'e/e7/WikEd_fix_chem.png',
'fixDash': 'e/e5/WikEd_fix_dash.png',
'fixHtml': '0/05/WikEd_fix_html.png',
'fixMath': '3/3f/WikEd_fix_math.png',
'fixPunct': 'd/db/WikEd_fix_punct.png',
'fixRegExTypo': '9/94/WikEd_fix_reg-ex-typo.png',
'fixUnits': '6/69/WikEd_fix_units.png',
'textZoom': '7/71/WikEd_font_size.png',
'fullScreen': 'd/d3/WikEd_fullscreen.png',
'getFind': '9/96/WikEd_get_selection.png',
'highlightSyntax': '6/67/WikEd_syntax.png',
'image': '3/37/WikEd_image.png',
'increaseHeading': '5/50/WikEd_increase_heading.png',
'indentList': '7/7a/WikEd_indent_list.png',
'italic': 'd/d4/WikEd_italic.png',
'jumpTopBottom': '5/5d/WikEd_jump_top_bottom.png',
'lastPos': '5/54/WikEd_jump_next.png',
'logo': '6/67/WikEd_logo.png',
'nowiki': '5/5a/WikEd_nowiki.png',
'numberList': '3/3b/WikEd_number_list.png',
'prevPos': 'c/c7/WikEd_jump_prev.png',
'preview': '3/31/WikEd_preview.png',
'redirect': 'f/fa/WikEd_redirect.png',
'redo': 'd/d7/WikEd_redo.png',
'redoAll': '2/2d/WikEd_redo_all.png',
'regExp': '6/6a/WikEd_regexp.png',
'replaceAll': '2/2a/WikEd_replace_all.png',
'replaceNext': 'b/b0/WikEd_replace_next.png',
'replacePrev': 'a/a1/WikEd_replace_prev.png',
'scrollToButtons': '0/01/WikEd_align_buttons.png',
'scrollToText': '1/13/WikEd_align_top.png',
'source': '0/02/WikEd_source.png',
'strikethrough': '0/06/WikEd_strikethrough.png',
'subscript': '9/9e/WikEd_subscript.png',
'superscript': 'b/bf/WikEd_superscript.png',
'tab': 'e/e7/WikEd_tab.png',
'table': 'b/bd/WikEd_table.png',
'textify': 'c/cd/WikEd_textify.png',
'underline': '2/21/WikEd_underline.png',
'undo': 'e/e6/WikEd_undo.png',
'undoAll': '0/08/WikEd_undo_all.png',
'unknown': '8/8a/WikEd_unknown.png',
'updateSyntax': '6/67/WikEd_syntax.png',
'useWikEd': '6/67/WikEd_logo.png',
'using': 'e/e0/WikEd_using.png',
'webLink': '1/16/WikEd_weblink.png',
'wikify': '9/9f/WikEd_wikify.png',
'wikiLink': '2/21/WikEd_wikilink.png'
});
// history length for find, replace, and summary fields
Line 197 ⟶ 510:
wikEdHistoryLength['find'] = 10;
wikEdHistoryLength['replace'] = 10;
wikEdHistoryLength['summary'] =
// presets for combo input fields dropdown options, {wikEdUsing} appends a link to this script
Line 207 ⟶ 520:
// expiration time span for history cookies in seconds
var wikEdCookieExpireSec = wikEdCookieExpireSec || (
// find ahead as you type checkbox preset
Line 216 ⟶ 529:
// enable wikEd preset
var
// initial text zoom for edit window (percentage)
var wikEdTextZoom = wikEdTextZoom || 100;
Line 224 ⟶ 537:
var wikEdRemoveHighlightComments = wikEdRemoveHighlightComments || true;
// show the edit toolbar when the rich-text edit
var wikEdShowToolbar = wikEdShowToolbar || true;
// show the text-to-source button for testing purposes
var wikEdShowSourceButton = wikEdShowSourceButton ||
// remove linebreak before minor edit checkbox
Line 238 ⟶ 551:
// use RegExTypoFix (http://en.wikipedia.org/wiki/User:Mboverload/RegExTypoFix), needs Wikipedia:AutoWikiBrowser/typos.js
var wikEdRegExTypoFix = wikEdRegExTypoFix || true;
Line 328 ⟶ 560:
// global variables
var wikEdLoaded = wikEdLoaded || false;
var wikEdDisabled = false;
// history
Line 347 ⟶ 581:
// global dom elements
var wikEdLogo = {};
var wikEdLogoList = {};
var wikEdTextarea = {};
var wikEdFrame = {};
Line 360 ⟶ 597:
var wikEdButtonsWrapper = {};
var wikEdSummaryWrapper = {};
var wikEdSummaryInputWrapper = {};
var wikEdSummaryOptions = {};
var wikEdSubmitWrapper = {};
var wikEdSubmitButtonsWrapper = {};
var
var wikEdInsertWrapper = {};
Line 372 ⟶ 611:
var wikEdPreviewBox = {};
var wikEdButtonsPreview2 = {};
var wikEdButtonsJump = {};
var wikEdCaseSensitive = {};
Line 385 ⟶ 625:
var wikEdTextareaHeight;
var wikEdLastPosObj = null;
var wikEdUsing;
// counters
Line 391 ⟶ 632:
// wiki file paths for use in regexps
var wikEdServer = wgServer || '';
var wikEdArticlePath = wgArticlePath || '';
var wikEdScriptPath = wgScriptPath || '';
wikEdServer = wikEdServer.replace(/(\W)/g, '\\$1');
wikEdArticlePath = wikEdArticlePath.replace(wgServer, '');
Line 410 ⟶ 651:
//
// WikEdInitObject: initialize object, keep pre-defined values
//
function
for (var
if (array[key] == null) {
array[key] = preset[key];
}
}
return;
}
//
// insertTags: override the insertTags function in wikibits.js, used for the standard button toolbar
//
function insertTags(tagOpen, tagClose, sampleText) {
if (
WikEdEditButton('wikEdInsertTags', [tagOpen, tagClose, sampleText]);
}
Line 697 ⟶ 731:
//
function WikEdSetup(scrollToText) {
var html = '';
// add image path to image filename
if (
if (wikEdUseLocalImages == true) {
// remove MediaWiki path prefixes
for (i in wikEdImage) {
wikEdImage[i] = wikEdImagePathLocal + wikEdImage[i].replace(/^[0-9a-f]+\/[0-9a-f]+\//, '');
}
}
else {
for (i in wikEdImage) {
wikEdImage[i] = wikEdImagePath + wikEdImage[i];
}
}
// insert logo into personal toolbar
wikEdLogo = document.createElement('img');
wikEdLogo.id = 'wikEdLogoImg';
wikEdLogo.onclick = WikEdMainSwitch;
wikEdLogoList = document.createElement('li');
wikEdLogoList.id = 'wikEdLogoList';
wikEdLogoList.appendChild(wikEdLogo);
var personalTools = document.getElementById('p-personal');
if (personalTools != null) {
personalTools.getElementsByTagName('ul')[0].appendChild(wikEdLogoList);
}
}
// check if disabled
var cookie = WikEdGetCookie('wikEdDisabled');
if (cookie != '') {
wikEdDisabled = true;
WikEdSetLogo();
return;
}
// check if setup was already run
if (wikEdLoaded == true) {
return;
}
wikEdLoaded = true;
// set error logo
WikEdSetLogo(
// at the moment this works only for mozilla browsers (Mozilla, Mozilla Firefox, Mozilla SeaMonkey)
Line 746 ⟶ 804:
// reset error indicator
WikEdSetLogo(
return;
}
Line 767 ⟶ 825:
}
// button cookie settings
var cookie = WikEdGetCookie('wikEdSummaryUsing');
if (cookie != '') {
wikEdUsing = true;
}
else {
wikEdUsing = false;
}
cookie = WikEdGetCookie('wikEdUseClassic');
if (cookie != '') {
wikEdUseWikEd = false;
}
cookie = WikEdGetCookie('wikEdSyntaxOff');
if (cookie != '') {
wikEdHighlightSyntax = false;
}
Line 822 ⟶ 887:
wikEdSummaryWrapper.className = 'wikEdSummaryWrapper';
wikEdConsoleWrapper.appendChild(wikEdSummaryWrapper);
// create summary input wrapper
wikEdSummaryInputWrapper = document.createElement('div');
wikEdSummaryInputWrapper.id = 'wikEdSummaryInputWrapper';
wikEdSummaryInputWrapper.className = 'wikEdSummaryInputWrapper';
wikEdSummaryWrapper.appendChild(wikEdSummaryInputWrapper);
// create minor edit and watch page wrapper
wikEdSummaryOptions = document.createElement('div');
wikEdSummaryOptions.id = 'wikEdSummaryOptions';
wikEdSummaryOptions.className = 'wikEdSummaryOptions';
wikEdSummaryWrapper.appendChild(wikEdSummaryOptions);
// create submit wrapper for submit buttons and help links
Line 836 ⟶ 913:
// create preview wrapper for preview and diff box
wikEdLocalPrevWrapper.id = 'wikEdLocalPrevWrapper';
wikEdInputWrapper.appendChild(
// create insert wrapper for insert special chars links
Line 861 ⟶ 938:
// call wikibits:mwSetupToolbar() now because it would terminate with an error after setting textarea to display: none
if (
if (wpToolbar != null) {
if (wpToolbar.getElementsByTagName('IMG').length == 0) {
Line 872 ⟶ 949:
}
// add summary elements to summary input wrapper
var summaryLabel = document.getElementById('wpSummaryLabel');
wikEdSummaryText = document.getElementById('wpSummary');
// move editpage-copywarn out of summary wrapper
Line 886 ⟶ 963:
}
// add summary elements to summary options wrapper
// crashes Mozilla when appended after filling the iframe
var editOptions = document.getElementById('wpMinoredit').parentNode;
Line 894 ⟶ 972:
wikEdTextareaWrapper.appendChild(wikEdTextarea);
// add edit
// any DOM changes to a starting iframe in designmode may crash the browser, including DOM move, display: none; and position: absolute;
Line 929 ⟶ 1,007:
html += '<div class="wikEdButtonsFormat" id="wikEdButtonsFormat">';
html += '<img class="wikEdButtonInactive" src="' + wikEdImage['undo'] + '" width="16" height="16" id="wikEdUndo" alt="' + wikEdText['wikEdUndo alt']
html += '<img class="wikEdButtonInactive" src="' + wikEdImage['redo'] + '" width="16" height="16" id="wikEdRedo" alt="' + wikEdText['wikEdRedo alt']
html += '<img class="wikEdButton" src="' + wikEdImage['bold'] + '" width="16" height="16" id="wikEdBold" alt="' + wikEdText['wikEdBold alt']
html += '<img class="wikEdButton" src="' + wikEdImage['italic'] + '" width="16" height="16" id="wikEdItalic" alt="' + wikEdText['wikEdItalic alt']
html += '<img class="wikEdButton" src="' + wikEdImage['underline'] + '" width="16" height="16" id="wikEdUnderline" alt="' + wikEdText['wikEdUnderline alt']
html += '<img class="wikEdButton" src="' + wikEdImage['strikethrough'] + '" width="16" height="16" id="wikEdStrikethrough" alt="' + wikEdText['wikEdStrikethrough alt']
html += '<img class="wikEdButton" src="' + wikEdImage['nowiki'] + '" width="16" height="16" id="wikEdNowiki" alt="' + wikEdText['wikEdNowiki alt']
html += '<img class="wikEdButton" src="' + wikEdImage['superscript'] + '" width="16" height="16" id="wikEdSuperscript" alt="' + wikEdText['wikEdSuperscript alt']
html += '<img class="wikEdButton" src="' + wikEdImage['subscript'] + '" width="16" height="16" id="wikEdSubscript" alt="' + wikEdText['wikEdSubscript alt']
html += '<img class="wikEdButton" src="' + wikEdImage['case'] + '" width="16" height="16" id="wikEdCase" alt="' + wikEdText['wikEdCase alt']
html += '<img class="wikEdButton" src="' + wikEdImage['undoAll'] + '" width="16" height="16" id="wikEdUndoAll" alt="' + wikEdText['wikEdUndoAll alt']
html += '<img class="wikEdButtonInactive" src="' + wikEdImage['redoAll'] + '" width="16" height="16" id="wikEdRedoAll" alt="' + wikEdText['wikEdRedoAll alt']
html += '<img class="wikEdButton" src="' + wikEdImage['updateSyntax'] + '" width="16" height="16" id="wikEdUpdateSyntax" alt="' + wikEdText['wikEdUpdateSyntax alt']
html += '<br />';
html += '<img class="wikEdButton" src="' + wikEdImage['wikiLink'] + '" width="16" height="16" id="wikEdWikiLink" alt="' + wikEdText['wikEdWikiLink alt']
html += '<img class="wikEdButton" src="' + wikEdImage['webLink'] + '" width="16" height="16" id="wikEdWebLink" alt="' + wikEdText['wikEdWebLink alt']
html += '<img class="wikEdButton" src="' + wikEdImage['decreaseHeading'] + '" width="16" height="16" id="wikEdDecreaseHeading" alt="' + wikEdText['wikEdDecreaseHeading alt']
html += '<img class="wikEdButton" src="' + wikEdImage['increaseHeading'] + '" width="16" height="16" id="wikEdIncreaseHeading" alt="' + wikEdText['wikEdIncreaseHeading alt']
html += '<img class="wikEdButton" src="' + wikEdImage['bulletList'] + '" width="16" height="16" id="wikEdBulletList" alt="' + wikEdText['wikEdBulletList alt']
html += '<img class="wikEdButton" src="' + wikEdImage['numberList'] + '" width="16" height="16" id="wikEdNumberList" alt="' + wikEdText['wikEdNumberList alt']
html += '<img class="wikEdButton" src="' + wikEdImage['indentList'] + '" width="16" height="16" id="wikEdIndentList" alt="' + wikEdText['wikEdIndentList alt']
html += '<img class="wikEdButton" src="' + wikEdImage['definitionList'] + '" width="16" height="16" id="wikEdDefinitionList" alt="' + wikEdText['wikEdDefinitionList alt']
html += '<img class="wikEdButton" src="' + wikEdImage['image'] + '" width="16" height="16" id="wikEdImage" alt="' + wikEdText['wikEdImage alt']
html += '<img class="wikEdButton" src="' + wikEdImage['table'] + '" width="16" height="16" id="wikEdTable" alt="' + wikEdText['wikEdTable alt']
html += '<img class="wikEdButton" src="' + wikEdImage['redirect'] + '" width="16" height="16" id="wikEdRedirect" alt="' + wikEdText['wikEdRedirect alt']
html += '<img class="wikEdButton" src="' + wikEdImage['wikify'] + '" width="16" height="16" id="wikEdWikify" alt="' + wikEdText['wikEdWikify alt']
html += '<img class="wikEdButton" src="' + wikEdImage['textify'] + '" width="16" height="16" id="wikEdTextify" alt="' + wikEdText['wikEdTextify alt']
html += '</div>';
// wikEd control buttons
html += '<div class="wikEdButtonsControl" id="wikEdButtonsControl">';
html += '<img class="wikEdButton" src="' + wikEdImage['textZoom'] + '" width="16" height="16" id="wikEdTextZoom" alt="' + wikEdText['wikEdTextZoom alt']
html += '<img class="wikEdButton" src="' + wikEdImage['clearHistory'] + '" width="16" height="16" id="wikEdClearHistory" alt="' + wikEdText['wikEdClearHistory alt']
html += '<img class="wikEdButton" src="' + wikEdImage['scrollToButtons'] + '" width="16" height="16" id="wikEdScrollToButtons" alt="' + wikEdText['wikEdScrollToButtons alt']
html += '<img class="wikEdButton" src="' + wikEdImage['scrollToText'] + '" width="16" height="16" id="wikEdScrollToInput" alt="' + wikEdText['wikEdScrollToInput alt']
html += '<br />';
html += '<img class="wikEdButtonChecked" src="' + wikEdImage['useWikEd'] + '" width="16" height="16" id="wikEdUseWikEd" alt="' + wikEdText['wikEdUseWikEd alt']
html += '<img class="wikEdButtonUnchecked" src="' + wikEdImage['highlightSyntax'] + '" width="16" height="16" id="wikEdHighlightSyntax" alt="' + wikEdText['wikEdHighlightSyntax alt']
if (wikEdShowSourceButton == true) {
html += '<img class="wikEdButton" src="' + wikEdImage['source'] + '" width="16" height="16" id="wikEdSource" alt="' + wikEdText['wikEdSource alt']
}
html += '<img class="
html += '<img class="wikEdButton" src="' + wikEdImage['fullScreen'] + '" width="16" height="16" id="wikEdFullScreen" alt="' + wikEdText['wikEdFullScreen alt'] + '" title="' + wikEdText['wikEdFullScreen title'] + '" onClick="javascript:WikEdButton(\'wikEdFullScreen\', true);">';
html += '</div>';
Line 978 ⟶ 1,057:
html += '<div class="wikEdButtonsFind" id="wikEdButtonsFind">';
html += '<img class="wikEdButton" src="' + wikEdImage['getFind'] + '" width="16" height="16" id="wikEdGetFind" alt="' + wikEdText['wikEdGetFind alt']
html += '<img class="wikEdButton" src="' + wikEdImage['findAll'] + '" width="16" height="16" id="wikEdFindAll" alt="' + wikEdText['wikEdFindAll alt']
html += '<img class="wikEdButton" src="' + wikEdImage['findPrev'] + '" width="16" height="16" id="wikEdFindPrev" alt="' + wikEdText['wikEdFindPrev alt']
html += '<span class="wikEdFindComboInput" id="wikEdFindComboInput">';
Line 988 ⟶ 1,067:
html += '</span>';
html += '<img class="wikEdButton" src="' + wikEdImage['findNext'] + '" width="16" height="16" id="wikEdFindNext" alt="' + wikEdText['wikEdFindNext alt']
html += '<img class="wikEdButton" src="' + wikEdImage['jumpTopBottom'] + '" width="16" height="16" id="wikEdUpdown" alt="' + wikEdText['wikEdUpdown alt']
html += '<img class="wikEdButtonInactive" src="' + wikEdImage['prevPos'] + '" width="16" height="16" id="wikEdPrevPos" alt="' + wikEdText['wikEdPrevPos alt']
html += '<img class="wikEdButtonInactive" src="' + wikEdImage['lastPos'] + '" width="16" height="16" id="wikEdLastPos" alt="' + wikEdText['wikEdLastPos alt']
html += '<br />';
html += '<img class="wikEdButton" src="' + wikEdImage['clearFind'] + '" width="16" height="16" id="wikEdClearFind" alt="' + wikEdText['wikEdClearFind alt']
html += '<img class="wikEdButton" src="' + wikEdImage['replaceAll'] + '" width="16" height="16" id="wikEdReplaceAll" alt="' + wikEdText['wikEdReplaceAll alt']
html += '<img class="wikEdButton" src="' + wikEdImage['replacePrev'] + '" width="16" height="16" id="wikEdReplacePrev" alt="' + wikEdText['wikEdReplacePrev alt']
html += '<span class="wikEdReplaceComboInput" id="wikEdReplaceComboInput">';
Line 1,004 ⟶ 1,083:
html += '</span>';
html += '<img class="wikEdButton" src="' + wikEdImage['replaceNext'] + '" width="16" height="16" id="wikEdReplaceNext" alt="' + wikEdText['wikEdReplaceNext alt']
html += '<img class="wikEdButtonUnchecked" src="' + wikEdImage['caseSensitive'] + '" width="16" height="16" id="wikEdCaseSensitive" alt="' + wikEdText['wikEdCaseSensitive alt']
html += '<img class="wikEdButtonUnchecked" src="' + wikEdImage['regExp'] + '" width="16" height="16" id="wikEdRegExp" alt="' + wikEdText['wikEdRegExp alt']
html += '<img class="wikEdButtonUnchecked" src="' + wikEdImage['findAhead'] + '" width="16" height="16" id="wikEdFindAhead" alt="' + wikEdText['wikEdFindAhead alt']
html += '</div>';
Line 1,013 ⟶ 1,092:
html += '<div class="wikEdButtonsFix" id="wikEdButtonsFix">';
html += '<img class="wikEdButton" src="' + wikEdImage['fixBasic'] + '" width="16" height="16" id="wikEdFixBasic" alt="' + wikEdText['wikEdFixBasic alt']
html += '<img class="wikEdButton" src="' + wikEdImage['fixHtml'] + '" width="16" height="16" id="wikEdFixHtml" alt="' + wikEdText['wikEdFixHtml alt']
html += '<img class="wikEdButton" src="' + wikEdImage['fixCaps'] + '" width="16" height="16" id="wikEdFixCaps" alt="' + wikEdText['wikEdFixCaps alt']
html += '<img class="wikEdButton" src="' + wikEdImage['fixUnicode'] + '" width="16" height="16" id="wikEdfixUnicode" alt="' + wikEdText['wikEdfixUnicode alt']
html += '<img class="wikEdButton" src="' + wikEdImage['fixAll'] + '" width="16" height="16" id="wikEdFixAll" alt="' + wikEdText['wikEdFixAll alt']
html += '<img class="wikEdButton" src="' + wikEdImage['fixRegExTypo'] + '" width="16" height="16" id="wikEdFixRegExTypo" alt="' + wikEdText['wikEdFixRegExTypo alt']
html += '<br />';
html += '<img class="wikEdButton" src="' + wikEdImage['fixDash'] + '" width="16" height="16" id="wikEdFixDashes" alt="' + wikEdText['wikEdFixDashes alt']
html += '<img class="wikEdButton" src="' + wikEdImage['fixPunct'] + '" width="16" height="16" id="wikEdFixPunct" alt="' + wikEdText['wikEdFixPunct alt']
html += '<img class="wikEdButton" src="' + wikEdImage['fixMath'] + '" width="16" height="16" id="wikEdFixMath" alt="' + wikEdText['wikEdFixMath alt']
html += '<img class="wikEdButton" src="' + wikEdImage['fixChem'] + '" width="16" height="16" id="wikEdFixChem" alt="' + wikEdText['wikEdFixChem alt']
html += '<img class="wikEdButton" src="' + wikEdImage['fixUnits'] + '" width="16" height="16" id="wikEdFixUnits" alt="' + wikEdText['wikEdFixUnits alt']
html += '</div>';
html += '<br style="clear: both;">';
Line 1,051 ⟶ 1,130:
html = '';
html += '<img class="wikEdButton" src="' + wikEdImage['preview'] + '" width="16" height="16" id="wikEdPreview" alt="' + wikEdText['wikEdPreview alt']
html += '<img class="wikEdButton" src="' + wikEdImage['diff'] + '" width="16" height="16" id="wikEdDiff" alt="' + wikEdText['wikEdDiff alt']
html += '<img class="wikEdButton" src="' + wikEdImage['close'] + '" width="16" height="16" id="wikEdClose" alt="' + wikEdText['wikEdClose alt']
html += '<img class="wikEdButton" src="' + wikEdImage['scrollToButtons'] + '" width="16" height="16" id="wikEdScrollToButtons2" alt="' + wikEdText['wikEdScrollToButtons2 alt']
html += '<img class="wikEdButton" src="' + wikEdImage['scrollToText'] + '" width="16" height="16" id="wikEdScrollToInput2" alt="' + wikEdText['wikEdScrollToInput2 alt']
buttonsPreview.innerHTML = html;
Line 1,069 ⟶ 1,148:
html += '<div id="wikEdButtonsPreview2" class="wikEdButtonsPreview2">';
html += '<img class="wikEdButton" src="' + wikEdImage['preview'] + '" width="16" height="16" id="wikEdPreview2" alt="' + wikEdText['wikEdPreview2 alt']
html += '<img class="wikEdButton" src="' + wikEdImage['diff'] + '" width="16" height="16" id="wikEdDiff2" alt="' + wikEdText['wikEdDiff2 alt']
html += '<img class="wikEdButton" src="' + wikEdImage['close'] + '" width="16" height="16" id="wikEdClose2" alt="' + wikEdText['wikEdClose2 alt']
html += '<img class="wikEdButton" src="' + wikEdImage['scrollToButtons'] + '" width="16" height="16" id="wikEdScrollToButtons3" alt="' + wikEdText['wikEdScrollToButtons3 alt']
html += '<img class="wikEdButton" src="' + wikEdImage['scrollToText'] + '" width="16" height="16" id="wikEdScrollToInput3" alt="' + wikEdText['wikEdScrollToInput3 alt']
html += '</div>';
wikEdPreviewBox = document.getElementById('wikEdPreviewBox');
wikEdButtonsPreview2 = document.getElementById('wikEdButtonsPreview2');
// add jump box to standard preview
var wikiPreview = document.getElementById('wikiPreview');
if (wikiPreview != null) {
if (wikiPreview.firstChild != null) {
var buttonsJump = document.createElement('div');
buttonsJump.id = 'wikEdButtonsJump';
buttonsJump.className = 'wikEdButtonsJump';
html = '';
html += '<img class="wikEdButtonSolo" src="' + wikEdImage['scrollToButtons'] + '" width="16" height="16" id="wikEdScrollToButtons4" alt="' + wikEdText['wikEdScrollToButtons4 alt'] + '" title="' + wikEdText['wikEdScrollToButtons4 title'] + '" onClick="javascript:WikEdButton(\'wikEdScrollToButtons4\');">';
html += '<img class="wikEdButtonSolo" src="' + wikEdImage['scrollToText'] + '" width="16" height="16" id="wikEdScrollToInput4" alt="' + wikEdText['wikEdScrollToInput4 alt'] + '" title="' + wikEdText['wikEdScrollToInput4 title'] + '" onClick="javascript:WikEdButton(\'wikEdScrollToInput4\');">';
buttonsJump.innerHTML = html;
wikiPreview.insertBefore(buttonsJump, wikiPreview.firstChild);
wikEdButtonsJump = document.getElementById('wikEdButtonsJump');
}
}
// add insert special chars to insert wrapper
var wpSpecialchars = document.getElementById('editpage-specialchars');
if (wpSpecialchars != null) {
wikEdInsertWrapper.appendChild(wpSpecialchars); }
// wrappers filled
// display only the textarea or the iframe
if (
WikEdSetEditArea(true);
}
Line 1,127 ⟶ 1,227:
// initialize image buttons
WikEdButton('wikEdHighlightSyntax', null, wikEdHighlightSyntax);
WikEdButton('wikEdUseWikEd', null,
WikEdButton('wikEdFullScreen', null, false);
WikEdButton('wikEdUsing', null, wikEdUsing);
WikEdButton('wikEdCaseSensitive', null, false);
WikEdButton('wikEdRegExp', null, false);
Line 1,212 ⟶ 1,312:
summaryComboInput.appendChild(summarySelect);
// shorten submit button texts
document.getElementById('wpPreview').value = wikEdText['
document.getElementById('wpDiff').value = wikEdText['
// set up combo input boxes with history
wikEdFieldHist ['find'] = [];
wikEdCookieName['find'] = '
wikEdInputElement['find'] = new Object(wikEdFindText);
wikEdSelectElement['find'] = new Object(document.getElementById('wikEdFindSelect'));
Line 1,224 ⟶ 1,324:
wikEdFieldHist ['replace'] = [];
wikEdCookieName['replace'] = '
wikEdInputElement['replace'] = new Object(wikEdReplaceText);
wikEdSelectElement['replace'] = new Object(document.getElementById('wikEdReplaceSelect'));
Line 1,230 ⟶ 1,330:
wikEdFieldHist ['summary'] = [];
wikEdCookieName['summary'] = '
wikEdInputElement['summary'] = new Object(wikEdSummaryText);
wikEdSelectElement['summary'] = new Object(document.getElementById('wikEdSummarySelect'));
Line 1,269 ⟶ 1,369:
// copy the textarea content to the iframe
if (
WikEdUpdateFrame();
}
// set frame events
wikEdFrameDocument.addEventListener('keydown', WikEdKeyFrame, true);
wikEdFrameDocument.addEventListener('keyup', WikEdKeyFrame, true);
wikEdFrameDocument.addEventListener('keypress', WikEdKeyFrame, true);
Line 1,293 ⟶ 1,394:
WikEdFullScreen(false);
}
if (
WikEdUpdateTextarea();
}
// add "using wikEd" to summary
var text = wikEdSummaryText.value;
text = text.replace(/^[, ]+/, '');
text = text.replace(/[, ]+$/, '');
WikEdAddToHistory('summary');
if ( (wikEdUsing == true) && (text != '') ) {
if (text.lastIndexOf(wikEdSummaryUsing) < 0) {
text += ' ' + wikEdSummaryUsing;
}
}
wikEdSummaryText.value = text;
saveButton.onclick = null;
saveButton.click();
Line 1,307 ⟶ 1,419:
WikEdFullScreen(false);
}
if (
WikEdUpdateTextarea();
}
Line 1,320 ⟶ 1,432:
WikEdFullScreen(false);
}
if (
WikEdUpdateTextarea();
}
Line 1,344 ⟶ 1,456:
// scroll to edit window if it is not a preview page
if (scrollToText != false) {
if (window.___location.search.match('noscroll') == null) { window.scroll(0, WikEdGetOffsetTop(wikEdInputWrapper) - 2);
// focus the edit area
wikEdFrameWindow.focus();
wikEdTextarea.setSelectionRange(0, 0);
wikEdTextarea.focus();
}
}
// reset error indicator
WikEdSetLogo(
return;
Line 1,368 ⟶ 1,482:
//
function WikEdSetLogo(
if (
}
else {
if (wikEdDisabled == true) {
wikEdLogo.src = wikEdImage['disabled'];
wikEdLogo.title = wikEdText['wikEdLogo disabled title'];
}
else {
wikEdLogo.src = wikEdImage['logo'];
wikEdLogo.alt = wikEdText['wikEdLogo alt'];
wikEdLogo.title = wikEdText['wikEdLogo title'];
}
}
return;
Line 1,506 ⟶ 1,627:
var obj = {};
obj.html = wikEdFrameBody.innerHTML;
obj.html = obj.html.replace(/(<br\b[^>]*>)\n* */g, '$1');
if (buttonObj.checked == true) {
WikEdRemoveHighlighting(obj);
Line 1,512 ⟶ 1,634:
WikEdHighlightSyntax(obj);
obj.html = obj.html.replace(/\n/g, '<br />');
cookieExpire.setTime(cookieExpire.getTime() - 60 * 60 * 1000);
WikEdSetCookie('wikEdSyntaxOff', '', cookieExpire.toGMTString(), '/');
}
else {
wikEdHighlightSyntax = false;
WikEdRemoveHighlighting(obj);
obj.html = obj.html.replace(/(\t)/g, '<
WikEdSetCookie('wikEdSyntaxOff', 'true', null, '/');
}
wikEdFrameBody.innerHTML = obj.html;
Line 1,525 ⟶ 1,650:
case 'wikEdScrollToInput2':
case 'wikEdScrollToInput3':
case 'wikEdScrollToInput4':
var wikEdInputWrapper = document.getElementById('wikEdInputWrapper');
var inputWrapperTop = WikEdGetOffsetTop(wikEdInputWrapper);
Line 1,534 ⟶ 1,660:
case 'wikEdScrollToButtons2':
case 'wikEdScrollToButtons3':
case 'wikEdScrollToButtons4':
var wikEdConsoleWrapper = document.getElementById('wikEdConsoleWrapper');
var consoleWrapperTop = WikEdGetOffsetTop(wikEdConsoleWrapper);
Line 1,555 ⟶ 1,682:
WikEdFullScreen(false);
}
if (
WikEdUpdateTextarea();
}
wikEdPreviewBox.innerHTML = wiki2html(wikEdTextarea.value);
break;
Line 1,569 ⟶ 1,696:
WikEdFullScreen(false);
}
if (
WikEdUpdateTextarea();
}
Line 1,575 ⟶ 1,702:
diffText = StringDiff(wikEdOrigVersion, diffText);
wikEdPreviewBox.innerHTML = diffText;
break;
Line 1,581 ⟶ 1,708:
case 'wikEdClose':
case 'wikEdClose2':
break;
Line 1,594 ⟶ 1,721:
// turn rich text frame on
WikEdSetEditArea(true);
cookieExpire.setTime(cookieExpire.getTime() - 60 * 60 * 1000);
WikEdSetCookie('wikEdUseClassic', '', cookieExpire.toGMTString(), '/');
}
Line 1,606 ⟶ 1,735:
// turn classic textarea on
WikEdSetEditArea(false);
WikEdSetCookie('wikEdUseClassic', 'true', null, '/');
}
break;
// add "using wikEd" to summaries
case 'wikEdUsing':
var cookieExpire = new Date();
if (buttonObj.checked == true) {
wikEdUsing = true;
WikEdSetCookie('wikEdSummaryUsing', 'true', null, '/');
}
else {
wikEdUsing = false;
cookieExpire.setTime(cookieExpire.getTime() - 60 * 60 * 1000);
WikEdSetCookie('wikEdSummaryUsing', '', cookieExpire.toGMTString(), '/');
}
break;
Line 2,324 ⟶ 2,469:
case 'wikEdRedirect':
var linkTarget;
if (obj.
linkTarget = obj.selection.plain;
}
else if (obj.selectionWord.plain != '') {
linkTarget = obj.selectionWord.plain;
}
Line 2,345 ⟶ 2,493:
obj.changed.plain = '#redirect [[' + linkTarget + ']]';
// append to summary
WikEdAppendToSummary(wikEdInputElement['summary'].value, '#redirect [[' + linkTarget + ']]');
selectChange = false;
break;
Line 2,638 ⟶ 2,786:
// display tabs
else {
obj.html = obj.html.replace(/(\t)/g, '<
}
Line 2,655 ⟶ 2,803:
var frameSrollTop;
if (obj.changed.from == 'whole') {
frameSrollTop = wikEdFrameBody.scrollTop;
}
Line 2,710 ⟶ 2,858:
// focus the frame
if (
wikEdFrameWindow.focus();
}
Line 2,815 ⟶ 2,963:
// convert html to plain
obj.plain = obj.html;
obj.plain = obj.plain.replace(/\n/g, ' ');
// delete tags
obj.plain = obj.plain.replace(/<(style
// newlines
Line 2,860 ⟶ 3,008:
obj.plain = obj.plain.replace(/<[^>]*>/g, '');
// remove
obj.plain = obj.plain.replace(/[ \t\u00a0]+(
obj.plain = obj.plain.replace(/(\u0000)[ \t\u00a0]+/g, '$1');
// trim down \u0000 and \n
obj.plain = obj.plain.replace(/\u0000+/g, '\n');
return;
Line 3,352 ⟶ 3,499:
obj.html = obj.html.replace(/<(\/?\w.*?)>/g, '<$1>');
// wikify, keep user added attribute
WikEdWikifyHTML(obj, true);
// turn real html into visible html code
Line 3,620 ⟶ 3,767:
WikEdRemoveHighlighting(obj);
// wikify, don't allow many attributes
if (obj.htmlCode == true) {
WikEdWikifyHTML(obj, false);
}
}
Line 3,652 ⟶ 3,799:
*/
function WikEdWikifyHTML(obj, relaxed) {
var regExpStr;
Line 3,661 ⟶ 3,808:
obj.html = obj.html.replace(/<(style)\b[^>]*>.*?<\/\1>/g, '');
// sanitize
obj.html = obj.html.replace(/<(
function (p, p1, p2
return('<' + p1 + WikEdSanitizeAttributes(p1, p2, relaxed) + '>');
}
);
Line 3,697 ⟶ 3,841:
if (p3 == '') {
isRemove.push(true);
return('\
}
isRemove.push(false);
Line 3,703 ⟶ 3,847:
}
if (isRemove.pop() == true) {
return('\
}
return(p1);
}
);
// escape character entities
Line 3,735 ⟶ 3,876:
// <hr> horizontal rule
obj.html = obj.html.replace(/(\n|\u0000|\s)*<hr\b[^>]*>(\n|\u0000|\s)*/i, '\
// <i> <em> <dfn> <var> <cite> italic
Line 3,748 ⟶ 3,889:
obj.html = obj.html.replace(/<span class=\"editsection\">.*?<\/span> */g, '');
obj.html = obj.html.replace(/[\s\u0000]*<h1\b[^>]*>(.*?)<\/h1>[\s\u0000]*/g, '\
obj.html = obj.html.replace(/[\s\u0000]*<h2\b[^>]*>(.*?)<\/h2>[\s\u0000]*/g, '\
obj.html = obj.html.replace(/[\s\u0000]*<h3\b[^>]*>(.*?)<\/h3>[\s\u0000]*/g, '\
obj.html = obj.html.replace(/[\s\u0000]*<h4\b[^>]*>(.*?)<\/h4>[\s\u0000]*/g, '\
obj.html = obj.html.replace(/[\s\u0000]*<h5\b[^>]*>(.*?)<\/h5>[\s\u0000]*/g, '\
obj.html = obj.html.replace(/[\s\u0000]*<h6\b[^>]*>(.*?)<\/h6>[\s\u0000]*/g, '\
obj.html = obj.html.replace(/<span\b[^>]*\bclass=\"mw-headline\">(.*?)<\/span> */g, '$1');
// remove <thead> <tbody> <tfoot>
obj.html = obj.html.replace(/([\s
// line breaks in table cells
obj.html = obj.html.replace(/(<(td|th)\b[^>]*>)
function(p, p1, p2, p3, p4) {
p3 = p3.replace(/^(\
p3 = p3.replace(/(\s|\u0000|<br\b[^>]*>)+$/g, '');
p3 = p3.replace(/<br\b[^>]*> */g, '<br />');
return(p1 + p3 + p4);
}
);
// remove table closing tags
obj.html = obj.html.replace(/([\s\u0000]*<\/(td|th|tr|caption|thead|tbody|tfoot)>[\s\u0000]*)/g, '');
// <td> table cells
obj.html = obj.html.replace(/[\s\u0000]*<td>[\s\u0000]*/g, '\
obj.html = obj.html.replace(/[\s\u0000]*<(td) +([^>]*)>[\s\u0000]*/g,
function (p, p1, p2) {
return('\
}
);
// <th> table cells
obj.html = obj.html.replace(/[\s\u0000]*<th>[\s\u0000]*/g, '\
obj.html = obj.html.replace(/[\s\u0000]*<(th) +([^>]*)>[\s\u0000]*/g,
function (p, p1, p2) {
return('\
}
);
// line breaks in table cells (continued)
obj.html = obj.html.replace(/<br\b[^>]*>/g, '\
// <tr> table rows
obj.html = obj.html.replace(/[\s\u0000]*<tr>[\s\u0000]*/g, '\
obj.html = obj.html.replace(/[\s\u0000]*<(tr) +([^>]*)>[\s\u0000]*/g,
function (p, p1, p2) {
return('\
}
);
// <caption> captionCaption
obj.html = obj.html.replace(/[\s\u0000]*<caption>[\s\u0000]*/g, '\
obj.html = obj.html.replace(/[\s\u0000]*<(caption) +([^>]*)>[\s\u0000]*/g,
function (p, p1, p2) {
return('\
}
);
// <table> tables
obj.html = obj.html.replace(/[\s\u0000]*<table>[\s\u0000]*(\|-[\n|\u0000])?/g, '\
obj.html = obj.html.replace(/[\s\u0000]*<(table) +([^>]*)>[\s\u0000]*(\|-[\n|\u0000])?/g,
function (p, p1, p2) {
return('\
}
);
obj.html = obj.html.replace(/[\s\u0000]*<\/table>[\s\u0000]*/g, '\
// convert links
Line 3,978 ⟶ 4,114:
// clean up MediaWiki category list
var regExp = new RegExp('<span\\b[^>]*>(\\[\\[' + wikEdText['wikicode Category'] + ':[^\\]]+\\]\\])<\\/span>[\\s\\u0000\\|]*', 'gi');
obj.html = obj.html.replace(regExp, '$1\
// clean up DOI
Line 3,999 ⟶ 4,135:
if (regExpMatch != null) {
imgAlt = regExpMatch[2].replace(/^ +| +$/g, '');
imgAlt = imgAlt.replace(/&nbsp;|[\n\u0000]/g, ' ');
imgAlt = imgAlt.replace(/ {2,}/g, ' ');
imgAlt = imgAlt.replace(/^ | $/g, '');
Line 4,028 ⟶ 4,164:
var listObj = {};
listObj.prefix = '';
obj.html = obj.html.replace(/
function (p, p1, p2, p3, p4) {
switch (p1.toLowerCase()) {
Line 4,044 ⟶ 4,180:
case '/dl':
listObj.prefix = listObj.prefix.substr(0, listObj.prefix.length - 1);
return('\u0000\u0000');
case 'li':
case 'dd':
Line 4,057 ⟶ 4,193:
}
);
obj.html = obj.html.replace(/[\n|\u0000]+[#\*:\;]+ (?=[\n|\u0000])/g, '');
// <> remove not allowed tags
Line 4,071 ⟶ 4,206:
}
);
// sanitize attributes in opening html tags
obj.html = obj.html.replace(/<(\w+) +(.*?) *(\/?)>/g,
function (p, p1, p2, p3) {
if (p3 != '') {
p3 = ' ' + p3;
}
return('<' + p1 + WikEdSanitizeAttributes(p1, p2, relaxed) + p3 + '>');
}
);
// remove space-only lines
obj.html = obj.html.replace(/([\s\u0000]*\u0000[\s\u0000]*)/g,
function (p, p1) {
return(p1.replace(/\n/g, '\u0000'));
}
);
obj.html = obj.html.replace(/\u0000\s+(?=\u0000)/g, '\u0000');
// remove leading and trailing spaces
obj.html = obj.html.replace(/>\s+\u0000/g, '>\u0000');
obj.html = obj.html.replace(/\u0000\s+</g, '\u0000<');
// remove empty inline and block tag pairs
obj.html = obj.html.replace(/( *)<(big|colgroup|code|del|font|ins|pre|s|small|span|strike|sub|sup|tt|u|rb|rp|rt|ruby|nowiki)\b[^>]*><\/\1> */g, '$1');
obj.html = obj.html.replace(/[\s\u0000]*<(blockquote|center|div|math|gallery|noinclude|includeonly|ref|references)\b[^>]*><\/\1>[\s\u0000]*/g, '\
// remove empty lines from div tags
obj.html = obj.html.replace(/(<div\b[^>]*>)[\s\u0000]+/g, '$1');
obj.html = obj.html.replace(/[\s\u0000]+(<\/div>)/g, '$1');
// escape < >
Line 4,081 ⟶ 4,242:
// newlines to <br />
obj.html = obj.html.replace(/
obj.html = obj.html.replace(/\n\u0000+\n{
obj.html = obj.html.replace(/\u0000+\n{2,}/g, '\n\n');
obj.html = obj.html.replace(/\n{2,}\u0000+/g, '\n\n');
obj.html = obj.html.replace(/\u0000+\n/g, '\n');
obj.html = obj.html.replace(/\n\u0000+/g, '\n');
obj.html = obj.html.replace(/\u0000{2,}/g, '\n\n');
obj.html = obj.html.replace(/\u0000/g, '\n');
obj.html = obj.html.replace(/\n/g, '<br />');
Line 4,093 ⟶ 4,260:
//
function WikEdSanitizeAttributes(tag, attributes, relaxed) {
var common;
var tablealign;
var tablecell;
var table;
if (relaxed == true) {
common = 'lang|dir|style|class'; // not needed: id|title
tablealign = '|align|char|charoff|valign';
table = '|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor';
tablecell = '|abbr|axis|headers|scope|rowspan|colspan|nowrap|width|height|bgcolor';
}
else {
common = 'lang|dir';
table = '|border|cellspacing|cellpadding|align|bgcolor';
tablealign = '|align|valign';
tablecell = '|rowspan|colspan|nowrap|bgcolor';
}
tag = tag.toLowerCase();
var sanitized = '';
Line 4,109 ⟶ 4,288:
}
var valid = false;
// relaxed
if (relaxed == true) {
if ('center|em|strong|cite|code|var|sub|supdl|dd|dt|tt|b|i|big|small|strike|s|u|rb|rp|ruby'.indexOf(tag) >= 0) {
if (common.indexOf(attrib) >= 0) { valid = true; }
}
else if ('div|span|h1|h2|h3|h4|h5|h6|p'.indexOf(tag) >= 0) {
if ((common + '|align').indexOf(attrib) >= 0) { valid = true; }
}
else if ('blockquote'.indexOf(tag) >= 0) {
if ((common + '|cite').indexOf(attrib) >= 0) { valid = true; }
}
else if ('br'.indexOf(tag) >= 0) {
if ('style|clear'.indexOf(attrib) >= 0) { valid = true; }
}
else if ('pre'.indexOf(tag) >= 0) {
if ((common + '|width').indexOf(attrib) >= 0) { valid = true; }
}
else if ('ins|del'.indexOf(tag) >= 0) {
if ((common + '|cite|datetime').indexOf(attrib) >= 0) { valid = true; }
}
else if ('ul'.indexOf(tag) >= 0) {
if ((common + '|type').indexOf(attrib) >= 0) { valid = true; }
}
else if ('ol'.indexOf(tag) >= 0) {
if ((common + '|type|start').indexOf(attrib) >= 0) { valid = true; }
}
else if ('li'.indexOf(tag) >= 0) {
if ((common + '|type|value').indexOf(attrib) >= 0) { valid = true; }
}
else if ('table'.indexOf(tag) >= 0) {
if ((common + table).indexOf(attrib) >= 0) { valid = true; }
}
else if ('caption'.indexOf(tag) >= 0) {
if ((common + '|align').indexOf(attrib) >= 0) { valid = true; }
}
else if ('thead|tfoot|tbody'.indexOf(tag) >= 0) {
if ((common + tablealign).indexOf(attrib) >= 0) { valid = true; }
}
else if ('colgroup|col'.indexOf(tag) >= 0) {
if ((common + '|span|width' + tablealign).indexOf(attrib) >= 0) { valid = true; }
}
else if ('tr'.indexOf(tag) >= 0) {
if ((common + '|bgcolor' + tablealign).indexOf(attrib) >= 0) { valid = true; }
}
else if ('td|th'.indexOf(tag) >= 0) {
if ((common + tablecell + tablealign).indexOf(attrib) >= 0) { valid = true; }
}
else if ('font'.indexOf(tag) >= 0) {
if ((common + '|size|color|face').indexOf(attrib) >= 0) { valid = true; }
}
else if ('hr'.indexOf(tag) >= 0) {
if ((common + '|noshade|size|width').indexOf(attrib) >= 0) { valid = true; }
}
else if ('rt'.indexOf(tag) >= 0) {
if ((common + '|rbspan').indexOf(attrib) >= 0) { valid = true; }
}
else if ('ref'.indexOf(tag) >= 0) {
if (('name').indexOf(attrib) >= 0) { valid = true; }
}
else if ('references'.indexOf(tag) >= 0) {
}
}
// strict
if
}
else if ('
if ((common + '
}
else if ('
if (
}
else if ('
if ((common + '|
}
else if ('
if ((common + '|type|start').indexOf(attrib) >= 0) { valid = true; }
}
else if ('
if ((common + '|type|
}
else if ('
if ((common +
}
else if ('
if ((common + '
}
else if ('
if ((common +
}
else if ('
if ((common + '|span' + tablealign).indexOf(attrib) >= 0) { valid = true; }
}
else if ('
if ((common + '|
}
else if ('
if ((common +
}
else if ('
if ((common +
}
else if ('
if ((common + '|noshade|size
}
else if ('
if ((common + '|
}
else if ('
if ((
}
else if ('
}
}
if (valid == true) {
Line 4,173 ⟶ 4,411:
if (attrib == 'style') {
attribValue = attribValue.replace(/(^| )(-moz-[\w\-]+): [\w\-]+; */g, '$1');
attribValue = attribValue.replace(/(^| )([\w\-]+): [^;]*(-moz-[\w\-]+|windowtext)[^;]*; */g, '$1');
attribValue = attribValue.replace(/\b0(%|in|cm|mm|em|ex|pt|pc|px)\b/g, '0');
attribValue = attribValue.replace(/[\w\-]+ *\: *\; */g, '');
Line 4,179 ⟶ 4,417:
attribValue = attribValue.replace(/( |;)+$/g, ';');
}
attribValue = attribValue.replace(/^Ms.*$/g, '');
}
if (attribValue != '') {
sanitized += ' ' + attrib + '="' + attribValue + '"';
}
}
}
Line 4,264 ⟶ 4,507:
return;
}
//
//
Line 4,285 ⟶ 4,530:
obj.html = obj.html.replace(/(<span class=\"wikEdListLine\">[^\n]*)(\n)(?!<span class=\"wikEdListLine\">)/g, '$1</span><!--wikEdListBlock-->$2');
}
// #redirect (finish)
Line 4,328 ⟶ 4,574:
// <gallery> wiki markup
if (singleLine != true) {
obj.html = obj.html.replace(/(<(gallery)\b.*?>)/gi, '
obj.html = obj.html.replace(/(<\/(gallery)\b.*?>)/gi, '$1</span><!--wikEdWiki-->');
}
Line 4,543 ⟶ 4,789:
function (p, p1) {
if (p1 == '\u0009') {
p1 = '<
}
else if (p1 != '\u000a') {
p1 = '<
}
return(p1);
Line 4,561 ⟶ 4,807:
function (p, p1) {
if (p1 != '\u000a') {
p1 = '<
}
return(p1);
Line 4,586 ⟶ 4,832:
var obj = {};
obj.html = wikEdFrameBody.innerHTML;
obj.html = obj.html.replace(/(<br\b[^>]*>)\n* */g, '$1');
// textify so that no html formatting is submitted
Line 4,621 ⟶ 4,868:
// display tabs
else {
obj.html = obj.html.replace(/(\t)/g, '<
}
Line 4,627 ⟶ 4,874:
obj.html = obj.html.replace(/ /g, ' ');
obj.html = obj.html.replace(/ /g, ' ');
obj.html = obj.html.replace(/ \n/g, ' \n');
// newlines to <br />
Line 4,643 ⟶ 4,891:
function WikEdKeyFrame(event) {
if ( (wikEdDisabled == false) && (wikEdUseWikEd == true) ) {
switch (event.type) {
// trap the tab key
case 'keydown':
switch (event.keyCode) {
case 9:
if (event.shiftKey == false) {
event.preventDefault();
// scroll to text input top
if (wikEdFullScreenMode == false) {
var wikEdInputWrapper = document.getElementById('wikEdInputWrapper');
var inputWrapperTop = WikEdGetOffsetTop(wikEdInputWrapper);
window.scroll(0, inputWrapperTop);
}
// focus the summary
wikEdSummaryText.focus();
}
break;
}
break;
// trap any other frame event
case 'keyup':
case 'keypress':
case 'mouseup':
// grey out inactive buttons
// reset the frame DOM cache
break;
}
}
return;
Line 4,678 ⟶ 4,958:
return;
}
// remember position
var sel = wikEdFrameWindow.getSelection();
var range = sel.getRangeAt(sel.rangeCount - 1).cloneRange();
var rangeClone = range.cloneRange();
var frameSrollTop = wikEdFrameBody.scrollTop;
// function: window.find(string, caseSensitive, backwards, wrapAround, wholeWord, searchInFrames, showDialog)
sel.removeAllRanges();
sel.addRange(range);
range.collapse(true);
// function: window.find(string, caseSensitive, backwards, wrapAround, wholeWord, searchInFrames, showDialog)
var found = wikEdFrameWindow.find(findText, false, false, true, false, false, false);
// start from top if not found
if (found == false) {
// set cursor to start and search again
sel.collapse(wikEdFrameBody, 0);
found = wikEdFrameWindow.find(findText, false, false, true, false, false, false);
// add original selection
if (found == false) {
wikEdFrameBody.scrollTop = frameSrollTop;
sel.removeAllRanges();
sel.addRange(rangeClone);
}
}
}
return;
}
//
// WikEdFullScreen: change to fullscreen edit area or back to normal view
//
function WikEdMainSwitch() {
var cookieExpire = new Date();
// enable wikEd
if (wikEdDisabled == true) {
wikEdDisabled = false;
WikEdSetLogo();
cookieExpire.setTime(cookieExpire.getTime() - 60 * 60 * 1000);
WikEdSetCookie('wikEdDisabled', '', cookieExpire.toGMTString(), '/');
// turn rich text frame on
if (wikEdLoaded == true) {
WikEdUpdateFrame();
WikEdSetEditArea(true);
wikEdButtonsControl.style.display = 'block';
wikEdButtonsPreview.style.display = 'block';
wikEdButtonsJump.style.display = 'block';
}
// setup wikEd
else {
WikEdSetup(false);
return;
}
}
// disable wikEd
else {
wikEdDisabled = true;
WikEdSetLogo();
cookieExpire.setTime(cookieExpire.getTime() + wikEdCookieExpireSec * 1000);
WikEdSetCookie('wikEdDisabled', 'true', cookieExpire.toGMTString(), '/');
if (wikEdLoaded == true) {
if (wikEdFullScreenMode == true) {
WikEdFullScreen(false);
}
// turn classic textarea on
WikEdUpdateTextarea();
WikEdSetEditArea(false);
wikEdButtonsControl.style.display = 'none';
wikEdButtonsPreview.style.display = 'none';
wikEdLocalPrevWrapper.style.display = 'none';
wikEdButtonsJump.style.display = 'none';
}
}
return;
}
Line 4,763 ⟶ 5,121:
}
// scroll to edit
if (fullscreen == false) {
window.scroll(0, WikEdGetOffsetTop(wikEdInputWrapper) - 2);
Line 4,816 ⟶ 5,174:
// delete dummy option
if (dummy == true) {
wikEdSelectElement[field].options[0] = null;
}
Line 4,844 ⟶ 5,202:
// add a tag to the summary box
if (field == 'summary') {
}
Line 4,870 ⟶ 5,218:
}
}
// find the new text
if ( (field == 'find') && (wikEdFindAhead.checked == true) ) {
WikEdFindAhead();
}
return;
}
//
// WikEdAppendToSummary: append a phrase to the summary text
//
function WikEdAppendToSummary(summary, append) {
summary = summary.replace(/^[, ]+/, '');
summary = summary.replace(/[, ]+$/, '');
if (summary != '') {
if (summary.match(/ \*\/$/) != null) {
summary += ' ';
}
else if (summary.match(/[\.\;\:]$/) != null) {
summary += ' ';
}
else if (option.summary.match(/^[\w\(\)\"\'\+\-]/) == null) {
summary += ' ';
}
else {
summary += ', ';
}
}
summary += append;
return(summary);
}
Line 4,917 ⟶ 5,299:
while (i < wikEdComboPresetOptions[field].length) {
if (wikEdComboPresetOptions[field][i] == wikEdFieldHist[field][0]) {
wikEdFieldHist[field].shift();
break;
}
Line 4,926 ⟶ 5,308:
}
// cut history number to maximal history length
wikEdFieldHist[field] = wikEdFieldHist[field].slice(0, wikEdHistoryLength[field]);
// saved history to cookie
if (wikEdFieldHist[field][0] != '') {
WikEdSaveHistoryToCookie(field);
}
}
return;
Line 4,947 ⟶ 5,331:
var option = {};
var selected = null;
// delete options
var options = wikEdSelectElement[field].options;
for (i = 0; i
wikEdSelectElement[field].remove(i);
}
Line 4,964 ⟶ 5,347:
option = document.createElement('option');
option.style.display = 'none';
j = 0;
wikEdSelectElement[field].options[j++] = option;
Line 5,020 ⟶ 5,404:
var cookieExpire = new Date();
cookieExpire.setTime( cookieExpire.getTime() + wikEdCookieExpireSec * 1000 );
WikEdSetCookie(wikEdCookieName[field], '', cookieExpire.toGMTString(), '/');
WikEdSetComboOptions(field);
return;
Line 5,054 ⟶ 5,438:
cookie = cookie.replace(/\n$/, '');
cookie = encodeURIComponent(cookie);
WikEdSetCookie(wikEdCookieName[field], cookie, cookieExpire.toGMTString(), '/');
return;
}
Line 5,242 ⟶ 5,626:
//
// WikEdGetInnerHTML: get the innerHTML from a document fragment
//
Line 5,288 ⟶ 5,672:
var value = childNode.nodeValue;
value = value.replace(/\n/g, ' '); // important for pasted page content
obj.plainArray.push(value); // plain array contains & < > instead of & < >
obj.plainNode.push(childNode);
obj.plainStart.push(obj.plain.length);
Line 5,391 ⟶ 5,775:
// removed because of internal use: < ['003c', 'lt']; > ['003e', 'gt']; & ['0026', 'amp'], ['00a0', 'nbsp']
// supported chars in Mozilla and IE
var wikEdSupportedChars = [
['00a1', 'iexcl'], //
['00a2', 'cent'], //
['00a3', 'pound'], //
['00a4', 'curren'], //
['00a5', 'yen'], //
['00a6', 'brvbar'], //
['00a7', 'sect'], //
['00a8', 'uml'], //
['00a9', 'copy'], //
['00aa', 'ordf'], //
['00ab', 'laquo'], //
['00ac', 'not'], //
['00ae', 'reg'], //
['00af', 'macr'], //
['00b0', 'deg'], //
['00b1', 'plusmn'], //
['00b2', 'sup2'], //
['00b3', 'sup3'], //
['00b4', 'acute'], //
['00b5', 'micro'], //
['00b6', 'para'], //
['00b7', 'middot'], //
['00b8', 'cedil'], //
['00b9', 'sup1'], //
['00ba', 'ordm'], //
['00bb', 'raquo'], //
['00bc', 'frac14'], //
['00bd', 'frac12'], //
['00be', 'frac34'], //
['00bf', 'iquest'], //
['00c0', 'Agrave'], //
['00c1', 'Aacute'], //
['00c2', 'Acirc'], //
['00c3', 'Atilde'], //
['00c4', 'Auml'], //
['00c5', 'Aring'], //
['00c6', 'AElig'], //
['00c7', 'Ccedil'], //
['00c8', 'Egrave'], //
['00c9', 'Eacute'], //
['00ca', 'Ecirc'], //
['00cb', 'Euml'], //
['00cc', 'Igrave'], //
['00cd', 'Iacute'], //
['00ce', 'Icirc'], //
['00cf', 'Iuml'], //
['00d0', 'ETH'], //
['00d1', 'Ntilde'], //
['00d2', 'Ograve'], //
['00d3', 'Oacute'], //
['00d4', 'Ocirc'], //
['00d5', 'Otilde'], //
['00d6', 'Ouml'], //
['00d7', 'times'], //
['00d8', 'Oslash'], //
['00d9', 'Ugrave'], //
['00da', 'Uacute'], //
['00db', 'Ucirc'], //
['00dc', 'Uuml'], //
['00dd', 'Yacute'], //
['00de', 'THORN'], //
['00df', 'szlig'], //
['00e0', 'agrave'], //
['00e1', 'aacute'], //
['00e2', 'acirc'], //
['00e3', 'atilde'], //
['00e4', 'auml'], //
['00e5', 'aring'], //
['00e6', 'aelig'], //
['00e7', 'ccedil'], //
['00e8', 'egrave'], //
['00e9', 'eacute'], //
['00ea', 'ecirc'], //
['00eb', 'euml'], //
['00ec', 'igrave'], //
['00ed', 'iacute'], //
['00ee', 'icirc'], //
['00ef', 'iuml'], //
['00f0', 'eth'], //
['00f1', 'ntilde'], //
['00f2', 'ograve'], //
['00f3', 'oacute'], //
['00f4', 'ocirc'], //
['00f5', 'otilde'], //
['00f6', 'ouml'], //
['00f7', 'divide'], //
['00f8', 'oslash'], //
['00f9', 'ugrave'], //
['00fa', 'uacute'], //
['00fb', 'ucirc'], //
['00fc', 'uuml'], //
['00fd', 'yacute'], //
['00fe', 'thorn'], //
['00ff', 'yuml'], //
['0027', 'apos'], // '
['0022', 'quot'], // "
['0152', 'OElig'], //
['0153', 'oelig'], //
['0160', 'Scaron'], //
['0161', 'scaron'], //
['0178', 'Yuml'], //
['02c6', 'circ'], //
['02dc', 'tilde'], //
['2013', 'ndash'], //
['2014', 'mdash'], //
['2018', 'lsquo'], //
['2019', 'rsquo'], //
['201a', 'sbquo'], //
['201c', 'ldquo'], //
['201d', 'rdquo'], //
['201e', 'bdquo'], //
['2020', 'dagger'], //
['2021', 'Dagger'], //
['2030', 'permil'], //
['2039', 'lsaquo'], //
['203a', 'rsaquo'], //
['20ac', 'euro'], //
['0192', 'fnof'], //
['0391', 'Alpha'], //
['0392', 'Beta'], //
['0393', 'Gamma'], //
['0394', 'Delta'], //
['0395', 'Epsilon'],//
['0396', 'Zeta'], //
['0397', 'Eta'], //
['0398', 'Theta'], //
['0399', 'Iota'], //
['039a', 'Kappa'], //
['039b', 'Lambda'], //
['039c', 'Mu'], //
['039d', 'Nu'], //
['039e', 'Xi'], //
['039f', 'Omicron'],//
['03a0', 'Pi'], //
['03a1', 'Rho'], //
['03a3', 'Sigma'], //
['03a4', 'Tau'], //
['03a5', 'Upsilon'],//
['03a6', 'Phi'], //
['03a7', 'Chi'], //
['03a8', 'Psi'], //
['03a9', 'Omega'], //
['03b1', 'alpha'], //
['03b2', 'beta'], //
['03b3', 'gamma'], //
['03b4', 'delta'], //
['03b5', 'epsilon'],//
['03b6', 'zeta'], //
['03b7', 'eta'], //
['03b8', 'theta'], //
['03b9', 'iota'], //
['03ba', 'kappa'], //
['03bb', 'lambda'], //
['03bc', 'mu'], //
['03bd', 'nu'], //
['03be', 'xi'], //
['03bf', 'omicron'],//
['03c0', 'pi'], //
['03c1', 'rho'], //
['03c2', 'sigmaf'], //
['03c3', 'sigma'], //
['03c4', 'tau'], //
['03c5', 'upsilon'],//
['03c6', 'phi'], //
['03c7', 'chi'], //
['03c8', 'psi'], //
['03c9', 'omega'], //
['2022', 'bull'], //
['2026', 'hellip'], //
['2032', 'prime'], //
['2033', 'Prime'], //
['203e', 'oline'], //
['2044', 'frasl'], //
['2122', 'trade'], //
['2190', 'larr'], //
['2191', 'uarr'], //
['2192', 'rarr'], //
['2193', 'darr'], //
['2194', 'harr'], //
['21d2', 'rArr'], //
['21d4', 'hArr'], //
['2200', 'forall'], //
['2202', 'part'], //
['2203', 'exist'], //
['2207', 'nabla'], //
['2208', 'isin'], //
['220b', 'ni'], //
['220f', 'prod'], //
['2211', 'sum'], //
['2212', 'minus'], //
['221a', 'radic'], //
['221d', 'prop'], //
['221e', 'infin'], //
['2220', 'ang'], //
['2227', 'and'], //
['2228', 'or'], //
['2229', 'cap'], //
['222a', 'cup'], //
['222b', 'int'], //
['2234', 'there4'], //
['223c', 'sim'], //
['2248', 'asymp'], //
['2260', 'ne'], //
['2261', 'equiv'], //
['2264', 'le'], //
['2265', 'ge'], //
['2282', 'sub'], //
['2283', 'sup'], //
['2286', 'sube'], //
['2287', 'supe'], //
['2295', 'oplus'], //
['22a5', 'perp'], //
['25ca', 'loz'], //
['2660', 'spades'], //
['2663', 'clubs'], //
['2665', 'hearts'], //
['2666', 'diams'] //
];
Line 5,616 ⟶ 5,999:
//
var wikEdSpecialChars = [
['2002', 'ensp'], //
['00ad', 'shy'], //
['2003', 'emsp'], //
['2009', 'thinsp'], //
['200c', 'zwnj'], //
['200d', 'zwj'], //
['200e', 'lrm'], //
['200f', 'rlm'] //
];
// unsupported chars in IE6
var wikEdProblemChars = [
['03d1', 'thetasym'], //
['03d2', 'upsih'], //
['03d6', 'piv'], //
['2118', 'weierp'], //
['2111', 'image'], //
['211c', 'real'], //
['2135', 'alefsym'], //
['21b5', 'crarr'], //
['21d0', 'lArr'], //
['21d1', 'uArr'], //
['21d3', 'dArr'], //
['2205', 'empty'], //
['2209', 'notin'], //
['2217', 'lowast'], //
['2245', 'cong'], //
['2284', 'nsub'], //
['22a5', 'perp'], //
['2297', 'otimes'], //
['22c5', 'sdot'], //
['2308', 'lceil'], //
['2309', 'rceil'], //
['230a', 'lfloor'], //
['230b', 'rfloor'], //
['2329', 'lang'], //
['232a', 'rang'] //
];
|