Initial Commit Update Telerik
|
After Width: | Height: | Size: 245 B |
|
After Width: | Height: | Size: 336 B |
|
After Width: | Height: | Size: 245 B |
|
After Width: | Height: | Size: 243 B |
BIN
LPWeb20/RichtextEditor/plugins/controldesigner/images/close.png
Normal file
|
After Width: | Height: | Size: 418 B |
BIN
LPWeb20/RichtextEditor/plugins/controldesigner/images/corner.png
Normal file
|
After Width: | Height: | Size: 265 B |
|
After Width: | Height: | Size: 225 B |
BIN
LPWeb20/RichtextEditor/plugins/controldesigner/images/reset.gif
Normal file
|
After Width: | Height: | Size: 100 B |
|
After Width: | Height: | Size: 58 B |
|
After Width: | Height: | Size: 113 B |
980
LPWeb20/RichtextEditor/plugins/controldesigner/plugin.xml
Normal file
@@ -0,0 +1,980 @@
|
||||
<?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">
|
||||
|
||||
<execute>
|
||||
plugin.header_attribute_name="class";
|
||||
</execute>
|
||||
|
||||
<panel jsml-class="controldesigner_proptag" overflow="visible">
|
||||
|
||||
<label dock="fill" margin="0,0,1,0" vertical_align="middle" font_size="12px" text_align="center" back_color="#f5f5f5" text_color="#555555" border_color="#cccccc" border_width="0,0,1,0">
|
||||
<attach name="attach_dom,loadvalue">
|
||||
var name=plugin.selectednode.GetName();
|
||||
name=name.charAt(0).toUpperCase()+name.substring(1);
|
||||
self.set_text(name);
|
||||
self._estyle.borderRadius="0"
|
||||
</attach>
|
||||
</label>
|
||||
|
||||
<panel dock="right" width="1" height="1" overflow="visible" jsml-base="panelbutton" margin="1,2,3,0" padding="2,2,0,2">
|
||||
<image dock="left" width="1" height="1" src="{folder}plugins/{plugin}/images/url_icon.gif"/>
|
||||
<attach name="click">
|
||||
<![CDATA[
|
||||
//plugin.controldesigner.toggle_toolbar();
|
||||
var newoption={}
|
||||
newoption.callback=function()
|
||||
{
|
||||
plugin.controldesigner.invoke_recursive("loadvalue");
|
||||
}
|
||||
editor.ShowPropertiesDialog(plugin.selectednode,newoption);
|
||||
]]>
|
||||
</attach>
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
<panel jsml-class="controldesigner_propsize" overflow="visible">
|
||||
<label dock="left" text="@SIZE|:" margin="0,0,1,0" vertical_align="middle" width="38"/>
|
||||
<panel jsml-base="rtepropunitbox" dock="left" propname="style:width" border_width="0,0,1,0" border_color="gray">
|
||||
<attach name="change">
|
||||
plugin.selectednode.RemoveAttribute("width");
|
||||
</attach>
|
||||
</panel>
|
||||
<image dock="left" jsml-base="imagebutton" width="18" height="18" margin="3,5,1,5" tooltip="@RESET" src="{folder}plugins/{plugin}/images/reset.gif">
|
||||
<attach name="click">
|
||||
plugin.selectednode.RemoveAttribute("width");
|
||||
plugin.selectednode.RemoveAttribute("height");
|
||||
plugin.selectednode.SetStyle("width",null);
|
||||
plugin.selectednode.SetStyle("height",null);
|
||||
plugin.controldesigner.invoke_recursive("loadvalue");
|
||||
</attach>
|
||||
</image>
|
||||
<panel jsml-base="rtepropunitbox" dock="left" propname="style:height" border_width="0,0,1,0" border_color="gray">
|
||||
<attach name="change">
|
||||
plugin.selectednode.RemoveAttribute("height");
|
||||
</attach>
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
<panel jsml-class="controldesigner_propidcls" overflow="visible">
|
||||
<label dock="left" text="ID:" margin="0,0,1,0" vertical_align="middle" width="38"/>
|
||||
<textbox dock="left" border_width="0,0,1,0" border_color="gray" width="60">
|
||||
<attach name="change,keyup">
|
||||
var val=self.get_text().replace(/(^\s+|\s+$)/g,"")
|
||||
plugin.selectednode.SetAttribute("id",val||null);
|
||||
</attach>
|
||||
<attach name="attach_dom">
|
||||
self.set_text(plugin.selectednode.GetAttribute("id")||"")
|
||||
</attach>
|
||||
</textbox>
|
||||
<label dock="left" text="class:" margin="0,0,1,4" vertical_align="middle" width="28" />
|
||||
<panel jsml-base="rteproptextbox" dock="left" propname="class" border_width="0,0,1,0" border_color="gray" width="60"/>
|
||||
</panel>
|
||||
|
||||
<panel jsml-class="controldesigner_proptitle" overflow="visible">
|
||||
<label dock="left" text="@TOOLTIP|:" margin="0,0,1,0" vertical_align="middle" width="38"/>
|
||||
<panel jsml-base="rteproptextbox" dock="left" propname="title" border_width="0,0,1,0" border_color="gray" width="148"/>
|
||||
</panel>
|
||||
|
||||
<panel jsml-class="controldesigner_propfloat" overflow="visible">
|
||||
<panel jsml-base="rtebtngroup_float" dock="left" />
|
||||
</panel>
|
||||
|
||||
<panel jsml-class="controldesigner_tag_div" margin="0,0,5,0" overflow="visible">
|
||||
|
||||
<panel jsml-base="controldesigner_proptag" dock="top" />
|
||||
<panel jsml-base="controldesigner_propsize" dock="top" margin="2,5,0,5" />
|
||||
<panel jsml-base="controldesigner_propidcls" dock="top" margin="2,5,0,5" />
|
||||
<panel jsml-base="controldesigner_proptitle" dock="top" margin="2,5,0,5" />
|
||||
|
||||
</panel>
|
||||
|
||||
<panel jsml-class="controldesigner_tag_img" margin="0,0,5,0" overflow="visible">
|
||||
|
||||
<panel jsml-base="controldesigner_proptag" dock="top" />
|
||||
<panel jsml-base="controldesigner_propsize" dock="top" margin="2,5,0,5" />
|
||||
<panel jsml-base="controldesigner_propidcls" dock="top" margin="2,5,0,5" />
|
||||
<panel jsml-base="controldesigner_proptitle" dock="top" margin="2,5,0,5" />
|
||||
<panel dock="top" height="30" margin="3,0,3,0">
|
||||
<panel jsml-base="tbgroup_{skin}_{color}" dock="right" margin="4">
|
||||
<image jsml-base="image_{skin}_{color}" command="insertimagemap" tooltip="@INSERTIMAGEMAP" imagename="imagemap"/>
|
||||
<image jsml-base="image_{skin}_{color}" command="imageeditor" tooltip="@IMAGEEDITOR" imagename="imageeditor" />
|
||||
</panel>
|
||||
<panel jsml-base="controldesigner_propfloat" dock="fill" margin="2,5,5,5" />
|
||||
</panel>
|
||||
|
||||
</panel>
|
||||
|
||||
<panel jsml-class="controldesigner_tag_fieldset" margin="0,0,5,0" overflow="visible">
|
||||
|
||||
<panel jsml-base="controldesigner_proptag" dock="top" />
|
||||
<panel jsml-base="controldesigner_propsize" dock="top" margin="2,5,0,5" />
|
||||
<panel jsml-base="controldesigner_propidcls" dock="top" margin="2,5,0,5" />
|
||||
<panel jsml-base="controldesigner_proptitle" dock="top" margin="2,5,0,5" />
|
||||
<panel jsml-base="controldesigner_propfloat" dock="top" margin="2,5,0,5" />
|
||||
|
||||
</panel>
|
||||
|
||||
<panel jsml-class="controldesigner_tag_table" margin="0,0,5,0" overflow="visible">
|
||||
|
||||
<panel jsml-base="controldesigner_proptag" dock="top" />
|
||||
<panel jsml-base="controldesigner_propsize" dock="top" margin="2,5,0,5" />
|
||||
<panel jsml-base="controldesigner_propidcls" dock="top" margin="2,5,0,5" />
|
||||
<panel jsml-base="controldesigner_proptitle" dock="top" margin="2,5,0,5" />
|
||||
<panel jsml-base="controldesigner_propfloat" dock="top" margin="2,5,0,5" />
|
||||
|
||||
</panel>
|
||||
|
||||
<panel jsml-class="controldesigner_tag_td" margin="0,0,5,0" overflow="visible">
|
||||
|
||||
<panel jsml-base="controldesigner_proptag" dock="top" />
|
||||
<panel jsml-base="controldesigner_propsize" dock="top" margin="2,5,0,5" />
|
||||
<panel jsml-base="controldesigner_propidcls" dock="top" margin="2,5,0,5" />
|
||||
<panel jsml-base="controldesigner_proptitle" dock="top" margin="2,5,0,5" />
|
||||
|
||||
<panel dock="top" overflow="visible" horizontal_align="center" margin="3,0,3,0" padding="3">
|
||||
<panel jsml-base="tbgroup_{skin}_{color}" dock="none">
|
||||
|
||||
<image jsml-base="image_{skin}_{color}" command="mergecells" tooltip="@MERGECELLS" imagename="mrgcell"/>
|
||||
<image jsml-base="image_{skin}_{color}" command="splitcells" tooltip="@SPLITCELLS" imagename="spltcell" />
|
||||
<image jsml-base="image_{skin}_{color}" command="insertrowtop" tooltip="@INSERTROWTOP" imagename="insrow_t"/>
|
||||
<image jsml-base="image_{skin}_{color}" command="insertrowbottom" tooltip="@INSERTROWBOTTOM" imagename="insrow_b" />
|
||||
<image jsml-base="image_{skin}_{color}" command="insertcolumnleft" tooltip="@INSERTCOLUMNLEFT" imagename="inscol_l"/>
|
||||
<image jsml-base="image_{skin}_{color}" command="insertcolumnright" tooltip="@INSERTCOLUMNRIGHT" imagename="inscol_r"/>
|
||||
<image jsml-base="image_{skin}_{color}" command="deleterow" tooltip="@DELETEROW" imagename="delrow"/>
|
||||
<image jsml-base="image_{skin}_{color}" command="deletecolumn" tooltip="@DELETECOLUMN" imagename="delcol"/>
|
||||
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
</panel>
|
||||
|
||||
<panel jsml-class="controldesigner">
|
||||
|
||||
<panel jsml-local="linel" width="1" height="1" back_color="orange" />
|
||||
<panel jsml-local="linet" width="1" height="1" back_color="orange" />
|
||||
<panel jsml-local="liner" width="1" height="1" back_color="orange">
|
||||
<initialize>
|
||||
self._estyle.boxShadow="3px 3px 12px #999999";
|
||||
</initialize>
|
||||
</panel>
|
||||
<panel jsml-local="lineb" width="1" height="1" back_color="orange">
|
||||
<initialize>
|
||||
self._estyle.boxShadow="3px 3px 12px #999999";
|
||||
</initialize>
|
||||
</panel>
|
||||
|
||||
<panel jsml-local="mergelinel" width="1" height="1" back_color="red" />
|
||||
<panel jsml-local="mergelinet" width="1" height="1" back_color="red" />
|
||||
<panel jsml-local="mergeliner" width="1" height="1" back_color="red">
|
||||
<initialize>
|
||||
self._estyle.boxShadow="3px 3px 12px #999999";
|
||||
</initialize>
|
||||
</panel>
|
||||
<panel jsml-local="mergelineb" width="1" height="1" back_color="red">
|
||||
<initialize>
|
||||
self._estyle.boxShadow="3px 3px 12px #999999";
|
||||
</initialize>
|
||||
</panel>
|
||||
|
||||
<panel jsml-local="controlheader" width="20" height="16" padding="0,5,0,6" back_color="#eeeeee" border_color="#3169C6" border_width="1,1,1,1" overflow_x="visible" unselectable="true">
|
||||
<label jsml-local="nodenamelabel" dock="fill" vertical_align="middle" width="10" overflow_x="visible" cursor="pointer" />
|
||||
<initialize>
|
||||
self._estyle.borderTopLeftRadius="4px";
|
||||
self._estyle.borderTopRightRadius="4px";
|
||||
</initialize>
|
||||
<attach name="click">
|
||||
editor.Focus();
|
||||
editor.SelectControl(plugin.headerctrl);
|
||||
</attach>
|
||||
<attach name="mousedown" arguments="je,de">
|
||||
<![CDATA[
|
||||
var now=new Date().getTime();
|
||||
if(now-(self._lastmousedowntime||0)<300)
|
||||
{
|
||||
editor.ShowPropertiesDialog(plugin.headerctrl);
|
||||
}
|
||||
else if(plugin.headerctrl.GetStyle("position")!="absolute")
|
||||
{
|
||||
editor.StartDragControl(de,plugin.headerctrl);
|
||||
}
|
||||
self._lastmousedowntime=now;
|
||||
]]>
|
||||
</attach>
|
||||
<attach name="mouseup" arguments="je,de">
|
||||
editor.StopDragControl(de);
|
||||
</attach>
|
||||
<attach name="contextmenu" arguments="je,de">
|
||||
de.cancel_default();
|
||||
var option={floatboxClass:"floatmenu",control:self,floatMode:'b-r',stopLoadingImage:true};
|
||||
option.node=plugin.headerctrl;
|
||||
editor.ShowXmlFloatBox(editor.BuildDialogUrl("menu_tagitem.xml"),option);
|
||||
</attach>
|
||||
<attach name="mousehover">
|
||||
<![CDATA[
|
||||
var code=plugin.headerctrl.GetAttributeCode();
|
||||
if(code)code=" "+code;
|
||||
code="<"+plugin.headerctrl.GetName()+code+">";
|
||||
self.set_tooltip(code);
|
||||
]]>
|
||||
</attach>
|
||||
<attach name="mousedown" arguments="je,devent">
|
||||
<![CDATA[
|
||||
if(plugin.headerctrl.GetStyle("position")!="absolute")
|
||||
return;
|
||||
|
||||
var _x=devent.clientX;
|
||||
var _y=devent.clientY;
|
||||
|
||||
var hct=parseInt(plugin.headerctrl.GetStyle("top"))||0;
|
||||
var hcl=parseInt(plugin.headerctrl.GetStyle("left"))||0;
|
||||
|
||||
function update_position(moveevent)
|
||||
{
|
||||
var x=moveevent.clientX;
|
||||
var y=moveevent.clientY;
|
||||
|
||||
var newt=hct+y-_y;
|
||||
var newl=hcl+x-_x;
|
||||
plugin.headerctrl.SetStyle("top",newt+"px");
|
||||
plugin.headerctrl.SetStyle("left",newl+"px");
|
||||
}
|
||||
|
||||
jsml.startcapture(update_position,null,"move");
|
||||
|
||||
devent.cancel_default();
|
||||
|
||||
]]>
|
||||
</attach>
|
||||
<attach name="resetui">
|
||||
<![CDATA[
|
||||
if(plugin.headerctrl.GetStyle("position")=="absolute")
|
||||
{
|
||||
self.set_cursor("move");
|
||||
nodenamelabel.set_cursor("move");
|
||||
}
|
||||
else
|
||||
{
|
||||
self.set_cursor("pointer");
|
||||
nodenamelabel.set_cursor("pointer");
|
||||
}
|
||||
]]>
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-local="resizeoverlay" width="20" height="20" overflow="none" border_width="1" border_color="gray" vertical_align="middle" horizontal_align="center">
|
||||
<panel dock="fill" back_color="blue" opacity="20" />
|
||||
<label jsml-local="resizeinfo" />
|
||||
<attach name="resize">
|
||||
<![CDATA[
|
||||
var nw=self.get_current_width();
|
||||
var nh=self.get_current_height();
|
||||
var zoom=parseInt(editor.GetWindow().document.body.style.zoom)||100;
|
||||
if(zoom!=100)
|
||||
{
|
||||
nw=Math.floor(nw*100/zoom)
|
||||
nh=Math.floor(nh*100/zoom)
|
||||
}
|
||||
resizeinfo.set_text(nw+" x "+nh)
|
||||
]]>
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<image jsml-local="tdresize" width="16" height="16" overflow="none" opacity="50" cursor="nw-resize" src="{folder}plugins/{plugin}/images/corner.png">
|
||||
<attach name="mousedown" arguments="je,devent">
|
||||
instance.invoke_event("resize_mousedown",devent,1,1);
|
||||
</attach>
|
||||
</image>
|
||||
<panel jsml-local="tdresizer" width="4" height="4" cursor="w-resize" back_color="white" opacity="11">
|
||||
<attach name="mousedown" arguments="je,devent">
|
||||
instance.invoke_event("resize_mousedown",devent,1,0);
|
||||
</attach>
|
||||
</panel>
|
||||
<panel jsml-local="tdresizeb" width="4" height="4" cursor="n-resize" back_color="white" opacity="11">
|
||||
<attach name="mousedown" arguments="je,devent">
|
||||
instance.invoke_event("resize_mousedown",devent,0,1);
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<image jsml-local="nwresize" width="7" height="7" overflow="none" cursor="nw-resize" src="{folder}plugins/{plugin}/images/dot_ring.6.png">
|
||||
<attach name="mousedown" arguments="je,devent">
|
||||
instance.invoke_event("resize_mousedown",devent,1,1);
|
||||
</attach>
|
||||
<attach name="mousehover">
|
||||
var w=plugin.selectednode.GetStyle("width")
|
||||
var h=plugin.selectednode.GetStyle("height")
|
||||
var s=(w||"*")+" - "+(h||"*")
|
||||
self.set_tooltip(s)
|
||||
</attach>
|
||||
</image>
|
||||
<image jsml-local="wresize" width="7" height="7" overflow="none" cursor="w-resize" src="{folder}plugins/{plugin}/images/dot_ring.6.png">
|
||||
<attach name="mousedown" arguments="je,devent">
|
||||
instance.invoke_event("resize_mousedown",devent,1,0);
|
||||
</attach>
|
||||
<attach name="mousehover">
|
||||
var w=plugin.selectednode.GetStyle("width")
|
||||
self.set_tooltip(editor.GetLangText("WIDTH")+":"+(w||"*"))
|
||||
</attach>
|
||||
</image>
|
||||
<image jsml-local="nresize" width="7" height="7" overflow="none" cursor="n-resize" src="{folder}plugins/{plugin}/images/dot_ring.6.png">
|
||||
<attach name="mousedown" arguments="je,devent">
|
||||
instance.invoke_event("resize_mousedown",devent,0,1);
|
||||
</attach>
|
||||
<attach name="mousehover">
|
||||
var h=plugin.selectednode.GetStyle("height")
|
||||
self.set_tooltip(editor.GetLangText("HEIGHT")+":"+(h||"*"))
|
||||
</attach>
|
||||
</image>
|
||||
|
||||
|
||||
|
||||
<panel jsml-local="toolbar" width="20" height="20" overflow="visible" border_width="1" border_color="gray" back_color="#ffffff">
|
||||
<initialize>
|
||||
self._estyle.boxShadow="3px 3px 12px #999999";
|
||||
</initialize>
|
||||
</panel>
|
||||
|
||||
<panel jsml-local="objarrow" width="11" height="11" cursor="pointer" unselectable='true'>
|
||||
<image dock="fill" jsml-local="objarrowr" src="{folder}plugins/{plugin}/images/arrow-r.png"/>
|
||||
<image dock="fill" visible="false" jsml-local="objarrowl" src="{folder}plugins/{plugin}/images/arrow-l.png"/>
|
||||
<attach name="resetui">
|
||||
objarrowr.set_visible(toolbar.ishided);
|
||||
objarrowl.set_visible(!toolbar.ishided);
|
||||
</attach>
|
||||
<attach name="click">
|
||||
instance.toggle_toolbar();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
|
||||
<method name="jsml_append" arguments="panel">
|
||||
panel._dommode='absolute';
|
||||
panel.set_parent(document.body);
|
||||
self.hidepanel(panel,true);
|
||||
if(!self.panels)self.panels=[];
|
||||
self.panels.push(panel);
|
||||
</method>
|
||||
<method name="invoke_recursive" overrideas="panel_invoke_recursive">
|
||||
<![CDATA[
|
||||
self.panel_invoke_recursive();
|
||||
for(var i=0;i<self.panels.length;i++)
|
||||
self.panels[i].invoke_recursive.apply(self.panels[i],arguments);
|
||||
]]>
|
||||
</method>
|
||||
<attach name="resize_mousedown" arguments="je,devent,fr,fb">
|
||||
<![CDATA[
|
||||
devent.cancel();
|
||||
self.showpanel(resizeoverlay,self.calc_ctrl_pos(plugin.selectednode),null,"s");
|
||||
//plugin.selectednode.SetRuntimeAttribute("style","border:solid 1px red;background-color:yellow;","resizing");
|
||||
var w=resizeoverlay.get_current_width();
|
||||
var h=resizeoverlay.get_current_height();
|
||||
resizeoverlay.start_resize(devent,0,fr,fb,0,20,function()
|
||||
{
|
||||
var nw=resizeoverlay.get_current_width();
|
||||
var nh=resizeoverlay.get_current_height();
|
||||
|
||||
var zoom=parseInt(editor.GetWindow().document.body.style.zoom)||100;
|
||||
if(zoom!=100)
|
||||
{
|
||||
nw=Math.floor(nw*100/zoom)
|
||||
nh=Math.floor(nh*100/zoom)
|
||||
}
|
||||
|
||||
if(nw!=w)
|
||||
{
|
||||
plugin.selectednode.RemoveAttribute("width");
|
||||
plugin.selectednode.SetStyle("width",nw+"px");
|
||||
}
|
||||
if(nh!=h)
|
||||
{
|
||||
plugin.selectednode.RemoveAttribute("height");
|
||||
plugin.selectednode.SetStyle("height",nh+"px");
|
||||
}
|
||||
|
||||
self.hidepanel(resizeoverlay);
|
||||
//plugin.selectednode.SetRuntimeAttribute("style",null,"resizing");
|
||||
self.invoke_recursive("loadvalue");
|
||||
self.updatepos();
|
||||
})
|
||||
]]>
|
||||
</attach>
|
||||
|
||||
<method name="toggle_toolbar">
|
||||
<![CDATA[
|
||||
if(objarrowr.get_visible())
|
||||
{
|
||||
self.pageinst.set_parent(toolbar);
|
||||
self.showpanel(toolbar,self.lastpos,"r",null,objarrow.get_current_width(),1);
|
||||
objarrowl.set_visible(true);
|
||||
objarrowr.set_visible(false);
|
||||
}
|
||||
else
|
||||
{
|
||||
self.hidepanel(toolbar);
|
||||
objarrowl.set_visible(false);
|
||||
objarrowr.set_visible(true);
|
||||
}
|
||||
]]>
|
||||
</method>
|
||||
|
||||
<method name="hidepanel" arguments="panel,hidenow">
|
||||
<![CDATA[
|
||||
if(panel.ishided)return;
|
||||
panel.ishided=true;
|
||||
function hideit()
|
||||
{
|
||||
panel.set_visibility("hidden");
|
||||
panel._estyle.left="-1000px";
|
||||
panel._estyle.top="-1000px";
|
||||
}
|
||||
if(hidenow)
|
||||
{
|
||||
hideit();
|
||||
return;
|
||||
}
|
||||
setTimeout(function()
|
||||
{
|
||||
if(!panel.ishided)return;
|
||||
hideit();
|
||||
},5);
|
||||
]]>
|
||||
</method>
|
||||
<method name="showpanel" arguments="panel,pos,mode,edge,xoffset,yoffset">
|
||||
<![CDATA[
|
||||
|
||||
panel.ishided=false;
|
||||
panel.set_visibility("visible");
|
||||
|
||||
var pew=pos.width;
|
||||
var peh=pos.height;
|
||||
|
||||
if(edge=="w"||edge=="s")panel.set_width(pew);
|
||||
if(edge=="h"||edge=="s")panel.set_height(peh);
|
||||
|
||||
var w=panel.get_current_width();
|
||||
var h=panel.get_current_height();
|
||||
|
||||
panel._estyle.zIndex=editor._config.ctrltool_zindex;
|
||||
|
||||
pos={left:pos.left,top:pos.top}
|
||||
|
||||
var nomovey,nomovex;
|
||||
|
||||
var fmpair=mode?mode.split('-'):[];
|
||||
|
||||
switch(fmpair[0])
|
||||
{
|
||||
case "t":
|
||||
nomovey=true;
|
||||
pos.top+=-h;
|
||||
break;
|
||||
case "b":
|
||||
nomovey=true;
|
||||
pos.top+=peh;
|
||||
break;
|
||||
case "l":
|
||||
nomovex=true;
|
||||
pos.left+=-w;
|
||||
break;
|
||||
case "r":
|
||||
nomovex=true;
|
||||
pos.left+=pew;
|
||||
break;
|
||||
}
|
||||
|
||||
switch(fmpair[1])
|
||||
{
|
||||
case "l":
|
||||
if(pew<w)pos.left+=pew-w;
|
||||
break;
|
||||
case "r":
|
||||
if(pew>w)pos.left+=pew-w;
|
||||
break;
|
||||
case "t":
|
||||
if(peh<h)pos.top+=peh-h;
|
||||
break;
|
||||
case "b":
|
||||
if(peh>h)pos.top+=peh-h;
|
||||
break;
|
||||
case "c":
|
||||
case "m":
|
||||
if(fmpair[0]=="t"||fmpair[0]=="b")
|
||||
{
|
||||
pos.left+=Math.floor((pew-w)/2)
|
||||
}
|
||||
else
|
||||
{
|
||||
pos.top+=Math.floor((peh-h)/2)
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if(xoffset)pos.left+=xoffset;
|
||||
if(yoffset)pos.top+=yoffset;
|
||||
|
||||
panel._estyle.left=pos.left+"px";
|
||||
panel._estyle.top=pos.top+"px";
|
||||
|
||||
]]>
|
||||
</method>
|
||||
|
||||
<method name="calc_ctrl_pos" arguments="ctrl,autoadjust">
|
||||
<![CDATA[
|
||||
var viewnode=ctrl.GetViewNode();
|
||||
|
||||
var fp=jsml.get_scrollposition(editor._config.skin_frame);
|
||||
var pos=jsml.get_clientposition(viewnode,editor.GetWindow());
|
||||
|
||||
pos.width=viewnode.offsetWidth;
|
||||
pos.height=viewnode.offsetHeight;
|
||||
|
||||
var zoom=parseInt(editor.GetWindow().document.body.style.zoom)||100;
|
||||
if(zoom!=100)
|
||||
{
|
||||
pos.top=pos.top*zoom/100;
|
||||
pos.left=pos.left*zoom/100;
|
||||
pos.width=pos.width*zoom/100;
|
||||
pos.height=pos.height*zoom/100;
|
||||
}
|
||||
|
||||
if(autoadjust)
|
||||
{
|
||||
fp.width=editor._config.skin_frame.offsetWidth-1;
|
||||
fp.height=editor._config.skin_frame.offsetHeight-1;
|
||||
|
||||
pos.left-=1;
|
||||
pos.top-=1;
|
||||
pos.width+=2;
|
||||
pos.height+=2;
|
||||
|
||||
if(pos.top<0)
|
||||
{
|
||||
pos.height-=-pos.top;
|
||||
pos.top=0;
|
||||
}
|
||||
if(pos.left<0)
|
||||
{
|
||||
pos.left=0;
|
||||
pos.width-=-pos.left;
|
||||
}
|
||||
|
||||
if(pos.left+pos.width>fp.width)
|
||||
{
|
||||
var sub=pos.left+pos.width-fp.width;
|
||||
pos.width-=sub;
|
||||
}
|
||||
if(pos.top+pos.height>fp.height)
|
||||
{
|
||||
var sub=pos.top+pos.height-fp.height;
|
||||
pos.height-=sub;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
pos.left+=fp.left;
|
||||
pos.top+=fp.top;
|
||||
return pos;
|
||||
]]>
|
||||
|
||||
</method>
|
||||
<method name="startmonitor">
|
||||
<![CDATA[
|
||||
|
||||
|
||||
plugin.selectedprovider=editor.CreateControlProvider(plugin.selectednode);
|
||||
|
||||
plugin.headerctrl=plugin.selectednode;
|
||||
|
||||
if(plugin.selectednode.IsTableCell)
|
||||
{
|
||||
for(var table=plugin.selectednode;table;table=table.GetParent())
|
||||
{
|
||||
if(table.GetNameLower()=="table")
|
||||
{
|
||||
plugin.headerctrl=table;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(plugin.headerctrl==plugin.selectednode)
|
||||
plugin.headerprovider=plugin.selectedprovider;
|
||||
else
|
||||
plugin.headerprovider=editor.CreateControlProvider(plugin.headerctrl);
|
||||
|
||||
|
||||
var nodenametext=plugin.headerprovider.GetTitle();
|
||||
if(plugin.header_attribute_name)
|
||||
{
|
||||
var hat=plugin.headerctrl.GetAttribute(plugin.header_attribute_name);
|
||||
if(hat)nodenametext+="."+hat;
|
||||
}
|
||||
nodenamelabel.set_text(nodenametext);
|
||||
|
||||
self.docversion=null;
|
||||
self.docstop=null;
|
||||
self.lastupdatetime=null;
|
||||
self.lastpos=null;
|
||||
self.updatepos();
|
||||
|
||||
|
||||
|
||||
]]>
|
||||
</method>
|
||||
|
||||
<method name="updatepos">
|
||||
<![CDATA[
|
||||
|
||||
clearTimeout(self.updateposid);
|
||||
self.updateposid=setTimeout(self.delegate_updatepos,10);
|
||||
|
||||
for(var skindiv=editor._config.skin_div;skindiv!=null;skindiv=skindiv.parentNode)
|
||||
{
|
||||
if(skindiv.style&&skindiv.style.display=='none')
|
||||
{
|
||||
self.stopmonitor();
|
||||
plugin.selectednode=null;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var now=new Date().getTime();
|
||||
var ver=editor.GetContentVersion();
|
||||
var doc=editor.GetWindow().document;
|
||||
var sct=Math.max(doc.body.scrollTop,doc.documentElement.scrollTop);
|
||||
if(self.docversion==ver&&self.docstop==sct)
|
||||
{
|
||||
if(now-(self.lastupdatetime||0)<200)
|
||||
return;
|
||||
}
|
||||
|
||||
self.docversion=ver;
|
||||
self.docstop=sct
|
||||
self.lastupdatetime=now;
|
||||
|
||||
var pos;
|
||||
|
||||
try
|
||||
{
|
||||
pos=self.calc_ctrl_pos(plugin.selectednode,true);
|
||||
}
|
||||
catch(x)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(self.lastpos&&self.lastpos.top==pos.top&&self.lastpos.left==pos.left
|
||||
&&self.lastpos.width==pos.width&&self.lastpos.height==pos.height)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(self.mergepn&&self.mergepn.IsAttached()&&self.mergern&&self.mergern.IsAttached())
|
||||
{
|
||||
var p1=self.calc_ctrl_pos(self.mergepn,true);
|
||||
var p2=self.calc_ctrl_pos(self.mergern,true);
|
||||
var p3={left:p1.left,top:p1.top,width:p2.width+p2.left-p1.left,height:p2.height+p2.top-p1.top}
|
||||
self.showpanel(mergelinel,p3,"l-m" ,"h")
|
||||
self.showpanel(mergeliner,p3,"r-m" ,"h")
|
||||
self.showpanel(mergelinet,p3,"t-c" ,"w")
|
||||
self.showpanel(mergelineb,p3,"b-c" ,"w")
|
||||
}
|
||||
|
||||
self.lastpos=pos;
|
||||
|
||||
var ctrlpos=pos;
|
||||
if(plugin.headerctrl!=plugin.selectednode)
|
||||
ctrlpos=self.calc_ctrl_pos(plugin.headerctrl,true);
|
||||
|
||||
var showheader=true;
|
||||
if(plugin.headerctrl.GetNameLower()=="a"&&plugin.headerctrl.GetChildCount()==0)
|
||||
showheader=false;
|
||||
if(showheader)
|
||||
{
|
||||
self.showpanel(controlheader,ctrlpos,'t',null,2,jsml.msie?-5:0);
|
||||
}
|
||||
controlheader.invoke_event("resetui");
|
||||
|
||||
var clsname="controldesigner_tag_"+plugin.selectednode.GetNameLower();
|
||||
if(jsml.class_exists(clsname))
|
||||
{
|
||||
var keyname="pageinst_"+plugin.selectednode.GetNameLower();
|
||||
self.pageinst=self[keyname];
|
||||
if(!self.pageinst)
|
||||
{
|
||||
self.pageinst=jsml.class_create_instance(clsname);
|
||||
self.pageinst.invoke_recursive("editor_ready",editor);
|
||||
self[keyname]=self.pageinst;
|
||||
}
|
||||
self.showpanel(objarrow,pos,"r-t",null,0,1)
|
||||
}
|
||||
|
||||
if(plugin.selectednode.IsTableCell)
|
||||
{
|
||||
if(editor._config.enableobjectresizing)
|
||||
{
|
||||
//self.showpanel(tdresizeb,pos,"b-c","w")
|
||||
//self.showpanel(tdresizer,pos,"r-m","h")
|
||||
self.showpanel(tdresize,pos,"b-r",null,0,-16)
|
||||
}
|
||||
}
|
||||
else// if(!jsml.msie||plugin.selectednode.GetNameLower()=="table")
|
||||
{
|
||||
self.showpanel(linel,pos,"l-m" ,"h")
|
||||
self.showpanel(liner,pos,"r-m" ,"h")
|
||||
self.showpanel(linet,pos,"t-c" ,"w")
|
||||
self.showpanel(lineb,pos,"b-c" ,"w")
|
||||
|
||||
var allowresize=editor._config.enableobjectresizing;
|
||||
switch(plugin.selectednode.GetNameLower())
|
||||
{
|
||||
case "a":
|
||||
allowresize=false;
|
||||
break;
|
||||
}
|
||||
|
||||
if(allowresize&&(!jsml.msie))
|
||||
{
|
||||
self.showpanel(wresize,pos,"r-m",null,-3,0)
|
||||
self.showpanel(nresize,pos,"b-c",null,0,-3)
|
||||
self.showpanel(nwresize,pos,"b-r",null,4,-3)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(!toolbar.ishided)
|
||||
{
|
||||
self.showpanel(toolbar,pos,"r",null,objarrow.get_current_width(),1);
|
||||
}
|
||||
objarrow.invoke_event("resetui");
|
||||
|
||||
]]>
|
||||
</method>
|
||||
<method name="stopmonitor">
|
||||
<![CDATA[
|
||||
clearTimeout(self.updateposid);
|
||||
for(var i=0;i<self.panels.length;i++)
|
||||
self.hidepanel(self.panels[i]);
|
||||
self.lastpos=null;
|
||||
if(self.pageinst)self.pageinst.set_parent(null);
|
||||
if(jsml.msie)clearInterval(self._ieresizetimerid);
|
||||
]]>
|
||||
</method>
|
||||
|
||||
|
||||
<method name="updatecontrols">
|
||||
<![CDATA[
|
||||
if(!editor.IsTabEdit())
|
||||
{
|
||||
if(plugin.selectednode)
|
||||
{
|
||||
self.stopmonitor();
|
||||
plugin.selectednode=null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
var mergepn=null;
|
||||
var mergern=null;
|
||||
var node=editor.GetDragControl()||editor.GetPointNode();
|
||||
var control;
|
||||
var seltype=editor.GetSelectionType();
|
||||
if(seltype=="Control"||(seltype=="Point"&&node.IsControl()))
|
||||
{
|
||||
control=node;
|
||||
}
|
||||
else if(seltype=="Range")
|
||||
{
|
||||
var endnode=editor.GetRangeNode();
|
||||
|
||||
if(editor.CanExecCommand("mergecells"))
|
||||
{
|
||||
mergepn=node;
|
||||
mergern=endnode;
|
||||
for(mergepn=node;mergepn;mergepn=mergepn.GetParent())
|
||||
if(mergepn.IsTableCell)
|
||||
break;
|
||||
for(mergern=endnode;mergern;mergern=mergern.GetParent())
|
||||
if(mergern.IsTableCell)
|
||||
break;
|
||||
}
|
||||
|
||||
var root=node;
|
||||
while(root&&!root.Contains(endnode))
|
||||
root=root.GetParent();
|
||||
node=root;
|
||||
}
|
||||
for(;node&&!control;node=node.GetParent())
|
||||
{
|
||||
if(node.IsControl()||node.IsTableCell||node.GetStyle("position")=="absolute")
|
||||
control=node;
|
||||
}
|
||||
|
||||
if(plugin.selectednode==control&&self.mergepn==mergepn&&self.mergern==mergern)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
jsml.suppend_layout();
|
||||
|
||||
if(plugin.selectednode)
|
||||
{
|
||||
self.stopmonitor();
|
||||
plugin.selectednode=null;
|
||||
}
|
||||
|
||||
self.mergepn=mergepn;
|
||||
self.mergern=mergern;
|
||||
|
||||
if(control)
|
||||
{
|
||||
plugin.selectednode=control;
|
||||
toolbar._rtenode=plugin.selectednode;
|
||||
self.startmonitor();
|
||||
}
|
||||
|
||||
jsml.resume_layout();
|
||||
]]>
|
||||
</method>
|
||||
<method name="HookControlSelectionForIE">
|
||||
<![CDATA[
|
||||
|
||||
if(!jsml.msie)return;
|
||||
|
||||
clearInterval(self._ieresizetimerid);
|
||||
|
||||
if(editor.GetSelectionType()!="Control")
|
||||
return;
|
||||
|
||||
var node=plugin.selectednode;
|
||||
|
||||
if(!node)
|
||||
return;
|
||||
|
||||
var vn=node.GetViewNode();
|
||||
var sl=vn.style.left;
|
||||
var st=vn.style.top;
|
||||
var sw=vn.style.width;
|
||||
var sh=vn.style.height;
|
||||
var surl=vn.getAttribute("src");
|
||||
var framever=editor.GetFrameVersion();
|
||||
self._ieresizetimerid=setInterval(function()
|
||||
{
|
||||
if(editor.GetFrameVersion()!=framever||plugin.selectednode!=node)
|
||||
{
|
||||
clearInterval(self._ieresizetimerid);
|
||||
return;
|
||||
}
|
||||
|
||||
if(self.iedownelement!=vn)
|
||||
return;
|
||||
|
||||
var url=vn.getAttribute("src");
|
||||
if(surl && url && surl!=url)
|
||||
{
|
||||
node.SetStyle("width","");
|
||||
node.SetStyle("height","");
|
||||
return;
|
||||
}
|
||||
|
||||
var l=vn.style.left;
|
||||
var t=vn.style.top;
|
||||
var w=vn.style.width;
|
||||
var h=vn.style.height;
|
||||
|
||||
if(sl==l&&st==t&&sw==w&&sh==h)return;
|
||||
|
||||
sw=w;
|
||||
sh=h;
|
||||
sl=l;
|
||||
st=t;
|
||||
if(l)node.SetStyle("left",l);
|
||||
if(t)node.SetStyle("top",t);
|
||||
if(!self.iedowncenter)
|
||||
{
|
||||
self.ieresizenode=node;
|
||||
self.ieresizewidth=w;
|
||||
node.RemoveAttribute("width");
|
||||
}
|
||||
if(!self.iedownmiddle)
|
||||
{
|
||||
self.ieresizenode=node;
|
||||
self.ieresizeheight=h;
|
||||
node.RemoveAttribute("height");
|
||||
}
|
||||
},100);
|
||||
]]>
|
||||
</method>
|
||||
<initialize>
|
||||
<![CDATA[
|
||||
|
||||
self.delegate_updatepos=self.delegate(self.updatepos);
|
||||
|
||||
editor.AttachEvent("SelectionChanged",function(editor,e)
|
||||
{
|
||||
self.updatecontrols();
|
||||
self.HookControlSelectionForIE();
|
||||
});
|
||||
editor.AttachEvent("TabModeChanged",function(editor,e)
|
||||
{
|
||||
self.updatecontrols();
|
||||
self.HookControlSelectionForIE();
|
||||
});
|
||||
|
||||
function onmousedown()
|
||||
{
|
||||
var event=editor.GetWindow().event;
|
||||
self.iedownelement=event.srcElement;
|
||||
self.iedownoffsetx=event.offsetX
|
||||
self.iedownoffsety=event.offsetY
|
||||
self.iedowncenter=Math.abs(self.iedownelement.offsetWidth/2-event.offsetX)<10
|
||||
self.iedownmiddle=Math.abs(self.iedownelement.offsetHeight/2-event.offsetY)<10
|
||||
|
||||
}
|
||||
function onmouseup()
|
||||
{
|
||||
self.iedownelement=null;
|
||||
if(self.ieresizenode)
|
||||
{
|
||||
if(self.ieresizewidth)self.ieresizenode.SetStyle("width",self.ieresizewidth);
|
||||
if(self.ieresizeheight)self.ieresizenode.SetStyle("height",self.ieresizeheight);
|
||||
}
|
||||
self.ieresizenode=null;
|
||||
}
|
||||
|
||||
function InitEvent()
|
||||
{
|
||||
editor.GetWindow().document.attachEvent("onmousedown",onmousedown);
|
||||
editor.GetWindow().document.attachEvent("onmouseup",onmouseup);
|
||||
}
|
||||
function UninitEvent()
|
||||
{
|
||||
editor.GetWindow().document.detachEvent("onmousedown",onmousedown);
|
||||
editor.GetWindow().document.detachEvent("onmouseup",onmouseup);
|
||||
}
|
||||
if(jsml.msie)
|
||||
{
|
||||
editor.AttachEvent("InitEvent",InitEvent);
|
||||
editor.AttachEvent("UninitEvent",UninitEvent);
|
||||
InitEvent();
|
||||
}
|
||||
|
||||
]]>
|
||||
</initialize>
|
||||
</panel>
|
||||
|
||||
<execute>
|
||||
<![CDATA[
|
||||
plugin.Execute=function(element,arg1,arg2)
|
||||
{
|
||||
|
||||
}
|
||||
plugin.controldesigner=jsml.class_create_instance("controldesigner");
|
||||
plugin.controldesigner.invoke_recursive("editor_ready",editor);
|
||||
]]>
|
||||
</execute>
|
||||
|
||||
|
||||
</jsml>
|
||||
|
After Width: | Height: | Size: 113 B |
415
LPWeb20/RichtextEditor/plugins/elementtoolbar/plugin.xml
Normal file
@@ -0,0 +1,415 @@
|
||||
<?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">
|
||||
|
||||
<execute>
|
||||
plugin.header_attribute_name="class";
|
||||
</execute>
|
||||
|
||||
<panel jsml-class="elementtoolbar_tag_a" overflow="visible" width="10" height="10" dock ="fill" padding="5,6,7,6">
|
||||
<label dock="left" text="@GOTOLINK" padding="0,2,0,2" overflow_x="visible" height="10" width="10" />
|
||||
<label dock="left" text="http://" text_color="darkblue" vertical_align="middle" padding="0,3,0,3" overflow_x="visible" height="10" width="50">
|
||||
<attach name="loadvalue">
|
||||
<![CDATA[
|
||||
if(!plugin.selectednode)return;
|
||||
var s=plugin.selectednode.GetAttribute("href")||"";
|
||||
if(s.length>77)
|
||||
{
|
||||
self.set_text(s.substring(0,73)+"....");
|
||||
self.set_tooltip(s);
|
||||
}
|
||||
else
|
||||
{
|
||||
self.set_text(s);
|
||||
self.set_tooltip(null);
|
||||
}
|
||||
self.set_cursor("pointer");
|
||||
self._content.style.textDecoration="underline";
|
||||
]]>
|
||||
</attach>
|
||||
<attach name="click">
|
||||
var url=plugin.selectednode.GetAttribute("href");
|
||||
if(url)window.open(url);
|
||||
</attach>
|
||||
</label>
|
||||
<label dock="left" text="-" padding="0,2,0,2" overflow_x="visible" height="10" width="10" />
|
||||
<label dock="left" text="@CHANGE" text_color="darkblue" vertical_align="middle" padding="0,3,0,3" overflow_x="visible" height="10" width="10">
|
||||
<attach name="loadvalue">
|
||||
self.set_cursor("pointer");
|
||||
self._content.style.textDecoration="underline";
|
||||
</attach>
|
||||
<attach name="click">
|
||||
editor.ExecUICommand(null,"InsertLink");
|
||||
</attach>
|
||||
</label>
|
||||
<label dock="left" text="-" padding="0,2,0,2" overflow_x="visible" height="10" width="10" />
|
||||
<label dock="left" text="@REMOVE" text_color="darkblue" vertical_align="middle" padding="0,3,0,3" overflow_x="visible" height="10" width="10">
|
||||
<attach name="loadvalue">
|
||||
self.set_cursor("pointer");
|
||||
self._content.style.textDecoration="underline";
|
||||
</attach>
|
||||
<attach name="click">
|
||||
editor.ExecUICommand(null,"UnLink");
|
||||
</attach>
|
||||
</label>
|
||||
|
||||
</panel>
|
||||
|
||||
<panel jsml-class="elementtoolbar">
|
||||
|
||||
<panel jsml-local="toolbar" overflow="visible" width="10" height="10" back_color="#E1EFFF">
|
||||
<initialize>
|
||||
self._estyle.border="solid 1px #A8CDFC";
|
||||
</initialize>
|
||||
</panel>
|
||||
|
||||
<method name="jsml_append" arguments="panel">
|
||||
panel._dommode='absolute';
|
||||
panel.set_parent(document.body);
|
||||
self.hidepanel(panel,true);
|
||||
if(!self.panels)self.panels=[];
|
||||
self.panels.push(panel);
|
||||
</method>
|
||||
<method name="invoke_recursive" overrideas="panel_invoke_recursive">
|
||||
<![CDATA[
|
||||
self.panel_invoke_recursive();
|
||||
for(var i=0;i<self.panels.length;i++)
|
||||
self.panels[i].invoke_recursive.apply(self.panels[i],arguments);
|
||||
]]>
|
||||
</method>
|
||||
|
||||
<method name="hidepanel" arguments="panel,hidenow">
|
||||
<![CDATA[
|
||||
if(panel.ishided)return;
|
||||
panel.ishided=true;
|
||||
function hideit()
|
||||
{
|
||||
panel.set_visibility("hidden");
|
||||
panel._estyle.left="-1000px";
|
||||
panel._estyle.top="-1000px";
|
||||
}
|
||||
if(hidenow)
|
||||
{
|
||||
hideit();
|
||||
return;
|
||||
}
|
||||
setTimeout(function()
|
||||
{
|
||||
if(!panel.ishided)return;
|
||||
hideit();
|
||||
},5);
|
||||
]]>
|
||||
</method>
|
||||
<method name="showpanel" arguments="panel,pos,mode,edge,xoffset,yoffset">
|
||||
<![CDATA[
|
||||
|
||||
panel.ishided=false;
|
||||
panel.set_visibility("visible");
|
||||
|
||||
var pew=pos.width;
|
||||
var peh=pos.height;
|
||||
|
||||
if(edge=="w"||edge=="s")panel.set_width(pew);
|
||||
if(edge=="h"||edge=="s")panel.set_height(peh);
|
||||
|
||||
var w=panel.get_current_width();
|
||||
var h=panel.get_current_height();
|
||||
|
||||
panel._estyle.zIndex=editor._config.ctrltool_zindex;
|
||||
|
||||
pos={left:pos.left,top:pos.top}
|
||||
|
||||
var nomovey,nomovex;
|
||||
|
||||
var fmpair=mode?mode.split('-'):[];
|
||||
|
||||
switch(fmpair[0])
|
||||
{
|
||||
case "t":
|
||||
nomovey=true;
|
||||
pos.top+=-h;
|
||||
break;
|
||||
case "b":
|
||||
nomovey=true;
|
||||
pos.top+=peh;
|
||||
break;
|
||||
case "l":
|
||||
nomovex=true;
|
||||
pos.left+=-w;
|
||||
break;
|
||||
case "r":
|
||||
nomovex=true;
|
||||
pos.left+=pew;
|
||||
break;
|
||||
}
|
||||
|
||||
switch(fmpair[1])
|
||||
{
|
||||
case "l":
|
||||
if(pew<w)pos.left+=pew-w;
|
||||
break;
|
||||
case "r":
|
||||
if(pew>w)pos.left+=pew-w;
|
||||
break;
|
||||
case "t":
|
||||
if(peh<h)pos.top+=peh-h;
|
||||
break;
|
||||
case "b":
|
||||
if(peh>h)pos.top+=peh-h;
|
||||
break;
|
||||
case "c":
|
||||
case "m":
|
||||
if(fmpair[0]=="t"||fmpair[0]=="b")
|
||||
{
|
||||
pos.left+=Math.floor((pew-w)/2)
|
||||
}
|
||||
else
|
||||
{
|
||||
pos.top+=Math.floor((peh-h)/2)
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if(xoffset)pos.left+=xoffset;
|
||||
if(yoffset)pos.top+=yoffset;
|
||||
|
||||
if(pos.left<10)pos.left=10
|
||||
|
||||
panel._estyle.left=pos.left+"px";
|
||||
panel._estyle.top=pos.top+"px";
|
||||
|
||||
]]>
|
||||
</method>
|
||||
|
||||
<method name="calc_ctrl_pos" arguments="ctrl,autoadjust">
|
||||
<![CDATA[
|
||||
var viewnode=ctrl.GetViewNode();
|
||||
|
||||
var fp=jsml.get_scrollposition(editor._config.skin_frame);
|
||||
var pos=jsml.get_clientposition(viewnode,editor.GetWindow());
|
||||
|
||||
pos.width=viewnode.offsetWidth;
|
||||
pos.height=viewnode.offsetHeight;
|
||||
|
||||
var zoom=parseInt(editor.GetWindow().document.body.style.zoom)||100;
|
||||
if(zoom!=100)
|
||||
{
|
||||
pos.top=pos.top*zoom/100;
|
||||
pos.left=pos.left*zoom/100;
|
||||
pos.width=pos.width*zoom/100;
|
||||
pos.height=pos.height*zoom/100;
|
||||
}
|
||||
|
||||
if(autoadjust)
|
||||
{
|
||||
fp.width=editor._config.skin_frame.offsetWidth-1;
|
||||
fp.height=editor._config.skin_frame.offsetHeight-1;
|
||||
|
||||
pos.left-=1;
|
||||
pos.top-=1;
|
||||
pos.width+=2;
|
||||
pos.height+=2;
|
||||
|
||||
if(pos.top<0)
|
||||
{
|
||||
pos.height-=-pos.top;
|
||||
pos.top=0;
|
||||
}
|
||||
if(pos.left<0)
|
||||
{
|
||||
pos.left=0;
|
||||
pos.width-=-pos.left;
|
||||
}
|
||||
|
||||
if(pos.left+pos.width>fp.width)
|
||||
{
|
||||
var sub=pos.left+pos.width-fp.width;
|
||||
pos.width-=sub;
|
||||
}
|
||||
if(pos.top+pos.height>fp.height)
|
||||
{
|
||||
var sub=pos.top+pos.height-fp.height;
|
||||
pos.height-=sub;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
pos.left+=fp.left;
|
||||
pos.top+=fp.top;
|
||||
return pos;
|
||||
]]>
|
||||
|
||||
</method>
|
||||
<method name="startmonitor">
|
||||
<![CDATA[
|
||||
|
||||
plugin.selectedprovider=editor.CreateControlProvider(plugin.selectednode);
|
||||
|
||||
self.docversion=null;
|
||||
self.docstop=null;
|
||||
self.lastupdatetime=null;
|
||||
self.lastpos=null;
|
||||
self.updatepos();
|
||||
|
||||
]]>
|
||||
</method>
|
||||
<method name="updatepos">
|
||||
<![CDATA[
|
||||
|
||||
clearTimeout(self.updateposid);
|
||||
self.updateposid=setTimeout(self.delegate_updatepos,10);
|
||||
|
||||
var now=new Date().getTime();
|
||||
var ver=editor.GetContentVersion();
|
||||
var doc=editor.GetWindow().document;
|
||||
var sct=Math.max(doc.body.scrollTop,doc.documentElement.scrollTop);
|
||||
if(self.docversion==ver&&self.docstop==sct)
|
||||
{
|
||||
if(now-(self.lastupdatetime||0)<200)
|
||||
return;
|
||||
}
|
||||
|
||||
self.docversion=ver;
|
||||
self.docstop=sct
|
||||
self.lastupdatetime=now;
|
||||
|
||||
var pos;
|
||||
|
||||
try
|
||||
{
|
||||
pos=self.calc_ctrl_pos(plugin.selectednode,true);
|
||||
}
|
||||
catch(x)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if(self.lastpos&&self.lastpos.top==pos.top&&self.lastpos.left==pos.left
|
||||
&&self.lastpos.width==pos.width&&self.lastpos.height==pos.height)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
self.lastpos=pos;
|
||||
|
||||
var ctrlpos=pos;
|
||||
|
||||
var clsname="elementtoolbar_tag_"+plugin.selectednode.GetNameLower();
|
||||
if(jsml.class_exists(clsname))
|
||||
{
|
||||
var keyname="pageinst_"+plugin.selectednode.GetNameLower();
|
||||
self.pageinst=self[keyname];
|
||||
if(!self.pageinst)
|
||||
{
|
||||
self.pageinst=jsml.class_create_instance(clsname);
|
||||
self.pageinst.invoke_recursive("editor_ready",editor);
|
||||
self[keyname]=self.pageinst;
|
||||
}
|
||||
if(self.pageinst.get_parent()==null)
|
||||
{
|
||||
toolbar.append_child(self.pageinst);
|
||||
self.pageinst.invoke_recursive("loadvalue");
|
||||
}
|
||||
self.showpanel(toolbar,pos,"b-c" ,"")
|
||||
}
|
||||
|
||||
|
||||
|
||||
]]>
|
||||
</method>
|
||||
<method name="stopmonitor">
|
||||
<![CDATA[
|
||||
clearTimeout(self.updateposid);
|
||||
for(var i=0;i<self.panels.length;i++)
|
||||
self.hidepanel(self.panels[i]);
|
||||
self.lastpos=null;
|
||||
if(self.pageinst)self.pageinst.set_parent(null);
|
||||
]]>
|
||||
</method>
|
||||
|
||||
|
||||
<method name="updatecontrols">
|
||||
<![CDATA[
|
||||
if(!editor.IsTabEdit())
|
||||
{
|
||||
if(plugin.selectednode)
|
||||
{
|
||||
self.stopmonitor();
|
||||
plugin.selectednode=null;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
var node=null;
|
||||
var control;
|
||||
|
||||
if(!editor.GetDragControl())
|
||||
{
|
||||
node=editor.GetPointNode();
|
||||
|
||||
var link=editor.IsIncludedByTag("a");
|
||||
if(editor._config.showlinkbar&&link&&link.GetAttribute("href"))
|
||||
{
|
||||
if(editor.GetSelectionType()!="Control")
|
||||
{
|
||||
control=link;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(plugin.selectednode==control)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
jsml.suppend_layout();
|
||||
|
||||
if(plugin.selectednode)
|
||||
{
|
||||
self.stopmonitor();
|
||||
plugin.selectednode=null;
|
||||
}
|
||||
|
||||
if(control)
|
||||
{
|
||||
plugin.selectednode=control;
|
||||
toolbar._rtenode=plugin.selectednode;
|
||||
self.startmonitor();
|
||||
}
|
||||
|
||||
jsml.resume_layout();
|
||||
]]>
|
||||
</method>
|
||||
|
||||
<initialize>
|
||||
<![CDATA[
|
||||
|
||||
self.delegate_updatepos=self.delegate(self.updatepos);
|
||||
|
||||
editor.AttachEvent("SelectionChanged",function(editor,e)
|
||||
{
|
||||
self.updatecontrols();
|
||||
});
|
||||
editor.AttachEvent("TabModeChanged",function(editor,e)
|
||||
{
|
||||
self.updatecontrols();
|
||||
});
|
||||
|
||||
]]>
|
||||
</initialize>
|
||||
</panel>
|
||||
|
||||
<execute>
|
||||
<![CDATA[
|
||||
plugin.Execute=function(element,arg1,arg2)
|
||||
{
|
||||
|
||||
}
|
||||
plugin.elementtoolbar=jsml.class_create_instance("elementtoolbar");
|
||||
plugin.elementtoolbar.invoke_recursive("editor_ready",editor);
|
||||
]]>
|
||||
</execute>
|
||||
|
||||
|
||||
</jsml>
|
||||
209
LPWeb20/RichtextEditor/plugins/googlemap/googlemap.htm
Normal file
@@ -0,0 +1,209 @@
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<title>map</title>
|
||||
|
||||
<style type="text/css">
|
||||
body,input,textarea,button,select,fieldset,table
|
||||
{
|
||||
color: windowtext;
|
||||
font-family:"Lucida Grande", Tahoma, Verdana, Arial, sans-serif;
|
||||
font-size:11px;
|
||||
}
|
||||
button
|
||||
{
|
||||
cursor:pointer;
|
||||
height: 20px;
|
||||
}
|
||||
#searchbox
|
||||
{
|
||||
height:18px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div style="margin-bottom: 5px;">
|
||||
<span langtext='1'>Search</span>:
|
||||
<input id="searchbox" type="text" style="width:220px" />
|
||||
<button onclick="TrySearch();return false;">
|
||||
<span langtext='1'>Search</span></button>
|
||||
<span> </span> <span langtext='1'>Size</span>:
|
||||
<select id='selsize'>
|
||||
<option value="640x480">640x480</option>
|
||||
<option value="480x320">480x320</option>
|
||||
<option value="320x240">320x240</option>
|
||||
</select>
|
||||
<button onclick="InsertMapUrl();return false;" style="float:right;width:82px;">
|
||||
<span langtext='1'>Insert</span></button>
|
||||
</div>
|
||||
<div id="mappanel" style="width: 540px; height: 370px; border: solid 1px gray;">
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script type="text/javascript">
|
||||
var usingssl=(location.href.indexOf("https://")==0);
|
||||
var httphead=usingssl?"https":"http";
|
||||
document.write('<script type="text/javascript" src="'+httphead+'://maps.google.com/maps/api/js?sensor=false"></scr'+'ipt>');
|
||||
</script>
|
||||
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
|
||||
// https://developers.google.com/maps/documentation/javascript/maptypes#BasicMapTypes
|
||||
var param={mapTypeId:google.maps.MapTypeId.ROADMAP,zoom:4};
|
||||
|
||||
var mappanel=document.getElementById("mappanel");
|
||||
var mapobject = new google.maps.Map(mappanel,param);
|
||||
var mapmarker = new google.maps.Marker({map:mapobject,draggable:true});
|
||||
|
||||
mapmarker.setTitle("Mark");
|
||||
|
||||
function saveposinfo()
|
||||
{
|
||||
var center=mapobject.getCenter().lat()+","+mapobject.getCenter().lng()
|
||||
var mmcenter=mapmarker.getPosition().lat()+","+mapmarker.getPosition().lng()
|
||||
parent.rtegooglemapeditor._googlemapinfo={zoom:mapobject.getZoom(),center:center,marker:mmcenter}
|
||||
}
|
||||
|
||||
function handlechanged()
|
||||
{
|
||||
mapmarker.setPosition(mapobject.getCenter());
|
||||
saveposinfo()
|
||||
}
|
||||
|
||||
google.maps.event.addListener(mapobject,"center_changed", handlechanged);
|
||||
google.maps.event.addListener(mapmarker,"dragend",saveposinfo);
|
||||
|
||||
function parseLatLng(exp)
|
||||
{
|
||||
var pair=exp.split(',')
|
||||
return new google.maps.LatLng(parseFloat(pair[0]),parseFloat(pair[1]))
|
||||
}
|
||||
|
||||
|
||||
var loadcount=0;
|
||||
function LoadFromUrl()
|
||||
{
|
||||
loadcount++;
|
||||
if(loadcount!=1)return;
|
||||
var url=parent.rtegooglemapoption.currenturl
|
||||
if(!url)return;
|
||||
|
||||
var pairs=(url.split('#')[0].split('?')[1]||"").split('&')
|
||||
for(var i=0;i<pairs.length;i++)
|
||||
{
|
||||
var pair=pairs[i].split('=');
|
||||
if(pair.length!=2)
|
||||
continue;
|
||||
var name=pair[0];
|
||||
if(name=="maptype")mapobject.setMapTypeId(pair[1]);
|
||||
if(name=="zoom")mapobject.setZoom(parseInt(pair[1]));
|
||||
if(name=="center")mapobject.setCenter(parseLatLng(pair[1]));
|
||||
if(name=="markers")mapmarker.setPosition(parseLatLng(pair[1]));
|
||||
if(name=="size")document.getElementById("selsize").value=pair[1];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
function FindLocation(address,zoom)
|
||||
{
|
||||
if(!address)address="";
|
||||
var geocoder = new google.maps.Geocoder();
|
||||
geocoder.geocode({"address":address},function(results,status)
|
||||
{
|
||||
if (status != google.maps.GeocoderStatus.OK)
|
||||
{
|
||||
alert("Failed to search '"+address+"'");
|
||||
return;
|
||||
}
|
||||
var ll=results[0].geometry.location;
|
||||
if(zoom)mapobject.setZoom(zoom);
|
||||
mapobject.setCenter(ll);
|
||||
mapmarker.setPosition(ll);
|
||||
LoadFromUrl()
|
||||
});
|
||||
}
|
||||
|
||||
setTimeout(function()
|
||||
{
|
||||
var config=parent.rtegooglemapeditor._config;
|
||||
var lastpos=null;
|
||||
if(config.googlemap_saveinsession)
|
||||
lastpos=parent.rtegooglemapeditor._googlemapinfo;
|
||||
if(!lastpos)
|
||||
{
|
||||
FindLocation(config.googlemap_initialplace,config.googlemap_initialzoom);
|
||||
return;
|
||||
}
|
||||
mapobject.setZoom(lastpos.zoom);
|
||||
mapobject.setCenter(parseLatLng(lastpos.center));
|
||||
mapmarker.setPosition(parseLatLng(lastpos.marker));
|
||||
LoadFromUrl();
|
||||
},100);
|
||||
|
||||
function InsertMapUrl()
|
||||
{
|
||||
var typeid=mapobject.getMapTypeId();
|
||||
var zoom=mapobject.getZoom();
|
||||
var center=mapobject.getCenter().lat()+","+mapobject.getCenter().lng()
|
||||
var mmcenter=mapmarker.getPosition().lat()+","+mapmarker.getPosition().lng()
|
||||
var size=document.getElementById("selsize").value;
|
||||
|
||||
var url=httphead+"://maps.google.com/maps/api/staticmap?sensor=false&size="+size
|
||||
+"&maptype="+typeid+"&zoom="+zoom
|
||||
+"¢er="+center+"&markers="+mmcenter
|
||||
|
||||
parent.rtegooglemapoption.seturl(url);
|
||||
parent.rtegooglemapdialog.result=true;
|
||||
parent.rtegooglemapdialog.close();
|
||||
}
|
||||
|
||||
|
||||
var searchbox=document.getElementById("searchbox");
|
||||
|
||||
function TrySearch()
|
||||
{
|
||||
var txt=searchbox.value.replace(/(^\s+|\s+$)/g,"");
|
||||
if(!txt)return;
|
||||
FindLocation(txt,6);
|
||||
}
|
||||
|
||||
searchbox.onkeydown=function(e)
|
||||
{
|
||||
e=window.event||e;
|
||||
if(e.keyCode==13)
|
||||
{
|
||||
TrySearch();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
new function()
|
||||
{
|
||||
var editor=parent.rtegooglemapeditor;
|
||||
var ns=document.getElementsByTagName("*");
|
||||
for(var i=0;i<ns.length;i++)
|
||||
{
|
||||
var n=ns[i];
|
||||
if(n.getAttribute('langtext')!="1")continue;
|
||||
var t=n.innerText||n.textContent||"";
|
||||
if(t)
|
||||
{
|
||||
t=editor.GetLangText(t);
|
||||
n.innerText=t;
|
||||
n.textContent=t;
|
||||
}
|
||||
var t=n.value||"";
|
||||
if(t)
|
||||
{
|
||||
t=editor.GetLangText(t);
|
||||
n.value=t;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
</html>
|
||||
48
LPWeb20/RichtextEditor/plugins/googlemap/googlemap.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">
|
||||
|
||||
<execute>
|
||||
dialog.set_title(editor.GetLangText("googlemap"));
|
||||
</execute>
|
||||
|
||||
<panel jsml-class="googlemap_dialog" dock="fill" overflow="visible">
|
||||
<htmlcontrol dock="fill" jsml-local="hc">
|
||||
</htmlcontrol>
|
||||
<attach name="attach_dom">
|
||||
<![CDATA[
|
||||
setTimeout(function()
|
||||
{
|
||||
if(self.iframe)return;
|
||||
|
||||
window.rtegooglemapeditor=editor;
|
||||
window.rtegooglemapdialog=dialog;
|
||||
window.rtegooglemapoption=option;
|
||||
|
||||
dialog.attach_event("closing",function()
|
||||
{
|
||||
window.rtegooglemapeditor=null;
|
||||
window.rtegooglemapdialog=null;
|
||||
window.rtegooglemapoption=null;
|
||||
});
|
||||
|
||||
var iframe=document.createElement("IFRAME");
|
||||
iframe.setAttribute("src","{folder}plugins/"+option.plugin.Name+"/googlemap.htm?{timems}");
|
||||
iframe.setAttribute("frameBorder","0");
|
||||
hc._content.appendChild(iframe);
|
||||
self.iframe=iframe;
|
||||
self.invoke_event("resize");
|
||||
},10);
|
||||
]]>
|
||||
</attach>
|
||||
<attach name="resize">
|
||||
if(!self.iframe)return;
|
||||
self.iframe.style.width=hc.get_client_width()+"px";
|
||||
self.iframe.style.height=hc.get_client_height()+"px";
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="googlemap_dialog" />
|
||||
|
||||
|
||||
</jsml>
|
||||
64
LPWeb20/RichtextEditor/plugins/googlemap/plugin.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">
|
||||
|
||||
|
||||
<execute>
|
||||
<![CDATA[
|
||||
|
||||
plugin.Execute=function(element,arg1,arg2)
|
||||
{
|
||||
var newoption={width:560,height:420}
|
||||
newoption.plugin=plugin;
|
||||
var selectedurl;
|
||||
newoption.seturl=function(url)
|
||||
{
|
||||
selectedurl=url;
|
||||
}
|
||||
newoption.callback=function(res)
|
||||
{
|
||||
if(!res||!selectedurl)return;
|
||||
var nodes=editor.InsertHTML("<img src='"+jsml.html_encode(selectedurl)+"' alt=''/>",true);
|
||||
}
|
||||
editor.ShowXmlDialog("{folder}plugins/{plugin}/googlemap.xml?{timems}",newoption);
|
||||
}
|
||||
|
||||
|
||||
editor.AttachEvent("CreateControlProvider",function(editor,e)
|
||||
{
|
||||
var provider=e.Arguments[0];
|
||||
var control=provider.Control;
|
||||
var nl=control.GetNameLower();
|
||||
if(nl!="img")return;
|
||||
var src=control.GetAttribute("src");
|
||||
if(!src||src.indexOf("://maps.google.com/maps/api/staticmap?")==-1)
|
||||
return;
|
||||
provider.GetTitle=function()
|
||||
{
|
||||
return "Google map";
|
||||
}
|
||||
provider.ShowPropertiesDialog=function()
|
||||
{
|
||||
var newoption={width:560,height:420}
|
||||
newoption.plugin=plugin;
|
||||
newoption.targetnode=control;
|
||||
newoption.currenturl=control.GetAttribute("src");
|
||||
var selectedurl;
|
||||
newoption.seturl=function(url)
|
||||
{
|
||||
selectedurl=url;
|
||||
}
|
||||
newoption.callback=function(res)
|
||||
{
|
||||
if(!res||!selectedurl)return;
|
||||
control.SetAttribute("src",selectedurl);
|
||||
}
|
||||
editor.ShowXmlDialog("{folder}plugins/{plugin}/googlemap.xml?{timems}",newoption);
|
||||
}
|
||||
});
|
||||
|
||||
]]>
|
||||
</execute>
|
||||
|
||||
|
||||
</jsml>
|
||||
20
LPWeb20/RichtextEditor/plugins/insertchars/plugin.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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">
|
||||
|
||||
|
||||
|
||||
<execute>
|
||||
<![CDATA[
|
||||
plugin.Execute=function(element,arg1,arg2)
|
||||
{
|
||||
var option={width:520,height:360}
|
||||
option.plugin=plugin;
|
||||
editor.ShowXmlDialog("{folder}server/insertchars.xml?{timems}",option);
|
||||
}
|
||||
|
||||
]]>
|
||||
</execute>
|
||||
|
||||
|
||||
</jsml>
|
||||
73
LPWeb20/RichtextEditor/plugins/insertyoutube/plugin.xml
Normal file
@@ -0,0 +1,73 @@
|
||||
<?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">
|
||||
|
||||
|
||||
|
||||
<execute>
|
||||
<![CDATA[
|
||||
|
||||
plugin.Execute=function(element,arg1,arg2)
|
||||
{
|
||||
var option={width:540,height:350}
|
||||
option.plugin=plugin;
|
||||
editor.ShowXmlDialog("{folder}plugins/{plugin}/youtube.xml?{timems}",option);
|
||||
}
|
||||
|
||||
plugin.FindMovie=function(url)
|
||||
{
|
||||
url=url.replace(/(^\s+|\s+$)/g,"");
|
||||
url=url.split('#')[0];
|
||||
if(!url)return;
|
||||
var qp=url.split('#')[0].split('?');
|
||||
var qs=(qp[1]||'').split('&');
|
||||
for(var i=0;i<qs.length;i++)
|
||||
if(qs[i].substring(0,2)=="v=")
|
||||
return qs[i].substring(2);
|
||||
url=qp[0];
|
||||
var prefixs=["youtu.be/","youtube.com/embed/"];
|
||||
for(var i=0;i<prefixs.length;i++)
|
||||
{
|
||||
var pos=url.indexOf(prefixs[i]);
|
||||
if(pos!=-1)return url.substring(pos+prefixs[i].length);
|
||||
}
|
||||
}
|
||||
|
||||
editor.AttachEvent("CreateControlProvider",function(editor,e)
|
||||
{
|
||||
var provider=e.Arguments[0];
|
||||
var control=provider.Control;
|
||||
var nl=control.GetNameLower();
|
||||
if(nl!="iframe")return;
|
||||
var src=control.GetAttribute("src");
|
||||
if(!src)
|
||||
return;
|
||||
var movie=plugin.FindMovie(src);
|
||||
if(!movie)
|
||||
return;
|
||||
provider.GetTitle=function()
|
||||
{
|
||||
return "Youtube";
|
||||
}
|
||||
provider.ShowPropertiesDialog=function()
|
||||
{
|
||||
var newoption={width:560,height:360}
|
||||
newoption.plugin=plugin;
|
||||
newoption.currenturl=control.GetAttribute("src");
|
||||
newoption.currentwidth=control.GetStyle("width");
|
||||
newoption.currentheight=control.GetStyle("height");
|
||||
editor.ShowXmlDialog("{folder}plugins/{plugin}/youtube.xml?{timems}",newoption);
|
||||
}
|
||||
provider.FillDesignView=function(element)
|
||||
{
|
||||
element.innerHTML="Youtube movie:"+src+"<hr/><img src='"+jsml.html_encode("http://img.youtube.com/vi/"+movie+"/hqdefault.jpg")+"'/>";
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
]]>
|
||||
</execute>
|
||||
|
||||
|
||||
</jsml>
|
||||
|
||||
280
LPWeb20/RichtextEditor/plugins/insertyoutube/youtube.xml
Normal file
@@ -0,0 +1,280 @@
|
||||
<?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">
|
||||
|
||||
<execute>
|
||||
dialog.set_title(editor.GetLangText("insertyoutube"));
|
||||
</execute>
|
||||
|
||||
<panel jsml-class="insertyoutube_dialog" dock="fill" overflow="visible" back_color="#f9f9f9">
|
||||
|
||||
<panel dock="top" margin="12">
|
||||
<label dock="left" text="@youtubeurl" width="1" overflow="visible" vertical_align="middle" />
|
||||
|
||||
<textbox dock="fill" jsml-local="urlbox" margin="1,103,1,3" border_color="#ABADB3">
|
||||
<initialize>
|
||||
setTimeout(function(){self.focus();},300);
|
||||
</initialize>
|
||||
<attach name="change,enterkey,keyup">
|
||||
setTimeout(function(){instance.ParseUrl()},100);
|
||||
</attach>
|
||||
</textbox>
|
||||
|
||||
<button right="10" text="@Preview">
|
||||
<attach name="click">
|
||||
instance.DoPreview();
|
||||
</attach>
|
||||
</button>
|
||||
</panel>
|
||||
|
||||
<panel dock="bottom" margin="12" overflow="visible">
|
||||
<panel right="0" overflow="visible">
|
||||
<button dock="left" height="24" margin="2" text="@OK">
|
||||
<attach name="click">
|
||||
instance.DoInsert();
|
||||
</attach>
|
||||
</button>
|
||||
<button dock="left" height="24" margin="2" text="@Cancel">
|
||||
<attach name="click">
|
||||
dialog.close();
|
||||
</attach>
|
||||
</button>
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
<panel dock="left" width="170" padding="6,0,0,6" >
|
||||
<panel dock="top">
|
||||
<label dock="left" text="@usehttps|:" width="70" text_align="right"/>
|
||||
<panel dock="left" width="2" />
|
||||
<checkbox jsml-local="cbhttps" dock="left"/>
|
||||
</panel>
|
||||
<panel dock="top">
|
||||
<label dock="left" text="@autoplay|:" width="70" text_align="right"/>
|
||||
<panel dock="left" width="2" />
|
||||
<checkbox jsml-local="cbautoplay" dock="left"/>
|
||||
</panel>
|
||||
<panel dock="top">
|
||||
<label dock="left" text="@loop|:" width="70" text_align="right"/>
|
||||
<panel dock="left" width="2" />
|
||||
<checkbox jsml-local="cbloop" dock="left"/>
|
||||
</panel>
|
||||
<panel dock="top">
|
||||
<label dock="left" text="@hideinfo|:" width="70" text_align="right"/>
|
||||
<panel dock="left" width="2" />
|
||||
<checkbox jsml-local="cbnoinfo" dock="left"/>
|
||||
</panel>
|
||||
<panel dock="top">
|
||||
<label dock="left" text="@hidetoolbar|:" width="70" text_align="right"/>
|
||||
<panel dock="left" width="2" />
|
||||
<checkbox jsml-local="cbnoctrl" dock="left"/>
|
||||
</panel>
|
||||
<panel dock="top">
|
||||
<label dock="left" text="@lighttheme|:" width="70" text_align="right"/>
|
||||
<panel dock="left" width="2" />
|
||||
<checkbox jsml-local="cblight" dock="left"/>
|
||||
</panel>
|
||||
<panel dock="top">
|
||||
<label dock="left" text="@DIMENSIONS|:" width="70" text_align="right" vertical_align="middle"/>
|
||||
<panel dock="left" width="6" />
|
||||
<dropdown jsml-local="ddsize" dock="left" border_color="#ABADB3" width="70">
|
||||
<attach name="change">
|
||||
<![CDATA[
|
||||
var sizes=ddsize.get_text().split('x').join(',').split(',');
|
||||
tbwidth.set_text(sizes[0]);
|
||||
tbheight.set_text(sizes[1]);
|
||||
]]>
|
||||
</attach>
|
||||
<listitem value="640x480" text="640x480"/>
|
||||
<listitem value="640x400" text="640x400"/>
|
||||
<listitem value="480x360" text="480x360"/>
|
||||
<listitem value="480x300" text="480x300"/>
|
||||
<listitem value="360x240" text="360x240"/>
|
||||
<listitem value="320x240" text="320x240"/>
|
||||
</dropdown>
|
||||
</panel>
|
||||
<panel dock="top" overflow="visible">
|
||||
<panel dock="right" width="25" vertical_align="middle" margin="7,0,0,1">
|
||||
<image src="{folder}images/locked.gif" cursor="pointer">
|
||||
<attach name="click">
|
||||
instance._dimunlocked=!instance._dimunlocked;
|
||||
self.set_src(instance._dimunlocked?"{folder}images/unlocked.gif":"{folder}images/locked.gif");
|
||||
</attach>
|
||||
</image>
|
||||
</panel>
|
||||
<panel dock="top" margin="2,0,0,0">
|
||||
<label dock="left" text="@WIDTH|:" text_align="right" width="70" vertical_align="middle"/>
|
||||
<panel jsml-base="rtepropunitbox" jsml-local="tbwidth" width="60" margin="4,0,0,6" dock="left" propname="style:width" border_width="1" border_color="#cccccc">
|
||||
<attach name="change">
|
||||
instance.onwidthchange();
|
||||
</attach>
|
||||
</panel>
|
||||
</panel>
|
||||
<panel dock="top" margin="2,0,0,0">
|
||||
<label dock="left" text="@HEIGHT|:" text_align="right" width="70" vertical_align="middle"/>
|
||||
<panel jsml-base="rtepropunitbox" jsml-local="tbheight" width="60" margin="4,0,0,6" dock="left" propname="style:height" border_width="1" border_color="#cccccc">
|
||||
<attach name="change">
|
||||
instance.onheightchange();
|
||||
</attach>
|
||||
</panel>
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
</panel>
|
||||
|
||||
<panel dock="right" width="360" margin="0,5,0,0">
|
||||
<panel dock="fill" horizontal_align="center" vertical_align="middle">
|
||||
<image jsml-local="previewimage" width="320" height="240" overflow="none" zoom="both" border_width="1" border_color="#999999" back_color="white"/>
|
||||
</panel>
|
||||
<panel jsml-local="previewintro" dock="fill" horizontal_align="center" vertical_align="middle" back_color="white" border_width="1" border_color="#999999">
|
||||
<label text="@youtubepreview" word_wrap="true" width="280" height="48" overflow="none"/>
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
<initialize>
|
||||
<![CDATA[
|
||||
|
||||
self._rtenode=new $rte.ContainerElement("div");
|
||||
|
||||
var url=option.currenturl;
|
||||
if(!url)return;
|
||||
var movie=option.plugin.FindMovie(url);
|
||||
if(!movie)return;
|
||||
if(url.substring(0,8)=="https://")
|
||||
cbhttps.set_checked(true);
|
||||
var pairs=(url.split('#')[0].split('?')[1]||"").split('&');
|
||||
for(var i=0;i<pairs.length;i++)
|
||||
{
|
||||
var pair=pairs[i];
|
||||
switch(pair)
|
||||
{
|
||||
case "autoplay=1":
|
||||
cbautoplay.set_checked(true);
|
||||
break;
|
||||
case "loop=1":
|
||||
cbloop.set_checked(true);
|
||||
break;
|
||||
case "showinfo=0":
|
||||
cbnoinfo.set_checked(true);
|
||||
break;
|
||||
case "controls=0":
|
||||
cbnoctrl.set_checked(true);
|
||||
break;
|
||||
case "theme=light":
|
||||
cblight.set_checked(true);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(option.currentwidth)
|
||||
{
|
||||
self._rtenode.SetStyle("width",option.currentwidth);
|
||||
tbwidth.set_text(option.currentwidth);
|
||||
}
|
||||
if(option.currentheight)
|
||||
{
|
||||
self._rtenode.SetStyle("height",option.currentheight);
|
||||
tbheight.set_text(option.currentheight);
|
||||
}
|
||||
|
||||
if(option.currentwidth&&option.currentwidth)
|
||||
ddsize.set_text(parseInt(option.currentwidth)+"x"+parseInt(option.currentwidth));
|
||||
|
||||
urlbox.set_text("http://www.youtube.com/watch?v="+movie);
|
||||
self.ParseUrl();
|
||||
|
||||
|
||||
]]>
|
||||
</initialize>
|
||||
|
||||
|
||||
<method name="onwidthchange">
|
||||
<![CDATA[
|
||||
if(instance._dimunlocked)return;
|
||||
var w=parseInt(tbwidth.get_text());
|
||||
if(!w)
|
||||
{
|
||||
tbheight.set_text("");
|
||||
return;
|
||||
}
|
||||
var sizes=ddsize.get_text().split('x').join(',').split(',')
|
||||
var h=Math.floor(w*sizes[1]/sizes[0]);
|
||||
tbheight.set_text(h);
|
||||
]]>
|
||||
</method>
|
||||
<method name="onheightchange">
|
||||
<![CDATA[
|
||||
if(instance._dimunlocked)return;
|
||||
var h=parseInt(tbheight.get_text());
|
||||
if(!h)
|
||||
{
|
||||
tbwidth.set_text("");
|
||||
return;
|
||||
}
|
||||
var w=Math.floor(h*sizes[0]/sizes[1]);
|
||||
tbwidth.set_text(w);
|
||||
]]>
|
||||
</method>
|
||||
|
||||
|
||||
<method name="GenerateHTML">
|
||||
<![CDATA[
|
||||
if(!self.currentmovie)return;
|
||||
|
||||
var url=(cbhttps.get_checked()?"https":"http")+"://www.youtube.com/embed/"+self.currentmovie;
|
||||
if(cbautoplay.get_checked())url+=(url.indexOf("?")==-1?"?":"&")+"autoplay=1";
|
||||
if(cbloop.get_checked())url+=(url.indexOf("?")==-1?"?":"&")+"loop=1";
|
||||
if(cbnoinfo.get_checked())url+=(url.indexOf("?")==-1?"?":"&")+"showinfo=0";
|
||||
if(cbnoctrl.get_checked())url+=(url.indexOf("?")==-1?"?":"&")+"controls=0";
|
||||
if(cblight.get_checked())url+=(url.indexOf("?")==-1?"?":"&")+"theme=light";
|
||||
|
||||
var sizes=ddsize.get_text().split('x').join(',').split(',');
|
||||
var width=parseInt(tbwidth.get_text())||parseInt(sizes[0]);
|
||||
var height=parseInt(tbheight.get_text())||parseInt(sizes[1]);
|
||||
|
||||
self.lastwidth=width;
|
||||
self.lastheight=height;
|
||||
|
||||
return "<iframe frameborder='0' style='width:"+width+"px;height:"+height+"px;' src='"+jsml.html_encode(url)+"' ></iframe>";
|
||||
]]>
|
||||
</method>
|
||||
<method name="DoPreview">
|
||||
var html=self.GenerateHTML();
|
||||
if(!html)return;
|
||||
var newoption={};
|
||||
newoption.width=self.lastwidth;
|
||||
newoption.height=self.lastheight;
|
||||
newoption.htmlcode=html;
|
||||
editor.ShowXmlDialog(editor.BuildDialogUrl("htmlpreview.xml"),newoption);
|
||||
</method>
|
||||
<method name="DoInsert">
|
||||
<![CDATA[
|
||||
var html=self.GenerateHTML();
|
||||
if(!html)return;
|
||||
var nodes=editor.InsertHTML(html,true);
|
||||
dialog.close();
|
||||
]]>
|
||||
</method>
|
||||
|
||||
<method name="ParseUrl">
|
||||
<![CDATA[
|
||||
var url=urlbox.get_text();
|
||||
var movie=option.plugin.FindMovie(url);
|
||||
if(!movie)
|
||||
{
|
||||
urlbox.set_text_color("red");
|
||||
return;
|
||||
}
|
||||
movie=movie.split('"')[0].split("'")[0].split('#')[0].split('?')[0].split("&")[0];
|
||||
urlbox.set_text_color("");
|
||||
if(self.currentmovie==movie)return;
|
||||
self.currentmovie=movie;
|
||||
previewimage.set_src("http://img.youtube.com/vi/"+movie+"/hqdefault.jpg");
|
||||
previewintro.set_visible(false);
|
||||
]]>
|
||||
</method>
|
||||
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="insertyoutube_dialog" />
|
||||
|
||||
</jsml>
|
||||
15
LPWeb20/RichtextEditor/plugins/mobilehelper/plugin.xml
Normal file
@@ -0,0 +1,15 @@
|
||||
<?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">
|
||||
|
||||
|
||||
<execute>
|
||||
<![CDATA[
|
||||
|
||||
|
||||
|
||||
]]>
|
||||
</execute>
|
||||
|
||||
|
||||
</jsml>
|
||||
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>
|
||||
404
LPWeb20/RichtextEditor/plugins/pageproperties/pageprops.xml
Normal file
@@ -0,0 +1,404 @@
|
||||
<?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">
|
||||
|
||||
<execute>
|
||||
dialog.set_title(editor.GetLangText("pageproperties"));
|
||||
</execute>
|
||||
|
||||
<panel jsml-class="pageprops_dialog" dock="fill" overflow="visible" back_color="#f9f9f9">
|
||||
|
||||
<panel dock="bottom" margin="3" padding="6" overflow="visible">
|
||||
|
||||
<panel dock="right" margin="3" overflow="visible">
|
||||
<initialize>
|
||||
if(!option.nestedmode)self.set_visible(false);
|
||||
</initialize>
|
||||
<button dock="left" width="82" height="24" text="@CLOSE">
|
||||
<attach name="click">
|
||||
dialog.close();
|
||||
</attach>
|
||||
</button>
|
||||
</panel>
|
||||
|
||||
<panel dock="right" margin="3" overflow="visible">
|
||||
<initialize>
|
||||
if(option.nestedmode)self.set_visible(false);
|
||||
</initialize>
|
||||
<button dock="left" width="82" height="24" text="@OK" margin="0,12,0,0">
|
||||
<initialize>
|
||||
if(option.oktext)self.set_text(option.oktext);
|
||||
</initialize>
|
||||
<attach name="click">
|
||||
editor.SaveBodyNode();
|
||||
dialog.result=true;
|
||||
dialog.close();
|
||||
</attach>
|
||||
</button>
|
||||
<button dock="left" width="82" height="24" text="@CANCEL">
|
||||
<attach name="click">
|
||||
dialog.close();
|
||||
</attach>
|
||||
</button>
|
||||
</panel>
|
||||
|
||||
</panel>
|
||||
|
||||
<groupbox text="@DOCUMENT" dock="top" overflow="visible" margin="5,5,15,5">
|
||||
<panel margin="7,3,2,3" height="18" dock="top">
|
||||
<label dock="left" vertical_align="middle" width="80" text="@TITLE|:" text_align="right"/>
|
||||
<panel dock="left" width="4" />
|
||||
<panel dock="left" jsml-base="rteproptextbox" width="320" propname="#">
|
||||
<method name="set_node_value">
|
||||
editor.SetPageTitle(value);
|
||||
</method>
|
||||
<method name="get_node_value">
|
||||
return editor.GetPageTitle();
|
||||
</method>
|
||||
</panel>
|
||||
</panel>
|
||||
<panel margin="7,3,2,3" height="45" dock="top">
|
||||
<label dock="left" vertical_align="middle" width="80" text="@DESCRIPTION|:" text_align="right"/>
|
||||
<panel dock="left" width="4" />
|
||||
<panel dock="left" jsml-base="rteproptextbox" width="320" propname="#" height="45">
|
||||
<initialize>
|
||||
self.textbox.set_text_mode("multipleline");
|
||||
</initialize>
|
||||
<method name="set_node_value">
|
||||
editor.SetPageDescription(value);
|
||||
</method>
|
||||
<method name="get_node_value">
|
||||
return editor.GetPageDescription();
|
||||
</method>
|
||||
</panel>
|
||||
</panel>
|
||||
<panel margin="7,3,2,3" height="45" dock="top">
|
||||
<label dock="left" vertical_align="middle" width="80" text="@KEYWORDS|:" text_align="right"/>
|
||||
<panel dock="left" width="4" />
|
||||
<panel dock="left" jsml-base="rteproptextbox" width="320" propname="#" height="45">
|
||||
<initialize>
|
||||
self.textbox.set_text_mode("multipleline");
|
||||
</initialize>
|
||||
<method name="set_node_value">
|
||||
editor.SetPageKeywords(value);
|
||||
</method>
|
||||
<method name="get_node_value">
|
||||
return editor.GetPageKeywords();
|
||||
</method>
|
||||
</panel>
|
||||
</panel>
|
||||
<panel margin="7,3,2,3" height="18" dock="top">
|
||||
<label dock="left" vertical_align="middle" width="80" text="@CHARSET|:" text_align="right"/>
|
||||
<panel dock="left" width="4" />
|
||||
<panel dock="left" jsml-base="rtepropdropdown" editable="true" width="100" propname="#">
|
||||
<method name="set_node_value">
|
||||
editor.SetPageContentType(value?("text/html;charset="+value):null);
|
||||
</method>
|
||||
<method name="get_node_value">
|
||||
var t=editor.GetPageContentType();
|
||||
if(!t)return "";
|
||||
return t.replace(/^.*charset\=(.*)$/i,"$1");
|
||||
</method>
|
||||
<initialize>
|
||||
<![CDATA[
|
||||
var list=",ascii,utf-8,gb2312";
|
||||
list=list.split(',');
|
||||
for(var i=0;i<list.length;i++)
|
||||
{
|
||||
self.jsml_append(jsml.new_listitem(list[i],list[i]));
|
||||
}
|
||||
]]>
|
||||
</initialize>
|
||||
</panel>
|
||||
<panel dock="left" width="12" />
|
||||
<label dock="left" vertical_align="middle" width="80" text="@CONTENT-LANGUAGE|:" text_align="right"/>
|
||||
<panel dock="left" width="4" />
|
||||
<panel dock="left" jsml-base="rtepropdropdown" editable="true" width="100" propname="#">
|
||||
<method name="set_node_value">
|
||||
editor.SetPageContentLanguage(value);
|
||||
</method>
|
||||
<method name="get_node_value">
|
||||
return editor.GetPageContentLanguage();
|
||||
</method>
|
||||
<initialize>
|
||||
<![CDATA[
|
||||
var list=",en-us,zh-cn";
|
||||
list=list.split(',');
|
||||
for(var i=0;i<list.length;i++)
|
||||
{
|
||||
self.jsml_append(jsml.new_listitem(list[i],list[i]));
|
||||
}
|
||||
]]>
|
||||
</initialize>
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
<panel margin="7,3,2,3" height="18" dock="top">
|
||||
</panel>
|
||||
|
||||
</groupbox>
|
||||
|
||||
<groupbox text="@BODY|.|@ATTRIBUTES" dock="top" overflow="visible" margin="5">
|
||||
|
||||
<panel margin="7,3,2,3" height="18" dock="top">
|
||||
<label dock="left" vertical_align="middle" width="80" text="@CSSCLASS|:" text_align="right"/>
|
||||
<panel dock="left" width="4" />
|
||||
<panel dock="left" jsml-base="rteproptextbox" width="100" propname="class"/>
|
||||
|
||||
|
||||
<panel dock="left" width="104" />
|
||||
<button dock="left" text="@STYLES">
|
||||
<attach name="click">
|
||||
<![CDATA[
|
||||
var newoption={}
|
||||
newoption.width=480;
|
||||
newoption.height=320;
|
||||
newoption.targetnode=option.targetnode;
|
||||
newoption.ondialogload=function(dialog)
|
||||
{
|
||||
dialog._rtenode=option.targetnode;
|
||||
dialog.set_back_color("#f9f9f9");
|
||||
dialog.set_title(editor.GetLangText("styles"));
|
||||
}
|
||||
newoption.callback=function(dialog)
|
||||
{
|
||||
instance.invoke_recursive("loadvalue");
|
||||
}
|
||||
editor.ShowXmlDialog(editor.BuildDialogUrl("properties_style.xml"),newoption);
|
||||
]]>
|
||||
</attach>
|
||||
</button>
|
||||
|
||||
</panel>
|
||||
|
||||
<panel margin="7,3,2,3" height="18" dock="top">
|
||||
<label dock="left" vertical_align="middle" text="@COLOR|:" text_align="right" width="80"/>
|
||||
<panel dock="left" width="4" />
|
||||
<panel dock="left" jsml-base="rtepropcolorbox" propname="style:color" width="100"/>
|
||||
<label dock="left" vertical_align="middle" text="@BACKGROUNDCOLOR|:" text_align="right" width="100"/>
|
||||
<panel dock="left" width="4" />
|
||||
<panel dock="left" jsml-base="rtepropcolorbox" propname="style:background-color" width="100"/>
|
||||
|
||||
</panel>
|
||||
|
||||
|
||||
|
||||
|
||||
<panel margin="7,3,2,3" height="18" dock="top">
|
||||
|
||||
<label dock="left" vertical_align="middle" text="@MARGIN|:" width="80" text_align="right"/>
|
||||
<panel dock="left" width="4" />
|
||||
<panel dock="left" width="60" jsml-base="rtepropnumupdown" propname="style:margin" suffix="px" />
|
||||
<image dock="left" width="20" cursor="pointer" src="{folder}images/box.png">
|
||||
<attach name="click">
|
||||
marginfloatbox._rtenode=option.targetnode;
|
||||
marginfloatbox.invoke_recursive("editor_ready",editor);
|
||||
marginfloatbox._estyle.zIndex=editor._config.dialog_zindex;
|
||||
marginfloatbox.show({control:self,stopDispose:true});
|
||||
</attach>
|
||||
</image>
|
||||
<attach name="disposing">
|
||||
marginfloatbox.dispose();
|
||||
</attach>
|
||||
<panel jsml-base="floatbox" jsml-local="marginfloatbox" jsml-append="false" height="180" padding="18">
|
||||
|
||||
<panel dock="bottom" margin="5">
|
||||
<button text="@RESET" right="0">
|
||||
<attach name="click">
|
||||
option.targetnode.SetStyle("margin-left",null);
|
||||
option.targetnode.SetStyle("margin-right",null);
|
||||
option.targetnode.SetStyle("margin-top",null);
|
||||
option.targetnode.SetStyle("margin-bottom",null);
|
||||
marginfloatbox.invoke_recursive("loadvalue");
|
||||
</attach>
|
||||
</button>
|
||||
</panel>
|
||||
|
||||
<panel dock="left" overflow="visible" vertical_align="middle">
|
||||
<panel overflow_x="visible" height="20">
|
||||
<label dock="left" width="1" overflow="visible" text="@LEFT|:" vertical_align="middle" text_align="right" />
|
||||
<panel dock="left" jsml-base="rtepropnumupdown" propname="style:margin-left" suffix="px" />
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
<panel dock="right" overflow="visible" vertical_align="middle">
|
||||
<panel overflow_x="visible" height="20">
|
||||
<label dock="left" width="60" text="@RIGHT|:" vertical_align="middle" text_align="right" />
|
||||
<panel dock="left" jsml-base="rtepropnumupdown" propname="style:margin-right" suffix="px" />
|
||||
</panel>
|
||||
</panel>
|
||||
<panel dock="top" overflow="visible" horizontal_align="center">
|
||||
<panel overflow_x="visible" height="20">
|
||||
<label dock="left" width="60" text="@TOP|:" vertical_align="middle" text_align="right" />
|
||||
<panel dock="left" jsml-base="rtepropnumupdown" propname="style:margin-top" suffix="px" />
|
||||
</panel>
|
||||
</panel>
|
||||
<panel dock="bottom" overflow="visible" horizontal_align="center">
|
||||
<panel overflow_x="visible" height="20">
|
||||
<label dock="left" width="60" text="@BOTTOM|:" vertical_align="middle" text_align="right" />
|
||||
<panel dock="left" jsml-base="rtepropnumupdown" propname="style:margin-bottom" suffix="px" />
|
||||
</panel>
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
</panel>
|
||||
|
||||
|
||||
|
||||
<panel margin="7,3,2,3" height="18" dock="top">
|
||||
|
||||
<label dock="left" vertical_align="middle" text="@PADDING|:" width="80" text_align="right"/>
|
||||
<panel dock="left" width="4" />
|
||||
<panel dock="left" width="60" jsml-base="rtepropnumupdown" propname="style:padding" suffix="px" min_value="0" />
|
||||
<image dock="left" width="20" cursor="pointer" src="{folder}images/box.png">
|
||||
<attach name="click">
|
||||
paddingfloatbox._rtenode=option.targetnode;
|
||||
paddingfloatbox.invoke_recursive("editor_ready",editor);
|
||||
paddingfloatbox._estyle.zIndex=editor._config.dialog_zindex;
|
||||
paddingfloatbox.show({control:self,stopDispose:true});
|
||||
</attach>
|
||||
</image>
|
||||
<attach name="disposing">
|
||||
paddingfloatbox.dispose();
|
||||
</attach>
|
||||
<panel jsml-base="floatbox" jsml-local="paddingfloatbox" jsml-append="false" height="180" padding="18">
|
||||
|
||||
<panel dock="bottom" margin="5">
|
||||
<button text="@RESET" right="0">
|
||||
<attach name="click">
|
||||
option.targetnode.SetStyle("padding-left",null);
|
||||
option.targetnode.SetStyle("padding-right",null);
|
||||
option.targetnode.SetStyle("padding-top",null);
|
||||
option.targetnode.SetStyle("padding-bottom",null);
|
||||
paddingfloatbox.invoke_recursive("loadvalue");
|
||||
</attach>
|
||||
</button>
|
||||
</panel>
|
||||
|
||||
<panel dock="left" overflow="visible" vertical_align="middle">
|
||||
<panel overflow_x="visible" height="20">
|
||||
<label dock="left" width="1" overflow="visible" text="@LEFT|:" vertical_align="middle" text_align="right" />
|
||||
<panel dock="left" jsml-base="rtepropnumupdown" propname="style:padding-left" suffix="px" />
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
<panel dock="right" overflow="visible" vertical_align="middle">
|
||||
<panel overflow_x="visible" height="20">
|
||||
<label dock="left" width="60" text="@RIGHT|:" vertical_align="middle" text_align="right" />
|
||||
<panel dock="left" jsml-base="rtepropnumupdown" propname="style:padding-right" suffix="px" />
|
||||
</panel>
|
||||
</panel>
|
||||
<panel dock="top" overflow="visible" horizontal_align="center">
|
||||
<panel overflow_x="visible" height="20">
|
||||
<label dock="left" width="60" text="@TOP|:" vertical_align="middle" text_align="right" />
|
||||
<panel dock="left" jsml-base="rtepropnumupdown" propname="style:padding-top" suffix="px" />
|
||||
</panel>
|
||||
</panel>
|
||||
<panel dock="bottom" overflow="visible" horizontal_align="center">
|
||||
<panel overflow_x="visible" height="20">
|
||||
<label dock="left" width="60" text="@BOTTOM|:" vertical_align="middle" text_align="right" />
|
||||
<panel dock="left" jsml-base="rtepropnumupdown" propname="style:padding-bottom" suffix="px" />
|
||||
</panel>
|
||||
</panel>
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
|
||||
<panel margin="7,3,2,3" height="18" dock="top">
|
||||
|
||||
<label dock="left" width="80" text="@BORDER|:" vertical_align="middle" text_align="right" />
|
||||
<panel dock="left" width="4" />
|
||||
<panel dock="left" width="60" jsml-base="rtepropnumupdown" propname="style:border-width" suffix="px" min_value="0">
|
||||
<attach name="change">
|
||||
<![CDATA[
|
||||
var size=parseInt(self.get_text());
|
||||
if(isNaN(size))
|
||||
ddborderstyle.set_text("");
|
||||
else if(size&&!ddborderstyle.get_text())
|
||||
ddborderstyle.set_text("solid");
|
||||
]]>
|
||||
</attach>
|
||||
</panel>
|
||||
<image dock="left" width="20" cursor="pointer" src="{folder}images/box.png">
|
||||
<attach name="click">
|
||||
borderfloatbox._rtenode=option.targetnode;
|
||||
borderfloatbox.invoke_recursive("editor_ready",editor);
|
||||
borderfloatbox._estyle.zIndex=editor._config.dialog_zindex;
|
||||
borderfloatbox.show({control:self,stopDispose:true});
|
||||
</attach>
|
||||
</image>
|
||||
<attach name="disposing">
|
||||
borderfloatbox.dispose();
|
||||
</attach>
|
||||
<panel jsml-base="floatbox" jsml-local="borderfloatbox" jsml-append="false" height="180" padding="18">
|
||||
|
||||
|
||||
<panel dock="bottom" margin="5">
|
||||
<button text="@RESET" right="0">
|
||||
<attach name="click">
|
||||
option.targetnode.SetStyle("border-left-width",null);
|
||||
option.targetnode.SetStyle("border-right-width",null);
|
||||
option.targetnode.SetStyle("border-top-width",null);
|
||||
option.targetnode.SetStyle("border-bottom-width",null);
|
||||
borderfloatbox.invoke_recursive("loadvalue");
|
||||
</attach>
|
||||
</button>
|
||||
</panel>
|
||||
|
||||
<panel dock="left" overflow="visible" vertical_align="middle">
|
||||
<panel overflow_x="visible" height="20">
|
||||
<label dock="left" width="1" overflow="visible" text="@LEFT|:" vertical_align="middle" text_align="right" />
|
||||
<panel dock="left" jsml-base="rtepropnumupdown" propname="style:border-left-width" suffix="px" />
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
<panel dock="right" overflow="visible" vertical_align="middle">
|
||||
<panel overflow_x="visible" height="20">
|
||||
<label dock="left" width="60" text="@RIGHT|:" vertical_align="middle" text_align="right" />
|
||||
<panel dock="left" jsml-base="rtepropnumupdown" propname="style:border-right-width" suffix="px" />
|
||||
</panel>
|
||||
</panel>
|
||||
<panel dock="top" overflow="visible" horizontal_align="center">
|
||||
<panel overflow_x="visible" height="20">
|
||||
<label dock="left" width="60" text="@TOP|:" vertical_align="middle" text_align="right" />
|
||||
<panel dock="left" jsml-base="rtepropnumupdown" propname="style:border-top-width" suffix="px" />
|
||||
</panel>
|
||||
</panel>
|
||||
<panel dock="bottom" overflow="visible" horizontal_align="center">
|
||||
<panel overflow_x="visible" height="20">
|
||||
<label dock="left" width="60" text="@BOTTOM|:" vertical_align="middle" text_align="right" />
|
||||
<panel dock="left" jsml-base="rtepropnumupdown" propname="style:border-bottom-width" suffix="px" />
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
</panel>
|
||||
|
||||
<panel dock="left" width="72" jsml-base="rtepropcolorbox" propname="style:border-color" />
|
||||
|
||||
<panel dock="left" width="85" jsml-local="ddborderstyle" margin="0,0,0,4" jsml-base="rtepropdropdown" propname="style:border-style">
|
||||
<listitem value="" text="@BORDER_NOTSET" />
|
||||
<listitem value="solid" text="@BORDER_SOLID" />
|
||||
<listitem value="dotted" text="@BORDER_DOTTED" />
|
||||
<listitem value="dashed" text="@BORDER_DASHED" />
|
||||
<listitem value="outset" text="@BORDER_OUTSET" />
|
||||
<listitem value="inset" text="@BORDER_INSET" />
|
||||
</panel>
|
||||
|
||||
</panel>
|
||||
|
||||
<panel margin="7,3,2,3" height="18" dock="top">
|
||||
</panel>
|
||||
|
||||
|
||||
</groupbox>
|
||||
|
||||
|
||||
<initialize>
|
||||
self._rtenode=option.targetnode;
|
||||
</initialize>
|
||||
|
||||
</panel>
|
||||
|
||||
<panel jsml-base="pageprops_dialog" />
|
||||
|
||||
</jsml>
|
||||
32
LPWeb20/RichtextEditor/plugins/pageproperties/plugin.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">
|
||||
|
||||
|
||||
|
||||
<execute>
|
||||
<![CDATA[
|
||||
plugin.Execute=function(element,arg1,arg2)
|
||||
{
|
||||
var sp=editor.SaveLogContent();
|
||||
var option={width:470,height:480}
|
||||
option.plugin=plugin;
|
||||
option.targetnode=editor.GetBodyNode();
|
||||
option.callback=function(res,err)
|
||||
{
|
||||
if(!res)
|
||||
{
|
||||
editor.LoadLogIndex(sp);
|
||||
editor.Focus();
|
||||
if(err)editor.Alert(err.message||err);
|
||||
return;
|
||||
}
|
||||
}
|
||||
editor.ShowXmlDialog("{folder}plugins/{plugin}/pageprops.xml?{timems}",option);
|
||||
}
|
||||
|
||||
]]>
|
||||
</execute>
|
||||
|
||||
|
||||
</jsml>
|
||||
95
LPWeb20/RichtextEditor/plugins/resizecorner/plugin.xml
Normal file
@@ -0,0 +1,95 @@
|
||||
<?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">
|
||||
|
||||
<image jsml-class="rte_plugin_resizecorner" dock="fill" margin="0,0,0,3" width="1" height="1" overflow="visible" src="{folder}plugins/{plugin}/resizecorner.gif" vertical_align="bottom">
|
||||
<attach name="mousedown" arguments="jevent,devent">
|
||||
if(editor.IsCommandActive("FullScreen"))return devent.cancel();
|
||||
editor._config.skin_control.start_resize(devent,0,self.fr,self.fb,0,180);
|
||||
</attach>
|
||||
</image>
|
||||
|
||||
<execute>
|
||||
<![CDATA[
|
||||
|
||||
var skindiv=editor._config.skin_div;
|
||||
var skinctrl=editor._config.skin_control;
|
||||
var srcheight=skinctrl.get_current_height();
|
||||
|
||||
skinctrl.attach_event("resize",function()
|
||||
{
|
||||
setTimeout(function()
|
||||
{
|
||||
if(editor.IsCommandActive("FullScreen"))
|
||||
return;
|
||||
skindiv.style.width=skinctrl.get_current_width()+"px";
|
||||
skindiv.style.height=skinctrl.get_current_height()+"px";
|
||||
},1);
|
||||
});
|
||||
|
||||
plugin.Execute=function(element,arg1,arg2)
|
||||
{
|
||||
|
||||
}
|
||||
plugin.LoadUI=function(ctrl,arg0)
|
||||
{
|
||||
var mode=editor._config.resize_mode;
|
||||
if(mode=="disabled")
|
||||
return;
|
||||
if(mode=="autoadjustheight")
|
||||
return StartAutoAdjustHeight();
|
||||
|
||||
var corner=jsml.class_create_instance("rte_plugin_resizecorner");
|
||||
|
||||
if(mode=="resizewidth")
|
||||
{
|
||||
corner.fr=1;
|
||||
corner.set_cursor("w-resize");
|
||||
}
|
||||
else if(mode=="resizeheight")
|
||||
{
|
||||
corner.fb=1;
|
||||
corner.set_cursor("n-resize");
|
||||
}
|
||||
else
|
||||
{
|
||||
corner.fr=corner.fb=1;
|
||||
corner.set_cursor("nw-resize");
|
||||
}
|
||||
|
||||
ctrl.append_child(corner);
|
||||
}
|
||||
function AutoAdjustHeight()
|
||||
{
|
||||
if(editor.IsCommandActive("FullScreen"))
|
||||
return;
|
||||
|
||||
var bodyheight=editor.GetContentHeight();
|
||||
if(bodyheight<80)bodyheight=80;
|
||||
var currheight=skinctrl.get_current_height();
|
||||
var missheight=bodyheight-editor._config.skin_container.get_current_height();
|
||||
var nextheight=currheight+missheight+32;
|
||||
if(nextheight<srcheight)nextheight=srcheight;
|
||||
skinctrl.set_height(nextheight);
|
||||
}
|
||||
function StartAutoAdjustHeight()
|
||||
{
|
||||
setTimeout(AutoAdjustHeight,200);
|
||||
editor.AttachEvent("TextChanged",function()
|
||||
{
|
||||
setTimeout(AutoAdjustHeight,200);
|
||||
});
|
||||
editor.AttachEvent("TabModeChanged",function()
|
||||
{
|
||||
setTimeout(AutoAdjustHeight,200);
|
||||
});
|
||||
editor.AttachEvent("FullScreenChanged",function()
|
||||
{
|
||||
setTimeout(AutoAdjustHeight,200);
|
||||
});
|
||||
}
|
||||
]]>
|
||||
</execute>
|
||||
|
||||
|
||||
</jsml>
|
||||
BIN
LPWeb20/RichtextEditor/plugins/resizecorner/resizecorner.gif
Normal file
|
After Width: | Height: | Size: 58 B |
19
LPWeb20/RichtextEditor/plugins/spellcheck/plugin.xml
Normal file
@@ -0,0 +1,19 @@
|
||||
<?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">
|
||||
|
||||
|
||||
|
||||
<execute>
|
||||
<![CDATA[
|
||||
plugin.Execute=function(element,arg1,arg2)
|
||||
{
|
||||
var option={width:400,height:280}
|
||||
option.plugin=plugin;
|
||||
editor.ShowXmlDialog("{folder}server/spellcheck.xml?{timems}",option);
|
||||
}
|
||||
]]>
|
||||
</execute>
|
||||
|
||||
|
||||
</jsml>
|
||||
54
LPWeb20/RichtextEditor/plugins/statistics/plugin.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="rte_plugin_statistics" dock="fill" width="1" overflow="visible" padding="0,5,0,5">
|
||||
<label jsml-local="label" dock="fill" vertical_align="middle" horizontal_align="center" text="Statistics" width="1" overflow="visible"></label>
|
||||
<initialize>
|
||||
<![CDATA[
|
||||
self.editoreventid=editor.AttachEvent("TextChanged",function(editor,e)
|
||||
{
|
||||
self.UpdateUI();
|
||||
});
|
||||
self.UpdateUI();
|
||||
]]>
|
||||
</initialize>
|
||||
<method name="UpdateUI">
|
||||
<![CDATA[
|
||||
var code=editor.GetHtmlCode();
|
||||
var div=document.createElement("DIV");
|
||||
div.innerHTML=code;
|
||||
var text=div.innerText||div.textContent||"";
|
||||
var word=0;
|
||||
text.replace(/\S+/g,function(a,b)
|
||||
{
|
||||
word++;
|
||||
return a;
|
||||
});
|
||||
var tcode=editor.GetLangText("code");
|
||||
var ttext=editor.GetLangText("text");
|
||||
var tword=editor.GetLangText("words");
|
||||
/// label.set_text(tcode+":"+code.length+","+ttext+":"+text.length+","+tword+":"+word);
|
||||
label.set_text(tword+":"+word+" "+tcode+":"+code.length);
|
||||
]]>
|
||||
</method>
|
||||
<attach name="dispose">
|
||||
editor.DetachEvent("TextChanged",self.editoreventid);
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<execute>
|
||||
<![CDATA[
|
||||
plugin.Execute=function(element,arg1,arg2)
|
||||
{
|
||||
|
||||
}
|
||||
plugin.LoadUI=function(ctrl,arg0)
|
||||
{
|
||||
ctrl.append_child(jsml.class_create_instance("rte_plugin_statistics"));
|
||||
}
|
||||
]]>
|
||||
</execute>
|
||||
|
||||
|
||||
</jsml>
|
||||
43
LPWeb20/RichtextEditor/plugins/syntaxhighlighter/plugin.xml
Normal file
@@ -0,0 +1,43 @@
|
||||
<?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">
|
||||
|
||||
|
||||
|
||||
<execute>
|
||||
<![CDATA[
|
||||
plugin.Execute=function(element,arg1,arg2)
|
||||
{
|
||||
var option={width:436,height:380}
|
||||
option.plugin=plugin;
|
||||
editor.ShowXmlDialog("{folder}server/syntaxhighlighter.xml?{timems}",option);
|
||||
}
|
||||
|
||||
function InsertToDoc(doc)
|
||||
{
|
||||
var link=doc.createElement("link");
|
||||
link.setAttribute("rel","stylesheet");
|
||||
link.setAttribute("href",editor._config.folder+"plugins/{plugin}/syntaxhighlighter.css");
|
||||
doc.getElementsByTagName("head")[0].appendChild(link);
|
||||
}
|
||||
|
||||
function InitPreview(editor,e)
|
||||
{
|
||||
InsertToDoc(e.Arguments[0]);
|
||||
}
|
||||
|
||||
function InsertCss()
|
||||
{
|
||||
InsertToDoc(editor.GetWindow().document);
|
||||
}
|
||||
|
||||
InsertCss();
|
||||
|
||||
editor.AttachEvent("InitPreview",InitPreview);
|
||||
editor.AttachEvent("InitEvent",InsertCss);
|
||||
|
||||
]]>
|
||||
</execute>
|
||||
|
||||
|
||||
</jsml>
|
||||
@@ -0,0 +1,185 @@
|
||||
.dp-highlighter
|
||||
{
|
||||
font-family: "Consolas", "Courier New", Courier, mono, serif;
|
||||
font-size: 12px;
|
||||
background-color: #E7E5DC;
|
||||
width: 99%;
|
||||
overflow: auto;
|
||||
margin: 18px 0 18px 0 !important;
|
||||
padding-top: 1px; /* adds a little border on top when controls are hidden */
|
||||
}
|
||||
|
||||
/* clear styles */
|
||||
.dp-highlighter ol,
|
||||
.dp-highlighter ol li,
|
||||
.dp-highlighter ol li span
|
||||
{
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
border: none;
|
||||
}
|
||||
|
||||
.dp-highlighter a,
|
||||
.dp-highlighter a:hover
|
||||
{
|
||||
background: none;
|
||||
border: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.dp-highlighter .bar
|
||||
{
|
||||
padding-left: 45px;
|
||||
}
|
||||
|
||||
.dp-highlighter.collapsed .bar,
|
||||
.dp-highlighter.nogutter .bar
|
||||
{
|
||||
padding-left: 0px;
|
||||
}
|
||||
|
||||
.dp-highlighter ol
|
||||
{
|
||||
list-style: decimal; /* for ie */
|
||||
background-color: #fff;
|
||||
margin: 0px 0px 1px 45px !important; /* 1px bottom margin seems to fix occasional Firefox scrolling */
|
||||
padding: 0px;
|
||||
color: #5C5C5C;
|
||||
}
|
||||
|
||||
.dp-highlighter.nogutter ol,
|
||||
.dp-highlighter.nogutter ol li
|
||||
{
|
||||
list-style: none !important;
|
||||
margin-left: 0px !important;
|
||||
}
|
||||
|
||||
.dp-highlighter ol li,
|
||||
.dp-highlighter .columns div
|
||||
{
|
||||
list-style: decimal-leading-zero; /* better look for others, override cascade from OL */
|
||||
list-style-position: outside !important;
|
||||
border-left: 3px solid #6CE26C;
|
||||
background-color: #F8F8F8;
|
||||
color: #5C5C5C;
|
||||
padding: 0 3px 0 10px !important;
|
||||
margin: 0 !important;
|
||||
line-height: 14px;
|
||||
}
|
||||
|
||||
.dp-highlighter.nogutter ol li,
|
||||
.dp-highlighter.nogutter .columns div
|
||||
{
|
||||
border: 0;
|
||||
}
|
||||
|
||||
.dp-highlighter .columns
|
||||
{
|
||||
background-color: #F8F8F8;
|
||||
color: gray;
|
||||
overflow: hidden;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.dp-highlighter .columns div
|
||||
{
|
||||
padding-bottom: 5px;
|
||||
}
|
||||
|
||||
.dp-highlighter ol li.alt
|
||||
{
|
||||
background-color: #FFF;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.dp-highlighter ol li span
|
||||
{
|
||||
color: black;
|
||||
background-color: inherit;
|
||||
}
|
||||
|
||||
/* Adjust some properties when collapsed */
|
||||
|
||||
.dp-highlighter.collapsed ol
|
||||
{
|
||||
margin: 0px;
|
||||
}
|
||||
|
||||
.dp-highlighter.collapsed ol li
|
||||
{
|
||||
display: none;
|
||||
}
|
||||
|
||||
/* Additional modifications when in print-view */
|
||||
|
||||
.dp-highlighter.printing
|
||||
{
|
||||
border: none;
|
||||
}
|
||||
|
||||
.dp-highlighter.printing .tools
|
||||
{
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.dp-highlighter.printing li
|
||||
{
|
||||
display: list-item !important;
|
||||
}
|
||||
|
||||
/* Styles for the tools */
|
||||
|
||||
.dp-highlighter .tools
|
||||
{
|
||||
padding: 3px 8px 3px 10px;
|
||||
font: 9px Verdana, Geneva, Arial, Helvetica, sans-serif;
|
||||
color: silver;
|
||||
background-color: #f8f8f8;
|
||||
padding-bottom: 10px;
|
||||
border-left: 3px solid #6CE26C;
|
||||
}
|
||||
|
||||
.dp-highlighter.nogutter .tools
|
||||
{
|
||||
border-left: 0;
|
||||
}
|
||||
|
||||
.dp-highlighter.collapsed .tools
|
||||
{
|
||||
border-bottom: 0;
|
||||
}
|
||||
|
||||
.dp-highlighter .tools a
|
||||
{
|
||||
font-size: 9px;
|
||||
color: #a0a0a0;
|
||||
background-color: inherit;
|
||||
text-decoration: none;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
.dp-highlighter .tools a:hover
|
||||
{
|
||||
color: red;
|
||||
background-color: inherit;
|
||||
text-decoration: underline;
|
||||
}
|
||||
|
||||
/* About dialog styles */
|
||||
|
||||
.dp-about { background-color: #fff; color: #333; margin: 0px; padding: 0px; }
|
||||
.dp-about table { width: 100%; height: 100%; font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; }
|
||||
.dp-about td { padding: 10px; vertical-align: top; }
|
||||
.dp-about .copy { border-bottom: 1px solid #ACA899; height: 95%; }
|
||||
.dp-about .title { color: red; background-color: inherit; font-weight: bold; }
|
||||
.dp-about .para { margin: 0 0 4px 0; }
|
||||
.dp-about .footer { background-color: #ECEADB; color: #333; border-top: 1px solid #fff; text-align: right; }
|
||||
.dp-about .close { font-size: 11px; font-family: Tahoma, Verdana, Arial, sans-serif !important; background-color: #ECEADB; color: #333; width: 60px; height: 22px; }
|
||||
|
||||
/* Language specific styles */
|
||||
|
||||
.dp-highlighter .comment, .dp-highlighter .comments { color: #008200; background-color: inherit; }
|
||||
.dp-highlighter .string { color: blue; background-color: inherit; }
|
||||
.dp-highlighter .keyword { color: #069; font-weight: bold; background-color: inherit; }
|
||||
.dp-highlighter .preprocessor { color: gray; background-color: inherit; }
|
||||
176
LPWeb20/RichtextEditor/plugins/taglist/plugin.xml
Normal file
@@ -0,0 +1,176 @@
|
||||
<?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="rte_plugin_taglist_item" jsml-base="panelbutton" dock="left" overflow="visible" width="20" border_width="1" margin="2,2,2,2" padding="0,2,0,2" font="normal 11px Tahoma" border_color="gray">
|
||||
<label dock="fill" jsml-local="label" width="10" vertical_align="middle" cursor="hand"></label>
|
||||
<method name="bind_item" arguments="node">
|
||||
<![CDATA[
|
||||
self.targetnode=node;
|
||||
var nodename=self.targetnode.GetName();
|
||||
var dispname=editor.CreateControlProvider(self.targetnode).GetTitle();
|
||||
if(nodename.toLowerCase()==dispname.toLowerCase())
|
||||
dispname=nodename;
|
||||
label.set_text("<"+dispname+">");
|
||||
self.set_visible(self.targetnode.GetNameLower()!="body");
|
||||
]]>
|
||||
</method>
|
||||
<method name="unbindandhide">
|
||||
<![CDATA[
|
||||
if(self.targetnode)
|
||||
{
|
||||
self.targetnode.SetRuntimeAttribute("style",null,"taglisthover");
|
||||
self.targetnode=null;
|
||||
}
|
||||
self.set_visible(false);
|
||||
]]>
|
||||
</method>
|
||||
<attach name="mousehover">
|
||||
<![CDATA[
|
||||
var code=self.targetnode.GetAttributeCode();
|
||||
if(code)code=" "+code;
|
||||
code="<"+self.targetnode.GetName()+code+">";
|
||||
self.set_tooltip(code);
|
||||
self.targetnode.SetRuntimeAttribute("style","background-color:#3399CC;color:white;","taglisthover");
|
||||
]]>
|
||||
</attach>
|
||||
<attach name="mouseleave">
|
||||
self.targetnode.SetRuntimeAttribute("style",null,"taglisthover");
|
||||
</attach>
|
||||
<attach name="contextmenu" arguments="je,de">
|
||||
<![CDATA[
|
||||
editor.Focus();
|
||||
if(self.targetnode.IsControl())
|
||||
{
|
||||
editor.SelectControl(self.targetnode);
|
||||
}
|
||||
else
|
||||
{
|
||||
editor.SelectContent(self.targetnode);
|
||||
}
|
||||
de.cancel();
|
||||
]]>
|
||||
</attach>
|
||||
<attach name="click" arguments="je,de">
|
||||
var option={floatboxClass:"floatmenu",control:self,floatMode:'t-r',stopLoadingImage:true};
|
||||
option.node=self.targetnode;
|
||||
editor.ShowXmlFloatBox(editor.BuildDialogUrl("menu_tagitem.xml"),option);
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<panel jsml-class="rte_plugin_taglist" dock="fill" margin="0,2,0,2">
|
||||
|
||||
<initialize>
|
||||
self.panels=[];
|
||||
self.editoreventid=editor.AttachEvent(self.delegate(self.processeditorevent));
|
||||
self.updatetaglist();
|
||||
</initialize>
|
||||
<attach name="disposing">
|
||||
editor.DetachEvent(self.editoreventid);
|
||||
</attach>
|
||||
|
||||
<method name="processeditorevent" arguments="editor,e">
|
||||
<![CDATA[
|
||||
if(e.Name!="SelectionChanged"&&e.Name!="TabModeChanged")
|
||||
return;
|
||||
self.updatetaglist();
|
||||
]]>
|
||||
</method>
|
||||
<method name="updatetaglist">
|
||||
<![CDATA[
|
||||
self.set_visible(editor.IsTabEdit());
|
||||
|
||||
var node=editor.GetPointNode();
|
||||
var control;
|
||||
var seltype=editor.GetSelectionType();
|
||||
if(seltype=="Control"||seltype=="Point")
|
||||
{
|
||||
control=node;
|
||||
}
|
||||
else if(seltype=="Range")
|
||||
{
|
||||
var endnode=editor.GetRangeNode();
|
||||
var root=node;
|
||||
while(root&&!root.Contains(endnode))
|
||||
root=root.GetParent();
|
||||
control=root;
|
||||
}
|
||||
if(control&&control.nodeType==3)
|
||||
{
|
||||
control=control.GetParent();
|
||||
}
|
||||
|
||||
var arr=[];
|
||||
for(node=control;node;node=node.GetParent())
|
||||
{
|
||||
if(node.DesignOnly)
|
||||
continue;
|
||||
arr.push(node);
|
||||
}
|
||||
arr.reverse();
|
||||
|
||||
jsml.suppend_layout();
|
||||
|
||||
while(self.panels.length<arr.length)
|
||||
{
|
||||
var panel=jsml.class_create_instance("rte_plugin_taglist_item");
|
||||
self.panels.push(panel);
|
||||
self.append_child(panel);
|
||||
}
|
||||
|
||||
var targetfound=false;
|
||||
for(var i=0;i<arr.length;i++)
|
||||
{
|
||||
var panel=self.panels[i];
|
||||
panel.bind_item(arr[i]);
|
||||
|
||||
panel.set_checked(panel.targetnode==control);
|
||||
panel.set_opacity(100);
|
||||
}
|
||||
|
||||
var last=arr[arr.length-1];
|
||||
if(last)
|
||||
{
|
||||
for(var i=arr.length;i<self.panels.length;i++)
|
||||
{
|
||||
var panel=self.panels[i];
|
||||
var tn=panel.targetnode;
|
||||
if(editor._config.plugin_taglist_hidepreviousitems)
|
||||
{
|
||||
panel.unbindandhide();
|
||||
}
|
||||
else if(tn&&tn.GetParent()==last)
|
||||
{
|
||||
last=tn;
|
||||
panel.set_checked(false);
|
||||
panel.set_opacity(30);
|
||||
}
|
||||
else
|
||||
{
|
||||
panel.unbindandhide();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
jsml.resume_layout();
|
||||
|
||||
]]>
|
||||
</method>
|
||||
|
||||
</panel>
|
||||
|
||||
<execute>
|
||||
<![CDATA[
|
||||
plugin.Execute=function(element,arg1,arg2)
|
||||
{
|
||||
|
||||
}
|
||||
plugin.LoadUI=function(ctrl,arg0)
|
||||
{
|
||||
ctrl.append_child(jsml.class_create_instance("rte_plugin_taglist"));
|
||||
}
|
||||
]]>
|
||||
</execute>
|
||||
|
||||
|
||||
</jsml>
|
||||
58
LPWeb20/RichtextEditor/plugins/toolbar_code/plugin.xml
Normal file
@@ -0,0 +1,58 @@
|
||||
<?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="rte_plugin_toolbar_code" dock="fill" overflow="visible">
|
||||
<panel jsml-base="tbgroup_{skin}_{color}">
|
||||
<image jsml-base="image_{skin}_{color}" command="Print" tooltip="@PRINT" />
|
||||
<image jsml-base="image_{skin}_{color}" command="FullScreen" tooltip="@FULLSCREEN" imagename="fit" />
|
||||
<image jsml-base="image_{skin}_{color}" command="Help" tooltip="@HELP" />
|
||||
<image jsml-base="image_{skin}_{color}" command="Save" tooltip="@SAVE"/>
|
||||
<image jsml-base="image_{skin}_{color}" command="New" tooltip="@NEW" imagename="newdoc" />
|
||||
<image jsml-base="image_{skin}_{color}" command="CleanCode" tooltip="@CLEANCODE" imagename="cleanup" />
|
||||
|
||||
<image jsml-base="image_{skin}_{color}" command="TC_Undo" tooltip="@UNDO" imagename="undo" />
|
||||
<image jsml-base="image_{skin}_{color}" command="TC_Redo" tooltip="@REDO" imagename="redo" />
|
||||
<!--
|
||||
<image jsml-base="image_{skin}_{color}" command="TC_Find" tooltip="@FINDANDREPLACE" imagename="find" />
|
||||
-->
|
||||
<image jsml-base="image_{skin}_{color}" command="TC_SelectAll" tooltip="@SELECTALL" imagename="selectall" />
|
||||
<image jsml-base="image_{skin}_{color}" command="TC_Delete" tooltip="@DELETE" imagename="delete" />
|
||||
<image jsml-base="image_{skin}_{color}" command="TC_Cut" tooltip="@CUT" imagename="cut">
|
||||
<attach name="mousehover">
|
||||
self._ResetFCButton();
|
||||
</attach>
|
||||
</image>
|
||||
<image jsml-base="image_{skin}_{color}" command="TC_Copy" tooltip="@COPY" imagename="copy">
|
||||
<attach name="mousehover">
|
||||
self._ResetFCButton();
|
||||
</attach>
|
||||
</image>
|
||||
<image jsml-base="image_{skin}_{color}" command="PasteHtml" tooltip="@PASTE" imagename="paste" />
|
||||
<!--
|
||||
<image jsml-base="image_{skin}_{color}" command="PasteText" tooltip="@PASTETEXT" imagename="pastetext"/>
|
||||
<image jsml-base="image_{skin}_{color}" command="PasteWord" tooltip="@PASTEWORD" imagename="pasteword"/>
|
||||
-->
|
||||
|
||||
<image jsml-base="image_{skin}_{color}" command="formatcode" tooltip="@FORMATCODE" imagename="formatcode" />
|
||||
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
<execute>
|
||||
<![CDATA[
|
||||
plugin.Execute=function(element,arg1,arg2)
|
||||
{
|
||||
|
||||
}
|
||||
plugin.LoadUI=function(ctrl,arg0)
|
||||
{
|
||||
var toolbar=jsml.class_create_instance("rte_plugin_toolbar_code");
|
||||
ctrl.append_child(toolbar);
|
||||
toolbar.invoke_recursive("editor_ready",editor);
|
||||
}
|
||||
]]>
|
||||
</execute>
|
||||
|
||||
|
||||
</jsml>
|
||||
29
LPWeb20/RichtextEditor/plugins/toolbar_view/plugin.xml
Normal file
@@ -0,0 +1,29 @@
|
||||
<?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="rte_plugin_toolbar_view" dock="fill" overflow="visible">
|
||||
<panel jsml-base="tbgroup_{skin}_{color}">
|
||||
<image jsml-base="image_{skin}_{color}" command="Print" tooltip="@PRINT" />
|
||||
<image jsml-base="image_{skin}_{color}" command="FullScreen" tooltip="@FULLSCREEN" imagename="fit" />
|
||||
<image jsml-base="image_{skin}_{color}" command="Help" tooltip="@HELP" />
|
||||
</panel>
|
||||
</panel>
|
||||
|
||||
<execute>
|
||||
<![CDATA[
|
||||
plugin.Execute=function(element,arg1,arg2)
|
||||
{
|
||||
|
||||
}
|
||||
plugin.LoadUI=function(ctrl,arg0)
|
||||
{
|
||||
var toolbar=jsml.class_create_instance("rte_plugin_toolbar_view");
|
||||
ctrl.append_child(toolbar);
|
||||
toolbar.invoke_recursive("editor_ready",editor);
|
||||
}
|
||||
]]>
|
||||
</execute>
|
||||
|
||||
|
||||
</jsml>
|
||||
20
LPWeb20/RichtextEditor/plugins/virtualkeyboard/plugin.xml
Normal file
@@ -0,0 +1,20 @@
|
||||
<?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">
|
||||
|
||||
|
||||
|
||||
<execute>
|
||||
<![CDATA[
|
||||
plugin.Execute=function(element,arg1,arg2)
|
||||
{
|
||||
var option={width:416,height:310}
|
||||
option.plugin=plugin;
|
||||
editor.ShowXmlDialog("{folder}server/virtualkeyboard.xml?{timems}",option);
|
||||
}
|
||||
|
||||
]]>
|
||||
</execute>
|
||||
|
||||
|
||||
</jsml>
|
||||
47
LPWeb20/RichtextEditor/plugins/zoomview/plugin.xml
Normal file
@@ -0,0 +1,47 @@
|
||||
<?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="rte_plugin_zoom" jsml-base="panelbutton" dock="fill" width="30" overflow="visible">
|
||||
<label jsml-local="label" dock="fill" vertical_align="middle" horizontal_align="center" width="30" padding="0,2,0,-2" margin="0,0,0,4" text="100%" cursor="pointer" />
|
||||
<attach name="click">
|
||||
<![CDATA[
|
||||
var option={}
|
||||
option.control=self;
|
||||
option.floatMode='t-l';
|
||||
option.selectzoom=function(val)
|
||||
{
|
||||
plugin.zoomvalue=val;
|
||||
label.set_text(val+"%");
|
||||
var zoom=plugin.zoomvalue==100?"":(plugin.zoomvalue+"%");
|
||||
editor.GetWindow().document.body.style.zoom=zoom;
|
||||
}
|
||||
]]>
|
||||
editor.ShowXmlFloatBox("{folder}plugins/{plugin}/zoomlist.xml",option)
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
<execute>
|
||||
<![CDATA[
|
||||
plugin.zoomvalue=100;
|
||||
|
||||
plugin.Execute=function(element,arg1,arg2)
|
||||
{
|
||||
|
||||
}
|
||||
plugin.LoadUI=function(ctrl,arg0)
|
||||
{
|
||||
ctrl.append_child(jsml.class_create_instance("rte_plugin_zoom"));
|
||||
}
|
||||
|
||||
editor.AttachEvent("InitEvent",function(editor,e)
|
||||
{
|
||||
var zoom=plugin.zoomvalue==100?"":(plugin.zoomvalue+"%");
|
||||
editor.GetWindow().document.body.style.zoom=zoom;
|
||||
});
|
||||
|
||||
]]>
|
||||
</execute>
|
||||
|
||||
|
||||
</jsml>
|
||||
85
LPWeb20/RichtextEditor/plugins/zoomview/zoomlist.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">
|
||||
|
||||
<htmlcontrol jsml-class="zoomlistitem" dock="top" overflow="visible" vertical_align="middle" margin="0" padding="0" border_width="1" border_color="transparent" cursor="pointer" unselectable="true">
|
||||
<initialize>
|
||||
self._estyle.fontFamily='"Segoe UI","Lucida Grande", Tahoma, Verdana, Arial, sans-serif';
|
||||
</initialize>
|
||||
|
||||
<attach name="mousehover" arguments="je,e">
|
||||
self.set_border_color('#DCAC6C');
|
||||
self.set_back_color('#FFF5D4');
|
||||
self.set_text_color('blue');
|
||||
</attach>
|
||||
<attach name="mouseleave">
|
||||
self.set_border_color('white');
|
||||
self.set_back_color('');
|
||||
self.set_text_color('');
|
||||
</attach>
|
||||
<attach name="click">
|
||||
option.selectzoom(parseInt(self.get_text())||100);
|
||||
dialog.close();
|
||||
</attach>
|
||||
</htmlcontrol>
|
||||
|
||||
<panel dock="fill" margin="0" padding="0" overflow="visible" width="50">
|
||||
<panel dock="fill" overflow="visible" padding="3">
|
||||
<htmlcontrol jsml-base="zoomlistitem" text="25">
|
||||
<xmldata>
|
||||
<div style="padding:0 10px;font-size:8px;">25%</div>
|
||||
</xmldata>
|
||||
</htmlcontrol>
|
||||
<htmlcontrol jsml-base="zoomlistitem" text="50">
|
||||
<xmldata>
|
||||
<div style="padding:0 10px;font-size:9px;">50%</div>
|
||||
</xmldata>
|
||||
</htmlcontrol>
|
||||
<htmlcontrol jsml-base="zoomlistitem" text="75">
|
||||
<xmldata>
|
||||
<div style="padding:0 10px;font-size:10px;">75%</div>
|
||||
</xmldata>
|
||||
</htmlcontrol>
|
||||
<htmlcontrol jsml-base="zoomlistitem" text="100">
|
||||
<xmldata>
|
||||
<div style="padding:0 10px;font-size:11px;">100%</div>
|
||||
</xmldata>
|
||||
</htmlcontrol>
|
||||
<htmlcontrol jsml-base="zoomlistitem" text="125">
|
||||
<xmldata>
|
||||
<div style="padding:0 10px;font-size:12px;">125%</div>
|
||||
</xmldata>
|
||||
</htmlcontrol>
|
||||
<htmlcontrol jsml-base="zoomlistitem" text="150">
|
||||
<xmldata>
|
||||
<div style="padding:0 10px;font-size:13px;">150%</div>
|
||||
</xmldata>
|
||||
</htmlcontrol>
|
||||
<htmlcontrol jsml-base="zoomlistitem" text="200">
|
||||
<xmldata>
|
||||
<div style="padding:0 10px;font-size:14px;">200%</div>
|
||||
</xmldata>
|
||||
</htmlcontrol>
|
||||
<htmlcontrol jsml-base="zoomlistitem" text="250">
|
||||
<xmldata>
|
||||
<div style="padding:0 10px;font-size:16px;">250%</div>
|
||||
</xmldata>
|
||||
</htmlcontrol>
|
||||
<htmlcontrol jsml-base="zoomlistitem" text="300">
|
||||
<xmldata>
|
||||
<div style="padding:0 10px;font-size:18px;">300%</div>
|
||||
</xmldata>
|
||||
</htmlcontrol>
|
||||
<htmlcontrol jsml-base="zoomlistitem" text="400">
|
||||
<xmldata>
|
||||
<div style="padding:0 10px;font-size:20px;">400%</div>
|
||||
</xmldata>
|
||||
</htmlcontrol>
|
||||
</panel>
|
||||
<attach name="keydown" arguments="je,e">
|
||||
if(e.keyCode==27)dialog.close();
|
||||
</attach>
|
||||
</panel>
|
||||
|
||||
|
||||
</jsml>
|
||||