文档拆分--查看--图片上传

This commit is contained in:
范强强
2024-03-10 13:18:09 +08:00
parent 46bcf687a3
commit a4464e58c3
5 changed files with 34 additions and 14 deletions
+3 -1
View File
@@ -911,7 +911,9 @@
}
})(img));
img.width = 113;
img.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=':'&noCache=') + (+new Date()).toString(36) );
console.log(urlPrefix + list[i].url)
img.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=':'&noCache=') + (+new Date()).toString(36) );
img.setAttribute('_src', urlPrefix + list[i].url);
domUtils.addClass(icon, 'icon');
+16 -11
View File
@@ -7336,15 +7336,14 @@ var fillCharReg = new RegExp(domUtils.fillChar, 'g');
* editor.setContent('<p>new text</p>', true); //插入的结果是<p>old text</p><p>new text</p>
* ```
*/
setContent: function (html, isAppendTo, notFireSelectionchange) {
var me = this;
me.fireEvent('beforesetcontent', html);
me.fireEvent('beforesetcontent', html);
var root = UE.htmlparser(html);
me.filterInputRule(root);
html = root.toHtml();
me.body.innerHTML = (isAppendTo ? me.body.innerHTML : '') + html;
me.body.innerHTML = (isAppendTo ? me.body.innerHTML : '') + html;
function isCdataDiv(node){
@@ -8078,14 +8077,14 @@ UE.Editor.defaultOptions = function(editor){
setTimeout(function(){
try{
me.options.imageUrl && me.setOpt('serverUrl', me.options.imageUrl.replace(/^(.*[\/]).+([\.].+)$/, '$1controller$2'));
var configUrl = me.getActionUrl('config'),
console.log(me.options.imageUrl)
var configUrl = me.getActionUrl('config'),
isJsonp = utils.isCrossDomainUrl(configUrl);
/* 发出ajax请求 */
me._serverConfigLoaded = false;
configUrl && UE.ajax.request(configUrl,{
configUrl && UE.ajax.request('http://localhost:8184/laws-sinotruk/sys/split/file/getImage?fileName=7DS756NXKGimage5.png',{
'method': 'GET',
'dataType': isJsonp ? 'jsonp':'',
'onsuccess':function(r){
@@ -9378,7 +9377,7 @@ var filterWord = UE.filterWord = function () {
* ```
*/
var htmlparser = UE.htmlparser = function (htmlstr,ignoreBlank) {
var htmlparser = UE.htmlparser = function (htmlstr,ignoreBlank) {
//todo 原来的方式 [^"'<>\/] 有\/就不能配对上 <TD vAlign=top background=../AAA.JPG> 这样的标签了
//先去掉了,加上的原因忘了,这里先记录
var re_tag = /<(?:(?:\/([^>]+)>)|(?:!--([\S|\s]*?)-->)|(?:([^\s\/<>]+)\s*((?:(?:"[^"]*")|(?:'[^']*')|[^"'<>])*)\/?>))/g,
@@ -9548,7 +9547,8 @@ var htmlparser = UE.htmlparser = function (htmlstr,ignoreBlank) {
if (nextIndex < htmlstr.length) {
text(currentParent, htmlstr.slice(nextIndex));
}
return root;
console.log(root)
return root;
};
@@ -27736,7 +27736,7 @@ UE.ui = baidu.editor.ui = {};
});
},
setContent: function(content){
this.getDom('content').innerHTML = content;
this.getDom('content').innerHTML = content;
},
setType: function(type){
type = type || 'info';
@@ -29566,6 +29566,11 @@ UE.registerUI('autosave', function(editor) {
});
window.getHtml = function (content) {
let html = ''
var root = UE.htmlparser(content);
html = root.toHtml();
return html
}
})();