From: Łukasz Rekucki Date: Fri, 11 Sep 2009 14:14:37 +0000 (+0200) Subject: Helper do nazw utworów. X-Git-Url: https://git.mdrn.pl/redakcja.git/commitdiff_plain/37c9ca34d7edb368cd080149cea73221a8d29f90?ds=sidebyside;hp=--cc Helper do nazw utworów. Przycisk do wydzielania. --- 37c9ca34d7edb368cd080149cea73221a8d29f90 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('$')) + +