fix 代码生成-父级菜单选择,更新ueditor-plus版本

This commit is contained in:
yxh 2024-10-22 11:50:30 +08:00
parent d51c52dece
commit 448d9ff1f8
130 changed files with 42779 additions and 50814 deletions

View File

@ -1,40 +1,62 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title> <title></title>
<style type="text/css"> <style type="text/css">
*{color: #838383;margin: 0;padding: 0} * {
html,body {font-size: 12px;overflow: hidden; } color: #838383;
.content{padding:5px 0 0 15px;} margin: 0;
input{margin-left:4px;box-sizing:border-box;width:210px;height:30px;line-height:30px;border:1px solid #d7d7d7;border-radius:3px;padding:0 5px;outline:none;} padding: 0
</style> }
</head>
<body> html, body {
<div class="content"> font-size: 12px;
<span><var id="lang_input_anchorName"></var></span><input id="anchorName" value="" /> overflow: hidden;
</div> }
<script type="text/javascript" src="../internal.js?20220503"></script>
<script type="text/javascript"> .content {
var anchorInput = $G('anchorName'), padding: 5px 0 0 15px;
node = editor.selection.getRange().getClosedNode(); }
if(node && node.tagName == 'IMG' && (node = node.getAttribute('anchorname'))){
anchorInput.value = node; input {
} margin-left: 4px;
anchorInput.onkeydown = function(evt){ box-sizing: border-box;
evt = evt || window.event; width: 210px;
if(evt.keyCode == 13){ height: 30px;
editor.execCommand('anchor', anchorInput.value); line-height: 30px;
dialog.close(); border: 1px solid #d7d7d7;
domUtils.preventDefault(evt) border-radius: 3px;
} padding: 0 5px;
}; outline: none;
dialog.onok = function (){ }
editor.execCommand('anchor', anchorInput.value); </style>
dialog.close(); </head>
}; <body>
$focus(anchorInput); <div class="content">
</script> <span><var id="lang_input_anchorName"></var></span><input id="anchorName" value=""/>
</body> </div>
<script type="text/javascript" src="../internal.js?aea0c61c"></script>
<script type="text/javascript">
var anchorInput = $G('anchorName'),
node = editor.selection.getRange().getClosedNode();
if (node && node.tagName == 'IMG' && (node = node.getAttribute('anchorname'))) {
anchorInput.value = node;
}
anchorInput.onkeydown = function (evt) {
evt = evt || window.event;
if (evt.keyCode == 13) {
editor.execCommand('anchor', anchorInput.value);
dialog.close();
domUtils.preventDefault(evt)
}
};
dialog.onok = function () {
editor.execCommand('anchor', anchorInput.value);
dialog.close();
};
$focus(anchorInput);
</script>
</body>
</html> </html>

View File

@ -13,8 +13,9 @@
/*tab样式框大小*/ /*tab样式框大小*/
.tabhead { .tabhead {
float:left; float: left;
} }
.tabbody { .tabbody {
width: 100%; width: 100%;
height: 346px; height: 346px;
@ -89,7 +90,7 @@
color: #cccccc; color: #cccccc;
font-size: 18px; font-size: 18px;
position: relative; position: relative;
top:0; top: 0;
*top: 10px; *top: 10px;
} }
@ -273,12 +274,14 @@
-ms-transition: 200ms ease-out; -ms-transition: 200ms ease-out;
transition: 200ms ease-out; transition: 200ms ease-out;
} }
#upload .filelist li p.imgWrap.notimage { #upload .filelist li p.imgWrap.notimage {
margin-top: 0; margin-top: 0;
width: 111px; width: 111px;
height: 111px; height: 111px;
border: 1px #eeeeee solid; border: 1px #eeeeee solid;
} }
#upload .filelist li p.imgWrap.notimage i.file-preview { #upload .filelist li p.imgWrap.notimage i.file-preview {
margin-top: 15px; margin-top: 15px;
} }
@ -297,7 +300,7 @@
line-height: 28px; line-height: 28px;
width: 100%; width: 100%;
z-index: 100; z-index: 100;
display:none; display: none;
} }
#upload .filelist li .success { #upload .filelist li .success {
@ -319,7 +322,8 @@
border: 1px solid #eeeeee; border: 1px solid #eeeeee;
border-radius: 0; border-radius: 0;
} }
#upload .filelist li.filePickerBlock div.webuploader-pick {
#upload .filelist li.filePickerBlock div.webuploader-pick {
width: 100%; width: 100%;
height: 100%; height: 100%;
margin: 0; margin: 0;
@ -352,7 +356,7 @@
background: url(./images/icons.gif) no-repeat \9; background: url(./images/icons.gif) no-repeat \9;
margin: 5px 1px 1px; margin: 5px 1px 1px;
cursor: pointer; cursor: pointer;
-webkit-tap-highlight-color: rgba(0,0,0,0); -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-user-select: none; -webkit-user-select: none;
-moz-user-select: none; -moz-user-select: none;
-ms-user-select: none; -ms-user-select: none;
@ -360,7 +364,7 @@
} }
#upload .filelist div.file-panel span.rotateLeft { #upload .filelist div.file-panel span.rotateLeft {
display:none; display: none;
background-position: 0 -24px; background-position: 0 -24px;
} }
@ -369,7 +373,7 @@
} }
#upload .filelist div.file-panel span.rotateRight { #upload .filelist div.file-panel span.rotateRight {
display:none; display: none;
background-position: -24px -24px; background-position: -24px -24px;
} }
@ -408,6 +412,7 @@
color: #6dbfff; color: #6dbfff;
margin: 0 10px 0 0; margin: 0 10px 0 0;
} }
#upload .statusBar .progress span.percentage { #upload .statusBar .progress span.percentage {
width: 0; width: 0;
height: 100%; height: 100%;
@ -416,6 +421,7 @@
background: #1483d8; background: #1483d8;
position: absolute; position: absolute;
} }
#upload .statusBar .progress span.text { #upload .statusBar .progress span.text {
position: relative; position: relative;
z-index: 10; z-index: 10;
@ -438,6 +444,7 @@
display: inline-block; display: inline-block;
float: left; float: left;
} }
#upload .statusBar .btns .webuploader-pick, #upload .statusBar .btns .webuploader-pick,
#upload .statusBar .btns .uploadBtn, #upload .statusBar .btns .uploadBtn,
#upload .statusBar .btns .uploadBtn.state-uploading, #upload .statusBar .btns .uploadBtn.state-uploading,
@ -457,6 +464,7 @@
-ms-user-select: none; -ms-user-select: none;
user-select: none; user-select: none;
} }
#upload .statusBar .btns .webuploader-pick-hover, #upload .statusBar .btns .webuploader-pick-hover,
#upload .statusBar .btns .uploadBtn:hover, #upload .statusBar .btns .uploadBtn:hover,
#upload .statusBar .btns .uploadBtn.state-uploading:hover, #upload .statusBar .btns .uploadBtn.state-uploading:hover,
@ -465,45 +473,48 @@
} }
#upload .statusBar .btns .uploadBtn, #upload .statusBar .btns .uploadBtn,
#upload .statusBar .btns .uploadBtn.state-paused{ #upload .statusBar .btns .uploadBtn.state-paused {
background: #00b7ee; background: #00b7ee;
color: #fff; color: #fff;
border-color: transparent; border-color: transparent;
} }
#upload .statusBar .btns .uploadBtn:hover, #upload .statusBar .btns .uploadBtn:hover,
#upload .statusBar .btns .uploadBtn.state-paused:hover{ #upload .statusBar .btns .uploadBtn.state-paused:hover {
background: #00a2d4; background: #00a2d4;
} }
#upload .statusBar .btns .uploadBtn.disabled { #upload .statusBar .btns .uploadBtn.disabled {
pointer-events: none; pointer-events: none;
filter:alpha(opacity=60); filter: alpha(opacity=60);
-moz-opacity:0.6; -moz-opacity: 0.6;
-khtml-opacity: 0.6; -khtml-opacity: 0.6;
opacity: 0.6; opacity: 0.6;
} }
/* 图片管理样式 */ /* 图片管理样式 */
#online { #online {
width: 100%; width: 100%;
height: 336px; height: 336px;
padding: 10px 0 0 0; padding: 10px 0 0 0;
} }
#online #fileList{
#online #fileList {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;
position: relative; position: relative;
} }
#online ul { #online ul {
display: block; display: block;
list-style: none; list-style: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
#online li { #online li {
float: left; float: left;
display: block; display: block;
@ -518,18 +529,21 @@
cursor: pointer; cursor: pointer;
position: relative; position: relative;
} }
#online li.clearFloat { #online li.clearFloat {
float: none; float: none;
clear: both; clear: both;
display: block; display: block;
width:0; width: 0;
height:0; height: 0;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
#online li img { #online li img {
cursor: pointer; cursor: pointer;
} }
#online li div.file-wrapper { #online li div.file-wrapper {
cursor: pointer; cursor: pointer;
position: absolute; position: absolute;
@ -539,7 +553,8 @@
border: 1px solid #eee; border: 1px solid #eee;
background: url("./images/bg.png") repeat; background: url("./images/bg.png") repeat;
} }
#online li div span.file-title{
#online li div span.file-title {
display: block; display: block;
padding: 0 3px; padding: 0 3px;
margin: 3px 0 0 0; margin: 3px 0 0 0;
@ -553,6 +568,7 @@
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
} }
#online li .icon { #online li .icon {
cursor: pointer; cursor: pointer;
width: 113px; width: 113px;
@ -564,16 +580,19 @@
border: 0; border: 0;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
#online li .icon:hover { #online li .icon:hover {
width: 107px; width: 107px;
height: 107px; height: 107px;
border: 3px solid #1094fa; border: 3px solid #1094fa;
} }
#online li.selected .icon { #online li.selected .icon {
background-image: url(images/success.png); background-image: url(images/success.png);
background-image: url(images/success.gif) \9; background-image: url(images/success.gif) \9;
background-position: 75px 75px; background-position: 75px 75px;
} }
#online li.selected .icon:hover { #online li.selected .icon:hover {
width: 107px; width: 107px;
height: 107px; height: 107px;
@ -593,41 +612,51 @@ i.file-preview {
background-position: -140px center; background-position: -140px center;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
i.file-preview.file-type-dir{
i.file-preview.file-type-dir {
background-position: 0 center; background-position: 0 center;
} }
i.file-preview.file-type-file{
i.file-preview.file-type-file {
background-position: -140px center; background-position: -140px center;
} }
i.file-preview.file-type-filelist{
i.file-preview.file-type-filelist {
background-position: -210px center; background-position: -210px center;
} }
i.file-preview.file-type-zip, i.file-preview.file-type-zip,
i.file-preview.file-type-rar, i.file-preview.file-type-rar,
i.file-preview.file-type-7z, i.file-preview.file-type-7z,
i.file-preview.file-type-tar, i.file-preview.file-type-tar,
i.file-preview.file-type-gz, i.file-preview.file-type-gz,
i.file-preview.file-type-bz2{ i.file-preview.file-type-bz2 {
background-position: -280px center; background-position: -280px center;
} }
i.file-preview.file-type-xls, i.file-preview.file-type-xls,
i.file-preview.file-type-xlsx{ i.file-preview.file-type-xlsx {
background-position: -350px center; background-position: -350px center;
} }
i.file-preview.file-type-doc, i.file-preview.file-type-doc,
i.file-preview.file-type-docx{ i.file-preview.file-type-docx {
background-position: -420px center; background-position: -420px center;
} }
i.file-preview.file-type-ppt, i.file-preview.file-type-ppt,
i.file-preview.file-type-pptx{ i.file-preview.file-type-pptx {
background-position: -490px center; background-position: -490px center;
} }
i.file-preview.file-type-vsd{
i.file-preview.file-type-vsd {
background-position: -560px center; background-position: -560px center;
} }
i.file-preview.file-type-pdf{
i.file-preview.file-type-pdf {
background-position: -630px center; background-position: -630px center;
} }
i.file-preview.file-type-txt, i.file-preview.file-type-txt,
i.file-preview.file-type-md, i.file-preview.file-type-md,
i.file-preview.file-type-json, i.file-preview.file-type-json,
@ -638,18 +667,22 @@ i.file-preview.file-type-js,
i.file-preview.file-type-css, i.file-preview.file-type-css,
i.file-preview.file-type-php, i.file-preview.file-type-php,
i.file-preview.file-type-jsp, i.file-preview.file-type-jsp,
i.file-preview.file-type-asp{ i.file-preview.file-type-asp {
background-position: -700px center; background-position: -700px center;
} }
i.file-preview.file-type-apk{
i.file-preview.file-type-apk {
background-position: -770px center; background-position: -770px center;
} }
i.file-preview.file-type-exe{
i.file-preview.file-type-exe {
background-position: -840px center; background-position: -840px center;
} }
i.file-preview.file-type-ipa{
i.file-preview.file-type-ipa {
background-position: -910px center; background-position: -910px center;
} }
i.file-preview.file-type-mp4, i.file-preview.file-type-mp4,
i.file-preview.file-type-swf, i.file-preview.file-type-swf,
i.file-preview.file-type-mkv, i.file-preview.file-type-mkv,
@ -661,21 +694,23 @@ i.file-preview.file-type-mpeg,
i.file-preview.file-type-ogv, i.file-preview.file-type-ogv,
i.file-preview.file-type-webm, i.file-preview.file-type-webm,
i.file-preview.file-type-rm, i.file-preview.file-type-rm,
i.file-preview.file-type-rmvb{ i.file-preview.file-type-rmvb {
background-position: -980px center; background-position: -980px center;
} }
i.file-preview.file-type-ogg, i.file-preview.file-type-ogg,
i.file-preview.file-type-wav, i.file-preview.file-type-wav,
i.file-preview.file-type-wmv, i.file-preview.file-type-wmv,
i.file-preview.file-type-mid, i.file-preview.file-type-mid,
i.file-preview.file-type-mp3{ i.file-preview.file-type-mp3 {
background-position: -1050px center; background-position: -1050px center;
} }
i.file-preview.file-type-jpg, i.file-preview.file-type-jpg,
i.file-preview.file-type-jpeg, i.file-preview.file-type-jpeg,
i.file-preview.file-type-gif, i.file-preview.file-type-gif,
i.file-preview.file-type-bmp, i.file-preview.file-type-bmp,
i.file-preview.file-type-png, i.file-preview.file-type-png,
i.file-preview.file-type-psd{ i.file-preview.file-type-psd {
background-position: -140px center; background-position: -140px center;
} }

View File

@ -3,58 +3,59 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>ueditor图片对话框</title> <title>ueditor图片对话框</title>
<script type="text/javascript" src="../internal.js?20220503"></script> <script type="text/javascript" src="../internal.js?aea0c61c"></script>
<!-- jquery --> <!-- jquery -->
<script type="text/javascript" src="../../third-party/jquery-1.10.2.js?20220503"></script> <script type="text/javascript" src="../../third-party/jquery-1.10.2.js?628072e7"></script>
<!-- webuploader --> <!-- webuploader -->
<script src="../../third-party/webuploader/webuploader.js?20220503"></script> <script src="../../third-party/webuploader/webuploader.js?21e72664"></script>
<link rel="stylesheet" type="text/css" href="../../third-party/webuploader/webuploader.css?20220503"> <link rel="stylesheet" type="text/css" href="../../third-party/webuploader/webuploader.css?0057c5c7">
<!-- attachment dialog --> <!-- attachment dialog -->
<link rel="stylesheet" href="attachment.css?20220503" type="text/css" /> <link rel="stylesheet" href="attachment.css?e8f09700" type="text/css"/>
</head> </head>
<body> <body>
<div class="wrapper"> <div class="wrapper">
<div id="tabhead" class="tabhead"> <div id="tabhead" class="tabhead">
<span class="tab focus" data-content-id="upload"><var id="lang_tab_upload"></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="online"><var id="lang_tab_online"></var></span>
</div>
<div id="tabbody" class="tabbody">
<!-- 上传图片 -->
<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="fileList"><var id="lang_imgLoading"></var></div>
</div>
</div>
</div> </div>
<script type="text/javascript" src="attachment.js?20220503"></script> <div id="tabbody" class="tabbody">
<!-- 上传图片 -->
<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="fileList"><var id="lang_imgLoading"></var></div>
</div>
</div>
</div>
<script type="text/javascript" src="attachment.js?30c88b65"></script>
</body> </body>
</html> </html>

View File

@ -30,7 +30,7 @@
/* 初始化tabbody */ /* 初始化tabbody */
function setTabFocus(id) { function setTabFocus(id) {
if(!id) return; if (!id) return;
var i, bodyId, tabs = $G('tabhead').children; var i, bodyId, tabs = $G('tabhead').children;
for (i = 0; i < tabs.length; i++) { for (i = 0; i < tabs.length; i++) {
bodyId = tabs[i].getAttribute('data-content-id') bodyId = tabs[i].getAttribute('data-content-id')
@ -88,6 +88,7 @@
this.$wrap = target.constructor == String ? $('#' + target) : $(target); this.$wrap = target.constructor == String ? $('#' + target) : $(target);
this.init(); this.init();
} }
UploadFile.prototype = { UploadFile.prototype = {
init: function () { init: function () {
this.fileList = []; this.fileList = [];
@ -102,34 +103,34 @@
var _this = this, var _this = this,
$ = jQuery, // just in case. Make sure it's not an other libaray. $ = jQuery, // just in case. Make sure it's not an other libaray.
$wrap = _this.$wrap, $wrap = _this.$wrap,
// 图片容器 // 图片容器
$queue = $wrap.find('.filelist'), $queue = $wrap.find('.filelist'),
// 状态栏,包括进度和控制按钮 // 状态栏,包括进度和控制按钮
$statusBar = $wrap.find('.statusBar'), $statusBar = $wrap.find('.statusBar'),
// 文件总体选择信息。 // 文件总体选择信息。
$info = $statusBar.find('.info'), $info = $statusBar.find('.info'),
// 上传按钮 // 上传按钮
$upload = $wrap.find('.uploadBtn'), $upload = $wrap.find('.uploadBtn'),
// 上传按钮 // 上传按钮
$filePickerBtn = $wrap.find('.filePickerBtn'), $filePickerBtn = $wrap.find('.filePickerBtn'),
// 上传按钮 // 上传按钮
$filePickerBlock = $wrap.find('.filePickerBlock'), $filePickerBlock = $wrap.find('.filePickerBlock'),
// 没选择文件之前的内容。 // 没选择文件之前的内容。
$placeHolder = $wrap.find('.placeholder'), $placeHolder = $wrap.find('.placeholder'),
// 总体进度条 // 总体进度条
$progress = $statusBar.find('.progress').hide(), $progress = $statusBar.find('.progress').hide(),
// 添加的文件数量 // 添加的文件数量
fileCount = 0, fileCount = 0,
// 添加的文件总大小 // 添加的文件总大小
fileSize = 0, fileSize = 0,
// 优化retina, 在retina下这个值是2 // 优化retina, 在retina下这个值是2
ratio = window.devicePixelRatio || 1, ratio = window.devicePixelRatio || 1,
// 缩略图大小 // 缩略图大小
thumbnailWidth = 113 * ratio, thumbnailWidth = 113 * ratio,
thumbnailHeight = 113 * ratio, thumbnailHeight = 113 * ratio,
// 可能有pedding, ready, uploading, confirm, done. // 可能有pedding, ready, uploading, confirm, done.
state = '', state = '',
// 所有文件的进度信息key为file id // 所有文件的进度信息key为file id
percentages = {}, percentages = {},
supportTransition = (function () { supportTransition = (function () {
var s = document.createElement('p').style, var s = document.createElement('p').style,
@ -141,11 +142,12 @@
s = null; s = null;
return r; return r;
})(), })(),
// WebUploader实例 // WebUploader实例
uploader, uploader,
actionUrl = editor.getActionUrl(editor.getOpt('fileActionName')), actionUrl = editor.getActionUrl(editor.getOpt('fileActionName')),
fileMaxSize = editor.getOpt('fileMaxSize'), fileMaxSize = editor.getOpt('fileMaxSize'),
acceptExtensions = (editor.getOpt('fileAllowFiles') || []).join('').replace(/\./g, ',').replace(/^[,]/, '');; acceptExtensions = (editor.getOpt('fileAllowFiles') || []).join('').replace(/\./g, ',').replace(/^[,]/, '');
;
if (!WebUploader.Uploader.support()) { if (!WebUploader.Uploader.support()) {
$('#filePickerReady').after($('<div>').html(lang.errorNotSupport)).hide(); $('#filePickerReady').after($('<div>').html(lang.errorNotSupport)).hide();
@ -155,7 +157,7 @@
return; return;
} }
uploader = _this.uploader = WebUploader.create({ var uploaderOption = {
pick: { pick: {
id: '#filePickerReady', id: '#filePickerReady',
label: lang.uploadSelectFile label: lang.uploadSelectFile
@ -165,8 +167,29 @@
fileVal: editor.getOpt('fileFieldName'), fileVal: editor.getOpt('fileFieldName'),
duplicate: true, duplicate: true,
fileSingleSizeLimit: fileMaxSize, fileSingleSizeLimit: fileMaxSize,
headers: editor.getOpt('serverHeaders') || {},
compress: false compress: false
}); };
if(editor.getOpt('uploadServiceEnable')) {
uploaderOption.customUpload = function (file, callback) {
editor.getOpt('uploadServiceUpload')('attachment', file, {
success: function( res ) {
callback.onSuccess(file, {_raw:JSON.stringify(res)});
},
error: function( err ) {
callback.onError(file, err);
},
progress: function( percent ) {
callback.onProgress(file, percent);
}
}, {
from: 'attachment'
});
};
}
uploader = _this.uploader = WebUploader.create(uploaderOption);
uploader.addButton({ uploader.addButton({
id: '#filePickerBlock' id: '#filePickerBlock'
}); });
@ -218,9 +241,9 @@
showError(file.statusText); showError(file.statusText);
} else { } else {
$wrap.text(lang.uploadPreview); $wrap.text(lang.uploadPreview);
if ('|png|jpg|jpeg|bmp|gif|'.indexOf('|'+file.ext.toLowerCase()+'|') == -1) { if ('|png|jpg|jpeg|bmp|gif|'.indexOf('|' + file.ext.toLowerCase() + '|') == -1) {
$wrap.empty().addClass('notimage').append('<i class="file-preview file-type-' + file.ext.toLowerCase() + '"></i>' + $wrap.empty().addClass('notimage').append('<i class="file-preview file-type-' + file.ext.toLowerCase() + '"></i>' +
'<span class="file-title" title="' + file.name + '">' + file.name + '</span>'); '<span class="file-title" title="' + file.name + '">' + file.name + '</span>');
} else { } else {
if (browser.ie && browser.version <= 7) { if (browser.ie && browser.version <= 7) {
$wrap.text(lang.uploadNoPreview); $wrap.text(lang.uploadNoPreview);
@ -238,7 +261,7 @@
}, thumbnailWidth, thumbnailHeight); }, thumbnailWidth, thumbnailHeight);
} }
} }
percentages[ file.id ] = [ file.size, 0 ]; percentages[file.id] = [file.size, 0];
file.rotation = 0; file.rotation = 0;
/* 检查文件格式 */ /* 检查文件格式 */
@ -258,11 +281,11 @@
// 成功 // 成功
if (cur === 'error' || cur === 'invalid') { if (cur === 'error' || cur === 'invalid') {
showError(file.statusText); showError(file.statusText);
percentages[ file.id ][ 1 ] = 1; percentages[file.id][1] = 1;
} else if (cur === 'interrupt') { } else if (cur === 'interrupt') {
showError('interrupt'); showError('interrupt');
} else if (cur === 'queued') { } else if (cur === 'queued') {
percentages[ file.id ][ 1 ] = 0; percentages[file.id][1] = 0;
} else if (cur === 'progress') { } else if (cur === 'progress') {
$info.hide(); $info.hide();
$prgress.css('display', 'block'); $prgress.css('display', 'block');
@ -315,7 +338,7 @@
// 负责view的销毁 // 负责view的销毁
function removeFile(file) { function removeFile(file) {
var $li = $('#' + file.id); var $li = $('#' + file.id);
delete percentages[ file.id ]; delete percentages[file.id];
updateTotalProgress(); updateTotalProgress();
$li.off().find('.file-panel').off().end().remove(); $li.off().find('.file-panel').off().end().remove();
} }
@ -327,8 +350,8 @@
percent; percent;
$.each(percentages, function (k, v) { $.each(percentages, function (k, v) {
total += v[ 0 ]; total += v[0];
loaded += v[ 0 ] * v[ 1 ]; loaded += v[0] * v[1];
}); });
percent = total ? loaded / total : 0; percent = total ? loaded / total : 0;
@ -354,7 +377,8 @@
$queue.addClass('element-invisible'); $queue.addClass('element-invisible');
$statusBar.addClass('element-invisible'); $statusBar.addClass('element-invisible');
$placeHolder.removeClass('element-invisible'); $placeHolder.removeClass('element-invisible');
$progress.hide(); $info.hide(); $progress.hide();
$info.hide();
uploader.refresh(); uploader.refresh();
break; break;
@ -363,25 +387,29 @@
$placeHolder.addClass('element-invisible'); $placeHolder.addClass('element-invisible');
$queue.removeClass('element-invisible'); $queue.removeClass('element-invisible');
$statusBar.removeClass('element-invisible'); $statusBar.removeClass('element-invisible');
$progress.hide(); $info.show(); $progress.hide();
$info.show();
$upload.text(lang.uploadStart); $upload.text(lang.uploadStart);
uploader.refresh(); uploader.refresh();
break; break;
/* 上传中 */ /* 上传中 */
case 'uploading': case 'uploading':
$progress.show(); $info.hide(); $progress.show();
$info.hide();
$upload.text(lang.uploadPause); $upload.text(lang.uploadPause);
break; break;
/* 暂停上传 */ /* 暂停上传 */
case 'paused': case 'paused':
$progress.show(); $info.hide(); $progress.show();
$info.hide();
$upload.text(lang.uploadContinue); $upload.text(lang.uploadContinue);
break; break;
case 'confirm': case 'confirm':
$progress.show(); $info.hide(); $progress.show();
$info.hide();
$upload.text(lang.uploadStart); $upload.text(lang.uploadStart);
stats = uploader.getStats(); stats = uploader.getStats();
@ -392,7 +420,8 @@
break; break;
case 'finish': case 'finish':
$progress.hide(); $info.show(); $progress.hide();
$info.show();
if (stats.uploadFailNum) { if (stats.uploadFailNum) {
$upload.text(lang.uploadRetry); $upload.text(lang.uploadRetry);
} else { } else {
@ -426,9 +455,7 @@
} }
} else { } else {
stats = uploader.getStats(); stats = uploader.getStats();
text = lang.updateStatusFinish.replace('_', fileCount). text = lang.updateStatusFinish.replace('_', fileCount).replace('_KB', WebUploader.formatSize(fileSize)).replace('_', stats.successNum);
replace('_KB', WebUploader.formatSize(fileSize)).
replace('_', stats.successNum);
if (stats.uploadFailNum) { if (stats.uploadFailNum) {
text += lang.updateStatusError.replace('_', stats.uploadFailNum); text += lang.updateStatusError.replace('_', stats.uploadFailNum);
@ -477,7 +504,7 @@
case 'startUpload': case 'startUpload':
/* 添加额外的GET参数 */ /* 添加额外的GET参数 */
var params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '', var params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '',
url = utils.formatUrl(actionUrl + (actionUrl.indexOf('?') == -1 ? '?':'&') + 'encode=utf-8&' + params); url = utils.formatUrl(actionUrl + (actionUrl.indexOf('?') == -1 ? '?' : '&') + 'encode=utf-8&' + params);
uploader.option('server', url); uploader.option('server', url);
setState('uploading', files); setState('uploading', files);
break; break;
@ -499,7 +526,7 @@
$percent = $li.find('.progress span'); $percent = $li.find('.progress span');
$percent.css('width', percentage * 100 + '%'); $percent.css('width', percentage * 100 + '%');
percentages[ file.id ][ 1 ] = percentage; percentages[file.id][1] = percentage;
updateTotalProgress(); updateTotalProgress();
}); });
@ -508,9 +535,15 @@
try { try {
var responseText = (ret._raw || ret), var responseText = (ret._raw || ret),
json = utils.str2json(responseText); json = utils.str2json(responseText);
json = editor.getOpt('serverResponsePrepare')(json);
if (json.state == 'SUCCESS') { if (json.state == 'SUCCESS') {
_this.fileList.push(json); _this.fileList.push(json);
$file.append('<span class="success"></span>'); $file.append('<span class="success"></span>');
// 触发上传附件事件
editor.fireEvent("uploadsuccess", {
res: json,
type: 'file'
});
} else { } else {
$file.find('.error').text(json.state).show(); $file.find('.error').text(json.state).show();
} }
@ -521,9 +554,11 @@
uploader.on('uploadError', function (file, code) { uploader.on('uploadError', function (file, code) {
}); });
uploader.on('error', function (code, file) { uploader.on('error', function (code, param1, param2) {
if (code == 'Q_TYPE_DENIED' || code == 'F_EXCEED_SIZE') { if (code === 'F_EXCEED_SIZE') {
addFile(file); editor.getOpt('tipError')(lang.errorExceedSize + ' ' + (param1 / 1024 / 1024).toFixed(1) + 'MB');
} else {
console.log('error', code, param1, param2);
} }
}); });
uploader.on('uploadComplete', function (file, ret) { uploader.on('uploadComplete', function (file, ret) {
@ -548,7 +583,7 @@
}, },
getQueueCount: function () { getQueueCount: function () {
var file, i, status, readyFile = 0, files = this.uploader.getFiles(); var file, i, status, readyFile = 0, files = this.uploader.getFiles();
for (i = 0; file = files[i++]; ) { for (i = 0; file = files[i++];) {
status = file.getStatus(); status = file.getStatus();
if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++; if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++;
} }
@ -575,6 +610,7 @@
this.container = utils.isString(target) ? document.getElementById(target) : target; this.container = utils.isString(target) ? document.getElementById(target) : target;
this.init(); this.init();
} }
OnlineFile.prototype = { OnlineFile.prototype = {
init: function () { init: function () {
this.initContainer(); this.initContainer();
@ -598,7 +634,7 @@
var _this = this; var _this = this;
/* 滚动拉取图片 */ /* 滚动拉取图片 */
domUtils.on($G('fileList'), 'scroll', function(e){ domUtils.on($G('fileList'), 'scroll', function (e) {
var panel = this; var panel = this;
if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) { if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) {
_this.getFileData(); _this.getFileData();
@ -634,14 +670,15 @@
getFileData: function () { getFileData: function () {
var _this = this; var _this = this;
if(!_this.listEnd && !this.isLoadingData) { if (!_this.listEnd && !this.isLoadingData) {
this.isLoadingData = true; this.isLoadingData = true;
ajax.request(editor.getActionUrl(editor.getOpt('fileManagerActionName')), { ajax.request(editor.getActionUrl(editor.getOpt('fileManagerActionName')), {
timeout: 100000, timeout: 100000,
data: utils.extend({ data: utils.extend({
start: this.listIndex, start: this.listIndex,
size: this.listSize size: this.listSize
}, editor.queryCommandValue('serverparam')), }, editor.queryCommandValue('serverparam')),
headers: editor.options.serverHeaders || {},
method: 'get', method: 'get',
onsuccess: function (r) { onsuccess: function (r) {
try { try {
@ -649,13 +686,13 @@
if (json.state == 'SUCCESS') { if (json.state == 'SUCCESS') {
_this.pushData(json.list); _this.pushData(json.list);
_this.listIndex = parseInt(json.start) + parseInt(json.list.length); _this.listIndex = parseInt(json.start) + parseInt(json.list.length);
if(_this.listIndex >= json.total) { if (_this.listIndex >= json.total) {
_this.listEnd = true; _this.listEnd = true;
} }
_this.isLoadingData = false; _this.isLoadingData = false;
} }
} catch (e) { } catch (e) {
if(r.responseText.indexOf('ue_separate_ue') != -1) { if (r.responseText.indexOf('ue_separate_ue') != -1) {
var list = r.responseText.split(r.responseText); var list = r.responseText.split(r.responseText);
_this.pushData(list); _this.pushData(list);
_this.listIndex = parseInt(list.length); _this.listIndex = parseInt(list.length);
@ -675,24 +712,24 @@
var i, item, img, filetype, preview, icon, _this = this, var i, item, img, filetype, preview, icon, _this = this,
urlPrefix = editor.getOpt('fileManagerUrlPrefix'); urlPrefix = editor.getOpt('fileManagerUrlPrefix');
for (i = 0; i < list.length; i++) { for (i = 0; i < list.length; i++) {
if(list[i] && list[i].url) { if (list[i] && list[i].url) {
item = document.createElement('li'); item = document.createElement('li');
icon = document.createElement('span'); icon = document.createElement('span');
filetype = list[i].url.substr(list[i].url.lastIndexOf('.') + 1); filetype = list[i].url.substr(list[i].url.lastIndexOf('.') + 1);
if ( "png|jpg|jpeg|gif|bmp".indexOf(filetype) != -1 ) { if ("png|jpg|jpeg|gif|bmp".indexOf(filetype) != -1) {
preview = document.createElement('img'); preview = document.createElement('img');
domUtils.on(preview, 'load', (function(image){ domUtils.on(preview, 'load', (function (image) {
return function(){ return function () {
_this.scale(image, image.parentNode.offsetWidth, image.parentNode.offsetHeight); _this.scale(image, image.parentNode.offsetWidth, image.parentNode.offsetHeight);
}; };
})(preview)); })(preview));
preview.width = 113; preview.width = 113;
preview.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=':'&noCache=') + (+new Date()).toString(36) ); preview.setAttribute('src', urlPrefix + list[i].url + (list[i].url.indexOf('?') == -1 ? '?noCache=' : '&noCache=') + (+new Date()).toString(36));
} else { } else {
var ic = document.createElement('i'), var ic = document.createElement('i'),
textSpan = document.createElement('span'); textSpan = document.createElement('span');
textSpan.innerHTML = list[i].url.substr(list[i].url.lastIndexOf('/') + 1); textSpan.innerHTML = list[i].original || list[i].url.substr(list[i].url.lastIndexOf('/') + 1);
preview = document.createElement('div'); preview = document.createElement('div');
preview.appendChild(ic); preview.appendChild(ic);
preview.appendChild(textSpan); preview.appendChild(textSpan);

Binary file not shown.

Before

Width:  |  Height:  |  Size: 923 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 841 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1012 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 949 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 950 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 986 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1001 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 996 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1001 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1009 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1007 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 970 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1005 B

View File

@ -0,0 +1,818 @@
@charset "utf-8";
.wrapper {
width: 570px;
_width: 575px;
margin: 10px auto;
zoom: 1;
position: relative
}
.tabbody {
height: 355px;
}
.tabbody .panel {
position: absolute;
width: 0;
height: 0;
background: #fff;
overflow: hidden;
display: none;
}
.tabbody .panel.focus {
width: 100%;
height: 355px;
display: block;
}
.tabbody .panel table td {
vertical-align: middle;
}
#audioUrl {
width: 380px;
height: 26px;
line-height: 26px;
margin: 8px 5px;
background: #FFF;
border: 1px solid #d7d7d7;
outline: none;
border-radius: 3px;
padding: 0 5px;
}
#audioSelect {
width: 100px;
display: inline-block;
background: #FFF;
border: 1px solid #EEE;
line-height: 26px;
text-align: center;
color: #333;
text-decoration: none;
border-radius: 3px;
vertical-align: middle;
}
#audioSearchTxt {
margin-left: 15px;
background: #FFF;
width: 200px;
height: 21px;
line-height: 21px;
border: 1px solid #d7d7d7;
}
#searchList {
width: 570px;
overflow: auto;
zoom: 1;
height: 270px;
}
#searchList div {
float: left;
width: 120px;
height: 135px;
margin: 5px 15px;
}
#searchList img {
margin: 2px 8px;
cursor: pointer;
border: 2px solid #fff
}
/*不用缩略图*/
#searchList p {
margin-left: 10px;
}
#audioType {
width: 65px;
height: 23px;
line-height: 22px;
border: 1px solid #d7d7d7;
}
#audioSearchBtn, #audioSearchReset {
/*width: 80px;*/
height: 25px;
line-height: 25px;
background: #eee;
border: 1px solid #d7d7d7;
cursor: pointer;
padding: 0 5px;
}
#preview {
position: relative;
width: 420px;
padding: 0;
overflow: hidden;
margin-left: 10px;
_margin-left: 5px;
height: 280px;
background-color: #ddd;
float: left
}
#preview .previewMsg {
position: absolute;
top: 0;
margin: 0;
padding: 0;
height: 280px;
width: 100%;
background-color: #666;
}
#preview .previewMsg span {
display: block;
margin: 125px auto 0 auto;
text-align: center;
font-size: 18px;
color: #fff;
}
#preview .previewaudio {
position: absolute;
top: 0;
margin: 0;
padding: 0;
height: 280px;
width: 100%;
}
.edui-audio-wrapper fieldset {
border: 1px solid #ddd;
padding-left: 5px;
margin-bottom: 20px;
padding-bottom: 5px;
width: 115px;
}
#audioInfo {
width: 120px;
float: left;
margin-left: 10px;
_margin-left: 7px;
}
fieldset {
border: 1px solid #ddd;
padding-left: 5px;
margin-bottom: 20px;
padding-bottom: 5px;
width: 115px;
}
fieldset legend {
font-weight: bold;
}
fieldset p {
line-height: 30px;
}
fieldset input.txt {
width: 65px;
height: 21px;
line-height: 21px;
margin: 8px 5px;
background: #FFF;
border: 1px solid #d7d7d7;
}
label.url {
font-weight: bold;
margin-left: 5px;
}
#audioFloat div {
cursor: pointer;
opacity: 0.5;
filter: alpha(opacity=50);
margin: 9px;
_margin: 5px;
width: 38px;
height: 36px;
float: left;
}
#audioFloat .focus {
opacity: 1;
filter: alpha(opacity=100)
}
span.view {
display: inline-block;
width: 30px;
float: right;
cursor: pointer;
color: blue
}
/* upload audio */
.tabbody #upload.panel {
width: 0;
height: 0;
overflow: hidden;
position: absolute !important;
clip: rect(1px, 1px, 1px, 1px);
background: #fff;
display: block;
}
.tabbody #upload.panel.focus {
width: 100%;
height: 335px;
display: block;
clip: auto;
}
#upload_alignment div {
cursor: pointer;
opacity: 0.5;
filter: alpha(opacity=50);
margin: 9px;
_margin: 5px;
width: 38px;
height: 36px;
float: left;
}
#upload_alignment .focus {
opacity: 1;
filter: alpha(opacity=100)
}
#upload_left {
width: 427px;
float: left;
}
#upload_left .controller {
height: 30px;
clear: both;
}
#uploadaudioInfo {
margin-top: 10px;
float: right;
padding-right: 8px;
}
#upload .queueList {
margin: 0;
}
#upload p {
margin: 0;
}
.element-invisible {
width: 0 !important;
height: 0 !important;
border: 0;
padding: 0;
margin: 0;
overflow: hidden;
position: absolute !important;
clip: rect(1px, 1px, 1px, 1px);
}
#upload .placeholder {
margin: 10px;
margin-right: 0;
border: 2px dashed #e6e6e6;
*border: 0px dashed #e6e6e6;
height: 161px;
padding-top: 150px;
text-align: center;
width: 97%;
float: left;
background: url(./images/image.png) center 70px no-repeat;
color: #cccccc;
font-size: 18px;
position: relative;
top: 0;
*margin-left: 0;
*left: 10px;
}
#upload .placeholder .webuploader-pick {
font-size: 18px;
background: #00b7ee;
border-radius: 3px;
line-height: 44px;
padding: 0 30px;
*width: 120px;
color: #fff;
display: inline-block;
margin: 0 auto 20px auto;
cursor: pointer;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}
#upload .placeholder .webuploader-pick-hover {
background: #00a2d4;
}
#filePickerContainer {
text-align: center;
}
#upload .placeholder .flashTip {
color: #666666;
font-size: 12px;
position: absolute;
width: 100%;
text-align: center;
bottom: 20px;
}
#upload .placeholder .flashTip a {
color: #0785d1;
text-decoration: none;
}
#upload .placeholder .flashTip a:hover {
text-decoration: underline;
}
#upload .placeholder.webuploader-dnd-over {
border-color: #999999;
}
#upload .filelist {
list-style: none;
margin: 0;
padding: 0;
overflow-x: hidden;
overflow-y: auto;
position: relative;
height: 285px;
}
#upload .filelist:after {
content: '';
display: block;
width: 0;
height: 0;
overflow: hidden;
clear: both;
}
#upload .filelist li {
width: 113px;
height: 113px;
background: url(./images/bg.png);
text-align: center;
margin: 15px 0 0 20px;
*margin: 15px 0 0 15px;
position: relative;
display: block;
float: left;
overflow: hidden;
font-size: 12px;
}
#upload .filelist li p.log {
position: relative;
top: -45px;
}
#upload .filelist li p.title {
position: absolute;
top: 0;
left: 0;
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
top: 5px;
text-indent: 5px;
text-align: left;
}
#upload .filelist li p.progress {
position: absolute;
width: 100%;
bottom: 0;
left: 0;
height: 8px;
overflow: hidden;
z-index: 50;
margin: 0;
border-radius: 0;
background: none;
-webkit-box-shadow: 0 0 0;
}
#upload .filelist li p.progress span {
display: none;
overflow: hidden;
width: 0;
height: 100%;
background: #1483d8 url(./images/progress.png) repeat-x;
-webit-transition: width 200ms linear;
-moz-transition: width 200ms linear;
-o-transition: width 200ms linear;
-ms-transition: width 200ms linear;
transition: width 200ms linear;
-webkit-animation: progressmove 2s linear infinite;
-moz-animation: progressmove 2s linear infinite;
-o-animation: progressmove 2s linear infinite;
-ms-animation: progressmove 2s linear infinite;
animation: progressmove 2s linear infinite;
-webkit-transform: translateZ(0);
}
@-webkit-keyframes progressmove {
0% {
background-position: 0 0;
}
100% {
background-position: 17px 0;
}
}
@-moz-keyframes progressmove {
0% {
background-position: 0 0;
}
100% {
background-position: 17px 0;
}
}
@keyframes progressmove {
0% {
background-position: 0 0;
}
100% {
background-position: 17px 0;
}
}
#upload .filelist li p.imgWrap {
position: relative;
z-index: 2;
line-height: 113px;
vertical-align: middle;
overflow: hidden;
width: 113px;
height: 113px;
-webkit-transform-origin: 50% 50%;
-moz-transform-origin: 50% 50%;
-o-transform-origin: 50% 50%;
-ms-transform-origin: 50% 50%;
transform-origin: 50% 50%;
-webit-transition: 200ms ease-out;
-moz-transition: 200ms ease-out;
-o-transition: 200ms ease-out;
-ms-transition: 200ms ease-out;
transition: 200ms ease-out;
}
#upload .filelist li p.imgWrap.notimage {
margin-top: 0;
width: 111px;
height: 111px;
border: 1px #eeeeee solid;
}
#upload .filelist li p.imgWrap.notimage i.file-preview {
margin-top: 15px;
}
#upload .filelist li img {
width: 100%;
}
#upload .filelist li p.error {
background: #f43838;
color: #fff;
position: absolute;
bottom: 0;
left: 0;
height: 28px;
line-height: 28px;
width: 100%;
z-index: 100;
display: none;
}
#upload .filelist li .success {
display: block;
position: absolute;
left: 0;
bottom: 0;
height: 40px;
width: 100%;
z-index: 200;
background: url(./images/success.png) no-repeat right bottom;
background-image: url(./images/success.gif) \9;
}
#upload .filelist li.filePickerBlock {
width: 113px;
height: 113px;
background: url(./images/image.png) no-repeat center 12px;
border: 1px solid #eeeeee;
border-radius: 0;
}
#upload .filelist li.filePickerBlock div.webuploader-pick {
width: 100%;
height: 100%;
margin: 0;
padding: 0;
opacity: 0;
background: none;
font-size: 0;
}
#upload .filelist div.file-panel {
position: absolute;
height: 0;
filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#80000000', endColorstr='#80000000') \0;
background: rgba(0, 0, 0, 0.5);
width: 100%;
top: 0;
left: 0;
overflow: hidden;
z-index: 300;
}
#upload .filelist div.file-panel span {
width: 24px;
height: 24px;
display: inline;
float: right;
text-indent: -9999px;
overflow: hidden;
background: url(./images/icons.png) no-repeat;
background: url(./images/icons.gif) no-repeat \9;
margin: 5px 1px 1px;
cursor: pointer;
-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
#upload .filelist div.file-panel span.rotateLeft {
display: none;
background-position: 0 -24px;
}
#upload .filelist div.file-panel span.rotateLeft:hover {
background-position: 0 0;
}
#upload .filelist div.file-panel span.rotateRight {
display: none;
background-position: -24px -24px;
}
#upload .filelist div.file-panel span.rotateRight:hover {
background-position: -24px 0;
}
#upload .filelist div.file-panel span.cancel {
background-position: -48px -24px;
}
#upload .filelist div.file-panel span.cancel:hover {
background-position: -48px 0;
}
#upload .statusBar {
height: 45px;
border-bottom: 1px solid #dadada;
margin: 0 10px;
padding: 0;
line-height: 45px;
vertical-align: middle;
position: relative;
}
#upload .statusBar .progress {
border: 1px solid #1483d8;
width: 198px;
background: #fff;
height: 18px;
position: absolute;
top: 12px;
display: none;
text-align: center;
line-height: 18px;
color: #6dbfff;
margin: 0 10px 0 0;
}
#upload .statusBar .progress span.percentage {
width: 0;
height: 100%;
left: 0;
top: 0;
background: #1483d8;
position: absolute;
}
#upload .statusBar .progress span.text {
position: relative;
z-index: 10;
}
#upload .statusBar .info {
display: inline-block;
font-size: 14px;
color: #666666;
}
#upload .statusBar .btns {
position: absolute;
top: 7px;
right: 0;
line-height: 30px;
}
#filePickerBtn {
display: inline-block;
float: left;
}
#upload .statusBar .btns .webuploader-pick,
#upload .statusBar .btns .uploadBtn,
#upload .statusBar .btns .uploadBtn.state-uploading,
#upload .statusBar .btns .uploadBtn.state-paused {
background: #ffffff;
border: 1px solid #cfcfcf;
color: #565656;
padding: 0 18px;
display: inline-block;
border-radius: 3px;
margin-left: 10px;
cursor: pointer;
font-size: 14px;
float: left;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
#upload .statusBar .btns .webuploader-pick-hover,
#upload .statusBar .btns .uploadBtn:hover,
#upload .statusBar .btns .uploadBtn.state-uploading:hover,
#upload .statusBar .btns .uploadBtn.state-paused:hover {
background: #f0f0f0;
}
#upload .statusBar .btns .uploadBtn,
#upload .statusBar .btns .uploadBtn.state-paused {
background: #00b7ee;
color: #fff;
border-color: transparent;
}
#upload .statusBar .btns .uploadBtn:hover,
#upload .statusBar .btns .uploadBtn.state-paused:hover {
background: #00a2d4;
}
#upload .statusBar .btns .uploadBtn.disabled {
pointer-events: none;
filter: alpha(opacity=60);
-moz-opacity: 0.6;
-khtml-opacity: 0.6;
opacity: 0.6;
}
/* 在线文件的文件预览图标 */
i.file-preview {
display: block;
margin: 10px auto;
width: 70px;
height: 70px;
background-image: url("./images/file-icons.png");
background-image: url("./images/file-icons.gif") \9;
background-position: -140px center;
background-repeat: no-repeat;
}
i.file-preview.file-type-dir {
background-position: 0 center;
}
i.file-preview.file-type-file {
background-position: -140px center;
}
i.file-preview.file-type-filelist {
background-position: -210px center;
}
i.file-preview.file-type-zip,
i.file-preview.file-type-rar,
i.file-preview.file-type-7z,
i.file-preview.file-type-tar,
i.file-preview.file-type-gz,
i.file-preview.file-type-bz2 {
background-position: -280px center;
}
i.file-preview.file-type-xls,
i.file-preview.file-type-xlsx {
background-position: -350px center;
}
i.file-preview.file-type-doc,
i.file-preview.file-type-docx {
background-position: -420px center;
}
i.file-preview.file-type-ppt,
i.file-preview.file-type-pptx {
background-position: -490px center;
}
i.file-preview.file-type-vsd {
background-position: -560px center;
}
i.file-preview.file-type-pdf {
background-position: -630px center;
}
i.file-preview.file-type-txt,
i.file-preview.file-type-md,
i.file-preview.file-type-json,
i.file-preview.file-type-htm,
i.file-preview.file-type-xml,
i.file-preview.file-type-html,
i.file-preview.file-type-js,
i.file-preview.file-type-css,
i.file-preview.file-type-php,
i.file-preview.file-type-jsp,
i.file-preview.file-type-asp {
background-position: -700px center;
}
i.file-preview.file-type-apk {
background-position: -770px center;
}
i.file-preview.file-type-exe {
background-position: -840px center;
}
i.file-preview.file-type-ipa {
background-position: -910px center;
}
i.file-preview.file-type-mp4,
i.file-preview.file-type-swf,
i.file-preview.file-type-mkv,
i.file-preview.file-type-avi,
i.file-preview.file-type-flv,
i.file-preview.file-type-mov,
i.file-preview.file-type-mpg,
i.file-preview.file-type-mpeg,
i.file-preview.file-type-ogv,
i.file-preview.file-type-webm,
i.file-preview.file-type-rm,
i.file-preview.file-type-rmvb {
background-position: -980px center;
}
i.file-preview.file-type-ogg,
i.file-preview.file-type-wav,
i.file-preview.file-type-wmv,
i.file-preview.file-type-mid,
i.file-preview.file-type-mp3 {
background-position: -1050px center;
}
i.file-preview.file-type-jpg,
i.file-preview.file-type-jpeg,
i.file-preview.file-type-gif,
i.file-preview.file-type-bmp,
i.file-preview.file-type-png,
i.file-preview.file-type-psd {
background-position: -140px center;
}

View File

@ -0,0 +1,83 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" src="../internal.js?aea0c61c"></script>
<link rel="stylesheet" type="text/css" href="audio.css?c75591bc"/>
</head>
<body>
<div class="wrapper">
<div id="audioTab">
<div id="tabHeads" class="tabhead">
<span tabSrc="audio" class="focus" data-content-id="audio"><var id="lang_tab_insertV"></var></span>
<span tabSrc="upload" style="display:none;" data-content-id="upload"><var
id="lang_tab_uploadV"></var></span>
</div>
<div id="tabBodys" class="tabbody">
<div id="audio" class="panel focus">
<table>
<tr>
<td><label for="audioUrl" class="url"><var id="lang_audio_url"></var></label></td>
<td><input id="audioUrl" type="text"><a href="javascript:;" id="audioSelect"
style="display:none;">选择音频</a></td>
</tr>
</table>
<div style="padding:0 5px 5px 5px;color:#999;">
外链音频支持MP3格式
</div>
<div id="preview"></div>
<div id="audioInfo">
<fieldset>
<legend><var id="lang_alignment"></var></legend>
<div id="audioFloat"></div>
</fieldset>
</div>
</div>
<div id="upload" class="panel">
<div id="upload_left">
<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="uploadaudioInfo">
<fieldset>
<legend><var id="lang_upload_alignment"></var></legend>
<div id="upload_alignment"></div>
</fieldset>
</div>
</div>
</div>
</div>
</div>
<!-- jquery -->
<script type="text/javascript" src="../../third-party/jquery-1.10.2.js?628072e7"></script>
<!-- webuploader -->
<script type="text/javascript" src="../../third-party/webuploader/webuploader.js?21e72664"></script>
<link rel="stylesheet" type="text/css" href="../../third-party/webuploader/webuploader.css?0057c5c7">
<!-- audio -->
<script type="text/javascript" src="audio.js?2d786af4"></script>
</body>
</html>

View File

@ -0,0 +1,805 @@
/**
* Created by JetBrains PhpStorm.
* User: taoqili
* Date: 12-2-20
* Time: 上午11:19
* To change this template use File | Settings | File Templates.
*/
(function () {
var audio = {},
uploadaudioList = [],
isModifyUploadaudio = false,
uploadFile;
var editorOpt = {};
window.onload = function () {
editorOpt = editor.getOpt('audioConfig');
$focus($G("audioUrl"));
initTabs();
initAudio();
initUpload();
};
/* 初始化tab标签 */
function initTabs() {
var tabs = $G('tabHeads').children;
for (var i = 0; i < tabs.length; i++) {
domUtils.on(tabs[i], "click", function (e) {
var j, bodyId, target = e.target || e.srcElement;
for (j = 0; j < tabs.length; j++) {
bodyId = tabs[j].getAttribute('data-content-id');
if (tabs[j] == target) {
domUtils.addClass(tabs[j], 'focus');
domUtils.addClass($G(bodyId), 'focus');
} else {
domUtils.removeClasses(tabs[j], 'focus');
domUtils.removeClasses($G(bodyId), 'focus');
}
}
});
}
if (!editorOpt.disableUpload) {
$G('tabHeads').querySelector('[data-content-id="upload"]').style.display = 'inline-block';
}
if (!!editorOpt.selectCallback) {
$G('audioSelect').style.display = 'inline-block';
domUtils.on($G('audioSelect'), "click", function (e) {
editorOpt.selectCallback(editor, function (info) {
if (info) {
$G('audioUrl').value = info.path;
createPreview(info.path);
}
});
});
}
}
function initAudio() {
createAlignButton(["audioFloat", "upload_alignment"]);
addUrlChangeListener($G("audioUrl"));
addOkListener();
//编辑视频时初始化相关信息
(function () {
var img = editor.selection.getRange().getClosedNode(), url;
if (img && img.className) {
var hasFakedClass = (img.className == "edui-faked-audio"),
hasUploadClass = img.className.indexOf("edui-upload-audio") != -1;
if (hasFakedClass || hasUploadClass) {
$G("audioUrl").value = url = img.getAttribute("_url");
var align = domUtils.getComputedStyle(img, "float"),
parentAlign = domUtils.getComputedStyle(img.parentNode, "text-align");
updateAlignButton(parentAlign === "center" ? "center" : align);
}
if (hasUploadClass) {
isModifyUploadaudio = true;
}
}
createPreview(url);
})();
}
/**
* 监听确认和取消两个按钮事件用户执行插入或者清空正在播放的视频实例操作
*/
function addOkListener() {
dialog.onok = function () {
$G("preview").innerHTML = "";
var currentTab = findFocus("tabHeads", "tabSrc");
switch (currentTab) {
case "audio":
return insertSingle();
break;
// case "audioSearch":
// return insertSearch("searchList");
// break;
case "upload":
return insertUpload();
break;
}
};
dialog.oncancel = function () {
$G("preview").innerHTML = "";
};
}
/**
* 依据传入的align值更新按钮信息
* @param align
*/
function updateAlignButton(align) {
var aligns = $G("audioFloat").children;
for (var i = 0, ci; ci = aligns[i++];) {
if (ci.getAttribute("name") == align) {
if (ci.className != "focus") {
ci.className = "focus";
}
} else {
if (ci.className == "focus") {
ci.className = "";
}
}
}
}
/**
* 将单个视频信息插入编辑器中
*/
function insertSingle() {
var url = $G('audioUrl').value,
align = findFocus("audioFloat", "name");
if (!url) return false;
editor.execCommand('insertaudio', {
url: url,
}, isModifyUploadaudio ? 'upload' : null);
}
/**
* 将元素id下的所有代表视频的图片插入编辑器中
* @param id
*/
function insertSearch(id) {
var imgs = domUtils.getElementsByTagName($G(id), "img"),
audioObjs = [];
for (var i = 0, img; img = imgs[i++];) {
if (img.getAttribute("selected")) {
audioObjs.push({
url: img.getAttribute("ue_audio_url"),
width: 420,
height: 280,
align: "none"
});
}
}
editor.execCommand('insertaudio', audioObjs);
}
/**
* 找到id下具有focus类的节点并返回该节点下的某个属性
* @param id
* @param returnProperty
*/
function findFocus(id, returnProperty) {
var tabs = $G(id).children,
property;
for (var i = 0, ci; ci = tabs[i++];) {
if (ci.className == "focus") {
property = ci.getAttribute(returnProperty);
break;
}
}
return property;
}
/**
* 数字判断
* @param value
*/
function isNumber(value) {
return /(0|^[1-9]\d*$)/.test(value);
}
/**
* 创建图片浮动选择按钮
* @param ids
*/
function createAlignButton(ids) {
for (var i = 0, ci; ci = ids[i++];) {
var floatContainer = $G(ci),
nameMaps = {
"none": lang['default'],
"left": lang.floatLeft,
"right": lang.floatRight,
"center": lang.block
};
for (var j in nameMaps) {
var div = document.createElement("div");
div.setAttribute("name", j);
if (j == "none") div.className = "focus";
div.style.cssText = "background:url(images/" + j + "_focus.jpg);";
div.setAttribute("title", nameMaps[j]);
floatContainer.appendChild(div);
}
switchSelect(ci);
}
}
/**
* 选择切换
* @param selectParentId
*/
function switchSelect(selectParentId) {
var selects = $G(selectParentId).children;
for (var i = 0, ci; ci = selects[i++];) {
domUtils.on(ci, "click", function () {
for (var j = 0, cj; cj = selects[j++];) {
cj.className = "";
cj.removeAttribute && cj.removeAttribute("class");
}
this.className = "focus";
})
}
}
/**
* 监听url改变事件
* @param url
*/
function addUrlChangeListener(url) {
if (browser.ie) {
url.onpropertychange = function () {
createPreview(this.value);
}
} else {
url.addEventListener("input", function () {
createPreview(this.value);
}, false);
}
}
function createAudioHtml(url, param) {
param = param || {};
var str = [
"<audio",
(param.id ? ' id="' + param.id + '"' : ""),
(param.cls ? ' class="' + param.cls + '"' : ''),
' controls >',
'<source src="' + url + '" type="audio/mpeg' + '" />',
'</audio>',
];
return str.join('');
}
/**
* 根据url生成视频预览
* @param url
*/
function createPreview(url) {
if (!url) {
return;
}
$G("preview").innerHTML = '<div class="previewMsg"><span>' + lang.urlError + '</span></div>' +
'<div style="position: absolute; inset: 0; background: #FFF; text-align: center; display: flex; justify-items: center; align-items: center;">' +
'<div style="text-align:center;flex-grow:1;">' + createAudioHtml(url) + '</div>'
+ '</div>';
}
/* 插入上传视频 */
function insertUpload() {
var audioObjs = [],
uploadDir = editor.getOpt('audioUrlPrefix'),
align = findFocus("upload_alignment", "name") || 'none';
for (var key in uploadaudioList) {
var file = uploadaudioList[key];
audioObjs.push({
url: uploadDir + file.url,
align: align
});
}
var count = uploadFile.getQueueCount();
if (count) {
$('.info', '#queueList').html('<span style="color:red;">' + '还有2个未上传文件'.replace(/[\d]/, count) + '</span>');
return false;
} else {
editor.execCommand('insertaudio', audioObjs, 'upload');
}
}
/*初始化上传标签*/
function initUpload() {
uploadFile = new UploadFile('queueList');
}
/* 上传附件 */
function UploadFile(target) {
this.$wrap = target.constructor == String ? $('#' + target) : $(target);
this.init();
}
UploadFile.prototype = {
init: function () {
this.fileList = [];
this.initContainer();
this.initUploader();
},
initContainer: function () {
this.$queue = this.$wrap.find('.filelist');
},
/* 初始化容器 */
initUploader: function () {
var _this = this,
$ = jQuery, // just in case. Make sure it's not an other libaray.
$wrap = _this.$wrap,
// 图片容器
$queue = $wrap.find('.filelist'),
// 状态栏,包括进度和控制按钮
$statusBar = $wrap.find('.statusBar'),
// 文件总体选择信息。
$info = $statusBar.find('.info'),
// 上传按钮
$upload = $wrap.find('.uploadBtn'),
// 上传按钮
$filePickerBtn = $wrap.find('.filePickerBtn'),
// 上传按钮
$filePickerBlock = $wrap.find('.filePickerBlock'),
// 没选择文件之前的内容。
$placeHolder = $wrap.find('.placeholder'),
// 总体进度条
$progress = $statusBar.find('.progress').hide(),
// 添加的文件数量
fileCount = 0,
// 添加的文件总大小
fileSize = 0,
// 优化retina, 在retina下这个值是2
ratio = window.devicePixelRatio || 1,
// 缩略图大小
thumbnailWidth = 113 * ratio,
thumbnailHeight = 113 * ratio,
// 可能有pedding, ready, uploading, confirm, done.
state = '',
// 所有文件的进度信息key为file id
percentages = {},
supportTransition = (function () {
var s = document.createElement('p').style,
r = 'transition' in s ||
'WebkitTransition' in s ||
'MozTransition' in s ||
'msTransition' in s ||
'OTransition' in s;
s = null;
return r;
})(),
// WebUploader实例
uploader,
actionUrl = editor.getActionUrl(editor.getOpt('audioActionName')),
fileMaxSize = editor.getOpt('audioMaxSize'),
acceptExtensions = (editor.getOpt('audioAllowFiles') || []).join('').replace(/\./g, ',').replace(/^[,]/, '');
;
if (!WebUploader.Uploader.support()) {
$('#filePickerReady').after($('<div>').html(lang.errorNotSupport)).hide();
return;
} else if (!editor.getOpt('audioActionName')) {
$('#filePickerReady').after($('<div>').html(lang.errorLoadConfig)).hide();
return;
}
var uploaderOption = {
pick: {
id: '#filePickerReady',
label: lang.uploadSelectFile
},
swf: '../../third-party/webuploader/Uploader.swf',
server: actionUrl,
fileVal: editor.getOpt('audioFieldName'),
duplicate: true,
fileSingleSizeLimit: fileMaxSize,
headers: editor.getOpt('serverHeaders') || {},
compress: false
};
if(editor.getOpt('uploadServiceEnable')) {
uploaderOption.customUpload = function (file, callback) {
editor.getOpt('uploadServiceUpload')('audio', file, {
success: function( res ) {
callback.onSuccess(file, {_raw:JSON.stringify(res)});
},
error: function( err ) {
callback.onError(file, err);
},
progress: function( percent ) {
callback.onProgress(file, percent);
}
}, {
from: 'audio'
});
};
}
uploader = _this.uploader = WebUploader.create(uploaderOption);
uploader.addButton({
id: '#filePickerBlock'
});
uploader.addButton({
id: '#filePickerBtn',
label: lang.uploadAddFile
});
setState('pedding');
// 当有文件添加进来时执行负责view的创建
function addFile(file) {
var $li = $('<li id="' + file.id + '">' +
'<p class="title">' + file.name + '</p>' +
'<p class="imgWrap"></p>' +
'<p class="progress"><span></span></p>' +
'</li>'),
$btns = $('<div class="file-panel">' +
'<span class="cancel">' + lang.uploadDelete + '</span>' +
'<span class="rotateRight">' + lang.uploadTurnRight + '</span>' +
'<span class="rotateLeft">' + lang.uploadTurnLeft + '</span></div>').appendTo($li),
$prgress = $li.find('p.progress span'),
$wrap = $li.find('p.imgWrap'),
$info = $('<p class="error"></p>').hide().appendTo($li),
showError = function (code) {
switch (code) {
case 'exceed_size':
text = lang.errorExceedSize;
break;
case 'interrupt':
text = lang.errorInterrupt;
break;
case 'http':
text = lang.errorHttp;
break;
case 'not_allow_type':
text = lang.errorFileType;
break;
default:
text = lang.errorUploadRetry;
break;
}
$info.text(text).show();
};
if (file.getStatus() === 'invalid') {
showError(file.statusText);
} else {
$wrap.text(lang.uploadPreview);
if ('|png|jpg|jpeg|bmp|gif|'.indexOf('|' + file.ext.toLowerCase() + '|') == -1) {
$wrap.empty().addClass('notimage').append('<i class="file-preview file-type-' + file.ext.toLowerCase() + '"></i>' +
'<span class="file-title">' + file.name + '</span>');
} else {
if (browser.ie && browser.version <= 7) {
$wrap.text(lang.uploadNoPreview);
} else {
uploader.makeThumb(file, function (error, src) {
if (error || !src || (/^data:/.test(src) && browser.ie && browser.version <= 7)) {
$wrap.text(lang.uploadNoPreview);
} else {
var $img = $('<img src="' + src + '">');
$wrap.empty().append($img);
$img.on('error', function () {
$wrap.text(lang.uploadNoPreview);
});
}
}, thumbnailWidth, thumbnailHeight);
}
}
percentages[file.id] = [file.size, 0];
file.rotation = 0;
/* 检查文件格式 */
if (!file.ext || acceptExtensions.indexOf(file.ext.toLowerCase()) == -1) {
showError('not_allow_type');
uploader.removeFile(file);
}
}
file.on('statuschange', function (cur, prev) {
if (prev === 'progress') {
$prgress.hide().width(0);
} else if (prev === 'queued') {
$li.off('mouseenter mouseleave');
$btns.remove();
}
// 成功
if (cur === 'error' || cur === 'invalid') {
showError(file.statusText);
percentages[file.id][1] = 1;
} else if (cur === 'interrupt') {
showError('interrupt');
} else if (cur === 'queued') {
percentages[file.id][1] = 0;
} else if (cur === 'progress') {
$info.hide();
$prgress.css('display', 'block');
} else if (cur === 'complete') {
}
$li.removeClass('state-' + prev).addClass('state-' + cur);
});
$li.on('mouseenter', function () {
$btns.stop().animate({height: 30});
});
$li.on('mouseleave', function () {
$btns.stop().animate({height: 0});
});
$btns.on('click', 'span', function () {
var index = $(this).index(),
deg;
switch (index) {
case 0:
uploader.removeFile(file);
return;
case 1:
file.rotation += 90;
break;
case 2:
file.rotation -= 90;
break;
}
if (supportTransition) {
deg = 'rotate(' + file.rotation + 'deg)';
$wrap.css({
'-webkit-transform': deg,
'-mos-transform': deg,
'-o-transform': deg,
'transform': deg
});
} else {
$wrap.css('filter', 'progid:DXImageTransform.Microsoft.BasicImage(rotation=' + (~~((file.rotation / 90) % 4 + 4) % 4) + ')');
}
});
$li.insertBefore($filePickerBlock);
}
// 负责view的销毁
function removeFile(file) {
var $li = $('#' + file.id);
delete percentages[file.id];
updateTotalProgress();
$li.off().find('.file-panel').off().end().remove();
}
function updateTotalProgress() {
var loaded = 0,
total = 0,
spans = $progress.children(),
percent;
$.each(percentages, function (k, v) {
total += v[0];
loaded += v[0] * v[1];
});
percent = total ? loaded / total : 0;
spans.eq(0).text(Math.round(percent * 100) + '%');
spans.eq(1).css('width', Math.round(percent * 100) + '%');
updateStatus();
}
function setState(val, files) {
if (val != state) {
var stats = uploader.getStats();
$upload.removeClass('state-' + state);
$upload.addClass('state-' + val);
switch (val) {
/* 未选择文件 */
case 'pedding':
$queue.addClass('element-invisible');
$statusBar.addClass('element-invisible');
$placeHolder.removeClass('element-invisible');
$progress.hide();
$info.hide();
uploader.refresh();
break;
/* 可以开始上传 */
case 'ready':
$placeHolder.addClass('element-invisible');
$queue.removeClass('element-invisible');
$statusBar.removeClass('element-invisible');
$progress.hide();
$info.show();
$upload.text(lang.uploadStart);
uploader.refresh();
break;
/* 上传中 */
case 'uploading':
$progress.show();
$info.hide();
$upload.text(lang.uploadPause);
break;
/* 暂停上传 */
case 'paused':
$progress.show();
$info.hide();
$upload.text(lang.uploadContinue);
break;
case 'confirm':
$progress.show();
$info.hide();
$upload.text(lang.uploadStart);
stats = uploader.getStats();
if (stats.successNum && !stats.uploadFailNum) {
setState('finish');
return;
}
break;
case 'finish':
$progress.hide();
$info.show();
if (stats.uploadFailNum) {
$upload.text(lang.uploadRetry);
} else {
$upload.text(lang.uploadStart);
}
break;
}
state = val;
updateStatus();
}
if (!_this.getQueueCount()) {
$upload.addClass('disabled')
} else {
$upload.removeClass('disabled')
}
}
function updateStatus() {
var text = '', stats;
if (state === 'ready') {
text = lang.updateStatusReady.replace('_', fileCount).replace('_KB', WebUploader.formatSize(fileSize));
} else if (state === 'confirm') {
stats = uploader.getStats();
if (stats.uploadFailNum) {
text = lang.updateStatusConfirm.replace('_', stats.successNum).replace('_', stats.successNum);
}
} else {
stats = uploader.getStats();
text = lang.updateStatusFinish.replace('_', fileCount).replace('_KB', WebUploader.formatSize(fileSize)).replace('_', stats.successNum);
if (stats.uploadFailNum) {
text += lang.updateStatusError.replace('_', stats.uploadFailNum);
}
}
$info.html(text);
}
uploader.on('fileQueued', function (file) {
fileCount++;
fileSize += file.size;
if (fileCount === 1) {
$placeHolder.addClass('element-invisible');
$statusBar.show();
}
addFile(file);
});
uploader.on('fileDequeued', function (file) {
fileCount--;
fileSize -= file.size;
removeFile(file);
updateTotalProgress();
});
uploader.on('filesQueued', function (file) {
if (!uploader.isInProgress() && (state == 'pedding' || state == 'finish' || state == 'confirm' || state == 'ready')) {
setState('ready');
}
updateTotalProgress();
});
uploader.on('all', function (type, files) {
switch (type) {
case 'uploadFinished':
setState('confirm', files);
break;
case 'startUpload':
/* 添加额外的GET参数 */
var params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '',
url = utils.formatUrl(actionUrl + (actionUrl.indexOf('?') == -1 ? '?' : '&') + 'encode=utf-8&' + params);
uploader.option('server', url);
setState('uploading', files);
break;
case 'stopUpload':
setState('paused', files);
break;
}
});
uploader.on('uploadBeforeSend', function (file, data, header) {
//这里可以通过data对象添加POST参数
if (actionUrl.toLowerCase().indexOf('jsp') != -1) {
header['X_Requested_With'] = 'XMLHttpRequest';
}
});
uploader.on('uploadProgress', function (file, percentage) {
var $li = $('#' + file.id),
$percent = $li.find('.progress span');
$percent.css('width', percentage * 100 + '%');
percentages[file.id][1] = percentage;
updateTotalProgress();
});
uploader.on('uploadSuccess', function (file, ret) {
var $file = $('#' + file.id);
try {
var responseText = (ret._raw || ret),
json = utils.str2json(responseText);
json = editor.getOpt('serverResponsePrepare')(json);
if (json.state == 'SUCCESS') {
uploadaudioList.push({
'url': json.url,
'type': json.type,
'original': json.original
});
$file.append('<span class="success"></span>');
} else {
$file.find('.error').text(json.state).show();
}
} catch (e) {
$file.find('.error').text(lang.errorServerUpload).show();
}
});
uploader.on('uploadError', function (file, code) {
});
uploader.on('error', function (code, param1, param2) {
if (code === 'F_EXCEED_SIZE') {
editor.getOpt('tipError')(lang.errorExceedSize + ' ' + (param1 / 1024 / 1024).toFixed(1) + 'MB');
} else {
console.log('error', code, param1, param2);
}
});
uploader.on('uploadComplete', function (file, ret) {
});
$upload.on('click', function () {
if ($(this).hasClass('disabled')) {
return false;
}
if (state === 'ready') {
uploader.upload();
} else if (state === 'paused') {
uploader.upload();
} else if (state === 'uploading') {
uploader.stop();
}
});
$upload.addClass('state-' + state);
updateTotalProgress();
},
getQueueCount: function () {
var file, i, status, readyFile = 0, files = this.uploader.getFiles();
for (i = 0; file = files[i++];) {
status = file.getStatus();
if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++;
}
return readyFile;
},
refresh: function () {
this.uploader.refresh();
}
};
})();

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 43 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: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 445 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -1,28 +1,118 @@
.wrapper{ width: 424px;margin: 10px auto; zoom:1;position: relative} .wrapper {
.tabbody{height:225px;} width: 424px;
.tabbody .panel { position: absolute;width:100%; height:100%;background: #fff; display: none;} margin: 10px auto;
.tabbody .focus { display: block;} zoom: 1;
position: relative
}
body{font-size: 12px;color: #888;overflow: hidden;} .tabbody {
input,label{vertical-align:middle} height: 225px;
.clear{clear: both;} }
.pl{padding-left: 18px;padding-left: 23px\9;}
#imageList {width: 420px;height: 215px;margin-top: 10px;overflow: hidden;overflow-y: auto;} .tabbody .panel {
#imageList div {float: left;width: 100px;height: 95px;margin: 5px 10px;} position: absolute;
#imageList img {cursor: pointer;border: 2px solid white;} width: 100%;
height: 100%;
background: #fff;
display: none;
}
.bgarea{margin: 10px;padding: 5px;height: 84%;border: 1px solid #A8A297;} .tabbody .focus {
.content div{margin: 10px 0 10px 5px;} display: block;
.content .iptradio{margin: 0px 5px 5px 0px;} }
.txt{width:280px;}
.wrapcolor{height: 19px;} body {
div.color{float: left;margin: 0;} font-size: 12px;
#colorPicker{width: 17px;height: 17px;border: 1px solid #CCC;display: inline-block;border-radius: 3px;box-shadow: 2px 2px 5px #D3D6DA;margin: 0;float: left;} color: #888;
div.alignment,#custom{margin-left: 23px;margin-left: 28px\9;} overflow: hidden;
#custom input{height: 15px;min-height: 15px;width:20px;} }
#repeatType{width:100px;}
input, label {
vertical-align: middle
}
.clear {
clear: both;
}
.pl {
padding-left: 18px;
padding-left: 23px \9;
}
#imageList {
width: 420px;
height: 215px;
margin-top: 10px;
overflow: hidden;
overflow-y: auto;
}
#imageList div {
float: left;
width: 100px;
height: 95px;
margin: 5px 10px;
}
#imageList img {
cursor: pointer;
border: 2px solid white;
}
.bgarea {
margin: 10px;
padding: 5px;
height: 84%;
border: 1px solid #A8A297;
}
.content div {
margin: 10px 0 10px 5px;
}
.content .iptradio {
margin: 0px 5px 5px 0px;
}
.txt {
width: 280px;
}
.wrapcolor {
height: 19px;
}
div.color {
float: left;
margin: 0;
}
#colorPicker {
width: 17px;
height: 17px;
border: 1px solid #CCC;
display: inline-block;
border-radius: 3px;
box-shadow: 2px 2px 5px #D3D6DA;
margin: 0;
float: left;
}
div.alignment, #custom {
margin-left: 23px;
margin-left: 28px \9;
}
#custom input {
height: 15px;
min-height: 15px;
width: 20px;
}
#repeatType {
width: 100px;
}
/* 图片管理样式 */ /* 图片管理样式 */
@ -30,17 +120,20 @@ div.alignment,#custom{margin-left: 23px;margin-left: 28px\9;}
width: 100%; width: 100%;
height: 225px; height: 225px;
} }
#imgManager #imageList{
#imgManager #imageList {
width: 100%; width: 100%;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;
} }
#imgManager ul { #imgManager ul {
display: block; display: block;
list-style: none; list-style: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
#imgManager li { #imgManager li {
float: left; float: left;
display: block; display: block;
@ -54,18 +147,21 @@ div.alignment,#custom{margin-left: 23px;margin-left: 28px\9;}
cursor: pointer; cursor: pointer;
position: relative; position: relative;
} }
#imgManager li.clearFloat { #imgManager li.clearFloat {
float: none; float: none;
clear: both; clear: both;
display: block; display: block;
width:0; width: 0;
height:0; height: 0;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
#imgManager li img { #imgManager li img {
cursor: pointer; cursor: pointer;
} }
#imgManager li .icon { #imgManager li .icon {
cursor: pointer; cursor: pointer;
width: 113px; width: 113px;
@ -77,18 +173,21 @@ div.alignment,#custom{margin-left: 23px;margin-left: 28px\9;}
border: 0; border: 0;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
#imgManager li .icon:hover { #imgManager li .icon:hover {
width: 107px; width: 107px;
height: 107px; height: 107px;
border: 3px solid #1094fa; border: 3px solid #1094fa;
} }
#imgManager li.selected .icon { #imgManager li.selected .icon {
background-image: url(images/success.png); background-image: url(images/success.png);
background-position: 75px 75px; background-position: 75px 75px;
} }
#imgManager li.selected .icon:hover { #imgManager li.selected .icon:hover {
width: 107px; width: 107px;
height: 107px; height: 107px;
border: 3px solid #1094fa; border: 3px solid #1094fa;
background-position: 72px 72px; background-position: 72px 72px;
} }

View File

@ -2,51 +2,58 @@
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" src="../internal.js?20220503"></script> <script type="text/javascript" src="../internal.js?aea0c61c"></script>
<link rel="stylesheet" type="text/css" href="background.css?20220503"> <link rel="stylesheet" type="text/css" href="background.css?da860c7a">
</head> </head>
<body> <body>
<div id="bg_container" class="wrapper"> <div id="bg_container" class="wrapper">
<div id="tabHeads" class="tabhead"> <div id="tabHeads" class="tabhead">
<span class="focus" data-content-id="normal"><var id="lang_background_normal"></var></span> <span class="focus" data-content-id="normal"><var id="lang_background_normal"></var></span>
</div> </div>
<div id="tabBodys" class="tabbody"> <div id="tabBodys" class="tabbody">
<div id="normal" class="panel focus"> <div id="normal" class="panel focus">
<fieldset class="bgarea"> <fieldset class="bgarea">
<legend><var id="lang_background_set"></var></legend> <legend><var id="lang_background_set"></var></legend>
<div class="content"> <div class="content">
<div> <div>
<label><input id="nocolorRadio" class="iptradio" type="radio" name="t" value="none" checked="checked"><var id="lang_background_none"></var></label> <label><input id="nocolorRadio" class="iptradio" type="radio" name="t" value="none"
<label><input id="coloredRadio" class="iptradio" type="radio" name="t" value="color"><var id="lang_background_colored"></var></label> checked="checked"><var id="lang_background_none"></var></label>
</div> <label><input id="coloredRadio" class="iptradio" type="radio" name="t" value="color"><var
<div class="wrapcolor pl"> id="lang_background_colored"></var></label>
<div class="color">
<var id="lang_background_color"></var>:
</div>
<div id="colorPicker"></div>
<div class="clear"></div>
</div>
<div class="wrapcolor pl">
<label><var id="lang_background_netimg"></var>:</label><input class="txt" type="text" id="url">
</div>
<div id="alignment" class="alignment">
<var id="lang_background_align"></var>:<select id="repeatType">
<option value="center"></option>
<option value="repeat-x"></option>
<option value="repeat-y"></option>
<option value="repeat"></option>
<option value="self"></option>
</select>
</div>
<div id="custom" >
<var id="lang_background_position"></var>:x:<input type="text" size="1" id="x" maxlength="4" value="0">px&nbsp;&nbsp;y:<input type="text" size="1" id="y" maxlength="4" value="0">px
</div>
</div> </div>
</fieldset> <div class="wrapcolor pl">
<div class="color">
<var id="lang_background_color"></var>:
</div>
<div id="colorPicker"></div>
<div class="clear"></div>
</div>
<div class="wrapcolor pl">
<label><var id="lang_background_netimg"></var>:</label><input class="txt" type="text" id="url">
</div>
<div id="alignment" class="alignment">
<var id="lang_background_align"></var>:<select id="repeatType">
<option value="center"></option>
<option value="repeat-x"></option>
<option value="repeat-y"></option>
<option value="repeat"></option>
<option value="self"></option>
</select>
</div>
<div id="custom">
<var id="lang_background_position"></var>:x:<input type="text" size="1" id="x" maxlength="4"
value="0">px&nbsp;&nbsp;y:<input type="text"
size="1"
id="y"
maxlength="4"
value="0">px
</div>
</div>
</fieldset>
</div>
</div> </div>
</div> </div>
<script type="text/javascript" src="background.js?20220503"></script> </div>
<script type="text/javascript" src="background.js?dd36acd0"></script>
</body> </body>
</html> </html>

View File

@ -9,17 +9,17 @@
}; };
/* 初始化tab标签 */ /* 初始化tab标签 */
function initTabs(){ function initTabs() {
var tabs = $G('tabHeads').children; var tabs = $G('tabHeads').children;
for (var i = 0; i < tabs.length; i++) { for (var i = 0; i < tabs.length; i++) {
domUtils.on(tabs[i], "click", function (e) { domUtils.on(tabs[i], "click", function (e) {
var target = e.target || e.srcElement; var target = e.target || e.srcElement;
for (var j = 0; j < tabs.length; j++) { for (var j = 0; j < tabs.length; j++) {
if(tabs[j] == target){ if (tabs[j] == target) {
tabs[j].className = "focus"; tabs[j].className = "focus";
var contentId = tabs[j].getAttribute('data-content-id'); var contentId = tabs[j].getAttribute('data-content-id');
$G(contentId).style.display = "block"; $G(contentId).style.display = "block";
}else { } else {
tabs[j].className = ""; tabs[j].className = "";
$G(tabs[j].getAttribute('data-content-id')).style.display = "none"; $G(tabs[j].getAttribute('data-content-id')).style.display = "none";
} }
@ -29,7 +29,7 @@
} }
/* 初始化颜色设置 */ /* 初始化颜色设置 */
function initColorSelector () { function initColorSelector() {
var obj = editor.queryCommandValue('background'); var obj = editor.queryCommandValue('background');
if (obj) { if (obj) {
var color = obj['background-color'], var color = obj['background-color'],
@ -40,10 +40,10 @@
x = parseInt(pos[0]) || 0, x = parseInt(pos[0]) || 0,
y = parseInt(pos[1]) || 0; y = parseInt(pos[1]) || 0;
if(repeat == 'no-repeat' && (x || y)) repeat = 'self'; if (repeat == 'no-repeat' && (x || y)) repeat = 'self';
image = image.match(/url[\s]*\(([^\)]*)\)/); image = image.match(/url[\s]*\(([^\)]*)\)/);
image = image ? image[1]:''; image = image ? image[1] : '';
updateFormState('colored', color, image, repeat, x, y); updateFormState('colored', color, image, repeat, x, y);
} else { } else {
updateFormState(); updateFormState();
@ -55,10 +55,10 @@
} }
domUtils.on($G('nocolorRadio'), 'click', updateBackground); domUtils.on($G('nocolorRadio'), 'click', updateBackground);
domUtils.on($G('coloredRadio'), 'click', updateHandler); domUtils.on($G('coloredRadio'), 'click', updateHandler);
domUtils.on($G('url'), 'keyup', function(){ domUtils.on($G('url'), 'keyup', function () {
if($G('url').value && $G('alignment').style.display == "none") { if ($G('url').value && $G('alignment').style.display == "none") {
utils.each($G('repeatType').children, function(item){ utils.each($G('repeatType').children, function (item) {
item.selected = ('repeat' == item.getAttribute('value') ? 'selected':false); item.selected = ('repeat' == item.getAttribute('value') ? 'selected' : false);
}); });
} }
updateHandler(); updateHandler();
@ -110,44 +110,44 @@
} }
/* 更新背景色设置面板 */ /* 更新背景色设置面板 */
function updateFormState (radio, color, url, align, x, y) { function updateFormState(radio, color, url, align, x, y) {
var nocolorRadio = $G('nocolorRadio'), var nocolorRadio = $G('nocolorRadio'),
coloredRadio = $G('coloredRadio'); coloredRadio = $G('coloredRadio');
if(radio) { if (radio) {
nocolorRadio.checked = (radio == 'colored' ? false:'checked'); nocolorRadio.checked = (radio == 'colored' ? false : 'checked');
coloredRadio.checked = (radio == 'colored' ? 'checked':false); coloredRadio.checked = (radio == 'colored' ? 'checked' : false);
} }
if(color) { if (color) {
domUtils.setStyle($G("colorPicker"), "background-color", color); domUtils.setStyle($G("colorPicker"), "background-color", color);
} }
if(url && /^\//.test(url)) { if (url && /^\//.test(url)) {
var a = document.createElement('a'); var a = document.createElement('a');
a.href = url; a.href = url;
browser.ie && (a.href = a.href); browser.ie && (a.href = a.href);
url = browser.ie ? a.href:(a.protocol + '//' + a.host + a.pathname + a.search + a.hash); url = browser.ie ? a.href : (a.protocol + '//' + a.host + a.pathname + a.search + a.hash);
} }
if(url || url === '') { if (url || url === '') {
$G('url').value = url; $G('url').value = url;
} }
if(align) { if (align) {
utils.each($G('repeatType').children, function(item){ utils.each($G('repeatType').children, function (item) {
item.selected = (align == item.getAttribute('value') ? 'selected':false); item.selected = (align == item.getAttribute('value') ? 'selected' : false);
}); });
} }
if(x || y) { if (x || y) {
$G('x').value = parseInt(x) || 0; $G('x').value = parseInt(x) || 0;
$G('y').value = parseInt(y) || 0; $G('y').value = parseInt(y) || 0;
} }
$G('alignment').style.display = coloredRadio.checked && $G('url').value ? '':'none'; $G('alignment').style.display = coloredRadio.checked && $G('url').value ? '' : 'none';
$G('custom').style.display = coloredRadio.checked && $G('url').value && $G('repeatType').value == 'self' ? '':'none'; $G('custom').style.display = coloredRadio.checked && $G('url').value && $G('repeatType').value == 'self' ? '' : 'none';
} }
/* 更新背景颜色 */ /* 更新背景颜色 */
function updateBackground () { function updateBackground() {
if ($G('coloredRadio').checked) { if ($G('coloredRadio').checked) {
var color = domUtils.getStyle($G("colorPicker"), "background-color"), var color = domUtils.getStyle($G("colorPicker"), "background-color"),
bgimg = $G("url").value, bgimg = $G("url").value,
@ -177,6 +177,7 @@
this.container = utils.isString(target) ? document.getElementById(target) : target; this.container = utils.isString(target) ? document.getElementById(target) : target;
this.init(); this.init();
} }
OnlineImage.prototype = { OnlineImage.prototype = {
init: function () { init: function () {
this.reset(); this.reset();
@ -200,7 +201,7 @@
var _this = this; var _this = this;
/* 滚动拉取图片 */ /* 滚动拉取图片 */
domUtils.on($G('imageList'), 'scroll', function(e){ domUtils.on($G('imageList'), 'scroll', function (e) {
var panel = this; var panel = this;
if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) { if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) {
_this.getImageData(); _this.getImageData();
@ -239,7 +240,7 @@
this.getImageData(); this.getImageData();
}, },
/* 重置界面 */ /* 重置界面 */
reset: function() { reset: function () {
this.initContainer(); this.initContainer();
this.initData(); this.initData();
}, },
@ -247,31 +248,32 @@
getImageData: function () { getImageData: function () {
var _this = this; var _this = this;
if(!_this.listEnd && !this.isLoadingData) { if (!_this.listEnd && !this.isLoadingData) {
this.isLoadingData = true; this.isLoadingData = true;
var url = editor.getActionUrl(editor.getOpt('imageManagerActionName')), var url = editor.getActionUrl(editor.getOpt('imageManagerActionName')),
isJsonp = utils.isCrossDomainUrl(url); isJsonp = utils.isCrossDomainUrl(url);
ajax.request(url, { ajax.request(url, {
'timeout': 100000, 'timeout': 100000,
'dataType': isJsonp ? 'jsonp':'', 'dataType': isJsonp ? 'jsonp' : '',
'data': utils.extend({ 'data': utils.extend({
start: this.listIndex, start: this.listIndex,
size: this.listSize size: this.listSize
}, editor.queryCommandValue('serverparam')), }, editor.queryCommandValue('serverparam')),
'headers': editor.options.serverHeaders || {},
'method': 'get', 'method': 'get',
'onsuccess': function (r) { 'onsuccess': function (r) {
try { try {
var json = isJsonp ? r:eval('(' + r.responseText + ')'); var json = isJsonp ? r : eval('(' + r.responseText + ')');
if (json.state == 'SUCCESS') { if (json.state == 'SUCCESS') {
_this.pushData(json.list); _this.pushData(json.list);
_this.listIndex = parseInt(json.start) + parseInt(json.list.length); _this.listIndex = parseInt(json.start) + parseInt(json.list.length);
if(_this.listIndex >= json.total) { if (_this.listIndex >= json.total) {
_this.listEnd = true; _this.listEnd = true;
} }
_this.isLoadingData = false; _this.isLoadingData = false;
} }
} catch (e) { } catch (e) {
if(r.responseText.indexOf('ue_separate_ue') != -1) { if (r.responseText.indexOf('ue_separate_ue') != -1) {
var list = r.responseText.split(r.responseText); var list = r.responseText.split(r.responseText);
_this.pushData(list); _this.pushData(list);
_this.listIndex = parseInt(list.length); _this.listIndex = parseInt(list.length);
@ -291,18 +293,18 @@
var i, item, img, icon, _this = this, var i, item, img, icon, _this = this,
urlPrefix = editor.getOpt('imageManagerUrlPrefix'); urlPrefix = editor.getOpt('imageManagerUrlPrefix');
for (i = 0; i < list.length; i++) { for (i = 0; i < list.length; i++) {
if(list[i] && list[i].url) { if (list[i] && list[i].url) {
item = document.createElement('li'); item = document.createElement('li');
img = document.createElement('img'); img = document.createElement('img');
icon = document.createElement('span'); icon = document.createElement('span');
domUtils.on(img, 'load', (function(image){ domUtils.on(img, 'load', (function (image) {
return function(){ return function () {
_this.scale(image, image.parentNode.offsetWidth, image.parentNode.offsetHeight); _this.scale(image, image.parentNode.offsetWidth, image.parentNode.offsetHeight);
} }
})(img)); })(img));
img.width = 113; img.width = 113;
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 + (list[i].url.indexOf('?') == -1 ? '?noCache=' : '&noCache=') + (+new Date()).toString(36));
img.setAttribute('_src', urlPrefix + list[i].url); img.setAttribute('_src', urlPrefix + list[i].url);
domUtils.addClass(icon, 'icon'); domUtils.addClass(icon, 'icon');

View File

@ -0,0 +1,176 @@
<!DOCTYPE html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" src="../internal.js?aea0c61c"></script>
<style type="text/css">
.wrapper {
width: 600px;
padding: 10px;
height: 352px;
overflow: hidden;
position: relative;
border-bottom: 1px solid #d7d7d7;
}
.wrapper .file-upload {
display: flex;
align-items: center;
}
.wrapper .file-upload .file-tip {
color: #999;
font-size: 12px;
padding-left: 10px;
flex-grow: 1;
}
.wrapper .file-manual {
background: #EEE;
padding: 10px;
border-radius: 5px;
margin-top: 10px;
line-height: 2;
}
.wrapper .file-manual .title {
font-weight: bold;
font-size: 120%;
}
.wrapper .file-manual .body {
}
.wrapper .file-manual .body li {
list-style: disc;
margin-left: 20px;
}
.wrapper .upload-button {
width: 100px;
height: 30px;
background-color: #F8F8F8;
border: 1px solid #EEE;
border-radius: 4px;
text-align: center;
line-height: 28px;
cursor: pointer;
position: relative;
flex-shrink: 0;
margin-right: 5px;
}
.wrapper .upload-button .text {
display: inline-block;
vertical-align: middle;
}
.wrapper .upload-button input {
position: absolute;
left: 0;
top: 0;
opacity: 0;
cursor: pointer;
height: 100%;
width: 100%;
}
.wrapper .file-result {
border: 1px solid #333;
padding: 10px;
border-radius: 5px;
position: absolute;
left: 10px;
right: 10px;
top: 50px;
background: #FFF;
bottom: 10px;
overflow: auto;
display: none;
}
.wrapper .file-input{
position: absolute;
left: 10px;
right: 10px;
top: 50px;
background: #EEE;
bottom: 10px;
border-radius: 5px;
display:none;
}
.wrapper .file-input textarea{
position: absolute;
left: 10px;
right: 10px;
bottom: 10px;
border: none;
resize: none;
border-radius: 5px;
padding: 5px;
outline: none;
top: 30px;
}
.wrapper .file-input .tool{
text-align: right;
padding: 5px 10px;
}
.wrapper .file-input .tool a{
display: inline-block;
text-decoration: none;
color: #333;
background: #FFF;
padding: 0 10px;
line-height: 20px;
border-radius: 3px;
}
</style>
</head>
<body>
<div class="wrapper">
<div class="file-upload">
<div class="upload-button">
<div class="text">选择本地文件</div>
<input type="file" id="contentImport"/>
</div>
<div class="upload-button">
<div class="text" onclick="$('.file-input').show();">粘贴Markdown</div>
</div>
<div class="file-tip"></div>
</div>
<div class="file-manual">
<div class="title">
支持文档格式
</div>
<div class="body">
<ul>
<li><b>Word</b>docx</li>
<li><b>Markdown</b>md</li>
</ul>
</div>
</div>
<div class="file-result"></div>
<div class="file-input">
<textarea id="fileInputContent"></textarea>
<div class="tool">
<a href="javascript:;" id="fileInputConfirm">
确定
</a>
<a href="javascript:;" onclick="$(this).closest('.file-input').hide();">
关闭
</a>
</div>
</div>
</div>
<script src="../../third-party/jquery-1.10.2.js?628072e7"></script>
<script src="mammoth.browser.min.js?bfaf513f"></script>
<script src="showdown.min.js?b4bef047"></script>
<script type="text/javascript" src="contentimport.js?5760833a"></script>
<script type="text/javascript">
utils.domReady(function () {
var options = {};
var callbacks = {};
contentImport.init(options, callbacks);
});
</script>
</body>
</html>

View File

@ -0,0 +1,91 @@
var contentImport = {};
var g = $G;
contentImport.data = {
result: null,
};
contentImport.init = function (opt, callbacks) {
addUploadButtonListener();
addOkListener();
};
function processWord(file) {
$('.file-tip').html('正在转换Word文件请稍后...');
$('.file-result').html('').hide();
var reader = new FileReader();
reader.onload = function (loadEvent) {
mammoth.convertToHtml({
arrayBuffer: loadEvent.target.result
})
.then(function displayResult(result) {
$('.file-tip').html('转换成功');
contentImport.data.result = result.value;
$('.file-result').html(result.value).show();
}, function (error) {
$('.file-tip').html('Word文件转换失败:' + error);
});
};
reader.onerror = function (loadEvent) {
$('.file-tip').html('Word文件转换失败:' + loadEvent);
};
reader.readAsArrayBuffer(file);
}
function processMarkdown( markdown ){
var converter = new showdown.Converter();
var html = converter.makeHtml(markdown);
$('.file-tip').html('转换成功');
contentImport.data.result = html;
$('.file-result').html(html).show();
}
function processMarkdownFile(file) {
$('.file-tip').html('正在转换Markdown文件请稍后...');
$('.file-result').html('').hide();
var reader = new FileReader();
reader.onload = function (loadEvent) {
processMarkdown( loadEvent.target.result );
};
reader.onerror = function (loadEvent) {
$('.file-tip').html('Markdown文件转换失败:' + loadEvent);
};
reader.readAsText(file, "UTF-8");
}
function addUploadButtonListener() {
g('contentImport').addEventListener('change', function () {
const file = this.files[0];
const fileName = file.name;
const fileExt = fileName.substring(fileName.lastIndexOf('.') + 1).toLowerCase();
switch (fileExt) {
case 'docx':
case 'doc':
processWord(file);
break;
case 'md':
processMarkdownFile(file);
break;
default:
$('.file-tip').html('不支持的文件格式:' + fileExt);
break;
}
});
g('fileInputConfirm').addEventListener('click', function () {
processMarkdown( g('fileInputContent').value );
$('.file-input').hide();
});
}
function addOkListener() {
dialog.onok = function () {
if (!contentImport.data.result) {
alert('请先上传文件识别内容');
return false;
}
editor.fireEvent('saveScene');
editor.execCommand("inserthtml", contentImport.data.result);
editor.fireEvent('saveScene');
};
dialog.oncancel = function () {
};
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,43 +1,129 @@
.jd img{ .jd img {
background:transparent url(images/jxface2.gif?v=1.1) no-repeat scroll left top; background: transparent url(images/jxface2.gif?v=1.1) no-repeat scroll left top;
cursor:pointer;width:35px;height:35px;display:block; cursor: pointer;
} width: 35px;
.pp img{ height: 35px;
background:transparent url(images/fface.gif?v=1.1) no-repeat scroll left top; display: block;
cursor:pointer;width:25px;height:25px;display:block;
}
.ldw img{
background:transparent url(images/wface.gif?v=1.1) no-repeat scroll left top;
cursor:pointer;width:35px;height:35px;display:block;
}
.tsj img{
background:transparent url(images/tface.gif?v=1.1) no-repeat scroll left top;
cursor:pointer;width:35px;height:35px;display:block;
}
.cat img{
background:transparent url(images/cface.gif?v=1.1) no-repeat scroll left top;
cursor:pointer;width:35px;height:35px;display:block;
}
.bb img{
background:transparent url(images/bface.gif?v=1.1) no-repeat scroll left top;
cursor:pointer;width:35px;height:35px;display:block;
}
.youa img{
background:transparent url(images/yface.gif?v=1.1) no-repeat scroll left top;
cursor:pointer;width:35px;height:35px;display:block;
} }
.smileytable td {height: 37px;} .pp img {
#tabPanel{margin-left:5px;overflow: hidden;} background: transparent url(images/fface.gif?v=1.1) no-repeat scroll left top;
#tabContent {float:left;background:#FFFFFF;} cursor: pointer;
#tabContent div{display: none;width:480px;overflow:hidden;} width: 25px;
#tabIconReview.show{left:17px;display:block;} height: 25px;
.menuFocus{background:#ACCD3C;} display: block;
.menuDefault{background:#FFFFFF;} }
#tabIconReview{position:absolute;left:406px;left:398px \9;top:41px;z-index:65533;width:90px;height:76px;}
img.review{width:90px;height:76px;border:2px solid #9cb945;background:#FFFFFF;background-position:center;background-repeat:no-repeat;}
.wrapper .tabbody{position:relative;float:left;clear:both;padding:10px;width: 95%;} .ldw img {
.tabbody table{width: 100%;} background: transparent url(images/wface.gif?v=1.1) no-repeat scroll left top;
.tabbody td{border:1px solid #BAC498;} cursor: pointer;
.tabbody td span{display: block;zoom:1;padding:0 4px;} width: 35px;
height: 35px;
display: block;
}
.tsj img {
background: transparent url(images/tface.gif?v=1.1) no-repeat scroll left top;
cursor: pointer;
width: 35px;
height: 35px;
display: block;
}
.cat img {
background: transparent url(images/cface.gif?v=1.1) no-repeat scroll left top;
cursor: pointer;
width: 35px;
height: 35px;
display: block;
}
.bb img {
background: transparent url(images/bface.gif?v=1.1) no-repeat scroll left top;
cursor: pointer;
width: 35px;
height: 35px;
display: block;
}
.youa img {
background: transparent url(images/yface.gif?v=1.1) no-repeat scroll left top;
cursor: pointer;
width: 35px;
height: 35px;
display: block;
}
.smileytable td {
height: 37px;
}
#tabPanel {
margin-left: 5px;
overflow: hidden;
}
#tabContent {
float: left;
background: #FFFFFF;
}
#tabContent div {
display: none;
width: 480px;
overflow: hidden;
}
#tabIconReview.show {
left: 17px;
display: block;
}
.menuFocus {
background: #ACCD3C;
}
.menuDefault {
background: #FFFFFF;
}
#tabIconReview {
position: absolute;
left: 406px;
left: 398px \9;
top: 41px;
z-index: 65533;
width: 90px;
height: 76px;
}
img.review {
width: 90px;
height: 76px;
border: 2px solid #9cb945;
background: #FFFFFF;
background-position: center;
background-repeat: no-repeat;
}
.wrapper .tabbody {
position: relative;
float: left;
clear: both;
padding: 10px;
width: 95%;
}
.tabbody table {
width: 100%;
}
.tabbody td {
border: 1px solid #BAC498;
}
.tabbody td span {
display: block;
zoom: 1;
padding: 0 4px;
}

View File

@ -4,8 +4,8 @@
<title></title> <title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="robots" content="noindex, nofollow"/> <meta name="robots" content="noindex, nofollow"/>
<script type="text/javascript" src="../internal.js?20220503"></script> <script type="text/javascript" src="../internal.js?aea0c61c"></script>
<link rel="stylesheet" type="text/css" href="emotion.css?20220503"> <link rel="stylesheet" type="text/css" href="emotion.css?d5b42328">
</head> </head>
<body> <body>
<div id="tabPanel" class="wrapper"> <div id="tabPanel" class="wrapper">
@ -31,22 +31,38 @@
<div id="tabIconReview"> <div id="tabIconReview">
<img id='faceReview' class='review' src="../../themes/default/images/spacer.gif"/> <img id='faceReview' class='review' src="../../themes/default/images/spacer.gif"/>
</div> </div>
<script type="text/javascript" src="emotion.js?20220503"></script> <script type="text/javascript" src="emotion.js?61027075"></script>
<script type="text/javascript"> <script type="text/javascript">
var emotion = { var emotion = {
tabNum:7, //切换面板数量 tabNum: 7, //切换面板数量
SmilmgName:{ tab0:['j_00', 84], tab1:['t_00', 40], tab2:['w_00', 52], tab3:['B_00', 63], tab4:['C_00', 20], tab5:['i_f', 50], tab6:['y_00', 40] }, //图片前缀名 SmilmgName: {
imageFolders:{ tab0:'jx2/', tab1:'tsj/', tab2:'ldw/', tab3:'bobo/', tab4:'babycat/', tab5:'face/', tab6:'youa/'}, //图片对应文件夹路径 tab0: ['j_00', 84],
imageCss:{tab0:'jd', tab1:'tsj', tab2:'ldw', tab3:'bb', tab4:'cat', tab5:'pp', tab6:'youa'}, //图片css类名 tab1: ['t_00', 40],
imageCssOffset:{tab0:35, tab1:35, tab2:35, tab3:35, tab4:35, tab5:25, tab6:35}, //图片偏移 tab2: ['w_00', 52],
SmileyInfor:{ tab3: ['B_00', 63],
tab0:['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '打酱油', '俯卧撑', '气愤', '?', '吻', '怒', '胜利', 'HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '微笑', '亲吻', '调皮', '惊恐', '耍酷', '发火', '害羞', '汗水', '大哭', '', '加油', '困', '你NB', '晕倒', '开心', '偷笑', '大哭', '滴汗', '叹气', '超赞', '??', '飞吻', '天使', '撒花', '生气', '被砸', '吓傻', '随意吐'], tab4: ['C_00', 20],
tab1:['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '摊手', '睡觉', '瘫坐', '无聊', '星星闪', '旋转', '也不行', '郁闷', '正Music', '抓墙', '撞墙至死', '歪头', '戳眼', '飘过', '互相拍砖', '砍死你', '扔桌子', '少林寺', '什么?', '转头', '我爱牛奶', '我踢', '摇晃', '晕厥', '在笼子里', '震荡'], tab5: ['i_f', 50],
tab2:['大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '我错了', 'money', '气愤', '挑逗', '吻', '怒', '胜利', '委屈', '受伤', '说啥呢?', '闭嘴', '不', '逗你玩儿', '飞吻', '眩晕', '魔法', '我来了', '睡了', '我打', '闭嘴', '打', '打晕了', '刷牙', '爆揍', '炸弹', '倒立', '刮胡子', '邪恶的笑', '不要不要', '爱恋中', '放大仔细看', '偷窥', '超高兴', '晕', '松口气', '我跑', '享受', '修养', '哭', '汗', '啊~', '热烈欢迎', '打酱油', '俯卧撑', '?'], tab6: ['y_00', 40]
tab3:['HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '泪眼', '流泪', '生气', '吐舌', '喜欢', '旋转', '再见', '抓狂', '汗', '鄙视', '拜', '吐血', '嘘', '打人', '蹦跳', '变脸', '扯肉', '吃To', '吃花', '吹泡泡糖', '大变身', '飞天舞', '回眸', '可怜', '猛抽', '泡泡', '苹果', '亲', '', '骚舞', '烧香', '睡', '套娃娃', '捅捅', '舞倒', '西红柿', '爱慕', '摇', '摇摆', '杂耍', '招财', '被殴', '被球闷', '大惊', '理想', '欧打', '呕吐', '碎', '吐痰'], }, //图片前缀名
tab4:['发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '顶', '幸运', '爱心', '躲', '送花', '选择'], imageFolders: {
tab5:['微笑', '亲吻', '调皮', '惊讶', '耍酷', '发火', '害羞', '汗水', '大哭', '得意', '鄙视', '困', '夸奖', '晕倒', '疑问', '媒婆', '狂吐', '青蛙', '发愁', '亲吻', '', '爱心', '心碎', '玫瑰', '礼物', '哭', '奸笑', '可爱', '得意', '呲牙', '暴汗', '楚楚可怜', '困', '哭', '生气', '惊讶', '口水', '彩虹', '夜空', '太阳', '钱钱', '灯泡', '咖啡', '蛋糕', '音乐', '爱', '胜利', '赞', '鄙视', 'OK'], tab0: 'jx2/',
tab6:['男兜', '女兜', '开心', '乖乖', '偷笑', '大笑', '抽泣', '大哭', '无奈', '滴汗', '叹气', '狂晕', '委屈', '超赞', '??', '疑问', '飞吻', '天使', '撒花', '生气', '被砸', '口水', '泪奔', '吓傻', '吐舌头', '点头', '随意吐', '旋转', '困困', '鄙视', '狂顶', '篮球', '再见', '欢迎光临', '恭喜发财', '稍等', '我在线', '恕不议价', '库房有货', '货在路上'] tab1: 'tsj/',
tab2: 'ldw/',
tab3: 'bobo/',
tab4: 'babycat/',
tab5: 'face/',
tab6: 'youa/'
}, //图片对应文件夹路径
imageCss: {tab0: 'jd', tab1: 'tsj', tab2: 'ldw', tab3: 'bb', tab4: 'cat', tab5: 'pp', tab6: 'youa'}, //图片css类名
imageCssOffset: {tab0: 35, tab1: 35, tab2: 35, tab3: 35, tab4: 35, tab5: 25, tab6: 35}, //图片偏移
SmileyInfor: {
tab0: ['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '打酱油', '俯卧撑', '气愤', '?', '吻', '怒', '胜利', 'HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '微笑', '亲吻', '调皮', '惊恐', '耍酷', '发火', '害羞', '汗水', '大哭', '', '加油', '困', '你NB', '晕倒', '开心', '偷笑', '大哭', '滴汗', '叹气', '超赞', '??', '飞吻', '天使', '撒花', '生气', '被砸', '吓傻', '随意吐'],
tab1: ['Kiss', 'Love', 'Yeah', '啊!', '背扭', '顶', '抖胸', '88', '汗', '瞌睡', '鲁拉', '拍砖', '揉脸', '生日快乐', '摊手', '睡觉', '瘫坐', '无聊', '星星闪', '旋转', '也不行', '郁闷', '正Music', '抓墙', '撞墙至死', '歪头', '戳眼', '飘过', '互相拍砖', '砍死你', '扔桌子', '少林寺', '什么?', '转头', '我爱牛奶', '我踢', '摇晃', '晕厥', '在笼子里', '震荡'],
tab2: ['大笑', '瀑布汗~', '惊讶', '臭美', '傻笑', '抛媚眼', '发怒', '我错了', 'money', '气愤', '挑逗', '吻', '怒', '胜利', '委屈', '受伤', '说啥呢?', '闭嘴', '不', '逗你玩儿', '飞吻', '眩晕', '魔法', '我来了', '睡了', '我打', '闭嘴', '打', '打晕了', '刷牙', '爆揍', '炸弹', '倒立', '刮胡子', '邪恶的笑', '不要不要', '爱恋中', '放大仔细看', '偷窥', '超高兴', '晕', '松口气', '我跑', '享受', '修养', '哭', '汗', '啊~', '热烈欢迎', '打酱油', '俯卧撑', '?'],
tab3: ['HI', 'KISS', '不说', '不要', '扯花', '大心', '顶', '大惊', '飞吻', '鬼脸', '害羞', '口水', '狂哭', '来', '泪眼', '流泪', '生气', '吐舌', '喜欢', '旋转', '再见', '抓狂', '汗', '鄙视', '拜', '吐血', '嘘', '打人', '蹦跳', '变脸', '扯肉', '吃To', '吃花', '吹泡泡糖', '大变身', '飞天舞', '回眸', '可怜', '猛抽', '泡泡', '苹果', '亲', '', '骚舞', '烧香', '睡', '套娃娃', '捅捅', '舞倒', '西红柿', '爱慕', '摇', '摇摆', '杂耍', '招财', '被殴', '被球闷', '大惊', '理想', '欧打', '呕吐', '碎', '吐痰'],
tab4: ['发财了', '吃西瓜', '套牢', '害羞', '庆祝', '我来了', '敲打', '晕了', '胜利', '臭美', '被打了', '贪吃', '迎接', '酷', '顶', '幸运', '爱心', '躲', '送花', '选择'],
tab5: ['微笑', '亲吻', '调皮', '惊讶', '耍酷', '发火', '害羞', '汗水', '大哭', '得意', '鄙视', '困', '夸奖', '晕倒', '疑问', '媒婆', '狂吐', '青蛙', '发愁', '亲吻', '', '爱心', '心碎', '玫瑰', '礼物', '哭', '奸笑', '可爱', '得意', '呲牙', '暴汗', '楚楚可怜', '困', '哭', '生气', '惊讶', '口水', '彩虹', '夜空', '太阳', '钱钱', '灯泡', '咖啡', '蛋糕', '音乐', '爱', '胜利', '赞', '鄙视', 'OK'],
tab6: ['男兜', '女兜', '开心', '乖乖', '偷笑', '大笑', '抽泣', '大哭', '无奈', '滴汗', '叹气', '狂晕', '委屈', '超赞', '??', '疑问', '飞吻', '天使', '撒花', '生气', '被砸', '口水', '泪奔', '吓傻', '吐舌头', '点头', '随意吐', '旋转', '困困', '鄙视', '狂顶', '篮球', '再见', '欢迎光临', '恭喜发财', '稍等', '我在线', '恕不议价', '库房有货', '货在路上']
} }
}; };
</script> </script>

View File

@ -1,73 +1,73 @@
window.onload = function () { window.onload = function () {
editor.setOpt({ editor.setOpt({
emotionLocalization:false emotionLocalization: false
}); });
emotion.SmileyPath = editor.options.emotionLocalization === true ? 'images/' : "http://img.baidu.com/hi/"; emotion.SmileyPath = editor.options.emotionLocalization === true ? 'images/' : "http://img.baidu.com/hi/";
emotion.SmileyBox = createTabList( emotion.tabNum ); emotion.SmileyBox = createTabList(emotion.tabNum);
emotion.tabExist = createArr( emotion.tabNum ); emotion.tabExist = createArr(emotion.tabNum);
initImgName(); initImgName();
initEvtHandler( "tabHeads" ); initEvtHandler("tabHeads");
}; };
function initImgName() { function initImgName() {
for ( var pro in emotion.SmilmgName ) { for (var pro in emotion.SmilmgName) {
var tempName = emotion.SmilmgName[pro], var tempName = emotion.SmilmgName[pro],
tempBox = emotion.SmileyBox[pro], tempBox = emotion.SmileyBox[pro],
tempStr = ""; tempStr = "";
if ( tempBox.length ) return; if (tempBox.length) return;
for ( var i = 1; i <= tempName[1]; i++ ) { for (var i = 1; i <= tempName[1]; i++) {
tempStr = tempName[0]; tempStr = tempName[0];
if ( i < 10 ) tempStr = tempStr + '0'; if (i < 10) tempStr = tempStr + '0';
tempStr = tempStr + i + '.gif'; tempStr = tempStr + i + '.gif';
tempBox.push( tempStr ); tempBox.push(tempStr);
} }
} }
} }
function initEvtHandler( conId ) { function initEvtHandler(conId) {
var tabHeads = $G( conId ); var tabHeads = $G(conId);
for ( var i = 0, j = 0; i < tabHeads.childNodes.length; i++ ) { for (var i = 0, j = 0; i < tabHeads.childNodes.length; i++) {
var tabObj = tabHeads.childNodes[i]; var tabObj = tabHeads.childNodes[i];
if ( tabObj.nodeType == 1 ) { if (tabObj.nodeType == 1) {
domUtils.on( tabObj, "click", (function ( index ) { domUtils.on(tabObj, "click", (function (index) {
return function () { return function () {
switchTab( index ); switchTab(index);
}; };
})( j ) ); })(j));
j++; j++;
} }
} }
switchTab( 0 ); switchTab(0);
$G( "tabIconReview" ).style.display = 'none'; $G("tabIconReview").style.display = 'none';
} }
function InsertSmiley( url, evt ) { function InsertSmiley(url, evt) {
var obj = { var obj = {
src:editor.options.emotionLocalization ? editor.options.UEDITOR_HOME_URL + "dialogs/emotion/" + url : url src: editor.options.emotionLocalization ? editor.options.UEDITOR_HOME_URL + "dialogs/emotion/" + url : url
}; };
obj._src = obj.src; obj._src = obj.src;
editor.execCommand( 'insertimage', obj ); editor.execCommand('insertimage', obj);
if ( !evt.ctrlKey ) { if (!evt.ctrlKey) {
dialog.popup.hide(); dialog.popup.hide();
} }
} }
function switchTab( index ) { function switchTab(index) {
autoHeight( index ); autoHeight(index);
if ( emotion.tabExist[index] == 0 ) { if (emotion.tabExist[index] == 0) {
emotion.tabExist[index] = 1; emotion.tabExist[index] = 1;
createTab( 'tab' + index ); createTab('tab' + index);
} }
//获取呈现元素句柄数组 //获取呈现元素句柄数组
var tabHeads = $G( "tabHeads" ).getElementsByTagName( "span" ), var tabHeads = $G("tabHeads").getElementsByTagName("span"),
tabBodys = $G( "tabBodys" ).getElementsByTagName( "div" ), tabBodys = $G("tabBodys").getElementsByTagName("div"),
i = 0, L = tabHeads.length; i = 0, L = tabHeads.length;
//隐藏所有呈现元素 //隐藏所有呈现元素
for ( ; i < L; i++ ) { for (; i < L; i++) {
tabHeads[i].className = ""; tabHeads[i].className = "";
tabBodys[i].style.display = "none"; tabBodys[i].style.display = "none";
} }
@ -76,10 +76,10 @@ function switchTab( index ) {
tabBodys[index].style.display = "block"; tabBodys[index].style.display = "block";
} }
function autoHeight( index ) { function autoHeight(index) {
var iframe = dialog.getDom( "iframe" ), var iframe = dialog.getDom("iframe"),
parent = iframe.parentNode.parentNode; parent = iframe.parentNode.parentNode;
switch ( index ) { switch (index) {
case 0: case 0:
iframe.style.height = "380px"; iframe.style.height = "380px";
parent.style.height = "392px"; parent.style.height = "392px";
@ -114,71 +114,71 @@ function autoHeight( index ) {
} }
function createTab( tabName ) { function createTab(tabName) {
var faceVersion = "?v=1.1", //版本号 var faceVersion = "?v=1.1", //版本号
tab = $G( tabName ), //获取将要生成的Div句柄 tab = $G(tabName), //获取将要生成的Div句柄
imagePath = emotion.SmileyPath + emotion.imageFolders[tabName], //获取显示表情和预览表情的路径 imagePath = emotion.SmileyPath + emotion.imageFolders[tabName], //获取显示表情和预览表情的路径
positionLine = 11 / 2, //中间数 positionLine = 11 / 2, //中间数
iWidth = iHeight = 35, //图片长宽 iWidth = iHeight = 35, //图片长宽
iColWidth = 3, //表格剩余空间的显示比例 iColWidth = 3, //表格剩余空间的显示比例
tableCss = emotion.imageCss[tabName], tableCss = emotion.imageCss[tabName],
cssOffset = emotion.imageCssOffset[tabName], cssOffset = emotion.imageCssOffset[tabName],
textHTML = ['<table class="smileytable">'], textHTML = ['<table class="smileytable">'],
i = 0, imgNum = emotion.SmileyBox[tabName].length, imgColNum = 11, faceImage, i = 0, imgNum = emotion.SmileyBox[tabName].length, imgColNum = 11, faceImage,
sUrl, realUrl, posflag, offset, infor; sUrl, realUrl, posflag, offset, infor;
for ( ; i < imgNum; ) { for (; i < imgNum;) {
textHTML.push( '<tr>' ); textHTML.push('<tr>');
for ( var j = 0; j < imgColNum; j++, i++ ) { for (var j = 0; j < imgColNum; j++, i++) {
faceImage = emotion.SmileyBox[tabName][i]; faceImage = emotion.SmileyBox[tabName][i];
if ( faceImage ) { if (faceImage) {
sUrl = imagePath + faceImage + faceVersion; sUrl = imagePath + faceImage + faceVersion;
realUrl = imagePath + faceImage; realUrl = imagePath + faceImage;
posflag = j < positionLine ? 0 : 1; posflag = j < positionLine ? 0 : 1;
offset = cssOffset * i * (-1) - 1; offset = cssOffset * i * (-1) - 1;
infor = emotion.SmileyInfor[tabName][i]; infor = emotion.SmileyInfor[tabName][i];
textHTML.push( '<td class="' + tableCss + '" border="1" width="' + iColWidth + '%" style="border-collapse:collapse;" align="center" bgcolor="transparent" onclick="InsertSmiley(\'' + realUrl.replace( /'/g, "\\'" ) + '\',event)" onmouseover="over(this,\'' + sUrl + '\',\'' + posflag + '\')" onmouseout="out(this)">' ); textHTML.push('<td class="' + tableCss + '" border="1" width="' + iColWidth + '%" style="border-collapse:collapse;" align="center" bgcolor="transparent" onclick="InsertSmiley(\'' + realUrl.replace(/'/g, "\\'") + '\',event)" onmouseover="over(this,\'' + sUrl + '\',\'' + posflag + '\')" onmouseout="out(this)">');
textHTML.push( '<span>' ); textHTML.push('<span>');
textHTML.push( '<img style="background-position:left ' + offset + 'px;" title="' + infor + '" src="' + emotion.SmileyPath + (editor.options.emotionLocalization ? '0.gif" width="' : 'default/0.gif" width="') + iWidth + '" height="' + iHeight + '"></img>' ); textHTML.push('<img style="background-position:left ' + offset + 'px;" title="' + infor + '" src="' + emotion.SmileyPath + (editor.options.emotionLocalization ? '0.gif" width="' : 'default/0.gif" width="') + iWidth + '" height="' + iHeight + '"></img>');
textHTML.push( '</span>' ); textHTML.push('</span>');
} else { } else {
textHTML.push( '<td width="' + iColWidth + '%" bgcolor="#FFFFFF">' ); textHTML.push('<td width="' + iColWidth + '%" bgcolor="#FFFFFF">');
} }
textHTML.push( '</td>' ); textHTML.push('</td>');
} }
textHTML.push( '</tr>' ); textHTML.push('</tr>');
} }
textHTML.push( '</table>' ); textHTML.push('</table>');
textHTML = textHTML.join( "" ); textHTML = textHTML.join("");
tab.innerHTML = textHTML; tab.innerHTML = textHTML;
} }
function over( td, srcPath, posFlag ) { function over(td, srcPath, posFlag) {
td.style.backgroundColor = "#ACCD3C"; td.style.backgroundColor = "#ACCD3C";
$G( 'faceReview' ).style.backgroundImage = "url(" + srcPath + ")"; $G('faceReview').style.backgroundImage = "url(" + srcPath + ")";
if ( posFlag == 1 ) $G( "tabIconReview" ).className = "show"; if (posFlag == 1) $G("tabIconReview").className = "show";
$G( "tabIconReview" ).style.display = 'block'; $G("tabIconReview").style.display = 'block';
} }
function out( td ) { function out(td) {
td.style.backgroundColor = "transparent"; td.style.backgroundColor = "transparent";
var tabIconRevew = $G( "tabIconReview" ); var tabIconRevew = $G("tabIconReview");
tabIconRevew.className = ""; tabIconRevew.className = "";
tabIconRevew.style.display = 'none'; tabIconRevew.style.display = 'none';
} }
function createTabList( tabNum ) { function createTabList(tabNum) {
var obj = {}; var obj = {};
for ( var i = 0; i < tabNum; i++ ) { for (var i = 0; i < tabNum; i++) {
obj["tab" + i] = []; obj["tab" + i] = [];
} }
return obj; return obj;
} }
function createArr( tabNum ) { function createArr(tabNum) {
var arr = []; var arr = [];
for ( var i = 0; i < tabNum; i++ ) { for (var i = 0; i < tabNum; i++) {
arr[i] = 0; arr[i] = 0;
} }
return arr; return arr;

View File

@ -1,86 +1,98 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
<title></title> <title></title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" src="../internal.js?20220503"></script> <script type="text/javascript" src="../internal.js?aea0c61c"></script>
<style type="text/css"> <style type="text/css">
.wrapper { .wrapper {
width: 600px; box-sizing: border-box;
padding: 10px; width: 800px;
height: 352px; height: 390px;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
border-bottom: 1px solid #d7d7d7 border-bottom: 1px solid #d7d7d7
} }
.editor-wrap { .editor-wrap {
display: flex; display: flex;
} margin: 10px;
}
.editor-wrap #editor { .editor-wrap #editor {
width: 0; width: 0;
flex-grow: 1; flex-grow: 1;
border: 1px solid #CCC; border: 1px solid #CCC;
border-radius: 3px; border-radius: 3px;
padding: 5px; padding: 5px;
height: 100px; height: 100px;
outline: none; outline: none;
} }
.input-tip { .input-tip {
margin-top: 10px; margin: 10px;
} }
.input-tip a { .input-tip a {
color: #0f0d0d; color: #0f0d0d;
} }
.editor-preview { .editor-preview {
background: #FFF; background: #FFF;
border-radius: 3px; border-radius: 3px;
margin-top: 10px; border: 1px solid #EEE;
border: 1px solid #EEE; display: none;
display:none; margin: 10px;
} }
.editor-preview .title { .editor-preview .title {
padding: 5px; padding: 5px;
} }
.editor-preview .body { .editor-preview .body {
padding: 5px 5px 15px 5px; padding: 5px 5px 15px 5px;
text-align: center; text-align: center;
} }
.editor-preview .body .image { .editor-preview .body .image {
max-width:100%; max-width: 100%;
max-height:100px; max-height: 100px;
} }
</style> </style>
</head> </head>
<body> <body>
<div class="wrapper"> <div class="wrapper">
<div class="editor-wrap">
<textarea id="editor"></textarea> <div id="modeLive" style="display:none;">
</div> <iframe id="liveEditor"
<div class="input-tip"> frameborder="0"
基于 latex 语法,<a href="javascript:;" id="inputDemo">点击输入示例</a> style="width:800px;height:390px;border: 0;outline: none;"
</div> ></iframe>
<div class="editor-preview" id="preview">
<div class="title">预览</div>
<div class="body">
<img class="image" id="previewImage" />
</div> </div>
</div>
<div id="modePlain" style="display:none;">
<div class="editor-wrap">
<textarea id="editor"></textarea>
</div>
<div class="input-tip">
基于 latex 语法,<a href="javascript:;" id="inputDemo">点击输入示例</a>
</div>
<div class="editor-preview" id="preview">
<div class="title">预览</div>
<div class="body">
<img class="image" id="previewImage"/>
</div>
</div>
</div>
</div> </div>
<script src="../../third-party/jquery-1.10.2.js?20220503"></script> <script src="../../third-party/jquery-1.10.2.js?628072e7"></script>
<script type="text/javascript" src="../../third-party/clipboard/clipboard.js?20220503"></script> <script type="text/javascript" src="../../third-party/clipboard/clipboard.js?555edf0a"></script>
<script type="text/javascript" src="formula.js?20220903"></script> <script type="text/javascript" src="formula.js?8fdd0a42"></script>
<script type="text/javascript"> <script type="text/javascript">
utils.domReady(function () { utils.domReady(function () {
Formula.init(); Formula.init();
}); });
</script> </script>
</body> </body>
</html> </html>

View File

@ -1,71 +1,147 @@
function preg_quote(str, delimiter) { function preg_quote(str, delimiter) {
// Quote regular expression characters plus an optional character // Quote regular expression characters plus an optional character
// //
// version: 1107.2516 // version: 1107.2516
// discuss at: http://phpjs.org/functions/preg_quote // discuss at: http://phpjs.org/functions/preg_quote
// + original by: booeyOH // + original by: booeyOH
// + improved by: Ates Goral (http://magnetiq.com) // + improved by: Ates Goral (http://magnetiq.com)
// + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net) // + improved by: Kevin van Zonneveld (http://kevin.vanzonneveld.net)
// + bugfixed by: Onno Marsman // + bugfixed by: Onno Marsman
// + improved by: Brett Zamir (http://brett-zamir.me) // + improved by: Brett Zamir (http://brett-zamir.me)
// * example 1: preg_quote("$40"); // * example 1: preg_quote("$40");
// * returns 1: '\$40' // * returns 1: '\$40'
// * example 2: preg_quote("*RRRING* Hello?"); // * example 2: preg_quote("*RRRING* Hello?");
// * returns 2: '\*RRRING\* Hello\?' // * returns 2: '\*RRRING\* Hello\?'
// * example 3: preg_quote("\\.+*?[^]$(){}=!<>|:"); // * example 3: preg_quote("\\.+*?[^]$(){}=!<>|:");
// * returns 3: '\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:' // * returns 3: '\\\.\+\*\?\[\^\]\$\(\)\{\}\=\!\<\>\|\:'
return (str + '').replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\' + (delimiter || '') + '-]', 'g'), '\\$&'); return (str + '').replace(new RegExp('[.\\\\+*?\\[\\^\\]$(){}=!<>|:\\' + (delimiter || '') + '-]', 'g'), '\\$&');
}
function loadScript(url, cb) {
var script;
script = document.createElement('script');
script.src = url;
script.onload = function () {
cb && cb({isNew: true})
};
document.getElementsByTagName('head')[0].appendChild(script);
} }
var Formula = { var Formula = {
init: function () { mode: 'plain',
// console.log('Formula.init') latexeasy: null,
Formula.initValue(); init: function () {
Formula.initEvent(); // console.log('Formula.init')
Formula.initSubmit(); Formula.initMode();
}, Formula.initEvent();
render: function () { Formula.initSubmit();
var content = $.trim($('#editor').val()); },
if (!content) { renderPlain: function () {
$('#preview').hide(); var $preview = $('#preview');
return; var value = $('#editor').val();
if (!value) {
$preview.hide();
return;
}
value = encodeURIComponent(value);
var formulaConfig = editor.getOpt('formulaConfig');
var src = formulaConfig.imageUrlTemplate.replace(/\{\}/, value);
$('#previewImage').attr('src', src);
$preview.show();
},
setValuePlain: function (value) {
$('#editor').val(value);
Formula.renderPlain();
},
setValueLive: function (value) {
if (!Formula.latexeasy) {
setTimeout(function () {
Formula.setValueLive(value);
}, 100);
return;
}
Formula.latexeasy.call('set.latex', {latex: value});
},
initMode: function () {
var formulaConfig = editor.getOpt('formulaConfig');
if ('live' === formulaConfig.editorMode) {
$('#liveEditor').attr('src', formulaConfig.editorLiveServer + '/editor');
$('#modeLive').show();
Formula.mode = 'live';
} else {
$('#modePlain').show();
Formula.mode = 'plain';
}
var img = editor.selection.getRange().getClosedNode();
if (img && img.getAttribute('data-formula-image') !== null) {
var value = img.getAttribute('data-formula-image');
if (value) {
Formula.setValue(decodeURIComponent(value));
}
}
},
setValue: function (value) {
switch (Formula.mode) {
case 'plain':
Formula.setValuePlain(value);
break;
case 'live':
Formula.setValueLive(value);
break;
}
},
getValue: function (cb) {
switch (Formula.mode) {
case 'plain':
cb($.trim($('#editor').val()));
break;
case 'live':
Formula.latexeasy.call('get.latex', {}, function (data) {
cb(data.latex);
});
break;
}
},
initEvent: function () {
var changeTimer = null, le;
switch (Formula.mode) {
case 'plain':
// console.log('Formula.initEvent');
$('#editor').on('change keypress', function () {
changeTimer && clearTimeout(changeTimer);
changeTimer = setTimeout(function () {
Formula.renderPlain();
}, 1000);
});
$('#inputDemo').on('click', function () {
$('#editor').val('f(a) = \\frac{1}{2\\pi i} \\oint\\frac{f(z)}{z-a}dz');
Formula.renderPlain();
});
break;
case 'live':
var formulaConfig = editor.getOpt('formulaConfig');
loadScript(formulaConfig.editorLiveServer + '/vendor/LatexEasyEditor/editor/sdk.js', function () {
le = new window.LatexEasy(document.getElementById('liveEditor'));
le.on('ready', function () {
Formula.latexeasy = le;
});
le.init();
});
break;
}
},
initSubmit: function () {
dialog.onclose = function (t, ok) {
if (!ok) {
return true;
}
// console.log('onclose', t, ok);
Formula.getValue(function (value) {
editor.execCommand('formula', value);
editor.fireEvent('saveScene');
dialog.close(false);
});
return false;
};
} }
content = encodeURIComponent(content);
var formulaConfig = editor.getOpt('formulaConfig');
var src = formulaConfig.imageUrlTemplate.replace(/\{\}/, content);
$('#previewImage').attr('src', src);
$('#preview').show();
},
initValue: function () {
var img = editor.selection.getRange().getClosedNode();
if (img && img.getAttribute('data-formula-image') !== null) {
var value = img.getAttribute('data-formula-image');
if (value) {
$('#editor').val(decodeURIComponent(value));
Formula.render();
}
}
},
initEvent: function () {
var changeTimer = null;
// console.log('Formula.initEvent');
$('#editor').on('change keypress', function () {
changeTimer && clearTimeout(changeTimer);
changeTimer = setTimeout(function () {
Formula.render();
}, 1000);
});
$('#inputDemo').on('click', function () {
$('#editor').val('f(a) = \\frac{1}{2\\pi i} \\oint\\frac{f(z)}{z-a}dz');
Formula.render();
});
},
initSubmit: function () {
dialog.onok = function () {
editor.execCommand('formula', $.trim($('#editor').val()));
editor.fireEvent('saveScene');
};
dialog.oncancel = function () {
};
}
}; };

View File

@ -1,7 +1,37 @@
.wrapper{width: 370px;margin: 10px auto;zoom: 1;} .wrapper {
.tabbody{height: 360px;} width: 370px;
.tabbody .panel{width:100%;height: 360px;position: absolute;background: #fff;} margin: 10px auto;
.tabbody .panel h1{font-size:26px;margin: 5px 0 0 5px;} zoom: 1;
.tabbody .panel p{font-size:12px;margin: 5px 0 0 5px;} }
.tabbody table{width:90%;line-height: 20px;margin: 5px 0 0 5px;;}
.tabbody table thead{font-weight: bold;line-height: 25px;} .tabbody {
height: 360px;
}
.tabbody .panel {
width: 100%;
height: 360px;
position: absolute;
background: #fff;
}
.tabbody .panel h1 {
font-size: 26px;
margin: 5px 0 0 5px;
}
.tabbody .panel p {
font-size: 12px;
margin: 5px 0 0 5px;
}
.tabbody table {
width: 90%;
line-height: 20px;
margin: 5px 0 0 5px;;
}
.tabbody table thead {
font-weight: bold;
line-height: 25px;
}

View File

@ -1,11 +1,11 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
<title>帮助</title> <title>帮助</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<script type="text/javascript" src="../internal.js?20220503"></script> <script type="text/javascript" src="../internal.js?aea0c61c"></script>
<link rel="stylesheet" type="text/css" href="help.css?20220503"> <link rel="stylesheet" type="text/css" href="help.css?81231bdb">
</head> </head>
<body> <body>
<div class="wrapper" id="helptab"> <div class="wrapper" id="helptab">
@ -77,6 +77,6 @@
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript" src="help.js?20220503"></script> <script type="text/javascript" src="help.js?0a6823d2"></script>
</body> </body>
</html> </html>

View File

@ -11,21 +11,21 @@
* @param tabBodys * @param tabBodys
* @param obj * @param obj
*/ */
function clickHandler( tabHeads,tabBodys,obj ) { function clickHandler(tabHeads, tabBodys, obj) {
//head样式更改 //head样式更改
for ( var k = 0, len = tabHeads.length; k < len; k++ ) { for (var k = 0, len = tabHeads.length; k < len; k++) {
tabHeads[k].className = ""; tabHeads[k].className = "";
} }
obj.className = "focus"; obj.className = "focus";
//body显隐 //body显隐
var tabSrc = obj.getAttribute( "tabSrc" ); var tabSrc = obj.getAttribute("tabSrc");
for ( var j = 0, length = tabBodys.length; j < length; j++ ) { for (var j = 0, length = tabBodys.length; j < length; j++) {
var body = tabBodys[j], var body = tabBodys[j],
id = body.getAttribute( "id" ); id = body.getAttribute("id");
body.onclick = function(){ body.onclick = function () {
this.style.zoom = 1; this.style.zoom = 1;
}; };
if ( id != tabSrc ) { if (id != tabSrc) {
body.style.zIndex = 1; body.style.zIndex = 1;
} else { } else {
body.style.zIndex = 200; body.style.zIndex = 200;
@ -38,19 +38,20 @@ function clickHandler( tabHeads,tabBodys,obj ) {
* TAB切换 * TAB切换
* @param tabParentId tab的父节点ID或者对象本身 * @param tabParentId tab的父节点ID或者对象本身
*/ */
function switchTab( tabParentId ) { function switchTab(tabParentId) {
var tabElements = $G( tabParentId ).children, var tabElements = $G(tabParentId).children,
tabHeads = tabElements[0].children, tabHeads = tabElements[0].children,
tabBodys = tabElements[1].children; tabBodys = tabElements[1].children;
for ( var i = 0, length = tabHeads.length; i < length; i++ ) { for (var i = 0, length = tabHeads.length; i < length; i++) {
var head = tabHeads[i]; var head = tabHeads[i];
if ( head.className === "focus" )clickHandler(tabHeads,tabBodys, head ); if (head.className === "focus") clickHandler(tabHeads, tabBodys, head);
head.onclick = function () { head.onclick = function () {
clickHandler(tabHeads,tabBodys,this); clickHandler(tabHeads, tabBodys, this);
} }
} }
} }
switchTab("helptab"); switchTab("helptab");
document.getElementById('version').innerHTML = parent.UE.version; document.getElementById('version').innerHTML = parent.UE.version;

View File

@ -13,8 +13,9 @@
/*tab样式框大小*/ /*tab样式框大小*/
.tabhead { .tabhead {
float:left; float: left;
} }
.tabbody { .tabbody {
width: 100%; width: 100%;
height: 346px; height: 346px;
@ -38,25 +39,26 @@
} }
/* 图片对齐方式 */ /* 图片对齐方式 */
.alignBar{ .alignBar {
float:right; float: right;
margin-top: 5px; margin-top: 5px;
position: relative; position: relative;
} }
.alignBar .algnLabel{ .alignBar .algnLabel {
float:left; float: left;
height: 20px; height: 20px;
line-height: 20px; line-height: 20px;
} }
.alignBar #alignIcon{ .alignBar #alignIcon {
zoom:1; zoom: 1;
_display: inline; _display: inline;
display: inline-block; display: inline-block;
position: relative; position: relative;
} }
.alignBar #alignIcon span{
.alignBar #alignIcon span {
float: left; float: left;
cursor: pointer; cursor: pointer;
display: block; display: block;
@ -66,75 +68,85 @@
margin-left: 3px; margin-left: 3px;
background-image: url(./images/alignicon.jpg); background-image: url(./images/alignicon.jpg);
} }
.alignBar #alignIcon .none-align{
.alignBar #alignIcon .none-align {
background-position: 0 -18px; background-position: 0 -18px;
} }
.alignBar #alignIcon .left-align{
.alignBar #alignIcon .left-align {
background-position: -20px -18px; background-position: -20px -18px;
} }
.alignBar #alignIcon .right-align{
.alignBar #alignIcon .right-align {
background-position: -40px -18px; background-position: -40px -18px;
} }
.alignBar #alignIcon .center-align{
.alignBar #alignIcon .center-align {
background-position: -60px -18px; background-position: -60px -18px;
} }
.alignBar #alignIcon .none-align.focus{
.alignBar #alignIcon .none-align.focus {
background-position: 0 0; background-position: 0 0;
} }
.alignBar #alignIcon .left-align.focus{
.alignBar #alignIcon .left-align.focus {
background-position: -20px 0; background-position: -20px 0;
} }
.alignBar #alignIcon .right-align.focus{
.alignBar #alignIcon .right-align.focus {
background-position: -40px 0; background-position: -40px 0;
} }
.alignBar #alignIcon .center-align.focus{
.alignBar #alignIcon .center-align.focus {
background-position: -60px 0; background-position: -60px 0;
} }
/* 远程图片样式 */ /* 远程图片样式 */
#remote { #remote {
z-index: 200; z-index: 200;
} }
#remote .top{ #remote .top {
width: 100%; width: 100%;
margin-top: 25px; margin-top: 25px;
} }
#remote .left{
#remote .left {
display: block; display: block;
float: left; float: left;
width: 300px; width: 300px;
height:10px; height: 10px;
} }
#remote .right{
#remote .right {
display: block; display: block;
float: right; float: right;
width: 300px; width: 300px;
height:10px; height: 10px;
} }
#remote .row{
#remote .row {
margin-left: 20px; margin-left: 20px;
clear: both; clear: both;
height: 40px; height: 40px;
} }
#remote .row label{ #remote .row label {
text-align: center; text-align: center;
width: 50px; width: 50px;
zoom:1; zoom: 1;
_display: inline; _display: inline;
display:inline-block; display: inline-block;
vertical-align: middle; vertical-align: middle;
} }
#remote .row label.algnLabel{
#remote .row label.algnLabel {
float: left; float: left;
} }
#remote input.text{ #remote input.text {
width: 150px; width: 150px;
padding: 3px 6px; padding: 3px 6px;
font-size: 14px; font-size: 14px;
@ -149,52 +161,60 @@
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; -webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s; transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
} }
#remote input.text:focus { #remote input.text:focus {
outline: 0; outline: 0;
} }
#remote #url{
width: 400px; #remote #url {
margin-bottom: 2px; width: 400px;
margin-bottom: 2px;
} }
#remote #imageSelect{
width: 100px; #remote #imageSelect {
display: inline-block; width: 100px;
background: #FFF; display: inline-block;
border: 1px solid #EEE; background: #FFF;
line-height: 26px; border: 1px solid #EEE;
text-align: center; line-height: 26px;
color: #333; text-align: center;
text-decoration: none; color: #333;
border-radius: 3px; text-decoration: none;
vertical-align: top; border-radius: 3px;
vertical-align: top;
} }
#remote #width, #remote #width,
#remote #height{ #remote #height {
width: 30px; width: 30px;
margin-left: 2px; margin-left: 2px;
margin-right: 2px; margin-right: 2px;
text-align:center; text-align: center;
} }
#remote #border, #remote #border,
#remote #vhSpace, #remote #vhSpace,
#remote #title{ #remote #title {
width: 180px; width: 180px;
margin-right: 5px; margin-right: 5px;
} }
#remote #lock{
display:inline-block; #remote #lock {
vertical-align: middle; display: inline-block;
vertical-align: middle;
} }
#remote #lockicon{
#remote #lockicon {
zoom: 1; zoom: 1;
_display:inline; _display: inline;
display: inline-block; display: inline-block;
width: 20px; width: 20px;
height: 20px; height: 20px;
background: url("../../themes/default/images/lock.gif") -13px -13px no-repeat; background: url("../../themes/default/images/lock.gif") -13px -13px no-repeat;
vertical-align: middle; vertical-align: middle;
} }
#remote #preview{
#remote #preview {
clear: both; clear: both;
width: 260px; width: 260px;
height: 240px; height: 240px;
@ -256,7 +276,7 @@
color: #cccccc; color: #cccccc;
font-size: 18px; font-size: 18px;
position: relative; position: relative;
top:0; top: 0;
*top: 10px; *top: 10px;
} }
@ -456,7 +476,7 @@
line-height: 28px; line-height: 28px;
width: 100%; width: 100%;
z-index: 100; z-index: 100;
display:none; display: none;
} }
#upload .filelist li .success { #upload .filelist li .success {
@ -478,7 +498,8 @@
border: 1px solid #eeeeee; border: 1px solid #eeeeee;
border-radius: 0; border-radius: 0;
} }
#upload .filelist li.filePickerBlock div.webuploader-pick {
#upload .filelist li.filePickerBlock div.webuploader-pick {
width: 100%; width: 100%;
height: 100%; height: 100%;
margin: 0; margin: 0;
@ -511,7 +532,7 @@
background: url(./images/icons.gif) no-repeat \9; background: url(./images/icons.gif) no-repeat \9;
margin: 5px 1px 1px; margin: 5px 1px 1px;
cursor: pointer; cursor: pointer;
-webkit-tap-highlight-color: rgba(0,0,0,0); -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-user-select: none; -webkit-user-select: none;
-moz-user-select: none; -moz-user-select: none;
-ms-user-select: none; -ms-user-select: none;
@ -519,7 +540,7 @@
} }
#upload .filelist div.file-panel span.rotateLeft { #upload .filelist div.file-panel span.rotateLeft {
display:none; display: none;
background-position: 0 -24px; background-position: 0 -24px;
} }
@ -528,7 +549,7 @@
} }
#upload .filelist div.file-panel span.rotateRight { #upload .filelist div.file-panel span.rotateRight {
display:none; display: none;
background-position: -24px -24px; background-position: -24px -24px;
} }
@ -567,6 +588,7 @@
color: #6dbfff; color: #6dbfff;
margin: 0 10px 0 0; margin: 0 10px 0 0;
} }
#upload .statusBar .progress span.percentage { #upload .statusBar .progress span.percentage {
width: 0; width: 0;
height: 100%; height: 100%;
@ -575,6 +597,7 @@
background: #1483d8; background: #1483d8;
position: absolute; position: absolute;
} }
#upload .statusBar .progress span.text { #upload .statusBar .progress span.text {
position: relative; position: relative;
z-index: 10; z-index: 10;
@ -597,6 +620,7 @@
display: inline-block; display: inline-block;
float: left; float: left;
} }
#upload .statusBar .btns .webuploader-pick, #upload .statusBar .btns .webuploader-pick,
#upload .statusBar .btns .uploadBtn, #upload .statusBar .btns .uploadBtn,
#upload .statusBar .btns .uploadBtn.state-uploading, #upload .statusBar .btns .uploadBtn.state-uploading,
@ -616,6 +640,7 @@
-ms-user-select: none; -ms-user-select: none;
user-select: none; user-select: none;
} }
#upload .statusBar .btns .webuploader-pick-hover, #upload .statusBar .btns .webuploader-pick-hover,
#upload .statusBar .btns .uploadBtn:hover, #upload .statusBar .btns .uploadBtn:hover,
#upload .statusBar .btns .uploadBtn.state-uploading:hover, #upload .statusBar .btns .uploadBtn.state-uploading:hover,
@ -624,45 +649,48 @@
} }
#upload .statusBar .btns .uploadBtn, #upload .statusBar .btns .uploadBtn,
#upload .statusBar .btns .uploadBtn.state-paused{ #upload .statusBar .btns .uploadBtn.state-paused {
background: #00b7ee; background: #00b7ee;
color: #fff; color: #fff;
border-color: transparent; border-color: transparent;
} }
#upload .statusBar .btns .uploadBtn:hover, #upload .statusBar .btns .uploadBtn:hover,
#upload .statusBar .btns .uploadBtn.state-paused:hover{ #upload .statusBar .btns .uploadBtn.state-paused:hover {
background: #00a2d4; background: #00a2d4;
} }
#upload .statusBar .btns .uploadBtn.disabled { #upload .statusBar .btns .uploadBtn.disabled {
pointer-events: none; pointer-events: none;
filter:alpha(opacity=60); filter: alpha(opacity=60);
-moz-opacity:0.6; -moz-opacity: 0.6;
-khtml-opacity: 0.6; -khtml-opacity: 0.6;
opacity: 0.6; opacity: 0.6;
} }
/* 图片管理样式 */ /* 图片管理样式 */
#online { #online {
width: 100%; width: 100%;
height: 336px; height: 336px;
padding: 10px 0 0 0; padding: 10px 0 0 0;
} }
#online #imageList{
#online #imageList {
width: 100%; width: 100%;
height: 100%; height: 100%;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;
position: relative; position: relative;
} }
#online ul { #online ul {
display: block; display: block;
list-style: none; list-style: none;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
#online li { #online li {
float: left; float: left;
display: block; display: block;
@ -677,18 +705,21 @@
cursor: pointer; cursor: pointer;
position: relative; position: relative;
} }
#online li.clearFloat { #online li.clearFloat {
float: none; float: none;
clear: both; clear: both;
display: block; display: block;
width:0; width: 0;
height:0; height: 0;
margin: 0; margin: 0;
padding: 0; padding: 0;
} }
#online li img { #online li img {
cursor: pointer; cursor: pointer;
} }
#online li .icon { #online li .icon {
cursor: pointer; cursor: pointer;
width: 113px; width: 113px;
@ -700,16 +731,19 @@
border: 0; border: 0;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
#online li .icon:hover { #online li .icon:hover {
width: 107px; width: 107px;
height: 107px; height: 107px;
border: 3px solid #1094fa; border: 3px solid #1094fa;
} }
#online li.selected .icon { #online li.selected .icon {
background-image: url(images/success.png); background-image: url(images/success.png);
background-image: url(images/success.gif)\9; background-image: url(images/success.gif) \9;
background-position: 75px 75px; background-position: 75px 75px;
} }
#online li.selected .icon:hover { #online li.selected .icon:hover {
width: 107px; width: 107px;
height: 107px; height: 107px;

View File

@ -3,117 +3,123 @@
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<title>ueditor图片对话框</title> <title>ueditor图片对话框</title>
<script type="text/javascript" src="../internal.js?20220503"></script> <script type="text/javascript" src="../internal.js?aea0c61c"></script>
<!-- jquery --> <!-- jquery -->
<script type="text/javascript" src="../../third-party/jquery-1.10.2.js?20220503"></script> <script type="text/javascript" src="../../third-party/jquery-1.10.2.js?628072e7"></script>
<!-- webuploader --> <!-- webuploader -->
<script src="../../third-party/webuploader/webuploader.js?20220503"></script> <script src="../../third-party/webuploader/webuploader.js?21e72664"></script>
<link rel="stylesheet" type="text/css" href="../../third-party/webuploader/webuploader.css?20220503"> <link rel="stylesheet" type="text/css" href="../../third-party/webuploader/webuploader.css?0057c5c7">
<!-- image dialog --> <!-- image dialog -->
<link rel="stylesheet" href="image.css?20220503" type="text/css" /> <link rel="stylesheet" href="image.css?fc461d7b" type="text/css"/>
</head> </head>
<body> <body>
<div class="wrapper"> <div class="wrapper">
<div id="tabhead" class="tabhead"> <div id="tabhead" class="tabhead">
<span class="tab focus" data-content-id="remote"><var id="lang_tab_remote"></var></span> <span class="tab focus" data-content-id="remote"><var id="lang_tab_remote"></var></span>
<span style="display:none;" class="tab" data-content-id="upload"><var id="lang_tab_upload"></var></span> <span style="display:none;" class="tab" data-content-id="upload"><var id="lang_tab_upload"></var></span>
<span style="display:none;" class="tab" data-content-id="online"><var id="lang_tab_online"></var></span> <span style="display:none;" class="tab" data-content-id="online"><var id="lang_tab_online"></var></span>
</div> </div>
<div class="alignBar"> <div class="alignBar">
<label class="algnLabel"><var id="lang_input_align"></var></label> <label class="algnLabel"><var id="lang_input_align"></var></label>
<span id="alignIcon"> <span id="alignIcon">
<span id="noneAlign" class="none-align focus" data-align="none"></span> <span id="noneAlign" class="none-align focus" data-align="none"></span>
<span id="leftAlign" class="left-align" data-align="left"></span> <span id="leftAlign" class="left-align" data-align="left"></span>
<span id="rightAlign" class="right-align" data-align="right"></span> <span id="rightAlign" class="right-align" data-align="right"></span>
<span id="centerAlign" class="center-align" data-align="center"></span> <span id="centerAlign" class="center-align" data-align="center"></span>
</span> </span>
<input id="align" name="align" type="hidden" value="none"/> <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>
<a href="javascript:;" id="imageSelect" style="display:none;">选择图片</a>
</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> </div>
<script type="text/javascript" src="image.js?20220503"></script> <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>
<a href="javascript:;" id="imageSelect" style="display:none;">选择图片</a>
</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?6a7f39bf"></script>
</body> </body>
</html> </html>

View File

@ -27,32 +27,32 @@
setTabFocus(target.getAttribute('data-content-id')); setTabFocus(target.getAttribute('data-content-id'));
}); });
} }
if(!editorOpt.disableUpload){ if (!editorOpt.disableUpload) {
$G('tabhead').querySelector('[data-content-id="upload"]').style.display = 'inline-block'; $G('tabhead').querySelector('[data-content-id="upload"]').style.display = 'inline-block';
} }
if(!editorOpt.disableOnline){ if (!editorOpt.disableOnline) {
$G('tabhead').querySelector('[data-content-id="online"]').style.display = 'inline-block'; $G('tabhead').querySelector('[data-content-id="online"]').style.display = 'inline-block';
} }
if(!!editorOpt.selectCallback){ if (!!editorOpt.selectCallback) {
$G('imageSelect').style.display = 'inline-block'; $G('imageSelect').style.display = 'inline-block';
domUtils.on($G('imageSelect'), "click", function (e) { domUtils.on($G('imageSelect'), "click", function (e) {
editorOpt.selectCallback(editor,function(info){ editorOpt.selectCallback(editor, function (info) {
if(info){ if (info) {
$G('url').value = info.path; $G('url').value = info.path;
$G('title').value = info.name; $G('title').value = info.name;
var img = new Image(); var img = new Image();
img.onload = function(){ img.onload = function () {
$G('width').value = img.width; $G('width').value = img.width;
$G('height').value = img.height; $G('height').value = img.height;
remoteImage.setPreview(); remoteImage.setPreview();
}; };
img.onerror = function(){ img.onerror = function () {
remoteImage.setPreview(); remoteImage.setPreview();
}; };
img.src = info.path; img.src = info.path;
} }
});
}); });
});
} }
var img = editor.selection.getRange().getClosedNode(); var img = editor.selection.getRange().getClosedNode();
if (img && img.tagName && img.tagName.toLowerCase() == 'img') { if (img && img.tagName && img.tagName.toLowerCase() == 'img') {
@ -64,7 +64,7 @@
/* 初始化tabbody */ /* 初始化tabbody */
function setTabFocus(id) { function setTabFocus(id) {
if(!id) return; if (!id) return;
var i, bodyId, tabs = $G('tabhead').children; var i, bodyId, tabs = $G('tabhead').children;
for (i = 0; i < tabs.length; i++) { for (i = 0; i < tabs.length; i++) {
bodyId = tabs[i].getAttribute('data-content-id'); bodyId = tabs[i].getAttribute('data-content-id');
@ -121,7 +121,7 @@
break; break;
} }
if(list) { if (list) {
editor.execCommand('insertimage', list); editor.execCommand('insertimage', list);
remote && editor.fireEvent("catchRemoteImage"); remote && editor.fireEvent("catchRemoteImage");
} }
@ -130,22 +130,22 @@
/* 初始化对其方式的点击事件 */ /* 初始化对其方式的点击事件 */
function initAlign(){ function initAlign() {
/* 点击align图标 */ /* 点击align图标 */
domUtils.on($G("alignIcon"), 'click', function(e){ domUtils.on($G("alignIcon"), 'click', function (e) {
var target = e.target || e.srcElement; var target = e.target || e.srcElement;
if(target.className && target.className.indexOf('-align') != -1) { if (target.className && target.className.indexOf('-align') != -1) {
setAlign(target.getAttribute('data-align')); setAlign(target.getAttribute('data-align'));
} }
}); });
} }
/* 设置对齐方式 */ /* 设置对齐方式 */
function setAlign(align){ function setAlign(align) {
align = align || 'none'; align = align || 'none';
var aligns = $G("alignIcon").children; var aligns = $G("alignIcon").children;
for(i = 0; i < aligns.length; i++){ for (i = 0; i < aligns.length; i++) {
if(aligns[i].getAttribute('data-align') == align) { if (aligns[i].getAttribute('data-align') == align) {
domUtils.addClass(aligns[i], 'focus'); domUtils.addClass(aligns[i], 'focus');
$G("align").value = aligns[i].getAttribute('data-align'); $G("align").value = aligns[i].getAttribute('data-align');
} else { } else {
@ -153,10 +153,11 @@
} }
} }
} }
/* 获取对齐方式 */ /* 获取对齐方式 */
function getAlign(){ function getAlign() {
var align = $G("align").value || 'none'; var align = $G("align").value || 'none';
return align == 'none' ? '':align; return align == 'none' ? '' : align;
} }
@ -165,6 +166,7 @@
this.container = utils.isString(target) ? document.getElementById(target) : target; this.container = utils.isString(target) ? document.getElementById(target) : target;
this.init(); this.init();
} }
RemoteImage.prototype = { RemoteImage.prototype = {
init: function () { init: function () {
this.initContainer(); this.initContainer();
@ -194,38 +196,38 @@
domUtils.on($G("border"), 'keyup', updatePreview); domUtils.on($G("border"), 'keyup', updatePreview);
domUtils.on($G("title"), 'keyup', updatePreview); domUtils.on($G("title"), 'keyup', updatePreview);
domUtils.on($G("width"), 'keyup', function(){ domUtils.on($G("width"), 'keyup', function () {
if(locker.checked) { if (locker.checked) {
var proportion =locker.getAttribute('data-proportion'); var proportion = locker.getAttribute('data-proportion');
$G('height').value = Math.round(this.value / proportion); $G('height').value = Math.round(this.value / proportion);
} else { } else {
_this.updateLocker(); _this.updateLocker();
} }
updatePreview(); updatePreview();
}); });
domUtils.on($G("height"), 'keyup', function(){ domUtils.on($G("height"), 'keyup', function () {
if(locker.checked) { if (locker.checked) {
var proportion =locker.getAttribute('data-proportion'); var proportion = locker.getAttribute('data-proportion');
$G('width').value = Math.round(this.value * proportion); $G('width').value = Math.round(this.value * proportion);
} else { } else {
_this.updateLocker(); _this.updateLocker();
} }
updatePreview(); updatePreview();
}); });
domUtils.on($G("lock"), 'change', function(){ domUtils.on($G("lock"), 'change', function () {
var proportion = parseInt($G("width").value) /parseInt($G("height").value); var proportion = parseInt($G("width").value) / parseInt($G("height").value);
locker.setAttribute('data-proportion', proportion); locker.setAttribute('data-proportion', proportion);
}); });
function updatePreview(){ function updatePreview() {
_this.setPreview(); _this.setPreview();
} }
}, },
updateLocker: function(){ updateLocker: function () {
var width = $G('width').value, var width = $G('width').value,
height = $G('height').value, height = $G('height').value,
locker = $G('lock'); locker = $G('lock');
if(width && height && width == parseInt(width) && height == parseInt(height)) { if (width && height && width == parseInt(width) && height == parseInt(height)) {
locker.disabled = false; locker.disabled = false;
locker.title = ''; locker.title = '';
} else { } else {
@ -234,7 +236,7 @@
locker.title = lang.remoteLockError; locker.title = lang.remoteLockError;
} }
}, },
setImage: function(img){ setImage: function (img) {
/* 不是正常的图片 */ /* 不是正常的图片 */
if (!img.tagName || img.tagName.toLowerCase() != 'img' && !img.getAttribute("src") || !img.src) return; if (!img.tagName || img.tagName.toLowerCase() != 'img' && !img.getAttribute("src") || !img.src) return;
@ -244,7 +246,7 @@
/* 防止onchange事件循环调用 */ /* 防止onchange事件循环调用 */
if (src !== $G("url").value) $G("url").value = src; if (src !== $G("url").value) $G("url").value = src;
if(src) { if (src) {
/* 设置表单内容 */ /* 设置表单内容 */
$G("width").value = img.width || ''; $G("width").value = img.width || '';
$G("height").value = img.height || ''; $G("height").value = img.height || '';
@ -256,14 +258,14 @@
this.updateLocker(); this.updateLocker();
} }
}, },
getData: function(){ getData: function () {
var data = {}; var data = {};
for(var k in this.dom){ for (var k in this.dom) {
data[k] = this.dom[k].value; data[k] = this.dom[k].value;
} }
return data; return data;
}, },
setPreview: function(){ setPreview: function () {
var url = $G('url').value, var url = $G('url').value,
ow = $G('width').value, ow = $G('width').value,
oh = $G('height').value, oh = $G('height').value,
@ -273,59 +275,59 @@
width, width,
height; height;
width = ((!ow || !oh) ? preview.offsetWidth:Math.min(ow, preview.offsetWidth)); width = ((!ow || !oh) ? preview.offsetWidth : Math.min(ow, preview.offsetWidth));
width = width+(border*2) > preview.offsetWidth ? width:(preview.offsetWidth - (border*2)); width = width + (border * 2) > preview.offsetWidth ? width : (preview.offsetWidth - (border * 2));
height = (!ow || !oh) ? '':width*oh/ow; height = (!ow || !oh) ? '' : width * oh / ow;
if(url) { if (url) {
preview.innerHTML = '<img src="' + url + '" width="' + width + '" height="' + height + '" border="' + border + 'px solid #000" title="' + title + '" />'; preview.innerHTML = '<img src="' + url + '" width="' + width + '" height="' + height + '" border="' + border + 'px solid #000" title="' + title + '" />';
} }
}, },
getInsertList: function () { getInsertList: function () {
var data = this.getData(); var data = this.getData();
if(data['url']) { if (data['url']) {
var img = { var img = {
src: data['url'], src: data['url'],
_src: data['url'], _src: data['url'],
} }
img._propertyDelete = [] img._propertyDelete = []
img.style = [] img.style = []
if(data['width']){ if (data['width']) {
img.width = data['width']; img.width = data['width'];
img.style.push('width:'+data['width']+'px'); img.style.push('width:' + data['width'] + 'px');
}else{ } else {
img._propertyDelete.push('width'); img._propertyDelete.push('width');
} }
if(data['height']){ if (data['height']) {
img.height = data['height']; img.height = data['height'];
img.style.push('height:'+data['height']+'px'); img.style.push('height:' + data['height'] + 'px');
}else{ } else {
img._propertyDelete.push('height'); img._propertyDelete.push('height');
} }
if(data['border']){ if (data['border']) {
img.border = data['border']; img.border = data['border'];
}else{ } else {
img._propertyDelete.push('border'); img._propertyDelete.push('border');
} }
if(data['align']){ if (data['align']) {
img.floatStyle = data['align']; img.floatStyle = data['align'];
}else{ } else {
img._propertyDelete.push('floatStyle'); img._propertyDelete.push('floatStyle');
} }
if(data['vhSpace']){ if (data['vhSpace']) {
img.vspace = data['vhSpace']; img.vspace = data['vhSpace'];
}else{ } else {
img._propertyDelete.push('vspace'); img._propertyDelete.push('vspace');
} }
if(data['title']){ if (data['title']) {
img.alt = data['title']; img.alt = data['title'];
}else{ } else {
img._propertyDelete.push('alt'); img._propertyDelete.push('alt');
} }
if(img.style.length> 0){ if (img.style.length > 0) {
img.style = img.style.join(';'); img.style = img.style.join(';');
}else{ } else {
img._propertyDelete.push('style'); img._propertyDelete.push('style');
} }
return [img]; return [img];
} else { } else {
@ -335,12 +337,12 @@
}; };
/* 上传图片 */ /* 上传图片 */
function UploadImage(target) { function UploadImage(target) {
this.$wrap = target.constructor == String ? $('#' + target) : $(target); this.$wrap = target.constructor == String ? $('#' + target) : $(target);
this.init(); this.init();
} }
UploadImage.prototype = { UploadImage.prototype = {
init: function () { init: function () {
this.imageList = []; this.imageList = [];
@ -355,34 +357,34 @@
var _this = this, var _this = this,
$ = jQuery, // just in case. Make sure it's not an other libaray. $ = jQuery, // just in case. Make sure it's not an other libaray.
$wrap = _this.$wrap, $wrap = _this.$wrap,
// 图片容器 // 图片容器
$queue = $wrap.find('.filelist'), $queue = $wrap.find('.filelist'),
// 状态栏,包括进度和控制按钮 // 状态栏,包括进度和控制按钮
$statusBar = $wrap.find('.statusBar'), $statusBar = $wrap.find('.statusBar'),
// 文件总体选择信息。 // 文件总体选择信息。
$info = $statusBar.find('.info'), $info = $statusBar.find('.info'),
// 上传按钮 // 上传按钮
$upload = $wrap.find('.uploadBtn'), $upload = $wrap.find('.uploadBtn'),
// 上传按钮 // 上传按钮
$filePickerBtn = $wrap.find('.filePickerBtn'), $filePickerBtn = $wrap.find('.filePickerBtn'),
// 上传按钮 // 上传按钮
$filePickerBlock = $wrap.find('.filePickerBlock'), $filePickerBlock = $wrap.find('.filePickerBlock'),
// 没选择文件之前的内容。 // 没选择文件之前的内容。
$placeHolder = $wrap.find('.placeholder'), $placeHolder = $wrap.find('.placeholder'),
// 总体进度条 // 总体进度条
$progress = $statusBar.find('.progress').hide(), $progress = $statusBar.find('.progress').hide(),
// 添加的文件数量 // 添加的文件数量
fileCount = 0, fileCount = 0,
// 添加的文件总大小 // 添加的文件总大小
fileSize = 0, fileSize = 0,
// 优化retina, 在retina下这个值是2 // 优化retina, 在retina下这个值是2
ratio = window.devicePixelRatio || 1, ratio = window.devicePixelRatio || 1,
// 缩略图大小 // 缩略图大小
thumbnailWidth = 113 * ratio, thumbnailWidth = 113 * ratio,
thumbnailHeight = 113 * ratio, thumbnailHeight = 113 * ratio,
// 可能有pedding, ready, uploading, confirm, done. // 可能有pedding, ready, uploading, confirm, done.
state = '', state = '',
// 所有文件的进度信息key为file id // 所有文件的进度信息key为file id
percentages = {}, percentages = {},
supportTransition = (function () { supportTransition = (function () {
var s = document.createElement('p').style, var s = document.createElement('p').style,
@ -394,7 +396,7 @@
s = null; s = null;
return r; return r;
})(), })(),
// WebUploader实例 // WebUploader实例
uploader, uploader,
actionUrl = editor.getActionUrl(editor.getOpt('imageActionName')), actionUrl = editor.getActionUrl(editor.getOpt('imageActionName')),
acceptExtensions = (editor.getOpt('imageAllowFiles') || []).join('').replace(/\./g, ',').replace(/^[,]/, ''), acceptExtensions = (editor.getOpt('imageAllowFiles') || []).join('').replace(/\./g, ',').replace(/^[,]/, ''),
@ -409,7 +411,7 @@
return; return;
} }
uploader = _this.uploader = WebUploader.create({ var uploaderOption = {
pick: { pick: {
id: '#filePickerReady', id: '#filePickerReady',
label: lang.uploadSelectFile label: lang.uploadSelectFile
@ -425,19 +427,32 @@
duplicate: true, duplicate: true,
fileSingleSizeLimit: imageMaxSize, // 默认 2 M fileSingleSizeLimit: imageMaxSize, // 默认 2 M
threads: 1, threads: 1,
headers: editor.getOpt('serverHeaders') || {},
compress: editor.getOpt('imageCompressEnable') ? { compress: editor.getOpt('imageCompressEnable') ? {
width: imageCompressBorder, enable: editor.getOpt('imageCompressEnable'),
height: imageCompressBorder, maxWidthOrHeight: imageCompressBorder,
// 图片质量只有type为`image/jpeg`的时候才有效。 maxSize: imageMaxSize,
quality: 90, } : false
// 是否允许放大如果想要生成小图的时候不失真此选项应该设置为false. };
allowMagnify: false, if(editor.getOpt('uploadServiceEnable')) {
// 是否允许裁剪。 uploaderOption.customUpload = function (file, callback) {
crop: false, editor.getOpt('uploadServiceUpload')('image', file, {
// 是否保留头部meta信息。 success: function( res ) {
preserveHeaders: true callback.onSuccess(file, {_raw:JSON.stringify(res)});
}:false },
}); error: function( err ) {
callback.onError(file, err);
},
progress: function( percent ) {
callback.onProgress(file, percent);
}
}, {
from: 'image'
});
};
}
uploader = _this.uploader = WebUploader.create(uploaderOption);
uploader.addButton({ uploader.addButton({
id: '#filePickerBlock' id: '#filePickerBlock'
}); });
@ -451,15 +466,15 @@
// 当有文件添加进来时执行负责view的创建 // 当有文件添加进来时执行负责view的创建
function addFile(file) { function addFile(file) {
var $li = $('<li id="' + file.id + '">' + var $li = $('<li id="' + file.id + '">' +
'<p class="title">' + file.name + '</p>' + '<p class="title">' + file.name + '</p>' +
'<p class="imgWrap"></p>' + '<p class="imgWrap"></p>' +
'<p class="progress"><span></span></p>' + '<p class="progress"><span></span></p>' +
'</li>'), '</li>'),
$btns = $('<div class="file-panel">' + $btns = $('<div class="file-panel">' +
'<span class="cancel">' + lang.uploadDelete + '</span>' + '<span class="cancel">' + lang.uploadDelete + '</span>' +
'<span class="rotateRight">' + lang.uploadTurnRight + '</span>' + '<span class="rotateRight">' + lang.uploadTurnRight + '</span>' +
'<span class="rotateLeft">' + lang.uploadTurnLeft + '</span></div>').appendTo($li), '<span class="rotateLeft">' + lang.uploadTurnLeft + '</span></div>').appendTo($li),
$prgress = $li.find('p.progress span'), $prgress = $li.find('p.progress span'),
$wrap = $li.find('p.imgWrap'), $wrap = $li.find('p.imgWrap'),
$info = $('<p class="error"></p>').hide().appendTo($li), $info = $('<p class="error"></p>').hide().appendTo($li),
@ -504,7 +519,7 @@
} }
}, thumbnailWidth, thumbnailHeight); }, thumbnailWidth, thumbnailHeight);
} }
percentages[ file.id ] = [ file.size, 0 ]; percentages[file.id] = [file.size, 0];
file.rotation = 0; file.rotation = 0;
/* 检查文件格式 */ /* 检查文件格式 */
@ -524,11 +539,11 @@
// 成功 // 成功
if (cur === 'error' || cur === 'invalid') { if (cur === 'error' || cur === 'invalid') {
showError(file.statusText); showError(file.statusText);
percentages[ file.id ][ 1 ] = 1; percentages[file.id][1] = 1;
} else if (cur === 'interrupt') { } else if (cur === 'interrupt') {
showError('interrupt'); showError('interrupt');
} else if (cur === 'queued') { } else if (cur === 'queued') {
percentages[ file.id ][ 1 ] = 0; percentages[file.id][1] = 0;
} else if (cur === 'progress') { } else if (cur === 'progress') {
$info.hide(); $info.hide();
$prgress.css('display', 'block'); $prgress.css('display', 'block');
@ -581,7 +596,7 @@
// 负责view的销毁 // 负责view的销毁
function removeFile(file) { function removeFile(file) {
var $li = $('#' + file.id); var $li = $('#' + file.id);
delete percentages[ file.id ]; delete percentages[file.id];
updateTotalProgress(); updateTotalProgress();
$li.off().find('.file-panel').off().end().remove(); $li.off().find('.file-panel').off().end().remove();
} }
@ -593,8 +608,8 @@
percent; percent;
$.each(percentages, function (k, v) { $.each(percentages, function (k, v) {
total += v[ 0 ]; total += v[0];
loaded += v[ 0 ] * v[ 1 ]; loaded += v[0] * v[1];
}); });
percent = total ? loaded / total : 0; percent = total ? loaded / total : 0;
@ -606,7 +621,7 @@
function setState(val, files) { function setState(val, files) {
if (val != state) { if (val !== state) {
var stats = uploader.getStats(); var stats = uploader.getStats();
@ -620,7 +635,8 @@
$queue.addClass('element-invisible'); $queue.addClass('element-invisible');
$statusBar.addClass('element-invisible'); $statusBar.addClass('element-invisible');
$placeHolder.removeClass('element-invisible'); $placeHolder.removeClass('element-invisible');
$progress.hide(); $info.hide(); $progress.hide();
$info.hide();
uploader.refresh(); uploader.refresh();
break; break;
@ -629,25 +645,29 @@
$placeHolder.addClass('element-invisible'); $placeHolder.addClass('element-invisible');
$queue.removeClass('element-invisible'); $queue.removeClass('element-invisible');
$statusBar.removeClass('element-invisible'); $statusBar.removeClass('element-invisible');
$progress.hide(); $info.show(); $progress.hide();
$info.show();
$upload.text(lang.uploadStart); $upload.text(lang.uploadStart);
uploader.refresh(); uploader.refresh();
break; break;
/* 上传中 */ /* 上传中 */
case 'uploading': case 'uploading':
$progress.show(); $info.hide(); $progress.show();
$info.hide();
$upload.text(lang.uploadPause); $upload.text(lang.uploadPause);
break; break;
/* 暂停上传 */ /* 暂停上传 */
case 'paused': case 'paused':
$progress.show(); $info.hide(); $progress.show();
$info.hide();
$upload.text(lang.uploadContinue); $upload.text(lang.uploadContinue);
break; break;
case 'confirm': case 'confirm':
$progress.show(); $info.hide(); $progress.show();
$info.hide();
$upload.text(lang.uploadStart); $upload.text(lang.uploadStart);
stats = uploader.getStats(); stats = uploader.getStats();
@ -658,7 +678,8 @@
break; break;
case 'finish': case 'finish':
$progress.hide(); $info.show(); $progress.hide();
$info.show();
if (stats.uploadFailNum) { if (stats.uploadFailNum) {
$upload.text(lang.uploadRetry); $upload.text(lang.uploadRetry);
} else { } else {
@ -692,9 +713,7 @@
} }
} else { } else {
stats = uploader.getStats(); stats = uploader.getStats();
text = lang.updateStatusFinish.replace('_', fileCount). text = lang.updateStatusFinish.replace('_', fileCount).replace('_KB', WebUploader.formatSize(fileSize)).replace('_', stats.successNum);
replace('_KB', WebUploader.formatSize(fileSize)).
replace('_', stats.successNum);
if (stats.uploadFailNum) { if (stats.uploadFailNum) {
text += lang.updateStatusError.replace('_', stats.uploadFailNum); text += lang.updateStatusError.replace('_', stats.uploadFailNum);
@ -741,7 +760,7 @@
case 'startUpload': case 'startUpload':
/* 添加额外的GET参数 */ /* 添加额外的GET参数 */
var params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '', var params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '',
url = utils.formatUrl(actionUrl + (actionUrl.indexOf('?') == -1 ? '?':'&') + 'encode=utf-8&' + params); url = utils.formatUrl(actionUrl + (actionUrl.indexOf('?') == -1 ? '?' : '&') + 'encode=utf-8&' + params);
uploader.option('server', url); uploader.option('server', url);
setState('uploading', files); setState('uploading', files);
break; break;
@ -763,7 +782,7 @@
$percent = $li.find('.progress span'); $percent = $li.find('.progress span');
$percent.css('width', percentage * 100 + '%'); $percent.css('width', percentage * 100 + '%');
percentages[ file.id ][ 1 ] = percentage; percentages[file.id][1] = percentage;
updateTotalProgress(); updateTotalProgress();
}); });
@ -772,9 +791,15 @@
try { try {
var responseText = (ret._raw || ret), var responseText = (ret._raw || ret),
json = utils.str2json(responseText); json = utils.str2json(responseText);
json = editor.options.serverResponsePrepare(json);
if (json.state == 'SUCCESS') { if (json.state == 'SUCCESS') {
_this.imageList.push(json); _this.imageList.push(json);
$file.append('<span class="success"></span>'); $file.append('<span class="success"></span>');
// 触发上传图片事件
editor.fireEvent("uploadsuccess", {
res: json,
type: 'image'
});
} else { } else {
$file.find('.error').text(json.state).show(); $file.find('.error').text(json.state).show();
} }
@ -785,9 +810,11 @@
uploader.on('uploadError', function (file, code) { uploader.on('uploadError', function (file, code) {
}); });
uploader.on('error', function (code, file) { uploader.on('error', function (code, param1, param2) {
if (code == 'Q_TYPE_DENIED' || code == 'F_EXCEED_SIZE') { if (code === 'F_EXCEED_SIZE') {
addFile(file); editor.getOpt('tipError')(lang.errorExceedSize + ' ' + (param1 / 1024 / 1024).toFixed(1) + 'MB');
} else {
console.log('error', code, param1, param2);
} }
}); });
uploader.on('uploadComplete', function (file, ret) { uploader.on('uploadComplete', function (file, ret) {
@ -812,7 +839,7 @@
}, },
getQueueCount: function () { getQueueCount: function () {
var file, i, status, readyFile = 0, files = this.uploader.getFiles(); var file, i, status, readyFile = 0, files = this.uploader.getFiles();
for (i = 0; file = files[i++]; ) { for (i = 0; file = files[i++];) {
status = file.getStatus(); status = file.getStatus();
if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++; if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++;
} }
@ -844,6 +871,7 @@
this.container = utils.isString(target) ? document.getElementById(target) : target; this.container = utils.isString(target) ? document.getElementById(target) : target;
this.init(); this.init();
} }
OnlineImage.prototype = { OnlineImage.prototype = {
init: function () { init: function () {
this.reset(); this.reset();
@ -866,7 +894,7 @@
var _this = this; var _this = this;
/* 滚动拉取图片 */ /* 滚动拉取图片 */
domUtils.on($G('imageList'), 'scroll', function(e){ domUtils.on($G('imageList'), 'scroll', function (e) {
var panel = this; var panel = this;
if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) { if (panel.scrollHeight - (panel.offsetHeight + panel.scrollTop) < 10) {
_this.getImageData(); _this.getImageData();
@ -899,7 +927,7 @@
this.getImageData(); this.getImageData();
}, },
/* 重置界面 */ /* 重置界面 */
reset: function() { reset: function () {
this.initContainer(); this.initContainer();
this.initData(); this.initData();
}, },
@ -907,13 +935,14 @@
getImageData: function () { getImageData: function () {
var _this = this; var _this = this;
if(!_this.listEnd && !this.isLoadingData) { if (!_this.listEnd && !this.isLoadingData) {
this.isLoadingData = true; this.isLoadingData = true;
var url = editor.getActionUrl(editor.getOpt('imageManagerActionName')), var url = editor.getActionUrl(editor.getOpt('imageManagerActionName')),
isJsonp = utils.isCrossDomainUrl(url); isJsonp = utils.isCrossDomainUrl(url);
ajax.request(url, { ajax.request(url, {
'timeout': 100000, 'timeout': 100000,
'dataType': isJsonp ? 'jsonp':'', 'dataType': isJsonp ? 'jsonp' : '',
'headers': editor.options.serverHeaders || {},
'data': utils.extend({ 'data': utils.extend({
start: this.listIndex, start: this.listIndex,
size: this.listSize size: this.listSize
@ -921,17 +950,18 @@
'method': 'get', 'method': 'get',
'onsuccess': function (r) { 'onsuccess': function (r) {
try { try {
var json = isJsonp ? r:eval('(' + r.responseText + ')'); var json = isJsonp ? r : eval('(' + r.responseText + ')');
if (json.state == 'SUCCESS') { json = editor.options.serverResponsePrepare(json);
if (json.state === 'SUCCESS') {
_this.pushData(json.list); _this.pushData(json.list);
_this.listIndex = parseInt(json.start) + parseInt(json.list.length); _this.listIndex = parseInt(json.start) + parseInt(json.list.length);
if(_this.listIndex >= json.total) { if (_this.listIndex >= json.total) {
_this.listEnd = true; _this.listEnd = true;
} }
_this.isLoadingData = false; _this.isLoadingData = false;
} }
} catch (e) { } catch (e) {
if(r.responseText.indexOf('ue_separate_ue') != -1) { if (r.responseText.indexOf('ue_separate_ue') != -1) {
var list = r.responseText.split(r.responseText); var list = r.responseText.split(r.responseText);
_this.pushData(list); _this.pushData(list);
_this.listIndex = parseInt(list.length); _this.listIndex = parseInt(list.length);
@ -951,18 +981,18 @@
var i, item, img, icon, _this = this, var i, item, img, icon, _this = this,
urlPrefix = editor.getOpt('imageManagerUrlPrefix'); urlPrefix = editor.getOpt('imageManagerUrlPrefix');
for (i = 0; i < list.length; i++) { for (i = 0; i < list.length; i++) {
if(list[i] && list[i].url) { if (list[i] && list[i].url) {
item = document.createElement('li'); item = document.createElement('li');
img = document.createElement('img'); img = document.createElement('img');
icon = document.createElement('span'); icon = document.createElement('span');
domUtils.on(img, 'load', (function(image){ domUtils.on(img, 'load', (function (image) {
return function(){ return function () {
_this.scale(image, image.parentNode.offsetWidth, image.parentNode.offsetHeight); _this.scale(image, image.parentNode.offsetWidth, image.parentNode.offsetHeight);
} }
})(img)); })(img));
img.width = 113; img.width = 113;
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 + (list[i].url.indexOf('?') == -1 ? '?noCache=' : '&noCache=') + (+new Date()).toString(36));
img.setAttribute('_src', urlPrefix + list[i].url); img.setAttribute('_src', urlPrefix + list[i].url);
domUtils.addClass(icon, 'icon'); domUtils.addClass(icon, 'icon');

View File

@ -3,96 +3,132 @@
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title></title> <title></title>
<script type="text/javascript" src="../internal.js?20220503"></script> <script type="text/javascript" src="../internal.js?aea0c61c"></script>
<link rel="stylesheet" href="../../themes/default/dialog.css?963f161c">
<style type="text/css"> <style type="text/css">
.warp {width: 320px;height: 200px;margin-left:5px;padding: 20px 0 0 15px;position: relative;} .warp {
#url {width: 290px; margin-bottom: 2px; margin-left: -6px; margin-left: -2px\9;*margin-left:0;_margin-left:0; } width: 320px;
.format span{display: inline-block; width: 58px;text-align:left; zoom:1;} height: 200px;
table td{padding:5px 0;} margin-left: 5px;
input[type="text"]{height:30px;border:1px solid #EEE;border-radius:3px;padding:0 5px;line-height:2px;outline:none;} padding: 20px 0 0 15px;
#align{width: 65px;height: 23px;line-height: 22px;} position: relative;
}
#url {
width: 290px;
margin-bottom: 2px;
margin-left: -6px;
margin-left: -2px \9;
*margin-left: 0;
_margin-left: 0;
}
.format span {
display: inline-block;
width: 58px;
text-align: left;
zoom: 1;
}
table td {
padding: 5px 0;
}
#align {
width: 65px;
height: 23px;
line-height: 22px;
}
</style> </style>
</head> </head>
<body> <body>
<div class="warp"> <div class="warp">
<table width="300" cellpadding="0" cellspacing="0"> <table width="300" cellpadding="0" cellspacing="0">
<tr> <tr>
<td colspan="2" class="format"> <td colspan="2" class="format">
<span><var id="lang_input_address"></var></span> <span><var id="lang_input_address"></var></span>
<input style="width:200px" id="url" type="text" value=""/> <input style="width:200px" id="url" type="text" value=""/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" class="format"><span><var id="lang_input_width"></var></span><input style="width:200px" type="text" id="width"/> px</td> <td colspan="2" class="format"><span><var id="lang_input_width"></var></span><input style="width:200px"
type="text" id="width"/>
px
</td>
</tr> </tr>
<tr> <tr>
<td colspan="2" class="format"><span><var id="lang_input_height"></var></span><input style="width:200px" type="text" id="height"/> px</td> <td colspan="2" class="format"><span><var id="lang_input_height"></var></span><input style="width:200px"
</tr> type="text"
<tr> id="height"/> px
<td><span><var id="lang_input_isScroll"></var></span><input type="checkbox" id="scroll"/> </td> </td>
<td><span><var id="lang_input_frameborder"></var></span><input type="checkbox" id="frameborder"/> </td> </tr>
</tr> <tr>
<td><span><var id="lang_input_isScroll"></var></span><input type="checkbox" id="scroll"/></td>
<td><span><var id="lang_input_frameborder"></var></span><input type="checkbox" id="frameborder"/></td>
</tr>
<tr> <tr>
<td colspan="2"><span><var id="lang_input_alignMode"></var></span> <td colspan="2"><span><var id="lang_input_alignMode"></var></span>
<select id="align"> <select id="align">
<option value=""></option> <option value=""></option>
<option value="left"></option> <option value="left"></option>
<option value="right"></option> <option value="right"></option>
</select> </select>
</td> </td>
</tr> </tr>
</table> </table>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var iframe = editor._iframe; var iframe = editor._iframe;
if(iframe){ if (iframe) {
$G("url").value = iframe.getAttribute("src")||""; $G("url").value = iframe.getAttribute("src") || "";
$G("width").value = iframe.getAttribute("width")||iframe.style.width.replace("px","")||""; $G("width").value = iframe.getAttribute("width") || iframe.style.width.replace("px", "") || "";
$G("height").value = iframe.getAttribute("height") || iframe.style.height.replace("px","") ||""; $G("height").value = iframe.getAttribute("height") || iframe.style.height.replace("px", "") || "";
$G("scroll").checked = (iframe.getAttribute("scrolling") == "yes") ? true : false; $G("scroll").checked = (iframe.getAttribute("scrolling") == "yes") ? true : false;
$G("frameborder").checked = (iframe.getAttribute("frameborder") == "1") ? true : false; $G("frameborder").checked = (iframe.getAttribute("frameborder") == "1") ? true : false;
$G("align").value = iframe.align ? iframe.align : ""; $G("align").value = iframe.align ? iframe.align : "";
} }
function queding(){
var url = $G("url").value.replace(/^\s*|\s*$/ig,""), function queding() {
width = $G("width").value, var url = $G("url").value.replace(/^\s*|\s*$/ig, ""),
height = $G("height").value, width = $G("width").value,
scroll = $G("scroll"), height = $G("height").value,
frameborder = $G("frameborder"), scroll = $G("scroll"),
float = $G("align").value, frameborder = $G("frameborder"),
newIframe = editor.document.createElement("iframe"), float = $G("align").value,
div; newIframe = editor.document.createElement("iframe"),
if(!url){ div;
if (!url) {
alert(lang.enterAddress); alert(lang.enterAddress);
return false; return false;
} }
newIframe.setAttribute("src",/http:\/\/|https:\/\//ig.test(url) ? url : "http://"+url); newIframe.setAttribute("src", /http:\/\/|https:\/\//ig.test(url) ? url : "http://" + url);
/^[1-9]+[.]?\d*$/g.test( width ) ? newIframe.setAttribute("width",width) : ""; /^[1-9]+[.]?\d*$/g.test(width) ? newIframe.setAttribute("width", width) : "";
/^[1-9]+[.]?\d*$/g.test( height ) ? newIframe.setAttribute("height",height) : ""; /^[1-9]+[.]?\d*$/g.test(height) ? newIframe.setAttribute("height", height) : "";
scroll.checked ? newIframe.setAttribute("scrolling","yes") : newIframe.setAttribute("scrolling","no"); scroll.checked ? newIframe.setAttribute("scrolling", "yes") : newIframe.setAttribute("scrolling", "no");
frameborder.checked ? newIframe.setAttribute("frameborder","1",0) : newIframe.setAttribute("frameborder","0",0); frameborder.checked ? newIframe.setAttribute("frameborder", "1", 0) : newIframe.setAttribute("frameborder", "0", 0);
float ? newIframe.setAttribute("align",float) : newIframe.setAttribute("align",""); float ? newIframe.setAttribute("align", float) : newIframe.setAttribute("align", "");
if(iframe){ if (iframe) {
iframe.parentNode.insertBefore(newIframe,iframe); iframe.parentNode.insertBefore(newIframe, iframe);
domUtils.remove(iframe); domUtils.remove(iframe);
}else{ } else {
div = editor.document.createElement("div"); div = editor.document.createElement("div");
div.appendChild(newIframe); div.appendChild(newIframe);
editor.execCommand("inserthtml",div.innerHTML); editor.execCommand("inserthtml", div.innerHTML);
} }
editor._iframe = null; editor._iframe = null;
dialog.close(); dialog.close();
} }
dialog.onok = queding; dialog.onok = queding;
$G("url").onkeydown = function(evt){ $G("url").onkeydown = function (evt) {
evt = evt || event; evt = evt || event;
if(evt.keyCode == 13){ if (evt.keyCode == 13) {
queding(); queding();
} }
}; };
$focus($G( "url" )); $focus($G("url"));
</script> </script>
</body> </body>

View File

@ -1,7 +1,7 @@
(function () { (function () {
var parent = window.parent; var parent = window.parent;
//dialog对象 //dialog对象
dialog = parent.$EDITORUI[window.frameElement.id.replace( /_iframe$/, '' )]; dialog = parent.$EDITORUI[window.frameElement.id.replace(/_iframe$/, '')];
//当前打开dialog的编辑器实例 //当前打开dialog的编辑器实例
editor = dialog.editor; editor = dialog.editor;
@ -15,65 +15,65 @@
ajax = UE.ajax; ajax = UE.ajax;
$G = function ( id ) { $G = function (id) {
return document.getElementById( id ) return document.getElementById(id)
}; };
//focus元素 //focus元素
$focus = function ( node ) { $focus = function (node) {
setTimeout( function () { setTimeout(function () {
if ( browser.ie ) { if (browser.ie) {
var r = node.createTextRange(); var r = node.createTextRange();
r.collapse( false ); r.collapse(false);
r.select(); r.select();
} else { } else {
node.focus() node.focus()
} }
}, 0 ) }, 0)
}; };
utils.loadFile(document,{ utils.loadFile(document, {
href:editor.options.themePath + editor.options.theme + "/dialogbase.css?cache="+Math.random(), href: editor.options.themePath + editor.options.theme + "/dialogbase.css?cache=" + Math.random(),
tag:"link", tag: "link",
type:"text/css", type: "text/css",
rel:"stylesheet" rel: "stylesheet"
}); });
lang = editor.getLang(dialog.className.split( "-" )[2]); lang = editor.getLang(dialog.className.split("-")[2]);
if(lang){ if (lang) {
domUtils.on(window,'load',function () { domUtils.on(window, 'load', function () {
var langImgPath = editor.options.langPath + editor.options.lang + "/images/"; var langImgPath = editor.options.langPath + editor.options.lang + "/images/";
//针对静态资源 //针对静态资源
for ( var i in lang["static"] ) { for (var i in lang["static"]) {
var dom = $G( i ); var dom = $G(i);
if(!dom) continue; if (!dom) continue;
var tagName = dom.tagName, var tagName = dom.tagName,
content = lang["static"][i]; content = lang["static"][i];
if(content.src){ if (content.src) {
//clone //clone
content = utils.extend({},content,false); content = utils.extend({}, content, false);
content.src = langImgPath + content.src; content.src = langImgPath + content.src;
} }
if(content.style){ if (content.style) {
content = utils.extend({},content,false); content = utils.extend({}, content, false);
content.style = content.style.replace(/url\s*\(/g,"url(" + langImgPath) content.style = content.style.replace(/url\s*\(/g, "url(" + langImgPath)
} }
switch ( tagName.toLowerCase() ) { switch (tagName.toLowerCase()) {
case "var": case "var":
dom.parentNode.replaceChild( document.createTextNode( content ), dom ); dom.parentNode.replaceChild(document.createTextNode(content), dom);
break; break;
case "select": case "select":
var ops = dom.options; var ops = dom.options;
for ( var j = 0, oj; oj = ops[j]; ) { for (var j = 0, oj; oj = ops[j];) {
oj.innerHTML = content.options[j++]; oj.innerHTML = content.options[j++];
} }
for ( var p in content ) { for (var p in content) {
p != "options" && dom.setAttribute( p, content[p] ); p != "options" && dom.setAttribute(p, content[p]);
} }
break; break;
default : default :
domUtils.setAttributes( dom, content); domUtils.setAttributes(dom, content);
} }
} }
} ); });
} }

View File

@ -1,127 +1,148 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
<title></title> <title></title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" src="../internal.js?20220503"></script> <script type="text/javascript" src="../internal.js?aea0c61c"></script>
<style type="text/css"> <style type="text/css">
*{margin:0;padding:0;color: #838383;} * {
table{font-size: 12px;margin: 10px;line-height:36px;width:100%;} margin: 0;
.txt{box-sizing:border-box;width:90%;height:30px;line-height:30px;border:1px solid #d7d7d7;border-radius:3px;padding:0 5px;outline:none;} padding: 0;
color: #838383;
}
table {
font-size: 12px;
margin: 10px;
line-height: 36px;
width: 100%;
}
.txt {
box-sizing: border-box;
width: 90%;
height: 30px;
line-height: 30px;
border: 1px solid #d7d7d7;
border-radius: 3px;
padding: 0 5px;
outline: none;
}
</style> </style>
</head> </head>
<body> <body>
<div style="padding:10px;"> <div style="padding:10px;">
<table> <table>
<tr> <tr>
<td><label for="text"> <var id="lang_input_text"></var></label></td> <td><label for="text"> <var id="lang_input_text"></var></label></td>
<td><input class="txt" id="text" type="text" disabled="true"/></td> <td><input class="txt" id="text" type="text" disabled="true"/></td>
</tr> </tr>
<tr> <tr>
<td><label for="href"> <var id="lang_input_url"></var></label></td> <td><label for="href"> <var id="lang_input_url"></var></label></td>
<td><input class="txt" id="href" type="text" /></td> <td><input class="txt" id="href" type="text"/></td>
</tr> </tr>
<tr> <tr>
<td><label for="title"> <var id="lang_input_title"></var></label></td> <td><label for="title"> <var id="lang_input_title"></var></label></td>
<td><input class="txt" id="title" type="text"/></td> <td><input class="txt" id="title" type="text"/></td>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<label for="target"><var id="lang_input_target"></var></label> <label for="target"><var id="lang_input_target"></var></label>
<input id="target" type="checkbox"/> <input id="target" type="checkbox"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2" id="msg"></td> <td colspan="2" id="msg"></td>
</tr> </tr>
</table> </table>
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
editor.setOpt('allowLinkProtocols', ['http:', 'https:', '#', '/', 'ftp:', 'mailto:', 'tel:']); editor.setOpt('allowLinkProtocols', ['http:', 'https:', '#', '/', 'ftp:', 'mailto:', 'tel:']);
var allowLinkProtocols = editor.getOpt('allowLinkProtocols'); var allowLinkProtocols = editor.getOpt('allowLinkProtocols');
var range = editor.selection.getRange(), var range = editor.selection.getRange(),
link = range.collapsed ? editor.queryCommandValue( "link" ) : editor.selection.getStart(), link = range.collapsed ? editor.queryCommandValue("link") : editor.selection.getStart(),
url, url,
text = $G('text'), text = $G('text'),
rangeLink = domUtils.findParentByTagName(range.getCommonAncestor(),'a',true), rangeLink = domUtils.findParentByTagName(range.getCommonAncestor(), 'a', true),
orgText; orgText;
link = domUtils.findParentByTagName( link, "a", true ); link = domUtils.findParentByTagName(link, "a", true);
if(link){ if (link) {
url = utils.html(link.getAttribute( '_href' ) || link.getAttribute( 'href', 2 )); url = utils.html(link.getAttribute('_href') || link.getAttribute('href', 2));
if(rangeLink === link && !link.getElementsByTagName('img').length){ if (rangeLink === link && !link.getElementsByTagName('img').length) {
text.removeAttribute('disabled'); text.removeAttribute('disabled');
orgText = text.value = link[browser.ie ? 'innerText':'textContent']; orgText = text.value = link[browser.ie ? 'innerText' : 'textContent'];
}else{ } else {
text.setAttribute('disabled','true'); text.setAttribute('disabled', 'true');
text.value = lang.validLink; text.value = lang.validLink;
} }
}else{ } else {
if(range.collapsed){ if (range.collapsed) {
text.removeAttribute('disabled'); text.removeAttribute('disabled');
text.value = ''; text.value = '';
}else{ } else {
text.setAttribute('disabled','true'); text.setAttribute('disabled', 'true');
text.value = lang.validLink; text.value = lang.validLink;
} }
} }
$G("title").value = url ? link.title : ""; $G("title").value = url ? link.title : "";
$G("href").value = url ? url: ''; $G("href").value = url ? url : '';
$G("target").checked = url && link.target == "_blank" ? true : false; $G("target").checked = url && link.target == "_blank" ? true : false;
$focus($G("href")); $focus($G("href"));
function handleDialogOk(){ function handleDialogOk() {
var href =$G('href').value.replace(/^\s+|\s+$/g, ''); var href = $G('href').value.replace(/^\s+|\s+$/g, '');
if(href){ if (href) {
if(!hrefStartWith(href, allowLinkProtocols)) { if (!hrefStartWith(href, allowLinkProtocols)) {
href = "http://" + href; href = "http://" + href;
} }
var obj = { var obj = {
'href' : href, 'href': href,
'target' : $G("target").checked ? "_blank" : '_self', 'target': $G("target").checked ? "_blank" : '_self',
'title' : $G("title").value.replace(/^\s+|\s+$/g, ''), 'title': $G("title").value.replace(/^\s+|\s+$/g, ''),
'_href':href '_href': href
}; };
//修改链接内容的情况太特殊了,所以先做到这里了 //修改链接内容的情况太特殊了,所以先做到这里了
//todo:情况多的时候做到command里 //todo:情况多的时候做到command里
if(orgText && text.value != orgText){ if (orgText && text.value != orgText) {
link[browser.ie ? 'innerText' : 'textContent'] = obj.textValue = text.value; link[browser.ie ? 'innerText' : 'textContent'] = obj.textValue = text.value;
range.selectNode(link).select() range.selectNode(link).select()
} }
if(range.collapsed){ if (range.collapsed) {
obj.textValue = text.value; obj.textValue = text.value;
} }
editor.execCommand('link',utils.clearEmptyAttrs(obj) ); editor.execCommand('link', utils.clearEmptyAttrs(obj));
dialog.close(); dialog.close();
} }
} }
dialog.onok = handleDialogOk; dialog.onok = handleDialogOk;
$G('href').onkeydown = $G('title').onkeydown = function(evt){ $G('href').onkeydown = $G('title').onkeydown = function (evt) {
evt = evt || window.event; evt = evt || window.event;
if (evt.keyCode == 13) { if (evt.keyCode == 13) {
handleDialogOk(); handleDialogOk();
return false; return false;
} }
}; };
$G('href').onblur = function(){ $G('href').onblur = function () {
if(!hrefStartWith(this.value, allowLinkProtocols)){ if (!hrefStartWith(this.value, allowLinkProtocols)) {
$G("msg").innerHTML = "<span style='color: red'>"+lang.httpPrompt+"</span>"; $G("msg").innerHTML = "<span style='color: red'>" + lang.httpPrompt + "</span>";
}else{ } else {
$G("msg").innerHTML = ""; $G("msg").innerHTML = "";
} }
}; };
function hrefStartWith(href,arr){ function hrefStartWith(href, arr) {
href = href.replace(/^\s+|\s+$/g, ''); href = href.replace(/^\s+|\s+$/g, '');
for(var i=0,ai;ai=arr[i++];){ for (var i = 0, ai; ai = arr[i++];) {
if(href.indexOf(ai)==0){ if (href.indexOf(ai) == 0) {
return true; return true;
} }
} }

View File

@ -1,40 +1,45 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<style> <style>
html,body{ html, body {
height:100%; height: 100%;
width:100%; width: 100%;
padding:0; padding: 0;
margin: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?20220503"></script>
<script src="../../ueditor.parse.js?20220503"></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>
#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?aea0c61c"></script>
<script src="../../ueditor.parse.js?8e3d12c6"></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> </html>

View File

@ -1,72 +1,324 @@
/*common /*common
*/ */
body{margin: 0;} body {
table{width:100%;} margin: 0;
table td{padding:2px 4px;vertical-align: middle;} }
a{text-decoration: none;}
em{font-style: normal;} table {
.border_style1{border: 1px solid #ccc;border-radius: 5px;box-shadow:2px 2px 5px #d3d6da;} width: 100%;
}
table td {
padding: 2px 4px;
vertical-align: middle;
}
a {
text-decoration: none;
}
em {
font-style: normal;
}
.border_style1 {
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 2px 2px 5px #d3d6da;
}
/*module /*module
*/ */
.main{margin: 8px;overflow: hidden;} .main {
margin: 8px;
overflow: hidden;
}
.hot{float:left;height:335px;} .hot {
.drawBoard{position: relative; cursor: crosshair;} float: left;
.brushBorad{position: absolute;left:0;top:0;z-index: 998;} height: 335px;
.picBoard{border: none;text-align: center;line-height: 300px;cursor: default;} }
.operateBar{margin-top:10px;font-size:12px;text-align: center;}
.operateBar span{margin-left: 10px;}
.drawToolbar{float:right;width:110px;height:300px;overflow: hidden;} .drawBoard {
.colorBar{margin-top:10px;font-size: 12px;text-align: center;} position: relative;
.colorBar a{display:block;width: 10px;height: 10px;border:1px solid #1006F1;border-radius: 3px; box-shadow:2px 2px 5px #d3d6da;opacity: 0.3} cursor: crosshair;
.sectionBar{margin-top:15px;font-size: 12px;text-align: center;} }
.sectionBar a{display:inline-block;width:10px;height:12px;color: #888;text-indent: -999px;opacity: 0.3}
.size1{background: url('images/size.png') 1px center no-repeat ;} .brushBorad {
.size2{background: url('images/size.png') -10px center no-repeat;} position: absolute;
.size3{background: url('images/size.png') -22px center no-repeat;} left: 0;
.size4{background: url('images/size.png') -35px center no-repeat;} top: 0;
z-index: 998;
}
.picBoard {
border: none;
text-align: center;
line-height: 300px;
cursor: default;
}
.operateBar {
margin-top: 10px;
font-size: 12px;
text-align: center;
}
.operateBar span {
margin-left: 10px;
}
.drawToolbar {
float: right;
width: 110px;
height: 300px;
overflow: hidden;
}
.colorBar {
margin-top: 10px;
font-size: 12px;
text-align: center;
}
.colorBar a {
display: block;
width: 10px;
height: 10px;
border: 1px solid #1006F1;
border-radius: 3px;
box-shadow: 2px 2px 5px #d3d6da;
opacity: 0.3
}
.sectionBar {
margin-top: 15px;
font-size: 12px;
text-align: center;
}
.sectionBar a {
display: inline-block;
width: 10px;
height: 12px;
color: #888;
text-indent: -999px;
opacity: 0.3
}
.size1 {
background: url('images/size.png') 1px center no-repeat;
}
.size2 {
background: url('images/size.png') -10px center no-repeat;
}
.size3 {
background: url('images/size.png') -22px center no-repeat;
}
.size4 {
background: url('images/size.png') -35px center no-repeat;
}
.addImgH {
position: relative;
}
.addImgH_form {
position: absolute;
left: 18px;
top: -1px;
width: 75px;
height: 21px;
opacity: 0;
cursor: pointer;
}
.addImgH_form input {
width: 100%;
}
.addImgH{position: relative;}
.addImgH_form{position: absolute;left: 18px;top: -1px;width: 75px;height: 21px;opacity: 0;cursor: pointer;}
.addImgH_form input{width: 100%;}
/*scrawl遮罩层 /*scrawl遮罩层
*/ */
.maskLayerNull{display: none;} .maskLayerNull {
.maskLayer{position: absolute;top:0;left:0;width: 100%; height: 100%;opacity: 0.7; display: none;
background-color: #fff;text-align:center;font-weight:bold;line-height:300px;z-index: 1000;} }
.maskLayer {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0.7;
background-color: #fff;
text-align: center;
font-weight: bold;
line-height: 300px;
z-index: 1000;
}
/*btn state /*btn state
*/ */
.previousStepH .icon{display: inline-block;width:16px;height:16px;background-image: url('images/undoH.png');cursor: pointer;} .previousStepH .icon {
.previousStepH .text{color:#888;cursor:pointer;} display: inline-block;
.previousStep .icon{display: inline-block;width:16px;height:16px;background-image: url('images/undo.png');cursor:default;} width: 16px;
.previousStep .text{color:#ccc;cursor:default;} height: 16px;
background-image: url('images/undoH.png');
cursor: pointer;
}
.nextStepH .icon{display: inline-block;width:16px;height:16px;background-image: url('images/redoH.png');cursor: pointer;} .previousStepH .text {
.nextStepH .text{color:#888;cursor:pointer;} color: #888;
.nextStep .icon{display: inline-block;width:16px;height:16px;background-image: url('images/redo.png');cursor:default;} cursor: pointer;
.nextStep .text{color:#ccc;cursor:default;} }
.clearBoardH .icon{display: inline-block;width:16px;height:16px;background-image: url('images/emptyH.png');cursor: pointer;} .previousStep .icon {
.clearBoardH .text{color:#888;cursor:pointer;} display: inline-block;
.clearBoard .icon{display: inline-block;width:16px;height:16px;background-image: url('images/empty.png');cursor:default;} width: 16px;
.clearBoard .text{color:#ccc;cursor:default;} height: 16px;
background-image: url('images/undo.png');
cursor: default;
}
.scaleBoardH .icon{display: inline-block;width:16px;height:16px;background-image: url('images/scaleH.png');cursor: pointer;} .previousStep .text {
.scaleBoardH .text{color:#888;cursor:pointer;} color: #ccc;
.scaleBoard .icon{display: inline-block;width:16px;height:16px;background-image: url('images/scale.png');cursor:default;} cursor: default;
.scaleBoard .text{color:#ccc;cursor:default;} }
.removeImgH .icon{display: inline-block;width:16px;height:16px;background-image: url('images/delimgH.png');cursor: pointer;} .nextStepH .icon {
.removeImgH .text{color:#888;cursor:pointer;} display: inline-block;
.removeImg .icon{display: inline-block;width:16px;height:16px;background-image: url('images/delimg.png');cursor:default;} width: 16px;
.removeImg .text{color:#ccc;cursor:default;} height: 16px;
background-image: url('images/redoH.png');
cursor: pointer;
}
.nextStepH .text {
color: #888;
cursor: pointer;
}
.nextStep .icon {
display: inline-block;
width: 16px;
height: 16px;
background-image: url('images/redo.png');
cursor: default;
}
.nextStep .text {
color: #ccc;
cursor: default;
}
.clearBoardH .icon {
display: inline-block;
width: 16px;
height: 16px;
background-image: url('images/emptyH.png');
cursor: pointer;
}
.clearBoardH .text {
color: #888;
cursor: pointer;
}
.clearBoard .icon {
display: inline-block;
width: 16px;
height: 16px;
background-image: url('images/empty.png');
cursor: default;
}
.clearBoard .text {
color: #ccc;
cursor: default;
}
.scaleBoardH .icon {
display: inline-block;
width: 16px;
height: 16px;
background-image: url('images/scaleH.png');
cursor: pointer;
}
.scaleBoardH .text {
color: #888;
cursor: pointer;
}
.scaleBoard .icon {
display: inline-block;
width: 16px;
height: 16px;
background-image: url('images/scale.png');
cursor: default;
}
.scaleBoard .text {
color: #ccc;
cursor: default;
}
.removeImgH .icon {
display: inline-block;
width: 16px;
height: 16px;
background-image: url('images/delimgH.png');
cursor: pointer;
}
.removeImgH .text {
color: #888;
cursor: pointer;
}
.removeImg .icon {
display: inline-block;
width: 16px;
height: 16px;
background-image: url('images/delimg.png');
cursor: default;
}
.removeImg .text {
color: #ccc;
cursor: default;
}
.addImgH .icon {
vertical-align: top;
display: inline-block;
width: 16px;
height: 16px;
background-image: url('images/addimg.png')
}
.addImgH .text {
color: #888;
cursor: pointer;
}
.addImgH .icon{vertical-align:top;display: inline-block;width:16px;height:16px;background-image: url('images/addimg.png')}
.addImgH .text{color:#888;cursor:pointer;}
/*icon /*icon
*/ */
.brushIcon{display: inline-block;width:16px;height:16px;background-image: url('images/brush.png')} .brushIcon {
.eraserIcon{display: inline-block;width:16px;height:16px;background-image: url('images/eraser.png')} display: inline-block;
width: 16px;
height: 16px;
background-image: url('images/brush.png')
}
.eraserIcon {
display: inline-block;
width: 16px;
height: 16px;
background-image: url('images/eraser.png')
}

View File

@ -4,8 +4,8 @@
<title></title> <title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="robots" content="noindex, nofollow"/> <meta name="robots" content="noindex, nofollow"/>
<script type="text/javascript" src="../internal.js?20220503"></script> <script type="text/javascript" src="../internal.js?aea0c61c"></script>
<link rel="stylesheet" type="text/css" href="scrawl.css?20220503"> <link rel="stylesheet" type="text/css" href="scrawl.css?5bdd07f3">
</head> </head>
<body> <body>
<div class="main" id="J_wrap"> <div class="main" id="J_wrap">
@ -70,21 +70,21 @@
</div> </div>
<div id="J_maskLayer" class="maskLayerNull"></div> <div id="J_maskLayer" class="maskLayerNull"></div>
<script type="text/javascript" src="scrawl.js?20220503"></script> <script type="text/javascript" src="scrawl.js?e3d28a2b"></script>
<script type="text/javascript"> <script type="text/javascript">
var settings = { var settings = {
drawBrushSize:3, //画笔初始大小 drawBrushSize: 3, //画笔初始大小
drawBrushColor:"#4bacc6", //画笔初始颜色 drawBrushColor: "#4bacc6", //画笔初始颜色
colorList:['c00000', 'ff0000', 'ffc000', 'ffff00', '92d050', '00b050', '00b0f0', '0070c0', '002060', '7030a0', 'ffffff', colorList: ['c00000', 'ff0000', 'ffc000', 'ffff00', '92d050', '00b050', '00b0f0', '0070c0', '002060', '7030a0', 'ffffff',
'000000', 'eeece1', '1f497d', '4f81bd', 'c0504d', '9bbb59', '8064a2', '4bacc6', 'f79646'], //画笔选择颜色 '000000', 'eeece1', '1f497d', '4f81bd', 'c0504d', '9bbb59', '8064a2', '4bacc6', 'f79646'], //画笔选择颜色
saveNum:10 //撤销次数 saveNum: 10 //撤销次数
}; };
var scrawlObj = new scrawl( settings ); var scrawlObj = new scrawl(settings);
scrawlObj.isCancelScrawl = false; scrawlObj.isCancelScrawl = false;
dialog.onok = function () { dialog.onok = function () {
exec( scrawlObj ); exec(scrawlObj);
return false; return false;
}; };
dialog.oncancel = function () { dialog.oncancel = function () {

View File

@ -15,11 +15,11 @@ var scrawl = function (options) {
drawStepIndex = 0; //undo redo指针 drawStepIndex = 0; //undo redo指针
scrawl.prototype = { scrawl.prototype = {
isScrawl:false, //是否涂鸦 isScrawl: false, //是否涂鸦
brushWidth:-1, //画笔粗细 brushWidth: -1, //画笔粗细
brushColor:"", //画笔颜色 brushColor: "", //画笔颜色
initOptions:function (options) { initOptions: function (options) {
var me = this; var me = this;
me.originalState(options);//初始页面状态 me.originalState(options);//初始页面状态
me._buildToolbarColor(options.colorList);//动态生成颜色选择集合 me._buildToolbarColor(options.colorList);//动态生成颜色选择集合
@ -39,7 +39,7 @@ var scrawl = function (options) {
me._clearSelection();//清楚选中状态 me._clearSelection();//清楚选中状态
}, },
originalState:function (options) { originalState: function (options) {
var me = this; var me = this;
me.brushWidth = options.drawBrushSize;//同步画笔粗细 me.brushWidth = options.drawBrushSize;//同步画笔粗细
@ -51,7 +51,7 @@ var scrawl = function (options) {
context.lineCap = "round";//去除锯齿 context.lineCap = "round";//去除锯齿
context.fill(); context.fill();
}, },
_buildToolbarColor:function (colorList) { _buildToolbarColor: function (colorList) {
var tmp = null, arr = []; var tmp = null, arr = [];
arr.push("<table id='J_colorList'>"); arr.push("<table id='J_colorList'>");
for (var i = 0, color; color = colorList[i++];) { for (var i = 0, color; color = colorList[i++];) {
@ -68,7 +68,7 @@ var scrawl = function (options) {
$G("J_colorBar").innerHTML = arr.join(""); $G("J_colorBar").innerHTML = arr.join("");
}, },
_addBoardListener:function (saveNum) { _addBoardListener: function (saveNum) {
var me = this, var me = this,
margin = 0, margin = 0,
startX = -1, startX = -1,
@ -121,7 +121,7 @@ var scrawl = function (options) {
break; break;
case 'mouseup': case 'mouseup':
buttonPress = 0; buttonPress = 0;
if (!isMouseDown)return; if (!isMouseDown) return;
if (!isMouseMove) { if (!isMouseMove) {
context.arc(startX, startY, context.lineWidth, 0, Math.PI * 2, false); context.arc(startX, startY, context.lineWidth, 0, Math.PI * 2, false);
context.fillStyle = context.strokeStyle; context.fillStyle = context.strokeStyle;
@ -144,7 +144,7 @@ var scrawl = function (options) {
} }
}); });
}, },
_addOPerateListener:function (saveNum) { _addOPerateListener: function (saveNum) {
var me = this; var me = this;
domUtils.on($G("J_previousStep"), "click", function () { domUtils.on($G("J_previousStep"), "click", function () {
if (drawStepIndex > 1) { if (drawStepIndex > 1) {
@ -175,7 +175,7 @@ var scrawl = function (options) {
me.btn2disable("J_clearBoard"); me.btn2disable("J_clearBoard");
}); });
}, },
_addColorBarListener:function () { _addColorBarListener: function () {
var me = this; var me = this;
domUtils.on($G("J_colorBar"), "click", function (e) { domUtils.on($G("J_colorBar"), "click", function (e) {
var target = me.getTarget(e), var target = me.getTarget(e),
@ -190,7 +190,7 @@ var scrawl = function (options) {
} }
}); });
}, },
_addBrushBarListener:function () { _addBrushBarListener: function () {
var me = this; var me = this;
domUtils.on($G("J_brushBar"), "click", function (e) { domUtils.on($G("J_brushBar"), "click", function (e) {
var target = me.getTarget(e), var target = me.getTarget(e),
@ -205,7 +205,7 @@ var scrawl = function (options) {
} }
}); });
}, },
_addEraserBarListener:function () { _addEraserBarListener: function () {
var me = this; var me = this;
domUtils.on($G("J_eraserBar"), "click", function (e) { domUtils.on($G("J_eraserBar"), "click", function (e) {
var target = me.getTarget(e), var target = me.getTarget(e),
@ -219,7 +219,7 @@ var scrawl = function (options) {
} }
}); });
}, },
_addAddImgListener:function () { _addAddImgListener: function () {
var file = $G("J_imgTxt"); var file = $G("J_imgTxt");
if (!window.FileReader) { if (!window.FileReader) {
$G("J_addImg").style.display = 'none'; $G("J_addImg").style.display = 'none';
@ -232,7 +232,7 @@ var scrawl = function (options) {
var target = e.target || e.srcElement, var target = e.target || e.srcElement,
reader = new FileReader(); reader = new FileReader();
reader.onload = function(evt){ reader.onload = function (evt) {
var target = evt.target || evt.srcElement; var target = evt.target || evt.srcElement;
ue_callback(target.result, 'SUCCESS'); ue_callback(target.result, 'SUCCESS');
}; };
@ -240,7 +240,7 @@ var scrawl = function (options) {
frm.reset(); frm.reset();
}); });
}, },
_addRemoveImgListenter:function () { _addRemoveImgListenter: function () {
var me = this; var me = this;
domUtils.on($G("J_removeImg"), "click", function () { domUtils.on($G("J_removeImg"), "click", function () {
$G("J_picBoard").innerHTML = ""; $G("J_picBoard").innerHTML = "";
@ -248,7 +248,7 @@ var scrawl = function (options) {
me.btn2disable("J_sacleBoard"); me.btn2disable("J_sacleBoard");
}); });
}, },
_addScalePicListenter:function () { _addScalePicListenter: function () {
domUtils.on($G("J_sacleBoard"), "click", function () { domUtils.on($G("J_sacleBoard"), "click", function () {
var picBoard = $G("J_picBoard"), var picBoard = $G("J_picBoard"),
scaleCon = $G("J_scaleCon"), scaleCon = $G("J_scaleCon"),
@ -256,7 +256,7 @@ var scrawl = function (options) {
if (img) { if (img) {
if (!scaleCon) { if (!scaleCon) {
picBoard.style.cssText = "position:relative;z-index:999;"+picBoard.style.cssText; picBoard.style.cssText = "position:relative;z-index:999;" + picBoard.style.cssText;
img.style.cssText = "position: absolute;top:" + (canvas.height - img.height) / 2 + "px;left:" + (canvas.width - img.width) / 2 + "px;"; img.style.cssText = "position: absolute;top:" + (canvas.height - img.height) / 2 + "px;left:" + (canvas.width - img.width) / 2 + "px;";
var scale = new ScaleBoy(); var scale = new ScaleBoy();
picBoard.appendChild(scale.init()); picBoard.appendChild(scale.init());
@ -274,7 +274,7 @@ var scrawl = function (options) {
} }
}); });
}, },
_addClearSelectionListenter:function () { _addClearSelectionListenter: function () {
var doc = document; var doc = document;
domUtils.on(doc, 'mousemove', function (e) { domUtils.on(doc, 'mousemove', function (e) {
if (browser.ie && browser.version < 11) if (browser.ie && browser.version < 11)
@ -283,17 +283,17 @@ var scrawl = function (options) {
window.getSelection().removeAllRanges(); window.getSelection().removeAllRanges();
}); });
}, },
_clearSelection:function () { _clearSelection: function () {
var list = ["J_operateBar", "J_colorBar", "J_brushBar", "J_eraserBar", "J_picBoard"]; var list = ["J_operateBar", "J_colorBar", "J_brushBar", "J_eraserBar", "J_picBoard"];
for (var i = 0, group; group = list[i++];) { for (var i = 0, group; group = list[i++];) {
domUtils.unSelectable($G(group)); domUtils.unSelectable($G(group));
} }
}, },
_saveOPerate:function (saveNum) { _saveOPerate: function (saveNum) {
var me = this; var me = this;
if (drawStep.length <= saveNum) { if (drawStep.length <= saveNum) {
if(drawStepIndex<drawStep.length){ if (drawStepIndex < drawStep.length) {
me.btn2disable("J_nextStep"); me.btn2disable("J_nextStep");
drawStep.splice(drawStepIndex); drawStep.splice(drawStepIndex);
} }
@ -308,7 +308,7 @@ var scrawl = function (options) {
me.btn2Highlight("J_clearBoard"); me.btn2Highlight("J_clearBoard");
}, },
_originalColorSelect:function (title) { _originalColorSelect: function (title) {
var colorList = $G("J_colorList").getElementsByTagName("td"); var colorList = $G("J_colorList").getElementsByTagName("td");
for (var j = 0, cell; cell = colorList[j++];) { for (var j = 0, cell; cell = colorList[j++];) {
if (cell.children[0].title.toLowerCase() == title) { if (cell.children[0].title.toLowerCase() == title) {
@ -316,7 +316,7 @@ var scrawl = function (options) {
} }
} }
}, },
_originalBrushSelect:function (text) { _originalBrushSelect: function (text) {
var brushList = $G("J_brushBar").children; var brushList = $G("J_brushBar").children;
for (var i = 0, ele; ele = brushList[i++];) { for (var i = 0, ele; ele = brushList[i++];) {
if (ele.tagName.toLowerCase() == "a") { if (ele.tagName.toLowerCase() == "a") {
@ -327,7 +327,7 @@ var scrawl = function (options) {
} }
} }
}, },
_addColorSelect:function (target) { _addColorSelect: function (target) {
var me = this, var me = this,
colorList = $G("J_colorList").getElementsByTagName("td"), colorList = $G("J_colorList").getElementsByTagName("td"),
eraserList = $G("J_eraserBar").children, eraserList = $G("J_eraserBar").children,
@ -354,7 +354,7 @@ var scrawl = function (options) {
target.style.opacity = 1; target.style.opacity = 1;
target.blur(); target.blur();
}, },
_addBESelect:function (target) { _addBESelect: function (target) {
var brushList = $G("J_brushBar").children; var brushList = $G("J_brushBar").children;
var eraserList = $G("J_eraserBar").children; var eraserList = $G("J_eraserBar").children;
@ -372,7 +372,7 @@ var scrawl = function (options) {
target.style.opacity = 1; target.style.opacity = 1;
target.blur(); target.blur();
}, },
getCanvasData:function () { getCanvasData: function () {
var picContainer = $G("J_picBoard"), var picContainer = $G("J_picBoard"),
img = picContainer.children[0]; img = picContainer.children[0];
if (img) { if (img) {
@ -397,15 +397,15 @@ var scrawl = function (options) {
return ""; return "";
} }
}, },
btn2Highlight:function (id) { btn2Highlight: function (id) {
var cur = $G(id); var cur = $G(id);
cur.className.indexOf("H") == -1 && (cur.className += "H"); cur.className.indexOf("H") == -1 && (cur.className += "H");
}, },
btn2disable:function (id) { btn2disable: function (id) {
var cur = $G(id); var cur = $G(id);
cur.className.indexOf("H") != -1 && (cur.className = cur.className.replace("H", "")); cur.className.indexOf("H") != -1 && (cur.className = cur.className.replace("H", ""));
}, },
getTarget:function (evt) { getTarget: function (evt) {
return evt.target || evt.srcElement; return evt.target || evt.srcElement;
} }
}; };
@ -465,7 +465,7 @@ var ScaleBoy = function () {
[0, 0, 1, 1] [0, 0, 1, 1]
]; ];
ScaleBoy.prototype = { ScaleBoy.prototype = {
init:function () { init: function () {
_appendStyle(); _appendStyle();
var me = this, var me = this,
scale = me.dom = _getDom(); scale = me.dom = _getDom();
@ -473,7 +473,7 @@ var ScaleBoy = function () {
me.scaleMousemove.fp = me; me.scaleMousemove.fp = me;
domUtils.on(scale, 'mousedown', function (e) { domUtils.on(scale, 'mousedown', function (e) {
var target = e.target || e.srcElement; var target = e.target || e.srcElement;
me.start = {x:e.clientX, y:e.clientY}; me.start = {x: e.clientX, y: e.clientY};
if (target.className.indexOf('hand') != -1) { if (target.className.indexOf('hand') != -1) {
me.dir = target.className.replace('hand', ''); me.dir = target.className.replace('hand', '');
} }
@ -484,7 +484,10 @@ var ScaleBoy = function () {
if (me.start) { if (me.start) {
domUtils.un(document.body, 'mousemove', me.scaleMousemove); domUtils.un(document.body, 'mousemove', me.scaleMousemove);
if (me.moved) { if (me.moved) {
me.updateScaledElement({position:{x:scale.style.left, y:scale.style.top}, size:{w:scale.style.width, h:scale.style.height}}); me.updateScaledElement({
position: {x: scale.style.left, y: scale.style.top},
size: {w: scale.style.width, h: scale.style.height}
});
} }
delete me.start; delete me.start;
delete me.moved; delete me.moved;
@ -493,13 +496,13 @@ var ScaleBoy = function () {
}); });
return scale; return scale;
}, },
startScale:function (objElement) { startScale: function (objElement) {
var me = this, Idom = me.dom; var me = this, Idom = me.dom;
Idom.style.cssText = 'visibility:visible;top:' + objElement.style.top + ';left:' + objElement.style.left + ';width:' + objElement.offsetWidth + 'px;height:' + objElement.offsetHeight + 'px;'; Idom.style.cssText = 'visibility:visible;top:' + objElement.style.top + ';left:' + objElement.style.left + ';width:' + objElement.offsetWidth + 'px;height:' + objElement.offsetHeight + 'px;';
me.scalingElement = objElement; me.scalingElement = objElement;
}, },
updateScaledElement:function (objStyle) { updateScaledElement: function (objStyle) {
var cur = this.scalingElement, var cur = this.scalingElement,
pos = objStyle.position, pos = objStyle.position,
size = objStyle.size; size = objStyle.size;
@ -512,7 +515,7 @@ var ScaleBoy = function () {
size.h && (cur.style.height = size.h); size.h && (cur.style.height = size.h);
} }
}, },
updateStyleByDir:function (dir, offset) { updateStyleByDir: function (dir, offset) {
var me = this, var me = this,
dom = me.dom, tmp; dom = me.dom, tmp;
@ -534,20 +537,20 @@ var ScaleBoy = function () {
dom.style.height = me._validScaledProp('height', tmp) + 'px'; dom.style.height = me._validScaledProp('height', tmp) + 'px';
} }
if (dir === 'def') { if (dir === 'def') {
me.updateScaledElement({position:{x:dom.style.left, y:dom.style.top}}); me.updateScaledElement({position: {x: dom.style.left, y: dom.style.top}});
} }
}, },
scaleMousemove:function (e) { scaleMousemove: function (e) {
var me = arguments.callee.fp, var me = arguments.callee.fp,
start = me.start, start = me.start,
dir = me.dir || 'def', dir = me.dir || 'def',
offset = {x:e.clientX - start.x, y:e.clientY - start.y}; offset = {x: e.clientX - start.x, y: e.clientY - start.y};
me.updateStyleByDir(dir, offset); me.updateStyleByDir(dir, offset);
arguments.callee.fp.start = {x:e.clientX, y:e.clientY}; arguments.callee.fp.start = {x: e.clientX, y: e.clientY};
arguments.callee.fp.moved = 1; arguments.callee.fp.moved = 1;
}, },
_validScaledProp:function (prop, value) { _validScaledProp: function (prop, value) {
var ele = this.dom, var ele = this.dom,
wrap = $G("J_picBoard"); wrap = $G("J_picBoard");
@ -611,6 +614,7 @@ function ue_callback(url, state) {
alert(state); alert(state);
} }
} }
//去掉遮罩层 //去掉遮罩层
function removeMaskLayer() { function removeMaskLayer() {
var maskLayer = $G("J_maskLayer"); var maskLayer = $G("J_maskLayer");
@ -618,6 +622,7 @@ function removeMaskLayer() {
maskLayer.innerHTML = ""; maskLayer.innerHTML = "";
dialog.buttons[0].setDisabled(false); dialog.buttons[0].setDisabled(false);
} }
//添加遮罩层 //添加遮罩层
function addMaskLayer(html) { function addMaskLayer(html) {
var maskLayer = $G("J_maskLayer"); var maskLayer = $G("J_maskLayer");
@ -625,33 +630,65 @@ function addMaskLayer(html) {
maskLayer.className = "maskLayer"; maskLayer.className = "maskLayer";
maskLayer.innerHTML = html; maskLayer.innerHTML = html;
} }
//执行确认按钮方法 //执行确认按钮方法
function exec(scrawlObj) { function exec(scrawlObj) {
if (scrawlObj.isScrawl) { if (scrawlObj.isScrawl) {
addMaskLayer(lang.scrawlUpLoading); addMaskLayer(lang.scrawlUpLoading);
var base64 = scrawlObj.getCanvasData(); var base64 = scrawlObj.getCanvasData();
if (!!base64) { if (!!base64) {
var successHandler = function (res) {
var imgObj = {},
url = editor.options.scrawlUrlPrefix + res.url;
imgObj.src = url;
imgObj._src = url;
imgObj.alt = res.original || '';
editor.execCommand("insertImage", imgObj);
dialog.close();
// 触发上传涂鸦事件
editor.fireEvent("uploadsuccess", {
res: res,
type: 'scrawl'
});
};
if(editor.getOpt('uploadServiceEnable')) {
var file = utils.base64toBlob(base64, 'image/png');
editor.getOpt('uploadServiceUpload')('image', file, {
success: function( res ) {
if (!scrawlObj.isCancelScrawl) {
successHandler(res);
}
},
error: function( err ) {
alert(lang.imageError + ' : '+err);
dialog.close();
},
progress: function( percent ) {
}
}, {
from: 'scrawl'
});
return;
}
var options = { var options = {
timeout:100000, timeout: 100000,
onsuccess:function (xhr) { headers: editor.options.serverHeaders || {},
onsuccess: function (xhr) {
if (!scrawlObj.isCancelScrawl) { if (!scrawlObj.isCancelScrawl) {
var responseObj; var responseObj;
responseObj = eval("(" + xhr.responseText + ")"); responseObj = eval("(" + xhr.responseText + ")");
if (responseObj.state == "SUCCESS") { if (responseObj.state === "SUCCESS") {
var imgObj = {}, successHandler(responseObj);
url = editor.options.scrawlUrlPrefix + responseObj.url;
imgObj.src = url;
imgObj._src = url;
imgObj.alt = responseObj.original || '';
editor.execCommand("insertImage", imgObj);
dialog.close();
} else { } else {
alert(responseObj.state); alert(responseObj.state);
} }
} }
}, },
onerror:function () { onerror: function () {
alert(lang.imageError); alert(lang.imageError);
dialog.close(); dialog.close();
} }
@ -660,7 +697,7 @@ function exec(scrawlObj) {
var actionUrl = editor.getActionUrl(editor.getOpt('scrawlActionName')), var actionUrl = editor.getActionUrl(editor.getOpt('scrawlActionName')),
params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '', params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '',
url = utils.formatUrl(actionUrl + (actionUrl.indexOf('?') == -1 ? '?':'&') + params); url = utils.formatUrl(actionUrl + (actionUrl.indexOf('?') == -1 ? '?' : '&') + params);
ajax.request(url, options); ajax.request(url, options);
} }
} else { } else {

View File

@ -1,61 +1,88 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
<title></title> <title></title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type"/> <meta content="text/html; charset=utf-8" http-equiv="Content-Type"/>
<script type="text/javascript" src="../internal.js?20220503"></script> <script type="text/javascript" src="../internal.js?aea0c61c"></script>
<style type="text/css"> <style type="text/css">
.warpper{ position:relative;width: 380px; height: 100%; margin: 10px auto;} .warpper {
.tabbody{height: 160px;} position: relative;
.tabbody table{width:100%;border-collapse: separate;border-spacing: 3px;line-height:36px;} width: 380px;
.tabbody .panel{width:373px;height:100%;padding-left: 5px;position: absolute;background-color: #fff;} height: 100%;
.tabbody input.int{ width: 190px; margin: 10px auto;
height: 30px; }
border: 1px solid #d7d7d7;
line-height: 21px; .tabbody {
border-radius: 3px; height: 160px;
outline: none; }
padding: 0 5px; }
.tabbody input.btn{ text-align: center; .tabbody table {
line-height: 28px; width: 100%;
text-decoration: none; border-collapse: separate;
height: 30px; border-spacing: 3px;
border: 1px solid #ccc; line-height: 36px;
background: #FFF; }
border-radius: 3px;
padding: 0 5px; .tabbody .panel {
font-size: 12px; width: 373px;
cursor: pointer;} height: 100%;
padding-left: 5px;
position: absolute;
background-color: #fff;
}
.tabbody input.int {
width: 190px;
height: 30px;
border: 1px solid #d7d7d7;
line-height: 21px;
border-radius: 3px;
outline: none;
padding: 0 5px;
}
.tabbody input.btn {
text-align: center;
line-height: 28px;
text-decoration: none;
height: 30px;
border: 1px solid #ccc;
background: #FFF;
border-radius: 3px;
padding: 0 5px;
font-size: 12px;
cursor: pointer;
}
</style> </style>
</head> </head>
<body> <body>
<div class="warpper" id="searchtab"> <div class="warpper" id="searchtab">
<div id="head" class="tabhead"> <div id="head" class="tabhead">
<span tabsrc="find" class="focus"><var id="lang_tab_search"></var></span> <span tabsrc="find" class="focus"><var id="lang_tab_search"></var></span>
<span tabsrc="replace" ><var id="lang_tab_replace"></var></span> <span tabsrc="replace"><var id="lang_tab_replace"></var></span>
</div> </div>
<div class="tabbody"> <div class="tabbody">
<div class="panel" id="find"> <div class="panel" id="find">
<table> <table>
<tr> <tr>
<td width="80"><var id="lang_search1"></var>: </td> <td width="80"><var id="lang_search1"></var>:</td>
<td><input id="findtxt" type="text" class="int" /></td> <td><input id="findtxt" type="text" class="int"/></td>
</tr> </tr>
<!--<tr>--> <!--<tr>-->
<!--<td colspan="2"><span style="color:red"><var id="lang_searchReg"></var></span></td>--> <!--<td colspan="2"><span style="color:red"><var id="lang_searchReg"></var></span></td>-->
<!--</tr>--> <!--</tr>-->
<tr> <tr>
<td><var id="lang_case_sensitive1"></var></td> <td><var id="lang_case_sensitive1"></var></td>
<td> <td>
<input id="matchCase" type="checkbox" /> <input id="matchCase" type="checkbox"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<input id="nextFindBtn" type="button" class="btn" /> <input id="nextFindBtn" type="button" class="btn"/>
<input id="preFindBtn" type="button" class="btn" /> <input id="preFindBtn" type="button" class="btn"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -73,29 +100,29 @@
<div class="panel" id="replace"> <div class="panel" id="replace">
<table> <table>
<tr> <tr>
<td width="80"><var id="lang_search2"></var>: </td> <td width="80"><var id="lang_search2"></var>:</td>
<td><input id="findtxt1" type="text" class="int" /></td> <td><input id="findtxt1" type="text" class="int"/></td>
</tr> </tr>
<!--<tr>--> <!--<tr>-->
<!--<td colspan="2"><span style="color:red"><var id="lang_searchReg1"></var></span></td>--> <!--<td colspan="2"><span style="color:red"><var id="lang_searchReg1"></var></span></td>-->
<!--</tr>--> <!--</tr>-->
<tr> <tr>
<td><var id="lang_replace"></var>: </td> <td><var id="lang_replace"></var>:</td>
<td><input id="replacetxt" type="text" class="int" /></td> <td><input id="replacetxt" type="text" class="int"/></td>
</tr> </tr>
<tr> <tr>
<td><var id="lang_case_sensitive2"></var></td> <td><var id="lang_case_sensitive2"></var></td>
<td> <td>
<input id="matchCase1" type="checkbox" /> <input id="matchCase1" type="checkbox"/>
</td> </td>
</tr> </tr>
<tr> <tr>
<td colspan="2"> <td colspan="2">
<input id="nextReplaceBtn" type="button" class="btn" /> <input id="nextReplaceBtn" type="button" class="btn"/>
<input id="preReplaceBtn" type="button" class="btn" /> <input id="preReplaceBtn" type="button" class="btn"/>
<input id="repalceBtn" type="button" class="btn" /> <input id="repalceBtn" type="button" class="btn"/>
<input id="repalceAllBtn" type="button" class="btn" /> <input id="repalceAllBtn" type="button" class="btn"/>
</td> </td>
</tr> </tr>
<tr> <tr>
@ -112,6 +139,6 @@
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript" src="searchreplace.js?20220503"></script> <script type="text/javascript" src="searchreplace.js?2c3cf2d3"></script>
</body> </body>
</html> </html>

View File

@ -9,6 +9,7 @@
//清空上次查选的痕迹 //清空上次查选的痕迹
editor.firstForSR = 0; editor.firstForSR = 0;
editor.currentRangeForSR = null; editor.currentRangeForSR = null;
//给tab注册切换事件 //给tab注册切换事件
/** /**
* tab点击处理事件 * tab点击处理事件
@ -16,18 +17,18 @@ editor.currentRangeForSR = null;
* @param tabBodys * @param tabBodys
* @param obj * @param obj
*/ */
function clickHandler( tabHeads,tabBodys,obj ) { function clickHandler(tabHeads, tabBodys, obj) {
//head样式更改 //head样式更改
for ( var k = 0, len = tabHeads.length; k < len; k++ ) { for (var k = 0, len = tabHeads.length; k < len; k++) {
tabHeads[k].className = ""; tabHeads[k].className = "";
} }
obj.className = "focus"; obj.className = "focus";
//body显隐 //body显隐
var tabSrc = obj.getAttribute( "tabSrc" ); var tabSrc = obj.getAttribute("tabSrc");
for ( var j = 0, length = tabBodys.length; j < length; j++ ) { for (var j = 0, length = tabBodys.length; j < length; j++) {
var body = tabBodys[j], var body = tabBodys[j],
id = body.getAttribute( "id" ); id = body.getAttribute("id");
if ( id != tabSrc ) { if (id != tabSrc) {
body.style.zIndex = 1; body.style.zIndex = 1;
} else { } else {
body.style.zIndex = 200; body.style.zIndex = 200;
@ -40,27 +41,30 @@ function clickHandler( tabHeads,tabBodys,obj ) {
* TAB切换 * TAB切换
* @param tabParentId tab的父节点ID或者对象本身 * @param tabParentId tab的父节点ID或者对象本身
*/ */
function switchTab( tabParentId ) { function switchTab(tabParentId) {
var tabElements = $G( tabParentId ).children, var tabElements = $G(tabParentId).children,
tabHeads = tabElements[0].children, tabHeads = tabElements[0].children,
tabBodys = tabElements[1].children; tabBodys = tabElements[1].children;
for ( var i = 0, length = tabHeads.length; i < length; i++ ) { for (var i = 0, length = tabHeads.length; i < length; i++) {
var head = tabHeads[i]; var head = tabHeads[i];
if ( head.className === "focus" )clickHandler(tabHeads,tabBodys, head ); if (head.className === "focus") clickHandler(tabHeads, tabBodys, head);
head.onclick = function () { head.onclick = function () {
clickHandler(tabHeads,tabBodys,this); clickHandler(tabHeads, tabBodys, this);
} }
} }
} }
$G('searchtab').onmousedown = function(){
$G('searchtab').onmousedown = function () {
$G('search-msg').innerHTML = ''; $G('search-msg').innerHTML = '';
$G('replace-msg').innerHTML = '' $G('replace-msg').innerHTML = ''
} }
//是否区分大小写 //是否区分大小写
function getMatchCase(id) { function getMatchCase(id) {
return $G(id).checked ? true : false; return $G(id).checked ? true : false;
} }
//查找 //查找
$G("nextFindBtn").onclick = function (txt, dir, mcase) { $G("nextFindBtn").onclick = function (txt, dir, mcase) {
var findtxt = $G("findtxt").value, obj; var findtxt = $G("findtxt").value, obj;
@ -68,9 +72,9 @@ $G("nextFindBtn").onclick = function (txt, dir, mcase) {
return false; return false;
} }
obj = { obj = {
searchStr:findtxt, searchStr: findtxt,
dir:1, dir: 1,
casesensitive:getMatchCase("matchCase") casesensitive: getMatchCase("matchCase")
}; };
if (!frCommond(obj)) { if (!frCommond(obj)) {
var bk = editor.selection.getRange().createBookmark(); var bk = editor.selection.getRange().createBookmark();
@ -86,9 +90,9 @@ $G("nextReplaceBtn").onclick = function (txt, dir, mcase) {
return false; return false;
} }
obj = { obj = {
searchStr:findtxt, searchStr: findtxt,
dir:1, dir: 1,
casesensitive:getMatchCase("matchCase1") casesensitive: getMatchCase("matchCase1")
}; };
frCommond(obj); frCommond(obj);
}; };
@ -98,9 +102,9 @@ $G("preFindBtn").onclick = function (txt, dir, mcase) {
return false; return false;
} }
obj = { obj = {
searchStr:findtxt, searchStr: findtxt,
dir:-1, dir: -1,
casesensitive:getMatchCase("matchCase") casesensitive: getMatchCase("matchCase")
}; };
if (!frCommond(obj)) { if (!frCommond(obj)) {
$G('search-msg').innerHTML = lang.getStart; $G('search-msg').innerHTML = lang.getStart;
@ -112,9 +116,9 @@ $G("preReplaceBtn").onclick = function (txt, dir, mcase) {
return false; return false;
} }
obj = { obj = {
searchStr:findtxt, searchStr: findtxt,
dir:-1, dir: -1,
casesensitive:getMatchCase("matchCase1") casesensitive: getMatchCase("matchCase1")
}; };
frCommond(obj); frCommond(obj);
}; };
@ -130,10 +134,10 @@ $G("repalceBtn").onclick = function () {
return false; return false;
} }
obj = { obj = {
searchStr:findtxt, searchStr: findtxt,
dir:1, dir: 1,
casesensitive:getMatchCase("matchCase1"), casesensitive: getMatchCase("matchCase1"),
replaceStr:replacetxt replaceStr: replacetxt
}; };
frCommond(obj); frCommond(obj);
}; };
@ -148,10 +152,10 @@ $G("repalceAllBtn").onclick = function () {
return false; return false;
} }
obj = { obj = {
searchStr:findtxt, searchStr: findtxt,
casesensitive:getMatchCase("matchCase1"), casesensitive: getMatchCase("matchCase1"),
replaceStr:replacetxt, replaceStr: replacetxt,
all:true all: true
}; };
var num = frCommond(obj); var num = frCommond(obj);
if (num) { if (num) {
@ -165,6 +169,6 @@ var frCommond = function (obj) {
switchTab("searchtab"); switchTab("searchtab");
dialog.onclose = function(){ dialog.onclose = function () {
editor.trigger('clearLastSearchResult') editor.trigger('clearLastSearchResult')
}; };

View File

@ -1,21 +1,42 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
<title></title> <title></title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" src="../internal.js?20220503"></script> <script type="text/javascript" src="../internal.js?aea0c61c"></script>
<style type="text/css"> <style type="text/css">
html,body{overflow:hidden;} html, body {
#specharsTab{width: 97%;margin: 10px auto; zoom:1;position: relative} overflow: hidden;
.tabbody {height:447px;} }
.tabbody span{ margin: 5px 3px;text-align: center;display:inline-block;width: 40px;height:16px;line-height: 16px;cursor: pointer; }
#specharsTab {
width: 97%;
margin: 10px auto;
zoom: 1;
position: relative
}
.tabbody {
height: 447px;
}
.tabbody span {
margin: 5px 3px;
text-align: center;
display: inline-block;
width: 40px;
height: 16px;
line-height: 16px;
cursor: pointer;
}
</style> </style>
</head> </head>
<body> <body>
<div id="specharsTab"> <div id="specharsTab">
<div id="tabHeads" class="tabhead"></div><div id="tabBodys" class="tabbody"></div> <div id="tabHeads" class="tabhead"></div>
</div> <div id="tabBodys" class="tabbody"></div>
<script type="text/javascript" src="spechars.js?20220503"></script> </div>
<script type="text/javascript" src="spechars.js?f474d0a8"></script>
</body> </body>
</html> </html>

View File

@ -6,22 +6,50 @@
* To change this template use File | Settings | File Templates. * To change this template use File | Settings | File Templates.
*/ */
var charsContent = [ var charsContent = [
{ name:"tsfh", title:lang.tsfh, content:toArray("、,。,·,ˉ,ˇ,¨,〃,々,—,,‖,…,,,“,”,,,〈,〉,《,》,「,」,『,』,〖,〗,【,】,±,×,÷,,∧,,∑,∏,,∩,∈,∷,√,⊥,∥,∠,⌒,⊙,∫,∮,≡,≌,≈,∽,∝,≠,≮,≯,≤,≥,∞,∵,∴,♂,♀,°,,″,℃,,¤,¢,£,‰,§,№,☆,★,○,●,◎,◇,◆,□,■,△,▲,※,→,←,↑,↓,〓,〡,〢,〣,〤,〥,〦,〧,〨,〩,㊣,㎎,㎏,㎜,㎝,㎞,㎡,㏄,㏎,㏑,㏒,㏕,,¬,¦,℡,ˊ,ˋ,˙,,―,‥,,℅,℉,↖,↗,↘,↙,,∟,,≒,≦,≧,⊿,═,║,╒,╓,╔,╕,╖,╗,╘,╙,╚,╛,╜,╝,╞,╟,╠,╡,╢,╣,╤,╥,╦,╧,╨,╩,╪,╫,╬,╭,╮,╯,╰,,╲,,▁,▂,▃,▄,▅,▆,▇,<2C>,█,▉,▊,▋,▌,▍,▎,▏,▓,▔,▕,▼,▽,◢,◣,◤,◥,☉,⊕,〒,〝,〞")}, {
{ name:"lmsz", title:lang.lmsz, content:toArray(",ⅱ,ⅲ,ⅳ,,ⅵ,ⅶ,ⅷ,ⅸ,,,Ⅱ,Ⅲ,Ⅳ,,Ⅵ,Ⅶ,Ⅷ,Ⅸ,,Ⅺ,Ⅻ")}, name: "tsfh",
{ name:"szfh", title:lang.szfh, content:toArray("⒈,⒉,⒊,⒋,⒌,⒍,⒎,⒏,⒐,⒑,⒒,⒓,⒔,⒕,⒖,⒗,⒘,⒙,⒚,⒛,⑴,⑵,⑶,⑷,⑸,⑹,⑺,⑻,⑼,⑽,⑾,⑿,⒀,⒁,⒂,⒃,⒄,⒅,⒆,⒇,①,②,③,④,⑤,⑥,⑦,⑧,⑨,⑩,㈠,㈡,㈢,㈣,㈤,㈥,㈦,㈧,㈨,㈩")}, title: lang.tsfh,
{ name:"rwfh", title:lang.rwfh, content:toArray("ぁ,あ,ぃ,い,ぅ,う,ぇ,え,ぉ,お,か,が,き,ぎ,く,ぐ,け,げ,こ,ご,さ,ざ,し,じ,す,ず,せ,ぜ,そ,ぞ,た,だ,ち,ぢ,っ,つ,づ,て,で,と,ど,な,に,ぬ,ね,の,は,ば,ぱ,ひ,び,ぴ,ふ,ぶ,ぷ,へ,べ,ぺ,ほ,ぼ,ぽ,ま,み,む,め,も,ゃ,や,ゅ,ゆ,ょ,よ,ら,り,る,れ,ろ,ゎ,わ,ゐ,ゑ,を,ん,ァ,ア,ィ,イ,ゥ,ウ,ェ,エ,ォ,オ,カ,ガ,キ,ギ,ク,グ,ケ,ゲ,コ,ゴ,サ,ザ,シ,ジ,ス,ズ,セ,ゼ,ソ,ゾ,タ,ダ,チ,ヂ,ッ,ツ,ヅ,テ,デ,ト,ド,ナ,ニ,ヌ,ネ,,ハ,バ,パ,ヒ,ビ,ピ,フ,ブ,プ,ヘ,ベ,ペ,ホ,ボ,ポ,マ,ミ,ム,メ,モ,ャ,ヤ,ュ,ユ,ョ,ヨ,ラ,リ,ル,レ,ロ,ヮ,ワ,ヰ,ヱ,ヲ,ン,ヴ,ヵ,ヶ")}, content: toArray("、,。,·,ˉ,ˇ,¨,〃,々,—,,‖,…,,,“,”,,,〈,〉,《,》,「,」,『,』,〖,〗,【,】,±,×,÷,,∧,,∑,∏,,∩,∈,∷,√,⊥,∥,∠,⌒,⊙,∫,∮,≡,≌,≈,∽,∝,≠,≮,≯,≤,≥,∞,∵,∴,♂,♀,°,,″,℃,,¤,¢,£,‰,§,№,☆,★,○,●,◎,◇,◆,□,■,△,▲,※,→,←,↑,↓,〓,〡,〢,〣,〤,〥,〦,〧,〨,〩,㊣,㎎,㎏,㎜,㎝,㎞,㎡,㏄,㏎,㏑,㏒,㏕,,¬,¦,℡,ˊ,ˋ,˙,,―,‥,,℅,℉,↖,↗,↘,↙,,∟,,≒,≦,≧,⊿,═,║,╒,╓,╔,╕,╖,╗,╘,╙,╚,╛,╜,╝,╞,╟,╠,╡,╢,╣,╤,╥,╦,╧,╨,╩,╪,╫,╬,╭,╮,╯,╰,,╲,,▁,▂,▃,▄,▅,▆,▇,<2C>,█,▉,▊,▋,▌,▍,▎,▏,▓,▔,▕,▼,▽,◢,◣,◤,◥,☉,⊕,〒,〝,〞")
{ name:"xlzm", title:lang.xlzm, content:toArray("Α,Β,Γ,Δ,Ε,Ζ,Η,Θ,Ι,Κ,Λ,Μ,Ν,Ξ,Ο,Π,Ρ,Σ,Τ,Υ,Φ,Χ,Ψ,Ω,α,β,γ,δ,ε,ζ,η,θ,ι,κ,λ,μ,ν,ξ,ο,π,ρ,σ,τ,υ,φ,χ,ψ,ω")}, },
{ name:"ewzm", title:lang.ewzm, content:toArray("А,Б,В,Г,Д,Е,Ё,Ж,З,И,Й,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Ъ,Ы,Ь,Э,Ю,Я,а,б,в,г,д,е,ё,ж,з,и,й,к,л,м,н,о,п,р,с,т,у,ф,х,ц,ч,ш,щ,ъ,ы,ь,э,ю,я")}, {name: "lmsz", title: lang.lmsz, content: toArray(",ⅱ,ⅲ,ⅳ,,ⅵ,ⅶ,ⅷ,ⅸ,,,Ⅱ,Ⅲ,Ⅳ,,Ⅵ,Ⅶ,Ⅷ,Ⅸ,,Ⅺ,Ⅻ")},
{ name:"pyzm", title:lang.pyzm, content:toArray("ā,á,ǎ,à,ē,é,ě,è,ī,í,ǐ,ì,ō,ó,ǒ,ò,ū,ú,ǔ,ù,ǖ,ǘ,ǚ,ǜ,ü")}, {
{ name:"yyyb", title:lang.yyyb, content:toArray("i:,i,e,æ,ʌ,ə:,ə,u:,u,ɔ:,ɔ,a:,ei,ai,ɔi,əu,au,iə,εə,uə,p,t,k,b,d,g,f,s,ʃ,θ,h,v,z,ʒ,ð,tʃ,tr,ts,dʒ,dr,dz,m,n,ŋ,l,r,w,j,")}, name: "szfh",
{ name:"zyzf", title:lang.zyzf, content:toArray("ㄅ,ㄆ,ㄇ,ㄈ,ㄉ,ㄊ,ㄋ,ㄌ,ㄍ,ㄎ,ㄏ,ㄐ,ㄑ,ㄒ,ㄓ,ㄔ,ㄕ,ㄖ,ㄗ,ㄘ,ㄙ,ㄚ,ㄛ,ㄜ,ㄝ,ㄞ,ㄟ,ㄠ,ㄡ,ㄢ,ㄣ,ㄤ,ㄥ,ㄦ,ㄧ,ㄨ")} title: lang.szfh,
content: toArray("⒈,⒉,⒊,⒋,⒌,⒍,⒎,⒏,⒐,⒑,⒒,⒓,⒔,⒕,⒖,⒗,⒘,⒙,⒚,⒛,⑴,⑵,⑶,⑷,⑸,⑹,⑺,⑻,⑼,⑽,⑾,⑿,⒀,⒁,⒂,⒃,⒄,⒅,⒆,⒇,①,②,③,④,⑤,⑥,⑦,⑧,⑨,⑩,㈠,㈡,㈢,㈣,㈤,㈥,㈦,㈧,㈨,㈩")
},
{
name: "rwfh",
title: lang.rwfh,
content: toArray("ぁ,あ,ぃ,い,ぅ,う,ぇ,え,ぉ,お,か,が,き,ぎ,く,ぐ,け,げ,こ,ご,さ,ざ,し,じ,す,ず,せ,ぜ,そ,ぞ,た,だ,ち,ぢ,っ,つ,づ,て,で,と,ど,な,に,ぬ,ね,の,は,ば,ぱ,ひ,び,ぴ,ふ,ぶ,ぷ,へ,べ,ぺ,ほ,ぼ,ぽ,ま,み,む,め,も,ゃ,や,ゅ,ゆ,ょ,よ,ら,り,る,れ,ろ,ゎ,わ,ゐ,ゑ,を,ん,ァ,ア,ィ,イ,ゥ,ウ,ェ,エ,ォ,オ,カ,ガ,キ,ギ,ク,グ,ケ,ゲ,コ,ゴ,サ,ザ,シ,ジ,ス,ズ,セ,ゼ,ソ,ゾ,タ,ダ,チ,ヂ,ッ,ツ,ヅ,テ,デ,ト,ド,ナ,ニ,ヌ,ネ,,ハ,バ,パ,ヒ,ビ,ピ,フ,ブ,プ,ヘ,ベ,ペ,ホ,ボ,ポ,マ,ミ,ム,メ,モ,ャ,ヤ,ュ,ユ,ョ,ヨ,ラ,リ,ル,レ,ロ,ヮ,ワ,ヰ,ヱ,ヲ,ン,ヴ,ヵ,ヶ")
},
{
name: "xlzm",
title: lang.xlzm,
content: toArray("Α,Β,Γ,Δ,Ε,Ζ,Η,Θ,Ι,Κ,Λ,Μ,Ν,Ξ,Ο,Π,Ρ,Σ,Τ,Υ,Φ,Χ,Ψ,Ω,α,β,γ,δ,ε,ζ,η,θ,ι,κ,λ,μ,ν,ξ,ο,π,ρ,σ,τ,υ,φ,χ,ψ,ω")
},
{
name: "ewzm",
title: lang.ewzm,
content: toArray("А,Б,В,Г,Д,Е,Ё,Ж,З,И,Й,К,Л,М,Н,О,П,Р,С,Т,У,Ф,Х,Ц,Ч,Ш,Щ,Ъ,Ы,Ь,Э,Ю,Я,а,б,в,г,д,е,ё,ж,з,и,й,к,л,м,н,о,п,р,с,т,у,ф,х,ц,ч,ш,щ,ъ,ы,ь,э,ю,я")
},
{name: "pyzm", title: lang.pyzm, content: toArray("ā,á,ǎ,à,ē,é,ě,è,ī,í,ǐ,ì,ō,ó,ǒ,ò,ū,ú,ǔ,ù,ǖ,ǘ,ǚ,ǜ,ü")},
{
name: "yyyb",
title: lang.yyyb,
content: toArray("i:,i,e,æ,ʌ,ə:,ə,u:,u,ɔ:,ɔ,a:,ei,ai,ɔi,əu,au,iə,εə,uə,p,t,k,b,d,g,f,s,ʃ,θ,h,v,z,ʒ,ð,tʃ,tr,ts,dʒ,dr,dz,m,n,ŋ,l,r,w,j,")
},
{
name: "zyzf",
title: lang.zyzf,
content: toArray("ㄅ,ㄆ,ㄇ,ㄈ,ㄉ,ㄊ,ㄋ,ㄌ,ㄍ,ㄎ,ㄏ,ㄐ,ㄑ,ㄒ,ㄓ,ㄔ,ㄕ,ㄖ,ㄗ,ㄘ,ㄙ,ㄚ,ㄛ,ㄜ,ㄝ,ㄞ,ㄟ,ㄠ,ㄡ,ㄢ,ㄣ,ㄤ,ㄥ,ㄦ,ㄧ,ㄨ")
}
]; ];
(function createTab(content) { (function createTab(content) {
for (var i = 0, ci; ci = content[i++];) { for (var i = 0, ci; ci = content[i++];) {
var span = document.createElement("span"); var span = document.createElement("span");
span.setAttribute("tabSrc", ci.name); span.setAttribute("tabSrc", ci.name);
span.innerHTML = ci.title; span.innerHTML = ci.title;
if (i == 1)span.className = "focus"; if (i == 1) span.className = "focus";
domUtils.on(span, "click", function () { domUtils.on(span, "click", function () {
var tmps = $G("tabHeads").children; var tmps = $G("tabHeads").children;
for (var k = 0, sk; sk = tmps[k++];) { for (var k = 0, sk; sk = tmps[k++];) {
@ -52,6 +80,7 @@ var charsContent = [
$G("tabBodys").appendChild(div); $G("tabBodys").appendChild(div);
} }
})(charsContent); })(charsContent);
function toArray(str) { function toArray(str) {
return str.split(","); return str.split(",");
} }

View File

@ -1,7 +1,8 @@
body{ body {
overflow: hidden; overflow: hidden;
width: 540px; width: 540px;
} }
.wrapper { .wrapper {
margin: 10px auto 0; margin: 10px auto 0;
font-size: 12px; font-size: 12px;
@ -81,4 +82,4 @@ body{
border-width: 2px 1px 1px 1px; border-width: 2px 1px 1px 1px;
height: 22px; height: 22px;
background-color: #F7F7F7; background-color: #F7F7F7;
} }

View File

@ -2,8 +2,8 @@
<html> <html>
<head> <head>
<title></title> <title></title>
<script type="text/javascript" src="../internal.js?20220503"></script> <script type="text/javascript" src="../internal.js?aea0c61c"></script>
<link rel="stylesheet" type="text/css" href="edittable.css?20220503"> <link rel="stylesheet" type="text/css" href="edittable.css?effbbe30">
</head> </head>
<body> <body>
<div class="wrapper"> <div class="wrapper">
@ -12,18 +12,22 @@
<h3><var id="lang_tableStyle"></var></h3> <h3><var id="lang_tableStyle"></var></h3>
<ul> <ul>
<li> <li>
<label onselectstart="return false"><input type="checkbox" id="J_title" name="style"/><var id="lang_insertTitle"></var></label> <label onselectstart="return false"><input type="checkbox" id="J_title" name="style"/><var
id="lang_insertTitle"></var></label>
</li> </li>
<li> <li>
<label onselectstart="return false"><input type="checkbox" id="J_titleCol" name="style"/><var id="lang_insertTitleCol"></var></label> <label onselectstart="return false"><input type="checkbox" id="J_titleCol" name="style"/><var
id="lang_insertTitleCol"></var></label>
</li> </li>
</ul> </ul>
<ul> <ul>
<li> <li>
<label onselectstart="return false"><input type="checkbox" id="J_caption" name="style"/><var id="lang_insertCaption"></var></label> <label onselectstart="return false"><input type="checkbox" id="J_caption" name="style"/><var
id="lang_insertCaption"></var></label>
</li> </li>
<li> <li>
<label onselectstart="return false"><input type="checkbox" id="J_sorttable" name="style"/><var id="lang_orderbycontent"></var></label> <label onselectstart="return false"><input type="checkbox" id="J_sorttable" name="style"/><var
id="lang_orderbycontent"></var></label>
</li> </li>
</ul> </ul>
<div class="clear"></div> <div class="clear"></div>
@ -35,7 +39,8 @@
<label><input type="radio" id="J_autoSizeContent" name="size"/><var id="lang_autoSizeContent"></var></label> <label><input type="radio" id="J_autoSizeContent" name="size"/><var id="lang_autoSizeContent"></var></label>
</li> </li>
<li> <li>
<label><input type="radio" id="J_autoSizePage" name="size"/><var id="lang_autoSizePage"></var></label> <label><input type="radio" id="J_autoSizePage" name="size"/><var
id="lang_autoSizePage"></var></label>
</li> </li>
</ul> </ul>
<div class="clear"></div> <div class="clear"></div>
@ -45,7 +50,7 @@
<ul> <ul>
<li> <li>
<span><var id="lang_color"></var></span> <span><var id="lang_color"></var></span>
<input type="text" class="tone" id="J_tone" readonly='readonly' /> <input type="text" class="tone" id="J_tone" readonly='readonly'/>
</li> </li>
</ul> </ul>
<div class="clear"></div> <div class="clear"></div>
@ -59,6 +64,6 @@
</div> </div>
</div> </div>
</div> </div>
<script type="text/javascript" src="edittable.js?20220503"></script> <script type="text/javascript" src="edittable.js?6b7a0dd4"></script>
</body> </body>
</html> </html>

View File

@ -21,13 +21,13 @@
me.init(); me.init();
}; };
editTable.prototype = { editTable.prototype = {
init:function () { init: function () {
var colorPiker = new UE.ui.ColorPicker({ var colorPiker = new UE.ui.ColorPicker({
editor:editor editor: editor
}), }),
colorPop = new UE.ui.Popup({ colorPop = new UE.ui.Popup({
editor:editor, editor: editor,
content:colorPiker content: colorPiker
}); });
title.checked = editor.queryCommandState("inserttitle") == -1; title.checked = editor.queryCommandState("inserttitle") == -1;
@ -38,9 +38,9 @@
var enablesortState = editor.queryCommandState("enablesort"), var enablesortState = editor.queryCommandState("enablesort"),
disablesortState = editor.queryCommandState("disablesort"); disablesortState = editor.queryCommandState("disablesort");
sorttable.checked = !!(enablesortState < 0 && disablesortState >=0); sorttable.checked = !!(enablesortState < 0 && disablesortState >= 0);
sorttable.disabled = !!(enablesortState < 0 && disablesortState < 0); sorttable.disabled = !!(enablesortState < 0 && disablesortState < 0);
sorttable.title = enablesortState < 0 && disablesortState < 0 ? lang.errorMsg:''; sorttable.title = enablesortState < 0 && disablesortState < 0 ? lang.errorMsg : '';
me.createTable(title.checked, titleCol.checked, caption.checked); me.createTable(title.checked, titleCol.checked, caption.checked);
me.setAutoSize(); me.setAutoSize();
@ -69,7 +69,7 @@
}); });
}, },
createTable:function (hasTitle, hasTitleCol, hasCaption) { createTable: function (hasTitle, hasTitleCol, hasCaption) {
var arr = [], var arr = [],
sortSpan = '<span>^</span>'; sortSpan = '<span>^</span>';
arr.push("<table id='J_example'>"); arr.push("<table id='J_example'>");
@ -78,7 +78,9 @@
} }
if (hasTitle) { if (hasTitle) {
arr.push("<tr>"); arr.push("<tr>");
if(hasTitleCol) { arr.push("<th>" + lang.titleName + "</th>"); } if (hasTitleCol) {
arr.push("<th>" + lang.titleName + "</th>");
}
for (var j = 0; j < 5; j++) { for (var j = 0; j < 5; j++) {
arr.push("<th>" + lang.titleName + "</th>"); arr.push("<th>" + lang.titleName + "</th>");
} }
@ -86,7 +88,9 @@
} }
for (var i = 0; i < 6; i++) { for (var i = 0; i < 6; i++) {
arr.push("<tr>"); arr.push("<tr>");
if(hasTitleCol) { arr.push("<th>" + lang.titleName + "</th>") } if (hasTitleCol) {
arr.push("<th>" + lang.titleName + "</th>")
}
for (var k = 0; k < 5; k++) { for (var k = 0; k < 5; k++) {
arr.push("<td>" + lang.cellsName + "</td>") arr.push("<td>" + lang.cellsName + "</td>")
} }
@ -96,9 +100,9 @@
preview.innerHTML = arr.join(""); preview.innerHTML = arr.join("");
this.updateSortSpan(); this.updateSortSpan();
}, },
titleHanler:function () { titleHanler: function () {
var example = $G("J_example"), var example = $G("J_example"),
frg=document.createDocumentFragment(), frg = document.createDocumentFragment(),
color = domUtils.getComputedStyle(domUtils.getElementsByTagName(example, "td")[0], "border-color"), color = domUtils.getComputedStyle(domUtils.getElementsByTagName(example, "td")[0], "border-color"),
colCount = example.rows[0].children.length; colCount = example.rows[0].children.length;
@ -117,7 +121,7 @@
me.setColor(color); me.setColor(color);
me.updateSortSpan(); me.updateSortSpan();
}, },
titleColHanler:function () { titleColHanler: function () {
var example = $G("J_example"), var example = $G("J_example"),
color = domUtils.getComputedStyle(domUtils.getElementsByTagName(example, "td")[0], "border-color"), color = domUtils.getComputedStyle(domUtils.getElementsByTagName(example, "td")[0], "border-color"),
colArr = example.rows, colArr = example.rows,
@ -137,7 +141,7 @@
me.setColor(color); me.setColor(color);
me.updateSortSpan(); me.updateSortSpan();
}, },
captionHanler:function () { captionHanler: function () {
var example = $G("J_example"); var example = $G("J_example");
if (caption.checked) { if (caption.checked) {
var row = document.createElement('caption'); var row = document.createElement('caption');
@ -147,14 +151,14 @@
domUtils.remove(domUtils.getElementsByTagName(example, 'caption')[0]); domUtils.remove(domUtils.getElementsByTagName(example, 'caption')[0]);
} }
}, },
sorttableHanler:function(){ sorttableHanler: function () {
me.updateSortSpan(); me.updateSortSpan();
}, },
autoSizeContentHanler:function () { autoSizeContentHanler: function () {
var example = $G("J_example"); var example = $G("J_example");
example.removeAttribute("width"); example.removeAttribute("width");
}, },
autoSizePageHanler:function () { autoSizePageHanler: function () {
var example = $G("J_example"); var example = $G("J_example");
var tds = example.getElementsByTagName(example, "td"); var tds = example.getElementsByTagName(example, "td");
utils.each(tds, function (td) { utils.each(tds, function (td) {
@ -162,30 +166,30 @@
}); });
example.setAttribute('width', '100%'); example.setAttribute('width', '100%');
}, },
updateSortSpan: function(){ updateSortSpan: function () {
var example = $G("J_example"), var example = $G("J_example"),
row = example.rows[0]; row = example.rows[0];
var spans = domUtils.getElementsByTagName(example,"span"); var spans = domUtils.getElementsByTagName(example, "span");
utils.each(spans,function(span){ utils.each(spans, function (span) {
span.parentNode.removeChild(span); span.parentNode.removeChild(span);
}); });
if (sorttable.checked) { if (sorttable.checked) {
utils.each(row.cells, function(cell, i){ utils.each(row.cells, function (cell, i) {
var span = document.createElement("span"); var span = document.createElement("span");
span.innerHTML = "^"; span.innerHTML = "^";
cell.appendChild(span); cell.appendChild(span);
}); });
} }
}, },
getColor:function () { getColor: function () {
var start = editor.selection.getStart(), color, var start = editor.selection.getStart(), color,
cell = domUtils.findParentByTagName(start, ["td", "th", "caption"], true); cell = domUtils.findParentByTagName(start, ["td", "th", "caption"], true);
color = cell && domUtils.getComputedStyle(cell, "border-color"); color = cell && domUtils.getComputedStyle(cell, "border-color");
if (!color) color = "#DDDDDD"; if (!color) color = "#DDDDDD";
return color; return color;
}, },
setColor:function (color) { setColor: function (color) {
var example = $G("J_example"), var example = $G("J_example"),
arr = domUtils.getElementsByTagName(example, "td").concat( arr = domUtils.getElementsByTagName(example, "td").concat(
domUtils.getElementsByTagName(example, "th"), domUtils.getElementsByTagName(example, "th"),
@ -198,7 +202,7 @@
}); });
}, },
setAutoSize:function () { setAutoSize: function () {
var me = this; var me = this;
autoSizePage.checked = true; autoSizePage.checked = true;
me.autoSizePageHanler(); me.autoSizePageHanler();
@ -211,27 +215,27 @@
editor.__hasEnterExecCommand = true; editor.__hasEnterExecCommand = true;
var checks = { var checks = {
title:"inserttitle deletetitle", title: "inserttitle deletetitle",
titleCol:"inserttitlecol deletetitlecol", titleCol: "inserttitlecol deletetitlecol",
caption:"insertcaption deletecaption", caption: "insertcaption deletecaption",
sorttable:"enablesort disablesort" sorttable: "enablesort disablesort"
}; };
editor.fireEvent('saveScene'); editor.fireEvent('saveScene');
for(var i in checks){ for (var i in checks) {
var cmds = checks[i].split(" "), var cmds = checks[i].split(" "),
input = $G("J_" + i); input = $G("J_" + i);
if(input["checked"]){ if (input["checked"]) {
editor.queryCommandState(cmds[0])!=-1 &&editor.execCommand(cmds[0]); editor.queryCommandState(cmds[0]) != -1 && editor.execCommand(cmds[0]);
}else{ } else {
editor.queryCommandState(cmds[1])!=-1 &&editor.execCommand(cmds[1]); editor.queryCommandState(cmds[1]) != -1 && editor.execCommand(cmds[1]);
} }
} }
editor.execCommand("edittable", tone.value); editor.execCommand("edittable", tone.value);
autoSizeContent.checked ?editor.execCommand('adaptbytext') : ""; autoSizeContent.checked ? editor.execCommand('adaptbytext') : "";
autoSizePage.checked ? editor.execCommand("adaptbywindow") : ""; autoSizePage.checked ? editor.execCommand("adaptbywindow") : "";
editor.fireEvent('saveScene'); editor.fireEvent('saveScene');
editor.__hasEnterExecCommand = false; editor.__hasEnterExecCommand = false;
}; };
})(); })();

View File

@ -2,12 +2,13 @@
<html> <html>
<head> <head>
<title></title> <title></title>
<script type="text/javascript" src="../internal.js?20220503"></script> <script type="text/javascript" src="../internal.js?aea0c61c"></script>
<style type="text/css"> <style type="text/css">
.section { .section {
text-align: center; text-align: center;
margin-top: 10px; margin-top: 10px;
} }
.section input { .section input {
margin-left: 5px; margin-left: 5px;
width: 70px; width: 70px;
@ -21,13 +22,13 @@
</div> </div>
<script type="text/javascript"> <script type="text/javascript">
var tone = $G("J_tone"), var tone = $G("J_tone"),
colorPiker = new UE.ui.ColorPicker({ colorPiker = new UE.ui.ColorPicker({
editor:editor editor: editor
}), }),
colorPop = new UE.ui.Popup({ colorPop = new UE.ui.Popup({
editor:editor, editor: editor,
content:colorPiker content: colorPiker
}); });
domUtils.on(tone, "click", function () { domUtils.on(tone, "click", function () {
colorPop.showAnchor(tone); colorPop.showAnchor(tone);
}); });
@ -39,18 +40,18 @@
colorPop.hide(); colorPop.hide();
}); });
colorPiker.addListener("picknocolor", function () { colorPiker.addListener("picknocolor", function () {
tone.value=""; tone.value = "";
colorPop.hide(); colorPop.hide();
}); });
dialog.onok=function(){ dialog.onok = function () {
editor.execCommand("edittd",tone.value); editor.execCommand("edittd", tone.value);
}; };
var start = editor.selection.getStart(), var start = editor.selection.getStart(),
cell = start && domUtils.findParentByTagName(start, ["td", "th"], true); cell = start && domUtils.findParentByTagName(start, ["td", "th"], true);
if(cell){ if (cell) {
var color = domUtils.getComputedStyle(cell,'background-color'); var color = domUtils.getComputedStyle(cell, 'background-color');
if(/^#/.test(color)){ if (/^#/.test(color)) {
tone.value = color tone.value = color
} }

View File

@ -2,7 +2,7 @@
<html> <html>
<head> <head>
<title>表格删除提示</title> <title>表格删除提示</title>
<script type="text/javascript" src="../internal.js?20220503"></script> <script type="text/javascript" src="../internal.js?aea0c61c"></script>
<style type="text/css"> <style type="text/css">
.section { .section {
width: 200px; width: 200px;

View File

@ -7,36 +7,36 @@
*/ */
var templates = [ var templates = [
{ {
"pre":"pre0.png", "pre": "pre0.png",
'title':lang.blank, 'title': lang.blank,
'preHtml':'<p class="ue_t">&nbsp;欢迎使用UEditor</p>', 'preHtml': '<p class="ue_t">&nbsp;欢迎使用UEditor</p>',
"html":'<p class="ue_t">欢迎使用UEditor</p>' "html": '<p class="ue_t">欢迎使用UEditor</p>'
}, },
{ {
"pre":"pre1.png", "pre": "pre1.png",
'title':lang.blog, 'title': lang.blog,
'preHtml':'<h1 label="Title center" name="tc" style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;text-align:center;margin:0px 0px 20px;"><span style="color:#c0504d;">深入理解Range</span></h1><p style="text-align:center;"><strong class=" ">UEditor二次开发</strong></p><h3><span class=" " style="font-family:幼圆">什么是Range</span></h3><p style="text-indent:2em;">对于“插入”选项卡上的库,在设计时都充分考虑了其中的项与文档整体外观的协调性。 </p><br /><h3><span class=" " style="font-family:幼圆">Range能干什么</span></h3><p style="text-indent:2em;">在“开始”选项卡上,通过从快速样式库中为所选文本选择一种外观,您可以方便地更改文档中所选文本的格式。</p>', 'preHtml': '<h1 label="Title center" name="tc" style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;text-align:center;margin:0px 0px 20px;"><span style="color:#c0504d;">深入理解Range</span></h1><p style="text-align:center;"><strong class=" ">UEditor二次开发</strong></p><h3><span class=" " style="font-family:幼圆">什么是Range</span></h3><p style="text-indent:2em;">对于“插入”选项卡上的库,在设计时都充分考虑了其中的项与文档整体外观的协调性。 </p><br /><h3><span class=" " style="font-family:幼圆">Range能干什么</span></h3><p style="text-indent:2em;">在“开始”选项卡上,通过从快速样式库中为所选文本选择一种外观,您可以方便地更改文档中所选文本的格式。</p>',
"html":'<h1 class="ue_t" label="Title center" name="tc" style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;text-align:center;margin:0px 0px 20px;"><span style="color:#c0504d;">[键入文档标题]</span></h1><p style="text-align:center;"><strong class="ue_t">[键入文档副标题]</strong></p><h3><span class="ue_t" style="font-family:幼圆">[标题 1]</span></h3><p class="ue_t" style="text-indent:2em;">对于“插入”选项卡上的库,在设计时都充分考虑了其中的项与文档整体外观的协调性。 您可以使用这些库来插入表格、页眉、页脚、列表、封面以及其他文档构建基块。 您创建的图片、图表或关系图也将与当前的文档外观协调一致。</p><h3><span class="ue_t" style="font-family:幼圆">[标题 2]</span></h3><p class="ue_t" style="text-indent:2em;">在“开始”选项卡上,通过从快速样式库中为所选文本选择一种外观,您可以方便地更改文档中所选文本的格式。 您还可以使用“开始”选项卡上的其他控件来直接设置文本格式。大多数控件都允许您选择是使用当前主题外观,还是使用某种直接指定的格式。 </p><h3><span class="ue_t" style="font-family:幼圆">[标题 3]</span></h3><p class="ue_t">对于“插入”选项卡上的库,在设计时都充分考虑了其中的项与文档整体外观的协调性。 您可以使用这些库来插入表格、页眉、页脚、列表、封面以及其他文档构建基块。 您创建的图片、图表或关系图也将与当前的文档外观协调一致。</p><p class="ue_t"><br /></p>' "html": '<h1 class="ue_t" label="Title center" name="tc" style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;text-align:center;margin:0px 0px 20px;"><span style="color:#c0504d;">[键入文档标题]</span></h1><p style="text-align:center;"><strong class="ue_t">[键入文档副标题]</strong></p><h3><span class="ue_t" style="font-family:幼圆">[标题 1]</span></h3><p class="ue_t" style="text-indent:2em;">对于“插入”选项卡上的库,在设计时都充分考虑了其中的项与文档整体外观的协调性。 您可以使用这些库来插入表格、页眉、页脚、列表、封面以及其他文档构建基块。 您创建的图片、图表或关系图也将与当前的文档外观协调一致。</p><h3><span class="ue_t" style="font-family:幼圆">[标题 2]</span></h3><p class="ue_t" style="text-indent:2em;">在“开始”选项卡上,通过从快速样式库中为所选文本选择一种外观,您可以方便地更改文档中所选文本的格式。 您还可以使用“开始”选项卡上的其他控件来直接设置文本格式。大多数控件都允许您选择是使用当前主题外观,还是使用某种直接指定的格式。 </p><h3><span class="ue_t" style="font-family:幼圆">[标题 3]</span></h3><p class="ue_t">对于“插入”选项卡上的库,在设计时都充分考虑了其中的项与文档整体外观的协调性。 您可以使用这些库来插入表格、页眉、页脚、列表、封面以及其他文档构建基块。 您创建的图片、图表或关系图也将与当前的文档外观协调一致。</p><p class="ue_t"><br /></p>'
}, },
{ {
"pre":"pre2.png", "pre": "pre2.png",
'title':lang.resume, 'title': lang.resume,
'preHtml':'<h1 label="Title left" name="tl" style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;margin:0px 0px 10px;"><span style="color:#e36c09;" class=" ">WEB前端开发简历</span></h1><table width="100%" border="1" bordercolor="#95B3D7" style="border-collapse:collapse;"><tbody><tr><td width="100" style="text-align:center;"><p><span style="background-color:transparent;">插</span><br /></p><p>入</p><p>照</p><p>片</p></td><td><p><span style="background-color:transparent;"> 联系电话:</span><span class="ue_t" style="background-color:transparent;">[键入您的电话]</span><br /></p><p><span style="background-color:transparent;"> 电子邮件:</span><span class="ue_t" style="background-color:transparent;">[键入您的电子邮件地址]</span><br /></p><p><span style="background-color:transparent;"> 家庭住址:</span><span class="ue_t" style="background-color:transparent;">[键入您的地址]</span><br /></p></td></tr></tbody></table><h3><span style="color:#E36C09;font-size:20px;">目标职位</span></h3><p style="text-indent:2em;" class=" ">WEB前端研发工程师</p><h3><span style="color:#e36c09;font-size:20px;">学历</span></h3><p><span style="display:none;line-height:0px;" id="_baidu_bookmark_start_26"></span></p><ol style="list-style-type:decimal;"><li><p><span class="ue_t">[起止时间]</span> <span class="ue_t">[学校名称] </span> <span class="ue_t">[所学专业]</span> <span class="ue_t">[所获学位]</span></p></li></ol><h3><span style="color:#e36c09;font-size:20px;" class="ue_t">工作经验</span></h3><p><br /></p>', 'preHtml': '<h1 label="Title left" name="tl" style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;margin:0px 0px 10px;"><span style="color:#e36c09;" class=" ">WEB前端开发简历</span></h1><table width="100%" border="1" bordercolor="#95B3D7" style="border-collapse:collapse;"><tbody><tr><td width="100" style="text-align:center;"><p><span style="background-color:transparent;">插</span><br /></p><p>入</p><p>照</p><p>片</p></td><td><p><span style="background-color:transparent;"> 联系电话:</span><span class="ue_t" style="background-color:transparent;">[键入您的电话]</span><br /></p><p><span style="background-color:transparent;"> 电子邮件:</span><span class="ue_t" style="background-color:transparent;">[键入您的电子邮件地址]</span><br /></p><p><span style="background-color:transparent;"> 家庭住址:</span><span class="ue_t" style="background-color:transparent;">[键入您的地址]</span><br /></p></td></tr></tbody></table><h3><span style="color:#E36C09;font-size:20px;">目标职位</span></h3><p style="text-indent:2em;" class=" ">WEB前端研发工程师</p><h3><span style="color:#e36c09;font-size:20px;">学历</span></h3><p><span style="display:none;line-height:0px;" id="_baidu_bookmark_start_26"></span></p><ol style="list-style-type:decimal;"><li><p><span class="ue_t">[起止时间]</span> <span class="ue_t">[学校名称] </span> <span class="ue_t">[所学专业]</span> <span class="ue_t">[所获学位]</span></p></li></ol><h3><span style="color:#e36c09;font-size:20px;" class="ue_t">工作经验</span></h3><p><br /></p>',
"html":'<h1 label="Title left" name="tl" style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;margin:0px 0px 10px;"><span style="color:#e36c09;" class="ue_t">[此处键入简历标题]</span></h1><p><span style="color:#e36c09;"><br /></span></p><table width="100%" border="1" bordercolor="#95B3D7" style="border-collapse:collapse;"><tbody><tr><td width="200" style="text-align:center;" class="ue_t">【此处插入照片】</td><td><p><br /></p><p> 联系电话:<span class="ue_t">[键入您的电话]</span></p><p><br /></p><p> 电子邮件:<span class="ue_t">[键入您的电子邮件地址]</span></p><p><br /></p><p> 家庭住址:<span class="ue_t">[键入您的地址]</span></p><p><br /></p></td></tr></tbody></table><h3><span style="color:#e36c09;font-size:20px;">目标职位</span></h3><p style="text-indent:2em;" class="ue_t">[此处键入您的期望职位]</p><h3><span style="color:#e36c09;font-size:20px;">学历</span></h3><p><span style="display:none;line-height:0px;" id="_baidu_bookmark_start_26"></span></p><ol style="list-style-type:decimal;"><li><p><span class="ue_t">[键入起止时间]</span> <span class="ue_t">[键入学校名称] </span> <span class="ue_t">[键入所学专业]</span> <span class="ue_t">[键入所获学位]</span></p></li><li><p><span class="ue_t">[键入起止时间]</span> <span class="ue_t">[键入学校名称]</span> <span class="ue_t">[键入所学专业]</span> <span class="ue_t">[键入所获学位]</span></p></li></ol><h3><span style="color:#e36c09;font-size:20px;" class="ue_t">工作经验</span></h3><ol style="list-style-type:decimal;"><li><p><span class="ue_t">[键入起止时间]</span> <span class="ue_t">[键入公司名称]</span> <span class="ue_t">[键入职位名称]</span> </p></li><ol style="list-style-type:lower-alpha;"><li><p><span class="ue_t">[键入负责项目]</span> <span class="ue_t">[键入项目简介]</span></p></li><li><p><span class="ue_t">[键入负责项目]</span> <span class="ue_t">[键入项目简介]</span></p></li></ol><li><p><span class="ue_t">[键入起止时间]</span> <span class="ue_t">[键入公司名称]</span> <span class="ue_t">[键入职位名称]</span> </p></li><ol style="list-style-type:lower-alpha;"><li><p><span class="ue_t">[键入负责项目]</span> <span class="ue_t">[键入项目简介]</span></p></li></ol></ol><p><span style="color:#e36c09;font-size:20px;">掌握技能</span></p><p style="text-indent:2em;"> &nbsp;<span class="ue_t">[这里可以键入您所掌握的技能]</span><br /></p>' "html": '<h1 label="Title left" name="tl" style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;margin:0px 0px 10px;"><span style="color:#e36c09;" class="ue_t">[此处键入简历标题]</span></h1><p><span style="color:#e36c09;"><br /></span></p><table width="100%" border="1" bordercolor="#95B3D7" style="border-collapse:collapse;"><tbody><tr><td width="200" style="text-align:center;" class="ue_t">【此处插入照片】</td><td><p><br /></p><p> 联系电话:<span class="ue_t">[键入您的电话]</span></p><p><br /></p><p> 电子邮件:<span class="ue_t">[键入您的电子邮件地址]</span></p><p><br /></p><p> 家庭住址:<span class="ue_t">[键入您的地址]</span></p><p><br /></p></td></tr></tbody></table><h3><span style="color:#e36c09;font-size:20px;">目标职位</span></h3><p style="text-indent:2em;" class="ue_t">[此处键入您的期望职位]</p><h3><span style="color:#e36c09;font-size:20px;">学历</span></h3><p><span style="display:none;line-height:0px;" id="_baidu_bookmark_start_26"></span></p><ol style="list-style-type:decimal;"><li><p><span class="ue_t">[键入起止时间]</span> <span class="ue_t">[键入学校名称] </span> <span class="ue_t">[键入所学专业]</span> <span class="ue_t">[键入所获学位]</span></p></li><li><p><span class="ue_t">[键入起止时间]</span> <span class="ue_t">[键入学校名称]</span> <span class="ue_t">[键入所学专业]</span> <span class="ue_t">[键入所获学位]</span></p></li></ol><h3><span style="color:#e36c09;font-size:20px;" class="ue_t">工作经验</span></h3><ol style="list-style-type:decimal;"><li><p><span class="ue_t">[键入起止时间]</span> <span class="ue_t">[键入公司名称]</span> <span class="ue_t">[键入职位名称]</span> </p></li><ol style="list-style-type:lower-alpha;"><li><p><span class="ue_t">[键入负责项目]</span> <span class="ue_t">[键入项目简介]</span></p></li><li><p><span class="ue_t">[键入负责项目]</span> <span class="ue_t">[键入项目简介]</span></p></li></ol><li><p><span class="ue_t">[键入起止时间]</span> <span class="ue_t">[键入公司名称]</span> <span class="ue_t">[键入职位名称]</span> </p></li><ol style="list-style-type:lower-alpha;"><li><p><span class="ue_t">[键入负责项目]</span> <span class="ue_t">[键入项目简介]</span></p></li></ol></ol><p><span style="color:#e36c09;font-size:20px;">掌握技能</span></p><p style="text-indent:2em;"> &nbsp;<span class="ue_t">[这里可以键入您所掌握的技能]</span><br /></p>'
}, },
{ {
"pre":"pre3.png", "pre": "pre3.png",
'title':lang.richText, 'title': lang.richText,
'preHtml':'<h1 label="Title center" name="tc" style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;text-align:center;margin:0px 0px 20px;" class="ue_t">[此处键入文章标题]</h1><p><img src="http://img.baidu.com/hi/youa/y_0034.gif" width="150" height="100" border="0" hspace="0" vspace="0" style="width:150px;height:100px;float:left;" />图文混排方法</p><p>图片居左,文字围绕图片排版</p><p>方法:在文字前面插入图片,设置居左对齐,然后即可在右边输入多行文</p><p><br /></p><p><img src="http://img.baidu.com/hi/youa/y_0040.gif" width="100" height="100" border="0" hspace="0" vspace="0" style="width:100px;height:100px;float:right;" /></p><p>还有没有什么其他的环绕方式呢?这里是居右环绕</p><p><br /></p><p>欢迎大家多多尝试为UEditor提供更多高质量模板</p>', 'preHtml': '<h1 label="Title center" name="tc" style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;text-align:center;margin:0px 0px 20px;" class="ue_t">[此处键入文章标题]</h1><p><img src="http://img.baidu.com/hi/youa/y_0034.gif" width="150" height="100" border="0" hspace="0" vspace="0" style="width:150px;height:100px;float:left;" />图文混排方法</p><p>图片居左,文字围绕图片排版</p><p>方法:在文字前面插入图片,设置居左对齐,然后即可在右边输入多行文</p><p><br /></p><p><img src="http://img.baidu.com/hi/youa/y_0040.gif" width="100" height="100" border="0" hspace="0" vspace="0" style="width:100px;height:100px;float:right;" /></p><p>还有没有什么其他的环绕方式呢?这里是居右环绕</p><p><br /></p><p>欢迎大家多多尝试为UEditor提供更多高质量模板</p>',
"html":'<p><br /></p><h1 label="Title center" name="tc" style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;text-align:center;margin:0px 0px 20px;" class="ue_t">[此处键入文章标题]</h1><p><img src="http://img.baidu.com/hi/youa/y_0034.gif" width="300" height="200" border="0" hspace="0" vspace="0" style="width:300px;height:200px;float:left;" />图文混排方法</p><p>1. 图片居左,文字围绕图片排版</p><p>方法:在文字前面插入图片,设置居左对齐,然后即可在右边输入多行文本</p><p><br /></p><p>2. 图片居右,文字围绕图片排版</p><p>方法:在文字前面插入图片,设置居右对齐,然后即可在左边输入多行文本</p><p><br /></p><p>3. 图片居中环绕排版</p><p>方法:亲,这个真心没有办法。。。</p><p><br /></p><p><br /></p><p><img src="http://img.baidu.com/hi/youa/y_0040.gif" width="300" height="300" border="0" hspace="0" vspace="0" style="width:300px;height:300px;float:right;" /></p><p>还有没有什么其他的环绕方式呢?这里是居右环绕</p><p><br /></p><p>欢迎大家多多尝试为UEditor提供更多高质量模板</p><p><br /></p><p>占位</p><p><br /></p><p>占位</p><p><br /></p><p>占位</p><p><br /></p><p>占位</p><p><br /></p><p>占位</p><p><br /></p><p><br /></p>' "html": '<p><br /></p><h1 label="Title center" name="tc" style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;text-align:center;margin:0px 0px 20px;" class="ue_t">[此处键入文章标题]</h1><p><img src="http://img.baidu.com/hi/youa/y_0034.gif" width="300" height="200" border="0" hspace="0" vspace="0" style="width:300px;height:200px;float:left;" />图文混排方法</p><p>1. 图片居左,文字围绕图片排版</p><p>方法:在文字前面插入图片,设置居左对齐,然后即可在右边输入多行文本</p><p><br /></p><p>2. 图片居右,文字围绕图片排版</p><p>方法:在文字前面插入图片,设置居右对齐,然后即可在左边输入多行文本</p><p><br /></p><p>3. 图片居中环绕排版</p><p>方法:亲,这个真心没有办法。。。</p><p><br /></p><p><br /></p><p><img src="http://img.baidu.com/hi/youa/y_0040.gif" width="300" height="300" border="0" hspace="0" vspace="0" style="width:300px;height:300px;float:right;" /></p><p>还有没有什么其他的环绕方式呢?这里是居右环绕</p><p><br /></p><p>欢迎大家多多尝试为UEditor提供更多高质量模板</p><p><br /></p><p>占位</p><p><br /></p><p>占位</p><p><br /></p><p>占位</p><p><br /></p><p>占位</p><p><br /></p><p>占位</p><p><br /></p><p><br /></p>'
}, },
{ {
"pre":"pre4.png", "pre": "pre4.png",
'title':lang.sciPapers, 'title': lang.sciPapers,
'preHtml':'<h2 style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;margin:0px 0px 10px;text-align:center;" class="ue_t">[键入文章标题]</h2><p><strong><span style="font-size:12px;">摘要</span></strong><span style="font-size:12px;" class="ue_t">:这里可以输入很长很长很长很长很长很长很长很长很差的摘要</span></p><p style="line-height:1.5em;"><strong>标题 1</strong></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">这里可以输入很多内容,可以图文混排,可以有列表等。</span></p><p style="line-height:1.5em;"><strong>标题 2</strong></p><ol style="list-style-type:lower-alpha;"><li><p class="ue_t">列表 1</p></li><li><p class="ue_t">列表 2</p></li><ol style="list-style-type:lower-roman;"><li><p class="ue_t">多级列表 1</p></li><li><p class="ue_t">多级列表 2</p></li></ol><li><p class="ue_t">列表 3<br /></p></li></ol><p style="line-height:1.5em;"><strong>标题 3</strong></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">来个文字图文混排的</span></p><p style="text-indent:2em;"><br /></p>', 'preHtml': '<h2 style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;margin:0px 0px 10px;text-align:center;" class="ue_t">[键入文章标题]</h2><p><strong><span style="font-size:12px;">摘要</span></strong><span style="font-size:12px;" class="ue_t">:这里可以输入很长很长很长很长很长很长很长很长很差的摘要</span></p><p style="line-height:1.5em;"><strong>标题 1</strong></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">这里可以输入很多内容,可以图文混排,可以有列表等。</span></p><p style="line-height:1.5em;"><strong>标题 2</strong></p><ol style="list-style-type:lower-alpha;"><li><p class="ue_t">列表 1</p></li><li><p class="ue_t">列表 2</p></li><ol style="list-style-type:lower-roman;"><li><p class="ue_t">多级列表 1</p></li><li><p class="ue_t">多级列表 2</p></li></ol><li><p class="ue_t">列表 3<br /></p></li></ol><p style="line-height:1.5em;"><strong>标题 3</strong></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">来个文字图文混排的</span></p><p style="text-indent:2em;"><br /></p>',
'html':'<h2 style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;margin:0px 0px 10px;text-align:center;" class="ue_t">[键入文章标题]</h2><p><strong><span style="font-size:12px;">摘要</span></strong><span style="font-size:12px;" class="ue_t">:这里可以输入很长很长很长很长很长很长很长很长很差的摘要</span></p><p style="line-height:1.5em;"><strong>标题 1</strong></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">这里可以输入很多内容,可以图文混排,可以有列表等。</span></p><p style="line-height:1.5em;"><strong>标题 2</strong></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">来个列表瞅瞅:</span></p><ol style="list-style-type:lower-alpha;"><li><p class="ue_t">列表 1</p></li><li><p class="ue_t">列表 2</p></li><ol style="list-style-type:lower-roman;"><li><p class="ue_t">多级列表 1</p></li><li><p class="ue_t">多级列表 2</p></li></ol><li><p class="ue_t">列表 3<br /></p></li></ol><p style="line-height:1.5em;"><strong>标题 3</strong></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">来个文字图文混排的</span></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">这里可以多行</span></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">右边是图片</span></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">绝对没有问题的,不信你也可以试试看</span></p><p><br /></p>' 'html': '<h2 style="border-bottom-color:#cccccc;border-bottom-width:2px;border-bottom-style:solid;padding:0px 4px 0px 0px;margin:0px 0px 10px;text-align:center;" class="ue_t">[键入文章标题]</h2><p><strong><span style="font-size:12px;">摘要</span></strong><span style="font-size:12px;" class="ue_t">:这里可以输入很长很长很长很长很长很长很长很长很差的摘要</span></p><p style="line-height:1.5em;"><strong>标题 1</strong></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">这里可以输入很多内容,可以图文混排,可以有列表等。</span></p><p style="line-height:1.5em;"><strong>标题 2</strong></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">来个列表瞅瞅:</span></p><ol style="list-style-type:lower-alpha;"><li><p class="ue_t">列表 1</p></li><li><p class="ue_t">列表 2</p></li><ol style="list-style-type:lower-roman;"><li><p class="ue_t">多级列表 1</p></li><li><p class="ue_t">多级列表 2</p></li></ol><li><p class="ue_t">列表 3<br /></p></li></ol><p style="line-height:1.5em;"><strong>标题 3</strong></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">来个文字图文混排的</span></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">这里可以多行</span></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">右边是图片</span></p><p style="text-indent:2em;"><span style="font-size:14px;" class="ue_t">绝对没有问题的,不信你也可以试试看</span></p><p><br /></p>'
} }
]; ];

View File

@ -1,18 +1,99 @@
.wrap{ padding: 5px;font-size: 14px;} .wrap {
.left{width:425px;float: left;} padding: 5px;
.right{width:160px;border: 1px solid #ccc;float: right;padding: 5px;margin-right: 5px;} font-size: 14px;
.right .pre{height: 332px;overflow-y: auto;} }
.right .preitem{border: white 1px solid;margin: 5px 0;padding: 2px 0;}
.right .preitem:hover{background-color: lemonChiffon;cursor: pointer;border: #ccc 1px solid;} .left {
.right .preitem img{display: block;margin: 0 auto;width:100px;} width: 425px;
.clear{clear: both;} float: left;
.top{height:26px;line-height: 26px;padding: 5px;} }
.bottom{height:320px;width:100%;margin: 0 auto;}
.transparent{ background: url("images/bg.gif") repeat;} .right {
.bottom table tr td{border:1px dashed #ccc;} width: 160px;
#colorPicker{width: 17px;height: 17px;border: 1px solid #CCC;display: inline-block;border-radius: 3px;box-shadow: 2px 2px 5px #D3D6DA;} border: 1px solid #ccc;
.border_style1{padding:2px;border: 1px solid #ccc;border-radius: 5px;box-shadow:2px 2px 5px #d3d6da;} float: right;
p{margin: 5px 0} padding: 5px;
table{clear:both;margin-bottom:10px;border-collapse:collapse;word-break:break-all;} margin-right: 5px;
li{clear:both} }
ol{padding-left:40px; }
.right .pre {
height: 332px;
overflow-y: auto;
}
.right .preitem {
border: white 1px solid;
margin: 5px 0;
padding: 2px 0;
}
.right .preitem:hover {
background-color: lemonChiffon;
cursor: pointer;
border: #ccc 1px solid;
}
.right .preitem img {
display: block;
margin: 0 auto;
width: 100px;
}
.clear {
clear: both;
}
.top {
height: 26px;
line-height: 26px;
padding: 5px;
}
.bottom {
height: 320px;
width: 100%;
margin: 0 auto;
}
.transparent {
background: url("images/bg.gif") repeat;
}
.bottom table tr td {
border: 1px dashed #ccc;
}
#colorPicker {
width: 17px;
height: 17px;
border: 1px solid #CCC;
display: inline-block;
border-radius: 3px;
box-shadow: 2px 2px 5px #D3D6DA;
}
.border_style1 {
padding: 2px;
border: 1px solid #ccc;
border-radius: 5px;
box-shadow: 2px 2px 5px #d3d6da;
}
p {
margin: 5px 0
}
table {
clear: both;
margin-bottom: 10px;
border-collapse: collapse;
word-break: break-all;
}
li {
clear: both
}
ol {
padding-left: 40px;
}

View File

@ -3,24 +3,24 @@
<head> <head>
<title></title> <title></title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" src="../internal.js?20220503"></script> <script type="text/javascript" src="../internal.js?aea0c61c"></script>
<link rel="stylesheet" type="text/css" href="template.css?20220503"> <link rel="stylesheet" type="text/css" href="template.css?18a023c1">
</head> </head>
<body> <body>
<div class="wrap"> <div class="wrap">
<div class="left"> <div class="left">
<div class="top"> <div class="top">
<label><var id="lang_template_clear"></var><input id="issave" type="checkbox"></label> <label><var id="lang_template_clear"></var><input id="issave" type="checkbox"></label>
</div>
<div class="bottom border_style1" id="preview"></div>
</div> </div>
<fieldset class="right border_style1"> <div class="bottom border_style1" id="preview"></div>
<legend><var id="lang_template_select"></var></legend>
<div class="pre" id="preitem"></div>
</fieldset>
<div class="clear"></div>
</div> </div>
<script type="text/javascript" src="config.js?20220503"></script> <fieldset class="right border_style1">
<script type="text/javascript" src="template.js?20220503"></script> <legend><var id="lang_template_select"></var></legend>
<div class="pre" id="preitem"></div>
</fieldset>
<div class="clear"></div>
</div>
<script type="text/javascript" src="config.js?9434a730"></script>
<script type="text/javascript" src="template.js?2d269423"></script>
</body> </body>
</html> </html>

View File

@ -7,47 +7,47 @@
*/ */
(function () { (function () {
var me = editor, var me = editor,
preview = $G( "preview" ), preview = $G("preview"),
preitem = $G( "preitem" ), preitem = $G("preitem"),
tmps = templates, tmps = templates,
currentTmp; currentTmp;
var initPre = function () { var initPre = function () {
var str = ""; var str = "";
for ( var i = 0, tmp; tmp = tmps[i++]; ) { for (var i = 0, tmp; tmp = tmps[i++];) {
str += '<div class="preitem" onclick="pre(' + i + ')"><img src="' + "images/" + tmp.pre + '" ' + (tmp.title ? "alt=" + tmp.title + " title=" + tmp.title + "" : "") + '></div>'; str += '<div class="preitem" onclick="pre(' + i + ')"><img src="' + "images/" + tmp.pre + '" ' + (tmp.title ? "alt=" + tmp.title + " title=" + tmp.title + "" : "") + '></div>';
} }
preitem.innerHTML = str; preitem.innerHTML = str;
}; };
var pre = function ( n ) { var pre = function (n) {
var tmp = tmps[n - 1]; var tmp = tmps[n - 1];
currentTmp = tmp; currentTmp = tmp;
clearItem(); clearItem();
domUtils.setStyles( preitem.childNodes[n - 1], { domUtils.setStyles(preitem.childNodes[n - 1], {
"background-color":"lemonChiffon", "background-color": "lemonChiffon",
"border":"#ccc 1px solid" "border": "#ccc 1px solid"
} ); });
preview.innerHTML = tmp.preHtml ? tmp.preHtml : ""; preview.innerHTML = tmp.preHtml ? tmp.preHtml : "";
}; };
var clearItem = function () { var clearItem = function () {
var items = preitem.children; var items = preitem.children;
for ( var i = 0, item; item = items[i++]; ) { for (var i = 0, item; item = items[i++];) {
domUtils.setStyles( item, { domUtils.setStyles(item, {
"background-color":"", "background-color": "",
"border":"white 1px solid" "border": "white 1px solid"
} ); });
} }
}; };
dialog.onok = function () { dialog.onok = function () {
if ( !$G( "issave" ).checked ){ if (!$G("issave").checked) {
me.execCommand( "cleardoc" ); me.execCommand("cleardoc");
} }
var obj = { var obj = {
html:currentTmp && currentTmp.html html: currentTmp && currentTmp.html
}; };
me.execCommand( "template", obj ); me.execCommand("template", obj);
}; };
initPre(); initPre();
window.pre = pre; window.pre = pre;
pre(2) pre(2)
})(); })();

View File

@ -1,6 +1,16 @@
@charset "utf-8"; @charset "utf-8";
.wrapper{ width: 570px;_width:575px;margin: 10px auto; zoom:1;position: relative} .wrapper {
.tabbody{height: 355px;} width: 570px;
_width: 575px;
margin: 10px auto;
zoom: 1;
position: relative
}
.tabbody {
height: 355px;
}
.tabbody .panel { .tabbody .panel {
position: absolute; position: absolute;
width: 0; width: 0;
@ -9,13 +19,17 @@
overflow: hidden; overflow: hidden;
display: none; display: none;
} }
.tabbody .panel.focus { .tabbody .panel.focus {
width: 100%; width: 100%;
height: 355px; height: 355px;
display: block; display: block;
} }
.tabbody .panel table td{vertical-align: middle;} .tabbody .panel table td {
vertical-align: middle;
}
#videoUrl { #videoUrl {
width: 380px; width: 380px;
height: 26px; height: 26px;
@ -24,33 +38,65 @@
background: #FFF; background: #FFF;
border: 1px solid #d7d7d7; border: 1px solid #d7d7d7;
outline: none; outline: none;
border-radius:3px; border-radius: 3px;
padding:0 5px; padding: 0 5px;
} }
#videoSelect{
width: 100px; #videoSelect {
display: inline-block; width: 100px;
background: #FFF; display: inline-block;
border: 1px solid #EEE; background: #FFF;
line-height: 26px; border: 1px solid #EEE;
text-align: center; line-height: 26px;
color: #333; text-align: center;
text-decoration: none; color: #333;
border-radius: 3px; text-decoration: none;
vertical-align: middle; border-radius: 3px;
vertical-align: middle;
} }
#videoSearchTxt{margin-left:15px;background: #FFF;width:200px;height:21px;line-height:21px;border: 1px solid #d7d7d7;}
#searchList{width: 570px;overflow: auto;zoom:1;height: 270px;} #videoSearchTxt {
#searchList div{float: left;width: 120px;height: 135px;margin: 5px 15px;} margin-left: 15px;
#searchList img{margin: 2px 8px;cursor: pointer;border: 2px solid #fff} /*不用缩略图*/ background: #FFF;
#searchList p{margin-left: 10px;} width: 200px;
#videoType{ height: 21px;
line-height: 21px;
border: 1px solid #d7d7d7;
}
#searchList {
width: 570px;
overflow: auto;
zoom: 1;
height: 270px;
}
#searchList div {
float: left;
width: 120px;
height: 135px;
margin: 5px 15px;
}
#searchList img {
margin: 2px 8px;
cursor: pointer;
border: 2px solid #fff
}
/*不用缩略图*/
#searchList p {
margin-left: 10px;
}
#videoType {
width: 65px; width: 65px;
height: 23px; height: 23px;
line-height: 22px; line-height: 22px;
border: 1px solid #d7d7d7; border: 1px solid #d7d7d7;
} }
#videoSearchBtn,#videoSearchReset{
#videoSearchBtn, #videoSearchReset {
/*width: 80px;*/ /*width: 80px;*/
height: 25px; height: 25px;
line-height: 25px; line-height: 25px;
@ -61,12 +107,46 @@
} }
#preview {
position: relative;
width: 420px;
padding: 0;
overflow: hidden;
margin-left: 10px;
_margin-left: 5px;
height: 280px;
background-color: #ddd;
float: left
}
#preview{position: relative;width: 420px;padding:0;overflow: hidden; margin-left: 10px; _margin-left:5px; height: 280px;background-color: #ddd;float: left} #preview .previewMsg {
#preview .previewMsg {position:absolute;top:0;margin:0;padding:0;height:280px;width:100%;background-color: #666;} position: absolute;
#preview .previewMsg span{display:block;margin: 125px auto 0 auto;text-align:center;font-size:18px;color:#fff;} top: 0;
#preview .previewVideo {position:absolute;top:0;margin:0;padding:0;height:280px;width:100%;} margin: 0;
.edui-video-wrapper fieldset{ padding: 0;
height: 280px;
width: 100%;
background-color: #666;
}
#preview .previewMsg span {
display: block;
margin: 125px auto 0 auto;
text-align: center;
font-size: 18px;
color: #fff;
}
#preview .previewVideo {
position: absolute;
top: 0;
margin: 0;
padding: 0;
height: 280px;
width: 100%;
}
.edui-video-wrapper fieldset {
border: 1px solid #ddd; border: 1px solid #ddd;
padding-left: 5px; padding-left: 5px;
margin-bottom: 20px; margin-bottom: 20px;
@ -74,17 +154,30 @@
width: 115px; width: 115px;
} }
#videoInfo {width: 120px;float: left;margin-left: 10px;_margin-left:7px;} #videoInfo {
fieldset{ width: 120px;
float: left;
margin-left: 10px;
_margin-left: 7px;
}
fieldset {
border: 1px solid #ddd; border: 1px solid #ddd;
padding-left: 5px; padding-left: 5px;
margin-bottom: 20px; margin-bottom: 20px;
padding-bottom: 5px; padding-bottom: 5px;
width: 115px; width: 115px;
} }
fieldset legend{font-weight: bold;}
fieldset p{line-height: 30px;} fieldset legend {
fieldset input.txt{ font-weight: bold;
}
fieldset p {
line-height: 30px;
}
fieldset input.txt {
width: 65px; width: 65px;
height: 21px; height: 21px;
line-height: 21px; line-height: 21px;
@ -92,12 +185,35 @@ fieldset input.txt{
background: #FFF; background: #FFF;
border: 1px solid #d7d7d7; border: 1px solid #d7d7d7;
} }
label.url{font-weight: bold;margin-left: 5px;}
#videoFloat div{cursor:pointer;opacity: 0.5;filter: alpha(opacity = 50);margin:9px;_margin:5px;width:38px;height:36px;float:left;}
#videoFloat .focus{opacity: 1;filter: alpha(opacity = 100)}
span.view{display: inline-block;width: 30px;float: right;cursor: pointer;color: blue}
label.url {
font-weight: bold;
margin-left: 5px;
}
#videoFloat div {
cursor: pointer;
opacity: 0.5;
filter: alpha(opacity=50);
margin: 9px;
_margin: 5px;
width: 38px;
height: 36px;
float: left;
}
#videoFloat .focus {
opacity: 1;
filter: alpha(opacity=100)
}
span.view {
display: inline-block;
width: 30px;
float: right;
cursor: pointer;
color: blue
}
/* upload video */ /* upload video */
@ -110,17 +226,45 @@ span.view{display: inline-block;width: 30px;float: right;cursor: pointer;color:
background: #fff; background: #fff;
display: block; display: block;
} }
.tabbody #upload.panel.focus { .tabbody #upload.panel.focus {
width: 100%; width: 100%;
height: 335px; height: 335px;
display: block; display: block;
clip: auto; clip: auto;
} }
#upload_alignment div{cursor:pointer;opacity: 0.5;filter: alpha(opacity = 50);margin:9px;_margin:5px;width:38px;height:36px;float:left;}
#upload_alignment .focus{opacity: 1;filter: alpha(opacity = 100)} #upload_alignment div {
#upload_left { width:427px; float:left; } cursor: pointer;
#upload_left .controller { height: 30px; clear: both; } opacity: 0.5;
#uploadVideoInfo{margin-top:10px;float:right;padding-right:8px;} filter: alpha(opacity=50);
margin: 9px;
_margin: 5px;
width: 38px;
height: 36px;
float: left;
}
#upload_alignment .focus {
opacity: 1;
filter: alpha(opacity=100)
}
#upload_left {
width: 427px;
float: left;
}
#upload_left .controller {
height: 30px;
clear: both;
}
#uploadVideoInfo {
margin-top: 10px;
float: right;
padding-right: 8px;
}
#upload .queueList { #upload .queueList {
margin: 0; margin: 0;
@ -143,7 +287,7 @@ span.view{display: inline-block;width: 30px;float: right;cursor: pointer;color:
#upload .placeholder { #upload .placeholder {
margin: 10px; margin: 10px;
margin-right:0; margin-right: 0;
border: 2px dashed #e6e6e6; border: 2px dashed #e6e6e6;
*border: 0px dashed #e6e6e6; *border: 0px dashed #e6e6e6;
height: 161px; height: 161px;
@ -155,7 +299,7 @@ span.view{display: inline-block;width: 30px;float: right;cursor: pointer;color:
color: #cccccc; color: #cccccc;
font-size: 18px; font-size: 18px;
position: relative; position: relative;
top:0; top: 0;
*margin-left: 0; *margin-left: 0;
*left: 10px; *left: 10px;
} }
@ -340,12 +484,14 @@ span.view{display: inline-block;width: 30px;float: right;cursor: pointer;color:
-ms-transition: 200ms ease-out; -ms-transition: 200ms ease-out;
transition: 200ms ease-out; transition: 200ms ease-out;
} }
#upload .filelist li p.imgWrap.notimage { #upload .filelist li p.imgWrap.notimage {
margin-top: 0; margin-top: 0;
width: 111px; width: 111px;
height: 111px; height: 111px;
border: 1px #eeeeee solid; border: 1px #eeeeee solid;
} }
#upload .filelist li p.imgWrap.notimage i.file-preview { #upload .filelist li p.imgWrap.notimage i.file-preview {
margin-top: 15px; margin-top: 15px;
} }
@ -364,7 +510,7 @@ span.view{display: inline-block;width: 30px;float: right;cursor: pointer;color:
line-height: 28px; line-height: 28px;
width: 100%; width: 100%;
z-index: 100; z-index: 100;
display:none; display: none;
} }
#upload .filelist li .success { #upload .filelist li .success {
@ -386,7 +532,8 @@ span.view{display: inline-block;width: 30px;float: right;cursor: pointer;color:
border: 1px solid #eeeeee; border: 1px solid #eeeeee;
border-radius: 0; border-radius: 0;
} }
#upload .filelist li.filePickerBlock div.webuploader-pick {
#upload .filelist li.filePickerBlock div.webuploader-pick {
width: 100%; width: 100%;
height: 100%; height: 100%;
margin: 0; margin: 0;
@ -419,7 +566,7 @@ span.view{display: inline-block;width: 30px;float: right;cursor: pointer;color:
background: url(./images/icons.gif) no-repeat \9; background: url(./images/icons.gif) no-repeat \9;
margin: 5px 1px 1px; margin: 5px 1px 1px;
cursor: pointer; cursor: pointer;
-webkit-tap-highlight-color: rgba(0,0,0,0); -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
-webkit-user-select: none; -webkit-user-select: none;
-moz-user-select: none; -moz-user-select: none;
-ms-user-select: none; -ms-user-select: none;
@ -427,7 +574,7 @@ span.view{display: inline-block;width: 30px;float: right;cursor: pointer;color:
} }
#upload .filelist div.file-panel span.rotateLeft { #upload .filelist div.file-panel span.rotateLeft {
display:none; display: none;
background-position: 0 -24px; background-position: 0 -24px;
} }
@ -436,7 +583,7 @@ span.view{display: inline-block;width: 30px;float: right;cursor: pointer;color:
} }
#upload .filelist div.file-panel span.rotateRight { #upload .filelist div.file-panel span.rotateRight {
display:none; display: none;
background-position: -24px -24px; background-position: -24px -24px;
} }
@ -475,6 +622,7 @@ span.view{display: inline-block;width: 30px;float: right;cursor: pointer;color:
color: #6dbfff; color: #6dbfff;
margin: 0 10px 0 0; margin: 0 10px 0 0;
} }
#upload .statusBar .progress span.percentage { #upload .statusBar .progress span.percentage {
width: 0; width: 0;
height: 100%; height: 100%;
@ -483,6 +631,7 @@ span.view{display: inline-block;width: 30px;float: right;cursor: pointer;color:
background: #1483d8; background: #1483d8;
position: absolute; position: absolute;
} }
#upload .statusBar .progress span.text { #upload .statusBar .progress span.text {
position: relative; position: relative;
z-index: 10; z-index: 10;
@ -505,6 +654,7 @@ span.view{display: inline-block;width: 30px;float: right;cursor: pointer;color:
display: inline-block; display: inline-block;
float: left; float: left;
} }
#upload .statusBar .btns .webuploader-pick, #upload .statusBar .btns .webuploader-pick,
#upload .statusBar .btns .uploadBtn, #upload .statusBar .btns .uploadBtn,
#upload .statusBar .btns .uploadBtn.state-uploading, #upload .statusBar .btns .uploadBtn.state-uploading,
@ -524,6 +674,7 @@ span.view{display: inline-block;width: 30px;float: right;cursor: pointer;color:
-ms-user-select: none; -ms-user-select: none;
user-select: none; user-select: none;
} }
#upload .statusBar .btns .webuploader-pick-hover, #upload .statusBar .btns .webuploader-pick-hover,
#upload .statusBar .btns .uploadBtn:hover, #upload .statusBar .btns .uploadBtn:hover,
#upload .statusBar .btns .uploadBtn.state-uploading:hover, #upload .statusBar .btns .uploadBtn.state-uploading:hover,
@ -532,20 +683,21 @@ span.view{display: inline-block;width: 30px;float: right;cursor: pointer;color:
} }
#upload .statusBar .btns .uploadBtn, #upload .statusBar .btns .uploadBtn,
#upload .statusBar .btns .uploadBtn.state-paused{ #upload .statusBar .btns .uploadBtn.state-paused {
background: #00b7ee; background: #00b7ee;
color: #fff; color: #fff;
border-color: transparent; border-color: transparent;
} }
#upload .statusBar .btns .uploadBtn:hover, #upload .statusBar .btns .uploadBtn:hover,
#upload .statusBar .btns .uploadBtn.state-paused:hover{ #upload .statusBar .btns .uploadBtn.state-paused:hover {
background: #00a2d4; background: #00a2d4;
} }
#upload .statusBar .btns .uploadBtn.disabled { #upload .statusBar .btns .uploadBtn.disabled {
pointer-events: none; pointer-events: none;
filter:alpha(opacity=60); filter: alpha(opacity=60);
-moz-opacity:0.6; -moz-opacity: 0.6;
-khtml-opacity: 0.6; -khtml-opacity: 0.6;
opacity: 0.6; opacity: 0.6;
} }
@ -562,41 +714,51 @@ i.file-preview {
background-position: -140px center; background-position: -140px center;
background-repeat: no-repeat; background-repeat: no-repeat;
} }
i.file-preview.file-type-dir{
i.file-preview.file-type-dir {
background-position: 0 center; background-position: 0 center;
} }
i.file-preview.file-type-file{
i.file-preview.file-type-file {
background-position: -140px center; background-position: -140px center;
} }
i.file-preview.file-type-filelist{
i.file-preview.file-type-filelist {
background-position: -210px center; background-position: -210px center;
} }
i.file-preview.file-type-zip, i.file-preview.file-type-zip,
i.file-preview.file-type-rar, i.file-preview.file-type-rar,
i.file-preview.file-type-7z, i.file-preview.file-type-7z,
i.file-preview.file-type-tar, i.file-preview.file-type-tar,
i.file-preview.file-type-gz, i.file-preview.file-type-gz,
i.file-preview.file-type-bz2{ i.file-preview.file-type-bz2 {
background-position: -280px center; background-position: -280px center;
} }
i.file-preview.file-type-xls, i.file-preview.file-type-xls,
i.file-preview.file-type-xlsx{ i.file-preview.file-type-xlsx {
background-position: -350px center; background-position: -350px center;
} }
i.file-preview.file-type-doc, i.file-preview.file-type-doc,
i.file-preview.file-type-docx{ i.file-preview.file-type-docx {
background-position: -420px center; background-position: -420px center;
} }
i.file-preview.file-type-ppt, i.file-preview.file-type-ppt,
i.file-preview.file-type-pptx{ i.file-preview.file-type-pptx {
background-position: -490px center; background-position: -490px center;
} }
i.file-preview.file-type-vsd{
i.file-preview.file-type-vsd {
background-position: -560px center; background-position: -560px center;
} }
i.file-preview.file-type-pdf{
i.file-preview.file-type-pdf {
background-position: -630px center; background-position: -630px center;
} }
i.file-preview.file-type-txt, i.file-preview.file-type-txt,
i.file-preview.file-type-md, i.file-preview.file-type-md,
i.file-preview.file-type-json, i.file-preview.file-type-json,
@ -607,18 +769,22 @@ i.file-preview.file-type-js,
i.file-preview.file-type-css, i.file-preview.file-type-css,
i.file-preview.file-type-php, i.file-preview.file-type-php,
i.file-preview.file-type-jsp, i.file-preview.file-type-jsp,
i.file-preview.file-type-asp{ i.file-preview.file-type-asp {
background-position: -700px center; background-position: -700px center;
} }
i.file-preview.file-type-apk{
i.file-preview.file-type-apk {
background-position: -770px center; background-position: -770px center;
} }
i.file-preview.file-type-exe{
i.file-preview.file-type-exe {
background-position: -840px center; background-position: -840px center;
} }
i.file-preview.file-type-ipa{
i.file-preview.file-type-ipa {
background-position: -910px center; background-position: -910px center;
} }
i.file-preview.file-type-mp4, i.file-preview.file-type-mp4,
i.file-preview.file-type-swf, i.file-preview.file-type-swf,
i.file-preview.file-type-mkv, i.file-preview.file-type-mkv,
@ -630,21 +796,23 @@ i.file-preview.file-type-mpeg,
i.file-preview.file-type-ogv, i.file-preview.file-type-ogv,
i.file-preview.file-type-webm, i.file-preview.file-type-webm,
i.file-preview.file-type-rm, i.file-preview.file-type-rm,
i.file-preview.file-type-rmvb{ i.file-preview.file-type-rmvb {
background-position: -980px center; background-position: -980px center;
} }
i.file-preview.file-type-ogg, i.file-preview.file-type-ogg,
i.file-preview.file-type-wav, i.file-preview.file-type-wav,
i.file-preview.file-type-wmv, i.file-preview.file-type-wmv,
i.file-preview.file-type-mid, i.file-preview.file-type-mid,
i.file-preview.file-type-mp3{ i.file-preview.file-type-mp3 {
background-position: -1050px center; background-position: -1050px center;
} }
i.file-preview.file-type-jpg, i.file-preview.file-type-jpg,
i.file-preview.file-type-jpeg, i.file-preview.file-type-jpeg,
i.file-preview.file-type-gif, i.file-preview.file-type-gif,
i.file-preview.file-type-bmp, i.file-preview.file-type-bmp,
i.file-preview.file-type-png, i.file-preview.file-type-png,
i.file-preview.file-type-psd{ i.file-preview.file-type-psd {
background-position: -140px center; background-position: -140px center;
} }

View File

@ -1,39 +1,52 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
<title></title> <title></title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" src="../internal.js?20220503"></script> <script type="text/javascript" src="../internal.js?aea0c61c"></script>
<link rel="stylesheet" type="text/css" href="video.css?20220503" /> <link rel="stylesheet" type="text/css" href="video.css?3ce050b9"/>
</head> </head>
<body> <body>
<div class="wrapper"> <div class="wrapper">
<div id="videoTab"> <div id="videoTab">
<div id="tabHeads" class="tabhead"> <div id="tabHeads" class="tabhead">
<span tabSrc="video" class="focus" data-content-id="video"><var id="lang_tab_insertV"></var></span> <span tabSrc="video" class="focus" data-content-id="video"><var id="lang_tab_insertV"></var></span>
<span tabSrc="upload" style="display:none;" data-content-id="upload"><var id="lang_tab_uploadV"></var></span> <span tabSrc="upload" style="display:none;" data-content-id="upload"><var
id="lang_tab_uploadV"></var></span>
</div> </div>
<div id="tabBodys" class="tabbody"> <div id="tabBodys" class="tabbody">
<div id="video" class="panel focus"> <div id="video" class="panel focus">
<table><tr><td><label for="videoUrl" class="url"><var id="lang_video_url"></var></label></td><td><input id="videoUrl" type="text"><a href="javascript:;" id="videoSelect" style="display:none;">选择视频</a> </td></tr></table> <table>
<div style="padding:0 5px 5px 5px;color:#999;"> <tr>
外链视频支持:优酷、腾讯视频、哔哩哔哩 <td><label for="videoUrl" class="url"><var id="lang_video_url"></var></label></td>
</div> <td><input id="videoUrl" type="text"><a href="javascript:;" id="videoSelect"
<div id="preview"></div> style="display:none;">选择视频</a></td>
<div id="videoInfo"> </tr>
<fieldset> </table>
<legend><var id="lang_video_size"></var></legend> <div style="padding:0 5px 5px 5px;color:#999;">
<table> 外链视频支持:优酷、腾讯视频、哔哩哔哩
<tr><td><label for="videoWidth"><var id="lang_videoW"></var></label></td><td><input class="txt" id="videoWidth" type="text"/></td></tr> </div>
<tr><td><label for="videoHeight"><var id="lang_videoH"></var></label></td><td><input class="txt" id="videoHeight" type="text"/></td></tr> <div id="preview"></div>
</table> <div id="videoInfo">
</fieldset> <fieldset>
<fieldset> <legend><var id="lang_video_size"></var></legend>
<legend><var id="lang_alignment"></var></legend> <table>
<div id="videoFloat"></div> <tr>
</fieldset> <td><label for="videoWidth"><var id="lang_videoW"></var></label></td>
</div> <td><input class="txt" id="videoWidth" type="text"/></td>
</tr>
<tr>
<td><label for="videoHeight"><var id="lang_videoH"></var></label></td>
<td><input class="txt" id="videoHeight" type="text"/></td>
</tr>
</table>
</fieldset>
<fieldset>
<legend><var id="lang_alignment"></var></legend>
<div id="videoFloat"></div>
</fieldset>
</div>
</div> </div>
<div id="upload" class="panel"> <div id="upload" class="panel">
<div id="upload_left"> <div id="upload_left">
@ -42,7 +55,8 @@
<div class="progress"> <div class="progress">
<span class="text">0%</span> <span class="text">0%</span>
<span class="percentage"></span> <span class="percentage"></span>
</div><div class="info"></div> </div>
<div class="info"></div>
<div class="btns"> <div class="btns">
<div id="filePickerBtn"></div> <div id="filePickerBtn"></div>
<div class="uploadBtn"><var id="lang_start_upload"></var></div> <div class="uploadBtn"><var id="lang_start_upload"></var></div>
@ -62,8 +76,14 @@
<fieldset> <fieldset>
<legend><var id="lang_upload_size"></var></legend> <legend><var id="lang_upload_size"></var></legend>
<table> <table>
<tr><td><label><var id="lang_upload_width"></var></label></td><td><input class="txt" id="upload_width" type="text"/></td></tr> <tr>
<tr><td><label><var id="lang_upload_height"></var></label></td><td><input class="txt" id="upload_height" type="text"/></td></tr> <td><label><var id="lang_upload_width"></var></label></td>
<td><input class="txt" id="upload_width" type="text"/></td>
</tr>
<tr>
<td><label><var id="lang_upload_height"></var></label></td>
<td><input class="txt" id="upload_height" type="text"/></td>
</tr>
</table> </table>
</fieldset> </fieldset>
<fieldset> <fieldset>
@ -77,13 +97,13 @@
</div> </div>
<!-- jquery --> <!-- jquery -->
<script type="text/javascript" src="../../third-party/jquery-1.10.2.js?20220503"></script> <script type="text/javascript" src="../../third-party/jquery-1.10.2.js?628072e7"></script>
<!-- webuploader --> <!-- webuploader -->
<script type="text/javascript" src="../../third-party/webuploader/webuploader.js?20220503"></script> <script type="text/javascript" src="../../third-party/webuploader/webuploader.js?21e72664"></script>
<link rel="stylesheet" type="text/css" href="../../third-party/webuploader/webuploader.css?20220503"> <link rel="stylesheet" type="text/css" href="../../third-party/webuploader/webuploader.css?0057c5c7">
<!-- video --> <!-- video -->
<script type="text/javascript" src="video.js?20220503"></script> <script type="text/javascript" src="video.js?101f4d14"></script>
</body> </body>
</html> </html>

View File

@ -6,7 +6,7 @@
* To change this template use File | Settings | File Templates. * To change this template use File | Settings | File Templates.
*/ */
(function(){ (function () {
var video = {}, var video = {},
uploadVideoList = [], uploadVideoList = [],
@ -14,7 +14,7 @@
uploadFile; uploadFile;
var editorOpt = {}; var editorOpt = {};
window.onload = function(){ window.onload = function () {
editorOpt = editor.getOpt('videoConfig'); editorOpt = editor.getOpt('videoConfig');
$focus($G("videoUrl")); $focus($G("videoUrl"));
initTabs(); initTabs();
@ -23,59 +23,59 @@
}; };
/* 初始化tab标签 */ /* 初始化tab标签 */
function initTabs(){ function initTabs() {
var tabs = $G('tabHeads').children; var tabs = $G('tabHeads').children;
for (var i = 0; i < tabs.length; i++) { for (var i = 0; i < tabs.length; i++) {
domUtils.on(tabs[i], "click", function (e) { domUtils.on(tabs[i], "click", function (e) {
var j, bodyId, target = e.target || e.srcElement; var j, bodyId, target = e.target || e.srcElement;
for (j = 0; j < tabs.length; j++) { for (j = 0; j < tabs.length; j++) {
bodyId = tabs[j].getAttribute('data-content-id'); bodyId = tabs[j].getAttribute('data-content-id');
if(tabs[j] == target){ if (tabs[j] == target) {
domUtils.addClass(tabs[j], 'focus'); domUtils.addClass(tabs[j], 'focus');
domUtils.addClass($G(bodyId), 'focus'); domUtils.addClass($G(bodyId), 'focus');
}else { } else {
domUtils.removeClasses(tabs[j], 'focus'); domUtils.removeClasses(tabs[j], 'focus');
domUtils.removeClasses($G(bodyId), 'focus'); domUtils.removeClasses($G(bodyId), 'focus');
} }
} }
}); });
} }
if(!editorOpt.disableUpload){ if (!editorOpt.disableUpload) {
$G('tabHeads').querySelector('[data-content-id="upload"]').style.display = 'inline-block'; $G('tabHeads').querySelector('[data-content-id="upload"]').style.display = 'inline-block';
} }
if(!!editorOpt.selectCallback){ if (!!editorOpt.selectCallback) {
$G('videoSelect').style.display = 'inline-block'; $G('videoSelect').style.display = 'inline-block';
domUtils.on($G('videoSelect'), "click", function (e) { domUtils.on($G('videoSelect'), "click", function (e) {
editorOpt.selectCallback(editor,function(info){ editorOpt.selectCallback(editor, function (info) {
if(info){ if (info) {
$G('videoUrl').value = info.path; $G('videoUrl').value = info.path;
createPreviewVideo(info.path); createPreviewVideo(info.path);
} }
}); });
}); });
} }
} }
function initVideo(){ function initVideo() {
createAlignButton( ["videoFloat", "upload_alignment"] ); createAlignButton(["videoFloat", "upload_alignment"]);
addUrlChangeListener($G("videoUrl")); addUrlChangeListener($G("videoUrl"));
addOkListener(); addOkListener();
//编辑视频时初始化相关信息 //编辑视频时初始化相关信息
(function(){ (function () {
var img = editor.selection.getRange().getClosedNode(),url; var img = editor.selection.getRange().getClosedNode(), url;
if(img && img.className){ if (img && img.className) {
var hasFakedClass = (img.className == "edui-faked-video"), var hasFakedClass = (img.className == "edui-faked-video"),
hasUploadClass = img.className.indexOf("edui-upload-video")!=-1; hasUploadClass = img.className.indexOf("edui-upload-video") != -1;
if(hasFakedClass || hasUploadClass) { if (hasFakedClass || hasUploadClass) {
$G("videoUrl").value = url = img.getAttribute("_url"); $G("videoUrl").value = url = img.getAttribute("_url");
$G("videoWidth").value = img.width; $G("videoWidth").value = img.width;
$G("videoHeight").value = img.height; $G("videoHeight").value = img.height;
var align = domUtils.getComputedStyle(img,"float"), var align = domUtils.getComputedStyle(img, "float"),
parentAlign = domUtils.getComputedStyle(img.parentNode,"text-align"); parentAlign = domUtils.getComputedStyle(img.parentNode, "text-align");
updateAlignButton(parentAlign==="center"?"center":align); updateAlignButton(parentAlign === "center" ? "center" : align);
} }
if(hasUploadClass) { if (hasUploadClass) {
isModifyUploadVideo = true; isModifyUploadVideo = true;
} }
} }
@ -86,11 +86,11 @@
/** /**
* 监听确认和取消两个按钮事件用户执行插入或者清空正在播放的视频实例操作 * 监听确认和取消两个按钮事件用户执行插入或者清空正在播放的视频实例操作
*/ */
function addOkListener(){ function addOkListener() {
dialog.onok = function(){ dialog.onok = function () {
$G("preview").innerHTML = ""; $G("preview").innerHTML = "";
var currentTab = findFocus("tabHeads","tabSrc"); var currentTab = findFocus("tabHeads", "tabSrc");
switch(currentTab){ switch (currentTab) {
case "video": case "video":
return insertSingle(); return insertSingle();
break; break;
@ -102,7 +102,7 @@
break; break;
} }
}; };
dialog.oncancel = function(){ dialog.oncancel = function () {
$G("preview").innerHTML = ""; $G("preview").innerHTML = "";
}; };
} }
@ -111,15 +111,15 @@
* 依据传入的align值更新按钮信息 * 依据传入的align值更新按钮信息
* @param align * @param align
*/ */
function updateAlignButton( align ) { function updateAlignButton(align) {
var aligns = $G( "videoFloat" ).children; var aligns = $G("videoFloat").children;
for ( var i = 0, ci; ci = aligns[i++]; ) { for (var i = 0, ci; ci = aligns[i++];) {
if ( ci.getAttribute( "name" ) == align ) { if (ci.getAttribute("name") == align) {
if ( ci.className !="focus" ) { if (ci.className != "focus") {
ci.className = "focus"; ci.className = "focus";
} }
} else { } else {
if ( ci.className =="focus" ) { if (ci.className == "focus") {
ci.className = ""; ci.className = "";
} }
} }
@ -129,39 +129,39 @@
/** /**
* 将单个视频信息插入编辑器中 * 将单个视频信息插入编辑器中
*/ */
function insertSingle(){ function insertSingle() {
var width = $G("videoWidth"), var width = $G("videoWidth"),
height = $G("videoHeight"), height = $G("videoHeight"),
url=$G('videoUrl').value, url = $G('videoUrl').value,
align = findFocus("videoFloat","name"); align = findFocus("videoFloat", "name");
if(!url) return false; if (!url) return false;
if ( !checkNum( [width, height] ) ) return false; if (!checkNum([width, height])) return false;
editor.execCommand('insertvideo', { editor.execCommand('insertvideo', {
url: convert_url(url), url: convert_url(url),
width: width.value, width: width.value,
height: height.value, height: height.value,
align: align align: align
}, isModifyUploadVideo ? 'upload':null); }, isModifyUploadVideo ? 'upload' : null);
} }
/** /**
* 将元素id下的所有代表视频的图片插入编辑器中 * 将元素id下的所有代表视频的图片插入编辑器中
* @param id * @param id
*/ */
function insertSearch(id){ function insertSearch(id) {
var imgs = domUtils.getElementsByTagName($G(id),"img"), var imgs = domUtils.getElementsByTagName($G(id), "img"),
videoObjs=[]; videoObjs = [];
for(var i=0,img; img=imgs[i++];){ for (var i = 0, img; img = imgs[i++];) {
if(img.getAttribute("selected")){ if (img.getAttribute("selected")) {
videoObjs.push({ videoObjs.push({
url:img.getAttribute("ue_video_url"), url: img.getAttribute("ue_video_url"),
width:420, width: 420,
height:280, height: 280,
align:"none" align: "none"
}); });
} }
} }
editor.execCommand('insertvideo',videoObjs); editor.execCommand('insertvideo', videoObjs);
} }
/** /**
@ -169,101 +169,107 @@
* @param id * @param id
* @param returnProperty * @param returnProperty
*/ */
function findFocus( id, returnProperty ) { function findFocus(id, returnProperty) {
var tabs = $G( id ).children, var tabs = $G(id).children,
property; property;
for ( var i = 0, ci; ci = tabs[i++]; ) { for (var i = 0, ci; ci = tabs[i++];) {
if ( ci.className=="focus" ) { if (ci.className == "focus") {
property = ci.getAttribute( returnProperty ); property = ci.getAttribute(returnProperty);
break; break;
} }
} }
return property; return property;
} }
function convert_url(url){
if (!url) return ''; function convert_url(url) {
url = utils.trim(url) if (!url) return '';
.replace(/v\.youku\.com\/v_show\/id_([\w\-=]+)\.html/i, 'player.youku.com/embed/$1') url = utils.trim(url)
// .replace(/(www\.)?youtube\.com\/watch\?v=([\w\-]+)/i, "www.youtube.com/v/$2") .replace(/v\.youku\.com\/v_show\/id_([\w\-=]+)\.html/i, 'player.youku.com/embed/$1')
// .replace(/youtu.be\/(\w+)$/i, "www.youtube.com/v/$1") // .replace(/(www\.)?youtube\.com\/watch\?v=([\w\-]+)/i, "www.youtube.com/v/$2")
//.replace(/www\.iqiyi\.com\/v_(\w+)\.html/i, "www.youtube.com/v/$1") // .replace(/youtu.be\/(\w+)$/i, "www.youtube.com/v/$1")
// .replace(/v\.ku6\.com\/.+\/([\w\.]+)\.html.*$/i, "player.ku6.com/refer/$1/v.swf") //.replace(/www\.iqiyi\.com\/v_(\w+)\.html/i, "www.youtube.com/v/$1")
// .replace(/www\.56\.com\/u\d+\/v_([\w\-]+)\.html/i, "player.56.com/v_$1.swf") // .replace(/v\.ku6\.com\/.+\/([\w\.]+)\.html.*$/i, "player.ku6.com/refer/$1/v.swf")
// .replace(/www.56.com\/w\d+\/play_album\-aid\-\d+_vid\-([^.]+)\.html/i, "player.56.com/v_$1.swf") // .replace(/www\.56\.com\/u\d+\/v_([\w\-]+)\.html/i, "player.56.com/v_$1.swf")
// .replace(/v\.pps\.tv\/play_([\w]+)\.html.*$/i, "player.pps.tv/player/sid/$1/v.swf") // .replace(/www.56.com\/w\d+\/play_album\-aid\-\d+_vid\-([^.]+)\.html/i, "player.56.com/v_$1.swf")
// .replace(/www\.letv\.com\/ptv\/vplay\/([\d]+)\.html.*$/i, "i7.imgs.letv.com/player/swfPlayer.swf?id=$1&autoplay=0") // .replace(/v\.pps\.tv\/play_([\w]+)\.html.*$/i, "player.pps.tv/player/sid/$1/v.swf")
// .replace(/www\.tudou\.com\/programs\/view\/([\w\-]+)\/?/i, "www.tudou.com/v/$1") // .replace(/www\.letv\.com\/ptv\/vplay\/([\d]+)\.html.*$/i, "i7.imgs.letv.com/player/swfPlayer.swf?id=$1&autoplay=0")
// https://v.qq.com/x/cover/wagzbx91asjomnu/w05337nxfof.html // .replace(/www\.tudou\.com\/programs\/view\/([\w\-]+)\/?/i, "www.tudou.com/v/$1")
// https://v.qq.com/iframe/player.html?vid=w05337nxfof&tiny=0&auto=0 // https://v.qq.com/x/cover/wagzbx91asjomnu/w05337nxfof.html
.replace(/v\.qq\.com\/x\/cover\/[\w]+\/([\w]+)\.html/i, "v.qq.com/iframe/player.html?vid=$1&tiny=0&auto=0") // https://v.qq.com/iframe/player.html?vid=w05337nxfof&tiny=0&auto=0
.replace(/v\.qq\.com\/x\/page\/([\w]+)\.html/i, "v.qq.com/iframe/player.html?vid=$1&tiny=0&auto=0") .replace(/v\.qq\.com\/x\/cover\/[\w]+\/([\w]+)\.html/i, "v.qq.com/iframe/player.html?vid=$1&tiny=0&auto=0")
.replace(/www\.bilibili\.com\/video\/([a-zA-Z0-9]+)\/?.*$/i, "player.bilibili.com/player.html?bvid=$1") .replace(/v\.qq\.com\/x\/page\/([\w]+)\.html/i, "v.qq.com/iframe/player.html?vid=$1&tiny=0&auto=0")
// .replace(/v\.qq\.com\/cover\/[\w]+\/[\w]+\/([\w]+)\.html/i, "static.video.qq.com/TPout.swf?vid=$1") .replace(/www\.bilibili\.com\/video\/([a-zA-Z0-9]+)\/?.*$/i, "player.bilibili.com/player.html?bvid=$1")
// .replace(/v\.qq\.com\/.+[\?\&]vid=([^&]+).*$/i, "static.video.qq.com/TPout.swf?vid=$1") // .replace(/v\.qq\.com\/cover\/[\w]+\/[\w]+\/([\w]+)\.html/i, "static.video.qq.com/TPout.swf?vid=$1")
// .replace(/my\.tv\.sohu\.com\/[\w]+\/[\d]+\/([\d]+)\.shtml.*$/i, "share.vrs.sohu.com/my/v.swf&id=$1") // .replace(/v\.qq\.com\/.+[\?\&]vid=([^&]+).*$/i, "static.video.qq.com/TPout.swf?vid=$1")
; // .replace(/my\.tv\.sohu\.com\/[\w]+\/[\d]+\/([\d]+)\.shtml.*$/i, "share.vrs.sohu.com/my/v.swf&id=$1")
return url; ;
return url;
} }
/** /**
* 检测传入的所有input框中输入的长宽是否是正数 * 检测传入的所有input框中输入的长宽是否是正数
* @param nodes input框集合 * @param nodes input框集合
*/ */
function checkNum( nodes ) { function checkNum(nodes) {
for ( var i = 0, ci; ci = nodes[i++]; ) { for (var i = 0, ci; ci = nodes[i++];) {
var value = ci.value; var value = ci.value;
if ( !isNumber( value ) && value) { if (!isNumber(value) && value) {
alert( lang.numError ); alert(lang.numError);
ci.value = ""; ci.value = "";
ci.focus(); ci.focus();
return false; return false;
} }
} }
return true; return true;
} }
/** /**
* 数字判断 * 数字判断
* @param value * @param value
*/ */
function isNumber( value ) { function isNumber(value) {
return /(0|^[1-9]\d*$)/.test( value ); return /(0|^[1-9]\d*$)/.test(value);
} }
/** /**
* 创建图片浮动选择按钮 * 创建图片浮动选择按钮
* @param ids * @param ids
*/ */
function createAlignButton( ids ) { function createAlignButton(ids) {
for ( var i = 0, ci; ci = ids[i++]; ) { for (var i = 0, ci; ci = ids[i++];) {
var floatContainer = $G( ci ), var floatContainer = $G(ci),
nameMaps = {"none":lang['default'], "left":lang.floatLeft, "right":lang.floatRight, "center":lang.block}; nameMaps = {
for ( var j in nameMaps ) { "none": lang['default'],
var div = document.createElement( "div" ); "left": lang.floatLeft,
div.setAttribute( "name", j ); "right": lang.floatRight,
if ( j == "none" ) div.className="focus"; "center": lang.block
div.style.cssText = "background:url(images/" + j + "_focus.jpg);"; };
div.setAttribute( "title", nameMaps[j] ); for (var j in nameMaps) {
floatContainer.appendChild( div ); var div = document.createElement("div");
} div.setAttribute("name", j);
switchSelect( ci ); if (j == "none") div.className = "focus";
} div.style.cssText = "background:url(images/" + j + "_focus.jpg);";
} div.setAttribute("title", nameMaps[j]);
floatContainer.appendChild(div);
}
switchSelect(ci);
}
}
/** /**
* 选择切换 * 选择切换
* @param selectParentId * @param selectParentId
*/ */
function switchSelect( selectParentId ) { function switchSelect(selectParentId) {
var selects = $G( selectParentId ).children; var selects = $G(selectParentId).children;
for ( var i = 0, ci; ci = selects[i++]; ) { for (var i = 0, ci; ci = selects[i++];) {
domUtils.on( ci, "click", function () { domUtils.on(ci, "click", function () {
for ( var j = 0, cj; cj = selects[j++]; ) { for (var j = 0, cj; cj = selects[j++];) {
cj.className = ""; cj.className = "";
cj.removeAttribute && cj.removeAttribute( "class" ); cj.removeAttribute && cj.removeAttribute("class");
} }
this.className = "focus"; this.className = "focus";
} ) })
} }
} }
@ -271,15 +277,15 @@
* 监听url改变事件 * 监听url改变事件
* @param url * @param url
*/ */
function addUrlChangeListener(url){ function addUrlChangeListener(url) {
if (browser.ie) { if (browser.ie) {
url.onpropertychange = function () { url.onpropertychange = function () {
createPreviewVideo( this.value ); createPreviewVideo(this.value);
} }
} else { } else {
url.addEventListener( "input", function () { url.addEventListener("input", function () {
createPreviewVideo( this.value ); createPreviewVideo(this.value);
}, false ); }, false);
} }
} }
@ -287,45 +293,45 @@
* 根据url生成视频预览 * 根据url生成视频预览
* @param url * @param url
*/ */
function createPreviewVideo(url){ function createPreviewVideo(url) {
if (!url)return; if (!url) return;
var conUrl = convert_url(url); var conUrl = convert_url(url);
conUrl = utils.unhtml(conUrl); conUrl = utils.unhtml(conUrl);
// $G("preview").innerHTML = '<div class="previewMsg"><span>'+lang.urlError+'</span></div>'+ // $G("preview").innerHTML = '<div class="previewMsg"><span>'+lang.urlError+'</span></div>'+
// '<embed class="previewVideo" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"' + // '<embed class="previewVideo" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"' +
// ' src="' + conUrl + '"' + // ' src="' + conUrl + '"' +
// ' width="' + 420 + '"' + // ' width="' + 420 + '"' +
// ' height="' + 280 + '"' + // ' height="' + 280 + '"' +
// ' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >' + // ' wmode="transparent" play="true" loop="false" menu="false" allowscriptaccess="never" allowfullscreen="true" >' +
// '</embed>'; // '</embed>';
$G("preview").innerHTML = '<div class="previewMsg"><span>' + lang.urlError + '</span></div>' + $G("preview").innerHTML = '<div class="previewMsg"><span>' + lang.urlError + '</span></div>' +
'<iframe class="previewVideo" ' + '<iframe class="previewVideo" ' +
' src="' + conUrl + '"' + ' src="' + conUrl + '"' +
' width="' + 420 + '"' + ' width="' + 420 + '"' +
' height="' + 280 + '"' + ' height="' + 280 + '"' +
' frameborder=0 allowfullscreen>' + ' frameborder=0 allowfullscreen>' +
'</iframe>'; '</iframe>';
} }
/* 插入上传视频 */ /* 插入上传视频 */
function insertUpload(){ function insertUpload() {
var videoObjs=[], var videoObjs = [],
uploadDir = editor.getOpt('videoUrlPrefix'), uploadDir = editor.getOpt('videoUrlPrefix'),
width = $G('upload_width').value || 420, width = $G('upload_width').value || 420,
height = $G('upload_height').value || 280, height = $G('upload_height').value || 280,
align = findFocus("upload_alignment","name") || 'none'; align = findFocus("upload_alignment", "name") || 'none';
for(var key in uploadVideoList) { for (var key in uploadVideoList) {
var file = uploadVideoList[key]; var file = uploadVideoList[key];
videoObjs.push({ videoObjs.push({
url: uploadDir + file.url, url: uploadDir + file.url,
width:width, width: width,
height:height, height: height,
align:align align: align
}); });
} }
@ -339,7 +345,7 @@
} }
/*初始化上传标签*/ /*初始化上传标签*/
function initUpload(){ function initUpload() {
uploadFile = new UploadFile('queueList'); uploadFile = new UploadFile('queueList');
} }
@ -349,6 +355,7 @@
this.$wrap = target.constructor == String ? $('#' + target) : $(target); this.$wrap = target.constructor == String ? $('#' + target) : $(target);
this.init(); this.init();
} }
UploadFile.prototype = { UploadFile.prototype = {
init: function () { init: function () {
this.fileList = []; this.fileList = [];
@ -363,34 +370,34 @@
var _this = this, var _this = this,
$ = jQuery, // just in case. Make sure it's not an other libaray. $ = jQuery, // just in case. Make sure it's not an other libaray.
$wrap = _this.$wrap, $wrap = _this.$wrap,
// 图片容器 // 图片容器
$queue = $wrap.find('.filelist'), $queue = $wrap.find('.filelist'),
// 状态栏,包括进度和控制按钮 // 状态栏,包括进度和控制按钮
$statusBar = $wrap.find('.statusBar'), $statusBar = $wrap.find('.statusBar'),
// 文件总体选择信息。 // 文件总体选择信息。
$info = $statusBar.find('.info'), $info = $statusBar.find('.info'),
// 上传按钮 // 上传按钮
$upload = $wrap.find('.uploadBtn'), $upload = $wrap.find('.uploadBtn'),
// 上传按钮 // 上传按钮
$filePickerBtn = $wrap.find('.filePickerBtn'), $filePickerBtn = $wrap.find('.filePickerBtn'),
// 上传按钮 // 上传按钮
$filePickerBlock = $wrap.find('.filePickerBlock'), $filePickerBlock = $wrap.find('.filePickerBlock'),
// 没选择文件之前的内容。 // 没选择文件之前的内容。
$placeHolder = $wrap.find('.placeholder'), $placeHolder = $wrap.find('.placeholder'),
// 总体进度条 // 总体进度条
$progress = $statusBar.find('.progress').hide(), $progress = $statusBar.find('.progress').hide(),
// 添加的文件数量 // 添加的文件数量
fileCount = 0, fileCount = 0,
// 添加的文件总大小 // 添加的文件总大小
fileSize = 0, fileSize = 0,
// 优化retina, 在retina下这个值是2 // 优化retina, 在retina下这个值是2
ratio = window.devicePixelRatio || 1, ratio = window.devicePixelRatio || 1,
// 缩略图大小 // 缩略图大小
thumbnailWidth = 113 * ratio, thumbnailWidth = 113 * ratio,
thumbnailHeight = 113 * ratio, thumbnailHeight = 113 * ratio,
// 可能有pedding, ready, uploading, confirm, done. // 可能有pedding, ready, uploading, confirm, done.
state = '', state = '',
// 所有文件的进度信息key为file id // 所有文件的进度信息key为file id
percentages = {}, percentages = {},
supportTransition = (function () { supportTransition = (function () {
var s = document.createElement('p').style, var s = document.createElement('p').style,
@ -402,11 +409,12 @@
s = null; s = null;
return r; return r;
})(), })(),
// WebUploader实例 // WebUploader实例
uploader, uploader,
actionUrl = editor.getActionUrl(editor.getOpt('videoActionName')), actionUrl = editor.getActionUrl(editor.getOpt('videoActionName')),
fileMaxSize = editor.getOpt('videoMaxSize'), fileMaxSize = editor.getOpt('videoMaxSize'),
acceptExtensions = (editor.getOpt('videoAllowFiles') || []).join('').replace(/\./g, ',').replace(/^[,]/, '');; acceptExtensions = (editor.getOpt('videoAllowFiles') || []).join('').replace(/\./g, ',').replace(/^[,]/, '');
;
if (!WebUploader.Uploader.support()) { if (!WebUploader.Uploader.support()) {
$('#filePickerReady').after($('<div>').html(lang.errorNotSupport)).hide(); $('#filePickerReady').after($('<div>').html(lang.errorNotSupport)).hide();
@ -416,7 +424,7 @@
return; return;
} }
uploader = _this.uploader = WebUploader.create({ var uploaderOption = {
pick: { pick: {
id: '#filePickerReady', id: '#filePickerReady',
label: lang.uploadSelectFile label: lang.uploadSelectFile
@ -426,8 +434,28 @@
fileVal: editor.getOpt('videoFieldName'), fileVal: editor.getOpt('videoFieldName'),
duplicate: true, duplicate: true,
fileSingleSizeLimit: fileMaxSize, fileSingleSizeLimit: fileMaxSize,
headers: editor.getOpt('serverHeaders') || {},
compress: false compress: false
}); };
if(editor.getOpt('uploadServiceEnable')) {
uploaderOption.customUpload = function (file, callback) {
editor.getOpt('uploadServiceUpload')('video', file, {
success: function( res ) {
callback.onSuccess(file, {_raw:JSON.stringify(res)});
},
error: function( err ) {
callback.onError(file, err);
},
progress: function( percent ) {
callback.onProgress(file, percent);
}
}, {
from: 'video'
});
};
}
uploader = _this.uploader = WebUploader.create(uploaderOption);
uploader.addButton({ uploader.addButton({
id: '#filePickerBlock' id: '#filePickerBlock'
}); });
@ -479,7 +507,7 @@
showError(file.statusText); showError(file.statusText);
} else { } else {
$wrap.text(lang.uploadPreview); $wrap.text(lang.uploadPreview);
if ('|png|jpg|jpeg|bmp|gif|'.indexOf('|'+file.ext.toLowerCase()+'|') == -1) { if ('|png|jpg|jpeg|bmp|gif|'.indexOf('|' + file.ext.toLowerCase() + '|') == -1) {
$wrap.empty().addClass('notimage').append('<i class="file-preview file-type-' + file.ext.toLowerCase() + '"></i>' + $wrap.empty().addClass('notimage').append('<i class="file-preview file-type-' + file.ext.toLowerCase() + '"></i>' +
'<span class="file-title">' + file.name + '</span>'); '<span class="file-title">' + file.name + '</span>');
} else { } else {
@ -499,7 +527,7 @@
}, thumbnailWidth, thumbnailHeight); }, thumbnailWidth, thumbnailHeight);
} }
} }
percentages[ file.id ] = [ file.size, 0 ]; percentages[file.id] = [file.size, 0];
file.rotation = 0; file.rotation = 0;
/* 检查文件格式 */ /* 检查文件格式 */
@ -519,11 +547,11 @@
// 成功 // 成功
if (cur === 'error' || cur === 'invalid') { if (cur === 'error' || cur === 'invalid') {
showError(file.statusText); showError(file.statusText);
percentages[ file.id ][ 1 ] = 1; percentages[file.id][1] = 1;
} else if (cur === 'interrupt') { } else if (cur === 'interrupt') {
showError('interrupt'); showError('interrupt');
} else if (cur === 'queued') { } else if (cur === 'queued') {
percentages[ file.id ][ 1 ] = 0; percentages[file.id][1] = 0;
} else if (cur === 'progress') { } else if (cur === 'progress') {
$info.hide(); $info.hide();
$prgress.css('display', 'block'); $prgress.css('display', 'block');
@ -576,7 +604,7 @@
// 负责view的销毁 // 负责view的销毁
function removeFile(file) { function removeFile(file) {
var $li = $('#' + file.id); var $li = $('#' + file.id);
delete percentages[ file.id ]; delete percentages[file.id];
updateTotalProgress(); updateTotalProgress();
$li.off().find('.file-panel').off().end().remove(); $li.off().find('.file-panel').off().end().remove();
} }
@ -588,8 +616,8 @@
percent; percent;
$.each(percentages, function (k, v) { $.each(percentages, function (k, v) {
total += v[ 0 ]; total += v[0];
loaded += v[ 0 ] * v[ 1 ]; loaded += v[0] * v[1];
}); });
percent = total ? loaded / total : 0; percent = total ? loaded / total : 0;
@ -615,7 +643,8 @@
$queue.addClass('element-invisible'); $queue.addClass('element-invisible');
$statusBar.addClass('element-invisible'); $statusBar.addClass('element-invisible');
$placeHolder.removeClass('element-invisible'); $placeHolder.removeClass('element-invisible');
$progress.hide(); $info.hide(); $progress.hide();
$info.hide();
uploader.refresh(); uploader.refresh();
break; break;
@ -624,25 +653,29 @@
$placeHolder.addClass('element-invisible'); $placeHolder.addClass('element-invisible');
$queue.removeClass('element-invisible'); $queue.removeClass('element-invisible');
$statusBar.removeClass('element-invisible'); $statusBar.removeClass('element-invisible');
$progress.hide(); $info.show(); $progress.hide();
$info.show();
$upload.text(lang.uploadStart); $upload.text(lang.uploadStart);
uploader.refresh(); uploader.refresh();
break; break;
/* 上传中 */ /* 上传中 */
case 'uploading': case 'uploading':
$progress.show(); $info.hide(); $progress.show();
$info.hide();
$upload.text(lang.uploadPause); $upload.text(lang.uploadPause);
break; break;
/* 暂停上传 */ /* 暂停上传 */
case 'paused': case 'paused':
$progress.show(); $info.hide(); $progress.show();
$info.hide();
$upload.text(lang.uploadContinue); $upload.text(lang.uploadContinue);
break; break;
case 'confirm': case 'confirm':
$progress.show(); $info.hide(); $progress.show();
$info.hide();
$upload.text(lang.uploadStart); $upload.text(lang.uploadStart);
stats = uploader.getStats(); stats = uploader.getStats();
@ -653,7 +686,8 @@
break; break;
case 'finish': case 'finish':
$progress.hide(); $info.show(); $progress.hide();
$info.show();
if (stats.uploadFailNum) { if (stats.uploadFailNum) {
$upload.text(lang.uploadRetry); $upload.text(lang.uploadRetry);
} else { } else {
@ -687,9 +721,7 @@
} }
} else { } else {
stats = uploader.getStats(); stats = uploader.getStats();
text = lang.updateStatusFinish.replace('_', fileCount). text = lang.updateStatusFinish.replace('_', fileCount).replace('_KB', WebUploader.formatSize(fileSize)).replace('_', stats.successNum);
replace('_KB', WebUploader.formatSize(fileSize)).
replace('_', stats.successNum);
if (stats.uploadFailNum) { if (stats.uploadFailNum) {
text += lang.updateStatusError.replace('_', stats.uploadFailNum); text += lang.updateStatusError.replace('_', stats.uploadFailNum);
@ -734,7 +766,7 @@
case 'startUpload': case 'startUpload':
/* 添加额外的GET参数 */ /* 添加额外的GET参数 */
var params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '', var params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '',
url = utils.formatUrl(actionUrl + (actionUrl.indexOf('?') == -1 ? '?':'&') + 'encode=utf-8&' + params); url = utils.formatUrl(actionUrl + (actionUrl.indexOf('?') == -1 ? '?' : '&') + 'encode=utf-8&' + params);
uploader.option('server', url); uploader.option('server', url);
setState('uploading', files); setState('uploading', files);
break; break;
@ -756,7 +788,7 @@
$percent = $li.find('.progress span'); $percent = $li.find('.progress span');
$percent.css('width', percentage * 100 + '%'); $percent.css('width', percentage * 100 + '%');
percentages[ file.id ][ 1 ] = percentage; percentages[file.id][1] = percentage;
updateTotalProgress(); updateTotalProgress();
}); });
@ -765,13 +797,19 @@
try { try {
var responseText = (ret._raw || ret), var responseText = (ret._raw || ret),
json = utils.str2json(responseText); json = utils.str2json(responseText);
json = editor.getOpt('serverResponsePrepare')(json);
if (json.state == 'SUCCESS') { if (json.state == 'SUCCESS') {
uploadVideoList.push({ uploadVideoList.push({
'url': json.url, 'url': json.url,
'type': json.type, 'type': json.type,
'original':json.original 'original': json.original
}); });
$file.append('<span class="success"></span>'); $file.append('<span class="success"></span>');
// 触发上传视频事件
editor.fireEvent("uploadsuccess", {
res: json,
type: 'video'
});
} else { } else {
$file.find('.error').text(json.state).show(); $file.find('.error').text(json.state).show();
} }
@ -782,9 +820,11 @@
uploader.on('uploadError', function (file, code) { uploader.on('uploadError', function (file, code) {
}); });
uploader.on('error', function (code, file) { uploader.on('error', function (code, param1, param2) {
if (code == 'Q_TYPE_DENIED' || code == 'F_EXCEED_SIZE') { if (code === 'F_EXCEED_SIZE') {
addFile(file); editor.getOpt('tipError')(lang.errorExceedSize + ' ' + (param1 / 1024 / 1024).toFixed(1) + 'MB');
} else {
console.log('error', code, param1, param2);
} }
}); });
uploader.on('uploadComplete', function (file, ret) { uploader.on('uploadComplete', function (file, ret) {
@ -809,13 +849,13 @@
}, },
getQueueCount: function () { getQueueCount: function () {
var file, i, status, readyFile = 0, files = this.uploader.getFiles(); var file, i, status, readyFile = 0, files = this.uploader.getFiles();
for (i = 0; file = files[i++]; ) { for (i = 0; file = files[i++];) {
status = file.getStatus(); status = file.getStatus();
if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++; if (status == 'queued' || status == 'uploading' || status == 'progress') readyFile++;
} }
return readyFile; return readyFile;
}, },
refresh: function(){ refresh: function () {
this.uploader.refresh(); this.uploader.refresh();
} }
}; };

View File

@ -1,215 +1,221 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd"> "http://www.w3.org/TR/html4/loose.dtd">
<html> <html>
<head> <head>
<title></title> <title></title>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" src="../internal.js?20220503"></script> <script type="text/javascript" src="../internal.js?aea0c61c"></script>
<style type="text/css"> <style type="text/css">
.wrapper { .wrapper {
width: 600px; width: 600px;
padding: 10px; padding: 10px;
height: 352px; height: 352px;
overflow: hidden; overflow: hidden;
position: relative; position: relative;
border-bottom: 1px solid #d7d7d7 border-bottom: 1px solid #d7d7d7
} }
.wrapper .image-info { .wrapper .image-info {
display: flex; display: flex;
align-items: center; align-items: center;
} }
.wrapper .image-info .input { .wrapper .image-info .input {
flex-grow: 1; flex-grow: 1;
display: flex; display: flex;
} }
.wrapper .image-info .input input { .wrapper .image-info .input input {
display: block; display: block;
border: 1px solid #CCC; border: 1px solid #CCC;
height: 23px; height: 23px;
border-radius: 3px; border-radius: 3px;
flex-grow: 1; flex-grow: 1;
outline: none; outline: none;
} }
.wrapper .image-info .copy { .wrapper .image-info .copy {
width: 60px; width: 60px;
cursor: pointer; cursor: pointer;
margin: 0 5px; margin: 0 5px;
} }
.wrapper .image-info .copy div { .wrapper .image-info .copy div {
height: 30px; height: 30px;
font-size: 12px; font-size: 12px;
line-height: 28px; line-height: 28px;
cursor: pointer; cursor: pointer;
border-radius: 4px; border-radius: 4px;
text-align: center; text-align: center;
background-color: #F8F8F8; background-color: #F8F8F8;
border: 1px solid #EEE; border: 1px solid #EEE;
} }
.wrapper .image-info .action { .wrapper .image-info .action {
width: 100px; width: 100px;
cursor: pointer; cursor: pointer;
} }
.wrapper .image-info .action .save-from-local { .wrapper .image-info .action .save-from-local {
position: relative; position: relative;
height: 30px; height: 30px;
font-size: 12px; font-size: 12px;
line-height: 28px; line-height: 28px;
cursor: pointer; cursor: pointer;
border-radius: 4px; border-radius: 4px;
text-align: center; text-align: center;
background-color: #F8F8F8; background-color: #F8F8F8;
border: 1px solid #EEE; border: 1px solid #EEE;
} }
.wrapper .image-info .action .save-from-local input { .wrapper .image-info .action .save-from-local input {
position: absolute; position: absolute;
left: 0; left: 0;
top: 0; top: 0;
opacity: 0; opacity: 0;
cursor: pointer; cursor: pointer;
} }
.wrapper .image-manual { .wrapper .image-manual {
background: #EEE; background: #EEE;
padding: 10px; padding: 10px;
border-radius: 5px; border-radius: 5px;
margin-top: 10px; margin-top: 10px;
line-height: 2; line-height: 2;
} }
.wrapper .image-manual .title { .wrapper .image-manual .title {
font-weight: bold; font-weight: bold;
font-size: 120%; font-size: 120%;
} }
.wrapper .image-manual .body { .wrapper .image-manual .body {
} }
</style> </style>
</head> </head>
<body> <body>
<div class="wrapper"> <div class="wrapper">
<div class="image-info"> <div class="image-info">
<div class="input"> <div class="input">
<input type="text" id="fileUrl"/> <input type="text" id="fileUrl"/>
</div>
<div class="copy">
<div id="copyButton">复制路径</div>
</div>
<div class="action">
<div class="save-from-local">
<div>本地选择保存</div>
<input type="file" id="saveFile" multiple=true/>
</div>
</div>
</div> </div>
<div class="copy"> <div class="image-tip"></div>
<div id="copyButton">复制路径</div> <div class="image-manual">
<div class="title">
Windows使用教程
</div>
<div class="body">
<p>1、点击复制地址按钮</p>
<p>2、点击本地选择文件粘贴剪切板的路径到文件选择路径</p>
<p>3、点击确定</p>
</div>
<div class="title">
Mac使用教程
</div>
<div class="body">
<p>1、点击复制地址按钮</p>
<p>2、点击本地选择文件按快捷 Command+Shift+G ,粘贴剪切板的路径到文件选择路径</p>
<p>3、点击确定</p>
</div>
</div> </div>
<div class="action">
<div class="save-from-local">
<div>本地选择保存</div>
<input type="file" id="saveFile"/>
</div>
</div>
</div>
<div class="image-tip"></div>
<div class="image-manual">
<div class="title">
Windows使用教程
</div>
<div class="body">
<p>1、点击复制地址按钮</p>
<p>2、点击本地选择文件粘贴剪切板的路径到文件选择路径</p>
<p>3、点击确定</p>
</div>
<div class="title">
Mac使用教程
</div>
<div class="body">
<p>1、点击复制地址按钮</p>
<p>2、点击本地选择文件按快捷 Command+Shift+G ,粘贴剪切板的路径到文件选择路径</p>
<p>3、点击确定</p>
</div>
</div>
</div> </div>
<script src="../../third-party/jquery-1.10.2.js?20220503"></script> <script src="../../third-party/jquery-1.10.2.js?628072e7"></script>
<script src="../../third-party/webuploader/webuploader.js?20220503"></script> <script src="../../third-party/webuploader/webuploader.js?21e72664"></script>
<script type="text/javascript" src="../../third-party/clipboard/clipboard.js?20220503"></script> <script type="text/javascript" src="../../third-party/clipboard/clipboard.js?555edf0a"></script>
<script type="text/javascript" src="wordimage.js?20220903"></script> <script type="text/javascript" src="wordimage.js?f4efe813"></script>
<script type="text/javascript"> <script type="text/javascript">
editor.setOpt({ editor.setOpt({
wordImageFieldName: "upfile", wordImageFieldName: "upfile",
compressSide: 0, compressSide: 0,
maxImageSideLength: 900 maxImageSideLength: 900
}); });
//全局变量 //全局变量
var imageUrls = [], //用于保存从服务器返回的图片信息数组 var imageUrls = [], //用于保存从服务器返回的图片信息数组
selectedImageCount = 0, //当前已选择的但未上传的图片数量 selectedImageCount = 0, //当前已选择的但未上传的图片数量
optImageUrl = editor.getActionUrl(editor.getOpt('imageActionName')), optImageUrl = editor.getActionUrl(editor.getOpt('imageActionName')),
optImageFieldName = editor.getOpt('imageFieldName'), optImageFieldName = editor.getOpt('imageFieldName'),
optImageCompressBorder = editor.getOpt('imageCompressEnable') ? editor.getOpt('imageCompressBorder') : null, optImageCompressBorder = editor.getOpt('imageCompressEnable') ? editor.getOpt('imageCompressBorder') : null,
maxSize = editor.getOpt('imageMaxSize') / 1024 / 1024, maxSize = editor.getOpt('imageMaxSize') / 1024 / 1024,
extension = editor.getOpt('imageAllowFiles').join(';').replace(/\./g, '*.'); extension = editor.getOpt('imageAllowFiles').join(';').replace(/\./g, '*.');
/* 添加额外的GET参数 */ /* 添加额外的GET参数 */
var params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '', var params = utils.serializeParam(editor.queryCommandValue('serverparam')) || '',
urlWidthParams = optImageUrl + (optImageUrl.indexOf('?') == -1 ? '?' : '&') + params; urlWidthParams = optImageUrl + (optImageUrl.indexOf('?') == -1 ? '?' : '&') + params;
var uploader, var uploader,
actionUrl = editor.getActionUrl(editor.getOpt('imageActionName')), actionUrl = editor.getActionUrl(editor.getOpt('imageActionName')),
acceptExtensions = (editor.getOpt('imageAllowFiles') || []).join('').replace(/\./g, ',').replace(/^[,]/, ''), acceptExtensions = (editor.getOpt('imageAllowFiles') || []).join('').replace(/\./g, ',').replace(/^[,]/, ''),
imageMaxSize = editor.getOpt('imageMaxSize'), imageMaxSize = editor.getOpt('imageMaxSize'),
imageCompressBorder = editor.getOpt('imageCompressBorder'); imageCompressBorder = editor.getOpt('imageCompressBorder');
uploader = WebUploader.create({ uploader = WebUploader.create({
accept: { accept: {
title: 'Images', title: 'Images',
extensions: acceptExtensions, extensions: acceptExtensions,
mimeTypes: 'image/*' mimeTypes: 'image/*'
}, },
swf: '../../third-party/webuploader/Uploader.swf', swf: '../../third-party/webuploader/Uploader.swf',
server: actionUrl, server: actionUrl,
fileVal: editor.getOpt('imageFieldName'), fileVal: editor.getOpt('imageFieldName'),
duplicate: true, duplicate: true,
fileSingleSizeLimit: imageMaxSize, // 默认 2 M fileSingleSizeLimit: imageMaxSize, // 默认 2 M
threads: 1, threads: 1,
compress: editor.getOpt('imageCompressEnable') ? { compress: editor.getOpt('imageCompressEnable') ? {
width: imageCompressBorder, width: imageCompressBorder,
height: imageCompressBorder, height: imageCompressBorder,
// 图片质量只有type为`image/jpeg`的时候才有效。 // 图片质量只有type为`image/jpeg`的时候才有效。
quality: 90, quality: 90,
// 是否允许放大如果想要生成小图的时候不失真此选项应该设置为false. // 是否允许放大如果想要生成小图的时候不失真此选项应该设置为false.
allowMagnify: false, allowMagnify: false,
// 是否允许裁剪。 // 是否允许裁剪。
crop: false, crop: false,
// 是否保留头部meta信息。 // 是否保留头部meta信息。
preserveHeaders: true preserveHeaders: true
} : false } : false
}); });
uploader.on('uploadSuccess', function (file, res) { uploader.on('uploadSuccess', function (file, res) {
if ('state' in res) { res = editor.getOpt('serverResponsePrepare')(res);
if (res.state === 'SUCCESS') { if ('state' in res) {
if (res.url) { if (res.state === 'SUCCESS') {
imageUrls.push({ if (res.url) {
name: file.name, imageUrls.push({
url: res.url, name: file.name,
title: '', url: res.url,
}); title: '',
if ($('#fileUrl').val().indexOf(file.name) >= 0) { });
$('#fileUrl').val(res.url); $('.image-tip').html('<span style="color:#139213;">图片' + imageUrls.length + '(' + file.name + ')' + '转存成功</span>');
$('.image-tip').html('<span style="color:#139213;">转存成功,请提交确认</span>'); } else {
} $('.image-tip').html('上传失败:' + JSON.stringify(res))
}
// 触发上传附件事件
editor.fireEvent("uploadsuccess", {
res: res,
type: 'image'
});
} else {
$('.image-tip').html('上传失败:' + JSON.stringify(res))
}
} else { } else {
$('.image-tip').html('上传失败:' + JSON.stringify(res)) $('.image-tip').html('上传失败:' + JSON.stringify(res))
} }
} else { });
$('.image-tip').html('上传失败:' + JSON.stringify(res)) uploader.on('uploadFinished', function () {
} $('.image-tip').html('<span style="color:#139213;">转存成功,请提交确认</span>');
} else { });
$('.image-tip').html('上传失败:' + JSON.stringify(res)) utils.domReady(function () {
} var options = {};
}); var callbacks = {};
utils.domReady(function () { wordImage.init(options, callbacks);
var options = {}; });
var callbacks = {};
wordImage.init(options, callbacks);
});
</script> </script>
</body> </body>

View File

@ -9,82 +9,85 @@ var wordImage = {};
var g = $G, flashObj, flashContainer; var g = $G, flashObj, flashContainer;
wordImage.init = function (opt, callbacks) { wordImage.init = function (opt, callbacks) {
showLocalPath("fileUrl"); showLocalPath("fileUrl");
createCopyButton("copyButton", "fileUrl"); createCopyButton("copyButton", "fileUrl");
addUploadButtonListener(); addUploadButtonListener();
addOkListener(); addOkListener();
}; };
function addUploadButtonListener() { function addUploadButtonListener() {
g('saveFile').addEventListener('change', function () { g('saveFile').addEventListener('change', function () {
if (this.files.length !== 1) { $('.image-tip').html('正在转存,请稍后...');
alert('请选择1个文件') uploader.addFile(this.files);
return; uploader.upload();
} });
$('.image-tip').html('正在转存,请稍后...');
var file = this.files[0];
uploader.addFile(file);
uploader.upload();
});
} }
function addOkListener() { function addOkListener() {
dialog.onok = function () { dialog.onok = function () {
//console.log('imageUrls',imageUrls); //console.log('imageUrls',imageUrls);
if (!imageUrls.length) return; if (!imageUrls.length) return;
var urlPrefix = editor.getOpt('imageUrlPrefix'), var urlPrefix = editor.getOpt('imageUrlPrefix'),
images = domUtils.getElementsByTagName(editor.document, "img"); images = domUtils.getElementsByTagName(editor.document, "img");
editor.fireEvent('saveScene'); editor.fireEvent('saveScene');
// console.log('images',images,imageUrls); // console.log('images',images,imageUrls);
for (var i = 0, img; img = images[i++];) { for (var i = 0, img; img = images[i++];) {
var src = img.getAttribute("data-word-image"); var src = img.getAttribute("data-word-image");
if (!src) continue; if (!src) continue;
for (var j = 0, url; url = imageUrls[j++];) { for (var j = 0, url; url = imageUrls[j++];) {
// console.log('url',src, url); // console.log('url',src, url);
if (src.indexOf(url.name.replace(" ", "")) != -1) { if (src.indexOf(url.name.replace(" ", "")) != -1) {
img.src = urlPrefix + url.url; img.src = urlPrefix + url.url;
img.setAttribute("_src", urlPrefix + url.url); //同时修改"_src"属性 img.setAttribute("_src", urlPrefix + url.url); //同时修改"_src"属性
img.setAttribute("title", url.title); img.setAttribute("title", url.title);
domUtils.removeAttributes(img, ["data-word-image", "style", "width", "height"]); domUtils.removeAttributes(img, ["data-word-image", "style", "width", "height"]);
editor.fireEvent("selectionchange"); editor.fireEvent("selectionchange");
break; break;
}
}
} }
} editor.fireEvent('saveScene');
} // hideFlash();
editor.fireEvent('saveScene'); };
// hideFlash(); dialog.oncancel = function () {
}; //hideFlash();
dialog.oncancel = function () { };
//hideFlash();
};
} }
function showLocalPath(id) { function showLocalPath(id) {
//单张编辑 //单张编辑
var img = editor.selection.getRange().getClosedNode(); var img = editor.selection.getRange().getClosedNode();
var images = editor.execCommand('wordimage'); var images = editor.execCommand('wordimage');
if (images.length == 1 || img && img.tagName == 'IMG') { if (images.length == 1 || img && img.tagName == 'IMG') {
g(id).value = images[0]; g(id).value = images[0];
return; return;
} }
var path = images[0]; var path = images[0];
var leftSlashIndex = path.lastIndexOf("/") || 0, //不同版本的doc和浏览器都可能影响到这个符号故直接判断两种 var leftSlashIndex = path.lastIndexOf("/") || 0, //不同版本的doc和浏览器都可能影响到这个符号故直接判断两种
rightSlashIndex = path.lastIndexOf("\\") || 0, rightSlashIndex = path.lastIndexOf("\\") || 0,
separater = leftSlashIndex > rightSlashIndex ? "/" : "\\"; separater = leftSlashIndex > rightSlashIndex ? "/" : "\\";
path = path.substring(0, path.lastIndexOf(separater) + 1); path = path.substring(0, path.lastIndexOf(separater) + 1);
g(id).value = path; g(id).value = path;
//增提醒用户选择哪些文件
var names = [];
for (var i = 0, len = images.length; i < len; i++) {
var img = images[i];
names.push(img.substring(img.lastIndexOf(separater) + 1, img.length));
}
$('.image-tip').html('<span style="color:#ff0000;">请选择:' + names.join("、") + "共" + images.length + '个文件</span>');
} }
function createCopyButton(id, dataFrom) { function createCopyButton(id, dataFrom) {
var url = g(dataFrom).value; var url = g(dataFrom).value;
if (url.startsWith("file:////")) { if (url.startsWith("file:////")) {
url = url.substring(8); url = url.substring(8);
} }
g(id).setAttribute("data-clipboard-text", url); url = decodeURI(url);
var clipboard = new Clipboard('[data-clipboard-text]') g(id).setAttribute("data-clipboard-text", url);
clipboard.on('success', function (e) { var clipboard = new Clipboard('[data-clipboard-text]')
g('copyButton').innerHTML = '复制成功'; clipboard.on('success', function (e) {
}); g('copyButton').innerHTML = '复制成功';
});
} }

View File

@ -1,31 +1,36 @@
<!doctype html> <!doctype html>
<html> <html>
<head> <head>
<title>UEditorPlus 完整演示</title> <title>UEditorPlus 完整演示</title>
<meta name="viewport" content="width=device-width, minimum-scale=0.5, maximum-scale=5, user-scalable=no"> <meta name="viewport" content="width=device-width, minimum-scale=0.5, maximum-scale=5, user-scalable=no">
<meta http-equiv="X-UA-Compatible" content="ie=edge"> <meta http-equiv="X-UA-Compatible" content="ie=edge">
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/> <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
<script type="text/javascript" charset="utf-8" src="ueditor.config.js"></script> <script type="text/javascript" charset="utf-8" src="ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="ueditor.all.js"></script> <script type="text/javascript" charset="utf-8" src="ueditor.all.js"></script>
<script type="text/javascript" charset="utf-8" src="lang/zh-cn/zh-cn.js"></script> <script type="text/javascript" charset="utf-8" src="lang/zh-cn/zh-cn.js?7a537435"></script>
<script src="./plugins/demo/demo.js"></script> <script src="./plugins/demo/demo.js"></script>
<script> <script>
// window.UEDITOR_CONFIG.toolbars[0].push('undo'); // window.UEDITOR_CONFIG.toolbars[0].push('undo');
</script> </script>
<script>var _hmt = _hmt || []; <script>var _hmt = _hmt || [];
(function () { (function () {
var hm = document.createElement("script"); var hm = document.createElement("script");
hm.src = "https://hm.baidu.com/hm.js?5f8b495b287894a451c761c963e6e34a"; hm.src = "https://hm.baidu.com/hm.js?f84f35a44b5cc5c0b10c3fabdf0f322b";
var s = document.getElementsByTagName("script")[0]; var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s); s.parentNode.insertBefore(hm, s);
})();</script> })();</script>
<link rel="stylesheet" href="./style.css"/> <style>
:root {
/*--ueditor-top-offset: 20px;*/
}
</style>
<link rel="stylesheet" href="./style.css"/>
</head> </head>
<body class="demo-editor-page"> <body class="demo-editor-page">
<div> <div>
<h1>完整示例</h1> <h1>完整示例</h1>
<div> <div>
<script id="editor" type="text/plain" style="height:300px;"> <script id="editor" type="text/plain" style="height:300px;">
<h1> <h1>
你好 UEditorPlus 你好 UEditorPlus
</h1> </h1>
@ -71,60 +76,71 @@
公式支持 公式支持
</h2> </h2>
<p> <p>
<img src="https://latex.codecogs.com/svg.image?f(a)%20%3D%20%5Cfrac%7B1%7D%7B2%5Cpi%20i%7D%20%5Coint%5Cfrac%7Bf(z)%7D%7Bz-a%7Ddz" data-formula-image="f(a)%20%3D%20%5Cfrac%7B1%7D%7B2%5Cpi%20i%7D%20%5Coint%5Cfrac%7Bf(z)%7D%7Bz-a%7Ddz"/> <img src="https://r.latexeasy.com/image.svg?%5Cint%20%5Cfrac%7B1%7D%7Bx%7D%20dx%20%3D%20%5Cln%20%5Cleft%7C%20x%20%5Cright%7C%20%2B%20C"
data-formula-image="%5Cint%20%5Cfrac%7B1%7D%7Bx%7D%20dx%20%3D%20%5Cln%20%5Cleft%7C%20x%20%5Cright%7C%20%2B%20C"/>
</p> </p>
<p> <p>
<br/> <br/>
</p> </p>
</script>
</div>
<div id="btns" style="margin-top:20px;">
<div>
<button onclick="alert(UE.getEditor('editor').getAllHtml())">获得整个html的内容</button> </script>
<button onclick="alert(UE.getEditor('editor').getContent())">获得内容</button>
<button onclick="UE.getEditor('editor').setContent('<p>欢迎使用 UEditorPlus</p>', false)">写入内容</button>
<button onclick="UE.getEditor('editor').setContent('<p>欢迎使用 UEditorPlus</p>', true)">追加内容</button>
<button onclick="alert(UE.getEditor('editor').getContentTxt())">获得纯文本</button>
<button onclick="alert(UE.getEditor('editor').getPlainTxt())">获得带格式的纯文本</button>
<button onclick="alert(UE.getEditor('editor').hasContents())">判断是否有内容</button>
<button onclick="UE.getEditor('editor').focus()">使编辑器获得焦点</button>
<button onmousedown="isFocus()">编辑器是否获得焦点</button>
<button onmousedown="setBlur()">编辑器失去焦点</button>
<button onclick="getSelectText()">获得当前选中的文本</button>
<button onclick="UE.getEditor('editor').execCommand('insertHtml', '插入的内容')">插入内容</button>
<button onclick="UE.getEditor('editor').setEnabled()">设定可编辑</button>
<button onclick="UE.getEditor('editor').setDisabled('fullscreen')">设定不可编辑</button>
<button onclick="UE.getEditor('editor').setHide()">隐藏编辑器</button>
<button onclick="UE.getEditor('editor').setShow()">显示编辑器</button>
<button onclick="UE.getEditor('editor').setHeight(300)">设置固定高度</button>
<button onclick="UE.getEditor('editor')">创建编辑器</button>
<button onclick="UE.getEditor('editor').destroy()">销毁编辑器</button>
<button onclick="alert( UE.getEditor('editor').execCommand('get_auto_save_content') )">草稿箱-获取</button>
<button onclick="UE.getEditor('editor').execCommand('clear_auto_save_content'); alert('已清空草稿箱')">草稿箱-清空</button>
<button onclick="UE.getEditor('editor').execCommand('set_auto_save_content'); alert('已保存')">草稿箱-立即保存</button>
<button onclick="UE.getEditor('editor').execCommand('auto_save_restore')">草稿箱-恢复到编辑器</button>
</div> </div>
</div> <div id="btns" style="margin-top:20px;">
<div>
<script type="text/javascript"> <button onclick="alert(UE.getEditor('editor').getAllHtml())">获得整个html的内容</button>
var ue = UE.getEditor('editor'); <button onclick="alert(UE.getEditor('editor').getContent())">获得内容</button>
function isFocus(e) { <button onclick="UE.getEditor('editor').setContent('<p>欢迎使用 UEditorPlus</p>', false)">写入内容</button>
alert(UE.getEditor('editor').isFocus()); <button onclick="UE.getEditor('editor').setContent('<p>欢迎使用 UEditorPlus</p>', true)">追加内容</button>
UE.dom.domUtils.preventDefault(e) <button onclick="alert(UE.getEditor('editor').getContentTxt())">获得纯文本</button>
} <button onclick="alert(UE.getEditor('editor').getPlainTxt())">获得带格式的纯文本</button>
function setBlur(e) { <button onclick="alert(UE.getEditor('editor').hasContents())">判断是否有内容</button>
UE.getEditor('editor').blur(); <button onclick="UE.getEditor('editor').focus()">使编辑器获得焦点</button>
UE.dom.domUtils.preventDefault(e) <button onmousedown="isFocus()">编辑器是否获得焦点</button>
} <button onmousedown="setBlur()">编辑器失去焦点</button>
<button onclick="getSelectText()">获得当前选中的文本</button>
<button onclick="UE.getEditor('editor').execCommand('insertHtml', '插入的内容')">插入内容</button>
<button onclick="UE.getEditor('editor').setEnabled()">设定可编辑</button>
<button onclick="UE.getEditor('editor').setDisabled('fullscreen')">设定不可编辑</button>
<button onclick="UE.getEditor('editor').setHide()">隐藏编辑器</button>
<button onclick="UE.getEditor('editor').setShow()">显示编辑器</button>
<button onclick="UE.getEditor('editor').setHeight(300)">设置固定高度</button>
<button onclick="UE.getEditor('editor')">创建编辑器</button>
<button onclick="UE.getEditor('editor').destroy()">销毁编辑器</button>
<button onclick="alert( UE.getEditor('editor').execCommand('get_auto_save_content') )">草稿箱-获取</button>
<button onclick="UE.getEditor('editor').execCommand('clear_auto_save_content'); alert('已清空草稿箱')">草稿箱-清空
</button>
<button onclick="UE.getEditor('editor').execCommand('set_auto_save_content'); alert('已保存')">草稿箱-立即保存
</button>
<button onclick="UE.getEditor('editor').execCommand('auto_save_restore')">草稿箱-恢复到编辑器</button>
</div>
</div>
function getSelectText() { <script type="text/javascript">
var range = UE.getEditor('editor').selection.getRange(); var ue = UE.getEditor('editor',{
range.select(); // autoHeightEnabled: false,
var txt = UE.getEditor('editor').selection.getText(); });
alert(txt) ue.on('contentchange', function () {
} // console.log('contentchange', ue.getContent());
</script> });
function isFocus(e) {
alert(UE.getEditor('editor').isFocus());
UE.dom.domUtils.preventDefault(e)
}
function setBlur(e) {
UE.getEditor('editor').blur();
UE.dom.domUtils.preventDefault(e)
}
function getSelectText() {
var range = UE.getEditor('editor').selection.getRange();
range.select();
var txt = UE.getEditor('editor').selection.getText();
alert(txt)
}
</script>
</div> </div>
</body> </body>
</html> </html>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@ -0,0 +1,17 @@
input[type="text"] {
height: 30px;
border: 1px solid #EEE;
border-radius: 3px;
padding: 0 5px;
line-height: 2px;
outline: none;
}
select {
height: 30px;
border: 1px solid #EEE;
border-radius: 3px;
padding: 0 5px;
line-height: 2px;
outline: none;
}

View File

@ -0,0 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg" width="84" height="100">
<defs>
<linearGradient id="a" x1="0%" x2="0%" y1="100%" y2="0%">
<stop offset="0%" stop-color="#FF9B13"/>
<stop offset="100%" stop-color="#FF7807"/>
</linearGradient>
</defs>
<path fill-rule="evenodd" fill="url(#a)" d="M84 22v74a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4h58l22 22z"/>
<path fill-rule="evenodd" fill="#FDDBB1" d="M84 22H66a4 4 0 0 1-4-4V0l22 22z"/>
<path fill-rule="evenodd" opacity=".6" fill="#FFF" d="M56.253 59.538l-11.282-10.91 7.527-4.642 8.493 8.122-4.738 7.43zm-6.295 5.292c-2.57 3.863-4.618 9.912-4.618 9.912l-21.827 7.253 13.152-13.752c.384.238.834.382 1.319.382a2.515 2.515 0 1 0-2.515-2.516c0 .281.056.545.141.797L22.987 81.312c1.547-6.646 5.86-22.411 5.86-22.411s6.403-1.881 10.077-3.88c3.451-1.877 4.904-3.678 4.904-3.678l9.809 9.808s-2.14 1.366-3.679 3.679z"/>
<path fill-rule="evenodd" fill="#FFF" d="M25.481 12.259a1.184 1.184 0 0 1-1.187-1.174c0-.645.534-1.173 1.187-1.173.652 0 1.186.528 1.186 1.173 0 .646-.534 1.174-1.186 1.174zm-5.645 11.125h-.158c-.692 1.124-1.859 1.74-3.283 1.74-2.067 0-3.599-1.212-3.599-3.138 0-1.887 1.404-2.972 3.886-3.119l3.075-.185v-.958c0-1.301-.82-2.014-2.413-2.014-1.275 0-2.165.479-2.402 1.31h-1.721c.227-1.692 1.908-2.806 4.183-2.806 2.601 0 4.054 1.32 4.054 3.51v7.214h-1.622v-1.554zm-.079-3.344l-2.867.186c-1.622.108-2.334.665-2.334 1.721 0 1.075.92 1.701 2.156 1.701 1.75 0 3.045-1.134 3.045-2.64v-.968zm6.574 4.898H24.63V14.4h1.701v10.538z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.5 KiB

View File

@ -0,0 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg" width="84" height="100">
<defs>
<linearGradient id="a" x1="0%" x2="0%" y1="100%" y2="0%">
<stop offset="0%" stop-color="#7CBD38"/>
<stop offset="100%" stop-color="#58A31B"/>
</linearGradient>
</defs>
<path fill-rule="evenodd" fill="url(#a)" d="M84 22v74a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4h58l22 22z"/>
<path fill-rule="evenodd" fill="#C3DFA4" d="M84 22H66a4 4 0 0 1-4-4V0l22 22z"/>
<path fill-rule="evenodd" opacity=".6" fill="#FFF" d="M60.994 80.99c-1.661 0-3.008-1.491-3.008-3.329V64.345c0-1.838 1.347-3.329 3.008-3.329s3.008 1.49 3.008 3.329v13.316c0 1.838-1.347 3.329-3.008 3.329zm-8.359.025H29.013V63.006H56.01v18.009h-3.375zm3.375-21H29.013c0-4.436 2.183-8.357 5.529-10.794l-1.735-2.98a.837.837 0 0 1 .309-1.143.849.849 0 0 1 1.154.306l1.691 2.906a13.5 13.5 0 0 1 6.55-1.687c2.379 0 4.61.614 6.551 1.685l1.689-2.902a.843.843 0 0 1 1.152-.308.832.832 0 0 1 .311 1.145l-1.733 2.978c3.346 2.437 5.529 6.358 5.529 10.794zm-18.561-8.37c-.933 0-1.687.748-1.687 1.674a1.68 1.68 0 0 0 1.687 1.674 1.68 1.68 0 0 0 1.688-1.674 1.68 1.68 0 0 0-1.688-1.674zm10.124 0c-.933 0-1.687.748-1.687 1.674a1.68 1.68 0 0 0 1.687 1.674 1.68 1.68 0 0 0 1.688-1.674c0-.926-.754-1.674-1.688-1.674zM23.997 80.99c-1.66 0-3.008-1.491-3.008-3.329V64.345c0-1.838 1.348-3.329 3.008-3.329 1.661 0 3.009 1.49 3.009 3.329v13.316c0 1.838-1.348 3.329-3.009 3.329z"/>
<path fill-rule="evenodd" fill="#FFF" d="M46.368 25.167h-2.166l-3.995-4.938-1.018.939v3.999h-1.701V10.443h1.701v8.789h.158l4.628-4.604h2.086l-4.588 4.516 4.895 6.023zm-16.115.185c-1.523 0-2.749-.655-3.332-1.769h-.159v5.103h-1.7V14.628h1.621v1.759h.158c.683-1.212 1.958-1.945 3.412-1.945 2.719 0 4.48 2.141 4.48 5.455 0 3.295-1.77 5.455-4.48 5.455zm-.395-9.395c-1.929 0-3.145 1.516-3.145 3.94 0 2.415 1.216 3.94 3.135 3.94 1.958 0 3.124-1.476 3.124-3.94s-1.166-3.94-3.114-3.94zm-9.551 7.655h-.158c-.692 1.124-1.859 1.74-3.283 1.74-2.067 0-3.599-1.212-3.599-3.138 0-1.887 1.404-2.972 3.886-3.119l3.075-.185v-.958c0-1.301-.82-2.014-2.413-2.014-1.275 0-2.165.479-2.403 1.31h-1.72c.227-1.692 1.908-2.806 4.183-2.806 2.6 0 4.054 1.32 4.054 3.51v7.215h-1.622v-1.555zm-.079-3.343l-2.867.185c-1.622.108-2.334.665-2.334 1.721 0 1.075.919 1.701 2.156 1.701 1.75 0 3.045-1.134 3.045-2.64v-.967z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg" width="84" height="100">
<defs>
<linearGradient id="a" x1="0%" x2="0%" y1="100%" y2="0%">
<stop offset="0%" stop-color="#98BCCD"/>
<stop offset="100%" stop-color="#76A1B7"/>
</linearGradient>
</defs>
<path fill-rule="evenodd" fill="url(#a)" d="M84 22v74a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4h58l22 22z"/>
<path fill-rule="evenodd" fill="#BEEAFF" d="M84 22H66a4 4 0 0 1-4-4V0l22 22z"/>
<path fill-rule="evenodd" opacity=".6" fill="#FFF" d="M63.794 62.015H20.225c-.668 0-1.21-.56-1.21-1.251v-2.502c0-.691.542-1.252 1.21-1.252h43.569c.668 0 1.21.561 1.21 1.252v2.502c0 .691-.542 1.251-1.21 1.251zm0-15.015H20.225c-.668 0-1.21-.56-1.21-1.251v-2.503c0-.691.542-1.251 1.21-1.251h43.569c.668 0 1.21.56 1.21 1.251v2.503c0 .691-.542 1.251-1.21 1.251zM20.187 70.994h43.62c.661 0 1.197.56 1.197 1.251v2.502c0 .691-.536 1.252-1.197 1.252h-43.62c-.661 0-1.197-.561-1.197-1.252v-2.502c0-.691.536-1.251 1.197-1.251z"/>
<path fill-rule="evenodd" fill="#FFF" d="M50.047 25.167v-6.893c0-1.554-.742-2.317-2.245-2.317-1.483 0-2.472 1.095-2.472 2.435v6.775h-1.701V18.01c0-1.251-.88-2.053-2.225-2.053-1.394 0-2.472 1.193-2.472 2.679v6.531h-1.701V14.628h1.622v1.662h.158c.485-1.174 1.553-1.848 2.976-1.848 1.444 0 2.453.753 2.947 1.848h.159c.573-1.115 1.789-1.848 3.263-1.848 2.175 0 3.392 1.232 3.392 3.441v7.284h-1.701zm-17.609-6.414c0-1.867-.85-2.796-2.462-2.796-1.909 0-2.957 1.193-2.957 2.972v6.238h-1.701V10.443h1.701v5.847h.159c.534-1.164 1.651-1.848 3.283-1.848 2.254 0 3.678 1.427 3.678 3.901v6.824h-1.701v-6.414zm-14.187 5.084c1.433 0 2.432-.655 2.749-1.848h1.72c-.306 1.936-1.898 3.363-4.46 3.363-2.986 0-4.894-2.141-4.894-5.494 0-3.285 1.898-5.416 4.885-5.416 2.59 0 4.173 1.535 4.469 3.412H21c-.277-1.046-1.217-1.897-2.749-1.897-1.919 0-3.125 1.516-3.125 3.901 0 2.434 1.226 3.979 3.125 3.979z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg" width="84" height="100">
<defs>
<linearGradient id="a" x1="0%" x2="0%" y1="100%" y2="0%">
<stop offset="0%" stop-color="#C1917F"/>
<stop offset="100%" stop-color="#A76D5A"/>
</linearGradient>
</defs>
<path fill-rule="evenodd" fill="url(#a)" d="M84 22v74a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4h58l22 22z"/>
<path fill-rule="evenodd" fill="#D4957F" d="M84 22H66a4 4 0 0 1-4-4V0l22 22z"/>
<path fill-rule="evenodd" opacity=".6" fill="#FFF" d="M64.796 63.83l-.039.064a1.31 1.31 0 0 1-.362.388c-.118.179-.264.34-.46.45l-11.639 6.512a1.254 1.254 0 0 1-1.756-.552 1.426 1.426 0 0 1 .571-1.855l10.122-5.663-9.212-6.032a1.37 1.37 0 0 1-.402-1.851l.039-.064a1.27 1.27 0 0 1 1.787-.417l10.948 7.169c.605.396.785 1.225.403 1.851zM38.238 74.999l6.083-23.994h2.433l-6.083 23.994h-2.433zm-5.541-3.755l-11.64-6.512a1.357 1.357 0 0 1-.46-.45 1.32 1.32 0 0 1-.361-.388l-.039-.064a1.37 1.37 0 0 1 .402-1.851l10.949-7.169a1.27 1.27 0 0 1 1.787.417l.039.064c.382.626.202 1.455-.403 1.851l-9.211 6.032 10.121 5.663c.643.359.899 1.19.572 1.855a1.254 1.254 0 0 1-1.756.552z"/>
<path fill-rule="evenodd" fill="#FFF" d="M39.087 15.869c-1.266 0-2.255.636-2.255 1.574 0 .724.593 1.173 1.849 1.476l1.642.392c2.007.479 2.976 1.339 2.976 2.854 0 1.887-1.849 3.187-4.272 3.187-2.373 0-4.004-1.124-4.192-2.874h1.75c.287.89 1.137 1.457 2.502 1.457 1.434 0 2.462-.675 2.462-1.643 0-.723-.554-1.212-1.691-1.486l-1.829-.44c-1.998-.479-2.908-1.329-2.908-2.854 0-1.75 1.711-3.07 3.976-3.07 2.234 0 3.787 1.095 4.014 2.825H41.43c-.227-.84-1.058-1.398-2.343-1.398zm-10.995 3.05l1.642.392c2.007.479 2.976 1.339 2.976 2.854 0 1.887-1.849 3.187-4.272 3.187-2.373 0-4.005-1.124-4.192-2.874h1.75c.287.89 1.137 1.457 2.502 1.457 1.434 0 2.462-.675 2.462-1.643 0-.723-.554-1.212-1.691-1.486l-1.829-.44c-1.998-.479-2.908-1.329-2.908-2.854 0-1.75 1.711-3.07 3.976-3.07 2.234 0 3.787 1.095 4.014 2.825h-1.681c-.227-.84-1.058-1.398-2.343-1.398-1.266 0-2.255.636-2.255 1.574 0 .724.593 1.173 1.849 1.476zm-10.281 4.918c1.433 0 2.432-.655 2.749-1.848h1.72c-.306 1.936-1.898 3.363-4.46 3.363-2.986 0-4.894-2.141-4.894-5.494 0-3.285 1.898-5.416 4.885-5.416 2.59 0 4.173 1.535 4.469 3.412h-1.72c-.277-1.046-1.217-1.897-2.749-1.897-1.919 0-3.125 1.516-3.125 3.901 0 2.434 1.226 3.979 3.125 3.979z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,22 @@
<svg xmlns="http://www.w3.org/2000/svg" width="85" height="100" viewBox="0 0 85 100">
<defs>
<linearGradient id="doc-a" x1="50%" x2="50%" y1="0%" y2="100%">
<stop offset="0%" stop-color="#1D70CA"/>
<stop offset="100%" stop-color="#41A5EE"/>
</linearGradient>
</defs>
<g fill="none" fill-rule="evenodd">
<path fill="url(#doc-a)"
d="M6,0 L62.3333333,0 L62.3333333,0 L85,22.8571429 L85,94 C85,97.3137085 82.3137085,100 79,100 L6,100 C2.6862915,100 4.05812251e-16,97.3137085 0,94 L0,6 C-4.05812251e-16,2.6862915 2.6862915,6.08718376e-16 6,0 Z"/>
<path fill="#FFF"
d="M62.3333333,0 L85,22.5352113 L68.3333333,22.5352113 C65.0196248,22.5352113 62.3333333,19.8489198 62.3333333,16.5352113 L62.3333333,0 L62.3333333,0 Z"
opacity=".5"/>
<rect width="42.5" height="42.254" y="30.986" fill="#1B61CA" rx="2"/>
<rect width="22.667" height="2.817" x="51" y="33.803" fill="#FFF" opacity=".5"/>
<rect width="22.667" height="2.817" x="51" y="45.07" fill="#FFF" opacity=".5"/>
<rect width="22.667" height="2.817" x="51" y="56.338" fill="#FFF" opacity=".5"/>
<rect width="22.667" height="2.817" x="51" y="67.606" fill="#FFF" opacity=".5"/>
<path fill="#FFF" fill-rule="nonzero"
d="M25.7935088,62.8642557 C27.1407465,65.0073347 30.3730311,64.6213304 31.1777196,62.2212652 L36.8443863,45.3198567 C37.3710779,43.7489455 36.5245707,42.0485025 34.9536595,41.5218109 C33.3827483,40.9951193 31.6823053,41.8416265 31.1556137,43.4125377 L27.5023119,54.3088809 L23.7898245,48.4033499 C22.6135444,46.5322167 19.8864556,46.5322167 18.7101755,48.4033499 L14.9976881,54.3088809 L11.3443863,43.4125377 C10.8176947,41.8416265 9.11725166,40.9951193 7.54634048,41.5218109 C5.97542929,42.0485025 5.12892207,43.7489455 5.65561368,45.3198567 L11.3222804,62.2212652 C12.1269689,64.6213304 15.3592535,65.0073347 16.7064912,62.8642557 L21.25,55.6368017 L25.7935088,62.8642557 Z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,22 @@
<svg xmlns="http://www.w3.org/2000/svg" width="85" height="100" viewBox="0 0 85 100">
<defs>
<linearGradient id="doc-a" x1="50%" x2="50%" y1="0%" y2="100%">
<stop offset="0%" stop-color="#1D70CA"/>
<stop offset="100%" stop-color="#41A5EE"/>
</linearGradient>
</defs>
<g fill="none" fill-rule="evenodd">
<path fill="url(#doc-a)"
d="M6,0 L62.3333333,0 L62.3333333,0 L85,22.8571429 L85,94 C85,97.3137085 82.3137085,100 79,100 L6,100 C2.6862915,100 4.05812251e-16,97.3137085 0,94 L0,6 C-4.05812251e-16,2.6862915 2.6862915,6.08718376e-16 6,0 Z"/>
<path fill="#FFF"
d="M62.3333333,0 L85,22.5352113 L68.3333333,22.5352113 C65.0196248,22.5352113 62.3333333,19.8489198 62.3333333,16.5352113 L62.3333333,0 L62.3333333,0 Z"
opacity=".5"/>
<rect width="42.5" height="42.254" y="30.986" fill="#1B61CA" rx="2"/>
<rect width="22.667" height="2.817" x="51" y="33.803" fill="#FFF" opacity=".5"/>
<rect width="22.667" height="2.817" x="51" y="45.07" fill="#FFF" opacity=".5"/>
<rect width="22.667" height="2.817" x="51" y="56.338" fill="#FFF" opacity=".5"/>
<rect width="22.667" height="2.817" x="51" y="67.606" fill="#FFF" opacity=".5"/>
<path fill="#FFF" fill-rule="nonzero"
d="M25.7935088,62.8642557 C27.1407465,65.0073347 30.3730311,64.6213304 31.1777196,62.2212652 L36.8443863,45.3198567 C37.3710779,43.7489455 36.5245707,42.0485025 34.9536595,41.5218109 C33.3827483,40.9951193 31.6823053,41.8416265 31.1556137,43.4125377 L27.5023119,54.3088809 L23.7898245,48.4033499 C22.6135444,46.5322167 19.8864556,46.5322167 18.7101755,48.4033499 L14.9976881,54.3088809 L11.3443863,43.4125377 C10.8176947,41.8416265 9.11725166,40.9951193 7.54634048,41.5218109 C5.97542929,42.0485025 5.12892207,43.7489455 5.65561368,45.3198567 L11.3222804,62.2212652 C12.1269689,64.6213304 15.3592535,65.0073347 16.7064912,62.8642557 L21.25,55.6368017 L25.7935088,62.8642557 Z"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,16 @@
<svg xmlns="http://www.w3.org/2000/svg" width="84" height="100" viewBox="0 0 84 100">
<defs>
<linearGradient id="dwg-a" x1="50%" x2="50%" y1="100%" y2="0%">
<stop offset="0%" stop-color="#98BCCD"/>
<stop offset="100%" stop-color="#76A1B7"/>
</linearGradient>
</defs>
<g fill="none" fill-rule="evenodd">
<path fill="url(#dwg-a)" d="M83.3333333,20.8333333 L83.3333333,93.75 C83.3333333,97.2017797 80.535113,100 77.0833333,100 L6.25,100 C2.79822031,100 0,97.2017797 0,93.75 L0,6.25 C0,2.79822031 2.79822031,0 6.25,0 L62.5,0 L83.3333333,20.8333333 Z"/>
<path fill="#FFF" d="M50,45.8333333 C51.1505932,45.8333333 52.0833333,46.7660734 52.0833333,47.9166667 L52.0833333,66.6663333 L54.1666667,66.6666667 C55.3172599,66.6666667 56.25,67.5994068 56.25,68.75 L56.2493333,70.8326667 L60.4166667,70.8333333 C61.5672599,70.8333333 62.5,71.7660734 62.5,72.9166667 C62.5,74.0672599 61.5672599,75 60.4166667,75 L56.2493333,74.9996667 L56.25,77.0833333 C56.25,78.2339266 55.3172599,79.1666667 54.1666667,79.1666667 L52.0833333,79.1663333 L52.0833333,85.4166667 C52.0833333,86.5672599 51.1505932,87.5 50,87.5 C48.8494068,87.5 47.9166667,86.5672599 47.9166667,85.4166667 L47.9163333,79.1663333 L45.8333333,79.1666667 C44.6827401,79.1666667 43.75,78.2339266 43.75,77.0833333 L43.7493333,74.9996667 L22.9166667,75 C21.7660734,75 20.8333333,74.0672599 20.8333333,72.9166667 C20.8333333,71.7660734 21.7660734,70.8333333 22.9166667,70.8333333 L43.7493333,70.8326667 L43.75,68.75 C43.75,67.5994068 44.6827401,66.6666667 45.8333333,66.6666667 L47.9163333,66.6663333 L47.9166667,47.9166667 C47.9166667,46.7660734 48.8494068,45.8333333 50,45.8333333 Z" opacity=".6"/>
<path fill="#BEEAFF" d="M83.3333333,20.8333333 L66.6666667,20.8333333 C64.3654802,20.8333333 62.5,18.9678531 62.5,16.6666667 L62.5,0 L83.3333333,20.8333333 Z"/>
<text fill="#FFF" font-family="Helvetica" font-size="22.917">
<tspan x="10.417" y="27.167">dwg</tspan>
</text>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="100" height="94">
<path fill-rule="evenodd" fill="#FDC94A" d="M90 94H10C4.477 94 0 89.523 0 84V26.571c-.001-.061-.01-.12-.01-.181V6.62c0-3.765 3.732-6.633 8.334-6.633h30.213c2.302 0 4.752 1.415 5.494 3.213L45.599 7H90c5.523 0 10 4.477 10 10v67c0 5.523-4.477 10-10 10z"/>
</svg>

After

Width:  |  Height:  |  Size: 327 B

View File

@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" width="84" height="100">
<defs>
<linearGradient id="a" x1="0%" x2="0%" y1="100%" y2="0%">
<stop offset="0%" stop-color="#4D9CFC"/>
<stop offset="100%" stop-color="#2B79FA"/>
</linearGradient>
</defs>
<path fill-rule="evenodd" fill="url(#a)" d="M84 22v74a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4h58l22 22z"/>
<path fill-rule="evenodd" fill="#A6CAFD" d="M84 22H66a4 4 0 0 1-4-4V0l22 22z"/>
<path fill-rule="evenodd" opacity=".6" fill="#FFF"
d="M43.583 59.101s.974-5.495 5.008-9.477c4.033-3.982 9.598-4.944 9.598-4.944s-.974 5.494-5.008 9.477c-4.033 3.982-9.598 4.944-9.598 4.944zm-4.676-10.909c0-5.632 3.246-10.197 3.246-10.197s3.246 4.565 3.246 10.197c0 5.632-3.246 10.198-3.246 10.198s-3.246-4.566-3.246-10.198zm-8.041 5.64c-4.074-3.999-5.058-9.517-5.058-9.517s5.621.967 9.695 4.966 5.059 9.516 5.059 9.516-5.621-.966-9.696-4.965zm8.934 6.452s-4.667 3.242-10.412 3.258c-5.745.017-10.392-3.198-10.392-3.198s4.666-3.241 10.411-3.258c5.745-.016 10.393 3.198 10.393 3.198zm.762 1.598s-.985 5.518-5.059 9.517c-4.074 3.999-9.695 4.965-9.695 4.965s.984-5.517 5.058-9.517c4.075-3.999 9.696-4.965 9.696-4.965zm4.686 10.844c-.017 5.673-3.3 10.28-3.3 10.28s-3.256-4.588-3.239-10.261c.017-5.672 3.3-10.279 3.3-10.279s3.256 4.588 3.239 10.26zm-.903-12.172s4.624-3.205 10.328-3.205 10.328 3.205 10.328 3.205-4.624 3.205-10.328 3.205-10.328-3.205-10.328-3.205zm8.836 6.552c4.034 3.982 5.008 9.477 5.008 9.477s-5.565-.962-9.598-4.945c-4.034-3.982-5.008-9.477-5.008-9.477s5.565.962 9.598 4.945z"/>
<path fill-rule="evenodd" fill="#FFF"
d="M34.558 12.182c-1.018 0-1.592.509-1.592 1.692v.977h2.443v1.408h-2.443v9.131h-1.701v-9.131h-1.77v-1.408h1.77v-1.026c0-2.161 1.138-3.06 3.194-3.06.337 0 .633.029 1.049.098v1.407a5.22 5.22 0 0 0-.95-.088zm-8.093.528a1.184 1.184 0 0 1-1.187-1.173c0-.645.534-1.173 1.187-1.173s1.187.528 1.187 1.173-.534 1.173-1.187 1.173zm-8.827 16.728c-2.571 0-4.213-1.144-4.47-2.884h1.8c.188.86 1.137 1.417 2.67 1.417 1.908 0 3.046-.929 3.046-2.483v-2.073h-.159c-.672 1.164-1.878 1.819-3.342 1.819-2.759 0-4.47-2.112-4.47-5.27 0-3.157 1.731-5.298 4.47-5.298 1.493 0 2.808.723 3.422 1.857h.158v-1.672h1.622v10.725c0 2.356-1.84 3.862-4.747 3.862zm-.079-13.257c-1.978 0-3.085 1.486-3.085 3.783 0 2.298 1.107 3.784 3.085 3.784s3.164-1.486 3.164-3.784c0-2.297-1.196-3.783-3.164-3.783zm9.756 9.209h-1.7V14.851h1.7V25.39z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.4 KiB

View File

@ -0,0 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg" width="84" height="100">
<defs>
<linearGradient id="a" x1="0%" x2="0%" y1="100%" y2="0%">
<stop offset="0%" stop-color="#C1917F"/>
<stop offset="100%" stop-color="#A76D5A"/>
</linearGradient>
</defs>
<path fill-rule="evenodd" fill="url(#a)" d="M84 22v74a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4h58l22 22z"/>
<path fill-rule="evenodd" fill="#D4957F" d="M84 22H66a4 4 0 0 1-4-4V0l22 22z"/>
<path fill-rule="evenodd" opacity=".6" fill="#FFF" d="M64.796 63.83l-.04.064c-.096.159-.22.288-.361.388-.118.179-.264.34-.46.45l-11.639 6.512a1.254 1.254 0 0 1-1.756-.552 1.426 1.426 0 0 1 .571-1.855l10.122-5.663-9.212-6.032a1.37 1.37 0 0 1-.402-1.851l.039-.064a1.27 1.27 0 0 1 1.787-.417l10.948 7.169c.605.396.785 1.225.403 1.851zM38.238 74.999l6.083-23.994h2.433l-6.083 23.994h-2.433zm-5.541-3.755l-11.64-6.512a1.357 1.357 0 0 1-.46-.45 1.32 1.32 0 0 1-.361-.388l-.039-.064a1.37 1.37 0 0 1 .402-1.851l10.949-7.169a1.268 1.268 0 0 1 1.786.417l.04.064c.382.626.202 1.455-.403 1.851l-9.211 6.032 10.121 5.663c.643.359.899 1.19.572 1.855a1.254 1.254 0 0 1-1.756.552z"/>
<path fill-rule="evenodd" fill="#FFF" d="M50.521 25.167V10.443h1.701v14.724h-1.701zm-4.885-6.893c0-1.554-.742-2.317-2.245-2.317-1.483 0-2.472 1.095-2.472 2.435v6.775h-1.701V18.01c0-1.251-.88-2.053-2.225-2.053-1.394 0-2.472 1.193-2.472 2.679v6.531H32.82V14.628h1.622v1.662h.158c.485-1.174 1.553-1.848 2.977-1.848 1.443 0 2.452.753 2.946 1.848h.159c.573-1.115 1.789-1.848 3.263-1.848 2.175 0 3.392 1.232 3.392 3.441v7.284h-1.701v-6.893zm-19.453 4.155v-6.394h-1.721v-1.407h1.721V11.9h1.701v2.728h2.373v1.407h-2.373v5.964c0 1.242.475 1.77 1.582 1.77.307 0 .475-.01.791-.04v1.418a5.721 5.721 0 0 1-.999.098c-2.195 0-3.075-.802-3.075-2.816zm-5.505-3.676c0-1.867-.85-2.796-2.462-2.796-1.909 0-2.957 1.193-2.957 2.972v6.238h-1.701V10.443h1.701v5.847h.158c.534-1.164 1.652-1.848 3.284-1.848 2.254 0 3.678 1.427 3.678 3.901v6.824h-1.701v-6.414z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View File

@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" width="84" height="100">
<defs>
<linearGradient id="a" x1="0%" x2="0%" y1="100%" y2="0%">
<stop offset="0%" stop-color="#4D9CFC"/>
<stop offset="100%" stop-color="#2B79FA"/>
</linearGradient>
</defs>
<path fill-rule="evenodd" fill="url(#a)" d="M84 22v74a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4h58l22 22z"/>
<path fill-rule="evenodd" fill="#A6CAFD" d="M84 22H66a4 4 0 0 1-4-4V0l22 22z"/>
<path fill-rule="evenodd" opacity=".6" fill="#FFF"
d="M43.583 59.101s.974-5.495 5.008-9.477c4.033-3.982 9.598-4.944 9.598-4.944s-.974 5.494-5.008 9.477c-4.033 3.982-9.598 4.944-9.598 4.944zm-4.676-10.909c0-5.632 3.246-10.197 3.246-10.197s3.246 4.565 3.246 10.197c0 5.632-3.246 10.198-3.246 10.198s-3.246-4.566-3.246-10.198zm-8.041 5.64c-4.074-3.999-5.058-9.517-5.058-9.517s5.621.967 9.695 4.966 5.059 9.516 5.059 9.516-5.621-.966-9.696-4.965zm8.934 6.452s-4.667 3.242-10.412 3.258c-5.745.017-10.392-3.198-10.392-3.198s4.666-3.241 10.411-3.258c5.745-.016 10.393 3.198 10.393 3.198zm.762 1.598s-.985 5.518-5.059 9.517c-4.074 3.999-9.695 4.965-9.695 4.965s.984-5.517 5.058-9.517c4.075-3.999 9.696-4.965 9.696-4.965zm4.686 10.844c-.017 5.673-3.3 10.28-3.3 10.28s-3.256-4.588-3.239-10.261c.017-5.672 3.3-10.279 3.3-10.279s3.256 4.588 3.239 10.26zm-.903-12.172s4.624-3.205 10.328-3.205 10.329 3.205 10.329 3.205-4.625 3.205-10.329 3.205c-5.704 0-10.328-3.205-10.328-3.205zm8.836 6.552c4.034 3.982 5.008 9.477 5.008 9.477s-5.565-.962-9.598-4.945c-4.034-3.982-5.008-9.477-5.008-9.477s5.565.962 9.598 4.945z"/>
<path fill-rule="evenodd" fill="#FFF"
d="M48.501 29.438c-2.571 0-4.212-1.144-4.47-2.884h1.8c.188.86 1.137 1.417 2.67 1.417 1.909 0 3.046-.929 3.046-2.483v-2.073h-.158c-.673 1.164-1.879 1.819-3.343 1.819-2.759 0-4.47-2.112-4.47-5.27 0-3.157 1.731-5.298 4.47-5.298 1.493 0 2.809.723 3.422 1.857h.158v-1.672h1.622v10.725c0 2.356-1.84 3.862-4.747 3.862zm-.079-13.257c-1.978 0-3.085 1.486-3.085 3.783 0 2.298 1.107 3.784 3.085 3.784s3.164-1.486 3.164-3.784c0-2.297-1.196-3.783-3.164-3.783zm-14.633 4.507c.09 2.082 1.266 3.402 3.076 3.402 1.374 0 2.304-.499 2.749-1.427h1.701c-.514 1.808-2.156 2.913-4.49 2.913-2.956 0-4.806-2.112-4.806-5.445 0-3.315 1.879-5.465 4.806-5.465 2.878 0 4.628 2.023 4.628 5.298v.646h-7.664v.078zm5.874-1.437c-.039-1.868-1.167-3.099-2.857-3.099-1.701 0-2.888 1.231-3.017 3.099h5.874zm-14.246 6.325c-1.522 0-2.749-.655-3.332-1.77h-.158v5.104h-1.701V14.851h1.622v1.76h.158c.682-1.212 1.958-1.945 3.411-1.945 2.72 0 4.48 2.141 4.48 5.455 0 3.294-1.77 5.455-4.48 5.455zm-.395-9.395c-1.928 0-3.145 1.515-3.145 3.94 0 2.415 1.217 3.94 3.135 3.94 1.958 0 3.125-1.477 3.125-3.94 0-2.464-1.167-3.94-3.115-3.94zm-8.885-3.471a1.183 1.183 0 0 1-1.186-1.173c0-.645.534-1.173 1.186-1.173.653 0 1.187.528 1.187 1.173s-.534 1.173-1.187 1.173zm-.85 2.141h1.701v11.057c0 2.171-1.029 3.099-3.264 3.099h-.296V27.57h.257c1.206 0 1.602-.469 1.602-1.632V14.851z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" width="84" height="100">
<defs>
<linearGradient id="a" x1="0%" x2="0%" y1="100%" y2="0%">
<stop offset="0%" stop-color="#4D9CFC"/>
<stop offset="100%" stop-color="#2B79FA"/>
</linearGradient>
</defs>
<path fill-rule="evenodd" fill="url(#a)" d="M84 22v74a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4h58l22 22z"/>
<path fill-rule="evenodd" fill="#A6CAFD" d="M84 22H66a4 4 0 0 1-4-4V0l22 22z"/>
<path fill-rule="evenodd" opacity=".6" fill="#FFF"
d="M43.583 59.101s.974-5.495 5.008-9.477c4.033-3.982 9.598-4.944 9.598-4.944s-.974 5.494-5.008 9.477c-4.033 3.982-9.598 4.944-9.598 4.944zm-4.676-10.909c0-5.632 3.246-10.197 3.246-10.197s3.246 4.565 3.246 10.197c0 5.632-3.246 10.198-3.246 10.198s-3.246-4.566-3.246-10.198zm-8.041 5.64c-4.074-3.999-5.058-9.517-5.058-9.517s5.621.967 9.695 4.966 5.059 9.516 5.059 9.516-5.621-.966-9.696-4.965zm8.934 6.452s-4.667 3.242-10.412 3.258c-5.745.017-10.392-3.198-10.392-3.198s4.666-3.241 10.411-3.258c5.745-.016 10.393 3.198 10.393 3.198zm.762 1.598s-.985 5.518-5.059 9.517c-4.074 3.999-9.695 4.965-9.695 4.965s.984-5.517 5.058-9.517c4.075-3.999 9.696-4.965 9.696-4.965zm4.686 10.844c-.017 5.673-3.3 10.28-3.3 10.28s-3.256-4.588-3.239-10.261c.017-5.672 3.3-10.279 3.3-10.279s3.256 4.588 3.239 10.26zm-.903-12.172s4.624-3.205 10.328-3.205 10.329 3.205 10.329 3.205-4.625 3.205-10.329 3.205c-5.704 0-10.328-3.205-10.328-3.205zm8.836 6.552c4.034 3.982 5.008 9.477 5.008 9.477s-5.565-.962-9.598-4.945c-4.034-3.982-5.008-9.477-5.008-9.477s5.565.962 9.598 4.945z"/>
<path fill-rule="evenodd" fill="#FFF"
d="M36.944 29.438c-2.571 0-4.213-1.144-4.47-2.884h1.8c.188.86 1.137 1.417 2.67 1.417 1.908 0 3.046-.929 3.046-2.483v-2.073h-.159c-.672 1.164-1.878 1.819-3.342 1.819-2.759 0-4.47-2.112-4.47-5.27 0-3.157 1.731-5.298 4.47-5.298 1.493 0 2.808.723 3.422 1.857h.158v-1.672h1.622v10.725c0 2.356-1.84 3.862-4.747 3.862zm-.079-13.257c-1.978 0-3.085 1.486-3.085 3.783 0 2.298 1.107 3.784 3.085 3.784s3.164-1.486 3.164-3.784c0-2.297-1.196-3.783-3.164-3.783zm-11.448 9.395c-1.522 0-2.749-.655-3.332-1.77h-.158v5.104h-1.701V14.851h1.622v1.76h.158c.682-1.212 1.958-1.945 3.411-1.945 2.72 0 4.48 2.141 4.48 5.455 0 3.294-1.77 5.455-4.48 5.455zm-.395-9.395c-1.928 0-3.145 1.515-3.145 3.94 0 2.415 1.217 3.94 3.135 3.94 1.958 0 3.125-1.477 3.125-3.94 0-2.464-1.167-3.94-3.115-3.94zm-8.885-3.471a1.183 1.183 0 0 1-1.186-1.173c0-.645.534-1.173 1.186-1.173.653 0 1.187.528 1.187 1.173s-.534 1.173-1.187 1.173zm-.85 2.141h1.701v11.057c0 2.171-1.029 3.099-3.263 3.099h-.297V27.57h.257c1.206 0 1.602-.469 1.602-1.632V14.851z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -0,0 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg" width="84" height="100">
<defs>
<linearGradient id="a" x1="0%" x2="0%" y1="100%" y2="0%">
<stop offset="0%" stop-color="#98BCCD"/>
<stop offset="100%" stop-color="#76A1B7"/>
</linearGradient>
</defs>
<path fill-rule="evenodd" fill="url(#a)" d="M84 22v74a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4h58l22 22z"/>
<path fill-rule="evenodd" fill="#BEEAFF" d="M84 22H66a4 4 0 0 1-4-4V0l22 22z"/>
<path fill-rule="evenodd" opacity=".6" fill="#FFF" d="M63.794 62.015H20.225c-.668 0-1.21-.56-1.21-1.251v-2.502c0-.691.542-1.252 1.21-1.252h43.569c.668 0 1.21.561 1.21 1.252v2.502c0 .691-.542 1.251-1.21 1.251zm0-15.015H20.225c-.668 0-1.21-.56-1.21-1.251v-2.503c0-.691.542-1.251 1.21-1.251h43.569c.668 0 1.21.56 1.21 1.251v2.503c0 .691-.542 1.251-1.21 1.251zM20.187 70.994h43.62c.661 0 1.197.56 1.197 1.251v2.502c0 .691-.536 1.252-1.197 1.252h-43.62c-.661 0-1.198-.561-1.198-1.252v-2.502c0-.691.537-1.251 1.198-1.251z"/>
<path fill-rule="evenodd" fill="#FFF" d="M34.339 29.214c-2.571 0-4.212-1.144-4.469-2.884h1.799c.188.86 1.138 1.417 2.67 1.417 1.909 0 3.046-.928 3.046-2.483v-2.072h-.158c-.673 1.163-1.879 1.818-3.343 1.818-2.759 0-4.469-2.112-4.469-5.269 0-3.158 1.73-5.299 4.469-5.299 1.494 0 2.809.723 3.422 1.857h.158v-1.671h1.622v10.724c0 2.356-1.839 3.862-4.747 3.862zm-.079-13.257c-1.978 0-3.085 1.486-3.085 3.784 0 2.297 1.107 3.783 3.085 3.783s3.165-1.486 3.165-3.783c0-2.298-1.197-3.784-3.165-3.784zm-11.883 9.395c-3.036 0-4.914-2.072-4.914-5.455 0-3.392 1.878-5.455 4.914-5.455 3.036 0 4.915 2.063 4.915 5.455 0 3.383-1.879 5.455-4.915 5.455zm0-9.395c-2.017 0-3.154 1.437-3.154 3.94 0 2.493 1.137 3.94 3.154 3.94s3.155-1.447 3.155-3.94c0-2.503-1.138-3.94-3.155-3.94zm-9.379-5.514h1.701v14.724h-1.701V10.443z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" width="84" height="100">
<defs>
<linearGradient id="a" x1="0%" x2="0%" y1="100%" y2="0%">
<stop offset="0%" stop-color="#F45F5F"/>
<stop offset="100%" stop-color="#EE3C3C"/>
</linearGradient>
</defs>
<path fill-rule="evenodd" fill="url(#a)" d="M84 22v74a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4h58l22 22z"/>
<path fill-rule="evenodd" fill="#FF8578" d="M84 22H66a4 4 0 0 1-4-4V0l22 22z"/>
<path fill-rule="evenodd" opacity=".6" fill="#FFF"
d="M19.162 81.782c2.206 2.801 6.763 2.983 10.179.41 1.389-1.048 2.351-2.392 2.884-3.802.307-.595.508-1.921.508-2.885V54.858l24.579-6.073V60.93c0 4.015-2.404 4.916-3.516 5.121-.097.011-.192.034-.289.052l-.124.014.018.006a8.981 8.981 0 0 0-3.829 1.667c-3.415 2.574-4.397 6.93-2.191 9.731 2.206 2.801 6.763 2.986 10.179.413 1.728-1.304 2.828-3.064 3.211-4.847.133-.433.228-.686.228-1.226V42.712c0-1.592-2.059-4.131-3.687-3.644l-25.808 6.073c-1.628.485-2.458 2.052-2.458 3.644v17.003c0 4.022-2.413 4.322-3.522 4.524-.056.008-.112.026-.171.034a3.291 3.291 0 0 1-.239.032l.032.014a9.021 9.021 0 0 0-3.793 1.659c-3.415 2.574-4.394 6.93-2.191 9.731z"/>
<path fill-rule="evenodd" fill="#FFF"
d="M49.544 17.707v.157c1.938.244 3.115 1.574 3.115 3.5 0 2.326-2.205 4.135-5.024 4.135-2.897 0-4.895-1.594-5.023-4.008h1.721c.158 1.505 1.443 2.473 3.283 2.473 1.878 0 3.213-1.105 3.213-2.649 0-1.633-1.255-2.65-3.283-2.65h-1.809V17.16h1.73c1.622 0 2.769-1.037 2.769-2.503 0-1.437-1.098-2.395-2.739-2.395-1.642 0-2.719.899-2.868 2.415h-1.73c.178-2.445 1.948-3.95 4.667-3.95 2.492 0 4.48 1.642 4.48 3.695 0 1.682-.94 2.914-2.502 3.285zm-13.851 7.645c-1.522 0-2.749-.655-3.332-1.769h-.158v5.103h-1.701V14.628h1.622v1.759h.158c.682-1.212 1.958-1.945 3.411-1.945 2.72 0 4.48 2.141 4.48 5.455 0 3.295-1.77 5.455-4.48 5.455zm-.395-9.395c-1.928 0-3.145 1.516-3.145 3.94 0 2.415 1.217 3.94 3.135 3.94 1.958 0 3.125-1.476 3.125-3.94s-1.167-3.94-3.115-3.94zm-9.583 2.317c0-1.554-.741-2.317-2.244-2.317-1.484 0-2.473 1.095-2.473 2.435v6.775h-1.701V18.01c0-1.251-.88-2.053-2.224-2.053-1.395 0-2.473 1.193-2.473 2.679v6.531h-1.7V14.628h1.621v1.662h.158c.485-1.174 1.553-1.848 2.977-1.848 1.444 0 2.452.753 2.947 1.848h.158c.574-1.115 1.79-1.848 3.263-1.848 2.176 0 3.392 1.232 3.392 3.441v7.284h-1.701v-6.893z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.3 KiB

View File

@ -0,0 +1,12 @@
<svg xmlns="http://www.w3.org/2000/svg" width="84" height="100">
<defs>
<linearGradient id="a" x1="0%" x2="0%" y1="100%" y2="0%">
<stop offset="0%" stop-color="#9E9EEE"/>
<stop offset="100%" stop-color="#7D7CE5"/>
</linearGradient>
</defs>
<path fill-rule="evenodd" fill="url(#a)" d="M84 22v74a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4h58l22 22z"/>
<path fill-rule="evenodd" fill="#D9DEFA" d="M84 22H66a4 4 0 0 1-4-4V0l22 22z"/>
<path fill-rule="evenodd" fill="#FFF"
d="M60.077 53.243v2.924h-1.741v-2.924h-6.952V51.64c1.276-2.239 3.541-5.778 6.112-9.581h2.581v9.61h2.027v1.574h-2.027zm-1.731-9.551h-.119c-1.463 2.102-3.322 5.015-5.023 7.87v.117h5.142v-7.987zm-13.653 12.66c-1.522 0-2.749-.655-3.332-1.769h-.158v5.103h-1.701V45.628h1.622v1.759h.158c.682-1.212 1.958-1.945 3.411-1.945 2.72 0 4.48 2.141 4.48 5.455 0 3.295-1.77 5.455-4.48 5.455zm-.395-9.395c-1.928 0-3.145 1.516-3.145 3.94 0 2.415 1.217 3.94 3.135 3.94 1.958 0 3.125-1.476 3.125-3.94s-1.167-3.94-3.115-3.94zm-9.583 2.317c0-1.554-.741-2.317-2.244-2.317-1.484 0-2.473 1.095-2.473 2.435v6.775h-1.701V49.01c0-1.251-.88-2.053-2.224-2.053-1.395 0-2.473 1.193-2.473 2.679v6.531h-1.7V45.628h1.621v1.662h.158c.485-1.174 1.553-1.848 2.977-1.848 1.444 0 2.452.753 2.947 1.848h.158c.574-1.115 1.79-1.848 3.263-1.848 2.176 0 3.392 1.232 3.392 3.441v7.284h-1.701v-6.893z"/>
</svg>

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" width="84" height="100">
<defs>
<linearGradient id="a" x1="0%" x2="0%" y1="100%" y2="0%">
<stop offset="0%" stop-color="#F45F5F"/>
<stop offset="100%" stop-color="#EE3C3C"/>
</linearGradient>
</defs>
<path fill-rule="evenodd" fill="url(#a)" d="M84 22v74a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4h58l22 22z"/>
<path fill-rule="evenodd" fill="#FF8578" d="M84 22H66a4 4 0 0 1-4-4V0l22 22z"/>
<path fill-rule="evenodd" opacity=".6" fill="#FFF"
d="M64.422 71.822c-.27.962-.943.686-1.482 1.237-.27-.275-.808.274-1.348 0-2.964.274-8.084-1.649-11.991-3.847-5.39.687-11.184 2.747-16.439 3.847-4.581 8.653-7.815 11.538-10.779 11.95-.27-.275-1.212 0-1.482-.55l-1.078-.412c-.674-.962-1.078-1.099-.674-2.197.405-1.924 2.964-5.083 7.007-7.281.404-.412 2.56-1.373 2.56-1.51l1.212-.551c1.078-2.059 2.426-4.395 3.773-7.142l.135-.137 4.042-8.791.404-.824c-1.751-6.869-2.425-11.264-1.751-14.973.538-.549 1.212-1.923 2.829-1.511l.674-.137c1.212.275 2.021.824 2.425 1.923l.135.275c0 .549.135.275.135.961.404 2.473-1.078 11.264-1.078 11.127 0 .549-.135.549-.135 1.098 1.078 3.435 3.369 7.555 6.063 9.478.944 1.236 2.291 1.511 3.369 2.611 2.695-.825 5.12-.276 7.276-.688 3.233.412 4.985.412 6.063 1.51v-.136c.269.549.674.824.674 1.373 0 .961.269 2.885-.539 3.297zm-37.054 3.984c-2.748 2.8-4.972 5.08-5.469 6.845-.018.005-.037.018-.055.022v.138c.012-.052.04-.108.055-.16 1.602-.453 3.351-2.917 6.682-7.807-.674.412-.808.962-1.213.962zm12.397-35.303c-.27-.274-.404 3.573-.404 3.298 0 1.648.538 4.532.808 6.18.673-1.373 1.077-2.609 1.077-4.944 0-1.923-.404-4.945-1.481-4.534zm5.793 25.962c-2.156-2.197-4.312-4.121-5.659-7.417-.674 2.198-1.751 4.67-3.503 7.829-.808 1.236-1.213 2.747-2.021 3.572v.137c3.638-1.511 7.546-2.061 12.126-3.572-.134.138-.673-.549-.943-.549zM61.997 68.8c-1.617 0-2.021-.687-3.773-.275-.674-.412-2.021 0-2.964 0 2.829 1.373 4.85 1.649 6.602 2.06.27-.274 1.482.276 1.482-.411v.137c.404-.413.404-.825-1.347-1.511z"/>
<path fill-rule="evenodd" fill="#FFF"
d="M41.658 11.959c-1.018 0-1.592.508-1.592 1.691v.978h2.443v1.407h-2.443v9.132h-1.701v-9.132h-1.77v-1.407h1.77v-1.027c0-2.16 1.138-3.06 3.194-3.06.337 0 .633.03 1.049.098v1.408a5.133 5.133 0 0 0-.95-.088zm-8.916 11.526h-.158c-.672 1.173-1.938 1.867-3.411 1.867-2.73 0-4.48-2.141-4.48-5.455 0-3.304 1.77-5.455 4.48-5.455 1.483 0 2.739.694 3.342 1.848h.148v-5.847h1.701v14.724h-1.622v-1.682zm-3.174-7.528c-1.938 0-3.115 1.486-3.115 3.94 0 2.464 1.167 3.94 3.115 3.94 1.938 0 3.135-1.506 3.135-3.94 0-2.415-1.206-3.94-3.135-3.94zm-11.477 9.395c-1.523 0-2.749-.655-3.332-1.769H14.6v5.103h-1.7V14.628h1.621v1.759h.158c.683-1.212 1.958-1.945 3.412-1.945 2.719 0 4.48 2.141 4.48 5.455 0 3.295-1.77 5.455-4.48 5.455zm-.395-9.395c-1.929 0-3.145 1.516-3.145 3.94 0 2.415 1.216 3.94 3.135 3.94 1.958 0 3.124-1.476 3.124-3.94s-1.166-3.94-3.114-3.94z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

@ -0,0 +1,14 @@
<svg xmlns="http://www.w3.org/2000/svg" width="84" height="100">
<defs>
<linearGradient id="a" x1="0%" x2="0%" y1="100%" y2="0%">
<stop offset="0%" stop-color="#4D9CFC"/>
<stop offset="100%" stop-color="#2B79FA"/>
</linearGradient>
</defs>
<path fill-rule="evenodd" fill="url(#a)" d="M84 22v74a4 4 0 0 1-4 4H4a4 4 0 0 1-4-4V4a4 4 0 0 1 4-4h58l22 22z"/>
<path fill-rule="evenodd" fill="#A6CAFD" d="M84 22H66a4 4 0 0 1-4-4V0l22 22z"/>
<path fill-rule="evenodd" opacity=".6" fill="#FFF"
d="M43.583 59.101s.974-5.495 5.008-9.477c4.033-3.982 9.598-4.944 9.598-4.944s-.974 5.494-5.008 9.477c-4.033 3.982-9.598 4.944-9.598 4.944zm-4.675-10.909c0-5.632 3.245-10.197 3.245-10.197s3.246 4.565 3.246 10.197c0 5.632-3.246 10.198-3.246 10.198s-3.245-4.566-3.245-10.198zm-8.042 5.64c-4.074-3.999-5.058-9.517-5.058-9.517s5.621.967 9.695 4.966c4.075 3.999 5.059 9.516 5.059 9.516s-5.621-.966-9.696-4.965zm8.934 6.452s-4.667 3.242-10.412 3.258c-5.745.017-10.392-3.198-10.392-3.198s4.666-3.241 10.411-3.258c5.745-.016 10.393 3.198 10.393 3.198zm.762 1.598s-.984 5.518-5.059 9.517c-4.074 3.999-9.695 4.965-9.695 4.965s.984-5.517 5.058-9.517c4.075-3.999 9.696-4.965 9.696-4.965zm4.686 10.844c-.017 5.673-3.3 10.28-3.3 10.28s-3.256-4.588-3.239-10.261c.017-5.672 3.3-10.279 3.3-10.279s3.256 4.588 3.239 10.26zm-.903-12.172s4.624-3.205 10.328-3.205 10.329 3.205 10.329 3.205-4.625 3.205-10.329 3.205c-5.704 0-10.328-3.205-10.328-3.205zm8.836 6.552c4.034 3.982 5.008 9.477 5.008 9.477s-5.565-.962-9.598-4.945c-4.034-3.982-5.008-9.477-5.008-9.477s5.565.962 9.598 4.945z"/>
<path fill-rule="evenodd" fill="#FFF"
d="M41.77 29.438c-2.571 0-4.213-1.144-4.47-2.884h1.8c.188.86 1.137 1.417 2.67 1.417 1.908 0 3.045-.929 3.045-2.483v-2.073h-.158c-.672 1.164-1.879 1.819-3.342 1.819-2.759 0-4.47-2.112-4.47-5.27 0-3.157 1.731-5.298 4.47-5.298 1.493 0 2.808.723 3.421 1.857h.158v-1.672h1.622v10.725c0 2.356-1.839 3.862-4.746 3.862zm-.08-13.257c-1.977 0-3.085 1.486-3.085 3.783 0 2.298 1.108 3.784 3.085 3.784 1.978 0 3.165-1.486 3.165-3.784 0-2.297-1.197-3.783-3.165-3.783zm-9.104 2.796c0-1.897-.811-2.796-2.512-2.796s-2.798 1.124-2.798 2.972v6.237h-1.701V14.851h1.622v1.662h.158c.534-1.163 1.572-1.847 3.204-1.847 2.393 0 3.728 1.398 3.728 3.9v6.824h-1.701v-6.413zm-14.147 6.599c-1.523 0-2.749-.655-3.333-1.77h-.158v5.104h-1.701V14.851h1.622v1.76h.158c.683-1.212 1.958-1.945 3.412-1.945 2.719 0 4.479 2.141 4.479 5.455 0 3.294-1.77 5.455-4.479 5.455zm-.396-9.395c-1.928 0-3.144 1.515-3.144 3.94 0 2.415 1.216 3.94 3.134 3.94 1.958 0 3.125-1.477 3.125-3.94 0-2.464-1.167-3.94-3.115-3.94z"/>
</svg>

After

Width:  |  Height:  |  Size: 2.6 KiB

View File

@ -0,0 +1,24 @@
<svg xmlns="http://www.w3.org/2000/svg" width="85" height="100" viewBox="0 0 85 100">
<defs>
<linearGradient id="ppt-a" x1="50%" x2="50%" y1="0%" y2="100%">
<stop offset="0%" stop-color="#E86D36"/>
<stop offset="100%" stop-color="#FA9B70"/>
</linearGradient>
</defs>
<g fill="none" fill-rule="evenodd">
<path fill="url(#ppt-a)"
d="M6,0 L62.3333333,0 L62.3333333,0 L85,22.8571429 L85,94 C85,97.3137085 82.3137085,100 79,100 L6,100 C2.6862915,100 4.05812251e-16,97.3137085 0,94 L0,6 C-4.05812251e-16,2.6862915 2.6862915,6.08718376e-16 6,0 Z"/>
<rect width="22.667" height="2.817" x="51" y="33.803" fill="#FFF" opacity=".5"/>
<rect width="22.667" height="2.817" x="51" y="45.07" fill="#FFF" opacity=".5"/>
<rect width="22.667" height="2.817" x="51" y="56.338" fill="#FFF" opacity=".5"/>
<rect width="22.667" height="2.817" x="51" y="67.606" fill="#FFF" opacity=".5"/>
<path fill="#FFF"
d="M62.3333333,0 L85,22.5352113 L68.3333333,22.5352113 C65.0196248,22.5352113 62.3333333,19.8489198 62.3333333,16.5352113 L62.3333333,0 L62.3333333,0 Z"
opacity=".5"/>
<rect width="42.5" height="42.254" y="30.986" fill="#E96123" rx="2"/>
<path fill="#FFF" fill-rule="nonzero"
d="M11.1666667,40.8450704 C11.1666667,39.1882162 12.5098124,37.8450704 14.1666667,37.8450704 L25.5328638,37.8450704 C30.3011815,37.8450704 34.1666667,41.7105556 34.1666667,46.4788732 C34.1666667,51.2471909 30.3011815,55.1126761 25.5328638,55.1126761 L14.1666667,55.1126761 C12.5098124,55.1126761 11.1666667,53.7695303 11.1666667,52.1126761 L11.1666667,40.8450704 Z M17.1666667,49.1126761 L25.5328638,49.1126761 C26.987473,49.1126761 28.1666667,47.9334824 28.1666667,46.4788732 C28.1666667,45.0242641 26.987473,43.8450704 25.5328638,43.8450704 L17.1666667,43.8450704 L17.1666667,49.1126761 Z"/>
<path stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" stroke-width="6"
d="M14.1666667,40.8450704 L14.1666667,63.3802817"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

View File

@ -0,0 +1,24 @@
<svg xmlns="http://www.w3.org/2000/svg" width="85" height="100" viewBox="0 0 85 100">
<defs>
<linearGradient id="ppt-a" x1="50%" x2="50%" y1="0%" y2="100%">
<stop offset="0%" stop-color="#E86D36"/>
<stop offset="100%" stop-color="#FA9B70"/>
</linearGradient>
</defs>
<g fill="none" fill-rule="evenodd">
<path fill="url(#ppt-a)"
d="M6,0 L62.3333333,0 L62.3333333,0 L85,22.8571429 L85,94 C85,97.3137085 82.3137085,100 79,100 L6,100 C2.6862915,100 4.05812251e-16,97.3137085 0,94 L0,6 C-4.05812251e-16,2.6862915 2.6862915,6.08718376e-16 6,0 Z"/>
<rect width="22.667" height="2.817" x="51" y="33.803" fill="#FFF" opacity=".5"/>
<rect width="22.667" height="2.817" x="51" y="45.07" fill="#FFF" opacity=".5"/>
<rect width="22.667" height="2.817" x="51" y="56.338" fill="#FFF" opacity=".5"/>
<rect width="22.667" height="2.817" x="51" y="67.606" fill="#FFF" opacity=".5"/>
<path fill="#FFF"
d="M62.3333333,0 L85,22.5352113 L68.3333333,22.5352113 C65.0196248,22.5352113 62.3333333,19.8489198 62.3333333,16.5352113 L62.3333333,0 L62.3333333,0 Z"
opacity=".5"/>
<rect width="42.5" height="42.254" y="30.986" fill="#E96123" rx="2"/>
<path fill="#FFF" fill-rule="nonzero"
d="M11.1666667,40.8450704 C11.1666667,39.1882162 12.5098124,37.8450704 14.1666667,37.8450704 L25.5328638,37.8450704 C30.3011815,37.8450704 34.1666667,41.7105556 34.1666667,46.4788732 C34.1666667,51.2471909 30.3011815,55.1126761 25.5328638,55.1126761 L14.1666667,55.1126761 C12.5098124,55.1126761 11.1666667,53.7695303 11.1666667,52.1126761 L11.1666667,40.8450704 Z M17.1666667,49.1126761 L25.5328638,49.1126761 C26.987473,49.1126761 28.1666667,47.9334824 28.1666667,46.4788732 C28.1666667,45.0242641 26.987473,43.8450704 25.5328638,43.8450704 L17.1666667,43.8450704 L17.1666667,49.1126761 Z"/>
<path stroke="#FFF" stroke-linecap="round" stroke-linejoin="round" stroke-width="6"
d="M14.1666667,40.8450704 L14.1666667,63.3802817"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.0 KiB

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