Mercurial > moin-mandarin
changeset 8:f84deed6b831
Enabled the GUI Editor
| author | Radomir Dopieralski <devel@sheep.art.pl> |
|---|---|
| date | Sun, 16 Dec 2007 01:17:51 +0100 |
| parents | 97b99cce9253 |
| children | 9a40cc297133 |
| files | mandarin.py mandarin/style.css |
| diffstat | 2 files changed, 43 insertions(+), 17 deletions(-) [+] |
line wrap: on
line diff
--- a/mandarin.py Thu Dec 13 13:02:49 2007 +0100 +++ b/mandarin.py Sun Dec 16 01:17:51 2007 +0100 @@ -90,7 +90,9 @@ self.username(d), self.gotobar(d), self.editbar(d), + u'<h1>', self.title(d), + u'</h1>', self.logged_trail(d), u'</div>', self.emit_custom_html(self.cfg.page_header2), @@ -158,7 +160,7 @@ params = (wikiutil.quoteWikinameURL(page.page_name) + '?action=edit') text = _('Edit', formatted=False) - return wikiutil.link_tag(self.request, params, text, css_class="edit") + return wikiutil.link_tag(self.request, params, text, css_class="edit", name="texteditlink") def login_link(self, d): page = d['page'] @@ -234,10 +236,10 @@ def title(self, d): title = d['title_text'] if title == d['page_name']: - html = '<h1>%s%s</h1>' % ( + html = '%s%s' % ( self.pagepath(d), wikiutil.escape(title.split('/')[-1])) else: - html = '<h1>%s</h1>' % wikiutil.escape(title) + html = wikiutil.escape(title) return html def html_stylesheets(self, d): @@ -293,13 +295,37 @@ return logo def headscript(self, d): - return u'' + """Override the stupid default script with its hardcoded HTML structure""" + return u'''<script type="text/javascript"><!-- +function add_gui_editor_links() { + // Add gui editor link after the text editor link - def externalScript(self, name): - return u'' + // If the variable is not set or browser is not compatible, exit + try {gui_editor_link_href} + catch (e) { + //alert("add_gui_editor_links: gui_editor_link_href not here"); + return + } + if (can_use_gui_editor() == false){ + //alert("add_gui_editor_links: can't use gui_editor"); + return; + } + var all = document.getElementsByName('texteditlink'); + for (i = 0; i < all.length; i++) { + var textEditorLink = all[i]; + // Create a a link + var guiEditorLink = document.createElement('a'); + guiEditorLink.href = gui_editor_link_href; + var text = document.createTextNode(gui_editor_link_text); + guiEditorLink.appendChild(text); + // Insert in the editbar + var editbar = textEditorLink.parentNode + editbar.insertBefore(guiEditorLink, textEditorLink.nextSibling); + } +} +--></script> +''' - def guiEditorScript(self, d): - return u'' def recentchanges_entry(self, d): _ = self.request.getText if d['comments']:
--- a/mandarin/style.css Thu Dec 13 13:02:49 2007 +0100 +++ b/mandarin/style.css Sun Dec 16 01:17:51 2007 +0100 @@ -1,6 +1,6 @@ html { padding: 0; - margin; 0; + margin: 0; font-size: 90%; font-family: DejaVu Sans, Droid Sans, Verdana, sans-serif; height: 100%; @@ -57,7 +57,7 @@ div.editbar a.edit:before { content: url(img/edit.png); vertical-align: baseline; - margin-right: 0.05em; + margin-right: 0.075em; } div.editbar { @@ -93,14 +93,14 @@ ul#username { - display; block; + display: block; float: right; clear: right; - list-style none; + list-style: none; margin: 0 0.5em; } ul#username li { - list-style none; + list-style: none; display: inline; margin: 0 0 0 1em; font-size: 90%; @@ -271,7 +271,7 @@ left: 0; right: 0; color: #ddd; - text-align; right; + text-align: right; border-top: 1px solid #ccc; padding: 0; margin: 0; @@ -317,16 +317,16 @@ } div.codearea pre { padding: 0; border: none; margin: 0; color: #222 } div.codearea span.ResWord { font-weight: bold } -div.codearea span.ResWord2 { font-weight: bold; color: #999 } +div.codearea span.ResWord2 { font-weight: bold; color: #f60 } div.codearea span.ID { font-style: italic } div.codearea span.Comment { color: #999; font-style: italic } -div.codearea span.Preprc { color: #999; } +div.codearea span.Preprc { color: #999; font-weight: bold; } div.codearea span.String { color: #f60; font-style: italic } div.codearea span.Char { color: #f60; font-style: italic; font-weight: bold } div.codearea span.Number { color: #f60 } div.codearea span.ConsWord { color: #f60; font-weight: bold } div.codearea span.Operator { } -div.codearea span.SPChar { font-style: bold; } +div.codearea span.SPChar { font-weight: bold; } div.codearea span.Special { } div.codearea span.Error { color: #f60; font-weight: bold; background: #ddd }
