Mercurial > moin > 2.0
changeset 49:5ac57ba008b5
merged bb+http://RogerHaase/moin-2.0
author | Thomas Waldmann <tw AT waldmann-edv DOT de> |
---|---|
date | Mon, 28 Feb 2011 22:42:52 +0100 |
parents | f4308cd49ba2 (current diff) 4d884cd29174 (diff) |
children | 8102f92d21b8 edd248672292 |
files | |
diffstat | 5 files changed, 157 insertions(+), 110 deletions(-) [+] |
line wrap: on
line diff
--- a/MoinMoin/static/js/common.js Mon Feb 28 15:19:17 2011 +0100 +++ b/MoinMoin/static/js/common.js Mon Feb 28 22:42:52 2011 +0100 @@ -11,7 +11,7 @@ // Update search buttons status according to search box content. // Ignore empty or whitespace search term. var value = e.value.replace(/\s+/, ''); - if (value == '' || searchIsDisabled) { + if (value == '' || searchIsDisabled) { searchSetDisabled(true); } else { searchSetDisabled(false); @@ -102,7 +102,7 @@ /* // disable safari : until fck devteam fix http://dev.fckeditor.net/ticket/2333 - + // Adobe AIR // Checked before Safari because AIR have the WebKit rich text editor // features from Safari 3.0.4, but the version reported is 420. @@ -136,7 +136,7 @@ function add_gui_editor_links() { // Add gui editor link after the text editor link - + // If the variable is not set or browser is not compatible, exit try {gui_editor_link_href} catch (e) { @@ -164,12 +164,12 @@ //alert("add_gui_editor_links: added gui editor link"); } } - + function show_switch2gui() { // Show switch to gui editor link if the browser is compatible if (can_use_gui_editor() == false) return; - + var switch2gui = document.getElementById('switch2gui') if (switch2gui) { switch2gui.style.display = 'inline'; @@ -208,24 +208,24 @@ function load() { // Do not name this "onload", it does not work with IE :-) // TODO: create separate onload for each type of view and set the - // correct function name in the html. + // correct function name in the html. // e.g <body onlod='editor_onload()'> // login focus if (document.forms['loginform']) { document.forms['loginform'].elements['name'].focus(); } - + // Page view stuff update_edit_links(); add_gui_editor_links(); - + // Editor stuff show_switch2gui(); // Enable menu item "ToggleComments" if inline comments exist show_toggleComments(); - + // data browser widget dbw_hide_buttons(); } @@ -315,7 +315,7 @@ Developed by Robert Nyman, http://www.robertnyman.com Code/licensing: http://code.google.com/p/getelementsbyclassname/ (MIT license) Version: 1.0.1 -*/ +*/ var getElementsByClassName = function (className, tag, elm){ if (document.getElementsByClassName) { getElementsByClassName = function (className, tag, elm) { @@ -455,10 +455,10 @@ targ.removeAttribute('title'); } // add leading zeros to hours, minutes, seconds, milliseconds -function leadingZeros (nbr,count) { +function leadingZeros (nbr,count) { var strNbr = nbr + ''; while (strNbr.length < count) { - strNbr = "0" + strNbr; + strNbr = "0" + strNbr; } return strNbr; } @@ -498,7 +498,7 @@ // this scrolls the textarea after a doubleclick - jumpLine is scroll-to line function scrollTextarea(jumpLine) { var txtBox = document.getElementById('editor-textarea'); - scroll(0,0); + scroll(0,0); if (txtBox) { // Calculate the cursor position - IE supports innerText, not textContent var textLines = txtBox.textContent || txtBox.innerText; @@ -541,18 +541,18 @@ range.select(); txtBox.__column = 1; } - } + } } // stop event bubbling function stopBubbling(e) { if (e.stopPropagation) { - e.stopPropagation(); + e.stopPropagation(); } e.cancelBubble = true; } -// stop bubbling and return event node +// stop bubbling and return event node function getNode(e) { // window.event and e.srcElement are IE var e = e || window.event; @@ -586,15 +586,15 @@ return; } else { node.scrollLine = line; - if(window.addEventListener){ + if(window.addEventListener){ if (isPreview) { node.addEventListener('dblclick',doTextareaScroll,false); } else { node.addEventListener('dblclick',doActionEdit,false); } if (autoScrollDebugOn) { - node.addEventListener('mouseover', doMouseOver,false); - node.addEventListener('mouseout',doMouseOut,false); + node.addEventListener('mouseover', doMouseOver,false); + node.addEventListener('mouseout',doMouseOut,false); } } else { // IE @@ -604,7 +604,7 @@ node.attachEvent('ondblclick',doActionEdit); } if (autoScrollDebugOn) { - node.attachEvent('onmouseover', doMouseOver,false); + node.attachEvent('onmouseover', doMouseOver,false); node.attachEvent('onmouseout',doMouseOut,false); } } @@ -669,14 +669,14 @@ var bottom = document.getElementById('bottom'); // add expected stopping point to end of array for convenience if (bottom) { - marks.push(bottom); + marks.push(bottom); } else { if (autoScrollDebugOn) { alert("auto scroll debug 1: document.getElementById('bottom') failed"); } } - var skipTo = -1; - // loop through span tags and apply double-click events to appropriate node(s) + var skipTo = -1; + // loop through span tags and apply double-click events to appropriate node(s) for (i = 0; i < marks.length-1; ++i) { var mark = marks[i]; // skip span tags generated by embedded parsers @@ -695,7 +695,7 @@ // determine how many lines, starting line number, and add double-click events var nbrParsedLines = j - i; var parsedLineNbr = lineParts[1] - nbrParsedLines - 1; - for (var k = 0; k < nbrParsedLines; ++k) { + for (var k = 0; k < nbrParsedLines; ++k) { if (marks[i+k] && marks[i+k+1] && marks[i+k+1].id) { walkDom (marks[i+k], parsedLineNbr+k, isPreview, marks[i+k+1].id, top.id); } else { @@ -705,7 +705,7 @@ } } // done with embedded parser lines, tell main loop to skip these - skipTo = j - 1; + skipTo = j - 1; } else { // walk part of DOM and apply doubleclick function to every node with a tagname if (marks[i+1] && marks[i+1].id) { @@ -727,7 +727,7 @@ } // test to see if this user has selected or defaulted to edit_on_doubleclick AND -// whether we are viewing a page, editing a page, or previewing an edit draft +// whether we are viewing a page, editing a page, or previewing an edit draft function scrollTextareaInit() { // look for meta tag -- is edit_on_doubleclick present? if (!document.getElementsByName('edit_on_doubleclick').length) { @@ -744,7 +744,7 @@ if (lineMatch) { scrollTextarea(lineMatch[1]); return; - } + } if (document.getElementById('preview')) { // is an editor preview setSpanTags(1); @@ -753,7 +753,7 @@ // Now to resolve the problem of how to best execute scrollTextareaInit // -- We want to run as soon as DOM is loaded, perhaps many seconds before last big image is loaded -// -- If we wait for body.onload, the user may see and doubleclick on text before we are ready +// -- If we wait for body.onload, the user may see and doubleclick on text before we are ready // -- If every browser supported DOMContentLoaded, we could do: // document.addEventListener("DOMContentLoaded", scrollTextareaInit, false); // -- If we had jQuery, we could do: @@ -765,7 +765,7 @@ // run scrollTextareaInit one time; this function will be called twice for almost all browsers, scrollTextareaInitComplete = 0; function runScrollTextareaInitOnce() { - // uncomment next line to test - most browsers will display this alert twice + // uncomment next line to test - most browsers will display this alert twice //~ alert('scrollTextareaInitComplete=' + scrollTextareaInitComplete); if (scrollTextareaInitComplete) { return; @@ -780,7 +780,7 @@ // speed up most browsers -- run my function As Soon As Possible function runASAP(func) { - if (document.addEventListener) { + if (document.addEventListener) { // Firefox 3.6, Chrome 4.0.249.89, Safari for Windows 4.04, Opera 10.5beta, and maybe older versions // schedule func to be run when DOM complete document.addEventListener("DOMContentLoaded", func, false); @@ -820,7 +820,7 @@ var e = document.getElementById('moin-searchinput'); searchChange(e); searchBlur(e); - + $('#moin-searchinput').blur(function(){ searchBlur(this); }); @@ -837,42 +837,43 @@ searchChange(this); }); - + }); -// Firefox 3.6 does not support CSS with {word-wrap: break-word;} within td elements -// insert zero-width-space into long words after every 5 characters -function moinInsertZWS(target) { - var words; - if (target.tagName && target.textContent && target.textContent.length > 5) { - words = target.textContent.split(" "); - for (var i = 0; i < words.length; i++) { - words[i] = words[i].replace(/(.{5})/g,"$1\u200B"); - } - target.textContent = words.join(" "); - } -} -// find TD nodes that require word-breaking and break them +// Insert Zero-Width-Space characters into long text strings of textNode elements. +// Firefox does not support CSS with {word-wrap: break-word;} within tables. +// As a result, Firefox may display tables with long urls or page names as very wide tables. +// This function alters tables by inserting a zero-width-space into long text strings after every 5 characters. +// The moin-wordbreak class is intended for use on TD elements, but may be used on TABLE, TR, THEAD, TBODY, or TFOOT. function moinFirefoxWordBreak() { + // TODO: Test for browser version when/if a future Firefox supports break-word within tables. if (!jQuery.browser.mozilla) { return; } - var wrapElements = document.getElementsByClassName("moin-wordbreak"); var child; - for (var i = 0; i < wrapElements.length; i++) { - if (wrapElements[i].tagName == 'TD') { - moinInsertZWS(wrapElements[i]); - child = wrapElements[i].firstChild; - while (child) { - moinInsertZWS(child); - child = child.nextSibling; + var words; + var parents; + var i, j; + // Only textNodes are of interest, but there is no way to select them directly. + // Select all elements with the moin-wordbreak class and add all selectable descendants of those elements. + // Then search for children that are textNodes; TDs or THs and elements descended from them are likely parents of textNodes. + parents = jQuery(".moin-wordbreak").add(".moin-wordbreak *"); + for (i = 0; i < parents.length; i++) { + child = parents[i].firstChild; + while(child) { + if (child.nodeType === 3) { + words = child.textContent.split(" "); + for (j = 0; j < words.length; j++) { + // \u200B denotes a zero-width-space character (for easy testing, replace with a visible character like Q) + words[j] = words[j].replace(/(.{5})/g,"$1\u200B"); + } + child.textContent = words.join(" "); } + child = child.nextSibling; } } } -// TODO BUG disable the word break - it also breaks the links in the -// (item) Name column on the global history view! -//jQuery(moinFirefoxWordBreak); +jQuery(moinFirefoxWordBreak); /* For the overlays on transcluded objects */ function removeURLPrefixes(url) { @@ -889,15 +890,15 @@ }, 10) } }) - + $(elements.slice(1)).hide() }) } $(document).ready(attachHoverToObjects) -/* - For the quicklinks patch that +/* + For the quicklinks patch that makes all quicklinks after the 5th visible only by mousing over an icon. */ function getLinks() { @@ -907,16 +908,16 @@ function createIcon(txt) { var li = document.createElement("li"); li.setAttribute("class", "moin-userlink moin-navibar-icon"); - + var txt = document.createTextNode(txt); li.appendChild(txt); - + return li } function appendIcon(txt) { var elem = createIcon(txt); - + document.getElementById("moin-navibar").appendChild(elem); return elem } @@ -955,36 +956,36 @@ this.getHideableLinks = getHideableLinks; this.hideLinks = hideLinks; this.showLinks = showLinks; - + this.navibar = $("#moin-header"); this.links = this.getLinks(); this.hideable = this.getHideableLinks(); - + // If there's less than 5 items, don't bother doing anything. if (this.shouldHide(this.links)) { this.expandIcon = $(this.appendIcon(QUICKLINKS_EXPAND)); this.closeIcon = $(this.appendIcon(QUICKLINKS_COLLAPSE)); - + this.closeIcon.hide(); - + // Hide everything after the first 5 this.hideLinks(); - - /* + + /* TODO: when FF4.0 becomes stable/popular, delete the following hack and use function.bind(this) */ var newThis = this; - + // When the user mouses over the icon link, // Show the hidden links this.expandIcon.mouseenter(function(e) { newThis.showLinks(); newThis.expandIcon.hide(); newThis.closeIcon.show(); - + }); - + this.closeIcon.mouseenter(function(e) { newThis.hideLinks(); newThis.expandIcon.show();
--- a/MoinMoin/themes/modernized/static/css/common.css Mon Feb 28 15:19:17 2011 +0100 +++ b/MoinMoin/themes/modernized/static/css/common.css Mon Feb 28 22:42:52 2011 +0100 @@ -6,22 +6,22 @@ License: GNU GPL v2 or later, see COPYING for details. */ -/* +/* Copied from: http://code.google.com/p/html5resetcss/ html5doctor.com Reset Stylesheet v1.6.1 Last Updated: 2010-09-17 -Author: Richard Clark - http: //richclarkdesign.com +Author: Richard Clark - http: //richclarkdesign.com Twitter: @rich_clark */ -html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, -blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, +html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, +blockquote, pre, abbr, address, cite, code, del, dfn, em, img, ins, kbd, q, samp, small, strong, sub, sup, var, b, i, dl, dt, dd, ol, ul, li, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td, -article, aside, canvas, details, figcaption, figure, footer, header, hgroup, -menu, nav, section, summary, time, mark, audio, -video { margin: 0; padding: 0; border: 0; outline: 0; +article, aside, canvas, details, figcaption, figure, footer, header, hgroup, +menu, nav, section, summary, time, mark, audio, +video { margin: 0; padding: 0; border: 0; outline: 0; font-size: 100%; vertical-align: baseline; background: transparent; } body { line-height: 1; } article, aside, details, figcaption, figure, footer, header, hgroup, menu, nav, @@ -65,7 +65,7 @@ a:link { color: blue; } a:visited { color: purple; } a:hover { color: red; } -a:active { color: red; } +a:active { color: red; } /* dead links */ a.moin-nonexistent:visited, @@ -108,7 +108,7 @@ strong.highlight { background-color: #CCE0FF; padding: 1px; } /* pre */ -pre { border: 1pt solid #AEBDCC; background-color: #F3F5F7; padding: 5pt; +pre { border: 1pt solid #AEBDCC; background-color: #F3F5F7; padding: 5pt; font-family: courier, monospace; margin: .33em 0; white-space: pre; } pre.comment { background-color: #CCC; color: red; padding: 0; margin: 0; border: 0; } pre.comment:before { content: url(../img/attention.png); } @@ -119,26 +119,15 @@ td p { margin: 0; padding: 0; } /* TableOfContents macro */ -div.moin-table-of-contents { - background: -moz-linear-gradient(center top , #F9FFFF 1%, #EFEFFF 101%) repeat scroll 0 0 transparent; - border: 1px solid #BBBBBB; - color: black; - display: inline-table; - font-size: 80%; - margin: 0.5em 0 0.5em 1em; - max-width: 50%; - padding: 0.5em 0.75em 0.5em 0.5em; - text-align: left; - box-shadow: 3px 3px 11px -7px; - /* support for firefox 3.5/3.6 and safari */ - -moz-box-shadow: 3px 3px 11px -7px; - -webkit-box-shadow: 3px 3px 11px -7px; -} -.moin-table-of-contents ol { margin: 0; padding: 0 0 0 2em; } -.moin-table-of-contents ul { margin: 0; list-style: none; } -.moin-table-of-contents li { margin: 0; padding: 0; } -.moin-table-of-contents-heading { font-weight: bold; padding: 0; margin: 0 0 0.5em 0; - letter-spacing: 0.075em; } +div.moin-table-of-contents { border: 1px solid #BBB; color: black; + font-size: 80%; margin: 0.5em 0 0.5em 1em; padding: 0.5em 0.75em 0.5em 0.5em; text-indent: -1em; + max-width: 35%; text-align: left; float: right; clear: both; + box-shadow: 10px 10px 5px #679; border-radius: 15px; + -moz-box-shadow: 10px 10px 5px #679; -moz-border-radius: 15px; + -webkit-box-shadow: 10px 10px 5px #679; -webkit-border-radius: 15px; } +.moin-table-of-contents ol { margin: 0; padding: 0 0 0 .92em; } +.moin-table-of-contents li { margin: .12em 0 0 0; padding: 0; list-style:none;} +.moin-table-of-contents-heading { font-weight: bold; padding: 0; margin: 0 0 0.5em 1em; letter-spacing: 0.075em; } .moin-showhide { margin-left: 10px; } /* Navigation macro */ @@ -189,12 +178,12 @@ .searchresults dd, .searchresults p { font-size: 0.85em; } .searchresults .searchhitinfobar { color: #008000; margin-left: 15px; margin-top: 0; } -p.searchstats { font-size: 0.8em; text-align: right; width: 100%; background-color: #E6EAF0; +p.searchstats { font-size: 0.8em; text-align: right; width: 100%; background-color: #E6EAF0; border-top: 1px solid #9088DC; padding: 2px; } p.searchhint { background-color: #E6EAF0; border: 1px solid #9088DC; padding: 2px; } .searchpages { margin-left: auto; margin-right: auto; } .searchpages tr, -.searchpages td { border: 0; padding: 5px; margin: 0; text-align: center; vertical-align: middle; +.searchpages td { border: 0; padding: 5px; margin: 0; text-align: center; vertical-align: middle; color: #b93a58; font-weight: bold; font-size: 1.05em; } .searchpages td a, .searchpages td a:link { text-decoration: underline; } @@ -204,7 +193,7 @@ input#comment { border: 1px solid #8cacbb; display: inline; margin: .33em 0; padding: 3px; width: 70%; } /* placeholder #editor-help { font-size: small; background-color: #EEEEFF; } -#editor-comment { font-size: 100%; border: 1px solid #8cacbb; color: black; background-color: white; +#editor-comment { font-size: 100%; border: 1px solid #8cacbb; color: black; background-color: white; vertical-align: middle; padding: 1px; display: inline; width: 70%; } #preview, #previewbelow { border: 1px solid #6C7680; padding: 10px 30px 20px 30px; background: url(../img/draft.png); margin-top: 0.5em; } @@ -234,14 +223,14 @@ .moin-diff-header { vertical-align: top; font-size: 92%; } .moin-diff-info { margin: .33em .25em; } .moin-diff-info-value { white-space: normal; } -.moin-diff-info-heading { background-color: #E8E8E8; width: 100%; padding: 0.25em 0.5em; +.moin-diff-info-heading { background-color: #E8E8E8; width: 100%; padding: 0.25em 0.5em; margin: -0.25em -0.5em; margin-bottom: 0.25em; text-align: center; } .moin-diff-info-caption {display: inline-block; min-width: 5em; } .moin-diff-line-number { background-color: #C0C0C0; } -.moin-diff-added { background-color: #E0FFE0; vertical-align: top; width: 50%; white-space: pre-wrap; word-wrap: break-word; +.moin-diff-added { background-color: #E0FFE0; vertical-align: top; width: 50%; white-space: pre-wrap; word-wrap: break-word; font-family: courier, monospace; } -.moin-diff-removed { background-color: #FFFFE0; vertical-align: top; width: 50%; white-space: pre-wrap; word-wrap: break-word; +.moin-diff-removed { background-color: #FFFFE0; vertical-align: top; width: 50%; white-space: pre-wrap; word-wrap: break-word; font-family: courier, monospace; } .moin-diff-added span { background-color: #80FF80; } .moin-diff-removed span { background-color: #FFFF80; } @@ -275,7 +264,7 @@ a.cal-link { color: #000; text-decoration: none; } th.cal-header { background-color: #DBF; text-align: center; } /* for MonthCalendar mouseover info boxes */ -TABLE.tip { color: black; background-color: #F88; font-size: small; font-weight: normal; +TABLE.tip { color: black; background-color: #F88; font-size: small; font-weight: normal; border-style: solid; border-width: 1px; } TH.tip { background-color: #F44; font-weight: bold; text-align: center; } TD.tip { text-align: left; } @@ -300,8 +289,8 @@ #moin-content div.important, #moin-content div.note, #moin-content div.tip, -#moin-content div.warning { border: 1px solid #E5E5E5; background-color: #F9F9FF; - background-repeat: no-repeat; background-position: 8px 8px; color: black; +#moin-content div.warning { border: 1px solid #E5E5E5; background-color: #F9F9FF; + background-repeat: no-repeat; background-position: 8px 8px; color: black; margin: 10px 30px 10px 30px; min-height: 64px; padding-left: 64px; } #moin-content div.caution p, #moin-content div.important p,
--- a/moin Mon Feb 28 15:19:17 2011 +0100 +++ b/moin Mon Feb 28 22:42:52 2011 +0100 @@ -78,7 +78,7 @@ manager.add_command("maint_xml", XML()) if __name__ == "__main__": - if sys.argv == ['./moin']: + if sys.argv == ['./moin'] or sys.argv == ['moin']: manager.run(default_command='moin') else: manager.run(default_command=sys.argv[1])
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/moin.bat Mon Feb 28 22:42:52 2011 +0100 @@ -0,0 +1,9 @@ +echo off +echo. +echo This executes the "moin" file under Windows. Read the "moin" file for options. +echo. + +echo Starting server... Press Ctrl-c keys to stop server. +python moin %* + +
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/quickinstall.bat Mon Feb 28 22:42:52 2011 +0100 @@ -0,0 +1,48 @@ +echo off +echo. +echo This is the windows version of the "quickinstall" file. +echo It requires the stand-alone wget.exe from http://users.ugent.be/~bpuype/wget/#download +echo and 7za.exe from http://sourceforge.net/projects/sevenzip/files/7-Zip/9.20/7za920.zip/download +echo. +echo wget.exe and 7za.exe must be installed in the system path or this directory. +echo. + +echo Creating a virtual environment in directory env/ ... +virtualenv --no-site-packages env + +echo Activating virtual environment ... +call env\Scripts\activate.bat + +echo Installing all required python packages from pypi ... +pip install -e . + +echo Compiling translations (not required if wiki is English only) ... +python setup.py compile_catalog --statistics + + +echo Getting some 3rd party stuff and unpack them into env/, where the default +echo wikiconfig.py expects them (should be replaced by packaging) ... + +wget -nc "http://download.cksource.com/CKEditor/CKEditor/CKEditor 3.5/ckeditor_3.5.tar.gz" -Penv/ +7za x env/ckeditor_3.5.tar.gz -y -oenv\ +7za x env/ckeditor_3.5.tar -y -oenv\ + +wget -nc http://static.moinmo.in/files/packages/TWikiDrawPlugin-moin.tar.gz -Penv/ +7za x env/TWikiDrawPlugin-moin.tar.gz -y -oenv\ +7za x env/TWikiDrawPlugin-moin.tar -y -oenv\ + +wget -nc http://static.moinmo.in/files/packages/svg-edit.tar.gz -Penv/ +7za x env/svg-edit.tar.gz -y -oenv\ +7za x env/svg-edit.tar -y -oenv\ + +mkdir env\jquery +wget -nc http://code.jquery.com/jquery-1.4.4.min.js -Oenv/jquery/jquery.min.js + +wget -nc http://svgweb.googlecode.com/files/svgweb-2010-08-10-Owlephant-1.zip -Penv/ +7za x env/svgweb-2010-08-10-Owlephant-1.zip -y -oenv\ + +wget -nc http://downloads.sourceforge.net/project/anywikidraw/anywikidraw/anywikidraw-0.14/anywikidraw-0.14.zip?use_mirror=ignum -Penv/ +7za x env/anywikidraw-0.14.zip -y -oenv\ +xcopy "env\AnyWikiDraw 0.14" env\AnyWikiDraw\ /Y /E /H + +del /q env\*.tar