From 05124c8c30a67c005eac475a262c6e3c61473590 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Rekucki?= Date: Mon, 8 Mar 2010 13:13:25 +0100 Subject: [PATCH 1/1] Fixes #273. Removed MySQL from requirements. --- .../wiki/templates/wiki/document_details.html | 6 +++- platforma/static/css/master.css | 14 ++++++-- platforma/static/js/main.js | 32 +++++++++++++++---- requirements.txt | 8 ++--- 4 files changed, 46 insertions(+), 14 deletions(-) diff --git a/apps/wiki/templates/wiki/document_details.html b/apps/wiki/templates/wiki/document_details.html index db4d884a..e7a33980 100644 --- a/apps/wiki/templates/wiki/document_details.html +++ b/apps/wiki/templates/wiki/document_details.html @@ -70,15 +70,19 @@ - + {% if request.user.is_staff %} + + {% endif %}
+ {% if request.user.is_staff %} + {% endif %} diff --git a/platforma/static/css/master.css b/platforma/static/css/master.css index 07487d3d..461b406d 100644 --- a/platforma/static/css/master.css +++ b/platforma/static/css/master.css @@ -125,11 +125,18 @@ body { display: block; float: left; margin: 4px 0 2px 0; - padding: 0 5px 2px 5px; + padding: 2px 5px; border: none; background: none; } +.toolbar button img { + margin: 0; + padding: 0; + margin-bottom: -3px; +} + + .toolbar select { float: left; margin: 1px 5px 1px 0; @@ -142,7 +149,8 @@ body { float: left; font-size: 11px; padding: 0; - margin: 2px 5px 0 5px; + margin: 4px 5px 0px 5px; + vertical-align:baseline; } .toolbar-end { @@ -190,7 +198,7 @@ p { margin: 0;} .gallery-image { position: absolute; - top: 27px; + top: 30px; right: 0; bottom: 0; left: 0; diff --git a/platforma/static/js/main.js b/platforma/static/js/main.js index 00bc9c66..8aff7317 100644 --- a/platforma/static/js/main.js +++ b/platforma/static/js/main.js @@ -145,7 +145,7 @@ function gallery(element, url) { }); $('.change-gallery', element).click(function() { $('.chosen-gallery').val($('#document-meta .gallery').html() || '/platforma/gallery/'); - $('.gallery-image').animate({top: 53}, 200); + $('.gallery-image').animate({top: 60}, 200); $('.chosen-gallery').focus(); }); $('.change-gallery-ok', element).click(function() { @@ -154,10 +154,10 @@ function gallery(element, url) { } $('#document-meta .gallery').html($('.chosen-gallery').val()); updateGallery($('.chosen-gallery').val()); - $('.gallery-image').animate({top: 27}, 200); + $('.gallery-image').animate({top: 30}, 200); }); $('.change-gallery-cancel', element).click(function() { - $('.gallery-image').animate({top: 27}, 200); + $('.gallery-image').animate({top: 30}, 200); }); $('.gallery-image img', element).load(function() { @@ -269,14 +269,14 @@ function gallery(element, url) { element.data('images', data); pn.val(1); pn.change(); - $('img', element).show(); + $('.gallery-image img', element).show(); }, error: function(data) { element.data('images', []); pn.val(1); pn.change(); - $('img', element).hide(); + $('.gallery-image img', element).hide(); } }); } @@ -393,6 +393,23 @@ function html(element) { return true; } + + var ANNOT_ALLOWED = ['wyroznienie']; + + function html2plainText(fragment) { + var text = ""; + + $(fragment.childNodes).each(function() { + if(this.nodeType == 3) // textNode + text += this.nodeValue; + else if (this.nodeType == 1 + && $.inArray($(this).attr('x-node'), ANNOT_ALLOWED) != -1 ){ + text += html2plainText(this); + } + }); + + return text; + } function addAnnotation() { @@ -418,7 +435,10 @@ function html(element) { return false; } - var text = range.toString(); + // BUG #273 - selected text can contain themes, which should be omited from + // defining term + var text = html2plainText( range.cloneContents() ); + var tag = $(''); range.collapse(false); range.insertNode(tag[0]); diff --git a/requirements.txt b/requirements.txt index 8776773b..00c38ace 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,9 +1,9 @@ --find-links=http://stigma.nowoczesnapolska.org.pl/pypi/ -Django==1.1.1 -lxml>=2.2,<2.3 -mercurial==1.3.1 +Django>=1.1.1,<1.2 +lxml>=2.2 +mercurial>=1.3.1 librarian>=1.3.dev,<1.4 PyYAML>=3.0 -MySQL-python>=1.2,<2.0 +# MySQL-python>=1.2,<2.0 django-nose>=0.0.3 -- 2.20.1