Poprawienie skryptu editor.js zgodnie z sugestiami jslist.
[redakcja.git] / apps / explorer / fixtures / przyciski.xml
index 2065b15..afa1deb 100755 (executable)
       <object pk="24"/>
     </field>
   </object>
       <object pk="24"/>
     </field>
   </object>
+  <object pk="88" model="toolbar.button">
+    <field type="CharField" name="label">Wydziel</field>
+    <field type="SlugField" name="slug">split-text-from-xmleditor</field>
+    <field type="TextField" name="params">[]</field>
+    <field to="toolbar.scriptlet" name="scriptlet" rel="ManyToOneRel">show_splitmodal</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="23"/>
+    </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>
   <object pk="77" model="toolbar.button">
     <field type="CharField" name="label">Zamień cudzysłowy</field>
     <field type="SlugField" name="slug">zamien-cudzyslowy</field>
@@ -1177,4 +1190,39 @@ if (!text) {
 
 panel.fireEvent('contentChanged');</field>
   </object>
 
 panel.fireEvent('contentChanged');</field>
   </object>
+  <object pk="show_splitmodal" model="toolbar.scriptlet">
+    <field type="TextField" name="code">var cm = panel.texteditor;
+
+cm.focus();
+
+var text = cm.selection();
+
+if(!text) return;
+
+
+
+cm.replaceSelection('&lt;include-tag-placeholder /&gt;');
+
+var fulltext = cm.getCode();
+
+
+
+$('#split-dialog').jqmShow({
+
+    selection: text, fulltext: fulltext,
+
+    success: function(uri) {
+
+        editor.refreshPanels();
+
+    },
+
+    failure: function() { cm.undo(); } 
+
+}) ;
+
+
+
+</field>
+  </object>
 </django-objects>
 </django-objects>