Content deleted Content added
No edit summary |
0.9.6 |
||
Line 17:
var wikEdProgramHomepage = 'http://en.wikipedia.org/wiki/User:Cacycle/wikEd';
var wikEdProgramVersion = '0.9.
var wikEdProgramDate = 'November
Line 29:
var wikEdFrameCSS = wikEdFrameCSS || [];
wikEdFrameCSS['body'] = wikEdFrameCSS['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'] || 'background-image: url({wikEdTab}); background-position: right bottom; background-repeat: no-repeat; display: inline;';
wikEdFrameCSS['.wikEdTabPlain'] = wikEdFrameCSS['.wikEdTabPlain'] || 'display: inline;';
wikEdFrameCSS['.wikEdCtrl'] = wikEdFrameCSS['.wikEdControl'] || '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'] || 'background-image: url({wikEdBlank}); background-position: left center; background-repeat: repeat-x; background-color: white; display: inline;';
// CSS rules main window
var wikEdMainCSS = 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;';
// wikEd button areas
wikEdMainCSS['.wikEdButtonsFormat'] = wikEdMainCSS['.wikEdButtonsFormat'] || 'background: #d4d0cc; border: 1px black solid; padding: 0.1em; margin: 0.2em 0.6em 0 0
wikEdMainCSS['.wikEdButtonsFind'] = wikEdMainCSS['.wikEdButtonsFind'] || 'background: #d4d0cc; border: 1px black solid; padding: 0.1em; margin: 0.2em 0.6em 0 0
wikEdMainCSS['.wikEdButtonsFix'] = wikEdMainCSS['.wikEdButtonsFix'] || 'background: #d4d0cc; border: 1px black solid; padding: 0.1em; margin: 0.2em 0.6em 0 0
wikEdMainCSS['.wikEdButtonsControl'] = wikEdMainCSS['.wikEdButtonsControl'] || 'background: #d4d0cc; border: 1px black solid; padding: 0.1em; margin: 0.2em 0 0 0
wikEdMainCSS['.wikEdButtonsPreview'] = wikEdMainCSS['.wikEdButtonsPreview'] || 'background: #d4d0cc; border: 1px black solid; padding: 0.1em; margin: -0.2em 0 0 0.6em
wikEdMainCSS['.wikEdButtonsPreviewFull'] = wikEdMainCSS['.wikEdButtonsPreviewFull'] || 'background: #d4d0cc; border: 1px black solid; padding: 0.1em; margin: -
// 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['.wikEdButtonFloat'] = wikEdMainCSS['.wikEdButtonFloat'] || 'background: #d4d0cc; border: 1px outset; cursor: pointer; display: none; position: absolute; z-index: 5;';
wikEdMainCSS['.wikEdButtonChecked'] = wikEdMainCSS['.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['#wpSummary'] = wikEdMainCSS['#wpSummary'] || 'padding: 0; margin: 0; position: absolute; left: 0; top: 0; z-index: 2; width: auto;';
wikEdMainCSS['#wpSummarySelect'] = wikEdMainCSS['#wpSummarySelect'] || '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'] || '';
wikEdMainCSS['.wikEdInputWrapperFull'] = wikEdMainCSS['.wikEdInputWrapperFull'] || 'position: fixed; top: 0; left: 0; right: 0; padding: 4px; background: white;';
// other wrappers
wikEdMainCSS['.wikEdToolbarWrapper'] = wikEdMainCSS['.wikEdToolbarWrapper'] || '';
wikEdMainCSS['.wikEdTextareaWrapper'] = wikEdMainCSS['.wikEdTextareaWrapper'] || '';
wikEdMainCSS['.wikEdFrameWrapper'] = wikEdMainCSS['.wikEdFrameWrapper'] || '';
wikEdMainCSS['.wikEdConsoleWrapper'] = wikEdMainCSS['.wikEdConsoleWrapper'] || '';
wikEdMainCSS['.wikEdButtonsWrapper'] = wikEdMainCSS['.wikEdButtonsWrapper'] || '';
wikEdMainCSS['.wikEdSubmitWrapper'] = wikEdMainCSS['.wikEdSubmitWrapper'] || '';
wikEdMainCSS['.
wikEdMainCSS['.
wikEdMainCSS['.wikEdInsertWrapper'] = wikEdMainCSS['.wikEdInsertWrapper'] || '';
// general settings
Line 365 ⟶ 366:
var wikEdSummaryWrapper = {};
var wikEdSubmitWrapper = {};
var wikEdSubmitButtonsWrapper = {};
var wikEdPreviewWrapper = {};
var wikEdInsertWrapper = {};
Line 603 ⟶ 605:
wikEdSubmitWrapper.className = 'wikEdSubmitWrapper';
wikEdConsoleWrapper.appendChild(wikEdSubmitWrapper);
// create submit wrapper for submit buttons and help links
wikEdSubmitButtonsWrapper = document.createElement('div');
wikEdSubmitButtonsWrapper.id = 'wikEdSubmitButtonsWrapper';
wikEdSubmitButtonsWrapper.className = 'wikEdSubmitButtonsWrapper';
wikEdSubmitWrapper.appendChild(wikEdSubmitButtonsWrapper);
// create preview wrapper for preview and diff box
Line 647 ⟶ 655:
wikEdSummaryText = document.getElementById('wpSummary');
wikEdSummaryWrapper.appendChild(wikEdSummaryText);
// move editpage-copywarn out of summary wrapper▼
// needs to be done before appending editOptions to summary wrapper otherwise a linebreak stays (Mozilla bug)
var copywarn = document.getElementById('editpage-copywarn');▼
if (copywarn != null) {
}
// crashes Mozilla when appended after filling the iframe
var editOptions = document.getElementById('wpMinoredit').parentNode;
wikEdSummaryWrapper.appendChild(editOptions);
// add textarea to textarea wrapper
Line 804 ⟶ 820:
// add submit buttons to submit wrapper
var wpEditButtons = document.getElementById('wpSave').parentNode;
// add preview box top bar to submit wrapper
Line 819 ⟶ 835:
buttonsPreview.innerHTML = html;
wikEdSubmitWrapper.
wikEdButtonsPreview = document.getElementById('wikEdButtonsPreview');
Line 901 ⟶ 917:
WikEdButton('wikEdDiff2', null, false, 'wikEdButton');
WikEdButton('wikEdClose2', null, false, 'wikEdButton');
▲// move editpage-copywarn out of summary wrapper
▲ var copywarn = document.getElementById('editpage-copywarn');
▲ wikEdInputWrapper.parentNode.insertBefore(copywarn, wikEdInputWrapper.nextSibling);
// no linebreak before minor edit checkbox
Line 917 ⟶ 929:
node = node.previousSibling;
}
}
Line 2,615 ⟶ 2,626:
//
// WikEdInactiveButtons: grey out inactive buttons, called after every change and click
//
Line 2,674 ⟶ 2,685:
// empty line before and after headings, spaces around word (lookahead)
obj.plain = obj.plain.replace(/\n+(=
// uppercase well known headings
obj.plain = obj.plain.replace(/\n=
obj.plain = obj.plain.replace(/\n=
obj.plain = obj.plain.replace(/\n=
// add space after * # : ; (list) and after {| |- | (table)
Line 2,754 ⟶ 2,765:
// no empty line between headings and includes
obj.plain = obj.plain.replace(/\n(
// spaces in comments
Line 3,145 ⟶ 3,156:
// uppercase headings
obj.plain = obj.plain.replace(/^(
function (p, p1, p2, p3) {
if ( ! p3.match(/^(http|ftp|alpha|beta|gamma|delta|epsilon|kappa|lambda)/) ) {
|