Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Dev 1.4.4 百度编辑器上传视频音频的bug #3240

Open
wants to merge 142 commits into
base: dev-1.4.3.3
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
142 commits
Select commit Hold shift + click to select a range
dacc92b
修改错别字
carsonxu Jun 4, 2014
4a25b4a
Merge remote-tracking branch 'origin/dev-1.4.3' into dev-1.4.3
carsonxu Jun 4, 2014
2691799
成功替换图片后没有触发contentchange
campaign Jun 5, 2014
a7d8974
修复LIST中处理li时因缺少选择器而造成全局范围影响的问题
csbde Jun 10, 2014
16281ab
修复li{clear:both}前边没有加入选择器,可能会影响全局的css问题
campaign Jun 10, 2014
55cf0d1
1.5.0
campaign Jun 10, 2014
af08cc9
修复自动保存配置项不起作用问题
carsonxu Jun 10, 2014
0ffa364
Merge remote-tracking branch 'origin/dev-1.4.3' into dev-1.4.3
carsonxu Jun 10, 2014
858fbb0
添加空串判断
techird Jun 10, 2014
c8e786d
添加自动上传的配置项
carsonxu Jun 10, 2014
7dc5c06
Merge remote-tracking branch 'origin/dev-1.4.4' into dev-1.4.4
carsonxu Jun 10, 2014
4b0e19e
明确两个配置节
Jun 11, 2014
dd9b517
更新权限说明
Jun 11, 2014
1289555
Update
Jun 11, 2014
db4524b
Update README.md
Jun 11, 2014
b529d86
Update README.md
Jun 11, 2014
350a97d
让表格背景透明
carsonxu Jun 11, 2014
595eccf
Merge remote-tracking branch 'origin/dev-1.4.4' into dev-1.4.4
carsonxu Jun 11, 2014
cfb8978
修改自动上传插件
carsonxu Jun 11, 2014
d760421
修改自动上传插件
carsonxu Jun 11, 2014
6392f3b
修改自动上传插件
carsonxu Jun 11, 2014
b5d66c2
插入图片不提供title属性
carsonxu Jun 11, 2014
048f2cc
修复ff下拖文件变成base64的问题
carsonxu Jun 11, 2014
464bfba
fix check or create path
techird Jun 13, 2014
89fd17f
Merge remote-tracking branch 'remotes/origin/dev-1.4.4' into dev-1.5.0
campaign Jun 18, 2014
ba7c15e
[test]
yancend Jun 18, 2014
f9f6bc0
[test]
yancend Jun 18, 2014
45f0ab1
[test]迁移用例 到https://github.com/yancend/testDesign/
yancend Jun 18, 2014
0b4882c
修复ff下拖文件变成base64的问题
carsonxu Jun 18, 2014
38f55e6
Merge remote-tracking branch 'origin/dev-1.5.0' into dev-1.5.0
carsonxu Jun 18, 2014
95b3363
设置 enableAutoSave 配置项
carsonxu Jun 18, 2014
156e818
设置 enableMessageShow 配置项
carsonxu Jun 18, 2014
77f0f23
添加 beforeinsertfile 和 afterinsertfile 事件
carsonxu Jun 18, 2014
cb19659
添加 beforeinsertvideo 和 afterinsertvideo 事件
carsonxu Jun 18, 2014
23724e3
修改toolbar按钮
carsonxu Jun 18, 2014
4bd08a5
修改grunt
carsonxu Jun 20, 2014
d679feb
修改grunt
carsonxu Jun 20, 2014
ab397c6
修改config
carsonxu Jun 20, 2014
a76e96b
修改config
carsonxu Jun 23, 2014
de797fc
修改config
carsonxu Jun 23, 2014
1e509e8
修改config
carsonxu Jun 23, 2014
b336d73
修改远程抓取的代码
carsonxu Jun 24, 2014
c0597ef
修改config
carsonxu Jun 24, 2014
f00f980
修改上传
carsonxu Jun 24, 2014
a094fbd
修改上传
carsonxu Jun 24, 2014
1c3cbc6
Update addCustomizeButton.js
zhoumengkang Jun 24, 2014
60a2fc3
Merge pull request #810 from zhoumengkang/patch-1
carsonxu Jun 24, 2014
a747686
BUG修复 td包含p属性时未清理p的width和height值。会造成表格与后台编辑宽度不一致。
csbde Jun 25, 2014
9bb2650
Merge branch 'dev-1.5.0' of git://github.com/fex-team/ueditor into fe…
csbde Jun 25, 2014
dffbd6a
Update list.js
csbde Jun 25, 2014
349680d
Update list.js
csbde Jun 25, 2014
44d8c99
Update list.js
csbde Jun 25, 2014
df62256
Update list.js
csbde Jun 25, 2014
91719bb
Update list.js
csbde Jun 25, 2014
d46ed0f
Update list.js
csbde Jun 25, 2014
1694f95
合并官方的list
csbde Jun 25, 2014
014ca42
Merge branch 'dev-1.4.3' of https://github.com/csbde/ueditor into dev…
csbde Jun 25, 2014
400dd4f
合并官方的list
csbde Jun 25, 2014
e137374
插入img删除title属性
carsonxu Jun 27, 2014
932c646
插入img删除title属性
carsonxu Jun 27, 2014
acae1c6
修改popup样式
carsonxu Jun 27, 2014
9b6f7d6
产生数据中的color默认都格式化为#16进制格式
campaign Jul 1, 2014
6b918bd
产生数据中的color默认都格式化为#16进制格式
campaign Jul 1, 2014
da8a116
产生数据中的color默认都格式化为#16进制格式
campaign Jul 1, 2014
0c07f6e
产生数据中的color默认都格式化为#16进制格式
campaign Jul 1, 2014
2604edc
产生数据中的color默认都格式化为#16进制格式
campaign Jul 1, 2014
48da535
过滤掉word冗余标签
campaign Jul 3, 2014
9902363
过滤掉word冗余标签
campaign Jul 3, 2014
7328e15
Merge pull request #826 from csbde/dev-1.4.3
carsonxu Jul 6, 2014
e4d12e6
添加了mark标签在dtd中
campaign Jul 18, 2014
69f4737
扩展的UI组件需要配置toolbars参数才可显示
campaign Jul 18, 2014
df841ab
扩展的UI组件需要配置toolbars参数才可显示
campaign Jul 18, 2014
33209cc
更新
campaign Jul 18, 2014
abfd64c
优化快捷上传,清除loader的class
carsonxu Jul 19, 2014
6bb1464
修正search/replace的bug
campaign Jul 23, 2014
1cff04b
Update changelog.md
Jul 23, 2014
127f53a
添加分号
campaign Jul 23, 2014
dcd825c
Merge remote-tracking branch 'origin/dev-1.5.0' into dev-1.5.0
campaign Jul 23, 2014
a71b84d
JSP版本修复上传路径错误的bug
HanCong03 Jul 24, 2014
3d027d4
Merge remote-tracking branch 'origin/dev-1.4.4' into dev-1.5.0
carsonxu Jul 27, 2014
7ef4067
修复windows平台下的路径bug
HanCong03 Jul 28, 2014
70105d6
Fixed windows path
Jul 28, 2014
5dce726
Merge branch 'dev-1.5.0' of github.com:HanCong03/ueditor into dev-1.5.0
Jul 28, 2014
c51f5ad
支持 tel: mailto: 等链接,添加配置项 allowLinkProtocols
carsonxu Jul 28, 2014
d4c8d80
Merge remote-tracking branch 'origin/dev-1.5.0' into dev-1.5.0
carsonxu Jul 28, 2014
573639c
支持 tel: mailto: 等链接,添加配置项 allowLinkProtocols
carsonxu Jul 28, 2014
489a857
修改版本号
campaign Jul 30, 2014
8c81266
添加 zeroclipboardready 事件
carsonxu Aug 1, 2014
fc53ebd
Merge branch 'dev-1.4.4' of https://github.com/fex-team/ueditor into …
carsonxu Aug 1, 2014
49e38c7
添加图片拉伸缩放的配置项
carsonxu Aug 4, 2014
c9cf1f2
添加 zeroclipboardready 事件
carsonxu Aug 4, 2014
ea3fb7b
添加 zeroclipboardready 事件
carsonxu Aug 7, 2014
7f8da86
fix copy plugin bug
carsonxu Aug 12, 2014
756a52d
修复创建编辑器后,快速销毁编辑器后的报错
carsonxu Aug 17, 2014
57a7c33
Update README.md
netpi Aug 23, 2014
3263b93
Merge pull request #1210 from netpi/dev-1.5.0
carsonxu Aug 23, 2014
afb28bb
add ueditor for nodejs
carsonxu Aug 23, 2014
442ff41
修复创建编辑器后,快速销毁编辑器后的报错
carsonxu Aug 25, 2014
d5318a2
修复 serverparam 的 bug
carsonxu Aug 25, 2014
796aac7
修复按钮样式优先级不够大的问题
carsonxu Aug 26, 2014
264455b
修复按钮样式优先级不够大的问题
carsonxu Aug 26, 2014
7f7050f
修复在编辑区域打不开 chrome 控制台的问题
carsonxu Aug 28, 2014
76adeae
修改文档
carsonxu Sep 1, 2014
39100a1
修改测试文件
worry127722 Sep 19, 2014
ff15810
修改测试配置
worry127722 Sep 19, 2014
b41f1ce
修复paragraph命令
campaign Sep 24, 2014
759bc65
添加Content-Type判断
carsonxu Sep 30, 2014
70506f3
修复word图片上传的单位错误
carsonxu Sep 30, 2014
7e42882
去除图片搜索里面编码使用的长字符串
carsonxu Oct 20, 2014
7f490df
修正对于大小写的问题
campaign Nov 13, 2014
1f6cae4
修改版本为1.5.0
campaign Nov 13, 2014
67b0ae8
整理了代码
campaign Nov 13, 2014
311cd80
修复对嵌套的span标签设置样式时,被嵌套的标签不能正确设置上给定的样式
campaign Nov 13, 2014
0700522
更新版本
campaign Nov 13, 2014
a0c5f5a
调试测试
worry127722 Nov 18, 2014
8c8a3f1
Merge branch 'dev-1.5.0' of https://github.com/fex-team/ueditor into …
worry127722 Nov 18, 2014
07362d3
123
worry127722 Nov 18, 2014
dfcbcff
d
worry127722 Nov 19, 2014
3a72493
d
worry127722 Nov 19, 2014
c194227
dd
worry127722 Nov 19, 2014
1e3ea0c
dddd
worry127722 Nov 19, 2014
9b189e2
ddd
worry127722 Nov 19, 2014
88bf4a7
sss
worry127722 Nov 19, 2014
ef002ac
s
worry127722 Nov 19, 2014
bdb33f7
d
worry127722 Nov 19, 2014
7be7cad
d
worry127722 Nov 19, 2014
fd89776
d
worry127722 Nov 19, 2014
2998fe3
dd
worry127722 Nov 19, 2014
98e0f80
d
worry127722 Nov 19, 2014
70e685d
d
worry127722 Nov 19, 2014
39d0a32
d
worry127722 Nov 19, 2014
bbbf2c9
更新test
worry127722 Dec 3, 2014
bae2196
[test]安全修复
worry127722 Feb 9, 2015
2b9a0ae
[test]安全修复
worry127722 Feb 11, 2015
23f2712
修改说明
taofish Jan 14, 2016
3d1d644
Merge pull request #2519 from taofish/dev-1.5.0
Phinome Jan 22, 2016
a338f78
Merge pull request #2465 from fex-team/dev-1.5.0
Phinome Jan 22, 2016
83b0313
bug修复: 连续上传图片A和B,A处于上传状态(loading)时,再上传B,如果B先于A上传成功,编辑框内会出现两张B图片.
Mar 4, 2016
23457a5
Merge pull request #2632 from zoln/dev-1.4.4
Phinome Mar 9, 2016
714fa0f
修复多图上传时,图片显示顺序被打乱的问题.
Mar 15, 2016
a67244e
bug修复:删除一张不可用的图片时,图片张数和大小统计错误.
Mar 15, 2016
70505a1
Merge pull request #2659 from zoln/dev-1.4.4
Phinome Apr 6, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 11 additions & 16 deletions Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ module.exports = function (grunt) {
server = grunt.option('server') || 'php',
encode = grunt.option('encode') || 'utf8',
disDir = "dist/",
banner = '/*!\n * UEditor\n * version: ' + packageJson.name + '\n * build: <%= new Date() %>\n */\n\n';
banner = '/*!\n * ' + packageJson.name + '\n * version: ' + packageJson.version + '\n * build: <%= new Date() %>\n */\n\n';

//init
(function () {
Expand All @@ -59,7 +59,8 @@ module.exports = function (grunt) {
concat: {
js: {
options: {
banner: banner + '(function(){\n\n',
banner: '/*!\n * ' + packageJson.name + '\n * version: ' + packageJson.version + '\n * build: <%= new Date() %>\n */\n\n' +
'(function(){\n\n',
footer: '\n\n})();\n',
process: function (src, s) {
var filename = s.substr(s.indexOf('/') + 1);
Expand All @@ -71,7 +72,8 @@ module.exports = function (grunt) {
},
parse: {
options: {
banner: banner + '(function(){\n\n',
banner: '/*!\n * ' + packageJson.name + ' parse\n * version: ' + packageJson.version + '\n * build: <%= new Date() %>\n */\n\n' +
'(function(){\n\n',
footer: '\n\n})();\n'
},
src: Util.fetchScripts("ueditor.parse.js", Util.parseBasePath),
Expand All @@ -94,25 +96,18 @@ module.exports = function (grunt) {
ext: '.min.css'
}
},
uglify: {
options: {
banner: banner
},
dest: {
src: disDir + '<%= pkg.name %>.all.js',
dest: disDir + '<%= pkg.name %>.all.min.js'
},
parse: {
src: disDir + '<%= pkg.name %>.parse.js',
dest: disDir + '<%= pkg.name %>.parse.min.js'
}
},
closurecompiler: {
dist: {
options: {
banner: '/*!\n * ' + packageJson.name + '\n * version: ' + packageJson.version + '\n * build: <%= new Date() %>\n */'
},
src: disDir + '<%= pkg.name %>.all.js',
dest: disDir + '<%= pkg.name %>.all.min.js'
},
parse: {
options: {
banner: '/*!\n * ' + packageJson.name + ' parse\n * version: ' + packageJson.version + '\n * build: <%= new Date() %>\n */'
},
src: disDir + '<%= pkg.name %>.parse.js',
dest: disDir + '<%= pkg.name %>.parse.min.js'
}
Expand Down
26 changes: 13 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@ Get Started

UEditor是由百度web前端研发部开发所见即所得富文本web编辑器,具有轻量,可定制,注重用户体验等特点,开源基于MIT协议,允许自由使用和修改代码。

## 入门部署和体验 ##
## 1 入门部署和体验

### 第一步:下载编辑器 ###
### 1.1 下载编辑器

到官网下载ueditor最新版:[[官网地址]](http://ueditor.baidu.com/website/download.html#ueditor "官网下载地址")

### 第二步:创建demo文件 ###
### 1.2 创建demo文件
解压下载的包,在解压后的目录创建demo.html文件,填入下面的html代码

```html
Expand All @@ -36,13 +36,13 @@ UEditor是由百度web前端研发部开发所见即所得富文本web编辑器
</html>
```

### 第三步:在浏览器打开demo.html ###
### 1.3 在浏览器打开demo.html

如果看到了下面这样的编辑器,恭喜你,初次部署成功!

![部署成功](http://fex.baidu.com/ueditor/doc/images/demo.png)

### 自定义的参数
### 1.4 传入自定义的参数

编辑器有很多可自定义的参数项,在实例化的时候可以传入给编辑器:
```javascript
Expand All @@ -53,11 +53,12 @@ var ue = UE.getEditor('container', {

配置项也可以通过ueditor.config.js文件修改,具体的配置方法请看[前端配置项说明](http://fex.baidu.com/ueditor/#start-config1.4 前端配置项说明.md)

### 设置和读取编辑器的内容
### 1.5 设置和读取编辑器的内容

通getContent和setContent方法可以设置和读取编辑器的内容
```javascript
var ue = UE.getContent();
var ue = UE.getEditor();
//对编辑器的操作最好在编辑器ready之后再做
ue.ready(function(){
//设置编辑器的内容
ue.setContent('hello');
Expand All @@ -70,21 +71,20 @@ ue.ready(function(){

ueditor的更多API请看[API 文档](http://ueditor.baidu.com/doc "ueditor API 文档")

## 相关链接 ##
## 2 详细文档

ueditor 官网:[http://ueditor.baidu.com](http://ueditor.baidu.com "ueditor 官网")

ueditor API 文档:[http://ueditor.baidu.com/doc](http://ueditor.baidu.com/doc "ueditor API 文档")

ueditor github 地址:[http://github.com/fex-team/ueditor](http://github.com/fex-team/ueditor "ueditor github 地址")

## 详细文档
## 3 第三方贡献

ueditor 文档:[http://fex.baidu.com/ueditor/](http://fex.baidu.com/ueditor/)
ueditor for nodejs 参考[https://github.com/netpi/ueditor](https://github.com/netpi/ueditor)



## 联系我们 ##
## 4 联系我们

email:[[email protected]](mailto://email:[email protected] "发邮件给ueditor开发组")

issue:[github issue](http://github.com/fex-team/ueditor/issues "ueditor 论坛")
36 changes: 35 additions & 1 deletion _examples/addCustomizeButton.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,38 @@ UE.registerUI('button',function(editor,uiName){

//因为你是添加button,所以需要返回这个button
return btn;
}/*index 指定添加到工具栏上的那个位置,默认时追加到最后,editorId 指定这个UI是那个编辑器实例上的,默认是页面上所有的编辑器都会添加这个按钮*/);
}/*index 指定添加到工具栏上的那个位置,默认时追加到最后,editorId 指定这个UI是那个编辑器实例上的,默认是页面上所有的编辑器都会添加这个按钮*/);

//自定义引用样式例子
UE.registerUI('myblockquote',function(editor,uiName){
editor.registerCommand(uiName,{
execCommand:function(){
this.execCommand('blockquote',{
"style":"border-left: 3px solid #E5E6E1; margin-left: 0px; padding-left: 5px; line-height:36px;"
});
}
});

var btn = new UE.ui.Button({
name:uiName,
title:'自定义引用',
cssRules :"background-position: -220px 0;",
onclick:function () {
editor.execCommand(uiName);
}
});

editor.addListener('selectionchange', function () {
console.log(this);
var state = editor.queryCommandState('blockquote');
if (state == -1) {
btn.setDisabled(true);
btn.setChecked(false);
} else {
btn.setDisabled(false);
btn.setChecked(state);
}
});

return btn;
});
4 changes: 2 additions & 2 deletions _examples/customizeToolbarUIDemo.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@ <h1>二次开发demo</h1>
//建议使用工厂方法getEditor创建和引用编辑器实例,如果在某个闭包下引用该编辑器,直接调用UE.getEditor('editor')就能拿到相关的实例
UE.getEditor('editor',{
//清空了工具栏
toolbars:[[]]
})
toolbars:[['combox','bold','button','dialog']]
});

</script>
</html>
2 changes: 1 addition & 1 deletion _parse/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ UE.parse.register('list',function(utils){
customCss.push(selector +' .list-paddingleft-2{padding-left:'+ this.listDefaultPaddingLeft+'px}');
customCss.push(selector +' .list-paddingleft-3{padding-left:'+ this.listDefaultPaddingLeft*2+'px}');

utils.cssRule('list', selector +' ol,'+selector +' ul{margin:0;padding:0;}li{clear:both;}'+customCss.join('\n'), document);
utils.cssRule('list', selector +' ol,'+selector +' ul{margin:0;padding:0;}\n' + selector + ' li{clear:both;}\n'+customCss.join('\n'), document);
}
function applyStyle(nodes){
var T = this;
Expand Down
6 changes: 3 additions & 3 deletions _parse/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ UE.parse.register('table', function (utils) {
'background-position: center right; background-image:url(' + this.rootPath + 'themes/default/images/sortable.png);}' +
selector + ' table.sortEnabled tr.firstRow th:hover,' + selector + ' table.sortEnabled tr.firstRow td:hover{background-color: #EEE;}' +
selector + ' table{margin-bottom:10px;border-collapse:collapse;display:table;}' +
selector + ' td,' + selector + ' th{ background:white; padding: 5px 10px;border: 1px solid #DDD;}' +
selector + ' td,' + selector + ' th{padding: 5px 10px;border: 1px solid #DDD;}' +
selector + ' caption{border:1px dashed #DDD;border-bottom:0;padding:3px;text-align:center;}' +
selector + ' th{border-top:1px solid #BBB;background:#F7F7F7;}' +
selector + ' table tr.firstRow th{border-top:2px solid #BBB;background:#F7F7F7;}' +
selector + ' tr.ue-table-interlace-color-single td{ background: #fcfcfc; }' +
selector + ' tr.ue-table-interlace-color-double td{ background: #f7faff; }' +
selector + ' td p{margin:0;padding:0;}',
selector + ' td p{margin:0;padding:0;width:auto;height:auto;}',
document);
//填充空的单元格

Expand Down Expand Up @@ -158,4 +158,4 @@ UE.parse.register('table', function (utils) {
}
}
}
});
});
46 changes: 25 additions & 21 deletions _src/adapter/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,7 @@
var editor = this.editor;
var toolbars = this.toolbars || [];
var toolbarUis = [];
var extraUIs = [];
for (var i = 0; i < toolbars.length; i++) {
var toolbar = toolbars[i];
var toolbarUi = new baidu.editor.ui.Toolbar({theme:editor.options.theme});
Expand All @@ -342,21 +343,36 @@
if(toolbarItem == '||'){
toolbarItem = 'Breakline';
}
if (baidu.editor.ui[toolbarItem]) {
toolbarItemUi = new baidu.editor.ui[toolbarItem](editor);
var ui = baidu.editor.ui[toolbarItem];
if (ui) {
if(utils.isFunction(ui)){
toolbarItemUi = new baidu.editor.ui[toolbarItem](editor);
}else{
if(ui.id && ui.id != editor.key){
continue;
}
var itemUI = ui.execFn.call(editor,editor,toolbarItem);
if(itemUI){
if(ui.index === undefined){
toolbarUi.add(itemUI);
continue;
}else{
extraUIs.push({
index:ui.index,
itemUI:itemUI
})
}
}
}
}

//fullscreen这里单独处理一下,放到首行去
if (toolbarItem == 'fullscreen') {
if (toolbarUis && toolbarUis[0]) {
toolbarUis[0].items.splice(0, 0, toolbarItemUi);
} else {
toolbarItemUi && toolbarUi.items.splice(0, 0, toolbarItemUi);
}

continue;


}
} else {
toolbarItemUi = toolbarItem;
Expand All @@ -371,21 +387,9 @@

//接受外部定制的UI

utils.each(UE._customizeUI,function(obj,key){
var itemUI,index;
if(obj.id && obj.id != editor.key){
return false;
}
itemUI = obj.execFn.call(editor,editor,key);
if(itemUI){
index = obj.index;
if(index === undefined){
index = toolbarUi.items.length;
}
toolbarUi.add(itemUI,index)
}
utils.each(extraUIs,function(obj){
toolbarUi.add(obj.itemUI,obj.index)
});

this.toolbars = toolbarUis;
},
getHtmlTpl:function () {
Expand Down Expand Up @@ -846,7 +850,7 @@

UE.registerUI = function(uiName,fn,index,editorId){
utils.each(uiName.split(/\s+/), function (name) {
UE._customizeUI[name] = {
baidu.editor.ui[name] = {
id : editorId,
execFn:fn,
index:index
Expand Down
6 changes: 6 additions & 0 deletions _src/adapter/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ UE.registerUI('message', function(editor) {
var _messageItems = [];
var me = editor;

me.setOpt('enableMessageShow', true);
if (me.getOpt('enableMessageShow') === false) {
return;
}

me.addListener('ready', function(){
holder = document.getElementById(me.ui.id + '_message_holder');
updateHolderPos();
Expand Down Expand Up @@ -48,6 +53,7 @@ UE.registerUI('message', function(editor) {
});

function updateHolderPos(){
if (!holder || !me.ui) return;
var toolbarbox = me.ui.getDom('toolbarbox');
if (toolbarbox) {
holder.style.top = toolbarbox.offsetHeight + 3 + 'px';
Expand Down
14 changes: 10 additions & 4 deletions _src/core/Editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,8 @@
container.style.zIndex = options.zIndex;

var html = ( ie && browser.version < 9 ? '' : '<!DOCTYPE html>') +
'<html xmlns=\'http://www.w3.org/1999/xhtml\' class=\'view\' ><head>' +
'<html xmlns=\'http://www.w3.org/1999/xhtml\' class=\'view\' >' +
'<head>' +
'<style type=\'text/css\'>' +
//设置四周的留边
'.view{padding:0;word-wrap:break-word;cursor:text;height:90%;}\n' +
Expand All @@ -413,12 +414,17 @@
'body{margin:8px;font-family:sans-serif;font-size:16px;}' +
//设置段落间距
'p{margin:5px 0;}</style>' +
( options.iframeCssUrl ? '<link rel=\'stylesheet\' type=\'text/css\' href=\'' + utils.unhtml(options.iframeCssUrl) + '\'/>' : '' ) +
(options.iframeCssUrl ? '<link rel=\'stylesheet\' type=\'text/css\' href=\'' + utils.unhtml(options.iframeCssUrl) + '\'/>' : '' ) +
(options.initialStyle ? '<style>' + options.initialStyle + '</style>' : '') +
'</head><body class=\'view\' ></body>' +
'</head>' +
'<body class=\'view\' ></body>' +
'<script type=\'text/javascript\' ' + (ie ? 'defer=\'defer\'' : '' ) +' id=\'_initialScript\'>' +
'setTimeout(function(){editor = window.parent.UE.instants[\'ueditorInstant' + me.uid + '\'];editor._setup(document);},0);' +
'var _tmpScript = document.getElementById(\'_initialScript\');_tmpScript.parentNode.removeChild(_tmpScript);</script></html>';
'var _tmpScript = document.getElementById(\'_initialScript\');_tmpScript.parentNode.removeChild(_tmpScript);' +
'</script>' +
(options.iframeJsUrl ? ('<script type=\'text/javascript\' src=\'' + utils.unhtml(options.iframeJsUrl) + '\'></script>'):'') +
'</html>';

container.appendChild(domUtils.createElement(document, 'iframe', {
id: 'ueditor_' + me.uid,
width: "100%",
Expand Down
6 changes: 6 additions & 0 deletions _src/core/Range.js
Original file line number Diff line number Diff line change
Expand Up @@ -1281,6 +1281,12 @@
domUtils.setAttributes(elm, attrs);
}
elm.appendChild(frag);
//针对嵌套span的全局样式指定,做容错处理
if(elm.tagName == 'SPAN' && attrs && attrs.style){
utils.each(elm.getElementsByTagName('span'),function(s){
s.style.cssText = s.style.cssText + ';' + attrs.style;
})
}
range.insertNode(list ? top : elm);
//处理下滑线在a上的情况
var aNode;
Expand Down
2 changes: 1 addition & 1 deletion _src/core/browser.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ var browser = UE.browser = function(){
* }
* ```
*/
ie : /(msie\s|trident.*rv:)([\w.]+)/.test(agent),
ie : /(msie\s|trident.*rv:)([\w.]+)/i.test(agent),

/**
* @property {boolean} opera 检测当前浏览器是否为Opera
Expand Down
5 changes: 3 additions & 2 deletions _src/core/dtd.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ var dtd = dom.dtd = (function() {
D = X( {iframe:1}, C ),
E = _({hr:1,ul:1,menu:1,div:1,blockquote:1,noscript:1,table:1,center:1,address:1,dir:1,pre:1,h5:1,dl:1,h4:1,noframes:1,h6:1,ol:1,h1:1,h3:1,h2:1}),
F = _({ins:1,del:1,script:1,style:1}),
G = X( _({b:1,acronym:1,bdo:1,'var':1,'#':1,abbr:1,code:1,br:1,i:1,cite:1,kbd:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,dfn:1,span:1}), F ),
G = X( _({mark:1,b:1,acronym:1,bdo:1,'var':1,'#':1,abbr:1,code:1,br:1,i:1,cite:1,kbd:1,u:1,strike:1,s:1,tt:1,strong:1,q:1,samp:1,em:1,dfn:1,span:1}), F ),
H = X( _({sub:1,img:1,embed:1,object:1,sup:1,basefont:1,map:1,applet:1,font:1,big:1,small:1}), G ),
I = X( _({p:1}), H ),
J = X( _({iframe:1}), H, B ),
Expand Down Expand Up @@ -174,6 +174,7 @@ var dtd = dom.dtd = (function() {
pre : X( G, C ),
p : X(_({'a':1}),L),
em :L,
dfn : L
dfn : L,
mark:L
});
})();
Loading