From 37c9ca34d7edb368cd080149cea73221a8d29f90 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C5=81ukasz=20Rekucki?= Date: Fri, 11 Sep 2009 16:14:37 +0200 Subject: [PATCH 1/1] =?utf8?q?Helper=20do=20nazw=20utwor=F3w.=20Przycisk?= =?utf8?q?=20do=20wydzielania.?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- apps/explorer/fixtures/przyciski.xml | 48 +++++++++++++++++++++ apps/explorer/templatetags/__init__.py | 0 apps/explorer/templatetags/explorer_tags.py | 14 ++++++ 3 files changed, 62 insertions(+) create mode 100755 apps/explorer/templatetags/__init__.py create mode 100755 apps/explorer/templatetags/explorer_tags.py diff --git a/apps/explorer/fixtures/przyciski.xml b/apps/explorer/fixtures/przyciski.xml index 2065b151..afa1deb2 100755 --- a/apps/explorer/fixtures/przyciski.xml +++ b/apps/explorer/fixtures/przyciski.xml @@ -192,6 +192,19 @@ + + Wydziel + split-text-from-xmleditor + [] + show_splitmodal + + + 0 + + + + + Zamień cudzysłowy zamien-cudzyslowy @@ -1177,4 +1190,39 @@ if (!text) { panel.fireEvent('contentChanged'); + + var cm = panel.texteditor; + +cm.focus(); + +var text = cm.selection(); + +if(!text) return; + + + +cm.replaceSelection('<include-tag-placeholder />'); + +var fulltext = cm.getCode(); + + + +$('#split-dialog').jqmShow({ + + selection: text, fulltext: fulltext, + + success: function(uri) { + + editor.refreshPanels(); + + }, + + failure: function() { cm.undo(); } + +}) ; + + + + + diff --git a/apps/explorer/templatetags/__init__.py b/apps/explorer/templatetags/__init__.py new file mode 100755 index 00000000..e69de29b diff --git a/apps/explorer/templatetags/explorer_tags.py b/apps/explorer/templatetags/explorer_tags.py new file mode 100755 index 00000000..a797b3a2 --- /dev/null +++ b/apps/explorer/templatetags/explorer_tags.py @@ -0,0 +1,14 @@ +from django import template +# from toolbar import models +register = template.Library() + +from django.template.defaultfilters import stringfilter + +@register.filter(name='bookname') +@stringfilter +def bookname(fileid): + return ', '.join(\ + ' '.join(s.capitalize() for s in part.split('_'))\ + for part in fileid.split('$')) + + -- 2.20.1