This commit is contained in:
alvis
2020-07-16 14:12:31 +08:00
parent 1c159a7bad
commit f746aef851
2140 changed files with 7218 additions and 4689 deletions

File diff suppressed because one or more lines are too long

View File

@@ -0,0 +1,121 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>ueditor图片对话框</title>
<script type="text/javascript" src="../internal.js"></script>
<!-- jquery -->
<script type="text/javascript" src="../../third-party/jquery-1.10.2.min.js"></script>
<!-- webuploader -->
<script src="../../third-party/webuploader/webuploader.min.js"></script>
<link rel="stylesheet" type="text/css" href="../../third-party/webuploader/webuploader.css">
<!-- image dialog -->
<link rel="stylesheet" href="image.css" type="text/css" />
</head>
<body>
<div class="wrapper">
<div id="tabhead" class="tabhead">
<!--xlz去掉线上上传图片的功能-->
<!-- <span class="tab" data-content-id="remote"><var id="lang_tab_remote"></var></span>-->
<span class="tab focus" data-content-id="upload"><var id="lang_tab_upload"></var></span>
<!--<span class="tab" data-content-id="online"><var id="lang_tab_online"></var></span>
<span class="tab" data-content-id="search"><var id="lang_tab_search"></var></span>-->
</div>
<div class="alignBar">
<label class="algnLabel"><var id="lang_input_align"></var></label>
<span id="alignIcon">
<span id="noneAlign" class="none-align focus" data-align="none"></span>
<span id="leftAlign" class="left-align" data-align="left"></span>
<span id="rightAlign" class="right-align" data-align="right"></span>
<span id="centerAlign" class="center-align" data-align="center"></span>
</span>
<input id="align" name="align" type="hidden" value="none"/>
</div>
<div id="tabbody" class="tabbody">
<!-- 远程图片 -->
<div id="remote" class="panel">
<div class="top">
<div class="row">
<label for="url"><var id="lang_input_url"></var></label>
<span><input class="text" id="url" type="text"/></span>
</div>
</div>
<div class="left">
<div class="row">
<label><var id="lang_input_size"></var></label>
<span><var id="lang_input_width">&nbsp;&nbsp;</var><input class="text" type="text" id="width"/>px </span>
<span><var id="lang_input_height">&nbsp;&nbsp;</var><input class="text" type="text" id="height"/>px </span>
<span><input id="lock" type="checkbox" disabled="disabled"><span id="lockicon"></span></span>
</div>
<div class="row">
<label><var id="lang_input_border"></var></label>
<span><input class="text" type="text" id="border"/>px </span>
</div>
<div class="row">
<label><var id="lang_input_vhspace"></var></label>
<span><input class="text" type="text" id="vhSpace"/>px </span>
</div>
<div class="row">
<label><var id="lang_input_title"></var></label>
<span><input class="text" type="text" id="title"/></span>
</div>
</div>
<div class="right"><div id="preview"></div></div>
</div>
<!-- 上传图片 -->
<div id="upload" class="panel focus">
<div id="queueList" class="queueList">
<div class="statusBar element-invisible">
<div class="progress">
<span class="text">0%</span>
<span class="percentage"></span>
</div><div class="info"></div>
<div class="btns">
<div id="filePickerBtn"></div>
<div class="uploadBtn"><var id="lang_start_upload"></var></div>
</div>
</div>
<div id="dndArea" class="placeholder">
<div class="filePickerContainer">
<div id="filePickerReady"></div>
</div>
</div>
<ul class="filelist element-invisible">
<li id="filePickerBlock" class="filePickerBlock"></li>
</ul>
</div>
</div>
<!-- 在线图片 -->
<div id="online" class="panel">
<div id="imageList"><var id="lang_imgLoading"></var></div>
</div>
<!-- 搜索图片 -->
<div id="search" class="panel">
<div class="searchBar">
<input id="searchTxt" class="searchTxt text" type="text" />
<select id="searchType" class="searchType">
<option value="&s=4&z=0"></option>
<option value="&s=1&z=19"></option>
<option value="&s=2&z=0"></option>
<option value="&s=3&z=0"></option>
</select>
<input id="searchReset" type="button" />
<input id="searchBtn" type="button" />
</div>
<div id="searchList" class="searchList"><ul id="searchListUl"></ul></div>
</div>
</div>
</div>
<script type="text/javascript" src="image.js"></script>
</body>
</html>

File diff suppressed because one or more lines are too long

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 453 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@@ -0,0 +1 @@
!function(){var e=window.parent;dialog=e.$EDITORUI[window.frameElement.id.replace(/_iframe$/,"")],editor=dialog.editor,UE=e.UE,domUtils=UE.dom.domUtils,utils=UE.utils,browser=UE.browser,ajax=UE.ajax,$G=function(e){return document.getElementById(e)},$focus=function(t){setTimeout(function(){if(browser.ie){var e=t.createTextRange();e.collapse(!1),e.select()}else t.focus()},0)},utils.loadFile(document,{href:"../themes/default/dialogbase.css?cache="+Math.random(),tag:"link",type:"text/css"}),lang=editor.getLang(dialog.className.split("-")[2]),lang&&domUtils.on(window,"load",function(){var e=editor.options.langPath+editor.options.lang+"/images/";for(var t in lang.static){var a=$G(t);if(a){var o=a.tagName,i=lang.static[t];switch(i.src&&((i=utils.extend({},i,!1)).src=e+i.src),i.style&&((i=utils.extend({},i,!1)).style=i.style.replace(/url\s*\(/g,"url("+e)),o.toLowerCase()){case"var":a.parentNode.replaceChild(document.createTextNode(i),a);break;case"select":for(var s,r=a.options,l=0;s=r[l];)s.innerHTML=i.options[l++];for(var n in i)"options"!=n&&a.setAttribute(n,i[n]);break;default:domUtils.setAttributes(a,i)}}}})}();

View File

@@ -0,0 +1,40 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style>
html,body{
height:100%;
width:100%;
padding:0;
margin:0;
}
#preview{
width:100%;
height:100%;
padding:0;
margin:0;
}
#preview *{font-family:sans-serif;font-size:16px;}
</style>
<script type="text/javascript" src="../internal.js"></script>
<script src="../../ueditor.parse.min.js"></script>
<title></title>
</head>
<body class="view">
<div id="preview" style="margin:8px">
</div>
</body>
<script>
document.getElementById('preview').innerHTML = editor.getContent();
uParse('#preview',{
rootPath : '../../',
chartContainerHeight:500
})
dialog.oncancel = function(){
document.getElementById('preview').innerHTML = '';
}
</script>
</html>

Binary file not shown.

After

Width:  |  Height:  |  Size: 304 B

View File

@@ -0,0 +1 @@
body{overflow:hidden;width:540px}.wrapper{margin:10px auto 0;font-size:12px;overflow:hidden;width:520px;height:315px}.clear{clear:both}.wrapper .left{float:left;margin-left:10px}.wrapper .right{float:right;border-left:2px dotted #ededed;padding-left:15px}.section{margin-bottom:15px;width:240px;overflow:hidden}.section h3{font-weight:bold;padding:5px 0;margin-bottom:10px;border-bottom:1px solid #ededed;font-size:12px}.section ul{list-style:none;overflow:hidden;clear:both}.section li{float:left;width:120px}.section .tone{width:80px}.section .preview{width:220px}.section .preview table{text-align:center;vertical-align:middle;color:#666}.section .preview caption{font-weight:bold}.section .preview td{border-width:1px;border-style:solid;height:22px}.section .preview th{border-style:solid;border-color:#DDD;border-width:2px 1px 1px 1px;height:22px;background-color:#f7f7f7}

View File

@@ -0,0 +1,64 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="../internal.js"></script>
<link rel="stylesheet" type="text/css" href="edittable.css">
</head>
<body>
<div class="wrapper">
<div class="left">
<div class="section">
<h3><var id="lang_tableStyle"></var></h3>
<ul>
<li>
<label onselectstart="return false"><input type="checkbox" id="J_title" name="style"/><var id="lang_insertTitle"></var></label>
</li>
<li>
<label onselectstart="return false"><input type="checkbox" id="J_titleCol" name="style"/><var id="lang_insertTitleCol"></var></label>
</li>
</ul>
<ul>
<li>
<label onselectstart="return false"><input type="checkbox" id="J_caption" name="style"/><var id="lang_insertCaption"></var></label>
</li>
<li>
<label onselectstart="return false"><input type="checkbox" id="J_sorttable" name="style"/><var id="lang_orderbycontent"></var></label>
</li>
</ul>
<div class="clear"></div>
</div>
<div class="section">
<h3><var id="lang_tableSize"></var></h3>
<ul>
<li>
<label><input type="radio" id="J_autoSizeContent" name="size"/><var id="lang_autoSizeContent"></var></label>
</li>
<li>
<label><input type="radio" id="J_autoSizePage" name="size"/><var id="lang_autoSizePage"></var></label>
</li>
</ul>
<div class="clear"></div>
</div>
<div class="section">
<h3><var id="lang_borderStyle"></var></h3>
<ul>
<li>
<span><var id="lang_color"></var></span>
<input type="text" class="tone" id="J_tone" readonly='readonly' />
</li>
</ul>
<div class="clear"></div>
</div>
</div>
<div class="right">
<div class="section">
<h3><var id="lang_example"></var></h3>
<div class="preview" id="J_preview">
</div>
</div>
</div>
</div>
<script type="text/javascript" src="edittable.js"></script>
</body>
</html>

View File

@@ -0,0 +1 @@
!function(){function e(){(r=this).init()}var r,l=$G("J_title"),d=$G("J_titleCol"),i=$G("J_caption"),a=$G("J_sorttable"),c=$G("J_autoSizeContent"),m=$G("J_autoSizePage"),s=$G("J_tone"),u=$G("J_preview");e.prototype={init:function(){var e=new UE.ui.ColorPicker({editor:editor}),t=new UE.ui.Popup({editor:editor,content:e});l.checked=-1==editor.queryCommandState("inserttitle"),d.checked=-1==editor.queryCommandState("inserttitlecol"),i.checked=-1==editor.queryCommandState("insertcaption"),a.checked=1==editor.queryCommandState("enablesort");var o=editor.queryCommandState("enablesort"),n=editor.queryCommandState("disablesort");a.checked=!!(o<0&&0<=n),a.disabled=!!(o<0&&n<0),a.title=o<0&&n<0?lang.errorMsg:"",r.createTable(l.checked,d.checked,i.checked),r.setAutoSize(),r.setColor(r.getColor()),domUtils.on(l,"click",r.titleHanler),domUtils.on(d,"click",r.titleColHanler),domUtils.on(i,"click",r.captionHanler),domUtils.on(a,"click",r.sorttableHanler),domUtils.on(c,"click",r.autoSizeContentHanler),domUtils.on(m,"click",r.autoSizePageHanler),domUtils.on(s,"click",function(){t.showAnchor(s)}),domUtils.on(document,"mousedown",function(){t.hide()}),e.addListener("pickcolor",function(){r.setColor(arguments[1]),t.hide()}),e.addListener("picknocolor",function(){r.setColor(""),t.hide()})},createTable:function(e,t,o){var n=[];if(n.push("<table id='J_example'>"),o&&n.push("<caption>"+lang.captionName+"</caption>"),e){n.push("<tr>"),t&&n.push("<th>"+lang.titleName+"</th>");for(var i=0;i<5;i++)n.push("<th>"+lang.titleName+"</th>");n.push("</tr>")}for(var a=0;a<6;a++){n.push("<tr>"),t&&n.push("<th>"+lang.titleName+"</th>");for(var r=0;r<5;r++)n.push("<td>"+lang.cellsName+"</td>");n.push("</tr>")}n.push("</table>"),u.innerHTML=n.join(""),this.updateSortSpan()},titleHanler:function(){var e=$G("J_example"),t=document.createDocumentFragment(),o=domUtils.getComputedStyle(domUtils.getElementsByTagName(e,"td")[0],"border-color"),n=e.rows[0].children.length;if(l.checked){e.insertRow(0);for(var i,a=0;a<n;a++)(i=document.createElement("th")).innerHTML=lang.titleName,t.appendChild(i);e.rows[0].appendChild(t)}else domUtils.remove(e.rows[0]);r.setColor(o),r.updateSortSpan()},titleColHanler:function(){var e=$G("J_example"),t=domUtils.getComputedStyle(domUtils.getElementsByTagName(e,"td")[0],"border-color"),o=e.rows,n=o.length;if(d.checked)for(var i,a=0;a<n;a++)(i=document.createElement("th")).innerHTML=lang.titleName,o[a].insertBefore(i,o[a].children[0]);else for(a=0;a<n;a++)domUtils.remove(o[a].children[0]);r.setColor(t),r.updateSortSpan()},captionHanler:function(){var e=$G("J_example");if(i.checked){var t=document.createElement("caption");t.innerHTML=lang.captionName,e.insertBefore(t,e.firstChild)}else domUtils.remove(domUtils.getElementsByTagName(e,"caption")[0])},sorttableHanler:function(){r.updateSortSpan()},autoSizeContentHanler:function(){$G("J_example").removeAttribute("width")},autoSizePageHanler:function(){var e=$G("J_example"),t=e.getElementsByTagName(e,"td");utils.each(t,function(e){e.removeAttribute("width")}),e.setAttribute("width","100%")},updateSortSpan:function(){var e=$G("J_example"),t=e.rows[0],o=domUtils.getElementsByTagName(e,"span");utils.each(o,function(e){e.parentNode.removeChild(e)}),a.checked&&utils.each(t.cells,function(e,t){var o=document.createElement("span");o.innerHTML="^",e.appendChild(o)})},getColor:function(){var e=editor.selection.getStart(),t=domUtils.findParentByTagName(e,["td","th","caption"],!0);return t&&domUtils.getComputedStyle(t,"border-color")||"#DDDDDD"},setColor:function(t){var e=$G("J_example"),o=domUtils.getElementsByTagName(e,"td").concat(domUtils.getElementsByTagName(e,"th"),domUtils.getElementsByTagName(e,"caption"));s.value=t,utils.each(o,function(e){e.style.borderColor=t})},setAutoSize:function(){m.checked=!0,this.autoSizePageHanler()}},new e,dialog.onok=function(){editor.__hasEnterExecCommand=!0;var e={title:"inserttitle deletetitle",titleCol:"inserttitlecol deletetitlecol",caption:"insertcaption deletecaption",sorttable:"enablesort disablesort"};for(var t in editor.fireEvent("saveScene"),e){var o=e[t].split(" ");$G("J_"+t).checked?-1!=editor.queryCommandState(o[0])&&editor.execCommand(o[0]):-1!=editor.queryCommandState(o[1])&&editor.execCommand(o[1])}editor.execCommand("edittable",s.value),c.checked&&editor.execCommand("adaptbytext"),m.checked&&editor.execCommand("adaptbywindow"),editor.fireEvent("saveScene"),editor.__hasEnterExecCommand=!1}}();

View File

@@ -0,0 +1,61 @@
<!DOCTYPE html>
<html>
<head>
<title></title>
<script type="text/javascript" src="../internal.js"></script>
<style type="text/css">
.section {
text-align: center;
margin-top: 10px;
}
.section input {
margin-left: 5px;
width: 70px;
}
</style>
</head>
<body>
<div class="section">
<span><var id="lang_tdBkColor"></var></span>
<input type="text" id="J_tone"/>
</div>
<script type="text/javascript">
var tone = $G("J_tone"),
colorPiker = new UE.ui.ColorPicker({
editor:editor
}),
colorPop = new UE.ui.Popup({
editor:editor,
content:colorPiker
});
domUtils.on(tone, "click", function () {
colorPop.showAnchor(tone);
});
domUtils.on(document, 'mousedown', function () {
colorPop.hide();
});
colorPiker.addListener("pickcolor", function () {
tone.value = arguments[1];
colorPop.hide();
});
colorPiker.addListener("picknocolor", function () {
tone.value="";
colorPop.hide();
});
dialog.onok=function(){
editor.execCommand("edittd",tone.value);
};
var start = editor.selection.getStart(),
cell = start && domUtils.findParentByTagName(start, ["td", "th"], true);
if(cell){
var color = domUtils.getComputedStyle(cell,'background-color');
if(/^#/.test(color)){
tone.value = color
}
}
</script>
</body>
</html>

View File

@@ -0,0 +1,33 @@
<!DOCTYPE html>
<html>
<head>
<title>表格删除提示</title>
<script type="text/javascript" src="../internal.js"></script>
<style type="text/css">
.section {
width: 200px;
margin: 10px auto 0;
font-size: 14px;
}
.item {
text-align: center;
}
</style>
</head>
<body>
<div class="section">
<div class="item">
<label><input type="radio" id="J_delRow" name="cmd" checked/><var id="lang_delRow"></var></label>
</div>
<div class="item">
<label><input type="radio" id="J_delCol" name="cmd"/><var id="lang_delCol"></var></label>
</div>
</div>
<script type="text/javascript">
dialog.onok = function () {
$G("J_delRow").checked ? editor.execCommand("deleterow") : editor.execCommand("deletecol");
};
</script>
</body>
</html>

View File

@@ -0,0 +1 @@
UE.registerUI("kityformula",function(t,n){var e=new UE.ui.Dialog({iframeUrl:t.options.UEDITOR_HOME_URL+"kityformula-plugin/kityFormulaDialog.html",editor:t,name:n,title:"插入公式 ",cssRules:"width:783px; height: 386px;",buttons:[{className:"edui-okbutton",label:"确定",onclick:function(){e.close(!0)}},{className:"edui-cancelbutton",label:"取消",onclick:function(){e.close(!1)}}]});t.ready(function(){UE.utils.cssRule("kfformula","img.kfformula{vertical-align: middle;}",t.document)});var i=t.options.UEDITOR_HOME_URL+"kityformula-plugin/kf-icon.png",l=document.createElement("a");l.href=i,l.href=l.href,i=l.href;var o=new UE.ui.Button({name:"插入"+n,title:"插入公式",cssRules:'background: url("'+i+'") !important',onclick:function(){e.render(),e.open()}});return t.addListener("selectionchange",function(){var e=t.queryCommandState(n);-1==e?(o.setDisabled(!0),o.setChecked(!1)):(o.setDisabled(!1),o.setChecked(e))}),o});

View File

@@ -0,0 +1 @@
UE.plugins.defaultfilter=function(){var n=this;n.setOpt({allowDivTransToP:!0,disabledTableInTable:!0,rgb2Hex:!0}),n.addInputRule(function(e){var s,d=this.options.allowDivTransToP;e.traversal(function(i){if("element"==i.type){if(!UE.dom.dtd.$cdata[i.tagName]&&n.options.autoClearEmptyNode&&UE.dom.dtd.$inline[i.tagName]&&!UE.dom.dtd.$empty[i.tagName]&&(!i.attrs||UE.utils.isEmptyObject(i.attrs)))return void(i.firstChild()?"span"!=i.tagName||i.attrs&&!UE.utils.isEmptyObject(i.attrs)||i.parentNode.removeChild(i,!0):i.parentNode.removeChild(i));switch(i.tagName){case"style":case"script":i.setAttr({cdata_tag:i.tagName,cdata_data:i.innerHTML()||"",_ue_custom_node_:"true"}),i.tagName="div",i.innerHTML("");break;case"a":(s=i.getAttr("href"))&&i.setAttr("_href",s);break;case"img":i.setAttr("_src",i.getAttr("src"));break;case"span":UE.browser.webkit&&(s=i.getStyle("white-space"))&&/nowrap|normal/.test(s)&&(i.setStyle("white-space",""),n.options.autoClearEmptyNode&&UE.utils.isEmptyObject(i.attrs)&&i.parentNode.removeChild(i,!0)),(s=i.getAttr("id"))&&/^_baidu_bookmark_/i.test(s)&&i.parentNode.removeChild(i);break;case"p":(s=i.getAttr("align"))&&(i.setAttr("align"),i.setStyle("text-align",s)),UE.utils.each(i.children,function(e){if("element"==e.type&&"p"==e.tagName){var t=e.nextSibling();i.parentNode.insertAfter(e,i);for(var a=e;t;){var r=t.nextSibling();i.parentNode.insertAfter(t,a),a=t,t=r}return!1}}),i.firstChild()||i.innerHTML(UE.browser.ie?"&nbsp;":"<br/>");break;case"div":if(i.getAttr("cdata_tag"))break;if((s=i.getAttr("class"))&&/^line number\d+/.test(s))break;if(!d)break;for(var e,t=UE.uNode.createElement("p");e=i.firstChild();)"text"!=e.type&&UE.dom.UE.dom.dtd.$block[e.tagName]?t.firstChild()?(i.parentNode.insertBefore(t,i),t=UE.uNode.createElement("p")):i.parentNode.insertBefore(e,i):t.appendChild(e);t.firstChild()&&i.parentNode.insertBefore(t,i),i.parentNode.removeChild(i);break;case"dl":i.tagName="ul";break;case"dt":case"dd":i.tagName="li";break;case"li":var a=i.getAttr("class");a&&/list\-/.test(a)||i.setAttr();var r=i.getNodesByTagName("ol ul");UE.utils.each(r,function(e){i.parentNode.insertAfter(e,i)});break;case"td":case"th":case"caption":i.children&&i.children.length||i.appendChild(UE.browser.ie11below?UE.uNode.createText(" "):UE.uNode.createElement("br"));break;case"table":n.options.disabledTableInTable&&function(e){for(;e&&"element"==e.type;){if("td"==e.tagName)return 1;e=e.parentNode}}(i)&&(i.parentNode.insertBefore(UE.uNode.createText(i.innerText()),i),i.parentNode.removeChild(i))}}})}),n.addOutputRule(function(e){var a;e.traversal(function(e){if("element"==e.type){if(n.options.autoClearEmptyNode&&UE.dom.dtd.$inline[e.tagName]&&!UE.dom.dtd.$empty[e.tagName]&&(!e.attrs||UE.utils.isEmptyObject(e.attrs)))return void(e.firstChild()?"span"!=e.tagName||e.attrs&&!UE.utils.isEmptyObject(e.attrs)||e.parentNode.removeChild(e,!0):e.parentNode.removeChild(e));switch(e.tagName){case"div":(a=e.getAttr("cdata_tag"))&&(e.tagName=a,e.appendChild(UE.uNode.createText(e.getAttr("cdata_data"))),e.setAttr({cdata_tag:"",cdata_data:"",_ue_custom_node_:""}));break;case"a":(a=e.getAttr("_href"))&&e.setAttr({href:UE.utils.html(a),_href:""});break;case"span":if((a=e.getAttr("id"))&&/^_baidu_bookmark_/i.test(a)&&e.parentNode.removeChild(e),n.getOpt("rgb2Hex")){var t=e.getAttr("style");t&&e.setAttr("style",t.replace(/rgba?\(([\d,\s]+)\)/g,function(e,t){var a=t.split(",");if(3<a.length)return"";t="#";for(var r,i=0;r=a[i++];)t+=1==(r=parseInt(r.replace(/[^\d]/gi,""),10).toString(16)).length?"0"+r:r;return t.toUpperCase()}))}break;case"img":(a=e.getAttr("_src"))&&e.setAttr({src:e.getAttr("_src"),_src:""})}}})})};

View File

@@ -0,0 +1 @@
UE.Editor.prototype.getKfContent=function(t){var s=this,e=s.getActionUrl(s.getOpt("scrawlActionName")),r=UE.utils.serializeParam(s.queryCommandValue("serverparam"))||"",a=UE.utils.formatUrl(e+(-1==e.indexOf("?")?"?":"&")+r),i=0,n=s.body.getElementsByTagName("img"),o=[];function c(){i>=o.length&&(s.sync(),t(s.getContent()))}UE.utils.each(n,function(t){"data:image/png"===t.getAttribute("src").match(/^[^;]+/)[0]&&o.push(t)}),0==o.length?c():UE.utils.each(o,function(n){var t={};t[s.getOpt("scrawlFieldName")]=n.getAttribute("src").replace(/^[^,]+,/,""),t.onsuccess=function(t){var e=UE.utils.str2json(t.responseText),r=s.options.scrawlUrlPrefix+e.url;n.setAttribute("src",r),n.setAttribute("_src",r),i++,c()},t.onerror=function(t){console.error(t),i++,c()},UE.ajax.request(a,t)})};

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@@ -0,0 +1,107 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<link rel="stylesheet" href="kityformula/assets/styles/base.css">
<link rel="stylesheet" href="kityformula/assets/styles/ui.css">
<link rel="stylesheet" href="kityformula/assets/styles/scrollbar.css">
<style>
html, body {
padding: 0;
margin: 0;
}
.kf-editor {
width: 780px;
height: 380px;
}
#loading {
height: 32px;
width: 340px;
line-height: 32px;
position: absolute;
top: 42%;
left: 50%;
margin-left: -170px;
font-family: arial, "Hiragino Sans GB", "Microsoft YaHei", "WenQuanYi Micro Hei", sans-serif;
}
#loading img {
position: absolute;
}
#loading p {
display: block;
position: absolute;
left: 40px;
top: 0px;
margin: 0;
}
</style>
<title></title>
</head>
<body>
<div id="kfEditorContainer" class="kf-editor">
<div id="tips" class="tips">
sorry! Beta版本仅支持IE9及以上版本的浏览器正式版本将会支持低版本浏览器谢谢您的关注
</div>
</div>
<!--页面中一定要引入internal.js为了能直接使用当前打开dialog的实例变量-->
<!--internal.js默认是放到dialogs目录下的-->
<script type="text/javascript" src="../dialogs/internal.js"></script>
<script src="kityformula/js/jquery-1.11.0.min.js"></script>
<script src="kityformula/js/kitygraph.all.js"></script>
<script src="kityformula/js/kity-formula-render.all.js"></script>
<script src="kityformula/js/kity-formula-parser.all.min.js"></script>
<script src="kityformula/js/kityformula-editor.all.min.js"></script>
<script>
jQuery( function ($) {
if ( document.body.addEventListener ) {
$( "#tips").html('<div id="loading"><img src="kityformula/loading.gif" alt="loading" /><p>正在加载,请耐心等待...</p></div>' );
var factory = kf.EditorFactory.create( $( "#kfEditorContainer" )[ 0 ], {
render: {
fontsize: 24
},
resource: {
path: "./kityformula/resource/"
}
} );
factory.ready( function ( KFEditor ) {
$( "#tips").remove();
// this指向KFEditor
var rng = editor.selection.getRange(),
img = rng.getClosedNode(),
imgLatex = img && $(img).attr('data-latex');
this.execCommand( "render", imgLatex || "\\placeholder" );
this.execCommand( "focus" );
window.kfe = this;
} );
dialog.onok = function(){
kfe.execCommand('get.image.data', function(data){
var latex = kfe.execCommand('get.source');
editor.execCommand('inserthtml', '<img class="kfformula" src="'+ data.img +'" data-latex="' + latex + '" />');
dialog.close();
});
return false;
}
} else {
$( "#tips").css( "color", "black" );
$( "#tips").css( "padding", "10px" );
}
} );
</script>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More