Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
ghsby
o2oa
提交
93e4afca
o2oa
项目概览
ghsby
/
o2oa
落后 Fork 源项目 2880 个版本
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
o2oa
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
93e4afca
编写于
9月 03, 2020
作者:
U
unknown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
ckeditor 增加保存为base64选项
上级
996c375d
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
207 addition
and
27 deletion
+207
-27
o2web/source/o2_core/o2/widget/ImageClipper.js
o2web/source/o2_core/o2/widget/ImageClipper.js
+1
-1
o2web/source/o2_lib/htmleditor/ckeditor4114/plugins/iframe/dialogs/iframe.js
.../htmleditor/ckeditor4114/plugins/iframe/dialogs/iframe.js
+131
-6
o2web/source/o2_lib/htmleditor/ckeditor4114/plugins/image/dialogs/image.js
...ib/htmleditor/ckeditor4114/plugins/image/dialogs/image.js
+75
-20
未找到文件。
o2web/source/o2_core/o2/widget/ImageClipper.js
浏览文件 @
93e4afca
...
...
@@ -439,7 +439,7 @@ o2.widget.HTML5ImageClipper = new Class({
this
.
fileNode
=
new
Element
(
"
input.file
"
,
{
"
type
"
:
"
file
"
,
"
accept
"
:
"
image
s
/*
"
,
"
accept
"
:
"
image/*
"
,
"
styles
"
:
{
"
display
"
:
"
none
"
}
}).
inject
(
this
.
container
);
this
.
fileNode
.
addEvent
(
"
change
"
,
function
(
event
){
...
...
o2web/source/o2_lib/htmleditor/ckeditor4114/plugins/iframe/dialogs/iframe.js
浏览文件 @
93e4afca
...
...
@@ -2,9 +2,134 @@
Copyright (c) 2003-2019, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license
*/
(
function
(){
function
c
(
b
){
var
c
=
this
instanceof
CKEDITOR
.
ui
.
dialog
.
checkbox
;
b
.
hasAttribute
(
this
.
id
)
&&
(
b
=
b
.
getAttribute
(
this
.
id
),
c
?
this
.
setValue
(
e
[
this
.
id
][
"
true
"
]
==
b
.
toLowerCase
()):
this
.
setValue
(
b
))}
function
d
(
b
){
var
c
=
""
===
this
.
getValue
(),
a
=
this
instanceof
CKEDITOR
.
ui
.
dialog
.
checkbox
,
d
=
this
.
getValue
();
c
?
b
.
removeAttribute
(
this
.
att
||
this
.
id
):
a
?
b
.
setAttribute
(
this
.
id
,
e
[
this
.
id
][
d
]):
b
.
setAttribute
(
this
.
att
||
this
.
id
,
d
)}
var
e
=
{
scrolling
:{
"
true
"
:
"
yes
"
,
"
false
"
:
"
no
"
},
frameborder
:{
"
true
"
:
"
1
"
,
"
false
"
:
"
0
"
}};
CKEDITOR
.
dialog
.
add
(
"
iframe
"
,
function
(
b
){
var
f
=
b
.
lang
.
iframe
,
a
=
b
.
lang
.
common
,
e
=
b
.
plugins
.
dialogadvtab
;
return
{
title
:
f
.
title
,
minWidth
:
350
,
minHeight
:
260
,
onShow
:
function
(){
this
.
fakeImage
=
this
.
iframeNode
=
null
;
var
a
=
this
.
getSelectedElement
();
a
&&
a
.
data
(
"
cke-real-element-type
"
)
&&
"
iframe
"
==
a
.
data
(
"
cke-real-element-type
"
)
&&
(
this
.
fakeImage
=
a
,
this
.
iframeNode
=
a
=
b
.
restoreRealElement
(
a
),
this
.
setupContent
(
a
))},
onOk
:
function
(){
var
a
;
a
=
this
.
fakeImage
?
this
.
iframeNode
:
new
CKEDITOR
.
dom
.
element
(
"
iframe
"
);
var
c
=
{},
d
=
{};
this
.
commitContent
(
a
,
c
,
d
);
a
=
b
.
createFakeElement
(
a
,
"
cke_iframe
"
,
"
iframe
"
,
!
0
);
a
.
setAttributes
(
d
);
a
.
setStyles
(
c
);
this
.
fakeImage
?(
a
.
replace
(
this
.
fakeImage
),
b
.
getSelection
().
selectElement
(
a
)):
b
.
insertElement
(
a
)},
contents
:[{
id
:
"
info
"
,
label
:
a
.
generalTab
,
accessKey
:
"
I
"
,
elements
:[{
type
:
"
vbox
"
,
padding
:
0
,
children
:[{
id
:
"
src
"
,
type
:
"
text
"
,
label
:
a
.
url
,
required
:
!
0
,
validate
:
CKEDITOR
.
dialog
.
validate
.
notEmpty
(
f
.
noUrl
),
setup
:
c
,
commit
:
d
}]},{
type
:
"
hbox
"
,
children
:[{
id
:
"
width
"
,
type
:
"
text
"
,
requiredContent
:
"
iframe[width]
"
,
style
:
"
width:100%
"
,
labelLayout
:
"
vertical
"
,
label
:
a
.
width
,
validate
:
CKEDITOR
.
dialog
.
validate
.
htmlLength
(
a
.
invalidHtmlLength
.
replace
(
"
%1
"
,
a
.
width
)),
setup
:
c
,
commit
:
d
},{
id
:
"
height
"
,
type
:
"
text
"
,
requiredContent
:
"
iframe[height]
"
,
style
:
"
width:100%
"
,
labelLayout
:
"
vertical
"
,
label
:
a
.
height
,
validate
:
CKEDITOR
.
dialog
.
validate
.
htmlLength
(
a
.
invalidHtmlLength
.
replace
(
"
%1
"
,
a
.
height
)),
setup
:
c
,
commit
:
d
},{
id
:
"
align
"
,
type
:
"
select
"
,
requiredContent
:
"
iframe[align]
"
,
"
default
"
:
""
,
items
:[[
a
.
notSet
,
""
],[
a
.
left
,
"
left
"
],[
a
.
right
,
"
right
"
],[
a
.
alignTop
,
"
top
"
],[
a
.
alignMiddle
,
"
middle
"
],[
a
.
alignBottom
,
"
bottom
"
]],
style
:
"
width:100%
"
,
labelLayout
:
"
vertical
"
,
label
:
a
.
align
,
setup
:
function
(
a
,
b
){
c
.
apply
(
this
,
arguments
);
if
(
b
){
var
d
=
b
.
getAttribute
(
"
align
"
);
this
.
setValue
(
d
&&
d
.
toLowerCase
()
||
""
)}},
commit
:
function
(
a
,
b
,
c
){
d
.
apply
(
this
,
arguments
);
this
.
getValue
()
&&
(
c
.
align
=
this
.
getValue
())}}]},{
type
:
"
hbox
"
,
widths
:[
"
50%
"
,
"
50%
"
],
children
:[{
id
:
"
scrolling
"
,
type
:
"
checkbox
"
,
requiredContent
:
"
iframe[scrolling]
"
,
label
:
f
.
scrolling
,
setup
:
c
,
commit
:
d
},{
id
:
"
frameborder
"
,
type
:
"
checkbox
"
,
requiredContent
:
"
iframe[frameborder]
"
,
label
:
f
.
border
,
setup
:
c
,
commit
:
d
}]},{
type
:
"
hbox
"
,
widths
:[
"
50%
"
,
"
50%
"
],
children
:[{
id
:
"
name
"
,
type
:
"
text
"
,
requiredContent
:
"
iframe[name]
"
,
label
:
a
.
name
,
setup
:
c
,
commit
:
d
},{
id
:
"
title
"
,
type
:
"
text
"
,
requiredContent
:
"
iframe[title]
"
,
label
:
a
.
advisoryTitle
,
setup
:
c
,
commit
:
d
}]},{
id
:
"
longdesc
"
,
type
:
"
text
"
,
requiredContent
:
"
iframe[longdesc]
"
,
label
:
a
.
longDescr
,
setup
:
c
,
commit
:
d
}]},
e
&&
e
.
createAdvancedTab
(
b
,{
id
:
1
,
classes
:
1
,
styles
:
1
},
"
iframe
"
)]}})})();
\ No newline at end of file
(
function
()
{
function
c
(
b
)
{
var
c
=
this
instanceof
CKEDITOR
.
ui
.
dialog
.
checkbox
;
b
.
hasAttribute
(
this
.
id
)
&&
(
b
=
b
.
getAttribute
(
this
.
id
),
c
?
this
.
setValue
(
e
[
this
.
id
][
"
true
"
]
==
b
.
toLowerCase
())
:
this
.
setValue
(
b
))
}
function
d
(
b
)
{
var
c
=
""
===
this
.
getValue
(),
a
=
this
instanceof
CKEDITOR
.
ui
.
dialog
.
checkbox
,
d
=
this
.
getValue
();
c
?
b
.
removeAttribute
(
this
.
att
||
this
.
id
)
:
a
?
b
.
setAttribute
(
this
.
id
,
e
[
this
.
id
][
d
])
:
b
.
setAttribute
(
this
.
att
||
this
.
id
,
d
)
}
var
e
=
{
scrolling
:
{
"
true
"
:
"
yes
"
,
"
false
"
:
"
no
"
},
frameborder
:
{
"
true
"
:
"
1
"
,
"
false
"
:
"
0
"
}};
CKEDITOR
.
dialog
.
add
(
"
iframe
"
,
function
(
b
)
{
var
f
=
b
.
lang
.
iframe
,
a
=
b
.
lang
.
common
,
e
=
b
.
plugins
.
dialogadvtab
;
return
{
title
:
f
.
title
,
minWidth
:
350
,
minHeight
:
260
,
onShow
:
function
()
{
this
.
fakeImage
=
this
.
iframeNode
=
null
;
var
a
=
this
.
getSelectedElement
();
a
&&
a
.
data
(
"
cke-real-element-type
"
)
&&
"
iframe
"
==
a
.
data
(
"
cke-real-element-type
"
)
&&
(
this
.
fakeImage
=
a
,
this
.
iframeNode
=
a
=
b
.
restoreRealElement
(
a
),
this
.
setupContent
(
a
))
},
onOk
:
function
()
{
var
a
;
a
=
this
.
fakeImage
?
this
.
iframeNode
:
new
CKEDITOR
.
dom
.
element
(
"
iframe
"
);
var
c
=
{},
d
=
{};
this
.
commitContent
(
a
,
c
,
d
);
a
=
b
.
createFakeElement
(
a
,
"
cke_iframe
"
,
"
iframe
"
,
!
0
);
a
.
setAttributes
(
d
);
a
.
setStyles
(
c
);
this
.
fakeImage
?
(
a
.
replace
(
this
.
fakeImage
),
b
.
getSelection
().
selectElement
(
a
))
:
b
.
insertElement
(
a
)
},
contents
:
[{
id
:
"
info
"
,
label
:
a
.
generalTab
,
accessKey
:
"
I
"
,
elements
:
[{
type
:
"
vbox
"
,
padding
:
0
,
children
:
[{
id
:
"
src
"
,
type
:
"
text
"
,
label
:
a
.
url
,
required
:
!
0
,
validate
:
CKEDITOR
.
dialog
.
validate
.
notEmpty
(
f
.
noUrl
),
setup
:
c
,
commit
:
d
}]
},
{
type
:
"
hbox
"
,
children
:
[{
id
:
"
width
"
,
type
:
"
text
"
,
requiredContent
:
"
iframe[width]
"
,
style
:
"
width:100%
"
,
labelLayout
:
"
vertical
"
,
label
:
a
.
width
,
validate
:
CKEDITOR
.
dialog
.
validate
.
htmlLength
(
a
.
invalidHtmlLength
.
replace
(
"
%1
"
,
a
.
width
)),
setup
:
c
,
commit
:
d
},
{
id
:
"
height
"
,
type
:
"
text
"
,
requiredContent
:
"
iframe[height]
"
,
style
:
"
width:100%
"
,
labelLayout
:
"
vertical
"
,
label
:
a
.
height
,
validate
:
CKEDITOR
.
dialog
.
validate
.
htmlLength
(
a
.
invalidHtmlLength
.
replace
(
"
%1
"
,
a
.
height
)),
setup
:
c
,
commit
:
d
},
{
id
:
"
align
"
,
type
:
"
select
"
,
requiredContent
:
"
iframe[align]
"
,
"
default
"
:
""
,
items
:
[[
a
.
notSet
,
""
],
[
a
.
left
,
"
left
"
],
[
a
.
right
,
"
right
"
],
[
a
.
alignTop
,
"
top
"
],
[
a
.
alignMiddle
,
"
middle
"
],
[
a
.
alignBottom
,
"
bottom
"
]],
style
:
"
width:100%
"
,
labelLayout
:
"
vertical
"
,
label
:
a
.
align
,
setup
:
function
(
a
,
b
)
{
c
.
apply
(
this
,
arguments
);
if
(
b
)
{
var
d
=
b
.
getAttribute
(
"
align
"
);
this
.
setValue
(
d
&&
d
.
toLowerCase
()
||
""
)
}
},
commit
:
function
(
a
,
b
,
c
)
{
d
.
apply
(
this
,
arguments
);
this
.
getValue
()
&&
(
c
.
align
=
this
.
getValue
())
}
}]
},
{
type
:
"
hbox
"
,
widths
:
[
"
50%
"
,
"
50%
"
],
children
:
[{
id
:
"
scrolling
"
,
type
:
"
checkbox
"
,
requiredContent
:
"
iframe[scrolling]
"
,
label
:
f
.
scrolling
,
setup
:
c
,
commit
:
d
},
{
id
:
"
frameborder
"
,
type
:
"
checkbox
"
,
requiredContent
:
"
iframe[frameborder]
"
,
label
:
f
.
border
,
setup
:
c
,
commit
:
d
}]
},
{
type
:
"
hbox
"
,
widths
:
[
"
50%
"
,
"
50%
"
],
children
:
[{
id
:
"
name
"
,
type
:
"
text
"
,
requiredContent
:
"
iframe[name]
"
,
label
:
a
.
name
,
setup
:
c
,
commit
:
d
},
{
id
:
"
title
"
,
type
:
"
text
"
,
requiredContent
:
"
iframe[title]
"
,
label
:
a
.
advisoryTitle
,
setup
:
c
,
commit
:
d
}]
},
{
id
:
"
longdesc
"
,
type
:
"
text
"
,
requiredContent
:
"
iframe[longdesc]
"
,
label
:
a
.
longDescr
,
setup
:
c
,
commit
:
d
}]
},
e
&&
e
.
createAdvancedTab
(
b
,
{
id
:
1
,
classes
:
1
,
styles
:
1
},
"
iframe
"
)]
}
})
})();
\ No newline at end of file
o2web/source/o2_lib/htmleditor/ckeditor4114/plugins/image/dialogs/image.js
浏览文件 @
93e4afca
...
...
@@ -3,6 +3,20 @@
For licensing, see LICENSE.md or http://ckeditor.com/license
*/
(
function
()
{
function
setupCheckbox
(
b
)
{
debugger
;
var
c
=
this
instanceof
CKEDITOR
.
ui
.
dialog
.
checkbox
;
b
.
hasAttribute
(
this
.
id
)
&&
(
b
=
b
.
getAttribute
(
this
.
id
),
c
?
this
.
setValue
(
checboxOptions
[
this
.
id
][
"
true
"
]
==
b
.
toLowerCase
())
:
this
.
setValue
(
b
))
}
function
commitCheckbox
(
b
)
{
return
true
;
// var c = "" === this.getValue(), a = this instanceof CKEDITOR.ui.dialog.checkbox, d = this.getValue();
// c ? b.removeAttribute(this.att || this.id) : a ? b.setAttribute(this.id, checboxOptions[this.id][d]) : b.setAttribute(this.att || this.id, d)
}
var
checboxOptions
=
{
base64enable
:
{
"
true
"
:
"
yes
"
,
"
false
"
:
"
no
"
}};
var
v
=
function
(
d
,
l
)
{
function
v
()
{
var
a
=
arguments
,
b
=
this
.
getContentElement
(
"
advanced
"
,
"
txtdlgGenStyle
"
);
...
...
@@ -221,25 +235,55 @@
onClick
:
function
(
e
)
{
//var fileNode = document.getElementById("fckLocalFileUpload");
//fileNode.click();
MWF
.
require
(
"
MWF.widget.Upload
"
,
function
(){
var
action
=
new
MWF
.
xDesktop
.
Actions
.
RestActions
(
"
/xDesktop/Actions/action.json
"
,
"
x_file_assemble_control
"
);
var
dialogElement
=
CKEDITOR
.
currentImageDialog
.
_
.
element
.
$
;
var
contentElement
=
dialogElement
.
getElement
(
"
.cke_dialog_body
"
).
getParent
();
var
upload
=
new
MWF
.
widget
.
Upload
(
contentElement
,
{
"
data
"
:
null
,
"
parameter
"
:
{
"
reference
"
:
d
.
config
.
reference
,
"
referencetype
"
:
d
.
config
.
referenceType
,
"
scale
"
:
800
},
"
action
"
:
action
,
"
method
"
:
"
uploadImageByScale
"
,
"
onEvery
"
:
function
(
json
){
var
id
=
json
.
data
?
json
.
data
.
id
:
json
.
id
;
var
src
=
MWF
.
xDesktop
.
getImageSrc
(
id
);
MWF
.
xDesktop
.
uploadedImageId
=
id
;
var
txtUrlElement
=
CKEDITOR
.
currentImageDialog
.
getContentElement
(
"
info
"
,
"
txtUrl
"
);
txtUrlElement
.
setValue
(
src
);
}.
bind
(
this
)
});
upload
.
load
();
}.
bind
(
this
));
var
base64enable
=
CKEDITOR
.
currentImageDialog
.
getContentElement
(
"
info
"
,
"
base64enable
"
);
if
(
base64enable
&&
base64enable
.
getValue
()
){
var
fileNode
=
document
.
getElementById
(
"
fckLocalFileUpload
"
);
if
(
!
fileNode
){
fileNode
=
new
Element
(
"
input
"
,
{
"
id
"
:
"
fckLocalFileUpload
"
,
"
type
"
:
"
file
"
,
"
accept
"
:
"
image/*
"
,
"
styles
"
:
{
"
display
"
:
"
none
"
}
}).
inject
(
document
.
body
);
fileNode
.
addEvent
(
"
change
"
,
function
(
event
){
var
file
=
fileNode
.
files
[
0
];
if
(
!
/image
\/\w
+/
.
test
(
file
.
type
)){
//判断获取的是否为图片文件
MWF
.
xDesktop
.
notice
(
"
请确保文件为图像文件
"
,
"
error
"
);
return
false
;
}
var
reader
=
new
FileReader
();
reader
.
readAsDataURL
(
file
);
reader
.
onload
=
function
(
e
){
var
txtUrlElement
=
CKEDITOR
.
currentImageDialog
.
getContentElement
(
"
info
"
,
"
txtUrl
"
);
txtUrlElement
.
setValue
(
this
.
result
);
}
}.
bind
(
this
));
fileNode
.
click
();
}
else
{
fileNode
.
click
();
}
}
else
{
MWF
.
require
(
"
MWF.widget.Upload
"
,
function
(){
var
action
=
new
MWF
.
xDesktop
.
Actions
.
RestActions
(
"
/xDesktop/Actions/action.json
"
,
"
x_file_assemble_control
"
);
var
dialogElement
=
CKEDITOR
.
currentImageDialog
.
_
.
element
.
$
;
var
contentElement
=
dialogElement
.
getElement
(
"
.cke_dialog_body
"
).
getParent
();
var
upload
=
new
MWF
.
widget
.
Upload
(
contentElement
,
{
"
data
"
:
null
,
"
parameter
"
:
{
"
reference
"
:
d
.
config
.
reference
,
"
referencetype
"
:
d
.
config
.
referenceType
,
"
scale
"
:
800
},
"
action
"
:
action
,
"
method
"
:
"
uploadImageByScale
"
,
"
onEvery
"
:
function
(
json
){
var
id
=
json
.
data
?
json
.
data
.
id
:
json
.
id
;
var
src
=
MWF
.
xDesktop
.
getImageSrc
(
id
);
MWF
.
xDesktop
.
uploadedImageId
=
id
;
var
txtUrlElement
=
CKEDITOR
.
currentImageDialog
.
getContentElement
(
"
info
"
,
"
txtUrl
"
);
txtUrlElement
.
setValue
(
src
);
}.
bind
(
this
)
});
upload
.
load
();
}.
bind
(
this
));
}
},
onLoad
:
function
()
{
//var fileNode = document.getElementById("fckLocalFileUpload");
...
...
@@ -307,7 +351,18 @@
});
}
}]
},
{
},
{
type
:
"
hbox
"
,
widths
:
[
"
100%
"
],
children
:
[{
id
:
"
base64enable
"
,
type
:
"
checkbox
"
,
requiredContent
:
"
img{src}
"
,
label
:
"
存为Base64编码
"
,
setup
:
setupCheckbox
,
commit
:
commitCheckbox
}]
},
{
id
:
"
txtAlt
"
,
type
:
"
text
"
,
label
:
d
.
lang
.
image
.
alt
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录