Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
qq_14980201
ueditor
提交
f7960f2e
U
ueditor
项目概览
qq_14980201
/
ueditor
与 Fork 源项目一致
从无法访问的项目Fork
通知
3
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
U
ueditor
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
f7960f2e
编写于
12月 27, 2012
作者:
C
campaign
浏览文件
操作
浏览文件
下载
差异文件
Merge remote-tracking branch 'origin/dev-1.2.4' into dev-1.2.4
上级
7d28f3c4
6fb1bfe2
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
42 addition
and
47 deletion
+42
-47
_src/ui/editor.js
_src/ui/editor.js
+38
-46
_src/ui/pastepicker.js
_src/ui/pastepicker.js
+4
-1
未找到文件。
_src/ui/editor.js
浏览文件 @
f7960f2e
...
...
@@ -7,7 +7,7 @@
uiUtils
=
baidu
.
editor
.
ui
.
uiUtils
,
UIBase
=
baidu
.
editor
.
ui
.
UIBase
,
domUtils
=
baidu
.
editor
.
dom
.
domUtils
;
var
nodeStack
=
[];
var
nodeStack
=
[];
function
EditorUI
(
options
)
{
this
.
initOptions
(
options
);
...
...
@@ -49,11 +49,11 @@
}
editor
.
ui
.
_scale
();
if
(
editor
.
options
.
scaleEnabled
)
{
if
(
editor
.
autoHeightEnabled
)
{
if
(
editor
.
autoHeightEnabled
)
{
editor
.
disableAutoHeight
();
}
me
.
enableScale
();
}
else
{
}
else
{
me
.
disableScale
();
}
if
(
!
editor
.
options
.
elementPathEnabled
&&
!
editor
.
options
.
wordCount
&&
!
editor
.
options
.
scaleEnabled
)
{
...
...
@@ -70,59 +70,51 @@
editor
.
addListener
(
'
mousedown
'
,
function
(
t
,
evt
)
{
var
el
=
evt
.
target
||
evt
.
srcElement
;
baidu
.
editor
.
ui
.
Popup
.
postHide
(
evt
,
el
);
baidu
.
editor
.
ui
.
Popup
.
postHide
(
evt
,
el
);
});
editor
.
addListener
(
"
delcells
"
,
function
()
{
editor
.
addListener
(
"
delcells
"
,
function
()
{
if
(
UE
.
ui
[
'
edittip
'
])
{
new
UE
.
ui
[
'
edittip
'
](
editor
);
}
editor
.
getDialog
(
'
edittip
'
).
open
();
});
var
pastePop
=
null
,
isPaste
=
false
;
editor
.
addListener
(
"
afterpaste
"
,
function
(){
var
pastePop
,
isPaste
=
false
,
timer
;
editor
.
addListener
(
"
afterpaste
"
,
function
()
{
pastePop
=
new
baidu
.
editor
.
ui
.
Popup
({
content
:
new
baidu
.
editor
.
ui
.
PastePicker
({
editor
:
editor
}),
editor
:
editor
,
className
:
'
edui-wordpastepop
'
});
pastePop
.
render
();
isPaste
=
true
;
isPaste
=
true
;
});
var
timer
;
editor
.
addListener
(
"
afterinserthtml
"
,
function
(){
clearTimeout
(
timer
);
timer
=
setTimeout
(
function
(){
if
(
!
pastePop
)
return
;
if
(
!
isPaste
)
return
;
var
span
=
domUtils
.
createElement
(
editor
.
document
,
'
span
'
,{
'
style
'
:
"
line-height:0px;
"
,
'
innerHTML
'
:
'
\
ufeff
'
}),
range
=
editor
.
selection
.
getRange
(),
node
=
pastePop
.
getDom
();
if
(
!
node
)
return
;
range
.
insertNode
(
span
);
pastePop
.
showAnchor
(
span
);
node
.
style
.
top
=
node
.
offsetTop
+
"
px
"
;
domUtils
.
remove
(
span
);
isPaste
=
false
;
},
200
)
editor
.
addListener
(
"
afterinserthtml
"
,
function
()
{
clearTimeout
(
timer
);
timer
=
setTimeout
(
function
()
{
if
(
pastePop
&&
(
isPaste
||
editor
.
ui
.
_isTransfer
)){
var
span
=
domUtils
.
createElement
(
editor
.
document
,
'
span
'
,
{
'
style
'
:
"
line-height:0px;
"
,
'
innerHTML
'
:
'
\
ufeff
'
}),
range
=
editor
.
selection
.
getRange
();
range
.
insertNode
(
span
);
pastePop
.
showAnchor
(
span
);
domUtils
.
remove
(
span
);
delete
editor
.
ui
.
_isTransfer
;
isPaste
=
false
;
}
},
200
)
});
editor
.
addListener
(
'
contextmenu
'
,
function
(
t
,
evt
)
{
baidu
.
editor
.
ui
.
Popup
.
postHide
(
evt
);
});
editor
.
addListener
(
'
keydown
'
,
function
(
t
,
evt
)
{
if
(
pastePop
)
pastePop
.
dispose
(
evt
);
if
(
pastePop
)
pastePop
.
dispose
(
evt
);
});
editor
.
addListener
(
'
selectionchange
'
,
function
()
{
//if(!editor.selection.isFocus())return;
if
(
editor
.
options
.
elementPathEnabled
)
{
me
[(
editor
.
queryCommandState
(
'
elementpath
'
)
==
-
1
?
'
dis
'
:
'
en
'
)
+
'
ableElementPath
'
]()
}
...
...
@@ -375,8 +367,8 @@
var
bk
=
editor
.
selection
.
getRange
().
createBookmark
();
}
if
(
fullscreen
)
{
while
(
container
.
tagName
!=
"
BODY
"
)
{
var
position
=
baidu
.
editor
.
dom
.
domUtils
.
getComputedStyle
(
container
,
"
position
"
);
while
(
container
.
tagName
!=
"
BODY
"
)
{
var
position
=
baidu
.
editor
.
dom
.
domUtils
.
getComputedStyle
(
container
,
"
position
"
);
nodeStack
.
push
(
position
);
container
.
style
.
position
=
"
static
"
;
container
=
container
.
parentNode
;
...
...
@@ -396,7 +388,7 @@
this
.
_bakCssText1
=
this
.
getDom
(
'
iframeholder
'
).
style
.
cssText
;
this
.
_updateFullScreen
();
}
else
{
while
(
container
.
tagName
!=
"
BODY
"
)
{
while
(
container
.
tagName
!=
"
BODY
"
)
{
container
.
style
.
position
=
nodeStack
.
shift
();
container
=
container
.
parentNode
;
}
...
...
@@ -422,8 +414,8 @@
editor
.
selection
.
getRange
().
moveToBookmark
(
bk
).
select
(
true
);
baidu
.
editor
.
dom
.
domUtils
.
remove
(
input
);
fullscreen
&&
window
.
scroll
(
0
,
0
);
},
0
)
},
0
)
},
0
)
},
0
)
}
this
.
editor
.
fireEvent
(
'
fullscreenchanged
'
,
fullscreen
);
this
.
triggerLayout
();
...
...
@@ -519,18 +511,19 @@
domUtils
.
on
(
editorDocument
,
"
mouseup
"
,
up
);
domUtils
.
on
(
doc
,
"
mouseup
"
,
up
);
}
var
me
=
this
;
//by xuheng 全屏时关掉缩放
this
.
editor
.
addListener
(
'
fullscreenchanged
'
,
function
(
e
,
fullScreen
)
{
if
(
fullScreen
)
{
this
.
editor
.
addListener
(
'
fullscreenchanged
'
,
function
(
e
,
fullScreen
)
{
if
(
fullScreen
)
{
me
.
disableScale
();
}
else
{
if
(
me
.
editor
.
options
.
scaleEnabled
)
{
}
else
{
if
(
me
.
editor
.
options
.
scaleEnabled
)
{
me
.
enableScale
();
var
tmpNode
=
me
.
editor
.
document
.
createElement
(
'
span
'
);
me
.
editor
.
body
.
appendChild
(
tmpNode
);
me
.
editor
.
body
.
style
.
height
=
Math
.
max
(
domUtils
.
getXY
(
tmpNode
).
y
,
me
.
editor
.
iframe
.
offsetHeight
-
20
)
+
'
px
'
;
me
.
editor
.
body
.
style
.
height
=
Math
.
max
(
domUtils
.
getXY
(
tmpNode
).
y
,
me
.
editor
.
iframe
.
offsetHeight
-
20
)
+
'
px
'
;
domUtils
.
remove
(
tmpNode
)
}
}
...
...
@@ -577,7 +570,7 @@
this
.
enableScale
=
function
()
{
//trace:2868
if
(
editor
.
queryCommandState
(
"
source
"
)
==
1
)
return
;
if
(
editor
.
queryCommandState
(
"
source
"
)
==
1
)
return
;
scale
.
style
.
display
=
""
;
this
.
scaleEnabled
=
true
;
domUtils
.
on
(
scale
,
"
mousedown
"
,
down
);
...
...
@@ -654,7 +647,7 @@
var
oldRender
=
editor
.
render
;
editor
.
render
=
function
(
holder
)
{
if
(
holder
.
constructor
===
String
)
{
if
(
holder
.
constructor
===
String
)
{
editor
.
key
=
holder
;
instances
[
holder
]
=
editor
;
}
...
...
@@ -708,7 +701,6 @@
};
/**
* @file
* @name UE
...
...
_src/ui/pastepicker.js
浏览文件 @
f7960f2e
...
...
@@ -29,7 +29,8 @@
return
this
.
target
;
},
format
:
function
(
isTransfer
){
this
.
editor
.
fireEvent
(
'
pasteTransfer
'
,
isTransfer
)
this
.
editor
.
ui
.
_isTransfer
=
true
;
this
.
editor
.
fireEvent
(
'
pasteTransfer
'
,
isTransfer
);
},
_onClick
:
function
(
cur
){
var
node
=
domUtils
.
getNextDomNode
(
cur
),
...
...
@@ -39,6 +40,8 @@
if
(
/hidden/ig
.
test
(
domUtils
.
getComputedStyle
(
node
,
"
visibility
"
))){
if
((
subPop
.
top
+
subPop
.
height
)
>
screenHt
)
node
.
style
.
top
=
(
-
subPop
.
height
-
cur
.
offsetHeight
)
+
"
px
"
;
else
node
.
style
.
top
=
""
;
node
.
style
.
visibility
=
"
visible
"
;
domUtils
.
addClass
(
cur
,
"
edui-state-opened
"
);
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录