Refaktor przyciskow.
authorŁukasz Rekucki <lrekucki@gmail.com>
Wed, 9 Sep 2009 14:32:14 +0000 (16:32 +0200)
committerŁukasz Rekucki <lrekucki@gmail.com>
Wed, 9 Sep 2009 14:32:14 +0000 (16:32 +0200)
Refaktor paneli.
Dodanie przycisku wyswietlajace widok do wydruku. Closes #100.
Scriptlet 'insert_stanza'. Closes #95.

18 files changed:
apps/explorer/admin.py [new file with mode: 0644]
apps/explorer/models.py
apps/explorer/views.py
apps/toolbar/admin.py
apps/toolbar/models.py
apps/toolbar/templates/toolbar/button.html [new file with mode: 0755]
apps/toolbar/templates/toolbar/toolbar.html
apps/toolbar/templatetags/toolbar_tags.py
fixtures/przyciski.xml
project/admin.py [deleted file]
project/static/css/master.css
project/static/css/toolbar.css
project/static/js/editor.js
project/templates/explorer/editor.html
project/templates/explorer/panels/dceditor.html
project/templates/explorer/panels/htmleditor.html
project/templates/explorer/panels/xmleditor.html
project/urls.py

diff --git a/apps/explorer/admin.py b/apps/explorer/admin.py
new file mode 100644 (file)
index 0000000..e4389e0
--- /dev/null
@@ -0,0 +1,8 @@
+from django.contrib import admin
+from django.utils.translation import ugettext_lazy as _
+
+import explorer.models
+
+admin.site.register(explorer.models.EditorSettings)
+admin.site.register(explorer.models.Book)
+admin.site.register(explorer.models.EditorPanel)
\ No newline at end of file
index f292283..0927152 100644 (file)
@@ -5,8 +5,9 @@ from django.contrib.auth.models import User
 from django.conf import settings
 from django.utils.translation import gettext_lazy as _
 
 from django.conf import settings
 from django.utils.translation import gettext_lazy as _
 
-from explorer import fields
+import toolbar.models
 
 
+from explorer import fields
 
 class EditorSettings(models.Model):
     user = models.ForeignKey(User, unique=True)
 
 class EditorSettings(models.Model):
     user = models.ForeignKey(User, unique=True)
@@ -18,7 +19,17 @@ class EditorSettings(models.Model):
     def __unicode__(self):
         return u"Editor settings for %s" % self.user.username
 
     def __unicode__(self):
         return u"Editor settings for %s" % self.user.username
 
+class EditorPanel(models.Model):
+    id = models.CharField(max_length=24, primary_key=True)
+    display_name = models.CharField(max_length=128)
+
+    toolbar_groups = models.ManyToManyField(toolbar.models.ButtonGroup, blank=True)
+    toolbar_extra = models.ForeignKey(toolbar.models.ButtonGroup, null=True, blank=True,
+        unique=True, related_name='main_editor_panels')
 
 
+    def __unicode__(self):
+        return self.display_name
+    
 class Book(models.Model):
     class Meta:
         permissions = (
 class Book(models.Model):
     class Meta:
         permissions = (
index b3cc09b..7f99b66 100644 (file)
@@ -10,9 +10,10 @@ from django.conf import settings
 from django.contrib.auth.decorators import login_required, permission_required
 
 from django.core.urlresolvers import reverse
 from django.contrib.auth.decorators import login_required, permission_required
 
 from django.core.urlresolvers import reverse
-from django.http import HttpResponseRedirect, HttpResponse
+from django.http import HttpResponseRedirect, HttpResponse, HttpResponseNotFound
 from django.utils import simplejson as json
 from django.views.generic.simple import direct_to_template
 from django.utils import simplejson as json
 from django.views.generic.simple import direct_to_template
+from django.contrib.auth.decorators import login_required
 
 from explorer import forms, models
 from toolbar import models as toolbar_models
 
 from explorer import forms, models
 from toolbar import models as toolbar_models
@@ -350,66 +351,93 @@ def display_editor(request, path, repo):
         repo.with_wlock(ensure_branch_exists)
         
         return direct_to_template(request, 'explorer/editor.html', extra_context={
         repo.with_wlock(ensure_branch_exists)
         
         return direct_to_template(request, 'explorer/editor.html', extra_context={
-            'hash': path,
+            'fileid': path,
             'panel_list': ['lewy', 'prawy'],
             'panel_list': ['lewy', 'prawy'],
+            'availble_panels': models.EditorPanel.objects.all(),
             'scriptlets': toolbar_models.Scriptlet.objects.all()
         })
     except KeyError:
         return direct_to_template(request, 'explorer/nofile.html', \
             'scriptlets': toolbar_models.Scriptlet.objects.all()
         })
     except KeyError:
         return direct_to_template(request, 'explorer/nofile.html', \
-            extra_context = { 'path': path })
+            extra_context = { 'fileid': path })
 
 # ===============
 # = Panel views =
 # ===============
 
 # ===============
 # = Panel views =
 # ===============
+class panel_view(object):
 
 
-@ajax_login_required
-@with_repo
-def xmleditor_panel(request, path, repo):
-    text = repo.get_file(path, file_branch(path, request.user))
-    
-    return direct_to_template(request, 'explorer/panels/xmleditor.html', extra_context={
-        'fpath': path,
-        'text': text,
-    })
-    
+    def __new__(cls, request, name, path, **kwargs):
+    #try:        
+        panel = models.EditorPanel.objects.get(id=name)
+        method = getattr(cls, name + '_panel', None)
+        if not panel or method is None:
+            raise HttpResponseNotFound
 
 
-@ajax_login_required
-def gallery_panel(request, path):
-    return direct_to_template(request, 'explorer/panels/gallery.html', extra_context={
-        'fpath': path,
-        'form': forms.ImageFoldersForm(),
-    })
+        extra_context = method(request, path, panel, **kwargs)
 
 
-@ajax_login_required
-@with_repo
-def htmleditor_panel(request, path, repo):
-    user_branch = file_branch(path, request.user)
-    try:
-        return direct_to_template(request, 'explorer/panels/htmleditor.html', extra_context={
-            'fpath': path,
-            'html': html.transform(repo.get_file(path, user_branch), is_file=False),
+        if not isinstance(extra_context, dict):
+            return extra_context
+
+        extra_context.update({
+            'toolbar_groups': panel.toolbar_groups.all(),
+            'toolbar_extra_group': panel.toolbar_extra,
+            'fileid': path
         })
         })
-    except (ParseError, ValidationError), e:
-        return direct_to_template(request, 'explorer/panels/parse_error.html', extra_context={
-            'fpath': path, 'exception_type': type(e).__name__, 'exception': e, 'panel_name': 'Edytor HTML'}) 
 
 
-@ajax_login_required
+        return direct_to_template(request, 'explorer/panels/'+name+'.html',\
+            extra_context=extra_context)
+
+    @staticmethod
+    @ajax_login_required
+    @with_repo
+    def xmleditor_panel(request, path, panel, repo):
+        return {'text': repo.get_file(path, file_branch(path, request.user))}
+
+    @staticmethod
+    @ajax_login_required
+    def gallery_panel(request, path, panel):
+        return {'form': forms.ImageFoldersForm() }
+
+    @staticmethod
+    @ajax_login_required
+    @with_repo
+    def htmleditor_panel(request, path, panel, repo):
+        user_branch = file_branch(path, request.user)
+        try:
+            return {'html': html.transform(repo.get_file(path, user_branch), is_file=False)}
+        except (ParseError, ValidationError), e:
+            return direct_to_template(request, 'explorer/panels/parse_error.html', extra_context={
+            'fileid': path, 'exception_type': type(e).__name__, 'exception': e,
+            'panel_name': panel.display_name})
+
+    @staticmethod
+    @ajax_login_required
+    @with_repo
+    def dceditor_panel(request, path, panel, repo):
+        user_branch = file_branch(path, request.user)
+        try:
+            doc_text = repo.get_file(path, user_branch)
+            document = parser.WLDocument.from_string(doc_text)
+            form = forms.DublinCoreForm(info=document.book_info)
+            return {'form': form}
+        except (ParseError, ValidationError), e:
+            return direct_to_template(request, 'explorer/panels/parse_error.html', extra_context={
+            'fileid': path, 'exception_type': type(e).__name__, 'exception': e,
+            'panel_name': panel.display_name})
+
+
+@login_required
 @with_repo
 @with_repo
-def dceditor_panel(request, path, repo):
+def print_html(request, path, repo):
     user_branch = file_branch(path, request.user)
     user_branch = file_branch(path, request.user)
+    return HttpResponse( 
+        html.transform(repo.get_file(path, user_branch), is_file=False),
+        mimetype="text/html")
 
 
-    try:
-        doc_text = repo.get_file(path, user_branch)
-        document = parser.WLDocument.from_string(doc_text)
-        form = forms.DublinCoreForm(info=document.book_info)       
-        return direct_to_template(request, 'explorer/panels/dceditor.html', extra_context={
-            'fpath': path,
-            'form': form,
-        })
-    except (ParseError, ValidationError), e:
-        return direct_to_template(request, 'explorer/panels/parse_error.html', extra_context={
-            'fpath': path, 'exception_type': type(e).__name__, 'exception': e, 
-            'panel_name': 'Edytor DublinCore'}) 
+@login_required
+@with_repo
+def print_xml(request, path, repo):
+    user_branch = file_branch(path, request.user)
+    return HttpResponse( repo.get_file(path, user_branch), mimetype="text/plain; charset=utf-8")
 
 # =================
 # = Utility views =
 
 # =================
 # = Utility views =
index dca934c..4f03702 100644 (file)
@@ -11,13 +11,13 @@ from toolbar import models
 #    prepopulated_fields = {'slug': ('name',)}
 #    list_editable = ('position',)
 
 #    prepopulated_fields = {'slug': ('name',)}
 #    list_editable = ('position',)
 
-
 class KeyModSelector(forms.MultiWidget):
     def __init__(self):
         super(KeyModSelector, self).__init__(
             [forms.CheckboxInput() for x in xrange(0,3)])
 
     def decompress(self, v):
 class KeyModSelector(forms.MultiWidget):
     def __init__(self):
         super(KeyModSelector, self).__init__(
             [forms.CheckboxInput() for x in xrange(0,3)])
 
     def decompress(self, v):
+        if not v: v = 0
         r = [(v&0x01) != 0, (v&0x02) != 0, (v&0x04) != 0]
         print "DECOMPRESS: " , v, repr(r)
         return r
         r = [(v&0x01) != 0, (v&0x02) != 0, (v&0x04) != 0]
         print "DECOMPRESS: " , v, repr(r)
         return r
index 004fde9..8d123fd 100644 (file)
@@ -19,8 +19,9 @@ class Button(models.Model):
     slug = models.SlugField(unique=True) #unused
 
     # behaviour
     slug = models.SlugField(unique=True) #unused
 
     # behaviour
-    params = models.TextField() # TODO: should be a JSON field
-    scriptlet = models.ForeignKey('Scriptlet')
+    params = models.TextField(default='[]') # TODO: should be a JSON field
+    scriptlet = models.ForeignKey('Scriptlet', null=True, blank=True)
+    link = models.CharField(max_length=256, blank=True, default='')
 
     # ui related stuff
     key = models.CharField(blank=True, max_length=1)
 
     # ui related stuff
     key = models.CharField(blank=True, max_length=1)
diff --git a/apps/toolbar/templates/toolbar/button.html b/apps/toolbar/templates/toolbar/button.html
new file mode 100755 (executable)
index 0000000..6ed4c85
--- /dev/null
@@ -0,0 +1,13 @@
+{% if button.link %}\r
+<a href="{{button.link}}" target="_new">\r
+{% endif %}\r
+<button type="button"\r
+        ui:action="{{ button.scriptlet.name }}"\r
+        ui:action-params="{{ button.params|escape }}"\r
+        {% if button.key %}ui:hotkey="{{ button.hotkey_code }}"{% endif %}\r
+        {% if button.tooltip %}ui:tooltip="{{ button.tooltip }}"{% endif %} >\r
+        {{ button.label|safe }}\r
+</button>\r
+{% if button.link %}\r
+</a>\r
+{% endif %}
\ No newline at end of file
index a6241d1..b0ee028 100644 (file)
@@ -1,9 +1,16 @@
 {% load toolbar_tags %}
 <div class="toolbar" xmlns:ui="http://nowoczesnapolska.org.pl/platforma/ui">
     
 {% load toolbar_tags %}
 <div class="toolbar" xmlns:ui="http://nowoczesnapolska.org.pl/platforma/ui">
     
+    {# This div will be connected to the right place #}
+    <span class="panel-toolbar-extra">
+    {% for button in toolbar_extra_group.button_set.all %}
+    {% toolbar_button button %}
+    {% endfor %} 
+    </span>
+
     <div class="toolbar-tabs-container">
     <p>
     <div class="toolbar-tabs-container">
     <p>
-        {% for group in groups %}
+        {% for group in toolbar_groups %}
         <button ui:group="{{ group.slug }}" {% if forloop.first %}class="active"{% endif %}>
             {{ group.name }}
         </button>
         <button ui:group="{{ group.slug }}" {% if forloop.first %}class="active"{% endif %}>
             {{ group.name }}
         </button>
     </div>
 
     <div class="toolbar-button-groups-container">
     </div>
 
     <div class="toolbar-button-groups-container">
-        {% for group in groups %}        
+        {% for group in toolbar_groups %}
         <p ui:group="{{group.slug}}" class="toolbar-buttons-container" {% if not forloop.first %}style="display:none;"{% endif %}>
             {# buttons for this group #}            
             {% for button in group.button_set.all %}
         <p ui:group="{{group.slug}}" class="toolbar-buttons-container" {% if not forloop.first %}style="display:none;"{% endif %}>
             {# buttons for this group #}            
             {% for button in group.button_set.all %}
-            <button type="button" 
-                ui:action="{{ button.scriptlet.name }}"
-                ui:action-params="{{ button.params|escape }}"
-                {% if button.key %}ui:hotkey="{{ button.hotkey_code }}"{% endif %}
-                {% if button.tooltip %}ui:tooltip="{{ button.tooltip }}"{% endif %} >
-            {{ button.label|safe }}
-            </button>
+            {% toolbar_button button %}
             {% endfor %}
         </p>
         {% endfor %}
             {% endfor %}
         </p>
         {% endfor %}
index a38ed01..9957a93 100644 (file)
@@ -1,9 +1,12 @@
 from django import template
 from django import template
-from toolbar import models
+from toolbar import models
 
 register = template.Library()
 
 @register.inclusion_tag('toolbar/toolbar.html')
 
 register = template.Library()
 
 @register.inclusion_tag('toolbar/toolbar.html')
-def toolbar():
-    groups = models.ButtonGroup.objects.all()
-    return {'groups': groups}
+def toolbar(groups, extra):
+    return {'toolbar_groups': groups, 'toolbar_extra_group': extra}
+
+@register.inclusion_tag('toolbar/button.html')
+def toolbar_button(b):
+    return {'button': b}
index ec2acab..2065b15 100755 (executable)
-<?xml version="1.0" encoding="utf-8"?>\r
-<django-objects version="1.0">\r
-  <object pk="14" model="toolbar.buttongroup">\r
-    <field type="CharField" name="name">Akapity i długie cytaty</field>\r
-    <field type="SlugField" name="slug">akapity-i-dlugie-cytaty</field>\r
-    <field type="IntegerField" name="position">0</field>\r
-  </object>\r
-  <object pk="2" model="toolbar.buttongroup">\r
-    <field type="CharField" name="name">Autokorekta</field>\r
-    <field type="SlugField" name="slug">autokorekta</field>\r
-    <field type="IntegerField" name="position">0</field>\r
-  </object>\r
-  <object pk="21" model="toolbar.buttongroup">\r
-    <field type="CharField" name="name">Bloki</field>\r
-    <field type="SlugField" name="slug">bloki</field>\r
-    <field type="IntegerField" name="position">0</field>\r
-  </object>\r
-  <object pk="12" model="toolbar.buttongroup">\r
-    <field type="CharField" name="name">Dramat wierszowany</field>\r
-    <field type="SlugField" name="slug">dramat-wierszowany</field>\r
-    <field type="IntegerField" name="position">0</field>\r
-  </object>\r
-  <object pk="18" model="toolbar.buttongroup">\r
-    <field type="CharField" name="name">Dramat współczesny</field>\r
-    <field type="SlugField" name="slug">dramat-wspolczesny</field>\r
-    <field type="IntegerField" name="position">0</field>\r
-  </object>\r
-  <object pk="13" model="toolbar.buttongroup">\r
-    <field type="CharField" name="name">Elementy początkowe</field>\r
-    <field type="SlugField" name="slug">elementy-poczatkowe</field>\r
-    <field type="IntegerField" name="position">0</field>\r
-  </object>\r
-  <object pk="1" model="toolbar.buttongroup">\r
-    <field type="CharField" name="name">Nagłówki</field>\r
-    <field type="SlugField" name="slug">naglowki</field>\r
-    <field type="IntegerField" name="position">0</field>\r
-  </object>\r
-  <object pk="22" model="toolbar.buttongroup">\r
-    <field type="CharField" name="name">Początek dramatu</field>\r
-    <field type="SlugField" name="slug">poczatek-dramatu</field>\r
-    <field type="IntegerField" name="position">0</field>\r
-  </object>\r
-  <object pk="16" model="toolbar.buttongroup">\r
-    <field type="CharField" name="name">Polecenia</field>\r
-    <field type="SlugField" name="slug">polecenia</field>\r
-    <field type="IntegerField" name="position">0</field>\r
-  </object>\r
-  <object pk="11" model="toolbar.buttongroup">\r
-    <field type="CharField" name="name">Strukturalne</field>\r
-    <field type="SlugField" name="slug">strukturalne</field>\r
-    <field type="IntegerField" name="position">0</field>\r
-  </object>\r
-  <object pk="15" model="toolbar.buttongroup">\r
-    <field type="CharField" name="name">Style znakowe</field>\r
-    <field type="SlugField" name="slug">style-znakowe</field>\r
-    <field type="IntegerField" name="position">0</field>\r
-  </object>\r
-  <object pk="17" model="toolbar.buttongroup">\r
-    <field type="CharField" name="name">Wersy</field>\r
-    <field type="SlugField" name="slug">wersy</field>\r
-    <field type="IntegerField" name="position">0</field>\r
-  </object>\r
-  <object pk="3" model="toolbar.buttongroup">\r
-    <field type="CharField" name="name">Widok</field>\r
-    <field type="SlugField" name="slug">display_options</field>\r
-    <field type="IntegerField" name="position">2</field>\r
-  </object>\r
-  <object pk="5" model="toolbar.button">\r
-    <field type="CharField" name="label">A&lt;sup&gt;+&lt;/sup&gt;</field>\r
-    <field type="SlugField" name="slug">increase_font_size</field>\r
-    <field type="TextField" name="params">{"change": 2}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">codemirror_fontsize</field>\r
-    <field type="CharField" name="key">+</field>\r
-    <field type="CharField" name="tooltip">Zwiększ rozmiar czcionki.</field>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="3"/>\r
-    </field>\r
-  </object>\r
-  <object pk="6" model="toolbar.button">\r
-    <field type="CharField" name="label">A&lt;sup&gt;-&lt;/sup&gt;</field>\r
-    <field type="SlugField" name="slug">descrease_font_size</field>\r
-    <field type="TextField" name="params">{"change": -2}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">codemirror_fontsize</field>\r
-    <field type="CharField" name="key">-</field>\r
-    <field type="CharField" name="tooltip">Zmniejsz rozmiar czcionki.</field>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="3"/>\r
-    </field>\r
-  </object>\r
-  <object pk="7" model="toolbar.button">\r
-    <field type="CharField" name="label">A&lt;sup&gt;=&lt;/sup&gt;</field>\r
-    <field type="SlugField" name="slug">reset_font_size</field>\r
-    <field type="TextField" name="params">{"fontSize": 13}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">codemirror_fontsize</field>\r
-    <field type="CharField" name="key">=</field>\r
-    <field type="CharField" name="tooltip">Przywróć orginalny rozmiar czcionki.</field>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="3"/>\r
-    </field>\r
-  </object>\r
-  <object pk="76" model="toolbar.button">\r
-    <field type="CharField" name="label">A&lt;sup&gt;↓&lt;/sup&gt;</field>\r
-    <field type="SlugField" name="slug">tolowercase</field>\r
-    <field type="TextField" name="params">[]</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">lowercase</field>\r
-    <field type="CharField" name="key">u</field>\r
-    <field type="CharField" name="tooltip">Zamień wielkie litery na małe.</field>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="15"/>\r
-    </field>\r
-  </object>\r
-  <object pk="39" model="toolbar.button">\r
-    <field type="CharField" name="label">akapit</field>\r
-    <field type="SlugField" name="slug">akapit</field>\r
-    <field type="TextField" name="params">{"tag": "akap"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="14"/>\r
-    </field>\r
-  </object>\r
-  <object pk="40" model="toolbar.button">\r
-    <field type="CharField" name="label">akapit cd.</field>\r
-    <field type="SlugField" name="slug">akapit-cd</field>\r
-    <field type="TextField" name="params">{"tag": "akap_cd"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="14"/>\r
-    </field>\r
-  </object>\r
-  <object pk="41" model="toolbar.button">\r
-    <field type="CharField" name="label">akapit dialogowy</field>\r
-    <field type="SlugField" name="slug">akapit-dialogowy</field>\r
-    <field type="TextField" name="params">{"tag": "akap_dialog"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="14"/>\r
-    </field>\r
-  </object>\r
-  <object pk="14" model="toolbar.button">\r
-    <field type="CharField" name="label">akt</field>\r
-    <field type="SlugField" name="slug">akt</field>\r
-    <field type="TextField" name="params">{"tag": "akt"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="1"/>\r
-    </field>\r
-  </object>\r
-  <object pk="32" model="toolbar.button">\r
-    <field type="CharField" name="label">autor</field>\r
-    <field type="SlugField" name="slug">autor</field>\r
-    <field type="TextField" name="params">{"tag": "autor"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="13"/>\r
-    </field>\r
-  </object>\r
-  <object pk="10" model="toolbar.button">\r
-    <field type="CharField" name="label">część/księga</field>\r
-    <field type="SlugField" name="slug">czesc</field>\r
-    <field type="TextField" name="params">{"tag": "naglowek_czesc"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="1"/>\r
-    </field>\r
-  </object>\r
-  <object pk="74" model="toolbar.button">\r
-    <field type="CharField" name="label">dedykacja</field>\r
-    <field type="SlugField" name="slug">dedykacja</field>\r
-    <field type="TextField" name="params">{"tag": "dedykacja"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="13"/>\r
-      <object pk="22"/>\r
-    </field>\r
-  </object>\r
-  <object pk="62" model="toolbar.button">\r
-    <field type="CharField" name="label">didaskalia</field>\r
-    <field type="SlugField" name="slug">didaskalia</field>\r
-    <field type="TextField" name="params">{"tag": "didaskalia"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="12"/>\r
-      <object pk="18"/>\r
-    </field>\r
-  </object>\r
-  <object pk="79" model="toolbar.button">\r
-    <field type="CharField" name="label">didaskalia początkowe</field>\r
-    <field type="SlugField" name="slug">didaskalia-poczatkowe</field>\r
-    <field type="TextField" name="params">{"tag": "miejsce_czas"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="22"/>\r
-    </field>\r
-  </object>\r
-  <object pk="63" model="toolbar.button">\r
-    <field type="CharField" name="label">didaskalia wewn.</field>\r
-    <field type="SlugField" name="slug">didaskalia-wewn</field>\r
-    <field type="TextField" name="params">{"tag": "didask_tekst"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="18"/>\r
-      <object pk="15"/>\r
-    </field>\r
-  </object>\r
-  <object pk="20" model="toolbar.button">\r
-    <field type="CharField" name="label">dramat wiersz.</field>\r
-    <field type="SlugField" name="slug">dramat-wiersz</field>\r
-    <field type="TextField" name="params">{"tag": "dramat_wierszowany_l"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="11"/>\r
-    </field>\r
-  </object>\r
-  <object pk="22" model="toolbar.button">\r
-    <field type="CharField" name="label">dramat wiersz./w. łam</field>\r
-    <field type="SlugField" name="slug">dramat-wiersz-w-lam</field>\r
-    <field type="TextField" name="params">{"tag": "dramat_wierszowany_lp"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="11"/>\r
-    </field>\r
-  </object>\r
-  <object pk="21" model="toolbar.button">\r
-    <field type="CharField" name="label">dramat współczesny</field>\r
-    <field type="SlugField" name="slug">dramat-wspolczesny</field>\r
-    <field type="TextField" name="params">{"tag": "dramat_wspolczesny"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="11"/>\r
-    </field>\r
-  </object>\r
-  <object pk="38" model="toolbar.button">\r
-    <field type="CharField" name="label">dzieło nadrzędne</field>\r
-    <field type="SlugField" name="slug">dzielo-nadrzedne</field>\r
-    <field type="TextField" name="params">{"tag": "dzielo_nadrzedne"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="13"/>\r
-    </field>\r
-  </object>\r
-  <object pk="67" model="toolbar.button">\r
-    <field type="CharField" name="label">długi cyt. poet.</field>\r
-    <field type="SlugField" name="slug">dlugi-cyt-poet</field>\r
-    <field type="TextField" name="params">{"tag": "poezja_cyt"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="14"/>\r
-      <object pk="21"/>\r
-    </field>\r
-  </object>\r
-  <object pk="42" model="toolbar.button">\r
-    <field type="CharField" name="label">długi cytat</field>\r
-    <field type="SlugField" name="slug">dlugi-cytat</field>\r
-    <field type="TextField" name="params">{"tag": "dlugi_cyt"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="14"/>\r
-      <object pk="21"/>\r
-    </field>\r
-  </object>\r
-  <object pk="52" model="toolbar.button">\r
-    <field type="CharField" name="label">ekstra</field>\r
-    <field type="SlugField" name="slug">ekstra</field>\r
-    <field type="TextField" name="params">{"tag": "ekstra"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="15"/>\r
-    </field>\r
-  </object>\r
-  <object pk="82" model="toolbar.button">\r
-    <field type="CharField" name="label">kwestia</field>\r
-    <field type="SlugField" name="slug">kwestia</field>\r
-    <field type="TextField" name="params">{"tag": "kwestia"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="12"/>\r
-      <object pk="18"/>\r
-    </field>\r
-  </object>\r
-  <object pk="23" model="toolbar.button">\r
-    <field type="CharField" name="label">liryka</field>\r
-    <field type="SlugField" name="slug">liryka</field>\r
-    <field type="TextField" name="params">{"tag": "liryka_l"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="11"/>\r
-    </field>\r
-  </object>\r
-  <object pk="24" model="toolbar.button">\r
-    <field type="CharField" name="label">liryka/w. łam</field>\r
-    <field type="SlugField" name="slug">liryka-w-lam</field>\r
-    <field type="TextField" name="params">{"tag": "liryka_lp"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="11"/>\r
-    </field>\r
-  </object>\r
-  <object pk="78" model="toolbar.button">\r
-    <field type="CharField" name="label">lista osób: pole</field>\r
-    <field type="SlugField" name="slug">lista-osob-pole</field>\r
-    <field type="TextField" name="params">{"tag": "lista_osoba", "attrs": {"typ": ""}}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="22"/>\r
-    </field>\r
-  </object>\r
-  <object pk="47" model="toolbar.button">\r
-    <field type="CharField" name="label">mamtemat.</field>\r
-    <field type="SlugField" name="slug">matemat</field>\r
-    <field type="TextField" name="params">{"tag": "mat"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="15"/>\r
-    </field>\r
-  </object>\r
-  <object pk="75" model="toolbar.button">\r
-    <field type="CharField" name="label">motto</field>\r
-    <field type="SlugField" name="slug">motto</field>\r
-    <field type="TextField" name="params">{"tag": "motto"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="13"/>\r
-      <object pk="22"/>\r
-    </field>\r
-  </object>\r
-  <object pk="37" model="toolbar.button">\r
-    <field type="CharField" name="label">motto podpis</field>\r
-    <field type="SlugField" name="slug">motto-podpis</field>\r
-    <field type="TextField" name="params">{"tag": "motto_podpis"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="13"/>\r
-    </field>\r
-  </object>\r
-  <object pk="16" model="toolbar.button">\r
-    <field type="CharField" name="label">nagłówek kwestii</field>\r
-    <field type="SlugField" name="slug">naglowek-kwestii</field>\r
-    <field type="TextField" name="params">{"tag": "naglowek_osoba"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="1"/>\r
-    </field>\r
-  </object>\r
-  <object pk="35" model="toolbar.button">\r
-    <field type="CharField" name="label">nota</field>\r
-    <field type="SlugField" name="slug">nota</field>\r
-    <field type="TextField" name="params">{"tag": "nota"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="13"/>\r
-    </field>\r
-  </object>\r
-  <object pk="18" model="toolbar.button">\r
-    <field type="CharField" name="label">opowiadanie</field>\r
-    <field type="SlugField" name="slug">opowiadanie</field>\r
-    <field type="TextField" name="params">{"tag": "opowiadanie"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="11"/>\r
-    </field>\r
-  </object>\r
-  <object pk="64" model="toolbar.button">\r
-    <field type="CharField" name="label">osoba</field>\r
-    <field type="SlugField" name="slug">osoba</field>\r
-    <field type="TextField" name="params">{"tag": "osoba"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="18"/>\r
-      <object pk="15"/>\r
-    </field>\r
-  </object>\r
-  <object pk="12" model="toolbar.button">\r
-    <field type="CharField" name="label">podrozdział</field>\r
-    <field type="SlugField" name="slug">podrozdzial</field>\r
-    <field type="TextField" name="params">{"tag": "naglowek_podrozdzial"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="1"/>\r
-    </field>\r
-  </object>\r
-  <object pk="4" model="toolbar.button">\r
-    <field type="CharField" name="label">Podstawowa</field>\r
-    <field type="SlugField" name="slug">basic_correction</field>\r
-    <field type="TextField" name="params">{"exprs": [["\n\\d+\n", "\n"], ["-\\s*\n+", ""], ["\\,\\.\\.|\\.\\,\\.|\\.\\.\\,", "..."]]}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">fulltextregexp</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip">Wykonuję operację z novel-pages i poem-pages.</field>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="2"/>\r
-    </field>\r
-  </object>\r
-  <object pk="34" model="toolbar.button">\r
-    <field type="CharField" name="label">podtytuł</field>\r
-    <field type="SlugField" name="slug">podtytul</field>\r
-    <field type="TextField" name="params">{"tag": "podtytul"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="13"/>\r
-    </field>\r
-  </object>\r
-  <object pk="19" model="toolbar.button">\r
-    <field type="CharField" name="label">powieść</field>\r
-    <field type="SlugField" name="slug">powiesc</field>\r
-    <field type="TextField" name="params">{"tag": "powiesc"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="11"/>\r
-    </field>\r
-  </object>\r
-  <object pk="68" model="toolbar.button">\r
-    <field type="CharField" name="label">przypis autorski</field>\r
-    <field type="SlugField" name="slug">przypis-autorski</field>\r
-    <field type="TextField" name="params">{"tag": "pa"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="21"/>\r
-    </field>\r
-  </object>\r
-  <object pk="71" model="toolbar.button">\r
-    <field type="CharField" name="label">przypis edytorski</field>\r
-    <field type="SlugField" name="slug">przypis-edytorski</field>\r
-    <field type="TextField" name="params">{"tag": "pe"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="21"/>\r
-    </field>\r
-  </object>\r
-  <object pk="70" model="toolbar.button">\r
-    <field type="CharField" name="label">przypis redaktorski</field>\r
-    <field type="SlugField" name="slug">przypis-redaktorski</field>\r
-    <field type="TextField" name="params">{"tag": "pr"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="21"/>\r
-    </field>\r
-  </object>\r
-  <object pk="69" model="toolbar.button">\r
-    <field type="CharField" name="label">przypis tłumacza</field>\r
-    <field type="SlugField" name="slug">przypis-tlumacza</field>\r
-    <field type="TextField" name="params">{"tag": "pt"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="21"/>\r
-    </field>\r
-  </object>\r
-  <object pk="11" model="toolbar.button">\r
-    <field type="CharField" name="label">rozdział</field>\r
-    <field type="SlugField" name="slug">rozdzial</field>\r
-    <field type="TextField" name="params">{"tag": "naglowek_rozdzial"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="1"/>\r
-    </field>\r
-  </object>\r
-  <object pk="15" model="toolbar.button">\r
-    <field type="CharField" name="label">scena</field>\r
-    <field type="SlugField" name="slug">scena</field>\r
-    <field type="TextField" name="params">{"tag": "naglowek_scena"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="1"/>\r
-    </field>\r
-  </object>\r
-  <object pk="54" model="toolbar.button">\r
-    <field type="CharField" name="label">sep. asteryks</field>\r
-    <field type="SlugField" name="slug">sep-asteryks</field>\r
-    <field type="TextField" name="params">{"tag": "sekcja_asteryks"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="16"/>\r
-    </field>\r
-  </object>\r
-  <object pk="55" model="toolbar.button">\r
-    <field type="CharField" name="label">sep. linia</field>\r
-    <field type="SlugField" name="slug">sep-linia</field>\r
-    <field type="TextField" name="params">{"tag": "separator_linia"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="16"/>\r
-    </field>\r
-  </object>\r
-  <object pk="53" model="toolbar.button">\r
-    <field type="CharField" name="label">sep. światło</field>\r
-    <field type="SlugField" name="slug">sep-swiatlo</field>\r
-    <field type="TextField" name="params">{"tag": "sekcja_swiatlo"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="16"/>\r
-    </field>\r
-  </object>\r
-  <object pk="13" model="toolbar.button">\r
-    <field type="CharField" name="label">śródtytuł</field>\r
-    <field type="SlugField" name="slug">srodtytul</field>\r
-    <field type="TextField" name="params">{"tag": "srodtytul"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="1"/>\r
-    </field>\r
-  </object>\r
-  <object pk="81" model="toolbar.button">\r
-    <field type="CharField" name="label">strofa</field>\r
-    <field type="SlugField" name="slug">strofa</field>\r
-    <field type="TextField" name="params">{"tag": "strofa"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key">s</field>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="12"/>\r
-      <object pk="17"/>\r
-    </field>\r
-  </object>\r
-  <object pk="46" model="toolbar.button">\r
-    <field type="CharField" name="label">słowo obce</field>\r
-    <field type="SlugField" name="slug">slowo-obce</field>\r
-    <field type="TextField" name="params">{"tag": "slowo_obce"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="15"/>\r
-    </field>\r
-  </object>\r
-  <object pk="17" model="toolbar.button">\r
-    <field type="CharField" name="label">tagi główne</field>\r
-    <field type="SlugField" name="slug">tagi-glowne</field>\r
-    <field type="TextField" name="params">{"tag": "utwor"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="11"/>\r
-    </field>\r
-  </object>\r
-  <object pk="33" model="toolbar.button">\r
-    <field type="CharField" name="label">tytuł</field>\r
-    <field type="SlugField" name="slug">tytul</field>\r
-    <field type="TextField" name="params">{"tag": "nazwa_utworu"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="13"/>\r
-    </field>\r
-  </object>\r
-  <object pk="45" model="toolbar.button">\r
-    <field type="CharField" name="label">tytuł dzieła</field>\r
-    <field type="SlugField" name="slug">tytul-dziela</field>\r
-    <field type="TextField" name="params">{"tag": "tytul_dziela", "attrs": {"typ": "1"}}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="15"/>\r
-    </field>\r
-  </object>\r
-  <object pk="3" model="toolbar.button">\r
-    <field type="CharField" name="label">Usuń spację</field>\r
-    <field type="SlugField" name="slug">strip_whitespace</field>\r
-    <field type="TextField" name="params">{"exprs": [["^\\s+|\\s+$", ""], ["\\s+", " "]]}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">lineregexp</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip">Usuwa zbędne spację z dokumentu.</field>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="2"/>\r
-    </field>\r
-  </object>\r
-  <object pk="51" model="toolbar.button">\r
-    <field type="CharField" name="label">uwaga</field>\r
-    <field type="SlugField" name="slug">uwaga</field>\r
-    <field type="TextField" name="params">{"tag": "uwaga"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="15"/>\r
-    </field>\r
-  </object>\r
-  <object pk="83" model="toolbar.button">\r
-    <field type="CharField" name="label">wers akap.</field>\r
-    <field type="SlugField" name="slug">wers-akap</field>\r
-    <field type="TextField" name="params">{"tag": "wers_akap"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="12"/>\r
-      <object pk="17"/>\r
-    </field>\r
-  </object>\r
-  <object pk="85" model="toolbar.button">\r
-    <field type="CharField" name="label">wers cd.</field>\r
-    <field type="SlugField" name="slug">wers-cd</field>\r
-    <field type="TextField" name="params">{"tag": "wers_cd"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="12"/>\r
-      <object pk="17"/>\r
-    </field>\r
-  </object>\r
-  <object pk="84" model="toolbar.button">\r
-    <field type="CharField" name="label">Wers wcięty</field>\r
-    <field type="SlugField" name="slug">wers-wciety</field>\r
-    <field type="TextField" name="params">{"tag": "wers_wciety", "attrs": {"typ": ""}}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="12"/>\r
-      <object pk="17"/>\r
-    </field>\r
-  </object>\r
-  <object pk="48" model="toolbar.button">\r
-    <field type="CharField" name="label">www</field>\r
-    <field type="SlugField" name="slug">www</field>\r
-    <field type="TextField" name="params">{"tag": "www"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="15"/>\r
-    </field>\r
-  </object>\r
-  <object pk="44" model="toolbar.button">\r
-    <field type="CharField" name="label">wyróżnienie</field>\r
-    <field type="SlugField" name="slug">wyroznienie</field>\r
-    <field type="TextField" name="params">{"tag": "wyroznienie"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="15"/>\r
-    </field>\r
-  </object>\r
-  <object pk="25" model="toolbar.button">\r
-    <field type="CharField" name="label">wywiad</field>\r
-    <field type="SlugField" name="slug">wywiad</field>\r
-    <field type="TextField" name="params">{"tag": "wywiad"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="11"/>\r
-    </field>\r
-  </object>\r
-  <object pk="73" model="toolbar.button">\r
-    <field type="CharField" name="label">wywiad odpowiedź</field>\r
-    <field type="SlugField" name="slug">wywiad-odpowiedz</field>\r
-    <field type="TextField" name="params">{"tag": "wywiad_odp"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="21"/>\r
-    </field>\r
-  </object>\r
-  <object pk="72" model="toolbar.button">\r
-    <field type="CharField" name="label">wywiad pytanie</field>\r
-    <field type="SlugField" name="slug">wywiad-pytanie</field>\r
-    <field type="TextField" name="params">{"tag": "wywiad_pyt"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="21"/>\r
-    </field>\r
-  </object>\r
-  <object pk="77" model="toolbar.button">\r
-    <field type="CharField" name="label">Zamień cudzysłowy</field>\r
-    <field type="SlugField" name="slug">zamien-cudzyslowy</field>\r
-    <field type="TextField" name="params">{"exprs": [["\u00bb|\u201e", ",,"], ["\u00ab", "\""], ["\"([\u0104\u0118\u00d3\u0141\u017b\u0179\u0106\u0143\u0105\u017c\u017a\u015b\u0144\u00f3\u0142\u0107\\w])", ",,$1"]]}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">lineregexp</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="2"/>\r
-    </field>\r
-  </object>\r
-  <object pk="2" model="toolbar.button">\r
-    <field type="CharField" name="label">Zamień dywiz</field>\r
-    <field type="SlugField" name="slug">zamien_dywiz</field>\r
-    <field type="TextField" name="params">{"exprs": [["(\\d)[\u2014-](\\d)", "$1--$2"], ["\u2014", "---"]]}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">lineregexp</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip">Zamienia '—' na '---', oraz '1—2' na '1--2'.</field>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="2"/>\r
-    </field>\r
-  </object>\r
-  <object pk="56" model="toolbar.button">\r
-    <field type="CharField" name="label">zastępnik wersu</field>\r
-    <field type="SlugField" name="slug">zastepnik-wersu</field>\r
-    <field type="TextField" name="params">{"tag": "zastepnik_wersu"}</field>\r
-    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>\r
-    <field type="CharField" name="key"/>\r
-    <field type="CharField" name="tooltip"/>\r
-    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">\r
-      <object pk="16"/>\r
-    </field>\r
-  </object>\r
-  <object pk="insert_tag" model="toolbar.scriptlet">\r
-    <field type="TextField" name="code">var texteditor = panel.texteditor;\r
-\r
-var text = texteditor.selection();\r
-\r
-var out = '&lt;'+params.tag;\r
-\r
-for (var attr in params.attrs) {\r
-\r
-    out += ' '+attr+'="' + params.attrs[attr] + '"';\r
-\r
-};\r
-\r
-out += '&gt;';\r
-\r
-out += text;\r
-\r
-out += '&lt;/' + params.tag + '&gt;';\r
-\r
\r
-\r
-texteditor.replaceSelection(out);\r
-\r
-\r
-\r
-if (text.length == 0) {\r
-\r
-    var pos = texteditor.cursorPosition();\r
-\r
-    texteditor.selectLines(pos.line, pos.character + params.tag.length + 2);\r
-\r
-}\r
-\r
-\r
-\r
-panel.fireEvent('contentChanged');</field>\r
-  </object>\r
-  <object pk="lineregexp" model="toolbar.scriptlet">\r
-    <field type="TextField" name="code">editor.showPopup('generic-info', 'Przetwarzanie zaznaczonego tekstu...', '', -1);\r
-\r
-var cm = panel.texteditor;\r
-var exprs = $.map(params.exprs, function(expr) {\r
-\r
-    var opts = "g";\r
-\r
-    if(expr.length &gt; 2)\r
-\r
-        opts = expr[2];\r
-\r
-    return {rx: new RegExp(expr[0], opts), repl: expr[1]};\r
-\r
-});\r
-\r
-\r
-\r
-var partial = true;\r
-\r
-var text = cm.selection();\r
-\r
-\r
-\r
-if(!text) {\r
-\r
-    var cpos = cm.cursorPosition();\r
-\r
-    cpos.line = cm.lineNumber(cpos.line)\r
-\r
-    cm.selectLines(cm.firstLine(), 0, cm.lastLine(), 0);\r
-\r
-    text = cm.selection();\r
-\r
-    partial = false;\r
-\r
-}\r
-\r
-\r
-\r
-var changed = 0;\r
-var lines = text.split('\n');\r
-var lines = $.map(lines, function(line) { \r
-    var old_line = line;\r
-    $(exprs).each(function() { \r
-        var expr = this;\r
-        line = line.replace(expr.rx, expr.repl);\r
-    });\r
-\r
-    if(old_line != line) changed += 1;\r
-    return line;\r
-});\r
-\r
-if(changed &gt; 0) \r
-{\r
-    cm.replaceSelection( lines.join('\n') );\r
-    panel.fireEvent('contentChanged');\r
-    editor.showPopup('generic-yes', 'Zmieniono ' + changed + ' linii.', 1500);\r
-    editor.advancePopupQueue();\r
-}\r
-else {\r
-    editor.showPopup('generic-info',  'Brak zmian w tekście', 1500);\r
-    editor.advancePopupQueue();\r
-}\r
-\r
-if(!partial)\r
-    cm.selectLines( cm.nthLine(cpos.line), cpos.character )</field>\r
-  </object>\r
-  <object pk="codemirror_fontsize" model="toolbar.scriptlet">\r
-    <field type="TextField" name="code">var texteditor = panel.texteditor;\r
-\r
-var frameBody = $('body', $(texteditor.frame).contents());\r
-\r
-\r
-\r
-if(params.fontSize) {\r
-\r
-    frameBody.css('font-size', params.fontSize);\r
-\r
-}\r
-\r
-else {\r
-\r
-    var old_size = parseInt(frameBody.css('font-size'));\r
-\r
-    frameBody.css('font-size', old_size + (params.change || 0) );\r
-\r
-}</field>\r
-  </object>\r
-  <object pk="fulltextregexp" model="toolbar.scriptlet">\r
-    <field type="TextField" name="code">editor.showPopup('generic-info', 'Przetwarzanie zaznaczonego tekstu...', '', -1);\r
-\r
-var cm = panel.texteditor;\r
-\r
-var exprs = $.map(params.exprs, function(expr) {\r
-    var opts = "mg";\r
-    if(expr.length &gt; 2)\r
-        opts = expr[2];\r
-\r
-    return {rx: new RegExp(expr[0], opts), repl: expr[1]};\r
-});\r
-\r
-var partial = true;\r
-var text = cm.selection();\r
-\r
-if(!text) {\r
-    var cpos = cm.cursorPosition();\r
-    cpos.line = cm.lineNumber(cpos.line)\r
-    cm.selectLines(cm.firstLine(), 0, cm.lastLine(), 0);\r
-\r
-    text = cm.selection();\r
-    partial = false;\r
-}\r
-\r
-\r
-\r
-var original = text;\r
-$(exprs).each(function() { \r
-    text = text.replace(this.rx, this.repl);\r
-});\r
-\r
-if( original != text) \r
-{    \r
-    cm.replaceSelection(text);\r
-    panel.fireEvent('contentChanged');\r
-    editor.showPopup('generic-yes', 'Zmieniono tekst' );\r
-    editor.advancePopupQueue();\r
-}\r
-else {\r
-    editor.showPopup('generic-info', 'Brak zmian w tekście.');\r
-    editor.advancePopupQueue();\r
-}\r
-\r
-if(!partial) {\r
-    cm.selectLines( cm.nthLine(cpos.line), cpos.character );\r
-}</field>\r
-  </object>\r
-  <object pk="macro" model="toolbar.scriptlet">\r
-    <field type="TextField" name="code">params.each(function() {\r
-\r
-    editor.callScriptlet(this[0], this[1]);\r
-\r
-});</field>\r
-  </object>\r
-  <object pk="lowercase" model="toolbar.scriptlet">\r
-    <field type="TextField" name="code">var cm = panel.texteditor;\r
-\r
-var text = cm.selection();\r
-\r
-if(!text) return;\r
-\r
-var repl = text.toLowerCase();\r
-\r
-if(repl != text) {\r
-\r
-    cm.replaceSelection(repl);\r
-\r
-    panel.fireEvent('contentChanged');\r
-\r
-};</field>\r
-  </object>\r
-</django-objects>\r
+<?xml version="1.0" encoding="utf-8"?>
+<django-objects version="1.0">
+  <object pk="23" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Dodatkowe przyciski w XMLEditor</field>
+    <field type="SlugField" name="slug">xmleditor-extra-buttons</field>
+    <field type="IntegerField" name="position">-1</field>
+  </object>
+  <object pk="24" model="toolbar.buttongroup">
+    <field type="CharField" name="name">HTMLEditor Extra</field>
+    <field type="SlugField" name="slug">htmleditor-extra</field>
+    <field type="IntegerField" name="position">-1</field>
+  </object>
+  <object pk="14" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Akapity i długie cytaty</field>
+    <field type="SlugField" name="slug">akapity-i-dlugie-cytaty</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="2" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Autokorekta</field>
+    <field type="SlugField" name="slug">autokorekta</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="21" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Bloki</field>
+    <field type="SlugField" name="slug">bloki</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="12" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Dramat wierszowany</field>
+    <field type="SlugField" name="slug">dramat-wierszowany</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="18" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Dramat współczesny</field>
+    <field type="SlugField" name="slug">dramat-wspolczesny</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="13" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Elementy początkowe</field>
+    <field type="SlugField" name="slug">elementy-poczatkowe</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="1" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Nagłówki</field>
+    <field type="SlugField" name="slug">naglowki</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="22" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Początek dramatu</field>
+    <field type="SlugField" name="slug">poczatek-dramatu</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="16" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Polecenia</field>
+    <field type="SlugField" name="slug">polecenia</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="11" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Strukturalne</field>
+    <field type="SlugField" name="slug">strukturalne</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="15" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Style znakowe</field>
+    <field type="SlugField" name="slug">style-znakowe</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="17" model="toolbar.buttongroup">
+    <field type="CharField" name="name">Wersy</field>
+    <field type="SlugField" name="slug">wersy</field>
+    <field type="IntegerField" name="position">0</field>
+  </object>
+  <object pk="5" model="toolbar.button">
+    <field type="CharField" name="label">A&lt;sup&gt;+&lt;/sup&gt;</field>
+    <field type="SlugField" name="slug">increase_font_size</field>
+    <field type="TextField" name="params">{"change": 2}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">codemirror_fontsize</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip">Zwiększ rozmiar czcionki.</field>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="23"/>
+    </field>
+  </object>
+  <object pk="6" model="toolbar.button">
+    <field type="CharField" name="label">A&lt;sup&gt;-&lt;/sup&gt;</field>
+    <field type="SlugField" name="slug">descrease_font_size</field>
+    <field type="TextField" name="params">{"change": -2}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">codemirror_fontsize</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip">Zmniejsz rozmiar czcionki.</field>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="23"/>
+    </field>
+  </object>
+  <object pk="7" model="toolbar.button">
+    <field type="CharField" name="label">A&lt;sup&gt;=&lt;/sup&gt;</field>
+    <field type="SlugField" name="slug">reset_font_size</field>
+    <field type="TextField" name="params">{"fontSize": 13}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">codemirror_fontsize</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip">Przywróć orginalny rozmiar czcionki.</field>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="23"/>
+    </field>
+  </object>
+  <object pk="76" model="toolbar.button">
+    <field type="CharField" name="label">A&lt;sup&gt;↓&lt;/sup&gt;</field>
+    <field type="SlugField" name="slug">tolowercase</field>
+    <field type="TextField" name="params">[]</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">lowercase</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key">u</field>
+    <field type="PositiveIntegerField" name="key_mod">6</field>
+    <field type="CharField" name="tooltip">Zamień wielkie litery na małe.</field>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="15"/>
+    </field>
+  </object>
+  <object pk="4" model="toolbar.button">
+    <field type="CharField" name="label">Podstawowa</field>
+    <field type="SlugField" name="slug">basic_correction</field>
+    <field type="TextField" name="params">{"exprs": [["\n\\d+\n", "\n"], ["-\\s*\n+", ""], ["\\,\\.\\.|\\.\\,\\.|\\.\\.\\,", "..."]]}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">fulltextregexp</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip">Wykonuję operację z novel-pages i poem-pages.</field>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="2"/>
+    </field>
+  </object>
+  <object pk="3" model="toolbar.button">
+    <field type="CharField" name="label">Usuń spację</field>
+    <field type="SlugField" name="slug">strip_whitespace</field>
+    <field type="TextField" name="params">{"exprs": [["^\\s+|\\s+$", ""], ["\\s+", " "]]}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">lineregexp</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip">Usuwa zbędne spację z dokumentu.</field>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="2"/>
+    </field>
+  </object>
+  <object pk="84" model="toolbar.button">
+    <field type="CharField" name="label">Wers wcięty</field>
+    <field type="SlugField" name="slug">wers-wciety</field>
+    <field type="TextField" name="params">{"tag": "wers_wciety", "attrs": {"typ": ""}}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="12"/>
+      <object pk="17"/>
+    </field>
+  </object>
+  <object pk="86" model="toolbar.button">
+    <field type="CharField" name="label">Wydrukuj</field>
+    <field type="SlugField" name="slug">print-xml</field>
+    <field type="TextField" name="params">[]</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">
+      <None/>
+    </field>
+    <field type="CharField" name="link">print/xml</field>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="23"/>
+    </field>
+  </object>
+  <object pk="87" model="toolbar.button">
+    <field type="CharField" name="label">Wydrukuj</field>
+    <field type="SlugField" name="slug">htmleditor-print</field>
+    <field type="TextField" name="params">[]</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">
+      <None/>
+    </field>
+    <field type="CharField" name="link">print/html</field>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="24"/>
+    </field>
+  </object>
+  <object pk="77" model="toolbar.button">
+    <field type="CharField" name="label">Zamień cudzysłowy</field>
+    <field type="SlugField" name="slug">zamien-cudzyslowy</field>
+    <field type="TextField" name="params">{"exprs": [["\u00bb|\u201e", ",,"], ["\u00ab", "\""], ["\"([\u0104\u0118\u00d3\u0141\u017b\u0179\u0106\u0143\u0105\u017c\u017a\u015b\u0144\u00f3\u0142\u0107\\w])", ",,$1"]]}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">lineregexp</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="2"/>
+    </field>
+  </object>
+  <object pk="2" model="toolbar.button">
+    <field type="CharField" name="label">Zamień dywiz</field>
+    <field type="SlugField" name="slug">zamien_dywiz</field>
+    <field type="TextField" name="params">{"exprs": [["(\\d)[\u2014-](\\d)", "$1--$2"], ["\u2014", "---"]]}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">lineregexp</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip">Zamienia '—' na '---', oraz '1—2' na '1--2'.</field>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="2"/>
+    </field>
+  </object>
+  <object pk="39" model="toolbar.button">
+    <field type="CharField" name="label">akapit</field>
+    <field type="SlugField" name="slug">akapit</field>
+    <field type="TextField" name="params">{"tag": "akap"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="14"/>
+    </field>
+  </object>
+  <object pk="40" model="toolbar.button">
+    <field type="CharField" name="label">akapit cd.</field>
+    <field type="SlugField" name="slug">akapit-cd</field>
+    <field type="TextField" name="params">{"tag": "akap_cd"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="14"/>
+    </field>
+  </object>
+  <object pk="41" model="toolbar.button">
+    <field type="CharField" name="label">akapit dialogowy</field>
+    <field type="SlugField" name="slug">akapit-dialogowy</field>
+    <field type="TextField" name="params">{"tag": "akap_dialog"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="14"/>
+    </field>
+  </object>
+  <object pk="14" model="toolbar.button">
+    <field type="CharField" name="label">akt</field>
+    <field type="SlugField" name="slug">akt</field>
+    <field type="TextField" name="params">{"tag": "akt"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="1"/>
+    </field>
+  </object>
+  <object pk="32" model="toolbar.button">
+    <field type="CharField" name="label">autor</field>
+    <field type="SlugField" name="slug">autor</field>
+    <field type="TextField" name="params">{"tag": "autor"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="13"/>
+    </field>
+  </object>
+  <object pk="10" model="toolbar.button">
+    <field type="CharField" name="label">część/księga</field>
+    <field type="SlugField" name="slug">czesc</field>
+    <field type="TextField" name="params">{"tag": "naglowek_czesc"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="1"/>
+    </field>
+  </object>
+  <object pk="74" model="toolbar.button">
+    <field type="CharField" name="label">dedykacja</field>
+    <field type="SlugField" name="slug">dedykacja</field>
+    <field type="TextField" name="params">{"tag": "dedykacja"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="13"/>
+      <object pk="22"/>
+    </field>
+  </object>
+  <object pk="62" model="toolbar.button">
+    <field type="CharField" name="label">didaskalia</field>
+    <field type="SlugField" name="slug">didaskalia</field>
+    <field type="TextField" name="params">{"tag": "didaskalia"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="12"/>
+      <object pk="18"/>
+    </field>
+  </object>
+  <object pk="79" model="toolbar.button">
+    <field type="CharField" name="label">didaskalia początkowe</field>
+    <field type="SlugField" name="slug">didaskalia-poczatkowe</field>
+    <field type="TextField" name="params">{"tag": "miejsce_czas"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="22"/>
+    </field>
+  </object>
+  <object pk="63" model="toolbar.button">
+    <field type="CharField" name="label">didaskalia wewn.</field>
+    <field type="SlugField" name="slug">didaskalia-wewn</field>
+    <field type="TextField" name="params">{"tag": "didask_tekst"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="18"/>
+      <object pk="15"/>
+    </field>
+  </object>
+  <object pk="20" model="toolbar.button">
+    <field type="CharField" name="label">dramat wiersz.</field>
+    <field type="SlugField" name="slug">dramat-wiersz</field>
+    <field type="TextField" name="params">{"tag": "dramat_wierszowany_l"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="11"/>
+    </field>
+  </object>
+  <object pk="22" model="toolbar.button">
+    <field type="CharField" name="label">dramat wiersz./w. łam</field>
+    <field type="SlugField" name="slug">dramat-wiersz-w-lam</field>
+    <field type="TextField" name="params">{"tag": "dramat_wierszowany_lp"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="11"/>
+    </field>
+  </object>
+  <object pk="21" model="toolbar.button">
+    <field type="CharField" name="label">dramat współczesny</field>
+    <field type="SlugField" name="slug">dramat-wspolczesny</field>
+    <field type="TextField" name="params">{"tag": "dramat_wspolczesny"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="11"/>
+    </field>
+  </object>
+  <object pk="38" model="toolbar.button">
+    <field type="CharField" name="label">dzieło nadrzędne</field>
+    <field type="SlugField" name="slug">dzielo-nadrzedne</field>
+    <field type="TextField" name="params">{"tag": "dzielo_nadrzedne"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="13"/>
+    </field>
+  </object>
+  <object pk="67" model="toolbar.button">
+    <field type="CharField" name="label">długi cyt. poet.</field>
+    <field type="SlugField" name="slug">dlugi-cyt-poet</field>
+    <field type="TextField" name="params">{"tag": "poezja_cyt"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="14"/>
+      <object pk="21"/>
+    </field>
+  </object>
+  <object pk="42" model="toolbar.button">
+    <field type="CharField" name="label">długi cytat</field>
+    <field type="SlugField" name="slug">dlugi-cytat</field>
+    <field type="TextField" name="params">{"tag": "dlugi_cyt"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="14"/>
+      <object pk="21"/>
+    </field>
+  </object>
+  <object pk="52" model="toolbar.button">
+    <field type="CharField" name="label">ekstra</field>
+    <field type="SlugField" name="slug">ekstra</field>
+    <field type="TextField" name="params">{"tag": "ekstra"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="15"/>
+    </field>
+  </object>
+  <object pk="82" model="toolbar.button">
+    <field type="CharField" name="label">kwestia</field>
+    <field type="SlugField" name="slug">kwestia</field>
+    <field type="TextField" name="params">{"tag": "kwestia"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="12"/>
+      <object pk="18"/>
+    </field>
+  </object>
+  <object pk="23" model="toolbar.button">
+    <field type="CharField" name="label">liryka</field>
+    <field type="SlugField" name="slug">liryka</field>
+    <field type="TextField" name="params">{"tag": "liryka_l"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="11"/>
+    </field>
+  </object>
+  <object pk="24" model="toolbar.button">
+    <field type="CharField" name="label">liryka/w. łam</field>
+    <field type="SlugField" name="slug">liryka-w-lam</field>
+    <field type="TextField" name="params">{"tag": "liryka_lp"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="11"/>
+    </field>
+  </object>
+  <object pk="78" model="toolbar.button">
+    <field type="CharField" name="label">lista osób: pole</field>
+    <field type="SlugField" name="slug">lista-osob-pole</field>
+    <field type="TextField" name="params">{"tag": "lista_osoba", "attrs": {"typ": ""}}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="22"/>
+    </field>
+  </object>
+  <object pk="47" model="toolbar.button">
+    <field type="CharField" name="label">mamtemat.</field>
+    <field type="SlugField" name="slug">matemat</field>
+    <field type="TextField" name="params">{"tag": "mat"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="15"/>
+    </field>
+  </object>
+  <object pk="75" model="toolbar.button">
+    <field type="CharField" name="label">motto</field>
+    <field type="SlugField" name="slug">motto</field>
+    <field type="TextField" name="params">{"tag": "motto"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="13"/>
+      <object pk="22"/>
+    </field>
+  </object>
+  <object pk="37" model="toolbar.button">
+    <field type="CharField" name="label">motto podpis</field>
+    <field type="SlugField" name="slug">motto-podpis</field>
+    <field type="TextField" name="params">{"tag": "motto_podpis"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="13"/>
+    </field>
+  </object>
+  <object pk="16" model="toolbar.button">
+    <field type="CharField" name="label">nagłówek kwestii</field>
+    <field type="SlugField" name="slug">naglowek-kwestii</field>
+    <field type="TextField" name="params">{"tag": "naglowek_osoba"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="1"/>
+    </field>
+  </object>
+  <object pk="35" model="toolbar.button">
+    <field type="CharField" name="label">nota</field>
+    <field type="SlugField" name="slug">nota</field>
+    <field type="TextField" name="params">{"tag": "nota"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="13"/>
+    </field>
+  </object>
+  <object pk="18" model="toolbar.button">
+    <field type="CharField" name="label">opowiadanie</field>
+    <field type="SlugField" name="slug">opowiadanie</field>
+    <field type="TextField" name="params">{"tag": "opowiadanie"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="11"/>
+    </field>
+  </object>
+  <object pk="64" model="toolbar.button">
+    <field type="CharField" name="label">osoba</field>
+    <field type="SlugField" name="slug">osoba</field>
+    <field type="TextField" name="params">{"tag": "osoba"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="18"/>
+      <object pk="15"/>
+    </field>
+  </object>
+  <object pk="12" model="toolbar.button">
+    <field type="CharField" name="label">podrozdział</field>
+    <field type="SlugField" name="slug">podrozdzial</field>
+    <field type="TextField" name="params">{"tag": "naglowek_podrozdzial"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="1"/>
+    </field>
+  </object>
+  <object pk="34" model="toolbar.button">
+    <field type="CharField" name="label">podtytuł</field>
+    <field type="SlugField" name="slug">podtytul</field>
+    <field type="TextField" name="params">{"tag": "podtytul"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="13"/>
+    </field>
+  </object>
+  <object pk="19" model="toolbar.button">
+    <field type="CharField" name="label">powieść</field>
+    <field type="SlugField" name="slug">powiesc</field>
+    <field type="TextField" name="params">{"tag": "powiesc"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="11"/>
+    </field>
+  </object>
+  <object pk="68" model="toolbar.button">
+    <field type="CharField" name="label">przypis autorski</field>
+    <field type="SlugField" name="slug">przypis-autorski</field>
+    <field type="TextField" name="params">{"tag": "pa"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="21"/>
+    </field>
+  </object>
+  <object pk="71" model="toolbar.button">
+    <field type="CharField" name="label">przypis edytorski</field>
+    <field type="SlugField" name="slug">przypis-edytorski</field>
+    <field type="TextField" name="params">{"tag": "pe"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="21"/>
+    </field>
+  </object>
+  <object pk="70" model="toolbar.button">
+    <field type="CharField" name="label">przypis redaktorski</field>
+    <field type="SlugField" name="slug">przypis-redaktorski</field>
+    <field type="TextField" name="params">{"tag": "pr"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="21"/>
+    </field>
+  </object>
+  <object pk="69" model="toolbar.button">
+    <field type="CharField" name="label">przypis tłumacza</field>
+    <field type="SlugField" name="slug">przypis-tlumacza</field>
+    <field type="TextField" name="params">{"tag": "pt"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="21"/>
+    </field>
+  </object>
+  <object pk="11" model="toolbar.button">
+    <field type="CharField" name="label">rozdział</field>
+    <field type="SlugField" name="slug">rozdzial</field>
+    <field type="TextField" name="params">{"tag": "naglowek_rozdzial"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="1"/>
+    </field>
+  </object>
+  <object pk="15" model="toolbar.button">
+    <field type="CharField" name="label">scena</field>
+    <field type="SlugField" name="slug">scena</field>
+    <field type="TextField" name="params">{"tag": "naglowek_scena"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="1"/>
+    </field>
+  </object>
+  <object pk="54" model="toolbar.button">
+    <field type="CharField" name="label">sep. asteryks</field>
+    <field type="SlugField" name="slug">sep-asteryks</field>
+    <field type="TextField" name="params">{"tag": "sekcja_asteryks"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="16"/>
+    </field>
+  </object>
+  <object pk="55" model="toolbar.button">
+    <field type="CharField" name="label">sep. linia</field>
+    <field type="SlugField" name="slug">sep-linia</field>
+    <field type="TextField" name="params">{"tag": "separator_linia"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="16"/>
+    </field>
+  </object>
+  <object pk="53" model="toolbar.button">
+    <field type="CharField" name="label">sep. światło</field>
+    <field type="SlugField" name="slug">sep-swiatlo</field>
+    <field type="TextField" name="params">{"tag": "sekcja_swiatlo"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="16"/>
+    </field>
+  </object>
+  <object pk="81" model="toolbar.button">
+    <field type="CharField" name="label">strofa</field>
+    <field type="SlugField" name="slug">strofa</field>
+    <field type="TextField" name="params">{"tag": "strofa"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_stanza</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key">s</field>
+    <field type="PositiveIntegerField" name="key_mod">1</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="12"/>
+      <object pk="17"/>
+    </field>
+  </object>
+  <object pk="46" model="toolbar.button">
+    <field type="CharField" name="label">słowo obce</field>
+    <field type="SlugField" name="slug">slowo-obce</field>
+    <field type="TextField" name="params">{"tag": "slowo_obce"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="15"/>
+    </field>
+  </object>
+  <object pk="17" model="toolbar.button">
+    <field type="CharField" name="label">tagi główne</field>
+    <field type="SlugField" name="slug">tagi-glowne</field>
+    <field type="TextField" name="params">{"tag": "utwor"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="11"/>
+    </field>
+  </object>
+  <object pk="33" model="toolbar.button">
+    <field type="CharField" name="label">tytuł</field>
+    <field type="SlugField" name="slug">tytul</field>
+    <field type="TextField" name="params">{"tag": "nazwa_utworu"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="13"/>
+    </field>
+  </object>
+  <object pk="45" model="toolbar.button">
+    <field type="CharField" name="label">tytuł dzieła</field>
+    <field type="SlugField" name="slug">tytul-dziela</field>
+    <field type="TextField" name="params">{"tag": "tytul_dziela", "attrs": {"typ": "1"}}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="15"/>
+    </field>
+  </object>
+  <object pk="51" model="toolbar.button">
+    <field type="CharField" name="label">uwaga</field>
+    <field type="SlugField" name="slug">uwaga</field>
+    <field type="TextField" name="params">{"tag": "uwaga"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="15"/>
+    </field>
+  </object>
+  <object pk="83" model="toolbar.button">
+    <field type="CharField" name="label">wers akap.</field>
+    <field type="SlugField" name="slug">wers-akap</field>
+    <field type="TextField" name="params">{"tag": "wers_akap"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="12"/>
+      <object pk="17"/>
+    </field>
+  </object>
+  <object pk="85" model="toolbar.button">
+    <field type="CharField" name="label">wers cd.</field>
+    <field type="SlugField" name="slug">wers-cd</field>
+    <field type="TextField" name="params">{"tag": "wers_cd"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="12"/>
+      <object pk="17"/>
+    </field>
+  </object>
+  <object pk="48" model="toolbar.button">
+    <field type="CharField" name="label">www</field>
+    <field type="SlugField" name="slug">www</field>
+    <field type="TextField" name="params">{"tag": "www"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="15"/>
+    </field>
+  </object>
+  <object pk="44" model="toolbar.button">
+    <field type="CharField" name="label">wyróżnienie</field>
+    <field type="SlugField" name="slug">wyroznienie</field>
+    <field type="TextField" name="params">{"tag": "wyroznienie"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="15"/>
+    </field>
+  </object>
+  <object pk="25" model="toolbar.button">
+    <field type="CharField" name="label">wywiad</field>
+    <field type="SlugField" name="slug">wywiad</field>
+    <field type="TextField" name="params">{"tag": "wywiad"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="11"/>
+    </field>
+  </object>
+  <object pk="73" model="toolbar.button">
+    <field type="CharField" name="label">wywiad odpowiedź</field>
+    <field type="SlugField" name="slug">wywiad-odpowiedz</field>
+    <field type="TextField" name="params">{"tag": "wywiad_odp"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="21"/>
+    </field>
+  </object>
+  <object pk="72" model="toolbar.button">
+    <field type="CharField" name="label">wywiad pytanie</field>
+    <field type="SlugField" name="slug">wywiad-pytanie</field>
+    <field type="TextField" name="params">{"tag": "wywiad_pyt"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="21"/>
+    </field>
+  </object>
+  <object pk="56" model="toolbar.button">
+    <field type="CharField" name="label">zastępnik wersu</field>
+    <field type="SlugField" name="slug">zastepnik-wersu</field>
+    <field type="TextField" name="params">{"tag": "zastepnik_wersu"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="16"/>
+    </field>
+  </object>
+  <object pk="13" model="toolbar.button">
+    <field type="CharField" name="label">śródtytuł</field>
+    <field type="SlugField" name="slug">srodtytul</field>
+    <field type="TextField" name="params">{"tag": "srodtytul"}</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">insert_tag</field>
+    <field type="CharField" name="link"/>
+    <field type="CharField" name="key"/>
+    <field type="PositiveIntegerField" name="key_mod">0</field>
+    <field type="CharField" name="tooltip"/>
+    <field to="toolbar.buttongroup" name="group" rel="ManyToManyRel">
+      <object pk="1"/>
+    </field>
+  </object>
+  <object pk="insert_tag" model="toolbar.scriptlet">
+    <field type="TextField" name="code">var texteditor = panel.texteditor;
+
+var text = texteditor.selection();
+
+var out = '&lt;'+params.tag;
+
+for (var attr in params.attrs) {
+
+    out += ' '+attr+'="' + params.attrs[attr] + '"';
+
+};
+
+out += '&gt;';
+
+out += text;
+
+out += '&lt;/' + params.tag + '&gt;';
+
+
+texteditor.replaceSelection(out);
+
+
+
+if (text.length == 0) {
+
+    var pos = texteditor.cursorPosition();
+
+    texteditor.selectLines(pos.line, pos.character + params.tag.length + 2);
+
+}
+
+
+
+panel.fireEvent('contentChanged');</field>
+  </object>
+  <object pk="lineregexp" model="toolbar.scriptlet">
+    <field type="TextField" name="code">editor.showPopup('generic-info', 'Przetwarzanie zaznaczonego tekstu...', '', -1);
+
+var cm = panel.texteditor;
+var exprs = $.map(params.exprs, function(expr) {
+
+    var opts = "g";
+
+    if(expr.length &gt; 2)
+
+        opts = expr[2];
+
+    return {rx: new RegExp(expr[0], opts), repl: expr[1]};
+
+});
+
+
+
+var partial = true;
+
+var text = cm.selection();
+
+
+
+if(!text) {
+
+    var cpos = cm.cursorPosition();
+
+    cpos.line = cm.lineNumber(cpos.line)
+
+    cm.selectLines(cm.firstLine(), 0, cm.lastLine(), 0);
+
+    text = cm.selection();
+
+    partial = false;
+
+}
+
+
+
+var changed = 0;
+var lines = text.split('\n');
+var lines = $.map(lines, function(line) { 
+    var old_line = line;
+    $(exprs).each(function() { 
+        var expr = this;
+        line = line.replace(expr.rx, expr.repl);
+    });
+
+    if(old_line != line) changed += 1;
+    return line;
+});
+
+if(changed &gt; 0) 
+{
+    cm.replaceSelection( lines.join('\n') );
+    panel.fireEvent('contentChanged');
+    editor.showPopup('generic-yes', 'Zmieniono ' + changed + ' linii.', 1500);
+    editor.advancePopupQueue();
+}
+else {
+    editor.showPopup('generic-info',  'Brak zmian w tekście', 1500);
+    editor.advancePopupQueue();
+}
+
+if(!partial)
+    cm.selectLines( cm.nthLine(cpos.line), cpos.character )</field>
+  </object>
+  <object pk="codemirror_fontsize" model="toolbar.scriptlet">
+    <field type="TextField" name="code">var texteditor = panel.texteditor;
+
+var frameBody = $('body', $(texteditor.frame).contents());
+
+
+
+if(params.fontSize) {
+
+    frameBody.css('font-size', params.fontSize);
+
+}
+
+else {
+
+    var old_size = parseInt(frameBody.css('font-size'));
+
+    frameBody.css('font-size', old_size + (params.change || 0) );
+
+}</field>
+  </object>
+  <object pk="fulltextregexp" model="toolbar.scriptlet">
+    <field type="TextField" name="code">editor.showPopup('generic-info', 'Przetwarzanie zaznaczonego tekstu...', '', -1);
+
+var cm = panel.texteditor;
+
+var exprs = $.map(params.exprs, function(expr) {
+    var opts = "mg";
+    if(expr.length &gt; 2)
+        opts = expr[2];
+
+    return {rx: new RegExp(expr[0], opts), repl: expr[1]};
+});
+
+var partial = true;
+var text = cm.selection();
+
+if(!text) {
+    var cpos = cm.cursorPosition();
+    cpos.line = cm.lineNumber(cpos.line)
+    cm.selectLines(cm.firstLine(), 0, cm.lastLine(), 0);
+
+    text = cm.selection();
+    partial = false;
+}
+
+
+
+var original = text;
+$(exprs).each(function() { 
+    text = text.replace(this.rx, this.repl);
+});
+
+if( original != text) 
+{    
+    cm.replaceSelection(text);
+    panel.fireEvent('contentChanged');
+    editor.showPopup('generic-yes', 'Zmieniono tekst' );
+    editor.advancePopupQueue();
+}
+else {
+    editor.showPopup('generic-info', 'Brak zmian w tekście.');
+    editor.advancePopupQueue();
+}
+
+if(!partial) {
+    cm.selectLines( cm.nthLine(cpos.line), cpos.character );
+}</field>
+  </object>
+  <object pk="macro" model="toolbar.scriptlet">
+    <field type="TextField" name="code">params.each(function() {
+
+    editor.callScriptlet(this[0], this[1]);
+
+});</field>
+  </object>
+  <object pk="lowercase" model="toolbar.scriptlet">
+    <field type="TextField" name="code">var cm = panel.texteditor;
+
+var text = cm.selection();
+
+if(!text) return;
+
+var repl = text.toLowerCase();
+
+if(repl != text) {
+
+    cm.replaceSelection(repl);
+
+    panel.fireEvent('contentChanged');
+
+};</field>
+  </object>
+  <object pk="insert_stanza" model="toolbar.scriptlet">
+    <field type="TextField" name="code">var texteditor = panel.texteditor;
+
+var text = texteditor.selection();
+
+
+
+if(text) {
+
+   text = '\n' + text.split('\n').join('\\\n') + '\n';
+
+}
+
+
+
+texteditor.replaceSelection('&lt;strofa&gt;'+text+'&lt;/strofa&gt;');
+
+
+
+if (!text) {
+
+    var pos = texteditor.cursorPosition();
+
+    texteditor.selectLines(pos.line, pos.character + 6 + 2);
+
+}
+
+
+
+
+
+
+
+panel.fireEvent('contentChanged');</field>
+  </object>
+</django-objects>
diff --git a/project/admin.py b/project/admin.py
deleted file mode 100644 (file)
index 7bf8097..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-from django.contrib import admin
-from django.utils.translation import ugettext_lazy as _
-
-import toolbar.admin
\ No newline at end of file
index 2eaf801..33a9f68 100644 (file)
@@ -161,25 +161,44 @@ label {
 }
 
 /* Toolbars with select box to change panel contents*/
 }
 
 /* Toolbars with select box to change panel contents*/
-.panel-toolbar {
+.panel-wrap .panel-toolbar {
     position: absolute;
     position: absolute;
-    top: 0px; left:0px; right: 0px; height: 24px;
+    top: 0px; left:0px; right: 0px; height: 26px;
+    padding: 0px;
 
 
-    padding: 0 0 2px 0;
     /* border-top: 1px solid #AAA; */
     border-bottom: 1px solid #AAA;
     /* border-top: 1px solid #AAA; */
     border-bottom: 1px solid #AAA;
+    z-index: 80;
+}
+
+.panel-toolbar label {
+    display: inline;
+}
+
+.panel-toolbar p {
+    /* position: relative; */
     font-size: 12px;
     font-size: 12px;
-    line-height: 20px;
+    line-height: 26px;
     background-color: #DDD;
     white-space: nowrap;
     overflow: hidden;
     background-color: #DDD;
     white-space: nowrap;
     overflow: hidden;
-    z-index: 80;
+    
+    margin: 0px;
+    padding: 0px 1em;
+
+    width: auto;
+    height: 26px;
 }
 
 }
 
-.panel-toolbar label {
-    display: block;
-    float: left;
-    margin: 0 10px 0 2px;
+
+.panel-toolbar .toolbar-button-groups-container .panel-toolbar-extra button {
+    /* this is uber specific */
+    font-size: 12px;
+    font-family: Sans-Serif;
+    padding: 2px 5px;
+    margin: 0px;
+    border: 0px solid black;
+    vertical-align: bottom;
 }
 
 /* Slider between panels */
 }
 
 /* Slider between panels */
@@ -207,6 +226,8 @@ label {
 }
 
 
 }
 
 
+
+
 /* ================= */
 /* = Gallery panel = */
 /* ================= */
 /* ================= */
 /* = Gallery panel = */
 /* ================= */
@@ -215,38 +236,6 @@ label {
     overflow-y: scroll;
 }
 
     overflow-y: scroll;
 }
 
-
-/* ==================== */
-/* = XML Editor panel = */
-/* ==================== */
-
-.change-font-size {
-    width: 45px;
-    height: 18px;
-    padding: 3px 0 0;
-    position: absolute;
-    top: 0;
-    right: 0;
-}
-
-.change-font-size div {
-    float: left;
-    text-align: center;
-    width: 20px;
-    font-size: 13px;
-    margin: 1px;
-    cursor: default;
-    border-radius: 2px;
-    -moz-border-radius: 2px;
-    -webkit-border-radius: 2px;
-}
-
-.change-font-size div:hover {
-    background-color: #EEE;
-    border: 1px solid #AAA;
-    margin: 0;
-}
-
 /* =========================== */
 /* = DublinCore Editor panel = */
 /* =========================== */
 /* =========================== */
 /* = DublinCore Editor panel = */
 /* =========================== */
index f38f4dd..4c5fa74 100644 (file)
@@ -5,33 +5,33 @@
     position: absolute;
     top: 0px; left:0px; right: 0px; 
     height: auto;
     position: absolute;
     top: 0px; left:0px; right: 0px; 
     height: auto;
-    padding: 1pt;
-    margin: 0pt;
+    padding: 2px;
+    margin: 0px;
 }
 
 .toolbar p {
 }
 
 .toolbar p {
-    margin: 0pt; 
+    margin: 0px;
 
 
-    padding: 0pt;    
+    padding: 0px;
     padding-left: 0.5em;
 
     border: none;
     background: #AAA;
     padding-left: 0.5em;
 
     border: none;
     background: #AAA;
-    font-size: 10pt;
-    line-height: 12pt;
+    font-size: 10px;
+    line-height: 12px;
 }
 
 .toolbar button {
     border: none;
 }
 
 .toolbar button {
     border: none;
-    padding: 2pt 0.5em;
+    padding: 2px 0.5em;
     background: #AAA;
     font-family: Sans-Serif;
 }
 
 .toolbar div {
     background: green;
     background: #AAA;
     font-family: Sans-Serif;
 }
 
 .toolbar div {
     background: green;
-    margin: 0pt;
-    padding: 0pt;
+    margin: 0px;
+    padding: 0px;
 }
 
 .toolbar-tabs-container button.active {
 }
 
 .toolbar-tabs-container button.active {
@@ -40,8 +40,8 @@
 
 .toolbar-button-groups-container p {
     background: #DDD;
 
 .toolbar-button-groups-container p {
     background: #DDD;
-    padding-top: 2pt;
-    padding-bottom: 2pt;
+    padding-top: 2px;
+    padding-bottom: 2px;
 }
 
 .toolbar-button-groups-container button {
 }
 
 .toolbar-button-groups-container button {
index f7f4cf3..ac34ac5 100644 (file)
@@ -85,6 +85,10 @@ Panel.prototype.unload = function(event, data) {
     if( data == this ) {
         $.log('unloading', this);
         $(this.contentDiv).html('');
     if( data == this ) {
         $.log('unloading', this);
         $(this.contentDiv).html('');
+
+        // disconnect the toolbar
+        $('div.panel-toolbar span.panel-toolbar-extra', this.wrap).empty();
+        
         this.callHook('unload');
         this.hooks = null; // flush the hooks
         return false;
         this.callHook('unload');
         this.hooks = null; // flush the hooks
         return false;
@@ -137,6 +141,13 @@ Panel.prototype.connectToolbar = function()
     $.log('Connecting toolbar', toolbar);
     if(toolbar.length == 0) return;
 
     $.log('Connecting toolbar', toolbar);
     if(toolbar.length == 0) return;
 
+    // move the extra
+    var extra_buttons = $('span.panel-toolbar-extra', toolbar);
+    var placeholder = $('div.panel-toolbar span.panel-toolbar-extra', this.wrap);
+    placeholder.replaceWith(extra_buttons);
+
+    var action_buttons = $('button', extra_buttons);
+
     // connect group-switch buttons
     var group_buttons = $('*.toolbar-tabs-container button', toolbar);
 
     // connect group-switch buttons
     var group_buttons = $('*.toolbar-tabs-container button', toolbar);
 
@@ -165,8 +176,11 @@ Panel.prototype.connectToolbar = function()
     });
 
     // connect action buttons
     });
 
     // connect action buttons
-    var action_buttons = $('*.toolbar-button-groups-container button', toolbar);
-    action_buttons.each(function() {
+    var allbuttons = $.makeArray(action_buttons)
+    $.merge(allbuttons,
+        $.makeArray($('*.toolbar-button-groups-container button', toolbar)) );
+        
+    $(allbuttons).each(function() {
         var button = $(this);
         var hk = button.attr('ui:hotkey');
         if(hk) hk = new Hotkey( parseInt(hk) );
         var button = $(this);
         var hk = button.attr('ui:hotkey');
         if(hk) hk = new Hotkey( parseInt(hk) );
index fe9d93a..891366b 100644 (file)
     </script>
 {% endblock extrabody %}
 
     </script>
 {% endblock extrabody %}
 
-{% block breadcrumbs %}<a href="{% url file_list %}">Platforma Redakcyjna</a> &gt; plik {{ hash }}{% endblock breadcrumbs %}
+{% block breadcrumbs %}<a href="{% url file_list %}">Platforma Redakcyjna</a> &gt; plik {{ fileid }}{% endblock breadcrumbs %}
 
 {% block header-toolbar %}
 
 
 {% block header-toolbar %}
 
-<form action="{% url file_commit hash %}" method="POST" style="display: inline;" id="toolbar-commit-form">
+<form action="{% url file_commit fileid %}" method="POST" style="display: inline;" id="toolbar-commit-form">
     <input type="text" size="40" id="toolbar-commit-message" name="message" />
     <button type="submit" class="toolbar-button" id="toolbar-button-commit">Merge</button>
 </form>
 <button type="button" class="toolbar-button" id="toolbar-button-update"
     <input type="text" size="40" id="toolbar-commit-message" name="message" />
     <button type="submit" class="toolbar-button" id="toolbar-button-commit">Merge</button>
 </form>
 <button type="button" class="toolbar-button" id="toolbar-button-update"
-        ui:ajax-action="{% url file_update hash %}">Update</button>
+        ui:ajax-action="{% url file_update fileid %}">Update</button>
 <button type="button" class="toolbar-button" id="toolbar-button-save" disabled="disabled">Save</button>
 {% endblock %}
 
 <button type="button" class="toolbar-button" id="toolbar-button-save" disabled="disabled">Save</button>
 {% endblock %}
 
             {% for n in panel_list %}
             <div class="panel-wrap{% if forloop.last %} last-panel{% endif %}" id="panel-{{n}}">
                 <div class="panel-toolbar">
             {% for n in panel_list %}
             <div class="panel-wrap{% if forloop.last %} last-panel{% endif %}" id="panel-{{n}}">
                 <div class="panel-toolbar">
-                    <label for="select-{{n}}-panel">{{n|capfirst}} panel:</label>
+                    <p><label>{{n|capfirst}} panel:
                     <select name="select-{{n}}-panel" id="panel-{{n}}-select">
                     <select name="select-{{n}}-panel" id="panel-{{n}}-select">
-                        <option value="{% url xmleditor_panel hash %}" name="xmleditor">Edytor XML</option>
-                        <option value="{% url htmleditor_panel hash %}" name="htmleditor">Edytor HTML</option>
-                        <option value="{% url gallery_panel hash %}" name="gallery">Galeria skanów</option>
-                        <option value="{% url dceditor_panel hash %}" name="dceditor">Edytor DublinCore</option>
+                        {% for panel_type in availble_panels %}
+                        <option value="{% url panel_view path=fileid,name=panel_type.id  %}">{{panel_type.display_name}}</option>
+                        {% endfor %}
                     </select>
                     </select>
-                    <button type="button" class="refresh-button">Odśwież</button>
+                    </label>
+                    <span class="toolbar-button-groups-container">
+                    <span class="panel-toolbar-extra" > </span>
+                    </span>
+                    <!-- rethink the refresh button - it doesn't work very well -->
+                    <!-- <button type="button" class="refresh-button">Odśwież</button> -->
+                    {# <a href="{% url print_xml fileid %}" target="_new">Wydruk</a> #}
                     <strong class="change-notification" style="display: none">Widok nieaktualny!</strong>
                     <strong class="change-notification" style="display: none">Widok nieaktualny!</strong>
+                    </p>
                </div>
                <div id="panel-{{n}}-content" class="panel-content"></div>
                <button type="button" class="panel-slider"></button>
                </div>
                <div id="panel-{{n}}-content" class="panel-content"></div>
                <button type="button" class="panel-slider"></button>
index a82f796..a09f9be 100644 (file)
@@ -18,7 +18,7 @@ panel_hooks = {
        },
        saveInfo: function(saveInfo) {
                var myInfo = {
        },
        saveInfo: function(saveInfo) {
                var myInfo = {
-                       url: "{% url file_dc fpath %}", 
+                       url: "{% url file_dc fileid %}",
                        postData: $('form', this.contentDiv).serialize() 
                };
                $.extend(saveInfo, myInfo);
                        postData: $('form', this.contentDiv).serialize() 
                };
                $.extend(saveInfo, myInfo);
index 3323cf1..3599dfe 100644 (file)
@@ -1,4 +1,8 @@
+{% load toolbar_tags %}
+{% toolbar toolbar_groups toolbar_extra_group %}
+
 {{ html|safe }}
 {{ html|safe }}
+
 <script type="text/javascript" charset="utf-8">
 panel_hooks = {
        load: function() 
 <script type="text/javascript" charset="utf-8">
 panel_hooks = {
        load: function() 
index 5c622bb..7691269 100644 (file)
@@ -1,13 +1,11 @@
 {% load toolbar_tags %}
 {% load toolbar_tags %}
+{% toolbar toolbar_groups toolbar_extra_group %}
 
 <div class="iframe-container" style="position: absolute; top: 40px; left:0px; right:0px; bottom: 0px;">
        <textarea name="text">{{ text }}</textarea>
 </div>
 
 
 <div class="iframe-container" style="position: absolute; top: 40px; left:0px; right:0px; bottom: 0px;">
        <textarea name="text">{{ text }}</textarea>
 </div>
 
-{% toolbar %}
-
 <script type="text/javascript" charset="utf-8">
 <script type="text/javascript" charset="utf-8">
-
 panel_hooks = {
        load: function () {
                var self = this;
 panel_hooks = {
        load: function () {
                var self = this;
@@ -48,7 +46,7 @@ panel_hooks = {
 
        saveInfo: function(saveInfo) {
                var myInfo = {
 
        saveInfo: function(saveInfo) {
                var myInfo = {
-                       url: "{% url file_xml fpath %}", 
+                       url: "{% url file_xml fileid %}",
                        postData: {
                                content: this.texteditor.getCode()
                        } 
                        postData: {
                                content: this.texteditor.getCode()
                        } 
index cf08247..ce2f6b5 100644 (file)
@@ -3,28 +3,28 @@ from django.contrib import admin
 from django.conf import settings
 
 admin.autodiscover()
 from django.conf import settings
 
 admin.autodiscover()
-PATH_END = r"(?P<path>[^/]+)$"
+PATH_SEC = r"(?P<path>[^/]+)"
+PATH_END = PATH_SEC + "/$"
 
 urlpatterns = patterns('',
     # Explorer:
     url(r'^$', 'explorer.views.file_list', name='file_list'),
     
 
 urlpatterns = patterns('',
     # Explorer:
     url(r'^$', 'explorer.views.file_list', name='file_list'),
     
-    url(r'^file/text/'+PATH_END, 'explorer.views.file_xml', name='file_xml'),
-    url(r'^file/dc/'+PATH_END, 'explorer.views.file_dc', name='file_dc'),
+    url(r'^file/'+PATH_SEC+'/text/$', 'explorer.views.file_xml', name='file_xml'),
+    url(r'^file/'+PATH_SEC+'/dc/$', 'explorer.views.file_dc', name='file_dc'),
     url(r'^file/upload', 'explorer.views.file_upload', name='file_upload'),
     url(r'^file/upload', 'explorer.views.file_upload', name='file_upload'),
-    url(r'^file/commit/'+PATH_END, 'explorer.views.file_commit', name='file_commit'),
-    url(r'^file/update/'+PATH_END, 'explorer.views.file_update_local', name='file_update'),
+    url(r'^file/'+PATH_SEC+'/commit$', 'explorer.views.file_commit', name='file_commit'),
+    url(r'^file/'+PATH_SEC+'/update$', 'explorer.views.file_update_local', name='file_update'),
 
     url(r'^images/(?P<folder>[^/]+)/$', 'explorer.views.folder_images', name='folder_image'),
     url(r'^images/$', 'explorer.views.folder_images', {'folder': '.'}, name='folder_image_ajax'),
     
     # Editor panels
 
     url(r'^images/(?P<folder>[^/]+)/$', 'explorer.views.folder_images', name='folder_image'),
     url(r'^images/$', 'explorer.views.folder_images', {'folder': '.'}, name='folder_image_ajax'),
     
     # Editor panels
-    url(r'^editor/panel/xmleditor/'+PATH_END, 'explorer.views.xmleditor_panel', name='xmleditor_panel'),
-    url(r'^editor/panel/gallery/'+PATH_END, 'explorer.views.gallery_panel', name='gallery_panel'),
-    url(r'^editor/panel/htmleditor/'+PATH_END, 'explorer.views.htmleditor_panel', name='htmleditor_panel'),
-    url(r'^editor/panel/dceditor/'+PATH_END, 'explorer.views.dceditor_panel', name='dceditor_panel'),
+    url(r'^editor/'+PATH_SEC+'/panel/(?P<name>[a-z]+)/$', 'explorer.views.panel_view', name='panel_view'),
     url(r'^editor/'+PATH_END, 'explorer.views.display_editor', name='editor_view'),
 
     url(r'^editor/'+PATH_END, 'explorer.views.display_editor', name='editor_view'),
 
+    url(r'^editor/'+PATH_SEC+'/print/html$', 'explorer.views.print_html'),
+    url(r'^editor/'+PATH_SEC+'/print/xml$', 'explorer.views.print_xml'),
     
     # Task managment
     url(r'^manager/pull-requests$', 'explorer.views.pull_requests'),
     
     # Task managment
     url(r'^manager/pull-requests$', 'explorer.views.pull_requests'),