ui:action-params="{{ button.params|escape }}"
{% if button.key %}ui:hotkey="{{ button.key|keycode }}"{% endif %}
{% if button.tooltip %}ui:tooltip="{{ button.tooltip }}"{% endif %} >
- {{ button.label }}
+ {{ button.label|safe }}
</button>
{% endfor %}
</p>
--- /dev/null
+./project/manage.py dumpdata --format=xml toolbar > fixtures/przyciski.xml
<?xml version="1.0" encoding="utf-8"?>\r
-<django-objects version="1.0"><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="1" model="toolbar.buttongroup"><field type="CharField" name="name">Formatowanie</field><field type="SlugField" name="slug">formatowanie</field><field type="IntegerField" name="position">0</field></object><object pk="4" model="toolbar.button"><field type="CharField" name="label">Novelpages</field><field type="SlugField" name="slug">novelpages</field><field type="TextField" name="params">({exprs: [\r\r
+<django-objects version="1.0"><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="1" model="toolbar.buttongroup"><field type="CharField" name="name">Formatowanie</field><field type="SlugField" name="slug">formatowanie</field><field type="IntegerField" name="position">0</field></object><object pk="3" model="toolbar.buttongroup"><field type="CharField" name="name">Widok</field><field type="SlugField" name="slug">display_options</field><field type="IntegerField" name="position">2</field></object><object pk="5" model="toolbar.button"><field type="CharField" name="label">A<sup>+</sup></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="key">+</field><field type="CharField" name="tooltip">Zwiększ rozmiar czcionki.</field><field to="toolbar.buttongroup" name="group" rel="ManyToManyRel"><object pk="3"></object></field></object><object pk="6" model="toolbar.button"><field type="CharField" name="label">A<sup>-</sup></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="key">-</field><field type="CharField" name="tooltip">Zmniejsz rozmiar czcionki.</field><field to="toolbar.buttongroup" name="group" rel="ManyToManyRel"><object pk="3"></object></field></object><object pk="7" model="toolbar.button"><field type="CharField" name="label">A<sup>=</sup></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="key">=</field><field type="CharField" name="tooltip">Przywróć orginalny rozmiar czcionki.</field><field to="toolbar.buttongroup" name="group" rel="ManyToManyRel"><object pk="3"></object></field></object><object pk="4" model="toolbar.button"><field type="CharField" name="label">Novelpages</field><field type="SlugField" name="slug">novelpages</field><field type="TextField" name="params">({exprs: [\r\r
["\\,\\.\\.|\\.\\,\\.|\\.\\.\\,", "..."],\r\r
["„", ",,"] /* DOUBLE LOW-9 QUOTATION MARK */\r\r
]})\r\r
cm.setLineContent(line, content);\r\r
line = cm.nextLine(line);\r\r
} while( !(line === false) );\r\r
+}</field></object><object pk="codemirror_fontsize" model="toolbar.scriptlet"><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></object></django-objects>\r
{% load toolbar_tags %}
-<div class="change-font-size" style="">
- <div class="decrease-font-size">A<sup>-</sup></div>
- <div class="increase-font-size">A<sup>+</sup></div>
-</div>
-
<div class="iframe-container" style="position: absolute; top: 41pt; left:0px; right:0px; bottom: 0px;">
<textarea name="text">{{ text }}</textarea>
</div>
-
{% toolbar %}
<script type="text/javascript" charset="utf-8">
$.fbind(self, self.isHotkey) );
}
})
-
- $(texteditor.frame).css({width: '100%', height: '100%'});
-
-
- $('.decrease-font-size', panel).click(function() {
- var frameBody = $('body', $(texteditor.frame).contents());
- console.log(frameBody.css('font-size'));
- frameBody.css('font-size', parseInt(frameBody.css('font-size')) - 2);
- });
-
- $('.increase-font-size', panel).click(function() {
- var frameBody = $('body', $(texteditor.frame).contents());
- console.log(frameBody.css('font-size'));
- frameBody.css('font-size', parseInt(frameBody.css('font-size')) + 2);
- });
+ $(texteditor.frame).css({width: '100%', height: '100%'});
this.texteditor = texteditor;
},