Initial Commit Update Telerik

This commit is contained in:
2022-01-07 19:26:33 +01:00
commit 57e1cda236
2174 changed files with 1202494 additions and 0 deletions

View File

@@ -0,0 +1,7 @@
<html>
<head>
<title>blank</title>
</head>
<body>
</body>
</html>

View File

@@ -0,0 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>blank</title>
</head>
<body>
</body>
</html>

View File

@@ -0,0 +1,8 @@
<!DOCTYPE html>
<html>
<head>
<title>blank</title>
</head>
<body>
</body>
</html>

View File

@@ -0,0 +1,8 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>blank</title>
</head>
<body>
</body>
</html>

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,226 @@
// this file stores the default settings for RichTextEditor
// some settings are overrided by server settings
window.RTE_Configuration =
{
version : "2013061202",
skin : "office2007blue", //sets the skin for how the toolbar is draw
toolbar : "full",//auto configures the toolbar with a set of buttons
autofocus : false,//specifies whether the editor grabs focus when the page loads
readonly : false,//specifies whether editor is read-only
showrulers : false,//specifies whether to display horizontal and/or vertical rulers
showlinkbar : true,//specifies whether to display the link editing box
showtoolbar : true,//specifies whether to display the editor toolbar
showtoolbar_code: true,//specifies whether to display the code mode toolbar
showtoolbar_view: true,//specifies whether to display the preview toolbar
showbottombar : true,//specifies whether to display the editor bottom bar
showeditmode : true,//specifies whether to display the edit mode button in the bottom bar
showcodemode : true,//specifies whether to display the code mode button in the bottom bar
showpreviewmode : true,//specifies whether to display the preview mode button in the bottom bar
showtaglist : true,//specifies whether to display the tag selector in the bottom bar
showzoomview : true,//specifies whether to display a zoom factor drop down in the bottom bar
showstatistics : true,//specifies whether to display the content statistics in the bottom bar
showresizecorner: true,//specifies whether to display the resize handle at the corner of the editor
resize_mode : "resizeboth", //"disabled","autoadjustheight","resizeheight","resizewidth","resizeboth" gets or sets the resize mode
enabledragdrop : true,//specifies whether to enable drag-and-drop support for the editor
enablecontextmenu: true,//specifies whether to display the context menu
enableobjectresizing:true,//specifies whether to enable the object resizing
autoparseclasses: true,//specifies whether or not the Editor should automatically parse the CSS classes from ContentCss
savebuttonmode : "submit", //specifies the default behavior for save button
initialtabmode : "edit", //"edit","code","view"
initialfullscreen : false,//specifies whether the Editor is used in a full-screen mode
initialtoggleborder : true,//specifies the ToggleBorder state
maxhtmllength : 0,//specifies the maximum number of characters including the HTML tags allowed. Default is 0, indicating no maximum
maxtextlength : 0,//specifies the maximum number of characters excluding the HTML tags allowed. Default is 0, indicating no maximum
editorbodyclass : "",//specifies the class name that will be added to the body of the editor document
editorbodystyle : "",//specifies the css style that will be applied to the body of the editor document
insertparagraph : 'p',//default tag for insertparagraph
unlistparagraph : 'p',//default tag for unlistparagraph
justifyparagraph: 'p',//default tag for justifyparagraph
enterkeytag : 'p',//default tag for enterkeytag
shiftenterkeytag: 'br',//default tag for shiftenterkeytag
insertbodyline : '<p>&nbsp;</p>',//default code for inserttopline
indentoutdentsize: 40,//by default, editor would use "margin-left:40px" for indentation, increasing its value by 40px for each new indentation.
tabkeyhtml : '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;', // '<span style="white-space:pre"> </span>', specifies the number of spaces to be inserted when the user hits the "tab" key.
codetabindent : ' ',//default 4 spaces for code indentation
tabtonextcell : true,// when pressing the tab key the cursor jumps to the next cell. set to 'select' for selecting content of the next td.
paste_default_command : "confirmword", // "disabled","paste","pasteword","confirmword","pastetext","pastepuretext"
pastetext_whitespace : 'auto', // 'auto',true,false
pastetext_tabspaces : '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;',
// for past from word , the list item
paste_replacelist : {"&#183;":"<span style='font-family:webdings'>=</span>"},
paste_removestylelist: "font-family,line-height,text-decoration,text-align,text-underline,letter-spacing,line-height,padding,border,margin",
inserttemplate_removestylelist: "font-family,line-height,text-decoration,text-align,text-underline,letter-spacing,line-height,padding,border,margin",
format_painter_list : "subscript,superscript,bold,italic,underline,linethrough,overline,forecolor,backcolor,fontsize,fontname,mark", //which format the painter shall collect from document
format_painter_preclear : true, //remove format before apply the new style
format_subscript : "<sub>", //or "<span style='vertical-align:sub;font-size:0.8em'>", //default tag for subscript
format_superscript : "<sup>", //or "<span style='vertical-align:super;font-size:0.8em'>", //default tag for superscript
format_bold : "<strong>", //or "<b>" or "<span style='font-weight:bold'>", //default behavior for bold
format_italic : "<em>", //or "<i>" or "<span style='font-style:italic'>", //default behavior for italic
format_underline : "<span style='text-decoration:underline'>", //or "<u>", //default behavior for underline
format_linethrough : "<span style='text-decoration:line-through'>",//or "<strike>", or "<s>" //default behavior for linethrough
format_overline : "<span style='text-decoration:overline'>",//default behavior for overline
format_forecolor : "<span style='color:%1'>",
format_backcolor : "<span style='background-color:%1'>",
format_fontsize : "<span style='font-size:%1'>",
format_fontname : "<span style='font-family:%1'>",
format_cssclass : "<span class='%1'>",
format_cssstyle : "<span style='%1'>",
format_mark : "<mark>",
default_link_text : "New Link Text",
default_forecolor : "#ff0000",
default_backcolor : "#ffff00",
default_table_cols : 6,
default_table_rows : 4,
default_code_table : "<table cellspacing='2' cellpadding='2' style='width:480px'></table>", // default table attributes
default_code_tr : "<tr></tr>",
default_code_td : "<td>&nbsp;</td>",
default_code_box : "<div>Type text here..</div>",
default_code_layer : "<div style='position:absolute;left:300px;top:100px;height:100px;width:100px;overflow:visible;'>&nbsp;</div>",
default_code_audio : "<audio controls='1' preload='1' loop='1' autoplay='1' style='width:320px;height:40px'/>",
default_code_video : "<video controls='1' preload='1' loop='1' autoplay='1' style='width:320px;height:240px'/>",
default_code_form : "<form method='POST' enctype='multipart/form-data'><p>&nbsp;</p></form>",
default_code_textarea :"<textarea style='width:240px;height:120px'></textarea>",
default_code_inptext :"<input type='text' />",
default_code_inpfile :"<input type='file' />",
default_code_inpimage :"<input type='image' />",
default_code_inpreset :"<input type='reset' />",
default_code_inpsubmit :"<input type='submit' />",
default_code_inphidden :"<input type='hidden' />",
default_code_inppassword:"<input type='password' />",
default_code_inpbutton :"<input type='button' />",
default_code_radiobox :"<input type='radio' />",
default_code_checkbox :"<input type='checkbox' />",
default_code_button :"<button>Button</button>",
default_code_dropdown :"<select style='margin:0px;width:120px' />",
default_code_listbox :"<select style='margin:0px;width:120px;height:120px;' size='8' />",
default_code_fieldset : "<fieldset><legend>Title</legend><p>Content...</p></fieldset>",
default_code_details : "<details style='padding:3px;margin:3px;'><summary>Summary</summary><p>Content...</p></details>",
default_code_blockquote : "<blockquote>", // class='myblockquote'
default_code_printbreak : '<div class="printpagebreak" title="Print Page Break" style="font-size:1px;page-break-before:always;">&nbsp;</div>',
command_insertdatetime : function()
{
var date=new Date();
var dval=date.getFullYear()*10000+(date.getMonth()+1)*100+date.getDate();
dval=dval*1000000+date.getHours()*10000+date.getMinutes()*100+date.getSeconds();
return String(dval).replace(/(\d{4})(\d{2})(\d{2})(\d{2})(\d{2})(\d{2})/,"$1-$2-$3 $4:$5:$6");
},
//full page edit mode key , F12=123 , -1 means disable hot key for fullscreen
event_fullscreenkeycode : 123,
//set to 5000 to test the loading gif
loader_loadcodedelay : 0,
//means richtexteditor/images/loading5.gif
loader_loadingimage : 'loading5.gif',
//auto format the source code when switch to source code view ?
codeview_autoformat : true,//"oneline",
preview_disabletooltip : false,
preview_disablefontname : false,
preview_disablefontsize : false,
preview_disableforecolor : true,
preview_disablebackcolor : true,
fontnamelist : 'Arial,Verdana,Tahoma,Segoe UI,Sans-Serif,Comic Sans MS,Courier New,Georgia,Impact,Lucida Console,Times New Roman,Trebuchet MS,Monospace',
fontsizelist : '8px,9px,10px,11px,12px,13px,14px,16px,18px,20px,24px,36px',
colorpicker_forecolor : ["#000000","#993300","#333300","#003300","#003366","#000080","#333399","#333333",
"#800000","#ff6600","#808000","#008000","#008080","#0000ff","#666699","#808080",
"#ff0000","#ff9900","#99cc00","#339966","#33cccc","#3366ff","#800080","#999999",
"#ff00ff","#ffcc00","#ffff00","#00ff00","#00ffff","#00ccff","#993366","#c0c0c0",
"#ff99cc","#ffcc99","#ffff99","#ccffcc","#ccffff","#99ccff","#cc99ff","#ffffff"],
colorpicker_backcolor : ["#000000","#993300","#333300","#003300","#003366","#000080","#333399","#333333",
"#800000","#ff6600","#808000","#008000","#008080","#0000ff","#666699","#808080",
"#ff0000","#ff9900","#99cc00","#339966","#33cccc","#3366ff","#800080","#999999",
"#ff00ff","#ffcc00","#ffff00","#00ff00","#00ffff","#00ccff","#993366","#c0c0c0",
"#ff99cc","#ffcc99","#ffff99","#ccffcc","#ccffff","#99ccff","#cc99ff","#ffffff"],
colorpicker_othercolor : ["#000000","#993300","#333300","#003300","#003366","#000080","#333399","#333333",
"#800000","#ff6600","#808000","#008000","#008080","#0000ff","#666699","#808080",
"#ff0000","#ff9900","#99cc00","#339966","#33cccc","#3366ff","#800080","#999999",
"#ff00ff","#ffcc00","#ffff00","#00ff00","#00ffff","#00ccff","#993366","#c0c0c0",
"#ff99cc","#ffcc99","#ffff99","#ccffcc","#ccffff","#99ccff","#cc99ff","#ffffff"],
htmlcode_forcehexformat : true,
codeview_autoadjustmode : "normalize,indent",
//this indexes matchs the images/all.png
//comment it , or set to null/empty to disable the all.png solution
//if you want to modify the context manually, please search our blog about 'allimageindexdata' and 'joinallimages'
allimageindexdata : 'save,newdoc,print,find,fit,cleanup,unformat,spell,cut,copy,paste,pastetext,pasteword,delete,undo,redo,insertpagebreak,insertdate,timer,specialchar,keyboard,div,layer,groupbox,image,gallery,flash,media,document,template,youtube,insrow_t,insrow_b,delrow,inscol_l,inscol_r,delcol,inscell,delcell,row,cell,mrgcell,spltcell,break,paragraph,textarea,textbox,passwordfield,hiddenfield,listbox,dropdownbox,optionbutton,checkbox,imagebutton,submit,reset,pushbutton,page,bold,italic,under,left,center,right,justifyfull,justifynone,numlist,bullist,indent,outdent,superscript,subscript,strike,ucase,lcase,rule,link,unlink,anchor,imagemap,borders,selectall,selectnone,help,code,overline,forecolor,backcolor,inserttable,insertform,blockquote,formatpainter,lineheight,dir_ltr,dir_rtl,preview,design,htmlview,map,topline,bottomline,html5',
//whether load the ihtml5.js for html5 browsers
useimagedatacache : false,
//for SiteRelative,
forcerelative : true,
syncloadtoolbar : false,
floatbox_leaveclosetimer : 500,
floatbox_showloaingimage : true,
fullscreen_zindex : 100011,
ctrltool_zindex : 100022,
dialog_zindex : 110011, //don't greater then 123450 , otherwise uploader will not works
//load the plugin into memory and activate its default function
preloadplugins : "controldesigner,elementtoolbar,googlemap,insertyoutube,syntaxhighlighter", //
htmlfilter_disabledlist : "",
editor_player_url : null,
editor_help_url : null,
toolbars :
{
"ribbon":"<@COMMON,ribbonpaste,pastetext,pasteword,{save,new,print,spellcheck}{cut,copy,delete,find}{undo,redo|formatpainter}><@FORMAT,[fontname,fontsize]{bold,italic,underlinemenu|forecolor,backcolor}{superscript,subscript,changecase|removeformat,cleancode,selectall}><@PARAGRAPHS,[paragraphs,styles]{justifymenu,lineheight,ltr,rtl,insertlinemenu}{insertorderedlist,insertunorderedlist,outdent,indent,insertblockquote}><@INSERT,ribbontable,insertgallery,insertimage,{insertform,insertbox,insertlayer,insertfieldset,fullscreen,toggleborder,pageproperties,help}{insertlink,unlink,insertanchor,insertimagemap,insertdate,insertchars,virtualkeyboard}{inserttemplate,insertdocument,insertvideo,syntaxhighlighter,insertyoutube,html5,googlemap}>",
"full":"{save,new,print,find,spellcheck}{cut,copy,paste,pastetext,pasteword,delete}{undo,redo}{formatpainter}{inserttable,insertbox,insertlayer,insertfieldset}{insertform}{insertchars,syntaxhighlighter,virtualkeyboard,insertdate}{pageproperties,help}/{bold,italic,underlinemenu,justifymenu,forecolor,backcolor}{lineheight,ltr,rtl}{insertlinemenu}{superscript,subscript,changecase}{insertorderedlist,insertunorderedlist,outdent,indent,insertblockquote}{removeformat,cleancode}{fullscreen,toggleborder,selectall}/[paragraphs,styles][fontname,fontsize]{insertlink,unlink,insertanchor,insertimagemap}{insertgallery,insertimage,insertvideo,inserttemplate,insertdocument,insertyoutube,html5,googlemap}",
"light":"{cut,copy,paste,pastetext,pasteword,delete}{undo,redo}{spellcheck,find}{formatpainter}{insertlink,unlink}{insertlinemenu}{inserttable,insertbox}{insertgallery,insertimage,insertdocument,insertvideo,insertyoutube,inserttemplate}{removeformat,cleancode}{fullscreen,toggleborder,selectall}{help}/[paragraphs,styles][fontname,fontsize]{bold,italic,underlinemenu}{forecolor,backcolor}{superscript,subscript,changecase}{justifymenu,insertorderedlist,insertunorderedlist,outdent,indent,insertblockquote}",
"forum": "{bold,italic,underline}{forecolor,backcolor,fontname,fontsize}{justifymenu}{insertorderedlist,insertunorderedlist,outdent,indent}{insertlink,insertgallery,insertimage,insertblockquote,syntaxhighlighter}{unlink,removeformat}",
"email": "{bold,italic,underline,fontname,fontsize,forecolor,backcolor,insertlink,unlink,insertorderedlist,insertunorderedlist,outdent,indent,insertblockquote,justifyleft,justifycenter,justifyright,removeformat}",
"minimal": "{bold,italic,underline,justifyleft,justifycenter,justifyright}",
"none":""
},
toolbaritems : "",
disableditems : "",
googlemap_saveinsession : true,
googlemap_initialplace : "USA",
googlemap_initialzoom : 4,
antispamemailencoder : true,
enableieborderradius : true,
//MISC UI BEHAVIOR:
dialog_tag_a_disablesynclinktotext : false,
plugin_taglist_hidepreviousitems : false,
////others
//urltype : null, //"siterelative","absolute"
//textdirection : null, //"ltr","rtl"
'':''
}
// The settings in this file will apply all instances of your editor objects.
// When you upgrade your RTE with newer versions, this file may be overwritten. To avoid losting the changes, we suggest you use the following method overwrite the setting.
// RTE_Configuration.enterkeytag="br";
// Just copy the code back to config.js after upgrading.

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,5 @@
window._rte_image_cache=new function(){
}

View File

@@ -0,0 +1,859 @@
if(!window.CreateRTELoader)new function()
{
var _debugmode=false;
if(location.href.indexOf("://127.0.0.1")!=-1||location.href.indexOf("rtenocache")!=-1)
_debugmode=true;
var debugloadingsteps=false;
if(location.href.indexOf("rteloadstep")!=-1)
debugloadingsteps=true;
var d=new Date();
var urlsuffix="2013061202" //String(d.getFullYear()*10000+(1+d.getMonth())*100+d.getDate());
if(_debugmode)
urlsuffix=d.getTime();
var _showLangWarning=false;
var ismsie=/MSIE/.test(navigator.userAgent);
function createxh()
{
return window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP");
}
function trace(msg)
{
if(debugloadingsteps)document.title=msg;
}
var textmap={}
function asyncloadtext(url,callback)
{
var item=textmap[url];
if(item)
{
if(!callback)
return;
if(item.loading!='loading')
{
setTimeout(function()
{
callback(item.text,item.xml);
},0);
}
else
{
item.callbacks.push(callback);
}
return;
}
item={url:url,loading:'loading',callbacks:callback?[callback]:[]};
textmap[url]=item;
var index=0;
function runcallbacks()
{
var func=item.callbacks[index];
index++;
if(index<item.callbacks.length)setTimeout(runcallbacks,0);
if(func)func(item.text,item.xml);
}
var xh=createxh();
xh.open("GET",url,true);
xh.onreadystatechange=function()
{
if(xh.readyState!=4)return;
xh.onreadystatechange=new Function("","");
if(xh.status!=200)
{
item.succeed=false;
item.loading='httperror:'+xh.status;
if(xh.status!=0)
throw(new Error("failed to load "+url+" , \r\n http"+xh.status));
return;
}
item.loading='ready';
item.text=xh.responseText;
item.xml=xh.responseXML;
setTimeout(runcallbacks,1);
}
xh.send("");
}
function asyncloadscript(url,callback,runcode)
{
asyncloadtext(url,function(code)
{
if(!runcode)
runcode=new Function("","eval(arguments[0])");
try
{
runcode(code);
}
catch(x)
{
callback();
throw(new Error("failed to load "+url+" , \r\n"+x.message));
}
callback();
});
}
var stylemap={};
function asyncloadstyle(url,callback)
{
var item=stylemap[url];
if(item)
{
setTimeout(function()
{
callback();
},0);
return;
}
item={url:url,callbacks:[callback]};
stylemap[url]=item;
var index=0;
function runcallbacks()
{
var func=item.callbacks[index];
index++;
if(index<item.callbacks.length)setTimeout(runcallbacks,0);
if(func)func(3);
}
var csscontainer=document.getElementsByTagName("head")[0]||document.body;
var stytag=document.createElement("LINK");
if("onload" in stytag)
{
stytag.onload=runcallbacks;
stytag.onerror=runcallbacks;
setTimeout(runcallbacks,3000);
}
else
{
setTimeout(runcallbacks,100);
}
stytag.setAttribute("type","text/css");
stytag.setAttribute("rel","stylesheet");
stytag.setAttribute("href",url);
csscontainer.appendChild(stytag);
}
window.CreateRTELoader=function(config)
{
var loader={};
loader._config=config;
config._debugmode=_debugmode;
var folder=config.folder;
if(folder.indexOf("://")==-1&&folder.charAt(0)!="/")
{
var url=window.location.href.split('#')[0].split('?')[0].split('/');
url[url.length-1]=folder;
url.splice(0,3);
config.folder=folder="/"+url.join('/');
}
config.initdate=new Date();
config._urlsuffix=urlsuffix;
loader._html5=!!document.createElement("canvas").getContext;
config.configjsurl=config.folder+"scripts/config.js?"+config._urlsuffix;
config.rtecssurl=config.folder+"styles/richtexteditor.css?"+config._urlsuffix;
config.jsmljsurl=config.folder+"core/jsml.js?"+config._urlsuffix;
config.commonxmlurl=config.folder+"scripts/common.xml?"+config._urlsuffix;
config.editorjsurl=config.folder+"scripts/editor.js?"+config._urlsuffix;
config.corejsurl=config.folder+"core/core.js?"+config._urlsuffix;
var langs=[];
function runlangcode(lang,code)
{
var func=new Function("lang,__code","eval(__code)");
if(!lang._data)lang._data={};
func(lang._data,code);
}
function asyncloadlangindex(index)
{
var lang=langs[index];
if(!lang)return;
if(lang.loading)return;
lang.loading=true;
function runcode(code)
{
runlangcode(lang,code);
}
function nextstep(err)
{
lang.loading=false;
lang.loaded=true;
if(index>0)asyncloadlangindex(index+1);
}
if(!lang.loaded)
{
asyncloadscript(lang.langurl,nextstep,runcode)
}
else
{
nextstep();
}
}
function syncloadlang(lang)
{
var xh=createxh();
xh.open("GET",lang.langurl,false);
xh.send("");
if(xh.status!=200)return;
runlangcode(lang,xh.responseText);
}
loader.getLangKeys=function(urlfilter)
{
var map={}
var arr=[];
for(var i=0;i<langs.length;i++)
{
var lang=langs[i];
if(urlfilter&&!urlfilter(lang.langurl))
continue;
var dict=lang._data;
if(!dict)
{
syncloadlang(lang);
dict=lang._data;
}
if(!dict)continue;
for(var key in dict)
{
if(map[key])continue;
map[key]=true;
arr.push(key);
}
}
return arr;
}
loader.getLangText=function(name,nullifnotfound)
{
var showWarning=_showLangWarning;
if(!name)return nullifnotfound?null:"{empty}";
name=name.toLowerCase().replace(/(^\s+|\s+$)/g,"");
for(var i=0;i<langs.length;i++)
{
var lang=langs[i];
var dict=lang._data;
if(!dict)
{
if(showWarning)
{
showWarning=false;
setTimeout(function()
{
throw(new Error("Warning,sync load "+lang.langurl+" for text {"+name+"}"));
},1);
}
syncloadlang(lang);
dict=lang._data;
}
if(!dict)continue;
var text=dict[name];
if(!text)continue;
if(text.indexOf("{")!=-1&&text.indexOf("}")!=-1)
{
for(var i=1;i<arguments.length;i++)
{
text=text.split("{"+(i-1)+"}").join(arguments[i]);
}
}
return text;
}
if(nullifnotfound)
return null;
if(config._debugmode)
return "{"+name+"}";
return name;
}
function translate_lang(val)
{
if(val.indexOf("|")==-1)
return loader.getLangText(val.substring(1));
var pairs=val.split("|");
for(var i=0;i<pairs.length;i++)
{
val=pairs[i];
if(val.charAt(0)=="@")
{
if(val.length==1)
pairs[i]="";
else
pairs[i]=loader.getLangText(val.substring(1));
}
}
return pairs.join("");
}
loader.translateText=function(text)
{
if(!text)return "";
if(text.charAt(0)=="@")
return translate_lang(text);
return text;
}
function _loadmain()
{
if(loader._loadcalled)return;
loader._loadcalled=true;
trace("_loadmain");
loader.preloadScripts();
function nextstep(err)
{
if(err)
{
alert("Unable to load config.js \r\n"+err);
}
else
{
_configready()
}
};
if(config.baseconfig||window.RTE_Configuration)
_configready();
else
asyncloadscript(config.configjsurl,nextstep)
}
function onstyleload()
{
loader._stylestep++;
trace("onstyleload "+loader._stylestep+","+onstyleload.caller);
if(loader._stylestep!=3)
return;
_loadeditorui();
}
function _configready()
{
trace("configready");
var baseconfig=config.baseconfig||window.RTE_Configuration;
if(baseconfig)
{
for(var p in baseconfig)
{
if(!config.hasOwnProperty(p))
config[p]=baseconfig[p];
}
}
var skin=config.skin.toLowerCase();
switch(skin)
{
case "office2007blue":
skin="office2007-blue";
break;
case "office2007silver":
skin="office2007-silver";
break;
case "office2007silver2":
skin="office2007-silver2";
break;
case "office2010blue":
skin="office2010-blue";
break;
case "office2010blue2":
skin="office2010-blue2";
break;
case "office2010silver2":
skin="office2010-silver2";
break;
case "office2010silver":
skin="office2010-silver";
break;
case "office2010black":
skin="office2010-black";
break;
case "office2003blue":
skin="office2003-blue";
break;
case "office2003silver":
skin="office2003-silver";
break;
case "office2003silver2":
skin = "office2003-silver2";
break;
case "officexpblue":
skin="officexp-blue";
break;
case "officexpsilver":
skin="officexp-silver";
break;
case "smartblue":
skin="smart-blue";
break;
case "smartsilver":
skin="smart-silver";
break;
case "smartgray":
skin="smart-gray";
break;
case "phonesilver":
skin = "phone-lightsilver";
break;
}
if(/Android|iPhone|iPad|iPod/i.test(navigator.userAgent))
{
skin = "phone-lightsilver";
}
var skinpair=skin.split('-');
if(skinpair.length>1)
{
config.skin=skinpair[0];
config.color=skinpair[1];
}
else
{
//invalid toolbar set!
}
if(config.toolbaritems||config.toolbar!="custom")
{
config._toolbartemplate="template";
}
if(config.skin=="phone"||config.skin=="pad")
{
config.ismobileversion=true;
}
if(!config.containerid)
{
alert("Fail to load editor because the ID is not set.");
return;
}
config.editorelement=document.getElementById(config.containerid);
config.skin_div=config.editorelement;
config.skin_div_holder=config.skin_div;
config.skin_div_parent=config.skin_div.parentNode;
config.skin_divborder=config.skin_div.style.border;
config.skin_div.style.border="solid 1px #eeeeee";
config.skin_div.innerHTML="<table style='width:100%;height:100%;'><tr>"
+"<td style='vertical-align:center;text-align:center;'>"
+"<img src='"+config.folder+"images/"+config.loader_loadingimage+"'/></td></tr></table>";
if(config.langfiles)
{
var langarr=config.langfiles.split(',');
for(var i=0;i<langarr.length;i++)
{
langs.push({langfile:langarr[i],langurl:config.folder+"lang/"+langarr[i]+".js?"+config._urlsuffix});
}
asyncloadlangindex(0);
}
config.blankfileurl=config.folder+"scripts/blank"+(config.designdoctype||"")+".htm?"+config._urlsuffix;
if(!window.localStorage&&ismsie)
{
config.userDataBehavior=document.createElement("textarea");
config.userDataBehavior.style.cssText="behavior:url('#default#userData');display:none;position:absolute;width:0px;height:0px;"
document.body.insertBefore(config.userDataBehavior,document.body.firstChild);
}
else
{
config.localStorage=window.localStorage;
}
config.skincssurl=config.folder+"skins/"+config.skin+"/skin.css?"+config._urlsuffix;
config.skinxmlurl=config.folder+"skins/"+(config.skin)+"/skin.xml?"+config._urlsuffix;
//preload
asyncloadtext(config.skinxmlurl);
loader._stylestep=0;
asyncloadstyle(config.rtecssurl,onstyleload);
asyncloadstyle(config.skincssurl,onstyleload);
setTimeout(function()
{
_loadjsml();
},config.loader_loadcodedelay||1);
}
function _loadjsml()
{
trace("_loadjsml");
function nextstep()
{
jsml.jsmlfolder=config.folder+"core"
jsml.default_textbox_bordercolor="#eeeeee";
if(config.ismobileversion)
jsml.mobile=true;
jsml.enableieborderradius=config.enableieborderradius;
_loadicache();
};
if(window.jsml)
nextstep();
else
asyncloadscript(config.jsmljsurl,nextstep)
}
function _loadicache()
{
if(!loader._html5||!config.useimagedatacache)
{
_loadcommonxml();
return;
}
function nextstep(err)
{
if(!err)config._rte_image_cache=window._rte_image_cache;
_loadcommonxml();
};
if(config._rte_image_cache)
nextstep();
else
asyncloadscript(config.folder+"scripts/ihtml5.js?"+config._urlsuffix,nextstep)
}
function translate_value(val)
{
if(val.charAt(0)=="@")
return translate_lang(val);
if(val.indexOf('}')==-1)
return val;
val=val.split('{skin}').join(config.skin);
val=val.split('{color}').join(config.color);
val=val.split('{folder}').join(config.folder);
val=val.split('{toolbar}').join(config._toolbartemplate||config.toolbar);
val=val.split('{timems}').join(config._debugmode?new Date().getTime():config._urlsuffix);
return val;
}
function _load_jsml_xml(url,callback)
{
asyncloadtext(url,function(text,xml)
{
try
{
jsml.parse_xmldoc(xml,null,null,null,translate_value);
}
catch(x)
{
alert("Unable to parse "+url+" , "+x.message);
return;
}
setTimeout(callback,12);
});
}
function _loadcommonxml()
{
trace("_loadcommonxml");
if(jsml.rtecommonlibraryloaded)
{
_loadskinxml();
return;
}
_load_jsml_xml(config.commonxmlurl,function()
{
_loadskinxml();
});
}
function _loadskinxml()
{
trace("_loadskinxml");
config.skinxmlclass="rteskin_"+(config.skin)+"_"+config.color;
if(jsml.class_exists(config.skinxmlclass))
{
onstyleload();
return;
}
_load_jsml_xml(config.skinxmlurl,onstyleload);
}
function _loadeditorui()
{
trace("_loadeditorui");
try
{
config.skin_div.style.border=config.skin_divborder;
config.skin_div.innerHTML="";
jsml.suppend_layout();
config.skin_control=jsml.class_create_instance(config.skinxmlclass);
config.skin_control._rteconfig=config;
config.skin_container=config.skin_control.editor_frame_container;
var width=config.skin_div.clientWidth||parseInt(config.skin_div.style.width)||760;
var height=config.skin_div.clientHeight||parseInt(config.skin_div.style.height)||480;
config.skin_control.set_width(width);
config.skin_control.set_height(height);
config.skin_control.set_parent(config.skin_div);
jsml.resume_layout();
}
catch(x)
{
alert("Unable to initialize the UI , "+x.message);
}
setTimeout(function()
{
try
{
_loadframe();
}
catch(x)
{
alert("Unable to initialize the IFrame , "+x.message);
}
},1);
}
function _loadframe()
{
trace("_loadframe");
var frame=document.createElement("IFRAME");
config.skin_frame=frame;
function handle_resize()
{
frame.style.width=Math.max(0,config.skin_container.get_client_width()-0)+"px";
frame.style.height=Math.max(0,config.skin_container.get_client_height()-0)+"px";
}
var frameurl=config.blankfileurl;
var frameloaded=false;
function frameonload()
{
frameloaded=true;
frame.onload=new Function();
if(config.designtimeblankhtml)
{
_loadscript();
return;
}
var url=frameurl;
var xh=jsml.xmlhttp();
xh.onreadystatechange=function()
{
if(xh.readyState<4)return;
xh.onreadystatechange=new Function();
if(xh.status==0)return;
if(xh.status!=200)
{
if(xh.status!=0)
alert("Unable to load "+url+" , http"+xh.status);
return;
}
config.designtimeblankhtml=xh.responseText;
_loadscript();
};
xh.open("GET",url,true);
xh.send("");
};
//frame.onload=frameonload;
frame.frameBorder=0;
frame.setAttribute("src",frameurl);
config.skin_container._content.appendChild(frame);
config.skin_container.attach_event("resize",handle_resize);
handle_resize();
//some browsers has trouble on frame.onload
function checkframeload()
{
if(frameloaded)return;
var win=frame.contentWindow;
//if(win&&win.document&&win.document.readyState=="complete")
// return frameonload();
if(win&&win.document&&win.document.body)
return frameonload();
setTimeout(checkframeload,10);
}
setTimeout(checkframeload,10);
}
function _loadscript()
{
trace("_loadscript");
function editorjsready()
{
try
{
_loadeditor()
}
catch(x)
{
alert("Unable to initialize the Editor class , "+x.message);
}
};
if($rte.Editor)
{
editorjsready();
return;
}
function corejsready()
{
asyncloadscript(config.editorjsurl,editorjsready);
if(loader.oncoreload)
{
loader.oncoreload(loader);
}
if(window.RichTextEditor_OnCoreLoad)
{
window.RichTextEditor_OnCoreLoad(loader);
}
};
if($rte.Core)
{
corejsready();
return;
}
asyncloadscript(config.corejsurl,corejsready);
}
function _loadeditor()
{
trace("_loadeditor");
var frame=config.skin_frame;
var editor=new $rte.Editor(config,frame,frame.contentWindow,loader);
config.skin_control._rteinstance=editor;
config.skin_control.invoke_recursive("editor_ready",editor);
//config.skin_div.onclick=editor.delegate(editor.Focus);
var timerid;
function disposeeditor()
{
window.clearInterval(timerid);
jsml.dom_detach_event(window,"unload",windowunload);
editor.Dispose();
}
function windowunload()
{
disposeeditor()
jsml.disposeall();
}
timerid=window.setInterval(function()
{
for(var n=config.skin_div;n;n=n.parentNode)
if(n.nodeName=="BODY")
return;
disposeeditor()
},200);
jsml.dom_attach_event(window,"unload",windowunload);
asyncloadlangindex(1);
if(config.preloadplugins)
{
var arr=config.preloadplugins.split(',');
for(var i=0;i<arr.length;i++)
editor.LoadPlugin(arr[i]);
}
if(config.autofocus)
{
setTimeout(function()
{
editor.Focus();
},222);
}
if(config.initialtabmode)
editor.ExecUICommand(null,"tab"+config.initialtabmode);
if(!config.initialtoggleborder)
editor.ExecUICommand(null,"ToggleBorder");
if(config.initialfullscreen)
{
setTimeout(function()
{
editor.ExecUICommand(null,"FullScreen");
editor.Focus();
},55);
}
}
loader.asyncloadscript=asyncloadscript;
loader.translate_value=translate_value;
loader.load=function()
{
_loadmain();
}
loader.startLoadTimer=function(timeout)
{
clearTimeout(loader._loadtimerid);
loader._loadtimerid=setTimeout(_loadmain,timeout);
}
loader.cancelLoadTimer=function()
{
clearTimeout(loader._loadtimerid);
}
loader.preloadScripts=function()
{
asyncloadtext(config.configjsurl);
asyncloadtext(config.rtecssurl);
asyncloadtext(config.jsmljsurl);
asyncloadtext(config.commonxmlurl);
asyncloadtext(config.corejsurl);
asyncloadtext(config.editorjsurl);
}
if(window.RichTextEditor_OnLoader)
window.RichTextEditor_OnLoader(loader);
return loader;
}
}

Binary file not shown.

View File

@@ -0,0 +1,22 @@
//this script file is for preview mode
document.onclick=function(e)
{
e=e||window.event;
var node=e.srcElement||e.target;
for(;node;node=node.parentNode)
{
var name=node.nodeName;
switch(name)
{
case "A":
case "AREA":
node.setAttribute("target","_blank");
return true;
case "INPUT":
case "BUTTON":
return false;
}
}
}