Bläddra i källkod

编辑器图标和旧数据图标处理

枝江中职分支
yxq 1 månad sedan
förälder
incheckning
565d419dd8
3 ändrade filer med 22 tillägg och 9 borttagningar
  1. +1
    -1
      Learun.Framework.Ultimate V7/Learun.Application.Web/Content/ueditor/config/config.json
  2. +16
    -6
      Learun.Framework.Ultimate V7/Learun.Application.Web/Content/ueditor/ueditor.all.js
  3. +5
    -2
      Learun.Framework.Ultimate V7/Learun.Application.Web/Content/ueditor/ueditor.view.js

+ 1
- 1
Learun.Framework.Ultimate V7/Learun.Application.Web/Content/ueditor/config/config.json Visa fil

@@ -8,7 +8,7 @@
"imageCompressEnable": true, /* 是否压缩图片,默认是true */ "imageCompressEnable": true, /* 是否压缩图片,默认是true */
"imageCompressBorder": 1600, /* 图片压缩最长边限制 */ "imageCompressBorder": 1600, /* 图片压缩最长边限制 */
"imageInsertAlign": "none", /* 插入的图片浮动方式 */ "imageInsertAlign": "none", /* 插入的图片浮动方式 */
"imageUrlPrefix": "http://wxd3f.cyzjzx.com/ueditor/", /* 图片访问路径前缀 */
"imageUrlPrefix": "/ueditor/", /* 图片访问路径前缀 */
"imagePathFormat": "upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */ "imagePathFormat": "upload/image/{yyyy}{mm}{dd}/{time}{rand:6}", /* 上传保存路径,可以自定义保存路径和文件名格式 */
/* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */ /* {filename} 会替换成原文件名,配置这项需要注意中文乱码问题 */
/* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */ /* {rand:6} 会替换成随机数,后面的数字是随机数的位数 */


+ 16
- 6
Learun.Framework.Ultimate V7/Learun.Application.Web/Content/ueditor/ueditor.all.js Visa fil

@@ -24795,19 +24795,29 @@ UE.plugin.register('insertfile', function (){


var i, item, icon, title, var i, item, icon, title,
html = '', html = '',
URL = me.getOpt('UEDITOR_HOME_URL'),
iconDir = URL + (URL.substr(URL.length - 1) == '/' ? '':'/') + 'dialogs/attachment/fileTypeImages/';

// 原代码
// URL = me.getOpt('UEDITOR_HOME_URL'),
// iconDir = URL + (URL.substr(URL.length - 1) == '/' ? '':'/') + 'dialogs/attachment/fileTypeImages/';
// 去掉地址的域名
URL = '/Content/ueditor/',
iconDir = URL + 'dialogs/attachment/fileTypeImages/';

for (i = 0; i < filelist.length; i++) { for (i = 0; i < filelist.length; i++) {
item = filelist[i]; item = filelist[i];
icon = iconDir + getFileIcon(item.url); icon = iconDir + getFileIcon(item.url);
title = item.title || item.url.substr(item.url.lastIndexOf('/') + 1); title = item.title || item.url.substr(item.url.lastIndexOf('/') + 1);
// html += '<p style="line-height: 16px;">' +
// '<img style="vertical-align: middle; margin-right: 2px;" src="'+ icon + '" _src="' + icon + '" />' +
// '<a style="font-size:12px; color:#0066cc;" href="' + item.url +'" title="' + title + '">' + title + '</a>' +
// '</p>';

// 原代码
html += '<p style="line-height: 16px;">' + html += '<p style="line-height: 16px;">' +
'<img style="vertical-align: middle; margin-right: 2px;" src="'+ icon + '" _src="' + icon + '" />' +
'<a style="font-size:12px; color:#0066cc;" href="' + item.url +'" title="' + title + '">' + title + '</a>' + '<a style="font-size:12px; color:#0066cc;" href="' + item.url +'" title="' + title + '">' + title + '</a>' +
'</p>'; '</p>';
// 去除图标
// html += '<p style="line-height: 16px;">' +
// '<a style="font-size:12px; color:#0066cc;" href="' + item.url +'" title="' + title + '">' + title + '</a>' +
// '</p>';

} }
me.execCommand('insertHtml', html); me.execCommand('insertHtml', html);
} }


+ 5
- 2
Learun.Framework.Ultimate V7/Learun.Application.Web/Content/ueditor/ueditor.view.js Visa fil

@@ -1,7 +1,10 @@
let imgs = document.querySelectorAll('img') let imgs = document.querySelectorAll('img')
imgs.forEach(e => { imgs.forEach(e => {
let src = e.getAttribute('src') let src = e.getAttribute('src')
if (src.includes('Content/ueditor/dialogs/attachment/fileTypeImages/icon_')){
e.style.display = 'none'
if (src.includes('Content/ueditor/dialogs/attachment/fileTypeImages/icon_')) {
// e.style.display = 'none'
let arr = src.split('Content/ueditor/dialogs/attachment/fileTypeImages/icon_')
src = '/Content/ueditor/dialogs/attachment/fileTypeImages/icon_' + arr[arr.length - 1]
e.setAttribute('src', src)
} }
}) })

Laddar…
Avbryt
Spara