Initial Commit Update Telerik
22
LPWeb20/RichtextEditor/plugins/mobilesidebar/__sample.xml
Normal file
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../core/jsml.xsd">
|
||||
|
||||
|
||||
<panel jsml-class="_sample_dialog" dock="fill" margin="12" padding="12" back_color="green" overflow="visible">
|
||||
<label dock="fill" margin="30" back_color="white" text="Hello World" font="Normal 29pt Arial" vertical_align="middle" horizontal_align="center" cursor="pointer">
|
||||
<attach name="click">
|
||||
<![CDATA[
|
||||
editor.AppendHTML("<p>Hello World ! <p>");
|
||||
]]>
|
||||
</attach>
|
||||
</label>
|
||||
<attach name="keydown" arguments="je,e">
|
||||
if(e.keyCode==27)dialog.close();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="_sample_dialog" />
|
||||
|
||||
|
||||
</jsml>
|
||||
52
LPWeb20/RichtextEditor/plugins/mobilesidebar/_dialog.xml
Normal file
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../core/jsml.xsd">
|
||||
|
||||
|
||||
<panel jsml-class="sidebar_dialog" jsml-base="sidebarmenu" dock="fill" overflow="scroll">
|
||||
<panel jsml-base="sidebarmenuitem" text="Back">
|
||||
<attach name="click">
|
||||
<![CDATA[
|
||||
if(dialog.onqueryclose)
|
||||
if(false===dialog.onqueryclose())
|
||||
return;
|
||||
dialog.close();
|
||||
]]>
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-member="dialog" jsml-local="dialog" dock="fill">
|
||||
<method name="close">
|
||||
self.invoke_event("closing");
|
||||
sidebar.back();
|
||||
</method>
|
||||
<property name="title">
|
||||
<get>
|
||||
return self.get_text();
|
||||
</get>
|
||||
<set>
|
||||
self.set_text(value);
|
||||
</set>
|
||||
</property>
|
||||
<method name="hidemask">
|
||||
|
||||
</method>
|
||||
<method name="resize" arguments="width,height">
|
||||
if(width)self.set_min_width(width);
|
||||
if(height)self.set_min_height(height);
|
||||
</method>
|
||||
<method name="adjustsize">
|
||||
|
||||
</method>
|
||||
<method name="expandsize" arguments="width,height">
|
||||
|
||||
</method>
|
||||
</panel>
|
||||
|
||||
</panel>
|
||||
|
||||
|
||||
<panel jsml-base="sidebar_dialog" />
|
||||
|
||||
|
||||
</jsml>
|
||||
32
LPWeb20/RichtextEditor/plugins/mobilesidebar/common.xml
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../core/jsml.xsd">
|
||||
|
||||
|
||||
<panel jsml-class="sidebar_common" jsml-base="sidebarmenu" dock="fill">
|
||||
<panel jsml-base="sidebarmenuitem" text="Back">
|
||||
<attach name="click">
|
||||
sidebar.back();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" command="new" text="New document" />
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" command="CleanCode" text="@CLEANCODE" imagename="cleanup" />
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" command="ExecPlugin" arguments="pageproperties" text="@PAGEPROPERTIES" imagename="properties" />
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" command="ExecPlugin" arguments="syntaxhighlighter" text="@SYNTAXHIGHLIGHTER" imagename="code" />
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" arrow="true" text="Debug">
|
||||
<attach name="click">
|
||||
sidebar.loadpanel("debug.xml");
|
||||
</attach>
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
|
||||
<panel jsml-base="sidebar_common" />
|
||||
|
||||
|
||||
</jsml>
|
||||
28
LPWeb20/RichtextEditor/plugins/mobilesidebar/debug.xml
Normal file
@@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../core/jsml.xsd">
|
||||
|
||||
|
||||
<panel jsml-class="sidebar_debug" jsml-base="sidebarmenu" dock="fill">
|
||||
<panel jsml-base="sidebarmenuitem" text="Back">
|
||||
<attach name="click">
|
||||
sidebar.back();
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" text="editor.GetText">
|
||||
<attach name="click">
|
||||
alert(editor.GetText());
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" text="iframe HTML">
|
||||
<attach name="click">
|
||||
alert(editor.GetWindow().document.documentElement.outerHTML);
|
||||
</attach>
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
|
||||
<panel jsml-base="sidebar_debug" />
|
||||
|
||||
|
||||
</jsml>
|
||||
37
LPWeb20/RichtextEditor/plugins/mobilesidebar/fontname.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../core/jsml.xsd">
|
||||
|
||||
|
||||
<panel jsml-class="sidebar_fontname" jsml-base="sidebarmenu" dock="fill">
|
||||
<panel jsml-base="sidebarmenuitem" text="Back">
|
||||
<attach name="click">
|
||||
sidebar.back();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" command="FontName" arguments="!" text="Default" />
|
||||
|
||||
<initialize>
|
||||
<![CDATA[
|
||||
var namelist=editor._config.fontnamelist||'Arial,Verdana,Tahoma,Segoe UI,Sans-Serif,Comic Sans MS,Courier New,Georgia,Impact,Lucida Console,Times New Roman,Trebuchet MS,Monospace';
|
||||
namelist=namelist.split(',');
|
||||
for(var i=0;i<namelist.length;i++)
|
||||
{
|
||||
var item=jsml.class_create_instance("sidebarmenuitem");
|
||||
item.set_command("FontName")
|
||||
item.set_arguments(namelist[i])
|
||||
item.set_text(namelist[i]);
|
||||
item.label._estyle.fontFamily=namelist[i];
|
||||
self.append_child(item);
|
||||
}
|
||||
]]>
|
||||
</initialize>
|
||||
|
||||
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebar_fontname" />
|
||||
|
||||
|
||||
</jsml>
|
||||
37
LPWeb20/RichtextEditor/plugins/mobilesidebar/fontsize.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../core/jsml.xsd">
|
||||
|
||||
|
||||
<panel jsml-class="sidebar_fontsize" jsml-base="sidebarmenu" dock="fill">
|
||||
<panel jsml-base="sidebarmenuitem" text="Back">
|
||||
<attach name="click">
|
||||
sidebar.back();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" command="FontSize" arguments="!" text="Default" />
|
||||
|
||||
<initialize>
|
||||
<![CDATA[
|
||||
var sizelist=editor._config.fontsizelist||'8px,9px,10px,11px,12px,13px,14px,16px,18px,20px,24px,36px';
|
||||
sizelist=sizelist.split(',');
|
||||
for(var i=0;i<sizelist.length;i++)
|
||||
{
|
||||
var item=jsml.class_create_instance("sidebarmenuitem");
|
||||
item.set_command("FontSize")
|
||||
item.set_arguments(sizelist[i])
|
||||
item.set_text(sizelist[i]);
|
||||
item.label.set_font_size(sizelist[i]);
|
||||
self.append_child(item);
|
||||
}
|
||||
]]>
|
||||
</initialize>
|
||||
|
||||
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebar_fontsize" />
|
||||
|
||||
|
||||
</jsml>
|
||||
70
LPWeb20/RichtextEditor/plugins/mobilesidebar/format.xml
Normal file
@@ -0,0 +1,70 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../core/jsml.xsd">
|
||||
|
||||
|
||||
<panel jsml-class="sidebar_format" jsml-base="sidebarmenu" dock="fill">
|
||||
<panel jsml-base="sidebarmenuitem" text="Back">
|
||||
<attach name="click">
|
||||
sidebar.back();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" text="@TEXTCOLOR" imagename="forecolor">
|
||||
<attach name="click">
|
||||
<![CDATA[
|
||||
var cmd = "ForeColor";
|
||||
var option = { command: cmd, preview: true }
|
||||
option.setcolor = this.delegate(function (val) {
|
||||
editor.ExecCommand(cmd, val);
|
||||
});
|
||||
editor.ExecShowXmlDialog(self.get_element(), "colorpicker.xml", option);
|
||||
]]>
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" text="@BACKCOLOR" imagename="backcolor">
|
||||
<attach name="click">
|
||||
<![CDATA[
|
||||
var cmd = "BackColor";
|
||||
var option = { command: cmd, preview: true }
|
||||
option.setcolor = this.delegate(function (val) {
|
||||
editor.ExecCommand(cmd, val);
|
||||
});
|
||||
editor.ExecShowXmlDialog(self.get_element(), "colorpicker.xml", option);
|
||||
]]>
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" arrow="true" text="@FontName" imagename="m_font">
|
||||
<attach name="click">
|
||||
sidebar.loadpanel("fontname.xml");
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" arrow="true" text="@FontSize" imagename="m_fontsize">
|
||||
<attach name="click">
|
||||
sidebar.loadpanel("fontsize.xml");
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" text="@BOLD" command="BOLD" />
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" text="@ITALIC" command="ITALIC" />
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" text="@UNDERLINE" command="UNDERLINE" imagename="under" />
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" command="Linethrough" text="@LINETHROUGH" imagename="strike" />
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" command="Overline" text="@OVERLINE" />
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" command="Superscript" text="@SUPERSCRIPT" />
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" command="Subscript" text="@SUBSCRIPT" />
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" text="@REMOVEFORMAT" command="REMOVEFORMAT" imagename="unformat" />
|
||||
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebar_format" />
|
||||
|
||||
|
||||
</jsml>
|
||||
BIN
LPWeb20/RichtextEditor/plugins/mobilesidebar/images/12close.png
Normal file
|
After Width: | Height: | Size: 245 B |
|
After Width: | Height: | Size: 336 B |
BIN
LPWeb20/RichtextEditor/plugins/mobilesidebar/images/arrow-l.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
LPWeb20/RichtextEditor/plugins/mobilesidebar/images/arrow-r.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
LPWeb20/RichtextEditor/plugins/mobilesidebar/images/close.png
Normal file
|
After Width: | Height: | Size: 418 B |
BIN
LPWeb20/RichtextEditor/plugins/mobilesidebar/images/corner.png
Normal file
|
After Width: | Height: | Size: 265 B |
|
After Width: | Height: | Size: 225 B |
BIN
LPWeb20/RichtextEditor/plugins/mobilesidebar/images/reset.gif
Normal file
|
After Width: | Height: | Size: 100 B |
|
After Width: | Height: | Size: 58 B |
BIN
LPWeb20/RichtextEditor/plugins/mobilesidebar/images/url_icon.gif
Normal file
|
After Width: | Height: | Size: 113 B |
44
LPWeb20/RichtextEditor/plugins/mobilesidebar/insert.xml
Normal file
@@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../core/jsml.xsd">
|
||||
|
||||
|
||||
<panel jsml-class="sidebar_insert" jsml-base="sidebarmenu" dock="fill">
|
||||
<panel jsml-base="sidebarmenuitem" text="Back">
|
||||
<attach name="click">
|
||||
sidebar.back();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertHorizontalRule" text="@INSERTHORIZONTALRULE" imagename="rule" />
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertLink" text="@INSERTLINK" imagename="link" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertAnchor" text="@INSERTANCHOR" imagename="anchor" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertDate" text="@INSERTDATE" imagename="insertdate" />
|
||||
<panel jsml-base="sidebarmenuitem" command="ExecPlugin" arguments="insertchars" text="@INSERTCHARS" imagename="specialchar" />
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertGallery" text="@INSERTGALLERY" imagename="gallery" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertImage" text="@INSERTIMAGE" imagename="image" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertVideo" text="@INSERTVIDEO" imagename="media" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertDocument" text="@INSERTDOCUMENT" imagename="document" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertTemplate" text="@INSERTTEMPLATE" imagename="template" />
|
||||
<panel jsml-base="sidebarmenuitem" command="ExecPlugin" arguments="syntaxhighlighter" text="@SYNTAXHIGHLIGHTER" imagename="code" />
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertTable" text="@INSERTTABLE" />
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertBox" text="@INSERTBOX" imagename="box" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertFieldSet" text="@INSERTFIELDSET" imagename="groupbox" />
|
||||
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" arrow="true" text="@INSERTFORM" imagename="InsertForm">
|
||||
<attach name="click">
|
||||
sidebar.loadpanel("insertform.xml");
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebar_insert" />
|
||||
|
||||
|
||||
</jsml>
|
||||
34
LPWeb20/RichtextEditor/plugins/mobilesidebar/insertform.xml
Normal file
@@ -0,0 +1,34 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../core/jsml.xsd">
|
||||
|
||||
|
||||
<panel jsml-class="sidebar_insertform" jsml-base="sidebarmenu" dock="fill">
|
||||
<panel jsml-base="sidebarmenuitem" text="Back">
|
||||
<attach name="click">
|
||||
sidebar.back();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertForm" text="@INSERTFORM" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertTextarea" text="@INSERTTEXTAREA" imagename="textarea" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertInpText" text="@INSERTINPTEXT" imagename="textbox" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertInpPassword" text="@INSERTINPPASSWORD" imagename="passwordfield" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertInpHidden" text="@INSERTINPHIDDEN" imagename="hiddenfield" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertInpFile" text="@INSERTINPFILE" imagename="document"/>
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertInpImage" text="@INSERTINPIMAGE" imagename="image" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertInpReset" text="@INSERTINPRESET" imagename="reset" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertInpSubmit" text="@INSERTINPSUBMIT" imagename="submit" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertRadioBox" text="@INSERTRADIOBOX" imagename="optionbutton" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertCheckbox" text="@INSERTCHECKBOX" imagename="checkbox" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertInpButton" text="@INSERTINPBUTTON" imagename="pushbutton" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertButton" text="@INSERTBUTTON" imagename="pushbutton" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertDropDown" text="@INSERTDROPDOWN" imagename="dropdownbox" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertListbox" text="@INSERTLISTBOX" imagename="listbox" />
|
||||
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebar_insertform" />
|
||||
|
||||
|
||||
</jsml>
|
||||
31
LPWeb20/RichtextEditor/plugins/mobilesidebar/insertlist.xml
Normal file
@@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../core/jsml.xsd">
|
||||
|
||||
|
||||
<panel jsml-class="sidebar_insertlist" jsml-base="sidebarmenu" dock="fill">
|
||||
<panel jsml-base="sidebarmenuitem" text="Back">
|
||||
<attach name="click">
|
||||
sidebar.back();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertOrderedList" arguments="decimal" noactive="1" text="1,2,3,4,5" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertOrderedList" arguments="lower-latin" noactive="1" text="a,b,c,d,e" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertOrderedList" arguments="lower-roman" noactive="1" text="ⅰ,ⅱ,ⅲ,ⅳ,ⅴ" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertOrderedList" arguments="upper-latin" noactive="1" text="A,B,C,D,E" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertOrderedList" arguments="upper-roman" noactive="1" text="Ⅰ,Ⅱ,ⅢⅢ,Ⅳ,Ⅴ" />
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertUnorderedList" arguments="disc" noactive="1" imagename="ul-disc" text="@UL_DISC" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertUnorderedList" arguments="circle" noactive="1" imagename="ul-circle" text="@UL_CIRCLE" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertUnorderedList" arguments="square" noactive="1" imagename="ul-square" text="@UL_SQUARE" />
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" command="FormatBlock" arguments="p" text="Cancel List"></panel>
|
||||
|
||||
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebar_insertlist" />
|
||||
|
||||
|
||||
</jsml>
|
||||
37
LPWeb20/RichtextEditor/plugins/mobilesidebar/insertwhere.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../core/jsml.xsd">
|
||||
|
||||
|
||||
<panel jsml-class="sidebar_insertwhere" jsml-base="sidebarmenu" dock="fill">
|
||||
<panel jsml-base="sidebarmenuitem" text="Back">
|
||||
<attach name="click">
|
||||
sidebar.back();
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" text="To current position">
|
||||
<attach name="click">
|
||||
sidebar.back();
|
||||
wherecallback();
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" text="To document front">
|
||||
<attach name="click">
|
||||
sidebar.back();
|
||||
editor.MoveToDocumentBegin();
|
||||
wherecallback();
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" text="To document end">
|
||||
<attach name="click">
|
||||
editor.MoveToDocumentEnd();
|
||||
sidebar.back();
|
||||
wherecallback();
|
||||
</attach>
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebar_insertwhere" />
|
||||
|
||||
|
||||
</jsml>
|
||||
45
LPWeb20/RichtextEditor/plugins/mobilesidebar/maincontrol.xml
Normal file
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../core/jsml.xsd">
|
||||
|
||||
|
||||
<panel jsml-class="sidebar_maincontrol" jsml-base="sidebarmenu" dock="fill">
|
||||
<panel jsml-base="sidebarmenuitem" text="Back">
|
||||
<attach name="click">
|
||||
sidebar.back();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" text="Cut" imagename="cut">
|
||||
<attach name="click">
|
||||
editor._mobileclipboard=editor.GetPointNode().GetHtmlCode();
|
||||
editor.GetPointNode().RemoveNode(true);
|
||||
sidebar.collapse();
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" text="Copy" imagename="copy">
|
||||
<attach name="click">
|
||||
editor._mobileclipboard=editor.GetPointNode().GetHtmlCode();
|
||||
sidebar.collapse();
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" text="Delete" imagename="delete">
|
||||
<attach name="click">
|
||||
editor.GetPointNode().RemoveNode(true);
|
||||
sidebar.collapse();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" text="Properties" imagename="properties">
|
||||
<attach name="click">
|
||||
editor.ShowPropertiesDialog(editor.GetPointNode())
|
||||
sidebar.collapse();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebar_maincontrol" />
|
||||
|
||||
|
||||
</jsml>
|
||||
85
LPWeb20/RichtextEditor/plugins/mobilesidebar/mainpoint.xml
Normal file
@@ -0,0 +1,85 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../core/jsml.xsd">
|
||||
|
||||
|
||||
<panel jsml-class="sidebar_mainpoint" jsml-base="sidebarmenu" dock="fill">
|
||||
<panel jsml-base="sidebarmenuitem" text="Back">
|
||||
<attach name="click">
|
||||
sidebar.back();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" text="Paste" imagename="m_paste">
|
||||
<attach name="click">
|
||||
<![CDATA[
|
||||
if(!editor._mobileclipboard)
|
||||
return sidebar.collapse();;
|
||||
var html=editor.FilterByPasteCommand(editor._mobileclipboard,"paste");
|
||||
sidebar.loadpanel("insertwhere.xml",{wherefrom:"typetext",wherecallback:function(){
|
||||
sidebar.collapse();
|
||||
editor.InsertHTML(html);
|
||||
}});
|
||||
]]>
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" text="Type text" imagename="m_edit">
|
||||
<attach name="click">
|
||||
sidebar.loadpanel("typetext.xml");
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" text="Upload image" imagename="m_upload">
|
||||
<attach name="click">
|
||||
sidebar.loadpanel("uploadimage.xml");
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" arrow="true" text="Insert">
|
||||
<attach name="click">
|
||||
sidebar.loadpanel("insert.xml");
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" arrow="true" text="Common">
|
||||
<attach name="click">
|
||||
sidebar.loadpanel("common.xml");
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" arrow="true" text="Paragraph">
|
||||
<attach name="click">
|
||||
sidebar.loadpanel("paragraph.xml");
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" arrow="true" text="Tag List">
|
||||
<attach name="click">
|
||||
sidebar.loadpanel("taglist.xml");
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<!--
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" text="Insert <p>">
|
||||
<attach name="click">
|
||||
editor.ExecCommand("insertparagraph");
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" text="Insert <hr>">
|
||||
<attach name="click">
|
||||
editor.ExecCommand("inserthorizontalrule");
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" text="Insert <br>">
|
||||
<attach name="click">
|
||||
editor.ExecCommand("insertbreak");
|
||||
</attach>
|
||||
</panel>
|
||||
-->
|
||||
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebar_mainpoint" />
|
||||
|
||||
|
||||
</jsml>
|
||||
52
LPWeb20/RichtextEditor/plugins/mobilesidebar/mainrange.xml
Normal file
@@ -0,0 +1,52 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../core/jsml.xsd">
|
||||
|
||||
|
||||
<panel jsml-class="sidebar_mainrange" jsml-base="sidebarmenu" dock="fill">
|
||||
<panel jsml-base="sidebarmenuitem" text="Back">
|
||||
<attach name="click">
|
||||
sidebar.back();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" text="Cut" imagename="cut">
|
||||
<attach name="click">
|
||||
editor._mobileclipboard=editor.ExtractRangeHTML(true);
|
||||
sidebar.collapse();
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" text="Copy" imagename="copy">
|
||||
<attach name="click">
|
||||
editor._mobileclipboard=editor.ExtractRangeHTML(false);
|
||||
sidebar.collapse();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" text="Replace text">
|
||||
<attach name="click">
|
||||
sidebar.loadpanel("typetext.xml");
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" arrow="true" text="Format">
|
||||
<attach name="click">
|
||||
sidebar.loadpanel("format.xml");
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" arrow="true" text="Common">
|
||||
<attach name="click">
|
||||
sidebar.loadpanel("common.xml");
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" arrow="true" text="Paragraph">
|
||||
<attach name="click">
|
||||
sidebar.loadpanel("paragraph.xml");
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebar_mainrange" />
|
||||
|
||||
|
||||
</jsml>
|
||||
36
LPWeb20/RichtextEditor/plugins/mobilesidebar/paragraph.xml
Normal file
@@ -0,0 +1,36 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../core/jsml.xsd">
|
||||
|
||||
|
||||
<panel jsml-class="sidebar_paragraph" jsml-base="sidebarmenu" dock="fill">
|
||||
<panel jsml-base="sidebarmenuitem" text="Back">
|
||||
<attach name="click">
|
||||
sidebar.back();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<!--
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertOrderedList" text="@ORDEREDLIST" imagename="numlist" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertUnorderedList" text="@UNORDEREDLIST" imagename="bullist" />
|
||||
-->
|
||||
<panel jsml-base="sidebarmenuitem" arrow="true" text="Insert List" imagename="numlist">
|
||||
<attach name="click">
|
||||
sidebar.loadpanel("insertlist.xml");
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" command="OUTDENT" text="@OUTDENT" />
|
||||
<panel jsml-base="sidebarmenuitem" command="Indent" text="@INDENT" />
|
||||
<panel jsml-base="sidebarmenuitem" command="InsertBlockQuote" text="@INSERTBLOCKQUOTE" imagename="blockquote" />
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" command="JustifyLeft" text="@JUSTIFYLEFT" imagename="left" />
|
||||
<panel jsml-base="sidebarmenuitem" command="JustifyCenter" text="@JUSTIFYCENTER" imagename="center" />
|
||||
<panel jsml-base="sidebarmenuitem" command="JustifyRight" text="@JUSTIFYRIGHT" imagename="right" />
|
||||
<panel jsml-base="sidebarmenuitem" command="JustifyFull" text="@JUSTIFYFULL" />
|
||||
<panel jsml-base="sidebarmenuitem" command="JustifyNone" text="@JUSTIFYNONE" noactive="true" />
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebar_paragraph" />
|
||||
|
||||
|
||||
</jsml>
|
||||
657
LPWeb20/RichtextEditor/plugins/mobilesidebar/plugin.xml
Normal file
@@ -0,0 +1,657 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../../core/jsml.xsd">
|
||||
|
||||
<panel jsml-class="sidebarmenu" css_class="sidebarmenu" padding="3,3,35,2" overflow="scroll">
|
||||
|
||||
<jsml-ref name="rteborderstyle"/>
|
||||
|
||||
<initialize>
|
||||
self._element.oncontextmenu=jsml.cancel_event_function;
|
||||
</initialize>
|
||||
|
||||
</panel>
|
||||
|
||||
<panel jsml-class="sidebarmenuitem" css_class="menuitem" dock="top" height="36" padding="2,32,2,0" overflow_x="visible" cursor="pointer" unselectable="true">
|
||||
<image jsml-member="image" css_class="menuitemimage" dock="left" width="32" overflow="none" zoom="both"></image>
|
||||
<image jsml-member="arrow" css_class="menuitemarrow" dock="right" width="18" vertical_align="middle" overflow="none" src="{folder}images/arrow_r.gif" visible="false" />
|
||||
<label jsml-member="label" css_class="menuitemlabel" dock="fill" font_size="18px" overflow_x="visible" margin="0,0,0,6" vertical_align="middle" cursor="pointer"/>
|
||||
|
||||
<jsml-ref name="rtebuttoncontrol" />
|
||||
<jsml-ref name="rtetoolbarcontrol" />
|
||||
|
||||
<attach name="touchstart" arguments="jevent,devent">
|
||||
self._isclicked=true;
|
||||
self.invoke_event("tooglecssclass","clicked",self._isclicked);
|
||||
</attach>
|
||||
<attach name="touchend,touchcancel">
|
||||
self._isclicked=false;
|
||||
self.invoke_event("tooglecssclass","clicked",self._isclicked);
|
||||
</attach>
|
||||
|
||||
|
||||
<initialize>
|
||||
self._dontuseindex=true;
|
||||
</initialize>
|
||||
|
||||
<attach name="tooglecssclass" arguments="jevent,name,mode">
|
||||
self.toggle_css_class("menuitem_"+name,mode);
|
||||
</attach>
|
||||
|
||||
<property name="src">
|
||||
<get>return self.image.get_src();</get>
|
||||
<set>self.image.set_src(value);</set>
|
||||
</property>
|
||||
<property name="text">
|
||||
<get>return self.label.get_text();</get>
|
||||
<set>self.label.set_text(value);</set>
|
||||
</property>
|
||||
<property name="htmlcode">
|
||||
<get>return self.label._content.innerHTML;</get>
|
||||
<set>self.label._content.innerHTML=value;self.label.invoke_notify_content();</set>
|
||||
</property>
|
||||
<property name="arrow">
|
||||
<get>
|
||||
return self.arrow.get_visible();
|
||||
</get>
|
||||
<set>
|
||||
self.arrow.set_visible(value);
|
||||
</set>
|
||||
</property>
|
||||
</panel>
|
||||
|
||||
<image jsml-class="sidebarbutton" width="28" height="28" zoom="both">
|
||||
<jsml-ref name="rtebuttoncontrol" />
|
||||
<attach name="tooglecssclass" arguments="jevent,name,mode">
|
||||
self.toggle_css_class("menuitem_"+name,mode);
|
||||
</attach>
|
||||
</image>
|
||||
|
||||
<panel jsml-class="rte_plugin_msbcursoricon" visible="false" width="20" height="20">
|
||||
<image dock="fill" src="{folder}images/slider-handle-up.png" />
|
||||
<attach name="touchstart" arguments="je,devent">
|
||||
<![CDATA[
|
||||
devent.cancel_default();
|
||||
|
||||
var _x=devent.touches[0].clientX;
|
||||
var _y=devent.touches[0].clientY;
|
||||
var ox=this.get_offset_x();
|
||||
var oy=this.get_offset_y();
|
||||
|
||||
function update_position(moveevent)
|
||||
{
|
||||
var x=moveevent.touches[0].clientX;
|
||||
var y=moveevent.touches[0].clientY;
|
||||
|
||||
jsml.suppend_layout();
|
||||
self.set_offset_x(ox+x-_x);
|
||||
self.set_offset_y(oy+y-_y);
|
||||
jsml.resume_layout();
|
||||
|
||||
editor.SelectForPoint(self.get_left()+self.get_offset_x()+10,self.get_top()+self.get_offset_y()-20);
|
||||
}
|
||||
function releasehandler()
|
||||
{
|
||||
self.moving=false;
|
||||
self.AdjustPosition();
|
||||
}
|
||||
|
||||
self.moving=true;
|
||||
jsml.startcapture(update_position,releasehandler,null,devent);
|
||||
|
||||
]]>
|
||||
</attach>
|
||||
<method name="AdjustPosition">
|
||||
<![CDATA[
|
||||
|
||||
if(self.moving)return;
|
||||
|
||||
var editor=self.editor;
|
||||
var seltype=editor.GetSelectionType();
|
||||
|
||||
function GetRangeRects()
|
||||
{
|
||||
if(seltype!="Point"&&seltype!="Range")
|
||||
return;
|
||||
if(seltype=="Range"&&!editor.IsCommandActive("RangeSelect"))
|
||||
return;
|
||||
if(!editor.GetWindow())
|
||||
return;
|
||||
var sel=editor.GetWindow().getSelection();
|
||||
if(sel.rangeCount==0)
|
||||
return;
|
||||
var rects=editor.GetRangeRects(sel.getRangeAt(0));
|
||||
if(!rects.length)
|
||||
return;
|
||||
return rects;
|
||||
}
|
||||
|
||||
var rects=GetRangeRects();
|
||||
if(!rects)
|
||||
return self.set_visible(false);
|
||||
|
||||
var start=true;
|
||||
if(seltype=="Range")
|
||||
{
|
||||
var sn=editor.GetRangeSelectNode();
|
||||
var so=editor.GetRangeSelectOffset();
|
||||
var rn=editor.GetRangeNode();
|
||||
var ro=editor.GetRangeOffset();
|
||||
if(sn==rn&&so==ro)
|
||||
start=true;
|
||||
else
|
||||
start=false;
|
||||
}
|
||||
|
||||
var l,t;
|
||||
|
||||
if(start)
|
||||
{
|
||||
var r=rects[0];
|
||||
l=r.left;
|
||||
t=r.top+r.height;
|
||||
}
|
||||
else
|
||||
{
|
||||
var r=rects[rects.length-1];
|
||||
l=r.left+r.width;
|
||||
t=r.top+r.height;
|
||||
}
|
||||
|
||||
t+=8;
|
||||
l-=10;
|
||||
|
||||
jsml.suppend_layout();
|
||||
self.set_offset_x(0);
|
||||
self.set_offset_y(0);
|
||||
self.set_left(l);
|
||||
self.set_top(t);
|
||||
self.set_visible(l>0);
|
||||
jsml.resume_layout();
|
||||
]]>
|
||||
</method>
|
||||
<attach name="editor_ready" arguments="je,editor">
|
||||
<![CDATA[
|
||||
self.editor=editor;
|
||||
editor.AttachEvent("SelectionChanged",function()
|
||||
{
|
||||
self.AdjustPosition();
|
||||
});
|
||||
editor.AttachEvent("RangeSelectChanged",function()
|
||||
{
|
||||
self.AdjustPosition();
|
||||
});
|
||||
]]>
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-class="rte_plugin_msbfloatpanel" visible="false">
|
||||
<panel jsml-member="rightpanel" dock="right" width="36">
|
||||
<image jsml-base="sidebarbutton" src="{folder}plugins/{plugin}/images/arrow-r.png" dock="top" margin="36,4,4,4">
|
||||
<attach name="click">
|
||||
instance.bar.collapse();
|
||||
</attach>
|
||||
</image>
|
||||
</panel>
|
||||
<panel jsml-member="containerpanel" dock="fill" overflow="visible">
|
||||
<attach name="touchmove" arguments="je,de">
|
||||
<![CDATA[
|
||||
//if(de.touches.length==1)return de.cancel();
|
||||
]]>
|
||||
</attach>
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
<panel jsml-class="rte_plugin_mobilesidebar" visible="false" overflow="visible">
|
||||
|
||||
<panel jsml-member="collapsedpanel" dock="left" width="36">
|
||||
|
||||
<image jsml-base="sidebarbutton" src="{folder}images/external.gif" dock="top" margin="36,4,4,4">
|
||||
<attach name="click">
|
||||
instance.expand();
|
||||
</attach>
|
||||
</image>
|
||||
|
||||
<panel dock="fill" jsml-member="panel_control" visible="false">
|
||||
<image jsml-base="sidebarbutton" src="{folder}images/properties.png" dock="top" margin="4">
|
||||
<attach name="click">
|
||||
editor.ShowPropertiesDialog(editor.GetPointNode())
|
||||
</attach>
|
||||
</image>
|
||||
<image jsml-base="sidebarbutton" src="{folder}images/cut.png" dock="top" margin="4">
|
||||
<attach name="click">
|
||||
editor._mobileclipboard=editor.GetPointNode().GetHtmlCode();
|
||||
editor.GetPointNode().RemoveNode(true);
|
||||
</attach>
|
||||
</image>
|
||||
<image jsml-base="sidebarbutton" src="{folder}images/copy.png" dock="top" margin="4">
|
||||
<attach name="click">
|
||||
editor._mobileclipboard=editor.GetPointNode().GetHtmlCode()
|
||||
</attach>
|
||||
</image>
|
||||
<image jsml-base="sidebarbutton" src="{folder}images/delete.png" dock="top" margin="4">
|
||||
<attach name="click">
|
||||
editor.GetPointNode().RemoveNode(true);
|
||||
</attach>
|
||||
</image>
|
||||
</panel>
|
||||
|
||||
<panel dock="fill" jsml-member="panel_point" visible="false">
|
||||
<image jsml-base="sidebarbutton" src="{folder}images/m_select.png" dock="top" margin="4">
|
||||
<attach name="click">
|
||||
<![CDATA[
|
||||
if(editor.IsCommandActive("RangeSelect"))
|
||||
{
|
||||
editor.ToggleRangeSelect();
|
||||
}
|
||||
else
|
||||
{
|
||||
instance.expand("select.xml");
|
||||
}
|
||||
]]>
|
||||
</attach>
|
||||
<attach name="editor_ready" arguments="je,editor">
|
||||
<![CDATA[
|
||||
editor.AttachEvent("RangeSelectChanged",function()
|
||||
{
|
||||
self.set_checked(editor.IsCommandActive("RangeSelect"));
|
||||
});
|
||||
]]>
|
||||
</attach>
|
||||
</image>
|
||||
<image jsml-base="sidebarbutton" src="{folder}images/m_edit.png" dock="top" margin="4">
|
||||
<attach name="click">
|
||||
instance.expand("typetext.xml");
|
||||
</attach>
|
||||
</image>
|
||||
<image jsml-base="sidebarbutton" src="{folder}images/p.png" dock="top" margin="4">
|
||||
<attach name="click">
|
||||
editor.ExecCommand("insertparagraph");
|
||||
</attach>
|
||||
</image>
|
||||
<image jsml-base="sidebarbutton" src="{folder}images/break.png" dock="top" margin="4">
|
||||
<attach name="click">
|
||||
editor.ExecCommand("insertbreak");
|
||||
</attach>
|
||||
</image>
|
||||
<image jsml-base="sidebarbutton" src="{folder}images/backspace.png" dock="top" margin="4">
|
||||
<attach name="click">
|
||||
editor.DeleteToLeft();
|
||||
editor.RangeSyncToDom();
|
||||
</attach>
|
||||
</image>
|
||||
</panel>
|
||||
|
||||
<panel dock="fill" jsml-member="panel_range" visible="false">
|
||||
<image jsml-base="sidebarbutton" src="{folder}images/m_select.png" dock="top" margin="4">
|
||||
<attach name="click">
|
||||
<![CDATA[
|
||||
if(editor.IsCommandActive("RangeSelect"))
|
||||
{
|
||||
editor.CollapseRangeSelect();
|
||||
editor.ToggleRangeSelect();
|
||||
}
|
||||
else
|
||||
{
|
||||
editor.SetPointInside(editor.GetPointNode(),editor.GetPointOffset());
|
||||
instance.expand("select.xml");
|
||||
}
|
||||
]]>
|
||||
|
||||
</attach>
|
||||
<attach name="editor_ready" arguments="je,editor">
|
||||
<![CDATA[
|
||||
editor.AttachEvent("RangeSelectChanged",function()
|
||||
{
|
||||
self.set_checked(editor.IsCommandActive("RangeSelect"));
|
||||
});
|
||||
]]>
|
||||
</attach>
|
||||
</image>
|
||||
<image jsml-base="sidebarbutton" src="{folder}images/unformat.png" dock="top" margin="4">
|
||||
<attach name="click">
|
||||
instance.expand("format.xml");
|
||||
</attach>
|
||||
</image>
|
||||
<image jsml-base="sidebarbutton" src="{folder}images/cut.png" dock="top" margin="4">
|
||||
<attach name="click">
|
||||
editor._mobileclipboard=editor.ExtractRangeHTML(true);
|
||||
</attach>
|
||||
</image>
|
||||
<image jsml-base="sidebarbutton" src="{folder}images/copy.png" dock="top" margin="4">
|
||||
<attach name="click">
|
||||
editor._mobileclipboard=editor.ExtractRangeHTML(false);
|
||||
</attach>
|
||||
</image>
|
||||
|
||||
<image jsml-base="sidebarbutton" src="{folder}images/delete.png" dock="top" margin="4">
|
||||
<attach name="click">
|
||||
editor.DeleteSelection();
|
||||
editor.RangeSyncToDom();
|
||||
</attach>
|
||||
</image>
|
||||
</panel>
|
||||
|
||||
</panel>
|
||||
|
||||
|
||||
</panel>
|
||||
|
||||
<execute>
|
||||
<![CDATA[
|
||||
|
||||
var skindiv=editor._config.skin_div;
|
||||
var fp=jsml.class_create_instance("rte_plugin_msbfloatpanel")
|
||||
var bar=jsml.class_create_instance("rte_plugin_mobilesidebar");
|
||||
var cursor=jsml.class_create_instance("rte_plugin_msbcursoricon");
|
||||
fp.bar=bar;
|
||||
|
||||
plugin.bar=bar;
|
||||
plugin.fp=fp;
|
||||
|
||||
plugin.Execute=function(element,arg1,arg2)
|
||||
{
|
||||
|
||||
}
|
||||
plugin.LoadUI=function(ctrl,touchpanel)
|
||||
{
|
||||
ctrl.get_parent().append_child(fp);
|
||||
ctrl.append_child(bar);
|
||||
ctrl.append_child(cursor);
|
||||
|
||||
|
||||
fp.invoke_recursive("editor_ready",editor);
|
||||
bar.invoke_recursive("editor_ready",editor);
|
||||
cursor.invoke_recursive("editor_ready",editor);
|
||||
|
||||
var collapsed=true;
|
||||
var nextpanelfile;
|
||||
var bodyst=0;
|
||||
var bodysl=0;
|
||||
|
||||
bar.togglecollapse=function(noloadmainpanel)
|
||||
{
|
||||
jsml.suppend_layout();
|
||||
collapsed=!collapsed;
|
||||
|
||||
fp.set_visible(!collapsed)
|
||||
fp.set_back_color("#eeeeee");
|
||||
bar.set_back_color(collapsed?"":"#eeeeee");
|
||||
|
||||
try
|
||||
{
|
||||
if(collapsed)
|
||||
{
|
||||
document.body.scrollTop=bodyst;
|
||||
document.body.scrollLeft=bodysl;
|
||||
skindiv.style.zIndex=config.fullscreen_zindex;
|
||||
fp.containerpanel.dispose_children();
|
||||
}
|
||||
else
|
||||
{
|
||||
bodyst=document.body.scrollTop;
|
||||
bodysl=document.body.scrollLeft;
|
||||
skindiv.style.zIndex=editor._config.ctrltool_zindex+33;
|
||||
if(!noloadmainpanel)
|
||||
bar.loadmainpanel();
|
||||
}
|
||||
}
|
||||
finally
|
||||
{
|
||||
bar.UpdatePosCore();
|
||||
jsml.resume_layout();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bar.collapse=function()
|
||||
{
|
||||
if(!collapsed)bar.togglecollapse();
|
||||
}
|
||||
bar.expand=function(panelfile)
|
||||
{
|
||||
nextpanelfile=panelfile
|
||||
if(collapsed)bar.togglecollapse();
|
||||
}
|
||||
|
||||
bar.back=function()
|
||||
{
|
||||
var cs=fp.containerpanel.get_children();
|
||||
if(cs.length<2)
|
||||
return bar.collapse();
|
||||
cs[cs.length-2].set_visible(true);
|
||||
cs[cs.length-1].dispose();
|
||||
}
|
||||
|
||||
bar.loadpanel=function(file,vars,handler,handleinst)
|
||||
{
|
||||
if(!vars)vars={};
|
||||
var cs=fp.containerpanel.get_children();
|
||||
for(var i=0;i<cs.length;i++)
|
||||
cs[i].set_visible(false);
|
||||
function urlhandler(res,err)
|
||||
{
|
||||
if(err)cs[cs.length-1].set_visible(true);
|
||||
if(handler)handler(res,err)
|
||||
}
|
||||
function processinst(ctrl)
|
||||
{
|
||||
fp.containerpanel.append_child(ctrl);
|
||||
ctrl.invoke_recursive("editor_ready",editor);
|
||||
if(handleinst)handleinst(ctrl);
|
||||
}
|
||||
vars.plugin=plugin;
|
||||
vars.sidebar=bar;
|
||||
vars.editor=editor;
|
||||
editor._LoadXmlUrl("{folder}plugins/{plugin}/"+file+"?{timems}",urlhandler,processinst,vars);
|
||||
|
||||
if(collapsed)bar.togglecollapse(true);
|
||||
}
|
||||
|
||||
bar.loadmainpanel=function()
|
||||
{
|
||||
function urlhandler(res,err)
|
||||
{
|
||||
if(err)bar.back();
|
||||
}
|
||||
function processinst(ctrl)
|
||||
{
|
||||
fp.containerpanel.append_child(ctrl);
|
||||
ctrl.invoke_recursive("editor_ready",editor);
|
||||
}
|
||||
var vars={};
|
||||
vars.plugin=plugin;
|
||||
vars.sidebar=bar;
|
||||
vars.editor=editor;
|
||||
var file;
|
||||
if(nextpanelfile)
|
||||
file=nextpanelfile
|
||||
else
|
||||
file="main"+editor.GetSelectionType().toLowerCase()+".xml";
|
||||
editor._LoadXmlUrl("{folder}plugins/{plugin}/"+file+"?{timems}",urlhandler,processinst,vars);
|
||||
}
|
||||
|
||||
|
||||
editor.AttachEvent("ExecCommand",function()
|
||||
{
|
||||
bar.collapse();
|
||||
});
|
||||
editor.AttachEvent("ExecUICommand",function()
|
||||
{
|
||||
bar.collapse();
|
||||
});
|
||||
|
||||
bar.UpdatePosCore=function()
|
||||
{
|
||||
if(!bar.get_visible())return;
|
||||
jsml.suppend_layout();
|
||||
|
||||
var ct=ctrl.get_current_top()+1;
|
||||
|
||||
var w=jsml.get_body_rect().width;
|
||||
var x=Math.max(0,window.pageXOffset)+window.innerWidth-30;
|
||||
var cw=bar.collapsedpanel.get_demand_width();
|
||||
|
||||
var y=Math.max(0,window.pageYOffset);
|
||||
var h=ctrl.get_current_height();
|
||||
var ch=window.innerHeight;
|
||||
|
||||
if(fp.get_visible())
|
||||
{
|
||||
cw=window.innerWidth;
|
||||
fp.rightpanel.set_padding([ct,0,0,0]);
|
||||
fp.set_padding([y,0,h+ct-ch-y,0]);
|
||||
fp.set_left(x-cw);
|
||||
fp.set_width(cw);
|
||||
fp.set_height(h+ct);
|
||||
}
|
||||
|
||||
y=y-ct;
|
||||
if(y<0)
|
||||
{
|
||||
ch=ch+y;
|
||||
y=0;
|
||||
}
|
||||
|
||||
bar.set_padding([y,w-cw,h-ch-y,0]);
|
||||
bar.set_left(x-cw);
|
||||
bar.set_width(w);
|
||||
bar.set_height(h);
|
||||
|
||||
jsml.resume_layout();
|
||||
}
|
||||
|
||||
function ResetLayout()
|
||||
{
|
||||
var isvisible=editor.IsCommandActive("FullScreen");
|
||||
bar.set_visible(isvisible);
|
||||
if(!isvisible)
|
||||
{
|
||||
bar.collapse();
|
||||
}
|
||||
else
|
||||
{
|
||||
bar.UpdatePosCore();
|
||||
}
|
||||
}
|
||||
|
||||
ResetLayout()
|
||||
|
||||
editor.AttachEvent("FullScreenChanged",function()
|
||||
{
|
||||
ResetLayout()
|
||||
});
|
||||
//window.addEventListener("resize",ResetLayout,false);
|
||||
//window.addEventListener("scroll",ResetLayout,false);
|
||||
|
||||
function getscrinfo()
|
||||
{
|
||||
return window.pageXOffset+":"+window.pageYOffset+":"+window.innerWidth+":"+window.innerHeight;
|
||||
}
|
||||
plugin.lastscreeninfo=getscrinfo()
|
||||
window.setInterval(function()
|
||||
{
|
||||
var info=getscrinfo();
|
||||
if(plugin.lastscreeninfo!=info)
|
||||
{
|
||||
plugin.lastscreeninfo=info;
|
||||
clearTimeout(plugin.lsitimer);
|
||||
plugin.lsitimer=setTimeout(ResetLayout,50);
|
||||
}
|
||||
},10);
|
||||
|
||||
touchpanel.attach_event("touchstart",function()
|
||||
{
|
||||
bar.set_visible(false);
|
||||
});
|
||||
touchpanel.attach_event("touchend",function()
|
||||
{
|
||||
ResetLayout();
|
||||
});
|
||||
|
||||
function ShowSelectionPanel()
|
||||
{
|
||||
var type=editor.GetSelectionType();
|
||||
bar.panel_point.set_visible(type=="Point");
|
||||
bar.panel_range.set_visible(type=="Range");
|
||||
bar.panel_control.set_visible(type=="Control");
|
||||
}
|
||||
|
||||
editor.AttachEvent("SelectionChanged",function()
|
||||
{
|
||||
ShowSelectionPanel();
|
||||
});
|
||||
editor.AttachEvent("RangeSelectChanged",function()
|
||||
{
|
||||
});
|
||||
|
||||
ShowSelectionPanel();
|
||||
}
|
||||
|
||||
|
||||
editor.AttachEvent("UICommand",function(editor,e)
|
||||
{
|
||||
if(e.Arguments[0]=="UploadImage")
|
||||
{
|
||||
bar.collapse();
|
||||
bar.expand("uploadimage.xml");
|
||||
}
|
||||
});
|
||||
|
||||
var currentdialog;
|
||||
editor._LoadDialog_SavedBySidebar = editor._LoadDialog;
|
||||
|
||||
if(false)
|
||||
editor._LoadDialog=function(option,callback)
|
||||
{
|
||||
if(currentdialog)
|
||||
return editor._LoadDialog_SavedBySidebar(option,callback);
|
||||
|
||||
var dialog;
|
||||
if(!option)option={}
|
||||
|
||||
var urlhandler=editor.delegate(function(res,err)
|
||||
{
|
||||
if(!res)
|
||||
{
|
||||
if(option.callback)option.callback(res,err);
|
||||
if(err)setTimeout(function(){throw(err)},1);
|
||||
return;
|
||||
}
|
||||
|
||||
dialog.attach_event("disposing",function()
|
||||
{
|
||||
currentdialog=null;
|
||||
});
|
||||
|
||||
currentdialog=dialog;
|
||||
|
||||
if(callback)
|
||||
callback(dialog);
|
||||
});
|
||||
|
||||
var processinst=editor.delegate(function(inst){
|
||||
dialog=inst.dialog;
|
||||
dialog._rteconfig=editor._config;
|
||||
dialog._rteinstance=editor;
|
||||
|
||||
if(option.title)
|
||||
dialog.set_title(option.title);
|
||||
if(option.width&&option.height)
|
||||
dialog.resize(option.width,option.height);
|
||||
if(option.ondialoginit)
|
||||
option.ondialoginit(dialog);
|
||||
});
|
||||
|
||||
var dialogvars={editor:editor}
|
||||
|
||||
bar.loadpanel("_dialog.xml",dialogvars,urlhandler,processinst);
|
||||
|
||||
}
|
||||
|
||||
|
||||
]]>
|
||||
</execute>
|
||||
|
||||
|
||||
</jsml>
|
||||
72
LPWeb20/RichtextEditor/plugins/mobilesidebar/select.xml
Normal file
@@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../core/jsml.xsd">
|
||||
|
||||
|
||||
<panel jsml-class="sidebar_select" jsml-base="sidebarmenu" dock="fill">
|
||||
<panel jsml-base="sidebarmenuitem" text="Back">
|
||||
<attach name="click">
|
||||
sidebar.back();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" text="Start selecting a range">
|
||||
<attach name="click">
|
||||
editor.ToggleRangeSelect();
|
||||
sidebar.collapse();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<method name="additem" arguments="node">
|
||||
<![CDATA[
|
||||
var item=jsml.class_create_instance("sidebarmenuitem");
|
||||
if(node.nodeType==3)
|
||||
{
|
||||
var text=node.GetText();
|
||||
if(text.length>20)text=text.substring(0,18)+"..."
|
||||
item.set_text("Text: "+text);
|
||||
}
|
||||
else
|
||||
{
|
||||
var text=node.GetInnerText()
|
||||
if(text.length>20)text=text.substring(0,18)+"..."
|
||||
item.set_text("<"+node.GetName()+">: "+text);
|
||||
}
|
||||
|
||||
self.append_child(item);
|
||||
|
||||
item.attach_event("click",function()
|
||||
{
|
||||
if(node.IsControl())
|
||||
{
|
||||
editor.SelectControl(node);
|
||||
editor.RangeSyncToDom(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
editor.SelectContent(node);
|
||||
editor.RangeSyncToDom(true);
|
||||
}
|
||||
sidebar.collapse();
|
||||
})
|
||||
]]>
|
||||
</method>
|
||||
|
||||
<initialize>
|
||||
<![CDATA[
|
||||
var pn=editor.GetPointNode();
|
||||
if(!pn)return;
|
||||
for(;pn;pn=pn.GetParent())
|
||||
{
|
||||
self.additem(pn);
|
||||
}
|
||||
]]>
|
||||
</initialize>
|
||||
|
||||
</panel>
|
||||
|
||||
|
||||
<panel jsml-base="sidebar_select" />
|
||||
|
||||
|
||||
</jsml>
|
||||
54
LPWeb20/RichtextEditor/plugins/mobilesidebar/tagitem.xml
Normal file
@@ -0,0 +1,54 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../core/jsml.xsd">
|
||||
|
||||
|
||||
<panel jsml-class="sidebar_tagitem" jsml-base="sidebarmenu" dock="fill">
|
||||
<panel jsml-base="sidebarmenuitem" text="Back">
|
||||
<attach name="click">
|
||||
sidebar.back();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" text="Select" imagename="selectall">
|
||||
<attach name="click">
|
||||
if(node.IsControl()) editor.SelectControl(node);
|
||||
else editor.SelectContent(node);
|
||||
editor.RangeSyncToDom(true);
|
||||
sidebar.collapse();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" text="Cut" imagename="cut">
|
||||
<attach name="click">
|
||||
editor._mobileclipboard=node.GetHtmlCode();
|
||||
node.RemoveNode(true);
|
||||
sidebar.collapse();
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" text="Copy" imagename="copy">
|
||||
<attach name="click">
|
||||
editor._mobileclipboard=node.GetHtmlCode();
|
||||
sidebar.collapse();
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" text="Delete" imagename="delete">
|
||||
<attach name="click">
|
||||
node.RemoveNode(true);
|
||||
sidebar.collapse();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebarmenuitem" text="Properties" imagename="properties">
|
||||
<attach name="click">
|
||||
editor.ShowPropertiesDialog(node);
|
||||
sidebar.collapse();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebar_tagitem" />
|
||||
|
||||
|
||||
</jsml>
|
||||
48
LPWeb20/RichtextEditor/plugins/mobilesidebar/taglist.xml
Normal file
@@ -0,0 +1,48 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../core/jsml.xsd">
|
||||
|
||||
|
||||
<panel jsml-class="sidebar_taglist" jsml-base="sidebarmenu" dock="fill">
|
||||
<panel jsml-base="sidebarmenuitem" text="Back">
|
||||
<attach name="click">
|
||||
sidebar.back();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
|
||||
<method name="additem" arguments="node">
|
||||
<![CDATA[
|
||||
if(node.nodeType==3)
|
||||
return;
|
||||
if(node.GetNameLower()=="body")
|
||||
return;
|
||||
|
||||
var item=jsml.class_create_instance("sidebarmenuitem");
|
||||
item.set_text("<"+node.GetName()+">");
|
||||
self.append_child(item);
|
||||
item.attach_event("click",function()
|
||||
{
|
||||
sidebar.loadpanel("tagitem.xml",{node:node});
|
||||
})
|
||||
]]>
|
||||
</method>
|
||||
|
||||
<initialize>
|
||||
<![CDATA[
|
||||
var pn=editor.GetPointNode();
|
||||
if(!pn)return;
|
||||
for(;pn;pn=pn.GetParent())
|
||||
{
|
||||
self.additem(pn);
|
||||
}
|
||||
]]>
|
||||
</initialize>
|
||||
|
||||
</panel>
|
||||
|
||||
|
||||
<panel jsml-base="sidebar_taglist" />
|
||||
|
||||
|
||||
</jsml>
|
||||
64
LPWeb20/RichtextEditor/plugins/mobilesidebar/typetext.xml
Normal file
@@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../core/jsml.xsd">
|
||||
|
||||
|
||||
<panel jsml-class="sidebar_typetext" jsml-base="sidebarmenu" dock="fill">
|
||||
<panel jsml-base="sidebarmenuitem" text="@Back">
|
||||
<attach name="click">
|
||||
sidebar.back();
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-base="sidebarmenuitem" text="@Next" dock="bottom">
|
||||
<attach name="click">
|
||||
<![CDATA[
|
||||
var text=textbox.get_text();
|
||||
var lines=text.split('\r').join('').split('\n');
|
||||
for(var i=0;i<lines.length;i++)
|
||||
{
|
||||
lines[i]=jsml.html_encode(lines[i])||" ";
|
||||
}
|
||||
var bv=ddlbreak.get_text();
|
||||
|
||||
if(bv=="br"||bv=="hr")
|
||||
{
|
||||
html=lines.join("<"+bv+"/>");
|
||||
}
|
||||
else if(bv=="ol"||bv=="ul")
|
||||
{
|
||||
html="<"+bv+"><li>"+lines.join("</li><li>")+"</li></"+bv+">";
|
||||
}
|
||||
else
|
||||
{
|
||||
html="<"+bv+">"+lines.join("</"+bv+"><"+bv+">")+"</"+bv+">";
|
||||
}
|
||||
|
||||
html=editor.FilterByPasteCommand(html,"paste");
|
||||
sidebar.loadpanel("insertwhere.xml",{wherefrom:"typetext",wherecallback:function(){
|
||||
sidebar.collapse();
|
||||
editor.InsertHTML(html);
|
||||
}});
|
||||
]]>
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<dropdown jsml-local="ddlbreak" dock="bottom">
|
||||
<listitem text="line break splitted by <p/>" value="p"></listitem>
|
||||
<listitem text="line break splitted by <br/>" value="br"></listitem>
|
||||
<listitem text="line break splitted by <div/>" value="div"></listitem>
|
||||
<listitem text="line break splitted by <ol/>" value="ol"></listitem>
|
||||
<listitem text="line break splitted by <ul/>" value="ul"></listitem>
|
||||
</dropdown>
|
||||
|
||||
<label dock="top" margin="2" text="Type the text below then click the Next button" word_wrap="true"></label>
|
||||
<textbox jsml-local="textbox" dock="fill" text_mode="multipleline">
|
||||
<attach name="attach_dom">
|
||||
setTimeout(function(){self.focus();},100);
|
||||
</attach>
|
||||
</textbox>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebar_typetext" />
|
||||
|
||||
|
||||
</jsml>
|
||||
340
LPWeb20/RichtextEditor/plugins/mobilesidebar/uploadimage.xml
Normal file
@@ -0,0 +1,340 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<jsml xmlns="http://cutesoft.net/jsml"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://cutesoft.net/jsml ../core/jsml.xsd">
|
||||
|
||||
<panel jsml-class="uploadprogresspanel" dock="fill" padding="12">
|
||||
|
||||
<panel dock="fill">
|
||||
<panel dock="bottom" overflow="visible">
|
||||
<panel dock="top" height="30">
|
||||
<panel dock="left" width="300" border_color="gray" border_width="1" margin="5">
|
||||
<panel jsml-local="progressblock" dock="left" background="url({folder}dialogs/uploadprogress/continuous.gif) repeat-x" width="0" />
|
||||
</panel>
|
||||
</panel>
|
||||
<panel dock="top" overflow="visible" height="10" padding="0,3,0,3">
|
||||
<label dock="top" jsml-local="progresslabel1" height="16" margin="2"/>
|
||||
<label dock="top" jsml-local="progresslabel2" height="16" margin="2"/>
|
||||
</panel>
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
<initialize>
|
||||
<![CDATA[
|
||||
self.editoreventid=editor.AttachEvent(self.delegate(self.processeditorevent));
|
||||
]]>
|
||||
</initialize>
|
||||
<attach name="disposing">
|
||||
editor.DetachEvent(self.editoreventid);
|
||||
</attach>
|
||||
<method name="processeditorevent" arguments="editor,e">
|
||||
<![CDATA[
|
||||
switch(e.Name)
|
||||
{
|
||||
case "Uploader_QueueUI":
|
||||
break;
|
||||
case "Uploader_Progress":
|
||||
|
||||
|
||||
|
||||
var uploader=e.Arguments[0];
|
||||
var filename=e.Arguments[2];
|
||||
var begintime=e.Arguments[3];
|
||||
var uploadedsize=e.Arguments[4];
|
||||
var totalsize=e.Arguments[5];
|
||||
|
||||
var items=uploader.getitems();
|
||||
var queuecount=0;
|
||||
for(var i=0;i<items.length;i++)
|
||||
{
|
||||
if(items[i].Status=="Queue")
|
||||
queuecount++;
|
||||
}
|
||||
var currcount=items.length-queuecount;
|
||||
if(items.length>1)
|
||||
{
|
||||
progresslabel1.set_text("Uploading "+currcount+"/"+items.length+" : "+filename+". ");
|
||||
}
|
||||
else
|
||||
{
|
||||
progresslabel1.set_text("Uploading "+filename+". ");
|
||||
}
|
||||
if(!totalsize)
|
||||
{
|
||||
progressblock.set_width(0);
|
||||
progresslabel2.set_text("");
|
||||
}
|
||||
else
|
||||
{
|
||||
var cw=Math.floor(progressblock.get_parent().get_client_width()*uploadedsize/totalsize);
|
||||
progressblock.set_width(cw);
|
||||
var speed=uploadedsize*1000/Math.max(1000,new Date().getTime()-begintime)
|
||||
var s=(totalsize-uploadedsize)/Math.max(1000,speed);
|
||||
|
||||
var ts="-";
|
||||
if(s>600) //10 mins , to be 87 mins
|
||||
ts=Math.floor(s/60)+" minutes";
|
||||
else if(s>120) //2 mins , to be 4.8 mins
|
||||
ts=Math.floor(s/6)/10+" minutes";
|
||||
else
|
||||
ts=Math.floor(s)+" seconds";
|
||||
progresslabel2.set_text(jsml.format_size(uploadedsize)+" of "+jsml.format_size(totalsize)+" at "+jsml.format_size(speed)+"/s , "+ts+" remaining");
|
||||
}
|
||||
break;
|
||||
case "Uploader_Stop":
|
||||
case "Uploader_Postback":
|
||||
self.uploadstopped=true;
|
||||
dialog.close();
|
||||
break;
|
||||
}
|
||||
|
||||
]]>
|
||||
</method>
|
||||
|
||||
</panel>
|
||||
|
||||
|
||||
<panel jsml-class="sidebar_uploadimage" jsml-base="sidebarmenu" dock="fill">
|
||||
<panel jsml-base="sidebarmenuitem" text="@Back">
|
||||
<attach name="click">
|
||||
sidebar.back();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
|
||||
<panel dock="fill" vertical_align="middle" horizontal_align="center">
|
||||
|
||||
<label jsml-local="loadinglabel" text="Loading...."></label>
|
||||
|
||||
<panel jsml-base="panelbutton" visible="false" disabled="true" css_class="dialogbutton" jsml-local="uploadbtn" height="26" border_color="#CDCDCD" overflow="visible" back_color="#f7f7f7" padding="4,10,4,10" width="120" >
|
||||
<image dock="left" src="{folder}images/upload.gif" width="24" />
|
||||
<panel dock="left" width="15" />
|
||||
<label dock="left" jsml-local="label" text="@LABEL_SELECTFILESTOUPLOAD" width="120" vertical_align="middle" cursor="pointer" />
|
||||
</panel>
|
||||
|
||||
</panel>
|
||||
|
||||
|
||||
<attach name="click">
|
||||
|
||||
</attach>
|
||||
<initialize>
|
||||
<![CDATA[
|
||||
self._category="Gallery";
|
||||
self._getoption={GetSize:false,GetTime:false,GetDimensions:false,GetThumbnails:false};
|
||||
|
||||
var storage
|
||||
function onstorages(res)
|
||||
{
|
||||
if(self._jsml_disposed)return;
|
||||
|
||||
loadinglabel.set_text("storage ready..");
|
||||
|
||||
if(res.Error)
|
||||
{
|
||||
loadinglabel.set_text(res.Error);
|
||||
return;
|
||||
}
|
||||
|
||||
var storage=res.ReturnValue[0];
|
||||
|
||||
var exts=storage.Extensions.split('.').join('').split('*').join('').split(',');
|
||||
for(var i=0;i<exts.length;i++)exts[i]="."+exts[i];
|
||||
self._selectedextensions=exts;
|
||||
self._selectedstorage=storage;
|
||||
|
||||
|
||||
self.editoreventid=editor.AttachEvent(self.delegate(self.processeditorevent));
|
||||
editor.RegisterUploadButton(uploadbtn._element);
|
||||
|
||||
var waited=false;
|
||||
|
||||
function checkuploader()
|
||||
{
|
||||
if(waited)
|
||||
return;
|
||||
var status=0;
|
||||
|
||||
if(window.RTE_AjaxUploader_Initialize)
|
||||
status++;
|
||||
if(editor.uploaderhidden)
|
||||
{
|
||||
status++;
|
||||
if(editor.uploaderhidden.internalobject)
|
||||
status++;
|
||||
}
|
||||
|
||||
var msg="wait for uploader..";
|
||||
for(var i=0;i<status;i++)
|
||||
msg+=".";
|
||||
loadinglabel.set_text(msg);
|
||||
|
||||
setTimeout(checkuploader,100);
|
||||
}
|
||||
|
||||
checkuploader();
|
||||
|
||||
editor.WaitForUploader(function(error)
|
||||
{
|
||||
waited=true;
|
||||
if(error)
|
||||
{
|
||||
loadinglabel.set_text(error);
|
||||
return;
|
||||
}
|
||||
|
||||
loadinglabel.set_text("ready");
|
||||
loadinglabel.set_visible(false);
|
||||
uploadbtn.set_visible(true);
|
||||
|
||||
setTimeout(function()
|
||||
{
|
||||
uploadbtn.set_disabled(false);
|
||||
editor.FocusUploadButton(uploadbtn._element);
|
||||
},100);
|
||||
});
|
||||
}
|
||||
editor.AsyncGetStoragesWithCache(self._category,onstorages)
|
||||
]]>
|
||||
</initialize>
|
||||
<attach name="disposing">
|
||||
<![CDATA[
|
||||
editor.DetachEvent(self.editoreventid);
|
||||
editor.RemoveUploadButton(uploadbtn._element);
|
||||
]]>
|
||||
</attach>
|
||||
<method name="processeditorevent" arguments="editor,e">
|
||||
<![CDATA[
|
||||
switch(e.Name)
|
||||
{
|
||||
case "Uploader_Browse":
|
||||
var uploader=e.Arguments[0];
|
||||
var filter=self._category+" files|"+self._selectedextensions.join(';').split('.').join("*.");
|
||||
uploader.internalobject.DialogFilter=filter;
|
||||
uploader.internalobject.DialogAccept="image/*";
|
||||
if(!self.uploaderstarted)uploader.reset();
|
||||
if(!self._selectedstorage.AllowUpload)e.ReturnValue=false;
|
||||
break;
|
||||
case "Uploader_Select":
|
||||
var uploader=e.Arguments[0];
|
||||
var tasks=e.Arguments[1];
|
||||
self.processuploaderselect(uploader,tasks);
|
||||
break;
|
||||
case "Uploader_Start":
|
||||
self.processuploaderstart(e.Arguments[0]);
|
||||
break;
|
||||
case "Uploader_Stop":
|
||||
self.processuploaderstop(e.Arguments[0]);
|
||||
break;
|
||||
case "Uploader_Postback":
|
||||
self.processuploaderstop(e.Arguments[0],true);
|
||||
break;
|
||||
}
|
||||
]]>
|
||||
</method>
|
||||
<method name="processuploaderselect" arguments="uploader,tasks">
|
||||
<![CDATA[
|
||||
var files=[];
|
||||
|
||||
var indexes=[];
|
||||
var usednamemap={};
|
||||
for(var i=0;i<tasks.length;i++)
|
||||
{
|
||||
var task=tasks[i];
|
||||
var filename=task.FileName;
|
||||
var d=new Date();
|
||||
filename=String(d.getFullYear()*100000000+(d.getMonth()+1)*1000000+d.getDate()*10000+d.getHours()*10000+d.getMinutes()*100+d.getSeconds())+"_"+(i+1)+"_"+filename;
|
||||
task.SetClientData(filename);
|
||||
}
|
||||
setTimeout(function(){uploader.startupload()},1);
|
||||
]]>
|
||||
</method>
|
||||
<method name="setisloading">
|
||||
</method>
|
||||
<method name="reportError">
|
||||
alert(value)
|
||||
</method>
|
||||
<method name="processuploaderstart" arguments="uploader">
|
||||
<![CDATA[
|
||||
self.uploaderstarted=true;
|
||||
self.setisloading(true);
|
||||
self.uploaderprogressdialog=jsml.class_create_instance("uploadprogresspanel");
|
||||
self.append_child(self.uploaderprogressdialog);
|
||||
]]>
|
||||
</method>
|
||||
<method name="processuploaderstop" arguments="uploader,postback">
|
||||
<![CDATA[
|
||||
self.uploaderstarted=false;
|
||||
if(postback)
|
||||
{
|
||||
self.setisloading(true);
|
||||
self._uploadertoreset=uploader;
|
||||
var storage={ID:self._selectedstorage.ID,UrlPath:"/",Category:self._category};
|
||||
var namemap=[];
|
||||
|
||||
var items=uploader.getitems();
|
||||
for(var i=0;i<items.length;i++)
|
||||
namemap.push(items[i].FileGuid+"/"+items[i].GetClientData());
|
||||
editor.CallAjax("AjaxUploadFiles",self.delegate(self.handleuploadfiles),storage,self._getoption,namemap.join("|"));
|
||||
}
|
||||
else
|
||||
{
|
||||
self.setisloading(false);
|
||||
}
|
||||
if(self.uploaderprogressdialog)
|
||||
{
|
||||
self.uploaderprogressdialog.dispose();
|
||||
}
|
||||
]]>
|
||||
</method>
|
||||
<method name="handleuploadfiles" arguments="res">
|
||||
<![CDATA[
|
||||
|
||||
self._uploadertoreset.reset();
|
||||
|
||||
self.setisloading(false);
|
||||
if(res.Error)
|
||||
{
|
||||
self.reportError(res.Error.message);
|
||||
return true;
|
||||
}
|
||||
|
||||
var arr=res.ReturnValue;
|
||||
if(!arr||arr.length==0)
|
||||
{
|
||||
//self.change_folder(self._currdir);
|
||||
return;
|
||||
}
|
||||
|
||||
var errcount=0;
|
||||
for(var i=0;i<arr.length;i++)
|
||||
{
|
||||
if(typeof(arr[i])=="string")
|
||||
{
|
||||
self.reportError(arr[i]);
|
||||
errcount++;
|
||||
}
|
||||
}
|
||||
|
||||
if(errcount==arr.length)
|
||||
return;
|
||||
|
||||
for(var i=0;i<arr.length;i++)
|
||||
{
|
||||
if(typeof(arr[i])=="string")
|
||||
continue;
|
||||
var url=self._selectedstorage.UrlPrefix+"/"+arr[i].Name;
|
||||
var html="<div><img alt='' src='"+jsml.html_encode(url)+"' /></div>";
|
||||
editor.AppendHTML(html);
|
||||
}
|
||||
|
||||
sidebar.collapse();
|
||||
|
||||
]]>
|
||||
</method>
|
||||
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="sidebar_uploadimage" />
|
||||
|
||||
|
||||
</jsml>
|
||||