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

Content deleted Content added
0.9.8
0.9.12rc
Line 1:
/* <pre><nowiki> */
 
/*
Name: wikEd (wikEd.js)
Version: wikEd 0.9 (beta) (NovemberDecember, 2006). The code is currently under active development and might change rapidly
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)
Bugs: surprisingly functional
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
What: Comfortable JavaScript editor for Wikipedia and other MediaWikis
Important: This file might have to be saved as UTF-16 in order to preserve certain Unicode characters
*/
 
// version information
var wikEdProgramVersion = '0.9.812 (beta)';
var wikEdProgramDate = 'NovemberDecember 182, 2006';
 
// set all user readable texts
var wikEdText = wikEdText || {};
WikEdText();
 
 
Line 30 ⟶ 25:
 
 
// user readable texts, preset as wikEdText[''] = '';
// CSS rules edit frame
// 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
wikEdFrameCSS['body'] = wikEdFrameCSS['body'] || 'background: #FFFFFF; margin: 0px; padding: 0.2em; overflow: -moz-scrollbars-vertical; overflow-x: auto; font-family: monospace;';
'body': 'background: #FFFFFF; margin: 0px; padding: 0.2em; overflow: -moz-scrollbars-vertical; overflow-x: auto; font-family: monospace;',
 
// syntax highlighting
wikEdFrameCSS[ '.wikEdBlock']: = wikEdFrameCSS['.wikEdBlock'] || 'background-color: #e8e8e8;';,
wikEdFrameCSS[ '.wikEdBlockTag']: = wikEdFrameCSS['.wikEdBlockTag'] || 'color: #0000e0;';,
wikEdFrameCSS[ '.wikEdInlineTag']: = wikEdFrameCSS['.wikEdInlineTag'] || 'color: #0000e0;';,
wikEdFrameCSS[ '.wikEdUnknown']: = wikEdFrameCSS['.wikEdUnknown'] || 'background-image: url({wikEdUnknown});';,
wikEdFrameCSS[ '.wikEdSubscript']: = wikEdFrameCSS['.wikEdSubscript'] || 'position: relative; top: 0.3em;';,
wikEdFrameCSS[ '.wikEdSuperscript'] = wikEdFrameCSS['.wikEdSuperscript'] ||: 'position: relative; top: -0.3em;';,
wikEdFrameCSS[ '.wikEdBold']: = wikEdFrameCSS['.wikEdBold'] || 'font-weight: bold;';,
wikEdFrameCSS[ '.wikEdComment']: = wikEdFrameCSS['.wikEdComment'] || 'background-color: #fff0d0;';,
wikEdFrameCSS[ '.wikEdDel']: = wikEdFrameCSS['.wikEdDel'] || 'text-decoration: line-through;';,
wikEdFrameCSS[ '.wikEdIns']: = wikEdFrameCSS['.wikEdIns'] || 'text-decoration: underline;';,
wikEdFrameCSS[ '.wikEdItalic']: = wikEdFrameCSS['.wikEdItalic'] || 'font-style: italic;';,
wikEdFrameCSS[ '.wikEdRGB']: = wikEdFrameCSS['.wikEdRGB'] || '';,
 
// horizontal rule
wikEdFrameCSS[ '.wikEdHR']: = wikEdFrameCSS['.wikEdHR'] || 'background-color: #d0d0d0;';,
wikEdFrameCSS[ '.wikEdHRInline']: = wikEdFrameCSS['.wikEdHRInline'] || 'background-color: #d0d0d0;';,
 
// wiki code
wikEdFrameCSS[ '.wikEdWiki']: = wikEdFrameCSS['.wikEdWiki'] || 'color: #0000e0;';,
wikEdFrameCSS[ '.wikEdWikiRedir']: = wikEdFrameCSS['.wikEdWikiRedir'] || 'color: #0000e0; background-color: #ffffff; font-weight: bold;';,
 
// headings
wikEdFrameCSS[ '.wikEdHeading']: = wikEdFrameCSS['.wikEdHeading'] || 'background-color: #e0e0e0; font-weight: bold;';,
wikEdFrameCSS[ '.wikEdHeadingWp']: = wikEdFrameCSS['.wikEdHeadingWp'] || 'background-color: #d8e0ff; font-weight: bold;';,
 
// tables
wikEdFrameCSS[ '.wikEdTableBlock']: = wikEdFrameCSS['.wikEdTableBlock'] || 'background-color: #e8e8e8;';,
wikEdFrameCSS[ '.wikEdTableLine']: = wikEdFrameCSS['.wikEdTableLine'] || 'background-color: #e8e8e8;';,
wikEdFrameCSS[ '.wikEdTableTag']: = wikEdFrameCSS['.wikEdTableTag'] || 'background-color: #e8e8e8; color: #0000e0;';,
 
// list
wikEdFrameCSS[ '.wikEdListBlock']: = wikEdFrameCSS['.wikEdListBlock'] || 'background-color: #e8e8e8;';,
wikEdFrameCSS[ '.wikEdListLine'] = wikEdFrameCSS['.wikEdListLine'] : || 'background-color: #f0f0f0';,
wikEdFrameCSS[ '.wikEdListTag']: = wikEdFrameCSS['.wikEdListTag'] || 'background-color: #e8e8e8; color: #0000e0; font-weight: bold;';,
 
// space-pre
wikEdFrameCSS[ '.wikEdSpaceBlock']: = wikEdFrameCSS['.wikEdSpaceBlock'] || 'background-color: #e8e8e8;';,
wikEdFrameCSS[ '.wikEdSpaceLine']: = wikEdFrameCSS['.wikEdSpaceLine'] || 'background-color: #e8e8e8;';,
wikEdFrameCSS[ '.wikEdSpaceTag']: = wikEdFrameCSS['.wikEdSpaceTag'] || 'color: #0000e0; font-weight: bold;';,
 
// wiki links, images, categories, templates
wikEdFrameCSS[ '.wikEdLinkTag']: = wikEdFrameCSS['.wikEdLinkTag'] || 'color: #0000e0;';,
wikEdFrameCSS[ '.wikEdLink']: = wikEdFrameCSS['.wikEdLink'] || '';,
wikEdFrameCSS[ '.wikEdImage']: = wikEdFrameCSS['.wikEdImage'] || 'background-color: #d5ffaa;';,
wikEdFrameCSS[ '.wikEdCat']: = wikEdFrameCSS['.wikEdCat'] || 'background-color: #d0d8ff;';,
wikEdFrameCSS[ '.wikEdTempl']: = wikEdFrameCSS['.wikEdTempl'] || 'background-color: #e0e8ff;';,
 
// interlanguage
wikEdFrameCSS[ '.wikEdInter']: = wikEdFrameCSS['.wikEdInter'] || '';,
wikEdFrameCSS[ '.wikEdLinkInter']: = wikEdFrameCSS['.wikEdLinkInter'] || 'background-color: #c8c8ff;';,
wikEdFrameCSS[ '.wikEdImageInter']: = wikEdFrameCSS['.wikEdImageInter'] || 'background-color: #c8c8ff;';,
wikEdFrameCSS[ '.wikEdCatInter']: = wikEdFrameCSS['.wikEdCatInter'] || 'background-color: #c8c8ff;';,
wikEdFrameCSS[ '.wikEdTemplInter']: = wikEdFrameCSS['.wikEdTemplInter'] || 'background-color: #c8c8ff;';,
 
// name
wikEdFrameCSS[ '.wikEdLinkName']: = wikEdFrameCSS['.wikEdLinkName'] || 'color: #f00000; font-weight: bold;';,
wikEdFrameCSS[ '.wikEdImageName']: = wikEdFrameCSS['.wikEdImageName'] || 'font-weight: bold;';,
wikEdFrameCSS[ '.wikEdCatName']: = wikEdFrameCSS['.wikEdCatName'] || 'color: #f00000; font-weight: bold;';,
wikEdFrameCSS[ '.wikEdTemplName']: = wikEdFrameCSS['.wikEdTemplName'] || 'color: #f00000; font-weight: bold;';,
wikEdFrameCSS[ '.wikEdURLLink']: = wikEdFrameCSS['.wikEdURLLink'] || 'color: #f00000; font-weight: bold;';,
 
// text and parameters
wikEdFrameCSS[ '.wikEdLinkText']: = wikEdFrameCSS['.wikEdLinkText'] || 'font-weight: bold;';,
wikEdFrameCSS[ '.wikEdImageText']: = wikEdFrameCSS['.wikEdImageText'] || '';,
wikEdFrameCSS[ '.wikEdCatText']: = wikEdFrameCSS['.wikEdCatText'] || '';,
wikEdFrameCSS[ '.wikEdTemplText']: = wikEdFrameCSS['.wikEdTemplText'] || '';,
wikEdFrameCSS[ '.wikEdURLText']: = wikEdFrameCSS['.wikEdURLText'] || 'font-weight: bold;';,
 
// insert wikicode here
wikEdFrameCSS[ '.wikEdInsertHere']: = wikEdFrameCSS['.wikEdInsertHere'] || 'background-color: orange; font-style: italic;';,
 
// invisibles, control chars, and strange spaces
wikEdFrameCSS[ '.wikEdTab']: = wikEdFrameCSS['.wikEdTab']white-space: pre; || 'background-image: url({wikEdTab}); background-position: right bottom; background-repeat: no-repeat; display: inline;';,
wikEdFrameCSS[ '.wikEdTabPlain']: = wikEdFrameCSS['.wikEdTabPlain'] || 'displaywhite-space: inlinepre;';,
wikEdFrameCSS[ '.wikEdCtrl']: = wikEdFrameCSS['.wikEdControl']white-space: pre; || 'background-image: url({wikEdCtrl}); background-position: left center; background-repeat: repeat-x; background-color: white; display: inline;';,
wikEdFrameCSS[ '.wikEdCtrl:before'] = wikEdFrameCSS['.wikEdCtrl:before'] || 'content: \'\u00a0\'';,
wikEdFrameCSS[ '.wikEdBlank']: = wikEdFrameCSS['.wikEdControl']white-space: -moz-pre-wrap; || 'background-image: url({wikEdBlank}); background-position: left center; background-repeat: repeat-x; background-color: white; display: inline;';
});
 
// main window css rules, preset as wikEdMainCSS[''] = '';
// CSS rules main window
var wikEdMainCSS = wikEdMainCSS || [];
WikEdInitObject(wikEdMainCSS, {
wikEdMainCSS['.wikEdCombo'] = wikEdMainCSS['.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;';
 
// 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
wikEdMainCSS[ '.wikEdButtonsFormat']: = wikEdMainCSS['.wikEdButtonsFormat'] || 'background: #d4d0cc; border: 1px black solid; padding: 0.1em; margin: 0.2em 0.6em 0 0 ; float: left;';,
wikEdMainCSS[ '.wikEdButtonsFind']: = wikEdMainCSS['.wikEdButtonsFind'] || 'background: #d4d0cc; border: 1px black solid; padding: 0.1em; margin: 0.2em 0.6em 0 0 ; float: left;';,
wikEdMainCSS[ '.wikEdButtonsFix']: = wikEdMainCSS['.wikEdButtonsFix'] || 'background: #d4d0cc; border: 1px black solid; padding: 0.1em; margin: 0.2em 0.6em 0 0 ; float: left';,
wikEdMainCSS[ '.wikEdButtonsControl']: = wikEdMainCSS['.wikEdButtonsControl'] || 'background: #d4d0cc; border: 1px black solid; padding: 0.1em; margin: 0.2em 0 0 0 ; float: right;';,
wikEdMainCSS[ '.wikEdButtonsPreview']: = wikEdMainCSS['.wikEdButtonsPreview'] || 'background: #d4d0cc; border: 1px black solid; padding: 0.1em; margin: -0.2em 0 0 0.6em; float: right;';,
wikEdMainCSS[ '.wikEdButtonsPreviewFull'] = wikEdMainCSS['.wikEdButtonsPreviewFull'] : || 'background: #d4d0cc; border: 1px black solid; padding: 0.1em; margin: -0.2em 0 0 0.6em; float: right;';,
'.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
wikEdMainCSS[ '.wikEdButton']: = wikEdMainCSS['.wikEdButton'] || 'vertical-align: text-top; font-size: small; text-decoration: underline; margin: 1px 2px; padding: 0; background: #d4d0cc; border: 1px #d4d0cc solid; cursor: pointer;';,
wikEdMainCSS[ '.wikEdButton:hover'] = wikEdMainCSS['.wikEdButton:hover'] || 'background: #e4e0dd; border: 1px outset; cursor: pointer;';,
wikEdMainCSS[ '.wikEdButton:active'] = wikEdMainCSS['.wikEdButton:active'] || 'background: #e4e0dc; border: 1px inset; cursor: pointer;';,
wikEdMainCSS[ '.wikEdButtonFloatwikEdButtonSolo']: = wikEdMainCSS['.wikEdButtonFloat']vertical-align: text-top; font-size: small; text-decoration: underline; margin: 1px 2px; padding: ||0; 'background: #d4d0cc; border: 1px outsetsolid; cursorborder-color: pointer;white display:black none; position:black absolutewhite; z-indexcursor: 5pointer;';,
wikEdMainCSS[ '.wikEdButtonCheckedwikEdButtonSolo:hover']: 'background: #e4e0dd; cursor: = wikEdMainCSS[pointer;',
'.wikEdButtonChecked'] : || 'vertical-align: text-top; font-size: small; text-decoration: none; margin: 1px 2px; padding: 0; background: #ccc8c3; border: 1px solid; border-color: black white white black; cursor: pointer;';,
wikEdMainCSS[ '.wikEdButtonUnchecked'] = wikEdMainCSS['.wikEdButtonUnchecked'] : || 'vertical-align: text-top; font-size: small; text-decoration: none; margin: 1px 2px; padding: 0; background: #ddd8d3; border: 1px solid; border-color: white black black white; cursor: pointer;';,
wikEdMainCSS[ '.wikEdButtonPressed'] = wikEdMainCSS['.wikEdButtonPressed'] : || 'vertical-align: text-top; font-size: small; text-decoration: none; margin: 1px 2px; padding: 0; background: #ccc8c3; border: 1px solid; border-color: black white white black; cursor: wait;';,
wikEdMainCSS[ '.wikEdButtonInactive'] = wikEdMainCSS['.wikEdButtonInactive'] : || 'vertical-align: text-top; font-size: small; text-decoration: underline; margin: 1px 2px; padding: 0; background: #c0c0c0; border: 1px #b0b0b0 solid; cursor: not-allowed';,
wikEdMainCSS[ '.wikEdLocalPreview']: = wikEdMainCSS['.wikEdLocalPreview'] || 'vertical-align: top; margin: 0 0.33em 0 0.15em; padding: 0;';,
wikEdMainCSS[ '.wikEdLocalDiff']: = wikEdMainCSS['.wikEdLocalDiff'] || 'vertical-align: top; margin: 0 0.33em 0 -0.18em; padding: 0;';,
wikEdMainCSS[ '.wikEdClearSummary']: = wikEdMainCSS['.wikEdClearSummary'] || 'vertical-align: middle; margin: 0 0.1em 0 0.5em; padding: 0 0 0.2em 0;';,
 
// preview box
wikEdMainCSS[ '.wikEdPreviewBoxOuter'] = wikEdMainCSS['.wikEdPreviewBoxOuter'] : || 'clear: both; margin-top: 0.5em; margin-bottom: 0; border-width: 1px; border-style: solid; border-color: #808080 #d0d0d0 #d0d0d0 #808080;';,
wikEdMainCSS[ '.wikEdPreviewBox']: = wikEdMainCSS['.wikEdPreviewBox'] || 'background-color: #f9f9f9; padding: 5px; border-width: 1px; border-style: solid; border-color: #404040 #ffffff #ffffff #404040;';,
 
// find field
wikEdMainCSS[ '.wikEdFindComboInput']: = wikEdMainCSS['.wikEdFindComboInput'] || 'position: relative; padding: 0; margin: 0 0.2em; font-style: normal;';,
wikEdMainCSS[ '#wikEdFindText']: = wikEdMainCSS['#wikEdFindText'] || 'height: 1.4em; font-family: monospace; padding: 0; margin: 0; position: absolute; left: 0; top: 0; z-index: 2;';,
wikEdMainCSS[ '#wikEdFindSelect']: = wikEdMainCSS['#wikEdFindSelect'] || 'height: 1.5em; font-family: monospace; border: none; padding: 0; margin: 0; position: relative; vertical-align: baseline; z-index: 1;';,
 
// replace field
wikEdMainCSS[ '.wikEdReplaceComboInput']: = wikEdMainCSS['.wikEdReplaceComboInput'] || 'position: relative; padding: 0; margin: 0 0.2em; font-style: normal;';,
wikEdMainCSS[ '#wikEdReplaceText']: = wikEdMainCSS['#wikEdReplaceText'] || 'height: 1.4em; font-family: monospace; padding: 0; margin: 0; position: absolute; left: 0; top: 0; z-index: 2;';,
wikEdMainCSS[ '#wikEdReplaceSelect']: = wikEdMainCSS['#wikEdReplaceSelect'] || 'height: 1.5em; font-family: monospace; border: none; padding: 0; margin: 0; position: relative; vertical-align: baseline; z-index: 1;';,
 
// summary field
wikEdMainCSS[ '.wikEdSummaryComboInput']: = wikEdMainCSS['.wikEdSummaryComboInput'] || 'position: relative;';,
wikEdMainCSS[ '.wikEdSummaryText']: = wikEdMainCSS['.wikEdSummaryText'] || 'padding: 0; margin: 0; position: absolute; left: 0; top: 0; z-index: 2; width: auto;';,
wikEdMainCSS[ '.wikEdSummarySelect']: = wikEdMainCSS['.wikEdSummarySelect'] || 'border: none; padding: 0; margin: 0; position: relative; vertical-align: middle; z-index: 1;';,
 
// space around submit buttons
wikEdMainCSS[ '.editButtons']: = wikEdMainCSS['.editButtons'] || 'margin-top: 0.5em; margin-bottom: 0.5em;';,
 
// frame
wikEdMainCSS[ '.wikEdFrameOuter']: = wikEdMainCSS['.wikEdFrameOuter'] || 'width: 100%; margin-top: 0.5em; margin-bottom: 0.1em; border-width: 1px; border-style: solid; border-color: #808080 #d0d0d0 #d0d0d0 #808080;';,
wikEdMainCSS[ '.wikEdFrameInner']: = wikEdMainCSS['.wikEdFrameInner'] || 'padding: 0; border-width: 1px; border-style: solid; border-color: #404040 #ffffff #ffffff #404040;';,
wikEdMainCSS[ '.wikEdFrame']: = wikEdMainCSS['.wikEdFrame'] || 'width: 100%; padding: 0; margin: 0; border: none;';,
 
// various
wikEdMainCSS['.wikEdHelpSpan'] = wikEdMainCSS['.wikEdHelpSpan'] || '';
 
// summary
wikEdMainCSS[ '.wikEdSummaryWrapper']: = wikEdMainCSS['.wikEdSummaryWrapper'] || 'margin: 0.25em 0 0.4em 0;';,
wikEdMainCSS[ '#wpSummaryLabel'] = wikEdMainCSS['#wpSummaryLabel'] : || 'margin-right: 0.2em';,
wikEdMainCSS[ '.editOptions']: = wikEdMainCSS['.editOptions'] || 'position: relative; top: 0.1em;';,
 
// input wrapper
wikEdMainCSS[ '.wikEdInputWrapper']: = wikEdMainCSS['.wikEdInputWrapper'] ||z-index: 100;'';,
wikEdMainCSS[ '.wikEdInputWrapperFull']: = wikEdMainCSS['.wikEdInputWrapperFull'] || 'position: fixed; top: 0; left: 0; right: 0; padding: 4px; background: white;' z-index: 100;',
 
// other wrappers
wikEdMainCSS[ '.wikEdToolbarWrapper']: = wikEdMainCSS['.wikEdToolbarWrapper'] || '';,
wikEdMainCSS[ '.wikEdTextareaWrapper']: = wikEdMainCSS['.wikEdTextareaWrapper'] || '';,
wikEdMainCSS[ '.wikEdFrameWrapper']: = wikEdMainCSS['.wikEdFrameWrapper'] || '';,
wikEdMainCSS[ '.wikEdConsoleWrapper']: = wikEdMainCSS['.wikEdConsoleWrapper'] || '';,
wikEdMainCSS[ '.wikEdButtonsWrapper']: = wikEdMainCSS['.wikEdButtonsWrapper'] || '';,
'.wikEdSummaryInputWrapper': 'display: inline;',
wikEdMainCSS['.wikEdSubmitWrapper'] = wikEdMainCSS['.wikEdSubmitWrapper'] || '';
'.wikEdSummaryOptions': 'display: inline;',
wikEdMainCSS['.wikEdSubmitButtonsWrapper'] = wikEdMainCSS['.wikEdSubmitButtonsWrapper'] || '';
'.wikEdSubmitWrapper': '',
wikEdMainCSS['.wikEdPreviewWrapper'] = wikEdMainCSS['.wikEdPreviewWrapper'] || '';
'.wikEdSubmitButtonsWrapper': '',
wikEdMainCSS['.wikEdInsertWrapper'] = wikEdMainCSS['.wikEdInsertWrapper'] || '';
'.wikEdLocalPrevWrapper': '',
'.wikEdInsertWrapper': '',
 
// various
'.wikEdHelpSpan': '',
'#editpage-specialchars': 'clear: both;'
});
 
// use local copies of images for testing (set to true in local copy of edit page)
// general settings
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'] = 1210;
 
// 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 || (36530 * 24 * 60 * 60);
 
// find ahead as you type checkbox preset
Line 216 ⟶ 529:
 
// enable wikEd preset
var useWikEdwikEdUseWikEd = useWikEdwikEdUseWikEd || true;
 
// 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 -frame is active
var wikEdShowToolbar = wikEdShowToolbar || true;
 
// show the text-to-source button for testing purposes
var wikEdShowSourceButton = wikEdShowSourceButton || truefalse;
 
// 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;
 
// use local copies of images for testing (set to true in local copy of edit page)
var wikEdUseLocalImages = wikEdUseLocalImages || false;
 
// path to local images used by wikEd for testing
var wikEdImagePathLocal = wikEdImagePathLocal || 'file:///D:/wikEd/images/';
 
// path to images used by wikEd
var wikEdImagePath = wikEdImagePath || 'http://upload.wikimedia.org/wikipedia/commons/';
 
// image filenames
var wikEdImage = wikEdImage || [];
wikEdImage['blank'] = wikEdImage['blank'] || wikEdImagePath + '5/51/WikEd_blank.png';
wikEdImage['bold'] = wikEdImage['bold'] || wikEdImagePath + '5/59/WikEd_bold.png';
wikEdImage['bulletList'] = wikEdImage['bulletList'] || wikEdImagePath + '6/62/WikEd_bullet_list.png';
wikEdImage['case'] = wikEdImage['case'] || wikEdImagePath + 'a/aa/WikEd_case.png';
wikEdImage['caseSensitive'] = wikEdImage['caseSensitive'] || wikEdImagePath + '0/0d/WikEd_case_sensitive.png';
wikEdImage['clearFind'] = wikEdImage['clearFind'] || wikEdImagePath + 'f/f0/WikEd_clear_find.png';
wikEdImage['clearHistory'] = wikEdImage['clearHistory'] || wikEdImagePath + 'c/c8/WikEd_clear_history.png';
wikEdImage['clearSummary'] = wikEdImage['clearSummary'] || wikEdImagePath + '2/2c/WikEd_clear_summary.png';
wikEdImage['close'] = wikEdImage['close'] || wikEdImagePath + '9/97/WikEd_close.png';
wikEdImage['ctrl'] = wikEdImage['ctrl'] || wikEdImagePath + '1/10/WikEd_ctrl.png';
wikEdImage['decreaseHeading'] = wikEdImage['decreaseHeading'] || wikEdImagePath + '7/72/WikEd_decrease_heading.png';
wikEdImage['definitionList'] = wikEdImage['definitionList'] || wikEdImagePath + 'f/f5/WikEd_definition_list.png';
wikEdImage['diff'] = wikEdImage['diff'] || wikEdImagePath + 'd/db/WikEd_diff.png';
wikEdImage['error'] = wikEdImage['error'] || wikEdImagePath + '3/3e/WikEd_error.png';
wikEdImage['findAhead'] = wikEdImage['findAhead'] || wikEdImagePath + '3/34/WikEd_find_ahead.png';
wikEdImage['findAll'] = wikEdImage['findAll'] || wikEdImagePath + '7/75/WikEd_find_all.png';
wikEdImage['findNext'] = wikEdImage['findNext'] || wikEdImagePath + 'a/ad/WikEd_find_next.png';
wikEdImage['findPrev'] = wikEdImage['findPrev'] || wikEdImagePath + 'f/f5/WikEd_find_prev.png';
wikEdImage['fixAll'] = wikEdImage['fixAll'] || wikEdImagePath + '8/86/WikEd_fix_all.png';
wikEdImage['fixBasic'] = wikEdImage['fixBasic'] || wikEdImagePath + '3/30/WikEd_fix_basic.png';
wikEdImage['fixCaps'] = wikEdImage['fixCaps'] || wikEdImagePath + '0/00/WikEd_fix_caps.png';
wikEdImage['fixUnicode'] = wikEdImage['fixUnicode'] || wikEdImagePath + 'd/d4/WikEd_fix_unicode.png';
wikEdImage['fixChem'] = wikEdImage['fixChem'] || wikEdImagePath + 'e/e7/WikEd_fix_chem.png';
wikEdImage['fixDash'] = wikEdImage['fixDash'] || wikEdImagePath + 'e/e5/WikEd_fix_dash.png';
wikEdImage['fixHtml'] = wikEdImage['fixHtml'] || wikEdImagePath + '0/05/WikEd_fix_html.png';
wikEdImage['fixMath'] = wikEdImage['fixMath'] || wikEdImagePath + '3/3f/WikEd_fix_math.png';
wikEdImage['fixPunct'] = wikEdImage['fixPunct'] || wikEdImagePath + 'd/db/WikEd_fix_punct.png';
wikEdImage['fixRegExTypo'] = wikEdImage['fixRegExTypo'] || wikEdImagePath + '9/94/WikEd_fix_reg-ex-typo.png';
wikEdImage['fixUnits'] = wikEdImage['fixUnits'] || wikEdImagePath + '6/69/WikEd_fix_units.png';
wikEdImage['textZoom'] = wikEdImage['textZoom'] || wikEdImagePath + '7/71/WikEd_font_size.png';
wikEdImage['fullScreen'] = wikEdImage['fullScreen'] || wikEdImagePath + 'd/d3/WikEd_fullscreen.png';
wikEdImage['getFind'] = wikEdImage['getFind'] || wikEdImagePath + '9/96/WikEd_get_selection.png';
wikEdImage['highlightSyntax'] = wikEdImage['highlightSyntax'] || wikEdImagePath + '6/67/WikEd_syntax.png';
wikEdImage['image'] = wikEdImage['image'] || wikEdImagePath + '3/37/WikEd_image.png';
wikEdImage['increaseHeading'] = wikEdImage['increaseHeading'] || wikEdImagePath + '5/50/WikEd_increase_heading.png';
wikEdImage['indentList'] = wikEdImage['indentList'] || wikEdImagePath + '7/7a/WikEd_indent_list.png';
wikEdImage['italic'] = wikEdImage['italic'] || wikEdImagePath + 'd/d4/WikEd_italic.png';
wikEdImage['jumpTopBottom'] = wikEdImage['jumpTopBottom'] || wikEdImagePath + '5/5d/WikEd_jump_top_bottom.png';
wikEdImage['lastPos'] = wikEdImage['lastPos'] || wikEdImagePath + '5/54/WikEd_jump_next.png';
wikEdImage['logo'] = wikEdImage['logo'] || wikEdImagePath + '6/67/WikEd_logo.png';
wikEdImage['nowiki'] = wikEdImage['nowiki'] || wikEdImagePath + '5/5a/WikEd_nowiki.png';
wikEdImage['numberList'] = wikEdImage['numberList'] || wikEdImagePath + '3/3b/WikEd_number_list.png';
wikEdImage['prevPos'] = wikEdImage['prevPos'] || wikEdImagePath + 'c/c7/WikEd_jump_prev.png';
wikEdImage['preview'] = wikEdImage['preview'] || wikEdImagePath + '3/31/WikEd_preview.png';
wikEdImage['redirect'] = wikEdImage['redirect'] || wikEdImagePath + 'f/fa/WikEd_redirect.png';
wikEdImage['redo'] = wikEdImage['redo'] || wikEdImagePath + 'd/d7/WikEd_redo.png';
wikEdImage['redoAll'] = wikEdImage['redoAll'] || wikEdImagePath + '2/2d/WikEd_redo_all.png';
wikEdImage['regExp'] = wikEdImage['regExp'] || wikEdImagePath + '6/6a/WikEd_regexp.png';
wikEdImage['replaceAll'] = wikEdImage['replaceAll'] || wikEdImagePath + '2/2a/WikEd_replace_all.png';
wikEdImage['replaceNext'] = wikEdImage['replaceNext'] || wikEdImagePath + 'b/b0/WikEd_replace_next.png';
wikEdImage['replacePrev'] = wikEdImage['replacePrev'] || wikEdImagePath + 'a/a1/WikEd_replace_prev.png';
wikEdImage['scrollToButtons'] = wikEdImage['scrollToButtons'] || wikEdImagePath + '0/01/WikEd_align_buttons.png';
wikEdImage['scrollToText'] = wikEdImage['scrollToText'] || wikEdImagePath + '1/13/WikEd_align_top.png';
wikEdImage['source'] = wikEdImage['source'] || wikEdImagePath + '0/02/WikEd_source.png';
wikEdImage['strikethrough'] = wikEdImage['strikethrough'] || wikEdImagePath + '0/06/WikEd_strikethrough.png';
wikEdImage['subscript'] = wikEdImage['subscript'] || wikEdImagePath + '9/9e/WikEd_subscript.png';
wikEdImage['superscript'] = wikEdImage['superscript'] || wikEdImagePath + 'b/bf/WikEd_superscript.png';
wikEdImage['tab'] = wikEdImage['tab'] || wikEdImagePath + 'e/e7/WikEd_tab.png';
wikEdImage['table'] = wikEdImage['table'] || wikEdImagePath + 'b/bd/WikEd_table.png';
wikEdImage['textify'] = wikEdImage['textify'] || wikEdImagePath + 'c/cd/WikEd_textify.png';
wikEdImage['underline'] = wikEdImage['underline'] || wikEdImagePath + '2/21/WikEd_underline.png';
wikEdImage['undo'] = wikEdImage['undo'] || wikEdImagePath + 'e/e6/WikEd_undo.png';
wikEdImage['undoAll'] = wikEdImage['undoAll'] || wikEdImagePath + '0/08/WikEd_undo_all.png';
wikEdImage['unknown'] = wikEdImage['unknown'] || wikEdImagePath + '8/8a/WikEd_unknown.png';
wikEdImage['updateSyntax'] = wikEdImage['updateSyntax'] || wikEdImagePath + '6/67/WikEd_syntax.png';
wikEdImage['useWikEd'] = wikEdImage['useWikEd'] || wikEdImagePath + '6/67/WikEd_logo.png';
wikEdImage['webLink'] = wikEdImage['webLink'] || wikEdImagePath + '1/16/WikEd_weblink.png';
wikEdImage['wikify'] = wikEdImage['wikify'] || wikEdImagePath + '9/9f/WikEd_wikify.png';
wikEdImage['wikiLink'] = wikEdImage['wikiLink'] || wikEdImagePath + '2/21/WikEd_wikilink.png';
 
 
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 wikEdPreviewWrapperwikEdLocalPrevWrapper = {};
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
// WikEdText: set all user readable texts
//
// changes should be copied to http://en.wikipedia.org/wiki/User:Cacycle/wikEd_international_en.js
 
function WikEdTextWikEdInitObject(array, preset) {
 
for (var wikEdTextEnkey in =preset) {
if (array[key] == null) {
 
array[key] = preset[key];
// logo
'wikEdLogoLnk alt': 'WikEd',
'wikEdLogoImg alt': 'WikEd',
'wikEdLogoLnk title': 'WikEd {wikEdProgramVersion} ({wikEdProgramDate})',
'wikEdLogoImg error alt': 'WikEd error',
'wikEdLogoLnk error title': 'WikEd {wikEdProgramVersion} ({wikEdProgramDate}): Loading error',
'wikEdLogoLnk href': 'http://en.wikipedia.org/wiki/User:Cacycle/wikEd',
 
// 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 up',
'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',
'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 mplemented. 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 (only for non-regexp searches)',
 
// 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 title',
'wikEdScrollToButtons2 title': 'Scroll to edit buttons',
'wikEdScrollToInput2 alt': 'Scroll up title',
'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 title',
'wikEdScrollToButtons3 title': 'Scroll to edit buttons',
'wikEdScrollToInput3 alt': 'Scroll up title',
'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'
}
 
// use the english text if no translation exists
for (var textEn in wikEdTextEn) {
if (wikEdText[textEn] == null) {
wikEdText[textEn] = wikEdTextEn[textEn];
}
}
return;
}
 
 
//
// insertTags: override the insertTags function in wikibits.js, used for the standard button toolbar
//
 
function insertTags(tagOpen, tagClose, sampleText) {
 
if (useWikEdwikEdUseWikEd == true) {
WikEdEditButton('wikEdInsertTags', [tagOpen, tagClose, sampleText]);
}
Line 697 ⟶ 731:
//
 
function WikEdSetup(scrollToText) {
 
var html = '';
 
// add image path to image filename
// check if setup was already run
if (documentwikEdLogo.getElementById('wikEdLogoList')id !== null) {
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
// insert logo into personal toolbar
if (wikEdLoaded == true) {
var logo = {};
return;
logo.img = document.createElement('img');
}
logo.img.id = 'wikEdLogoImg';
wikEdLoaded = true;
logo.lnk = document.createElement('a');
logo.lnk.id = 'wikEdLogoLnk';
logo.lnk.href = wikEdText['wikEdLogoLnk href'];
logo.lnk.alt = wikEdText['wikEdLogoLnk alt'];
logo.lnk.appendChild(logo.img);
var listObj = document.createElement('li');
listObj.id = 'wikEdLogoList';
listObj.appendChild(logo.lnk);
var personalTools = document.getElementById('p-personal').getElementsByTagName('ul')[0];
personalTools.appendChild(listObj);
 
// set error logo
WikEdSetLogo(logo, false'error');
 
// at the moment this works only for mozilla browsers (Mozilla, Mozilla Firefox, Mozilla SeaMonkey)
Line 746 ⟶ 804:
 
// reset error indicator
WikEdSetLogo(logo);
return;
}
Line 767 ⟶ 825:
}
 
// button cookie settings
// rewrite image paths to local copies for testing
var cookie = WikEdGetCookie('wikEdSummaryUsing');
if (wikEdUseLocalImages == true) {
if (cookie != '') {
wikEdUsing = true;
}
else {
wikEdUsing = false;
}
 
cookie = WikEdGetCookie('wikEdUseClassic');
// remove MediaWiki upload paths
if (cookie != '') {
var regExpStr = '/[0-9a-f]+/[0-9a-f]+(/[\\w\\.\\-]+)$';
wikEdUseWikEd = false;
var regExp = new RegExp(regExpStr, 'g');
}
for (i in wikEdImage) {
 
wikEdImage[i] = wikEdImage[i].replace(regExp, '$1');
cookie = WikEdGetCookie('wikEdSyntaxOff');
wikEdImage[i] = wikEdImage[i].replace(wikEdImagePath, wikEdImagePathLocal);
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
wikEdPreviewWrapperwikEdLocalPrevWrapper = document.createElement('div');
wikEdLocalPrevWrapper.id = 'wikEdLocalPrevWrapper';
wikEdPreviewWrapper.id = 'wikEdPreviewWrapper';
wikEdPreviewWrapperwikEdLocalPrevWrapper.className = 'wikEdPreviewWrapperwikEdLocalPrevWrapper';
wikEdPreviewWrapperwikEdLocalPrevWrapper.style.display = 'none';
wikEdInputWrapper.appendChild(wikEdPreviewWrapperwikEdLocalPrevWrapper);
 
// 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 (useWikEdwikEdUseWikEd == true) {
if (wpToolbar != null) {
if (wpToolbar.getElementsByTagName('IMG').length == 0) {
Line 872 ⟶ 949:
}
 
// add summary elements to summary input wrapper
var summaryLabel = document.getElementById('wpSummaryLabel');
wikEdSummaryWrapperwikEdSummaryInputWrapper.appendChild(summaryLabel);
 
wikEdSummaryText = document.getElementById('wpSummary');
wikEdSummaryWrapperwikEdSummaryInputWrapper.appendChild(wikEdSummaryText);
 
// 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;
wikEdSummaryWrapperwikEdSummaryOptions.appendChild(editOptions);
 
 
Line 894 ⟶ 972:
wikEdTextareaWrapper.appendChild(wikEdTextarea);
 
// add edit -frame to frame wrapper
// 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'] + + '" title="' + wikEdText['wikEdUndo title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdUndo\');">';
html += '<img class="wikEdButtonInactive" src="' + wikEdImage['redo'] + '" width="16" height="16" id="wikEdRedo" alt="' + wikEdText['wikEdRedo alt'] + + '" title="' + wikEdText['wikEdRedo title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdRedo\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['bold'] + '" width="16" height="16" id="wikEdBold" alt="' + wikEdText['wikEdBold alt'] + + '" title="' + wikEdText['wikEdBold title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdBold\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['italic'] + '" width="16" height="16" id="wikEdItalic" alt="' + wikEdText['wikEdItalic alt'] + + '" title="' + wikEdText['wikEdItalic title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdItalic\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['underline'] + '" width="16" height="16" id="wikEdUnderline" alt="' + wikEdText['wikEdUnderline alt'] + + '" title="' + wikEdText['wikEdUnderline title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdUnderline\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['strikethrough'] + '" width="16" height="16" id="wikEdStrikethrough" alt="' + wikEdText['wikEdStrikethrough alt'] + + '" title="' + wikEdText['wikEdStrikethrough title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdStrikethrough\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['nowiki'] + '" width="16" height="16" id="wikEdNowiki" alt="' + wikEdText['wikEdNowiki alt'] + + '" title="' + wikEdText['wikEdNowiki title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdNowiki\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['superscript'] + '" width="16" height="16" id="wikEdSuperscript" alt="' + wikEdText['wikEdSuperscript alt'] + + '" title="' + wikEdText['wikEdSuperscript title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdSuperscript\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['subscript'] + '" width="16" height="16" id="wikEdSubscript" alt="' + wikEdText['wikEdSubscript alt'] + + '" title="' + wikEdText['wikEdSubscript title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdSubscript\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['case'] + '" width="16" height="16" id="wikEdCase" alt="' + wikEdText['wikEdCase alt'] + + '" title="' + wikEdText['wikEdCase title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdCase\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['undoAll'] + '" width="16" height="16" id="wikEdUndoAll" alt="' + wikEdText['wikEdUndoAll alt'] + + '" title="' + wikEdText['wikEdUndoAll title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdUndoAll\');">';
html += '<img class="wikEdButtonInactive" src="' + wikEdImage['redoAll'] + '" width="16" height="16" id="wikEdRedoAll" alt="' + wikEdText['wikEdRedoAll alt'] + + '" title="' + wikEdText['wikEdRedoAll title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdRedoAll\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['updateSyntax'] + '" width="16" height="16" id="wikEdUpdateSyntax" alt="' + wikEdText['wikEdUpdateSyntax alt'] + + '" title="' + wikEdText['wikEdUpdateSyntax title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdUpdateSyntax\');">';
html += '<br />';
 
html += '<img class="wikEdButton" src="' + wikEdImage['wikiLink'] + '" width="16" height="16" id="wikEdWikiLink" alt="' + wikEdText['wikEdWikiLink alt'] + + '" title="' + wikEdText['wikEdWikiLink title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdWikiLink\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['webLink'] + '" width="16" height="16" id="wikEdWebLink" alt="' + wikEdText['wikEdWebLink alt'] + + '" title="' + wikEdText['wikEdWebLink title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdWebLink\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['decreaseHeading'] + '" width="16" height="16" id="wikEdDecreaseHeading" alt="' + wikEdText['wikEdDecreaseHeading alt'] + + '" title="' + wikEdText['wikEdDecreaseHeading title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdDecreaseHeading\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['increaseHeading'] + '" width="16" height="16" id="wikEdIncreaseHeading" alt="' + wikEdText['wikEdIncreaseHeading alt'] + + '" title="' + wikEdText['wikEdIncreaseHeading title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdIncreaseHeading\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['bulletList'] + '" width="16" height="16" id="wikEdBulletList" alt="' + wikEdText['wikEdBulletList alt'] + + '" title="' + wikEdText['wikEdBulletList title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdBulletList\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['numberList'] + '" width="16" height="16" id="wikEdNumberList" alt="' + wikEdText['wikEdNumberList alt'] + + '" title="' + wikEdText['wikEdNumberList title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdNumberList\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['indentList'] + '" width="16" height="16" id="wikEdIndentList" alt="' + wikEdText['wikEdIndentList alt'] + + '" title="' + wikEdText['wikEdIndentList title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdIndentList\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['definitionList'] + '" width="16" height="16" id="wikEdDefinitionList" alt="' + wikEdText['wikEdDefinitionList alt'] + + '" title="' + wikEdText['wikEdDefinitionList title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdDefinitionList\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['image'] + '" width="16" height="16" id="wikEdImage" alt="' + wikEdText['wikEdImage alt'] + + '" title="' + wikEdText['wikEdImage title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdImage\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['table'] + '" width="16" height="16" id="wikEdTable" alt="' + wikEdText['wikEdTable alt'] + + '" title="' + wikEdText['wikEdTable title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdTable\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['redirect'] + '" width="16" height="16" id="wikEdRedirect" alt="' + wikEdText['wikEdRedirect alt'] + + '" title="' + wikEdText['wikEdRedirect title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdRedirect\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['wikify'] + '" width="16" height="16" id="wikEdWikify" alt="' + wikEdText['wikEdWikify alt'] + + '" title="' + wikEdText['wikEdWikify title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdWikify\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['textify'] + '" width="16" height="16" id="wikEdTextify" alt="' + wikEdText['wikEdTextify alt'] + + '" title="' + wikEdText['wikEdTextify title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdTextify\');">';
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'] + + '" title="' + wikEdText['wikEdTextZoom title'] + + '" onClick="javascript:WikEdButton(\'wikEdTextZoom\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['clearHistory'] + '" width="16" height="16" id="wikEdClearHistory" alt="' + wikEdText['wikEdClearHistory alt'] + + '" title="' + wikEdText['wikEdClearHistory title'] + + '" onClick="javascript:WikEdButton(\'wikEdClearHistory\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['scrollToButtons'] + '" width="16" height="16" id="wikEdScrollToButtons" alt="' + wikEdText['wikEdScrollToButtons alt'] + + '" title="' + wikEdText['wikEdScrollToButtons title'] + + '" onClick="javascript:WikEdButton(\'wikEdScrollToButtons\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['scrollToText'] + '" width="16" height="16" id="wikEdScrollToInput" alt="' + wikEdText['wikEdScrollToInput alt'] + + '" title="' + wikEdText['wikEdScrollToInput title'] + + '" onClick="javascript:WikEdButton(\'wikEdScrollToInput\');">';
html += '<br />';
 
html += '<img class="wikEdButtonChecked" src="' + wikEdImage['useWikEd'] + '" width="16" height="16" id="wikEdUseWikEd" alt="' + wikEdText['wikEdUseWikEd alt'] + + '" title="' + wikEdText['wikEdUseWikEd title'] + + '" onClick="javascript:WikEdButton(\'wikEdUseWikEd\', true);">';
html += '<img class="wikEdButtonUnchecked" src="' + wikEdImage['highlightSyntax'] + '" width="16" height="16" id="wikEdHighlightSyntax" alt="' + wikEdText['wikEdHighlightSyntax alt'] + + '" title="' + wikEdText['wikEdHighlightSyntax title'] + + '" onClick="javascript:WikEdButton(\'wikEdHighlightSyntax\', true);">';
if (wikEdShowSourceButton == true) {
html += '<img class="wikEdButton" src="' + wikEdImage['source'] + '" width="16" height="16" id="wikEdSource" alt="' + wikEdText['wikEdSource alt'] + + '" title="' + wikEdText['wikEdSource title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdSource\');">';
}
html += '<img class="wikEdButtonwikEdButtonUnchecked" src="' + wikEdImage['fullScreenusing'] + '" width="16" height="16" id="wikEdFullScreenwikEdUsing" alt="' + wikEdText['wikEdFullScreenwikEdUsing alt'] + + '" title="' + wikEdText['wikEdFullScreenwikEdUsing title'] + + '" onClick="javascript:WikEdButton(\'wikEdFullScreenwikEdUsing\', true);">';
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'] + + '" title="' + wikEdText['wikEdGetFind title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdGetFind\');" ondblclick="javascript:WikEdEditButton(\'wikEdGetFindReplace\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['findAll'] + '" width="16" height="16" id="wikEdFindAll" alt="' + wikEdText['wikEdFindAll alt'] + + '" title="' + wikEdText['wikEdFindAll title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdFindAll\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['findPrev'] + '" width="16" height="16" id="wikEdFindPrev" alt="' + wikEdText['wikEdFindPrev alt'] + + '" title="' + wikEdText['wikEdFindPrev title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdFindPrev\');">';
 
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'] + + '" title="' + wikEdText['wikEdFindNext title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdFindNext\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['jumpTopBottom'] + '" width="16" height="16" id="wikEdUpdown" alt="' + wikEdText['wikEdUpdown alt'] + + '" title="' + wikEdText['wikEdUpdown title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdUpdown\');">';
html += '<img class="wikEdButtonInactive" src="' + wikEdImage['prevPos'] + '" width="16" height="16" id="wikEdPrevPos" alt="' + wikEdText['wikEdPrevPos alt'] + + '" title="' + wikEdText['wikEdPrevPos title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdPrevPos\');">';
html += '<img class="wikEdButtonInactive" src="' + wikEdImage['lastPos'] + '" width="16" height="16" id="wikEdLastPos" alt="' + wikEdText['wikEdLastPos alt'] + + '" title="' + wikEdText['wikEdLastPos title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdLastPos\');">';
html += '<br />';
 
html += '<img class="wikEdButton" src="' + wikEdImage['clearFind'] + '" width="16" height="16" id="wikEdClearFind" alt="' + wikEdText['wikEdClearFind alt'] + + '" title="' + wikEdText['wikEdClearFind title'] + + '" onClick="javascript:WikEdButton(\'wikEdClearFind\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['replaceAll'] + '" width="16" height="16" id="wikEdReplaceAll" alt="' + wikEdText['wikEdReplaceAll alt'] + + '" title="' + wikEdText['wikEdReplaceAll title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdReplaceAll\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['replacePrev'] + '" width="16" height="16" id="wikEdReplacePrev" alt="' + wikEdText['wikEdReplacePrev alt'] + + '" title="' + wikEdText['wikEdReplacePrev title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdReplacePrev\');">';
 
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'] + + '" title="' + wikEdText['wikEdReplaceNext title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdReplaceNext\');">';
html += '<img class="wikEdButtonUnchecked" src="' + wikEdImage['caseSensitive'] + '" width="16" height="16" id="wikEdCaseSensitive" alt="' + wikEdText['wikEdCaseSensitive alt'] + + '" title="' + wikEdText['wikEdCaseSensitive title'] + + '" onClick="javascript:WikEdButton(\'wikEdCaseSensitive\', true);">';
html += '<img class="wikEdButtonUnchecked" src="' + wikEdImage['regExp'] + '" width="16" height="16" id="wikEdRegExp" alt="' + wikEdText['wikEdRegExp alt'] + + '" title="' + wikEdText['wikEdRegExp title'] + + '" onClick="javascript:WikEdButton(\'wikEdRegExp\', true);">';
html += '<img class="wikEdButtonUnchecked" src="' + wikEdImage['findAhead'] + '" width="16" height="16" id="wikEdFindAhead" alt="' + wikEdText['wikEdFindAhead alt'] + + '" title="' + wikEdText['wikEdFindAhead title'] + + '" onClick="javascript:WikEdButton(\'wikEdFindAhead\', true);">';
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'] + + '" title="' + wikEdText['wikEdFixBasic title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdFixBasic\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['fixHtml'] + '" width="16" height="16" id="wikEdFixHtml" alt="' + wikEdText['wikEdFixHtml alt'] + + '" title="' + wikEdText['wikEdFixHtml title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdFixHtml\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['fixCaps'] + '" width="16" height="16" id="wikEdFixCaps" alt="' + wikEdText['wikEdFixCaps alt'] + + '" title="' + wikEdText['wikEdFixCaps title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdFixCaps\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['fixUnicode'] + '" width="16" height="16" id="wikEdfixUnicode" alt="' + wikEdText['wikEdfixUnicode alt'] + + '" title="' + wikEdText['wikEdfixUnicode title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdfixUnicode\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['fixAll'] + '" width="16" height="16" id="wikEdFixAll" alt="' + wikEdText['wikEdFixAll alt'] + + '" title="' + wikEdText['wikEdFixAll title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdFixAll\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['fixRegExTypo'] + '" width="16" height="16" id="wikEdFixRegExTypo" alt="' + wikEdText['wikEdFixRegExTypo alt'] + + '" title="' + wikEdText['wikEdFixRegExTypo title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdFixRegExTypo\');">';
html += '<br />';
 
html += '<img class="wikEdButton" src="' + wikEdImage['fixDash'] + '" width="16" height="16" id="wikEdFixDashes" alt="' + wikEdText['wikEdFixDashes alt'] + + '" title="' + wikEdText['wikEdFixDashes title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdFixDashes\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['fixPunct'] + '" width="16" height="16" id="wikEdFixPunct" alt="' + wikEdText['wikEdFixPunct alt'] + + '" title="' + wikEdText['wikEdFixPunct title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdFixPunct\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['fixMath'] + '" width="16" height="16" id="wikEdFixMath" alt="' + wikEdText['wikEdFixMath alt'] + + '" title="' + wikEdText['wikEdFixMath title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdFixMath\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['fixChem'] + '" width="16" height="16" id="wikEdFixChem" alt="' + wikEdText['wikEdFixChem alt'] + + '" title="' + wikEdText['wikEdFixChem title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdFixChem\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['fixUnits'] + '" width="16" height="16" id="wikEdFixUnits" alt="' + wikEdText['wikEdFixUnits alt'] + + '" title="' + wikEdText['wikEdFixUnits title'] + + '" onClick="javascript:WikEdEditButton(\'wikEdFixUnits\');">';
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'] + + '" title="' + wikEdText['wikEdPreview title'] + + '" onClick="javascript:WikEdButton(\'wikEdPreview\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['diff'] + '" width="16" height="16" id="wikEdDiff" alt="' + wikEdText['wikEdDiff alt'] + + '" title="' + wikEdText['wikEdDiff title'] + + '" onClick="javascript:WikEdButton(\'wikEdDiff\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['close'] + '" width="16" height="16" id="wikEdClose" alt="' + wikEdText['wikEdClose alt'] + + '" title="' + wikEdText['wikEdClose title'] + + '" onClick="javascript:WikEdButton(\'wikEdClose\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['scrollToButtons'] + '" width="16" height="16" id="wikEdScrollToButtons2" alt="' + wikEdText['wikEdScrollToButtons2 alt'] + + '" title="' + wikEdText['wikEdScrollToButtons2 title'] + + '" onClick="javascript:WikEdButton(\'wikEdScrollToButtons2\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['scrollToText'] + '" width="16" height="16" id="wikEdScrollToInput2" alt="' + wikEdText['wikEdScrollToInput2 alt'] + + '" title="' + wikEdText['wikEdScrollToInput2 title'] + + '" onClick="javascript:WikEdButton(\'wikEdScrollToInput2\');">';
 
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'] + + '" title="' + wikEdText['wikEdPreview2 title'] + + '" onClick="javascript:WikEdButton(\'wikEdPreview2\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['diff'] + '" width="16" height="16" id="wikEdDiff2" alt="' + wikEdText['wikEdDiff2 alt'] + + '" title="' + wikEdText['wikEdDiff2 title'] + + '" onClick="javascript:WikEdButton(\'wikEdDiff2\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['close'] + '" width="16" height="16" id="wikEdClose2" alt="' + wikEdText['wikEdClose2 alt'] + + '" title="' + wikEdText['wikEdClose2 title'] + + '" onClick="javascript:WikEdButton(\'wikEdClose2\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['scrollToButtons'] + '" width="16" height="16" id="wikEdScrollToButtons3" alt="' + wikEdText['wikEdScrollToButtons3 alt'] + + '" title="' + wikEdText['wikEdScrollToButtons3 title'] + + '" onClick="javascript:WikEdButton(\'wikEdScrollToButtons3\');">';
html += '<img class="wikEdButton" src="' + wikEdImage['scrollToText'] + '" width="16" height="16" id="wikEdScrollToInput3" alt="' + wikEdText['wikEdScrollToInput3 alt'] + + '" title="' + wikEdText['wikEdScrollToInput3 title'] + + '" onClick="javascript:WikEdButton(\'wikEdScrollToInput3\');">';
html += '</div>';
 
wikEdPreviewWrapperwikEdLocalPrevWrapper.innerHTML = html;
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 (useWikEdwikEdUseWikEd == true) {
WikEdSetEditArea(true);
}
Line 1,127 ⟶ 1,227:
 
// initialize image buttons
WikEdButton('wikEdSource', null, false);
WikEdButton('wikEdHighlightSyntax', null, wikEdHighlightSyntax);
WikEdButton('wikEdUseWikEd', null, useWikEdwikEdUseWikEd);
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 and add onclick handler
document.getElementById('wpPreview').value = wikEdText['PreviewshortenedPreview'];
document.getElementById('wpDiff').value = wikEdText['ChangesshortenedChanges'];
 
// set up combo input boxes with history
wikEdFieldHist ['find'] = [];
wikEdCookieName['find'] = 'findHistorywikEdFindHistory';
wikEdInputElement['find'] = new Object(wikEdFindText);
wikEdSelectElement['find'] = new Object(document.getElementById('wikEdFindSelect'));
Line 1,224 ⟶ 1,324:
 
wikEdFieldHist ['replace'] = [];
wikEdCookieName['replace'] = 'replaceHistorywikEdReplaceHistory';
wikEdInputElement['replace'] = new Object(wikEdReplaceText);
wikEdSelectElement['replace'] = new Object(document.getElementById('wikEdReplaceSelect'));
Line 1,230 ⟶ 1,330:
 
wikEdFieldHist ['summary'] = [];
wikEdCookieName['summary'] = 'summaryHistorywikEdSummaryHistory';
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 (useWikEdwikEdUseWikEd == true) {
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 (useWikEdwikEdUseWikEd == true) {
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 (useWikEdwikEdUseWikEd == true) {
WikEdUpdateTextarea();
}
Line 1,320 ⟶ 1,432:
WikEdFullScreen(false);
}
if (useWikEdwikEdUseWikEd == true) {
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
if (useWikEdwikEdUseWikEd == true) {
wikEdFrameWindow.focus();
}
else {
wikEdTextarea.setSelectionRange(0, 0);
wikEdTextarea.focus();
}
}
 
// reset error indicator
WikEdSetLogo(logo);
 
return;
Line 1,368 ⟶ 1,482:
//
 
function WikEdSetLogo(logo, errorstate) {
 
if (errorstate == false'error') {
logo.imgwikEdLogo.src = wikEdImage['error'];
logo.imgwikEdLogo.alt = wikEdText['wikEdLogoImgwikEdLogo error alt'];
logo.lnkwikEdLogo.title = wikEdText['wikEdLogoLnkwikEdLogo error title'];
}
else {
if (wikEdDisabled == true) {
logo.img.src = wikEdImage['logo'];
wikEdLogo.src = wikEdImage['disabled'];
logo.img.alt = wikEdText['wikEdLogoImg error alt'];
logo wikEdLogo.lnk.titlealt = wikEdText['wikEdLogoLnkwikEdLogo disabled titlealt'];
wikEdLogo.title = wikEdText['wikEdLogo disabled title'];
}
else {
wikEdLogo.src = wikEdImage['logo'];
wikEdLogo.alt = wikEdText['wikEdLogo alt'];
wikEdLogo.title = wikEdText['wikEdLogo title'];
}
}
 
logo.lnkwikEdLogo.title = logo.lnkwikEdLogo.title.replace(/\{wikEdProgramVersion\}/g, wikEdProgramVersion);
logo.lnkwikEdLogo.title = logo.lnkwikEdLogo.title.replace(/\{wikEdProgramDate\}/g, wikEdProgramDate);
 
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, '<' + 'prespan class="wikEdTabPlain">$1<' + '/prespan><!--wikEdTabPlain-->');
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 (useWikEdwikEdUseWikEd == true) {
WikEdUpdateTextarea();
}
wikEdPreviewBox.innerHTML = wiki2html(wikEdTextarea.value);
wikEdPreviewWrapperwikEdLocalPrevWrapper.style.display = 'block';
break;
 
Line 1,569 ⟶ 1,696:
WikEdFullScreen(false);
}
if (useWikEdwikEdUseWikEd == true) {
WikEdUpdateTextarea();
}
Line 1,575 ⟶ 1,702:
diffText = StringDiff(wikEdOrigVersion, diffText);
wikEdPreviewBox.innerHTML = diffText;
wikEdPreviewWrapperwikEdLocalPrevWrapper.style.display = 'block';
break;
 
Line 1,581 ⟶ 1,708:
case 'wikEdClose':
case 'wikEdClose2':
wikEdPreviewWrapperwikEdLocalPrevWrapper.style.display = 'none';
break;
 
Line 1,594 ⟶ 1,721:
// turn rich text frame on
WikEdSetEditArea(true);
useWikEdwikEdUseWikEd = true;
cookieExpire.setTime(cookieExpire.getTime() - 60 * 60 * 1000);
WikEdSetCookie('wikEdUseClassic', '', cookieExpire.toGMTString(), '/');
}
 
Line 1,606 ⟶ 1,735:
// turn classic textarea on
WikEdSetEditArea(false);
useWikEdwikEdUseWikEd = 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.selectionWordselection.plain != '') {
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
if (wikEdInputElement['summary'].value == '') {
wikEdInputElement['summary'].value = '#redirect [[' + linkTarget + ']]';
WikEdAppendToSummary(wikEdInputElement['summary'].value, '#redirect [[' + linkTarget + ']]');
}
selectChange = false;
break;
Line 2,638 ⟶ 2,786:
// display tabs
else {
obj.html = obj.html.replace(/(\t)/g, '<' + 'prespan class="wikEdTabPlain">$1<' + '/prespan><!--wikEdTabPlain-->');
}
 
Line 2,655 ⟶ 2,803:
var frameSrollTop;
if (obj.changed.from == 'whole') {
frameSrollTop = wikEdFrameBody.scrollTop;
}
 
Line 2,710 ⟶ 2,858:
 
// focus the frame
if (useWikEdwikEdUseWikEd == true) {
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|script|script|object|applet|embed)\b[^>]*>.*?<\/\1>/g, '');
 
// newlines
Line 2,860 ⟶ 3,008:
obj.plain = obj.plain.replace(/<[^>]*>/g, '');
 
// remove trailing spaces
obj.plain = obj.plain.replace(/[ \t\u00a0]+([\n\u0000])/g, '$1');
obj.plain = obj.plain.replace(/(\u0000)[ \t\u00a0]+/g, '$1');
 
// trim down \u0000 and \n
obj.plain = obj.plain.replace(/\u0000+/g, '\n');
obj.plain = obj.plain.replace(/^\n+/g, '');
obj.plain = obj.plain.replace(/\n{2,}$/g, '\n');
 
return;
Line 3,352 ⟶ 3,499:
obj.html = obj.html.replace(/&lt;(\/?\w.*?)&gt;/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 attributes<span> in<div> opening html tags<p>
obj.html = obj.html.replace(/<(\w+span|div|p)\b *(.*?) *(\/?)>/g,
function (p, p1, p2, p3) {
return('<' + p1 + WikEdSanitizeAttributes(p1, p2, relaxed) + '>');
if (p3 != '') {
p3 = ' ' + p3;
}
return('<' + p1 + WikEdSanitizeAttributes(p1, p2) + p3 + '>');
}
);
Line 3,697 ⟶ 3,841:
if (p3 == '') {
isRemove.push(true);
return('\nu0000\nu0000');
}
isRemove.push(false);
Line 3,703 ⟶ 3,847:
}
if (isRemove.pop() == true) {
return('\nu0000\nu0000');
}
return(p1);
}
);
 
// remove trailing spaces
obj.html = obj.html.replace(/[ \t]+\n/g, '\n');
 
// 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, '\nu0000\u0000----\nu0000\u0000');
 
// <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, '\nu0000\nu0000= $1 =\nu0000\nu0000');
obj.html = obj.html.replace(/[\s\u0000]*<h2\b[^>]*>(.*?)<\/h2>[\s\u0000]*/g, '\nu0000\nu0000== $1 ==\nu0000\nu0000');
obj.html = obj.html.replace(/[\s\u0000]*<h3\b[^>]*>(.*?)<\/h3>[\s\u0000]*/g, '\nu0000\nu0000=== $1 ===\nu0000\nu0000');
obj.html = obj.html.replace(/[\s\u0000]*<h4\b[^>]*>(.*?)<\/h4>[\s\u0000]*/g, '\nu0000\nu0000==== $1 ====\nu0000\nu0000');
obj.html = obj.html.replace(/[\s\u0000]*<h5\b[^>]*>(.*?)<\/h5>[\s\u0000]*/g, '\nu0000\nu0000===== $1 =====\nu0000\nu0000');
obj.html = obj.html.replace(/[\s\u0000]*<h6\b[^>]*>(.*?)<\/h6>[\s\u0000]*/g, '\nu0000\nu0000====== $1 ======\nu0000\nu0000');
 
obj.html = obj.html.replace(/<span\b[^>]*\bclass=\"mw-headline\">(.*?)<\/span> */g, '$1');
 
// sanitize <span> <div>
obj.html = obj.html.replace(/<(span|div) ([^>]*)>/g,
function (p, p1, p2) {
return('<' + p1 + WikEdSanitizeAttributes(p1, p2) + '>');
}
);
 
// remove <thead> <tbody> <tfoot>
obj.html = obj.html.replace(/([\s*\u0000])<(thead|tbody|tfoot)\b[^>]*>[\s\u0000]*/g, '$1');
 
// line breaks in table cells
obj.html = obj.html.replace(/(<(td|th)\b[^>]*>)\s*([^].*?)(<\/\2>)/g,
function(p, p1, p2, p3, p4) {
p3 = p3.replace(/^(\ns|\u0000|<br\b[^>]*>)+/g, '&lt;br /&gt;\n');
p3 = p3.replace(/(\s|\u0000|<br\b[^>]*>)+$/g, '');
return(p1 + '<br />' + p3 + p4);
p3 = p3.replace(/<br\b[^>]*> */g, '&lt;br /&gt;');
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, '\nu0000| ');
obj.html = obj.html.replace(/[\s\u0000]*<(td) +([^>]*)>[\s\u0000]*/g,
function (p, p1, p2) {
return('\nu0000|' + WikEdSanitizeAttributes(p1, p2, relaxed) + ' | ');
}
);
 
// <th> table cells
obj.html = obj.html.replace(/[\s\u0000]*<th>[\s\u0000]*/g, '\nu0000| ');
obj.html = obj.html.replace(/[\s\u0000]*<(th) +([^>]*)>[\s\u0000]*/g,
function (p, p1, p2) {
return('\nu0000!' + WikEdSanitizeAttributes(p1, p2, relaxed) + ' | ');
}
);
 
// line breaks in table cells (continued)
obj.html = obj.html.replace(/<br\b[^>]*>/g, '\nu0000');
 
// <tr> table rows
obj.html = obj.html.replace(/[\s\u0000]*<tr>[\s\u0000]*/g, '\nu0000|-\nu0000');
obj.html = obj.html.replace(/[\s\u0000]*<(tr) +([^>]*)>[\s\u0000]*/g,
function (p, p1, p2) {
return('\nu0000|-' + WikEdSanitizeAttributes(p1, p2, relaxed) + '\nu0000');
}
);
 
// <caption> captionCaption
obj.html = obj.html.replace(/[\s\u0000]*<caption>[\s\u0000]*/g, '\nu0000|+ ');
obj.html = obj.html.replace(/[\s\u0000]*<(caption) +([^>]*)>[\s\u0000]*/g,
function (p, p1, p2) {
return('\nu0000|+' + WikEdSanitizeAttributes(p1, p2, relaxed) + ' | ');
}
);
 
// <table> tables
obj.html = obj.html.replace(/[\s\u0000]*<table>[\s\u0000]*(\|-[\n|\u0000])?/g, '\nu0000\nu0000{|\nu0000');
obj.html = obj.html.replace(/[\s\u0000]*<(table) +([^>]*)>[\s\u0000]*(\|-[\n|\u0000])?/g,
function (p, p1, p2) {
return('\nu0000{|' + WikEdSanitizeAttributes(p1, p2) + '\nu0000');
}
);
obj.html = obj.html.replace(/[\s\u0000]*<\/table>[\s\u0000]*/g, '\nu0000|}\nu0000\nu0000');
 
// 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\nu0000');
 
// clean up DOI
Line 3,999 ⟶ 4,135:
if (regExpMatch != null) {
imgAlt = regExpMatch[2].replace(/^ +| +$/g, '');
imgAlt = imgAlt.replace(/&amp;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(/ [\s\u0000]*<(\/?(ol|ul|li|dl|dd|dt))\b[^>]*> [\s\u0000]*/g,
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, '');
obj.html = obj.html.replace(/\u0000+/g, '\n');
 
// <> 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, '\nu0000\u0000');
 
// 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(/[ \t]n{2,}\u0000+\n/g, '\n\n');
obj.html = obj.html.replace(/\n\u0000+\n{32,}/g, '\n\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 common = 'lang|dir|style|class'; // not needed: id|title
var tablecell;
var tablealign = '|align|char|charoff|valign';
var table;
var tablecell = '|abbr|axis|headers|scope|rowspan|colspan|nowrap|width|height|bgcolor';
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;
 
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) {
// relaxed
if (common.indexOf(attrib) >= 0) { valid = true; }
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) {
}
}
 
else if ('div|span|h1|h2|h3|h4|h5|h6|p'.indexOf(tag) >= 0) {
// strict
if ((common + '|align').indexOf(attrib) >= 0) { valid = true; }
}else {
else if ('center|em|strong|cite|code|var|sub|supdl|dd|dt|tt|b|i|big|small|strike|s|u|rb|rp|ruby|blockquote|pre|ins|del'.indexOf(tag) >= 0) {
if ((common + '|cite').indexOf(attrib) >= 0) { valid = true; }
}
else if ('brdiv|span|h1|h2|h3|h4|h5|h6|p'.indexOf(tag) >= 0) {
if ((common + 'style|clearalign').indexOf(attrib) >= 0) { valid = true; }
}
else if ('prebr'.indexOf(tag) >= 0) {
if ((common + '|widthclear').indexOf(attrib) >= 0) { valid = true; }
}
else if ('ins|delul'.indexOf(tag) >= 0) {
if ((common + '|cite|datetimetype').indexOf(attrib) >= 0) { valid = true; }
}
else if ('ulol'.indexOf(tag) >= 0) {
if ((common + '|type|start').indexOf(attrib) >= 0) { valid = true; }
}
else if ('olli'.indexOf(tag) >= 0) {
if ((common + '|type|startvalue').indexOf(attrib) >= 0) { valid = true; }
}
else if ('litable'.indexOf(tag) >= 0) {
if ((common + '|type|value'table).indexOf(attrib) >= 0) { valid = true; }
}
else if ('tablecaption'.indexOf(tag) >= 0) {
if ((common + '|summary|width|border|frame|rules|cellspacing|cellpadding|align|bgcolor|frame|rules|border').indexOf(attrib) >= 0) { valid = true; }
}
else if ('captionthead|tfoot|tbody'.indexOf(tag) >= 0) {
if ((common + '|align'tablealign).indexOf(attrib) >= 0) { valid = true; }
}
else if ('theadcolgroup|tfoot|tbodycol'.indexOf(tag) >= 0) {
if ((common + '|span' + tablealign).indexOf(attrib) >= 0) { valid = true; }
}
else if ('colgroup|coltr'.indexOf(tag) >= 0) {
if ((common + '|span|widthbgcolor' + tablealign).indexOf(attrib) >= 0) { valid = true; }
}
else if ('trtd|th'.indexOf(tag) >= 0) {
if ((common + '|bgcolor'tablecell + tablealign).indexOf(attrib) >= 0) { valid = true; }
}
else if ('td|thfont'.indexOf(tag) >= 0) {
if ((common + tablecell + tablealign'|color').indexOf(attrib) >= 0) { valid = true; }
}
else if ('fonthr'.indexOf(tag) >= 0) {
if ((common + '|noshade|size|color|face').indexOf(attrib) >= 0) { valid = true; }
}
else if ('hrrt'.indexOf(tag) >= 0) {
if ((common + '|noshade|size|widthrbspan').indexOf(attrib) >= 0) { valid = true; }
}
else if ('rtref'.indexOf(tag) >= 0) {
if ((common + '|rbspanname').indexOf(attrib) >= 0) { valid = true; }
}
else if ('refreferences'.indexOf(tag) >= 0) {
}
if (('name').indexOf(attrib) >= 0) { valid = true; }
}
else if ('references'.indexOf(tag) >= 0) {
}
 
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, ';');
}
sanitizedelse += ' ' +if (attrib +== '="class') + attribValue + '"';{
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(/(&lt;(gallery)\b.*?&gt;)/gi, '$1<span class="wikEdWiki">$1');
obj.html = obj.html.replace(/(&lt;\/(gallery)\b.*?&gt;)/gi, '$1</span><!--wikEdWiki-->');
}
Line 4,543 ⟶ 4,789:
function (p, p1) {
if (p1 == '\u0009') {
p1 = '<' + 'prespan class="wikEdTab" title="' + wikEdControlChars[p1.charCodeAt(0).toString()] + '">' + p1 + '<' + '/prespan><!--wikEdTab-->';
}
else if (p1 != '\u000a') {
p1 = '<' + 'prespan class="wikEdCtrl" title="' + wikEdControlChars[p1.charCodeAt(0).toString()] + '">' + p1 + '<' + '/prespan><!--wikEdCtrl-->';
}
return(p1);
Line 4,561 ⟶ 4,807:
function (p, p1) {
if (p1 != '\u000a') {
p1 = '<' + 'prespan class="wikEdBlank" title="' + wikEdStrangeSpaces[p1.charCodeAt(0).toString()] + '">' + p1 + '<' + '/prespan><!--wikEdBlank-->';
}
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, '<' + 'prespan class="wikEdTabPlain">$1<' + '/prespan><!--wikEdTabPlain-->');
}
 
Line 4,627 ⟶ 4,874:
obj.html = obj.html.replace(/ /g, '&nbsp; ');
obj.html = obj.html.replace(/ /g, '&nbsp; ');
obj.html = obj.html.replace(/ \n/g, '&nbsp;\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
WikEdInactiveButtons();
 
// reset the frame DOM cache
wikEdFrameDOMCache = null;
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) {
 
var sel = wikEdFrameWindow.getSelection();
// set cursor to start and search again
sel.collapse(sel.anchorNode, sel.anchorOffset);
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 -frame
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') {
var textwikEdInputElement[field].value = WikEdAppendToSummary(wikEdInputElement[field].value, option.text);
if ( (text != '') && (!text.match(/ \*\/ $/) ) ) {
if (option.text.match(/^\w/)) {
text += ', ';
}
else {
text += ' ';
}
}
text += option.text;
wikEdInputElement[field].value = text;
}
 
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);
WikEdSaveHistoryToCookie(field);
}
}
return;
Line 4,947 ⟶ 5,331:
var option = {};
var selected = null;
j = 0;
 
// delete options
var options = wikEdSelectElement[field].options;
for (i = 0; i >< options.length; 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 &amp; &lt; &gt;
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
 
// supported chars in Mozilla and IE6
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'], //   en space
['00ad', 'shy'], // ­ soft hyphen
['2003', 'emsp'], //   em space
['2009', 'thinsp'], //   thin space
['200c', 'zwnj'], // ‌ zero width non-joiner
['200d', 'zwj'], // ‍ zero width joiner
['200e', 'lrm'], // ‎ left-to-right mark
['200f', 'rlm'] // ‏ right-to-left mark
];
 
// 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'] // 〉
];