Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
weixin_42566577
o2oa
提交
0314daae
o2oa
项目概览
weixin_42566577
/
o2oa
与 Fork 源项目一致
Fork自
浙江兰德纵横网络技术股份有限公司 / o2oa
通知
1
Star
0
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,发现更多精彩内容 >>
提交
0314daae
编写于
12月 14, 2021
作者:
U
unknown
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
允许openWork传入只读参数,notice增加了过滤html的代码
上级
6aa691a9
变更
7
显示空白变更内容
内联
并排
Showing
7 changed file
with
18 addition
and
3 deletion
+18
-3
o2web/source/o2_lib/mootools/plugin/mBox-all.js
o2web/source/o2_lib/mootools/plugin/mBox-all.js
+4
-0
o2web/source/o2_lib/mootools/plugin/mBox-all.min.js
o2web/source/o2_lib/mootools/plugin/mBox-all.min.js
+1
-1
o2web/source/o2_lib/mootools/plugin/mBox.Notice.js
o2web/source/o2_lib/mootools/plugin/mBox.Notice.js
+4
-0
o2web/source/o2_lib/mootools/plugin/mBox.Notice.min.js
o2web/source/o2_lib/mootools/plugin/mBox.Notice.min.js
+1
-1
o2web/source/o2_lib/mootools/plugin/mBox.js
o2web/source/o2_lib/mootools/plugin/mBox.js
+4
-0
o2web/source/o2_lib/mootools/plugin/mBox.min.js
o2web/source/o2_lib/mootools/plugin/mBox.min.js
+1
-1
o2web/source/x_component_process_Work/Main.js
o2web/source/x_component_process_Work/Main.js
+3
-0
未找到文件。
o2web/source/o2_lib/mootools/plugin/mBox-all.js
浏览文件 @
0314daae
...
@@ -933,6 +933,10 @@ var mBox = new Class({
...
@@ -933,6 +933,10 @@ var mBox = new Class({
this
[
where
||
'
content
'
].
grab
(
$
(
content
)
||
$$
(
'
.
'
+
content
));
this
[
where
||
'
content
'
].
grab
(
$
(
content
)
||
$$
(
'
.
'
+
content
));
if
(
$
(
content
))
$
(
content
).
setStyle
(
'
display
'
,
''
);
if
(
$
(
content
))
$
(
content
).
setStyle
(
'
display
'
,
''
);
}
else
if
(
content
!=
null
)
{
}
else
if
(
content
!=
null
)
{
content
=
content
.
replace
(
/
(?:
<script
[\s\S]
*
?)(?:(?:
<
\/
script>
)
|
(?:\/
>
))
/gmi
,
''
)
content
=
content
.
replace
(
/<
[^
>
]
+/gmi
,
function
(
match
){
return
match
.
replace
(
/ on
\w
+=
[\"\'\S][^
"
]
*
[\"\'\S]
/gmi
,
''
).
replace
(
/javascript/gmi
,
''
);
});
this
[
where
||
'
content
'
].
set
(
'
html
'
,
content
);
this
[
where
||
'
content
'
].
set
(
'
html
'
,
content
);
}
}
}
}
...
...
o2web/source/o2_lib/mootools/plugin/mBox-all.min.js
浏览文件 @
0314daae
var
mBox
=
new
Class
({
Implements
:[
Options
,
Events
],
options
:{
id
:
""
,
theme
:
""
,
addClass
:{
wrapper
:
""
,
container
:
""
,
content
:
""
,
title
:
""
,
footer
:
""
},
setStyles
:{
wrapper
:{},
container
:{},
content
:{},
title
:{},
footer
:{}},
target
:
$
(
window
),
attach
:
null
,
event
:
"
click
"
,
preventDefault
:
!
1
,
width
:
"
auto
"
,
height
:
"
auto
"
,
zIndex
:
8
e3
,
content
:
null
,
setContent
:
"
data-setContent
"
,
load
:
null
,
url
:
""
,
reload
:
!
1
,
title
:
null
,
footer
:
null
,
draggable
:
!
1
,
position
:{
x
:
"
center
"
,
y
:
"
center
"
},
fixed
:
null
,
offset
:{
x
:
0
,
y
:
0
},
pointer
:
!
1
,
fade
:{
open
:
!
0
,
close
:
!
0
},
fadeDuration
:{
open
:
200
,
close
:
300
},
fadeWhenOpen
:
!
1
,
overlay
:
!
1
,
overlayStyles
:{
color
:
"
black
"
,
opacity
:.
75
},
overlayFadeDuration
:
100
,
transition
:{
open
:
null
,
close
:
null
},
closeOnEsc
:
!
0
,
closeOnClick
:
!
1
,
closeOnBoxClick
:
!
1
,
closeOnWrapperClick
:
!
1
,
closeOnBodyClick
:
!
0
,
closeOnMouseleave
:
!
1
,
closeInTitle
:
!
1
,
delayOpen
:
0
,
delayClose
:
0
,
delayOpenOnce
:
!
0
,
constructOnInit
:
!
0
,
openOnInit
:
!
1
},
initialize
:
function
(
t
){
this
.
block
=!
1
,
this
.
ignoreDelay
=!
1
,
this
.
ignoreDelayOnce
=!
1
,
this
.
setOptions
(
t
),
this
.
fixOptions
(),
this
.
getPosition
(),
this
.
target
=
this
.
getTarget
(),
null
==
this
.
options
.
fixed
&&
(
this
.
options
.
fixed
=
[
$
(
window
),
$
(
document
),
$
(
document
.
body
)].
contains
(
this
.
target
)),
"
mouse
"
==
this
.
target
&&
(
this
.
options
.
pointer
=!
1
),
this
.
targets
=
[],
this
.
id
=
this
.
options
.
id
||
"
mBox
"
+
++
mBox
.
currentId
,
this
.
addListeners
(),
this
.
options
.
constructOnInit
&&
this
.
construct
(),
this
.
fireEvent
(
"
init
"
).
fireEvent
(
"
systemInit
"
),
this
.
options
.
openOnInit
&&
this
.
open
(),
mBox
.
instances
.
push
(
this
)},
reInit
:
function
(){
this
.
addListeners
()},
fixOptions
:
function
(){
"
string
"
==
typeof
this
.
options
.
addClass
&&
(
this
.
options
.
addClass
=
{
wrapper
:
this
.
options
.
addClass
}),
"
object
"
!=
typeof
this
.
options
.
setStyles
||
this
.
options
.
setStyles
.
wrapper
||
this
.
options
.
setStyles
.
container
||
this
.
options
.
setStyles
.
content
||
this
.
options
.
setStyles
.
title
||
this
.
options
.
setStyles
.
footer
||
(
this
.
options
.
setStyles
=
{
wrapper
:
this
.
options
.
setStyles
}),
this
.
options
.
fade
=
{
open
:
this
.
options
.
fade
.
open
||
1
==
this
.
options
.
fade
,
close
:
this
.
options
.
fade
.
close
||
1
==
this
.
options
.
fade
},
this
.
options
.
fadeDuration
=
{
open
:
this
.
options
.
fadeDuration
.
open
||
this
.
options
.
fadeDuration
,
close
:
this
.
options
.
fadeDuration
.
close
||
this
.
options
.
fadeDuration
}},
construct
:
function
(){
if
(
this
.
wrapper
)
return
null
;
this
.
wrapper
=
new
Element
(
"
div
"
,{
id
:
this
.
id
,
class
:
"
mBox
"
+
(
this
.
defaultTheme
||
"
Core
"
)
+
(
this
.
options
.
theme
?
"
-
"
+
this
.
options
.
theme
:
""
)
+
"
"
+
(
this
.
options
.
addClass
.
wrapper
||
""
),
styles
:{
zIndex
:
this
.
options
.
zIndex
,
position
:
0
==
this
.
options
.
fixed
||
Browser
.
ie6
||
Browser
.
ie7
?
"
absolute
"
:
"
fixed
"
,
display
:
"
none
"
,
opacity
:
1
e
-
5
,
top
:
-
12
e3
,
left
:
-
12
e3
,
zoom
:
1
}}).
setStyles
(
this
.
options
.
setStyles
.
wrapper
||
{});
var
t
=
$
(
t
)
||
t
||
this
.
target
||
$
(
this
.
options
.
target
)
||
this
.
options
.
target
||
$
(
this
.
options
.
attach
);
t
&&
"
element
"
===
typeOf
(
t
)?
this
.
wrapper
.
inject
(
t
,
"
after
"
):
this
.
wrapper
.
inject
(
document
.
body
,
"
bottom
"
),
this
.
options
.
closeOnMouseleave
&&
this
.
wrapper
.
addEvents
({
mouseenter
:
function
(
t
){
this
.
open
()}.
bind
(
this
),
mouseleave
:
function
(
t
){
this
.
close
()}.
bind
(
this
)}),
this
.
container
=
new
Element
(
"
div
"
,{
class
:
"
mBoxContainer
"
+
(
this
.
options
.
addClass
.
container
||
""
)}).
setStyles
(
this
.
options
.
setStyles
.
container
||
{}).
inject
(
this
.
wrapper
),
this
.
content
=
new
Element
(
"
div
"
,{
class
:
"
mBoxContent
"
+
(
this
.
options
.
addClass
.
content
||
""
),
styles
:{
width
:
this
.
options
.
width
,
height
:
this
.
options
.
height
}}).
setStyles
(
this
.
options
.
setStyles
.
content
||
{}).
inject
(
this
.
container
),
this
.
load
(
this
.
options
.
content
,
this
.
options
.
title
,
this
.
options
.
footer
,
!
0
),
this
.
fireEvent
(
"
systemBoxReady
"
).
fireEvent
(
"
boxReady
"
)},
addListeners
:
function
(
t
){
if
(
t
=
t
||
this
.
options
.
attach
,
elements
=
Array
.
from
(
$
(
t
)).
combine
(
Array
.
from
(
$$
(
"
.
"
+
t
))).
combine
(
Array
.
from
(
$$
(
t
))).
clean
(),
!
elements
||
0
==
elements
.
length
)
return
this
;
switch
(
this
.
targets
.
combine
(
elements
),
this
.
options
.
event
){
case
"
mouseenter
"
:
case
"
mouseover
"
:
var
e
=
{
mouseenter
:
function
(
t
){
this
.
target
=
this
.
getTargetFromEvent
(
t
),
this
.
source
=
this
.
getTargetElementFromEvent
(
t
),
this
.
open
()}.
bind
(
this
),
mouseleave
:
function
(
t
){
this
.
close
()}.
bind
(
this
)};
break
;
default
:
e
=
{
click
:
function
(
t
){
this
.
options
.
preventDefault
&&
t
.
preventDefault
(),
this
.
isOpen
?
this
.
close
():(
this
.
target
=
this
.
getTargetFromEvent
(
t
),
this
.
source
=
this
.
getTargetElementFromEvent
(
t
),
this
.
open
())}.
bind
(
this
)}}
$$
(
elements
).
each
(
function
(
t
){
t
.
retrieve
(
"
mBoxElementEventsAdded
"
+
this
.
id
)
||
t
.
addEvents
(
e
).
store
(
"
mBoxElementEventsAdded
"
+
this
.
id
,
!
0
)}.
bind
(
this
))},
loadAjax
:
function
(
t
){
this
.
ajaxRequest
||
(
this
.
ajaxRequest
=
new
Request
.
HTML
({
link
:
"
cancel
"
,
update
:
this
.
content
,
onRequest
:
function
(){
this
.
setContent
(
""
),
this
.
wrapper
.
addClass
(
"
mBoxLoading
"
)}.
bind
(
this
),
onComplete
:
function
(){
this
.
wrapper
.
removeClass
(
"
mBoxLoading
"
),
"
auto
"
!=
this
.
options
.
width
&&
"
auto
"
!=
this
.
options
.
height
||
this
.
setPosition
(),
this
.
fireEvent
(
"
ajaxComplete
"
)}.
bind
(
this
)}).
send
()),
this
.
ajaxRequest
.
send
(
t
),
this
.
ajaxLoaded
=!
0
},
open
:
function
(
r
){
if
(
this
.
wrapper
||
this
.
construct
(),
"
object
"
!=
typeof
r
&&
(
r
=
{}),
clearTimeout
(
this
.
timer
),
!
this
.
isOpen
&&!
this
.
block
){
var
t
=
function
(){
this
.
ignoreDelayOnce
=!
1
,
this
.
fireEvent
(
"
systemOpenComplete
"
).
fireEvent
(
"
openComplete
"
)}.
bind
(
this
),
e
=
function
(
t
){
if
(
this
.
isOpen
=!
0
,
"
ajax
"
!=
this
.
options
.
load
||!
this
.
options
.
url
||
this
.
ajaxLoaded
&&!
this
.
options
.
reload
||
this
.
loadAjax
({
url
:
this
.
options
.
url
}),
this
.
target
=
this
.
getTarget
(
r
.
target
||
null
),
this
.
options
.
setContent
&&
this
.
source
&&
this
.
source
.
getAttribute
(
this
.
options
.
setContent
))
if
(
$
(
this
.
source
.
getAttribute
(
this
.
options
.
setContent
)))
this
.
content
.
getChildren
().
setStyle
(
"
display
"
,
"
none
"
),
$
(
this
.
source
.
getAttribute
(
this
.
options
.
setContent
)).
setStyle
(
"
display
"
,
""
);
else
{
var
e
=
this
.
source
.
getAttribute
(
this
.
options
.
setContent
).
split
(
"
|
"
),
i
=
e
[
0
]
||
null
,
o
=
e
[
1
]
||
null
,
n
=
e
[
2
]
||
null
;
this
.
load
(
i
,
o
,
n
)}
this
.
wrapper
&&
this
.
wrapper
.
inject
(
document
.
body
,
"
bottom
"
),
this
.
setPosition
(
null
,
r
.
position
||
null
,
r
.
offset
||
null
),
this
.
fireEvent
(
"
systemOpen
"
).
fireEvent
(
"
open
"
),
this
.
fx
&&
this
.
fx
.
cancel
(),
this
.
wrapper
.
setStyles
({
display
:
""
}),
this
.
options
.
fadeWhenOpen
&&
this
.
wrapper
.
setStyle
(
"
opacity
"
,
0
),
this
.
fx
=
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
"
opacity
"
,
duration
:
this
.
options
.
fadeDuration
.
open
,
link
:
"
cancel
"
,
onComplete
:
t
})[
r
.
instant
||!
this
.
options
.
fade
.
open
?
"
set
"
:
"
start
"
](
1
),
!
r
.
instant
&&
this
.
options
.
fade
.
open
||
t
();
var
s
=
this
.
getTransition
();
s
.
open
&&
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
s
.
open
.
property
||
"
top
"
,
duration
:
s
.
open
.
duration
||
this
.
options
.
fadeDuration
.
open
,
transition
:
s
.
open
.
transition
||
null
,
onStart
:
s
.
open
.
onStart
||
null
,
onComplete
:
s
.
open
.
onComplete
||
null
}).
start
(
s
.
open
.
start
||
this
.
wrapper
.
getStyle
(
s
.
open
.
property
||
"
top
"
).
toInt
()
+
(
s
.
open
.
difference_start
||
0
),
s
.
open
.
end
||
this
.
wrapper
.
getStyle
(
s
.
open
.
property
||
"
top
"
).
toInt
()
+
(
s
.
open
.
difference_end
||
0
));
this
.
attachEvents
(),
this
.
options
.
overlay
&&
this
.
addOverlay
(
r
.
instant
||!
this
.
options
.
fade
.
open
),
this
.
options
.
delayOpenOnce
&&
(
this
.
delayOpenOnce
=!
0
)}.
bind
(
this
);
0
<
this
.
options
.
delayOpen
&&!
this
.
ignoreDelay
&&!
this
.
ignoreDelayOnce
&&!
this
.
delayOpenOnce
?
this
.
timer
=
e
.
delay
(
this
.
options
.
delayOpen
,
this
,
t
):
e
(
t
)}
return
this
},
close
:
function
(
i
){
if
(
"
object
"
!=
typeof
i
&&
(
i
=
{}),
clearTimeout
(
this
.
timer
),
this
.
isOpen
&&!
this
.
block
){
var
t
=
function
(){
if
(
this
.
delayOpenOnce
=!
1
,
this
.
ignoreDelayOnce
=!
1
,
this
.
wrapper
.
setStyle
(
"
display
"
,
"
none
"
),
this
.
fireEvent
(
"
systemCloseComplete
"
).
fireEvent
(
"
closeComplete
"
),
this
.
wrapper
){
var
t
=
this
.
target
||
$
(
this
.
options
.
target
)
||
this
.
options
.
target
||
$
(
this
.
options
.
attach
);
t
&&
"
element
"
===
typeOf
(
t
)
&&
this
.
wrapper
.
inject
(
t
)}}.
bind
(
this
),
e
=
function
(
t
){
this
.
isOpen
=!
1
,
this
.
fireEvent
(
"
systemClose
"
).
fireEvent
(
"
close
"
),
this
.
detachEvents
(),
this
.
options
.
overlay
&&
this
.
removeOverlay
(
i
.
instant
||!
this
.
options
.
fade
.
close
),
this
.
fx
&&
this
.
fx
.
cancel
(),
this
.
fx
=
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
"
opacity
"
,
duration
:
this
.
options
.
fadeDuration
.
close
,
link
:
"
cancel
"
,
onComplete
:
t
})[
i
.
instant
||!
this
.
options
.
fade
.
close
?
"
set
"
:
"
start
"
](
0
),
!
i
.
instant
&&
this
.
options
.
fade
.
close
||
t
();
var
e
=
this
.
getTransition
();
e
.
close
&&
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
e
.
close
.
property
||
"
top
"
,
duration
:
e
.
close
.
duration
||
this
.
options
.
fadeDuration
.
close
,
transition
:
e
.
close
.
transition
||
null
,
onStart
:
e
.
open
.
onStart
||
null
,
onComplete
:
e
.
open
.
onComplete
||
null
}).
start
(
e
.
close
.
start
||
this
.
wrapper
.
getStyle
(
e
.
close
.
property
||
"
top
"
).
toInt
()
+
(
e
.
close
.
difference_start
||
0
),
e
.
close
.
end
||
this
.
wrapper
.
getStyle
(
e
.
close
.
property
||
"
top
"
).
toInt
()
+
(
e
.
close
.
difference_end
||
0
))}.
bind
(
this
);
0
<
this
.
options
.
delayClose
&&!
this
.
ignoreDelay
&&!
this
.
ignoreDelayOnce
?
this
.
timer
=
e
.
delay
(
this
.
options
.
delayClose
,
this
,
t
):
e
(
t
)}
return
this
},
addOverlay
:
function
(
t
){
return
this
.
overlay
||
(
this
.
overlay
=
new
Element
(
"
div
"
,{
styles
:{
position
:
"
fixed
"
,
top
:
0
,
left
:
0
,
width
:
"
100%
"
,
height
:
"
100%
"
,
zIndex
:
this
.
wrapper
.
getStyle
(
"
zIndex
"
)
-
1
,
background
:
this
.
options
.
overlayStyles
.
color
||
"
white
"
,
opacity
:.
001
,
display
:
"
none
"
}}).
set
(
"
tween
"
,{
duration
:
this
.
options
.
overlayFadeDuration
,
link
:
"
cancel
"
}).
inject
(
$
(
document
.
body
),
"
bottom
"
)),
this
.
overlay
.
setStyle
(
"
display
"
,
"
block
"
)[
t
?
"
set
"
:
"
tween
"
](
"
opacity
"
,
this
.
options
.
overlayStyles
.
opacity
||
.
001
),
this
},
removeOverlay
:
function
(
t
){
return
this
.
overlay
&&
this
.
overlay
[
t
?
"
set
"
:
"
tween
"
](
"
opacity
"
,
0
).
get
(
"
tween
"
).
chain
(
function
(){
this
.
overlay
.
setStyle
(
"
display
"
,
"
none
"
)}.
bind
(
this
)),
this
},
getTarget
:
function
(
t
){
return
"
mouse
"
==
(
t
=
$
(
t
)
||
t
||
this
.
target
||
$
(
this
.
options
.
target
)
||
this
.
options
.
target
||
$
(
this
.
options
.
attach
))?
"
mouse
"
:
this
.
fixOperaPositioning
(
$
(
t
))},
getTargetFromEvent
:
function
(
t
){
return
this
.
options
.
target
?
this
.
fixOperaPositioning
(
$
(
this
.
options
.
target
)):
this
.
getTargetElementFromEvent
(
t
)},
getTargetElementFromEvent
:
function
(
t
){
if
(
t
&&
t
.
target
){
if
(
this
.
targets
.
contains
(
t
.
target
))
return
this
.
fixOperaPositioning
(
t
.
target
);
for
(
var
e
=
t
.
target
.
getParent
();
null
!=
e
;){
if
(
this
.
targets
.
contains
(
e
))
return
this
.
fixOperaPositioning
(
e
);
e
=
e
.
getParent
()}}
return
null
},
fixOperaPositioning
:
function
(
t
){
if
(
$
(
t
)
&&!
$
(
t
).
retrieve
(
"
OperaBugFixed
"
)
&&
t
!=
window
){
try
{
$
(
t
).
getStyle
(
"
border-top-width
"
).
toInt
()
+
$
(
t
).
getStyle
(
"
border-right-width
"
).
toInt
()
+
$
(
t
).
getStyle
(
"
border-bottom-width
"
).
toInt
()
+
$
(
t
).
getStyle
(
"
border-left-width
"
).
toInt
()
||
$
(
t
).
setStyle
(
"
border
"
,
0
)}
catch
(
t
){}
$
(
t
).
store
(
"
OperaBugFixed
"
)}
return
t
},
getPosition
:
function
(
t
){
return
!
t
&&
this
.
position
||
(
t
=
t
||
this
.
options
.
position
,
this
.
position
=
{},
this
.
position
.
x
=
"
object
"
==
typeof
t
&&
"
number
"
==
typeof
t
.
x
?[
t
.
x
.
toInt
(),
null
]:
"
object
"
!=
typeof
t
||!
t
.
x
||
"
center
"
==
t
.
x
||
"
object
"
==
typeof
t
.
x
&&
"
center
"
==
t
.
x
[
0
]?[
"
center
"
,
null
]:[
"
right
"
,
"
left
"
].
contains
(
t
.
x
)?[
t
.
x
,
this
.
defaultInOut
||
"
inside
"
]:
"
object
"
==
typeof
t
.
x
&&
[
"
right
"
,
"
left
"
].
contains
(
t
.
x
[
0
])?[
t
.
x
[
0
],[
"
inside
"
,
"
center
"
,
"
outside
"
].
contains
(
t
.
x
[
1
])?
t
.
x
[
1
]:
this
.
defaultInOut
||
"
inside
"
]:[
"
center
"
,
null
],
this
.
position
.
xAttribute
=
"
right
"
==
this
.
position
.
x
[
3
]
||
"
inside
"
==
this
.
position
.
x
[
1
]
&&
"
right
"
==
this
.
position
.
x
[
0
]?
"
right
"
:
"
left
"
,
this
.
position
.
y
=
"
object
"
==
typeof
t
&&
"
number
"
==
typeof
t
.
y
?[
t
.
y
.
toInt
(),
null
]:
"
object
"
!=
typeof
t
||!
t
.
y
||
"
center
"
==
t
.
y
||
"
object
"
==
typeof
t
.
y
&&
"
center
"
==
t
.
y
[
0
]?[
"
center
"
,
null
]:[
"
top
"
,
"
bottom
"
].
contains
(
t
.
y
)?[
t
.
y
,
this
.
defaultInOut
||
"
inside
"
]:
"
object
"
==
typeof
t
.
y
&&
[
"
top
"
,
"
bottom
"
].
contains
(
t
.
y
[
0
])?[
t
.
y
[
0
],[
"
inside
"
,
"
center
"
,
"
outside
"
].
contains
(
t
.
y
[
1
])?
t
.
y
[
1
]:
this
.
defaultInOut
||
"
inside
"
]:[
"
center
"
,
null
],
this
.
position
.
yAttribute
=
"
bottom
"
==
this
.
position
.
x
[
3
]
||
"
inside
"
==
this
.
position
.
y
[
1
]
&&
"
bottom
"
==
this
.
position
.
y
[
0
]?
"
bottom
"
:
"
top
"
),
this
.
position
},
getOffset
:
function
(
t
){
return
!
t
&&
this
.
offset
||
(
t
=
t
||
this
.
options
.
offset
,
this
.
offset
=
{},
this
.
offset
.
x
=
"
number
"
==
typeof
t
?
t
:
t
.
x
&&
(
0
<=
t
.
x
.
toInt
()
||
t
.
x
.
toInt
()
<
0
)?
t
.
x
.
toInt
():
0
,
this
.
offset
.
y
=
"
number
"
==
typeof
t
?
t
:
t
.
y
&&
(
0
<=
t
.
y
.
toInt
()
||
t
.
y
.
toInt
()
<
0
)?
t
.
y
.
toInt
():
0
),
this
.
offset
},
getPointer
:
function
(
t
){
if
(
!
t
&&
this
.
pointer
)
return
this
.
pointer
;
if
(
!
(
t
=
t
||
this
.
options
.
pointer
))
return
!
1
;
var
e
=
this
.
getPosition
();
if
(
this
.
pointer
=
{},
"
outside
"
==
e
.
y
[
1
])
this
.
pointer
.
position
=
"
bottom
"
==
e
.
y
[
0
]?
"
top
"
:
"
bottom
"
,
this
.
pointer
.
adjustment
=
"
object
"
==
typeof
t
&&
[
"
center
"
,
"
right
"
,
"
left
"
].
contains
(
t
[
0
])?
t
[
0
]:[
"
center
"
,
"
right
"
,
"
left
"
].
contains
(
t
)?
t
:
"
center
"
;
else
{
if
(
"
outside
"
!=
e
.
x
[
1
])
return
null
;
this
.
pointer
.
position
=
"
left
"
==
e
.
x
[
0
]?
"
right
"
:
"
left
"
,
this
.
pointer
.
adjustment
=
"
object
"
==
typeof
t
&&
[
"
center
"
,
"
top
"
,
"
bottom
"
].
contains
(
t
[
0
])?
t
[
0
]:[
"
center
"
,
"
top
"
,
"
bottom
"
].
contains
(
t
)?
t
:
"
center
"
}
return
this
.
pointer
.
offset
=
"
object
"
==
typeof
t
&&
t
[
1
]
&&
"
number
"
==
typeof
t
[
1
].
toInt
()?
t
[
1
].
toInt
():
0
,
this
.
pointer
.
offset
=
this
.
pointer
.
offset
<
0
?
-
1
*
this
.
pointer
.
offset
:
this
.
pointer
.
offset
,
this
.
pointer
.
offset
=
"
right
"
==
this
.
pointer
.
adjustment
||
"
bottom
"
==
this
.
pointer
.
adjustment
?
-
1
*
this
.
pointer
.
offset
:
this
.
pointer
.
offset
,
this
.
pointer
},
getTransition
:
function
(){
if
(
this
.
transition
)
return
this
.
transition
;
if
(
this
.
options
.
transition
&&
[
"
flyin
"
,
"
flyout
"
,
"
flyinout
"
,
"
flyoutin
"
,
"
bounce
"
,
"
bouncein
"
,
"
bounceout
"
,
"
bounceinout
"
,
"
bouncefly
"
].
contains
(
this
.
options
.
transition
)){
this
.
transition
=
{},
this
.
transition
.
open
=
{
property
:
"
top
"
==
this
.
position
.
yAttribute
||
"
bottom
"
==
this
.
position
.
yAttribute
?
this
.
position
.
yAttribute
:
this
.
position
.
xAttribute
,
transition
:
"
quad:out
"
,
duration
:
300
},
this
.
transition
.
close
=
Object
.
clone
(
this
.
transition
.
open
);
var
t
=
20
*
(
"
bottom
"
==
this
.
position
.
yAttribute
||
"
right
"
==
this
.
position
.
xAttribute
?
-
1
:
1
);
switch
(
this
.
options
.
transition
){
case
"
flyin
"
:
case
"
flyout
"
:
this
.
transition
.
open
.
difference_start
=
this
.
transition
.
close
.
difference_end
=
t
*
(
"
flyin
"
==
this
.
options
.
transition
?
-
1
:
1
);
break
;
case
"
flyinout
"
:
case
"
flyoutin
"
:
t
*=
"
flyinout
"
==
this
.
options
.
transition
?
1
:
-
1
,
this
.
transition
.
open
.
difference_start
=-
1
*
t
,
this
.
transition
.
close
.
difference_end
=
t
;
break
;
case
"
bounce
"
:
case
"
bouncefly
"
:
case
"
bouncein
"
:
case
"
bounceout
"
:
case
"
bounceinout
"
:
this
.
transition
.
open
.
transition
=
"
bounce:out
"
,
this
.
transition
.
open
.
duration
=
450
,
this
.
transition
.
open
.
difference_start
=-
1
*
t
,
"
bounceinout
"
!=
this
.
options
.
transition
&&
"
bounceout
"
!=
this
.
options
.
transition
&&
"
bouncefly
"
!=
this
.
options
.
transition
||
(
this
.
transition
.
close
.
difference_end
=-
1
*
t
)}}
else
this
.
transition
=
{},
this
.
transition
.
open
=
null
!=
typeof
this
.
options
.
transition
.
open
?
this
.
options
.
transition
.
open
:
this
.
options
.
transition
,
this
.
transition
.
close
=
null
!=
typeof
this
.
options
.
transition
.
close
?
this
.
options
.
transition
.
close
:
this
.
options
.
transition
;
return
this
.
transition
},
setPosition
:
function
(
t
,
e
,
i
){
if
(
t
=
this
.
getTarget
(
t
),
e
=
this
.
getPosition
(
e
),
i
=
this
.
getOffset
(
i
),
pointer
=
this
.
getPointer
(),
"
mouse
"
==
t
)
return
r
=
(
this
.
mouseX
||
0
)
+
15
+
i
.
x
,
h
=
(
this
.
mouseY
||
0
)
+
15
+
i
.
y
,
this
.
wrapper
.
setStyles
({
left
:
Math
.
floor
(
r
),
top
:
Math
.
floor
(
h
)}),
this
;
if
(
!
t
||
[
$
(
window
),
$
(
document
),
$
(
document
.
body
)].
contains
(
t
)){
var
o
=
"
fixed
"
==
this
.
wrapper
.
getStyle
(
"
position
"
)?{
x
:
0
,
y
:
0
}:
$
(
window
).
getScroll
();(
s
=
$
(
window
).
getSize
()).
width
=
s
.
totalWidth
=
s
.
x
,
s
.
height
=
s
.
totalHeight
=
s
.
y
;
var
n
=
{
top
:
o
.
y
,
left
:
o
.
x
,
right
:
o
.
x
+
s
.
width
,
bottom
:
o
.
y
+
s
.
height
}}
else
{
1
!=!
this
.
options
.
fixed
&&
this
.
wrapper
.
setStyle
(
"
position
"
,
"
absolute
"
);
var
s
=
t
.
getDimensions
({
computeSize
:
!
0
});
n
=
t
.
getCoordinates
();
0
==
s
.
totalWidth
&&
(
s
.
width
=
s
.
totalWidth
=
n
.
width
,
s
.
height
=
s
.
totalHeight
=
n
.
height
)}
var
r
=
n
.
left
||
0
,
h
=
n
.
top
||
0
,
a
=
this
.
wrapper
.
getDimensions
({
computeSize
:
!
0
});
if
(
pointer
&&!
this
.
pointerElement
){
if
(
this
.
pointerElement
=
new
Element
(
"
div
"
,{
class
:
"
mBoxPointer mBoxPointer
"
+
pointer
.
position
.
capitalize
(),
styles
:{
position
:
"
absolute
"
}}).
setStyle
(
pointer
.
position
,
0
).
inject
(
this
.
wrapper
,
"
top
"
),
Browser
.
opera
){
var
p
=
new
Element
(
"
div
"
,{
class
:
"
mBox
"
+
(
this
.
defaultTheme
||
"
Core
"
)
+
(
this
.
options
.
theme
?
"
-
"
+
this
.
options
.
theme
:
""
)}).
inject
(
document
.
body
).
grab
(
this
.
pointerElement
);
this
.
pointerDimensions
=
this
.
pointerElement
.
getDimensions
({
computeSize
:
!
0
}),
this
.
pointerElement
.
inject
(
this
.
wrapper
,
"
top
"
),
p
.
destroy
()}
else
this
.
pointerDimensions
=
this
.
pointerElement
.
getDimensions
({
computeSize
:
!
0
});
this
.
container
.
setStyle
(
"
margin-
"
+
pointer
.
position
,
"
left
"
==
pointer
.
position
||
"
right
"
==
pointer
.
position
?
this
.
pointerDimensions
.
width
-
this
.
container
.
getStyle
(
"
border-
"
+
pointer
.
position
).
toInt
():
this
.
pointerDimensions
.
height
-
this
.
container
.
getStyle
(
"
border-
"
+
pointer
.
position
).
toInt
())}
if
(
pointer
&&
this
.
pointerElement
){
if
(
"
outside
"
==
e
.
x
[
1
]
&&
"
outside
"
==
e
.
y
[
1
]
&&
"
center
"
==
pointer
.
adjustment
)
switch
(
pointer
.
adjustment
=
"
left
"
==
e
.
x
[
0
]?
"
right
"
:
"
left
"
,
e
.
x
[
0
]){
case
"
left
"
:
r
+=
a
.
totalWidth
-
this
.
pointerDimensions
.
width
/
2
;
break
;
case
"
right
"
:
r
-=
this
.
pointerDimensions
.
width
/
2
}
var
l
=
0
,
c
=
0
,
d
=
0
;
switch
(
pointer
.
adjustment
){
case
"
center
"
:
l
=
"
top
"
==
pointer
.
position
||
"
bottom
"
==
pointer
.
position
?
a
.
totalWidth
/
2
-
this
.
pointerDimensions
.
width
/
2
:
a
.
totalHeight
/
2
-
this
.
pointerDimensions
.
height
/
2
;
break
;
case
"
left
"
:
case
"
right
"
:
switch
(
e
.
x
[
1
]){
case
"
inside
"
:
c
+=
this
.
pointerDimensions
.
width
/
2
*-
1
+
(
"
right
"
==
e
.
x
[
0
]?
a
.
totalWidth
:
0
);
break
;
default
:
"
center
"
==
e
.
x
[
0
]
&&
(
c
+=
a
.
totalWidth
/
2
-
this
.
pointerDimensions
.
width
/
2
)}
r
+=
c
-
(
"
right
"
==
pointer
.
adjustment
?
a
.
totalWidth
-
this
.
pointerDimensions
.
width
:
0
),
l
=
"
right
"
==
pointer
.
adjustment
?
a
.
totalWidth
-
this
.
pointerDimensions
.
width
:
0
;
break
;
case
"
top
"
:
case
"
bottom
"
:
switch
(
e
.
y
[
1
]){
case
"
inside
"
:
d
+=
this
.
pointerDimensions
.
height
/
2
*-
1
+
(
"
bottom
"
==
e
.
y
[
0
]?
a
.
totalHeight
:
0
);
break
;
default
:
"
center
"
==
e
.
y
[
0
]
&&
(
d
+=
a
.
totalHeight
/
2
-
this
.
pointerDimensions
.
height
/
2
)}
h
+=
d
-
(
"
bottom
"
==
pointer
.
adjustment
?
a
.
totalHeight
-
this
.
pointerDimensions
.
height
:
0
),
l
=
"
bottom
"
==
pointer
.
adjustment
?
a
.
totalHeight
-
this
.
pointerDimensions
.
height
:
0
}
switch
(
pointer
.
position
){
case
"
top
"
:
case
"
bottom
"
:
r
+=-
1
*
pointer
.
offset
;
break
;
case
"
left
"
:
case
"
right
"
:
h
+=-
1
*
pointer
.
offset
}
this
.
pointerElement
.
setStyle
(
"
top
"
==
pointer
.
position
||
"
bottom
"
==
pointer
.
position
?
"
left
"
:
"
top
"
,
l
+
pointer
.
offset
)}
switch
(
a
=
this
.
wrapper
.
getDimensions
({
computeSize
:
!
0
}),
e
.
x
[
0
]){
case
"
center
"
:
r
+=
s
.
totalWidth
/
2
-
a
.
totalWidth
/
2
;
break
;
case
"
right
"
:
r
+=
s
.
totalWidth
-
(
"
inside
"
==
e
.
x
[
1
]?
a
.
totalWidth
:
"
center
"
==
e
.
x
[
1
]?
a
.
totalWidth
/
2
:
0
);
break
;
case
"
left
"
:
r
-=
"
outside
"
==
e
.
x
[
1
]?
a
.
totalWidth
:
"
center
"
==
e
.
x
[
1
]?
a
.
totalWidth
/
2
:
0
;
break
;
default
:
r
=
e
.
x
}
switch
(
e
.
y
[
0
]){
case
"
center
"
:
h
+=
s
.
totalHeight
/
2
-
a
.
totalHeight
/
2
;
break
;
case
"
bottom
"
:
h
+=
s
.
totalHeight
-
(
"
inside
"
==
e
.
y
[
1
]?
a
.
totalHeight
:
"
center
"
==
e
.
y
[
1
]?
a
.
totalHeight
/
2
:
0
);
break
;
case
"
top
"
:
h
-=
"
outside
"
==
e
.
y
[
1
]?
a
.
totalHeight
:
"
center
"
==
e
.
y
[
1
]?
a
.
totalHeight
/
2
:
0
;
break
;
default
:
r
=
e
.
y
}
this
.
wrapper
.
setStyles
({
top
:
null
,
right
:
null
,
bottom
:
null
,
left
:
null
});
var
u
=
$
(
window
).
getSize
();
return
"
right
"
==
e
.
xAttribute
&&
(
r
=
u
.
x
-
(
r
+
a
.
totalWidth
)),
"
bottom
"
==
e
.
yAttribute
&&
(
h
=
u
.
y
-
(
h
+
a
.
totalHeight
)),
r
=
r
||
0
,
r
+=
i
.
x
,
h
+=
i
.
y
,
this
.
wrapper
.
setStyle
(
e
.
xAttribute
,
r
.
floor
()),
this
.
wrapper
.
setStyle
(
e
.
yAttribute
,
h
.
floor
()),
this
},
setContent
:
function
(
t
,
e
){
return
null
!=
t
&&
(
$
(
t
)
||
0
<
$$
(
"
.
"
+
t
).
length
?(
this
[
e
||
"
content
"
].
grab
(
$
(
t
)
||
$$
(
"
.
"
+
t
)),
$
(
t
)
&&
$
(
t
).
setStyle
(
"
display
"
,
""
)):
null
!=
t
&&
this
[
e
||
"
content
"
].
set
(
"
html
"
,
t
)),
this
},
setTitle
:
function
(
t
){
return
null
==
t
||
this
.
titleContainer
||
(
this
.
titleContainer
=
new
Element
(
"
div
"
,{
class
:
"
mBoxTitleContainer
"
}).
inject
(
this
.
container
,
"
top
"
),
this
.
title
=
new
Element
(
"
div
"
,{
class
:
"
mBoxTitle
"
+
(
this
.
options
.
addClass
.
title
||
""
),
styles
:
this
.
options
.
setStyles
.
title
||
{}}).
inject
(
this
.
titleContainer
),
this
.
wrapper
.
addClass
(
"
hasTitle
"
),
this
.
options
.
draggable
&&
null
!=
window
.
Drag
&&
(
new
Drag
(
this
.
wrapper
,{
handle
:
this
.
titleContainer
}),
this
.
titleContainer
.
addClass
(
"
mBoxDraggable
"
)),
this
.
options
.
closeInTitle
&&
new
Element
(
"
div
"
,{
class
:
"
mBoxClose
"
,
events
:{
click
:
function
(){
this
.
close
()}.
bind
(
this
)}}).
grab
(
new
Element
(
"
div
"
)).
inject
(
this
.
titleContainer
)),
null
!=
t
&&
this
.
setContent
(
t
,
"
title
"
),
this
},
setFooter
:
function
(
t
){
return
null
==
t
||
this
.
footerContainer
||
(
this
.
footerContainer
=
new
Element
(
"
div
"
,{
class
:
"
mBoxFooterContainer
"
}).
inject
(
this
.
container
,
"
bottom
"
),
this
.
footer
=
new
Element
(
"
div
"
,{
class
:
"
mBoxFooter
"
+
(
this
.
options
.
addClass
.
footer
||
""
),
styles
:
this
.
options
.
setStyles
.
footer
||
{}}).
inject
(
this
.
footerContainer
),
this
.
wrapper
.
addClass
(
"
hasFooter
"
)),
null
!=
t
&&
this
.
setContent
(
t
,
"
footer
"
),
this
},
load
:
function
(
t
,
e
,
i
){
return
this
.
setContent
(
t
),
this
.
setTitle
(
e
),
this
.
setFooter
(
i
),
this
},
getHTML
:
function
(
t
,
e
,
i
){
return
this
.
load
(
t
,
e
,
i
),
"
<div>
"
+
this
.
wrapper
.
get
(
"
html
"
)
+
"
</div>
"
},
attachEvents
:
function
(){
this
.
escEvent
=
function
(
t
){
"
esc
"
==
t
.
key
&&
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnEsc
&&
$
(
window
).
addEvent
(
"
keyup
"
,
this
.
escEvent
),
this
.
resizeEvent
=
function
(
t
){
this
.
setPosition
()}.
bind
(
this
),
$
(
window
).
addEvent
(
"
resize
"
,
this
.
resizeEvent
),
this
.
options
.
fixed
&&
(
Browser
.
ie6
||
Browser
.
ie7
)
&&
$
(
window
).
addEvent
(
"
scroll
"
,
this
.
resizeEvent
),
this
.
closeOnClickEvent
=
function
(
t
){
this
.
isOpen
&&
$
(
this
.
options
.
attach
)
!=
t
.
target
&&!
$$
(
"
.
"
+
this
.
options
.
attach
).
contains
(
t
.
target
)
&&
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnClick
&&
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnClickEvent
),
this
.
closeOnBoxClickEvent
=
function
(
t
){
this
.
isOpen
&&
(
this
.
wrapper
==
t
.
target
||
this
.
wrapper
.
contains
(
t
.
target
))
&&
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnBoxClick
&&
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnBoxClickEvent
),
this
.
closeOnWrapperClickEvent
=
function
(
t
){
this
.
isOpen
&&
this
.
wrapper
==
t
.
target
&&
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnWrapperClick
&&
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnWrapperClickEvent
),
this
.
closeOnBodyClickEvent
=
function
(
t
){
!
this
.
isOpen
||
$
(
this
.
options
.
attach
)
==
t
.
target
||
$$
(
"
.
"
+
this
.
options
.
attach
).
contains
(
t
.
target
)
||
t
.
target
==
this
.
wrapper
||
this
.
wrapper
.
contains
(
t
.
target
)
||
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnBodyClick
&&
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnBodyClickEvent
),
this
.
mouseMoveEvent
=
function
(
t
){
this
.
mouseX
=
t
.
page
.
x
,
this
.
mouseY
=
t
.
page
.
y
,
this
.
setPosition
(
"
mouse
"
)}.
bind
(
this
),
"
mouse
"
==
this
.
target
&&
$
(
document
).
addEvent
(
"
mousemove
"
,
this
.
mouseMoveEvent
)},
detachEvents
:
function
(){
this
.
options
.
fixed
&&
(
Browser
.
ie6
||
Browser
.
ie7
)
&&
$
(
window
).
removeEvent
(
"
scroll
"
,
this
.
resizeEvent
),
$
(
window
).
removeEvent
(
"
keyup
"
,
this
.
keyEvent
),
$
(
window
).
removeEvent
(
"
resize
"
,
this
.
resizeEvent
),
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnClickEvent
),
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnBoxClickEvent
),
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnWrapperClickEvent
),
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnBodyClickEvent
),
$
(
document
).
removeEvent
(
"
mousemove
"
,
this
.
mouseMoveEvent
)},
destroy
:
function
(){
mBox
.
instances
.
erase
(
this
),
this
.
detachEvents
(),
this
.
wrapper
.
dispose
(),
delete
this
.
wrapper
}});
mBox
.
instances
=
[],
mBox
.
currentId
=
0
,
mBox
.
reInit
=
function
(){
mBox
.
addConfirmEvents
&&
mBox
.
addConfirmEvents
(),
mBox
.
instances
.
each
(
function
(
t
){
try
{
t
.
reInit
()}
catch
(
t
){}})},
mBox
.
Notice
=
new
Class
({
Extends
:
mBox
,
options
:{
type
:
"
Default
"
,
position
:{
x
:[
"
left
"
,
"
inside
"
],
y
:[
"
bottom
"
,
"
inside
"
]},
offset
:{
x
:
30
,
y
:
30
},
fixed
:
!
0
,
move
:
!
0
,
moveDuration
:
500
,
delayClose
:
4
e3
,
fade
:
!
0
,
fadeDuration
:{
open
:
250
,
close
:
400
},
target
:
$
(
window
),
zIndex
:
1
e6
,
closeOnEsc
:
!
1
,
closeOnBoxClick
:
!
0
,
closeOnBodyClick
:
!
1
,
openOnInit
:
!
0
},
initialize
:
function
(
t
){
this
.
defaultInOut
=
"
inside
"
,
this
.
defaultTheme
=
"
Notice
"
,
t
.
onSystemBoxReady
=
function
(){
if
(
this
.
container
.
addClass
(
"
mBoxNotice
"
+
(
this
.
options
.
type
.
capitalize
()
||
"
Default
"
)),
this
.
options
.
move
&&
(
"
inside
"
==
this
.
position
.
x
[
1
]
||
"
center
"
==
this
.
position
.
x
[
0
])
&&
"
inside
"
==
this
.
position
.
y
[
1
]
&&
(
"
top
"
==
this
.
position
.
y
[
0
]
||
"
bottom
"
==
this
.
position
.
y
[
0
])){
var
t
=
this
.
wrapper
.
getDimensions
({
computeSize
:
!
0
});
this
.
container
.
setStyle
(
"
position
"
,
"
absolute
"
),
this
.
container
.
setStyle
(
"
top
"
==
this
.
position
.
y
[
0
]?
"
bottom
"
:
"
top
"
,
0
),
this
.
wrapper
.
setStyles
({
height
:
0
,
width
:
t
.
totalWidth
,
overflowY
:
"
hidden
"
}),
this
.
options
.
transition
=
{
open
:{
transition
:
"
linear
"
,
property
:
"
height
"
,
duration
:
this
.
options
.
moveDuration
,
start
:
0
,
end
:
t
.
totalHeight
+
this
.
options
.
offset
.
y
}},
this
.
options
.
offset
.
y
=
0
,
this
.
options
.
delayClose
+=
this
.
options
.
moveDuration
}},
t
.
onSystemOpen
=
function
(){
$
(
window
).
retrieve
(
"
mBoxNotice
"
)
&&
(
$
(
window
).
retrieve
(
"
mBoxNotice
"
).
ignoreDelay
=!
0
,
$
(
window
).
retrieve
(
"
mBoxNotice
"
).
close
()),
$
(
window
).
store
(
"
mBoxNotice
"
,
this
)},
t
.
onSystemOpenComplete
=
function
(){
this
.
close
()},
t
.
onSystemCloseComplete
=
function
(){
this
.
destroy
()},
this
.
parent
(
t
)}}),
mBox
.
Tooltip
=
new
Class
({
Extends
:
mBox
,
options
:{
target
:
null
,
event
:
"
mouseenter
"
,
position
:{
x
:[
"
center
"
],
y
:[
"
top
"
,
"
outside
"
]},
pointer
:
"
center
"
,
fixed
:
!
1
,
delayOpenOnce
:
!
0
},
initialize
:
function
(
t
){
this
.
defaultInOut
=
"
outside
"
,
this
.
defaultTheme
=
"
Tooltip
"
,
this
.
parent
(
t
)}});
var
mBox
=
new
Class
({
Implements
:[
Options
,
Events
],
options
:{
id
:
""
,
theme
:
""
,
addClass
:{
wrapper
:
""
,
container
:
""
,
content
:
""
,
title
:
""
,
footer
:
""
},
setStyles
:{
wrapper
:{},
container
:{},
content
:{},
title
:{},
footer
:{}},
target
:
$
(
window
),
attach
:
null
,
event
:
"
click
"
,
preventDefault
:
!
1
,
width
:
"
auto
"
,
height
:
"
auto
"
,
zIndex
:
8
e3
,
content
:
null
,
setContent
:
"
data-setContent
"
,
load
:
null
,
url
:
""
,
reload
:
!
1
,
title
:
null
,
footer
:
null
,
draggable
:
!
1
,
position
:{
x
:
"
center
"
,
y
:
"
center
"
},
fixed
:
null
,
offset
:{
x
:
0
,
y
:
0
},
pointer
:
!
1
,
fade
:{
open
:
!
0
,
close
:
!
0
},
fadeDuration
:{
open
:
200
,
close
:
300
},
fadeWhenOpen
:
!
1
,
overlay
:
!
1
,
overlayStyles
:{
color
:
"
black
"
,
opacity
:.
75
},
overlayFadeDuration
:
100
,
transition
:{
open
:
null
,
close
:
null
},
closeOnEsc
:
!
0
,
closeOnClick
:
!
1
,
closeOnBoxClick
:
!
1
,
closeOnWrapperClick
:
!
1
,
closeOnBodyClick
:
!
0
,
closeOnMouseleave
:
!
1
,
closeInTitle
:
!
1
,
delayOpen
:
0
,
delayClose
:
0
,
delayOpenOnce
:
!
0
,
constructOnInit
:
!
0
,
openOnInit
:
!
1
},
initialize
:
function
(
t
){
this
.
block
=!
1
,
this
.
ignoreDelay
=!
1
,
this
.
ignoreDelayOnce
=!
1
,
this
.
setOptions
(
t
),
this
.
fixOptions
(),
this
.
getPosition
(),
this
.
target
=
this
.
getTarget
(),
null
==
this
.
options
.
fixed
&&
(
this
.
options
.
fixed
=
[
$
(
window
),
$
(
document
),
$
(
document
.
body
)].
contains
(
this
.
target
)),
"
mouse
"
==
this
.
target
&&
(
this
.
options
.
pointer
=!
1
),
this
.
targets
=
[],
this
.
id
=
this
.
options
.
id
||
"
mBox
"
+
++
mBox
.
currentId
,
this
.
addListeners
(),
this
.
options
.
constructOnInit
&&
this
.
construct
(),
this
.
fireEvent
(
"
init
"
).
fireEvent
(
"
systemInit
"
),
this
.
options
.
openOnInit
&&
this
.
open
(),
mBox
.
instances
.
push
(
this
)},
reInit
:
function
(){
this
.
addListeners
()},
fixOptions
:
function
(){
"
string
"
==
typeof
this
.
options
.
addClass
&&
(
this
.
options
.
addClass
=
{
wrapper
:
this
.
options
.
addClass
}),
"
object
"
!=
typeof
this
.
options
.
setStyles
||
this
.
options
.
setStyles
.
wrapper
||
this
.
options
.
setStyles
.
container
||
this
.
options
.
setStyles
.
content
||
this
.
options
.
setStyles
.
title
||
this
.
options
.
setStyles
.
footer
||
(
this
.
options
.
setStyles
=
{
wrapper
:
this
.
options
.
setStyles
}),
this
.
options
.
fade
=
{
open
:
this
.
options
.
fade
.
open
||
1
==
this
.
options
.
fade
,
close
:
this
.
options
.
fade
.
close
||
1
==
this
.
options
.
fade
},
this
.
options
.
fadeDuration
=
{
open
:
this
.
options
.
fadeDuration
.
open
||
this
.
options
.
fadeDuration
,
close
:
this
.
options
.
fadeDuration
.
close
||
this
.
options
.
fadeDuration
}},
construct
:
function
(){
if
(
this
.
wrapper
)
return
null
;
this
.
wrapper
=
new
Element
(
"
div
"
,{
id
:
this
.
id
,
class
:
"
mBox
"
+
(
this
.
defaultTheme
||
"
Core
"
)
+
(
this
.
options
.
theme
?
"
-
"
+
this
.
options
.
theme
:
""
)
+
"
"
+
(
this
.
options
.
addClass
.
wrapper
||
""
),
styles
:{
zIndex
:
this
.
options
.
zIndex
,
position
:
0
==
this
.
options
.
fixed
||
Browser
.
ie6
||
Browser
.
ie7
?
"
absolute
"
:
"
fixed
"
,
display
:
"
none
"
,
opacity
:
1
e
-
5
,
top
:
-
12
e3
,
left
:
-
12
e3
,
zoom
:
1
}}).
setStyles
(
this
.
options
.
setStyles
.
wrapper
||
{});
var
t
=
$
(
t
)
||
t
||
this
.
target
||
$
(
this
.
options
.
target
)
||
this
.
options
.
target
||
$
(
this
.
options
.
attach
);
t
&&
"
element
"
===
typeOf
(
t
)?
this
.
wrapper
.
inject
(
t
,
"
after
"
):
this
.
wrapper
.
inject
(
document
.
body
,
"
bottom
"
),
this
.
options
.
closeOnMouseleave
&&
this
.
wrapper
.
addEvents
({
mouseenter
:
function
(
t
){
this
.
open
()}.
bind
(
this
),
mouseleave
:
function
(
t
){
this
.
close
()}.
bind
(
this
)}),
this
.
container
=
new
Element
(
"
div
"
,{
class
:
"
mBoxContainer
"
+
(
this
.
options
.
addClass
.
container
||
""
)}).
setStyles
(
this
.
options
.
setStyles
.
container
||
{}).
inject
(
this
.
wrapper
),
this
.
content
=
new
Element
(
"
div
"
,{
class
:
"
mBoxContent
"
+
(
this
.
options
.
addClass
.
content
||
""
),
styles
:{
width
:
this
.
options
.
width
,
height
:
this
.
options
.
height
}}).
setStyles
(
this
.
options
.
setStyles
.
content
||
{}).
inject
(
this
.
container
),
this
.
load
(
this
.
options
.
content
,
this
.
options
.
title
,
this
.
options
.
footer
,
!
0
),
this
.
fireEvent
(
"
systemBoxReady
"
).
fireEvent
(
"
boxReady
"
)},
addListeners
:
function
(
t
){
if
(
t
=
t
||
this
.
options
.
attach
,
elements
=
Array
.
from
(
$
(
t
)).
combine
(
Array
.
from
(
$$
(
"
.
"
+
t
))).
combine
(
Array
.
from
(
$$
(
t
))).
clean
(),
!
elements
||
0
==
elements
.
length
)
return
this
;
switch
(
this
.
targets
.
combine
(
elements
),
this
.
options
.
event
){
case
"
mouseenter
"
:
case
"
mouseover
"
:
var
e
=
{
mouseenter
:
function
(
t
){
this
.
target
=
this
.
getTargetFromEvent
(
t
),
this
.
source
=
this
.
getTargetElementFromEvent
(
t
),
this
.
open
()}.
bind
(
this
),
mouseleave
:
function
(
t
){
this
.
close
()}.
bind
(
this
)};
break
;
default
:
e
=
{
click
:
function
(
t
){
this
.
options
.
preventDefault
&&
t
.
preventDefault
(),
this
.
isOpen
?
this
.
close
():(
this
.
target
=
this
.
getTargetFromEvent
(
t
),
this
.
source
=
this
.
getTargetElementFromEvent
(
t
),
this
.
open
())}.
bind
(
this
)}}
$$
(
elements
).
each
(
function
(
t
){
t
.
retrieve
(
"
mBoxElementEventsAdded
"
+
this
.
id
)
||
t
.
addEvents
(
e
).
store
(
"
mBoxElementEventsAdded
"
+
this
.
id
,
!
0
)}.
bind
(
this
))},
loadAjax
:
function
(
t
){
this
.
ajaxRequest
||
(
this
.
ajaxRequest
=
new
Request
.
HTML
({
link
:
"
cancel
"
,
update
:
this
.
content
,
onRequest
:
function
(){
this
.
setContent
(
""
),
this
.
wrapper
.
addClass
(
"
mBoxLoading
"
)}.
bind
(
this
),
onComplete
:
function
(){
this
.
wrapper
.
removeClass
(
"
mBoxLoading
"
),
"
auto
"
!=
this
.
options
.
width
&&
"
auto
"
!=
this
.
options
.
height
||
this
.
setPosition
(),
this
.
fireEvent
(
"
ajaxComplete
"
)}.
bind
(
this
)}).
send
()),
this
.
ajaxRequest
.
send
(
t
),
this
.
ajaxLoaded
=!
0
},
open
:
function
(
t
){
if
(
this
.
wrapper
||
this
.
construct
(),
"
object
"
!=
typeof
t
&&
(
t
=
{}),
clearTimeout
(
this
.
timer
),
!
this
.
isOpen
&&!
this
.
block
){
var
e
=
function
(){
this
.
ignoreDelayOnce
=!
1
,
this
.
fireEvent
(
"
systemOpenComplete
"
).
fireEvent
(
"
openComplete
"
)}.
bind
(
this
),
i
=
function
(
e
){
if
(
this
.
isOpen
=!
0
,
"
ajax
"
!=
this
.
options
.
load
||!
this
.
options
.
url
||
this
.
ajaxLoaded
&&!
this
.
options
.
reload
||
this
.
loadAjax
({
url
:
this
.
options
.
url
}),
this
.
target
=
this
.
getTarget
(
t
.
target
||
null
),
this
.
options
.
setContent
&&
this
.
source
&&
this
.
source
.
getAttribute
(
this
.
options
.
setContent
))
if
(
$
(
this
.
source
.
getAttribute
(
this
.
options
.
setContent
)))
this
.
content
.
getChildren
().
setStyle
(
"
display
"
,
"
none
"
),
$
(
this
.
source
.
getAttribute
(
this
.
options
.
setContent
)).
setStyle
(
"
display
"
,
""
);
else
{
var
i
=
this
.
source
.
getAttribute
(
this
.
options
.
setContent
).
split
(
"
|
"
),
o
=
i
[
0
]
||
null
,
n
=
i
[
1
]
||
null
,
s
=
i
[
2
]
||
null
;
this
.
load
(
o
,
n
,
s
)}
this
.
wrapper
&&
this
.
wrapper
.
inject
(
document
.
body
,
"
bottom
"
),
this
.
setPosition
(
null
,
t
.
position
||
null
,
t
.
offset
||
null
),
this
.
fireEvent
(
"
systemOpen
"
).
fireEvent
(
"
open
"
),
this
.
fx
&&
this
.
fx
.
cancel
(),
this
.
wrapper
.
setStyles
({
display
:
""
}),
this
.
options
.
fadeWhenOpen
&&
this
.
wrapper
.
setStyle
(
"
opacity
"
,
0
),
this
.
fx
=
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
"
opacity
"
,
duration
:
this
.
options
.
fadeDuration
.
open
,
link
:
"
cancel
"
,
onComplete
:
e
})[
t
.
instant
||!
this
.
options
.
fade
.
open
?
"
set
"
:
"
start
"
](
1
),
!
t
.
instant
&&
this
.
options
.
fade
.
open
||
e
();
var
r
=
this
.
getTransition
();
r
.
open
&&
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
r
.
open
.
property
||
"
top
"
,
duration
:
r
.
open
.
duration
||
this
.
options
.
fadeDuration
.
open
,
transition
:
r
.
open
.
transition
||
null
,
onStart
:
r
.
open
.
onStart
||
null
,
onComplete
:
r
.
open
.
onComplete
||
null
}).
start
(
r
.
open
.
start
||
this
.
wrapper
.
getStyle
(
r
.
open
.
property
||
"
top
"
).
toInt
()
+
(
r
.
open
.
difference_start
||
0
),
r
.
open
.
end
||
this
.
wrapper
.
getStyle
(
r
.
open
.
property
||
"
top
"
).
toInt
()
+
(
r
.
open
.
difference_end
||
0
));
this
.
attachEvents
(),
this
.
options
.
overlay
&&
this
.
addOverlay
(
t
.
instant
||!
this
.
options
.
fade
.
open
),
this
.
options
.
delayOpenOnce
&&
(
this
.
delayOpenOnce
=!
0
)}.
bind
(
this
);
this
.
options
.
delayOpen
>
0
&&!
this
.
ignoreDelay
&&!
this
.
ignoreDelayOnce
&&!
this
.
delayOpenOnce
?
this
.
timer
=
i
.
delay
(
this
.
options
.
delayOpen
,
this
,
e
):
i
(
e
)}
return
this
},
close
:
function
(
t
){
if
(
"
object
"
!=
typeof
t
&&
(
t
=
{}),
clearTimeout
(
this
.
timer
),
this
.
isOpen
&&!
this
.
block
){
var
e
=
function
(){
if
(
this
.
delayOpenOnce
=!
1
,
this
.
ignoreDelayOnce
=!
1
,
this
.
wrapper
.
setStyle
(
"
display
"
,
"
none
"
),
this
.
fireEvent
(
"
systemCloseComplete
"
).
fireEvent
(
"
closeComplete
"
),
this
.
wrapper
){
var
t
=
this
.
target
||
$
(
this
.
options
.
target
)
||
this
.
options
.
target
||
$
(
this
.
options
.
attach
);
t
&&
"
element
"
===
typeOf
(
t
)
&&
this
.
wrapper
.
inject
(
t
)}}.
bind
(
this
),
i
=
function
(
e
){
this
.
isOpen
=!
1
,
this
.
fireEvent
(
"
systemClose
"
).
fireEvent
(
"
close
"
),
this
.
detachEvents
(),
this
.
options
.
overlay
&&
this
.
removeOverlay
(
t
.
instant
||!
this
.
options
.
fade
.
close
),
this
.
fx
&&
this
.
fx
.
cancel
(),
this
.
fx
=
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
"
opacity
"
,
duration
:
this
.
options
.
fadeDuration
.
close
,
link
:
"
cancel
"
,
onComplete
:
e
})[
t
.
instant
||!
this
.
options
.
fade
.
close
?
"
set
"
:
"
start
"
](
0
),
!
t
.
instant
&&
this
.
options
.
fade
.
close
||
e
();
var
i
=
this
.
getTransition
();
i
.
close
&&
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
i
.
close
.
property
||
"
top
"
,
duration
:
i
.
close
.
duration
||
this
.
options
.
fadeDuration
.
close
,
transition
:
i
.
close
.
transition
||
null
,
onStart
:
i
.
open
.
onStart
||
null
,
onComplete
:
i
.
open
.
onComplete
||
null
}).
start
(
i
.
close
.
start
||
this
.
wrapper
.
getStyle
(
i
.
close
.
property
||
"
top
"
).
toInt
()
+
(
i
.
close
.
difference_start
||
0
),
i
.
close
.
end
||
this
.
wrapper
.
getStyle
(
i
.
close
.
property
||
"
top
"
).
toInt
()
+
(
i
.
close
.
difference_end
||
0
))}.
bind
(
this
);
this
.
options
.
delayClose
>
0
&&!
this
.
ignoreDelay
&&!
this
.
ignoreDelayOnce
?
this
.
timer
=
i
.
delay
(
this
.
options
.
delayClose
,
this
,
e
):
i
(
e
)}
return
this
},
addOverlay
:
function
(
t
){
return
this
.
overlay
||
(
this
.
overlay
=
new
Element
(
"
div
"
,{
styles
:{
position
:
"
fixed
"
,
top
:
0
,
left
:
0
,
width
:
"
100%
"
,
height
:
"
100%
"
,
zIndex
:
this
.
wrapper
.
getStyle
(
"
zIndex
"
)
-
1
,
background
:
this
.
options
.
overlayStyles
.
color
||
"
white
"
,
opacity
:.
001
,
display
:
"
none
"
}}).
set
(
"
tween
"
,{
duration
:
this
.
options
.
overlayFadeDuration
,
link
:
"
cancel
"
}).
inject
(
$
(
document
.
body
),
"
bottom
"
)),
this
.
overlay
.
setStyle
(
"
display
"
,
"
block
"
)[
t
?
"
set
"
:
"
tween
"
](
"
opacity
"
,
this
.
options
.
overlayStyles
.
opacity
||
.
001
),
this
},
removeOverlay
:
function
(
t
){
return
this
.
overlay
&&
this
.
overlay
[
t
?
"
set
"
:
"
tween
"
](
"
opacity
"
,
0
).
get
(
"
tween
"
).
chain
(
function
(){
this
.
overlay
.
setStyle
(
"
display
"
,
"
none
"
)}.
bind
(
this
)),
this
},
getTarget
:
function
(
t
){
return
"
mouse
"
==
(
t
=
$
(
t
)
||
t
||
this
.
target
||
$
(
this
.
options
.
target
)
||
this
.
options
.
target
||
$
(
this
.
options
.
attach
))?
"
mouse
"
:
this
.
fixOperaPositioning
(
$
(
t
))},
getTargetFromEvent
:
function
(
t
){
return
this
.
options
.
target
?
this
.
fixOperaPositioning
(
$
(
this
.
options
.
target
)):
this
.
getTargetElementFromEvent
(
t
)},
getTargetElementFromEvent
:
function
(
t
){
if
(
t
&&
t
.
target
){
if
(
this
.
targets
.
contains
(
t
.
target
))
return
this
.
fixOperaPositioning
(
t
.
target
);
for
(
var
e
=
t
.
target
.
getParent
();
null
!=
e
;){
if
(
this
.
targets
.
contains
(
e
))
return
this
.
fixOperaPositioning
(
e
);
e
=
e
.
getParent
()}}
return
null
},
fixOperaPositioning
:
function
(
t
){
if
(
$
(
t
)
&&!
$
(
t
).
retrieve
(
"
OperaBugFixed
"
)
&&
t
!=
window
){
try
{
$
(
t
).
getStyle
(
"
border-top-width
"
).
toInt
()
+
$
(
t
).
getStyle
(
"
border-right-width
"
).
toInt
()
+
$
(
t
).
getStyle
(
"
border-bottom-width
"
).
toInt
()
+
$
(
t
).
getStyle
(
"
border-left-width
"
).
toInt
()
||
$
(
t
).
setStyle
(
"
border
"
,
0
)}
catch
(
t
){}
$
(
t
).
store
(
"
OperaBugFixed
"
)}
return
t
},
getPosition
:
function
(
t
){
return
!
t
&&
this
.
position
||
(
t
=
t
||
this
.
options
.
position
,
this
.
position
=
{},
this
.
position
.
x
=
"
object
"
==
typeof
t
&&
"
number
"
==
typeof
t
.
x
?[
t
.
x
.
toInt
(),
null
]:
"
object
"
!=
typeof
t
||!
t
.
x
||
"
center
"
==
t
.
x
||
"
object
"
==
typeof
t
.
x
&&
"
center
"
==
t
.
x
[
0
]?[
"
center
"
,
null
]:[
"
right
"
,
"
left
"
].
contains
(
t
.
x
)?[
t
.
x
,
this
.
defaultInOut
||
"
inside
"
]:
"
object
"
==
typeof
t
.
x
&&
[
"
right
"
,
"
left
"
].
contains
(
t
.
x
[
0
])?[
t
.
x
[
0
],[
"
inside
"
,
"
center
"
,
"
outside
"
].
contains
(
t
.
x
[
1
])?
t
.
x
[
1
]:
this
.
defaultInOut
||
"
inside
"
]:[
"
center
"
,
null
],
this
.
position
.
xAttribute
=
"
right
"
==
this
.
position
.
x
[
3
]
||
"
inside
"
==
this
.
position
.
x
[
1
]
&&
"
right
"
==
this
.
position
.
x
[
0
]?
"
right
"
:
"
left
"
,
this
.
position
.
y
=
"
object
"
==
typeof
t
&&
"
number
"
==
typeof
t
.
y
?[
t
.
y
.
toInt
(),
null
]:
"
object
"
!=
typeof
t
||!
t
.
y
||
"
center
"
==
t
.
y
||
"
object
"
==
typeof
t
.
y
&&
"
center
"
==
t
.
y
[
0
]?[
"
center
"
,
null
]:[
"
top
"
,
"
bottom
"
].
contains
(
t
.
y
)?[
t
.
y
,
this
.
defaultInOut
||
"
inside
"
]:
"
object
"
==
typeof
t
.
y
&&
[
"
top
"
,
"
bottom
"
].
contains
(
t
.
y
[
0
])?[
t
.
y
[
0
],[
"
inside
"
,
"
center
"
,
"
outside
"
].
contains
(
t
.
y
[
1
])?
t
.
y
[
1
]:
this
.
defaultInOut
||
"
inside
"
]:[
"
center
"
,
null
],
this
.
position
.
yAttribute
=
"
bottom
"
==
this
.
position
.
x
[
3
]
||
"
inside
"
==
this
.
position
.
y
[
1
]
&&
"
bottom
"
==
this
.
position
.
y
[
0
]?
"
bottom
"
:
"
top
"
),
this
.
position
},
getOffset
:
function
(
t
){
return
!
t
&&
this
.
offset
||
(
t
=
t
||
this
.
options
.
offset
,
this
.
offset
=
{},
this
.
offset
.
x
=
"
number
"
==
typeof
t
?
t
:
t
.
x
&&
(
t
.
x
.
toInt
()
>=
0
||
t
.
x
.
toInt
()
<
0
)?
t
.
x
.
toInt
():
0
,
this
.
offset
.
y
=
"
number
"
==
typeof
t
?
t
:
t
.
y
&&
(
t
.
y
.
toInt
()
>=
0
||
t
.
y
.
toInt
()
<
0
)?
t
.
y
.
toInt
():
0
),
this
.
offset
},
getPointer
:
function
(
t
){
if
(
!
t
&&
this
.
pointer
)
return
this
.
pointer
;
if
(
!
(
t
=
t
||
this
.
options
.
pointer
))
return
!
1
;
var
e
=
this
.
getPosition
();
if
(
this
.
pointer
=
{},
"
outside
"
==
e
.
y
[
1
])
this
.
pointer
.
position
=
"
bottom
"
==
e
.
y
[
0
]?
"
top
"
:
"
bottom
"
,
this
.
pointer
.
adjustment
=
"
object
"
==
typeof
t
&&
[
"
center
"
,
"
right
"
,
"
left
"
].
contains
(
t
[
0
])?
t
[
0
]:[
"
center
"
,
"
right
"
,
"
left
"
].
contains
(
t
)?
t
:
"
center
"
;
else
{
if
(
"
outside
"
!=
e
.
x
[
1
])
return
null
;
this
.
pointer
.
position
=
"
left
"
==
e
.
x
[
0
]?
"
right
"
:
"
left
"
,
this
.
pointer
.
adjustment
=
"
object
"
==
typeof
t
&&
[
"
center
"
,
"
top
"
,
"
bottom
"
].
contains
(
t
[
0
])?
t
[
0
]:[
"
center
"
,
"
top
"
,
"
bottom
"
].
contains
(
t
)?
t
:
"
center
"
}
return
this
.
pointer
.
offset
=
"
object
"
==
typeof
t
&&
t
[
1
]
&&
"
number
"
==
typeof
t
[
1
].
toInt
()?
t
[
1
].
toInt
():
0
,
this
.
pointer
.
offset
=
this
.
pointer
.
offset
<
0
?
-
1
*
this
.
pointer
.
offset
:
this
.
pointer
.
offset
,
this
.
pointer
.
offset
=
"
right
"
==
this
.
pointer
.
adjustment
||
"
bottom
"
==
this
.
pointer
.
adjustment
?
-
1
*
this
.
pointer
.
offset
:
this
.
pointer
.
offset
,
this
.
pointer
},
getTransition
:
function
(){
if
(
this
.
transition
)
return
this
.
transition
;
if
(
this
.
options
.
transition
&&
[
"
flyin
"
,
"
flyout
"
,
"
flyinout
"
,
"
flyoutin
"
,
"
bounce
"
,
"
bouncein
"
,
"
bounceout
"
,
"
bounceinout
"
,
"
bouncefly
"
].
contains
(
this
.
options
.
transition
)){
this
.
transition
=
{},
this
.
transition
.
open
=
{
property
:
"
top
"
==
this
.
position
.
yAttribute
||
"
bottom
"
==
this
.
position
.
yAttribute
?
this
.
position
.
yAttribute
:
this
.
position
.
xAttribute
,
transition
:
"
quad:out
"
,
duration
:
300
},
this
.
transition
.
close
=
Object
.
clone
(
this
.
transition
.
open
);
var
t
=
20
*
(
"
bottom
"
==
this
.
position
.
yAttribute
||
"
right
"
==
this
.
position
.
xAttribute
?
-
1
:
1
);
switch
(
this
.
options
.
transition
){
case
"
flyin
"
:
case
"
flyout
"
:
this
.
transition
.
open
.
difference_start
=
this
.
transition
.
close
.
difference_end
=
t
*
(
"
flyin
"
==
this
.
options
.
transition
?
-
1
:
1
);
break
;
case
"
flyinout
"
:
case
"
flyoutin
"
:
t
*=
"
flyinout
"
==
this
.
options
.
transition
?
1
:
-
1
,
this
.
transition
.
open
.
difference_start
=-
1
*
t
,
this
.
transition
.
close
.
difference_end
=
t
;
break
;
case
"
bounce
"
:
case
"
bouncefly
"
:
case
"
bouncein
"
:
case
"
bounceout
"
:
case
"
bounceinout
"
:
this
.
transition
.
open
.
transition
=
"
bounce:out
"
,
this
.
transition
.
open
.
duration
=
450
,
this
.
transition
.
open
.
difference_start
=-
1
*
t
,
"
bounceinout
"
!=
this
.
options
.
transition
&&
"
bounceout
"
!=
this
.
options
.
transition
&&
"
bouncefly
"
!=
this
.
options
.
transition
||
(
this
.
transition
.
close
.
difference_end
=-
1
*
t
)}}
else
this
.
transition
=
{},
this
.
transition
.
open
=
null
!=
typeof
this
.
options
.
transition
.
open
?
this
.
options
.
transition
.
open
:
this
.
options
.
transition
,
this
.
transition
.
close
=
null
!=
typeof
this
.
options
.
transition
.
close
?
this
.
options
.
transition
.
close
:
this
.
options
.
transition
;
return
this
.
transition
},
setPosition
:
function
(
t
,
e
,
i
){
if
(
t
=
this
.
getTarget
(
t
),
e
=
this
.
getPosition
(
e
),
i
=
this
.
getOffset
(
i
),
pointer
=
this
.
getPointer
(),
"
mouse
"
==
t
)
return
r
=
(
this
.
mouseX
||
0
)
+
15
+
i
.
x
,
h
=
(
this
.
mouseY
||
0
)
+
15
+
i
.
y
,
this
.
wrapper
.
setStyles
({
left
:
Math
.
floor
(
r
),
top
:
Math
.
floor
(
h
)}),
this
;
if
(
!
t
||
[
$
(
window
),
$
(
document
),
$
(
document
.
body
)].
contains
(
t
)){
var
o
=
"
fixed
"
==
this
.
wrapper
.
getStyle
(
"
position
"
)?{
x
:
0
,
y
:
0
}:
$
(
window
).
getScroll
();(
s
=
$
(
window
).
getSize
()).
width
=
s
.
totalWidth
=
s
.
x
,
s
.
height
=
s
.
totalHeight
=
s
.
y
;
var
n
=
{
top
:
o
.
y
,
left
:
o
.
x
,
right
:
o
.
x
+
s
.
width
,
bottom
:
o
.
y
+
s
.
height
}}
else
{
1
!=!
this
.
options
.
fixed
&&
this
.
wrapper
.
setStyle
(
"
position
"
,
"
absolute
"
);
var
s
=
t
.
getDimensions
({
computeSize
:
!
0
});
n
=
t
.
getCoordinates
();
0
==
s
.
totalWidth
&&
(
s
.
width
=
s
.
totalWidth
=
n
.
width
,
s
.
height
=
s
.
totalHeight
=
n
.
height
)}
var
r
=
n
.
left
||
0
,
h
=
n
.
top
||
0
,
a
=
this
.
wrapper
.
getDimensions
({
computeSize
:
!
0
});
if
(
pointer
&&!
this
.
pointerElement
){
if
(
this
.
pointerElement
=
new
Element
(
"
div
"
,{
class
:
"
mBoxPointer mBoxPointer
"
+
pointer
.
position
.
capitalize
(),
styles
:{
position
:
"
absolute
"
}}).
setStyle
(
pointer
.
position
,
0
).
inject
(
this
.
wrapper
,
"
top
"
),
Browser
.
opera
){
var
p
=
new
Element
(
"
div
"
,{
class
:
"
mBox
"
+
(
this
.
defaultTheme
||
"
Core
"
)
+
(
this
.
options
.
theme
?
"
-
"
+
this
.
options
.
theme
:
""
)}).
inject
(
document
.
body
).
grab
(
this
.
pointerElement
);
this
.
pointerDimensions
=
this
.
pointerElement
.
getDimensions
({
computeSize
:
!
0
}),
this
.
pointerElement
.
inject
(
this
.
wrapper
,
"
top
"
),
p
.
destroy
()}
else
this
.
pointerDimensions
=
this
.
pointerElement
.
getDimensions
({
computeSize
:
!
0
});
this
.
container
.
setStyle
(
"
margin-
"
+
pointer
.
position
,
"
left
"
==
pointer
.
position
||
"
right
"
==
pointer
.
position
?
this
.
pointerDimensions
.
width
-
this
.
container
.
getStyle
(
"
border-
"
+
pointer
.
position
).
toInt
():
this
.
pointerDimensions
.
height
-
this
.
container
.
getStyle
(
"
border-
"
+
pointer
.
position
).
toInt
())}
if
(
pointer
&&
this
.
pointerElement
){
if
(
"
outside
"
==
e
.
x
[
1
]
&&
"
outside
"
==
e
.
y
[
1
]
&&
"
center
"
==
pointer
.
adjustment
)
switch
(
pointer
.
adjustment
=
"
left
"
==
e
.
x
[
0
]?
"
right
"
:
"
left
"
,
e
.
x
[
0
]){
case
"
left
"
:
r
+=
a
.
totalWidth
-
this
.
pointerDimensions
.
width
/
2
;
break
;
case
"
right
"
:
r
-=
this
.
pointerDimensions
.
width
/
2
}
var
l
=
0
,
c
=
0
,
d
=
0
;
switch
(
pointer
.
adjustment
){
case
"
center
"
:
l
=
"
top
"
==
pointer
.
position
||
"
bottom
"
==
pointer
.
position
?
a
.
totalWidth
/
2
-
this
.
pointerDimensions
.
width
/
2
:
a
.
totalHeight
/
2
-
this
.
pointerDimensions
.
height
/
2
;
break
;
case
"
left
"
:
case
"
right
"
:
switch
(
e
.
x
[
1
]){
case
"
inside
"
:
c
+=
this
.
pointerDimensions
.
width
/
2
*-
1
+
(
"
right
"
==
e
.
x
[
0
]?
a
.
totalWidth
:
0
);
break
;
default
:
"
center
"
==
e
.
x
[
0
]
&&
(
c
+=
a
.
totalWidth
/
2
-
this
.
pointerDimensions
.
width
/
2
)}
r
+=
c
-
(
"
right
"
==
pointer
.
adjustment
?
a
.
totalWidth
-
this
.
pointerDimensions
.
width
:
0
),
l
=
"
right
"
==
pointer
.
adjustment
?
a
.
totalWidth
-
this
.
pointerDimensions
.
width
:
0
;
break
;
case
"
top
"
:
case
"
bottom
"
:
switch
(
e
.
y
[
1
]){
case
"
inside
"
:
d
+=
this
.
pointerDimensions
.
height
/
2
*-
1
+
(
"
bottom
"
==
e
.
y
[
0
]?
a
.
totalHeight
:
0
);
break
;
default
:
"
center
"
==
e
.
y
[
0
]
&&
(
d
+=
a
.
totalHeight
/
2
-
this
.
pointerDimensions
.
height
/
2
)}
h
+=
d
-
(
"
bottom
"
==
pointer
.
adjustment
?
a
.
totalHeight
-
this
.
pointerDimensions
.
height
:
0
),
l
=
"
bottom
"
==
pointer
.
adjustment
?
a
.
totalHeight
-
this
.
pointerDimensions
.
height
:
0
}
switch
(
pointer
.
position
){
case
"
top
"
:
case
"
bottom
"
:
r
+=-
1
*
pointer
.
offset
;
break
;
case
"
left
"
:
case
"
right
"
:
h
+=-
1
*
pointer
.
offset
}
this
.
pointerElement
.
setStyle
(
"
top
"
==
pointer
.
position
||
"
bottom
"
==
pointer
.
position
?
"
left
"
:
"
top
"
,
l
+
pointer
.
offset
)}
switch
(
a
=
this
.
wrapper
.
getDimensions
({
computeSize
:
!
0
}),
e
.
x
[
0
]){
case
"
center
"
:
r
+=
s
.
totalWidth
/
2
-
a
.
totalWidth
/
2
;
break
;
case
"
right
"
:
r
+=
s
.
totalWidth
-
(
"
inside
"
==
e
.
x
[
1
]?
a
.
totalWidth
:
"
center
"
==
e
.
x
[
1
]?
a
.
totalWidth
/
2
:
0
);
break
;
case
"
left
"
:
r
-=
"
outside
"
==
e
.
x
[
1
]?
a
.
totalWidth
:
"
center
"
==
e
.
x
[
1
]?
a
.
totalWidth
/
2
:
0
;
break
;
default
:
r
=
e
.
x
}
switch
(
e
.
y
[
0
]){
case
"
center
"
:
h
+=
s
.
totalHeight
/
2
-
a
.
totalHeight
/
2
;
break
;
case
"
bottom
"
:
h
+=
s
.
totalHeight
-
(
"
inside
"
==
e
.
y
[
1
]?
a
.
totalHeight
:
"
center
"
==
e
.
y
[
1
]?
a
.
totalHeight
/
2
:
0
);
break
;
case
"
top
"
:
h
-=
"
outside
"
==
e
.
y
[
1
]?
a
.
totalHeight
:
"
center
"
==
e
.
y
[
1
]?
a
.
totalHeight
/
2
:
0
;
break
;
default
:
r
=
e
.
y
}
this
.
wrapper
.
setStyles
({
top
:
null
,
right
:
null
,
bottom
:
null
,
left
:
null
});
var
u
=
$
(
window
).
getSize
();
return
"
right
"
==
e
.
xAttribute
&&
(
r
=
u
.
x
-
(
r
+
a
.
totalWidth
)),
"
bottom
"
==
e
.
yAttribute
&&
(
h
=
u
.
y
-
(
h
+
a
.
totalHeight
)),
r
=
r
||
0
,
r
+=
i
.
x
,
h
+=
i
.
y
,
this
.
wrapper
.
setStyle
(
e
.
xAttribute
,
r
.
floor
()),
this
.
wrapper
.
setStyle
(
e
.
yAttribute
,
h
.
floor
()),
this
},
setContent
:
function
(
t
,
e
){
return
null
!=
t
&&
(
$
(
t
)
||
$$
(
"
.
"
+
t
).
length
>
0
?(
this
[
e
||
"
content
"
].
grab
(
$
(
t
)
||
$$
(
"
.
"
+
t
)),
$
(
t
)
&&
$
(
t
).
setStyle
(
"
display
"
,
""
)):
null
!=
t
&&
(
t
=
(
t
=
t
.
replace
(
/
(?:
<script
[\s\S]
*
?)(?:(?:
<
\/
script>
)
|
(?:\/
>
))
/gim
,
""
)).
replace
(
/<
[^
>
]
+/gim
,(
function
(
t
){
return
t
.
replace
(
/ on
\w
+=
[\"\'\S][^
"
]
*
[\"\'\S]
/gim
,
""
).
replace
(
/javascript/gim
,
""
)})),
this
[
e
||
"
content
"
].
set
(
"
html
"
,
t
))),
this
},
setTitle
:
function
(
t
){
return
null
==
t
||
this
.
titleContainer
||
(
this
.
titleContainer
=
new
Element
(
"
div
"
,{
class
:
"
mBoxTitleContainer
"
}).
inject
(
this
.
container
,
"
top
"
),
this
.
title
=
new
Element
(
"
div
"
,{
class
:
"
mBoxTitle
"
+
(
this
.
options
.
addClass
.
title
||
""
),
styles
:
this
.
options
.
setStyles
.
title
||
{}}).
inject
(
this
.
titleContainer
),
this
.
wrapper
.
addClass
(
"
hasTitle
"
),
this
.
options
.
draggable
&&
null
!=
window
.
Drag
&&
(
new
Drag
(
this
.
wrapper
,{
handle
:
this
.
titleContainer
}),
this
.
titleContainer
.
addClass
(
"
mBoxDraggable
"
)),
this
.
options
.
closeInTitle
&&
new
Element
(
"
div
"
,{
class
:
"
mBoxClose
"
,
events
:{
click
:
function
(){
this
.
close
()}.
bind
(
this
)}}).
grab
(
new
Element
(
"
div
"
)).
inject
(
this
.
titleContainer
)),
null
!=
t
&&
this
.
setContent
(
t
,
"
title
"
),
this
},
setFooter
:
function
(
t
){
return
null
==
t
||
this
.
footerContainer
||
(
this
.
footerContainer
=
new
Element
(
"
div
"
,{
class
:
"
mBoxFooterContainer
"
}).
inject
(
this
.
container
,
"
bottom
"
),
this
.
footer
=
new
Element
(
"
div
"
,{
class
:
"
mBoxFooter
"
+
(
this
.
options
.
addClass
.
footer
||
""
),
styles
:
this
.
options
.
setStyles
.
footer
||
{}}).
inject
(
this
.
footerContainer
),
this
.
wrapper
.
addClass
(
"
hasFooter
"
)),
null
!=
t
&&
this
.
setContent
(
t
,
"
footer
"
),
this
},
load
:
function
(
t
,
e
,
i
){
return
this
.
setContent
(
t
),
this
.
setTitle
(
e
),
this
.
setFooter
(
i
),
this
},
getHTML
:
function
(
t
,
e
,
i
){
return
this
.
load
(
t
,
e
,
i
),
"
<div>
"
+
this
.
wrapper
.
get
(
"
html
"
)
+
"
</div>
"
},
attachEvents
:
function
(){
this
.
escEvent
=
function
(
t
){
"
esc
"
==
t
.
key
&&
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnEsc
&&
$
(
window
).
addEvent
(
"
keyup
"
,
this
.
escEvent
),
this
.
resizeEvent
=
function
(
t
){
this
.
setPosition
()}.
bind
(
this
),
$
(
window
).
addEvent
(
"
resize
"
,
this
.
resizeEvent
),
this
.
options
.
fixed
&&
(
Browser
.
ie6
||
Browser
.
ie7
)
&&
$
(
window
).
addEvent
(
"
scroll
"
,
this
.
resizeEvent
),
this
.
closeOnClickEvent
=
function
(
t
){
this
.
isOpen
&&
$
(
this
.
options
.
attach
)
!=
t
.
target
&&!
$$
(
"
.
"
+
this
.
options
.
attach
).
contains
(
t
.
target
)
&&
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnClick
&&
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnClickEvent
),
this
.
closeOnBoxClickEvent
=
function
(
t
){
this
.
isOpen
&&
(
this
.
wrapper
==
t
.
target
||
this
.
wrapper
.
contains
(
t
.
target
))
&&
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnBoxClick
&&
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnBoxClickEvent
),
this
.
closeOnWrapperClickEvent
=
function
(
t
){
this
.
isOpen
&&
this
.
wrapper
==
t
.
target
&&
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnWrapperClick
&&
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnWrapperClickEvent
),
this
.
closeOnBodyClickEvent
=
function
(
t
){
!
this
.
isOpen
||
$
(
this
.
options
.
attach
)
==
t
.
target
||
$$
(
"
.
"
+
this
.
options
.
attach
).
contains
(
t
.
target
)
||
t
.
target
==
this
.
wrapper
||
this
.
wrapper
.
contains
(
t
.
target
)
||
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnBodyClick
&&
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnBodyClickEvent
),
this
.
mouseMoveEvent
=
function
(
t
){
this
.
mouseX
=
t
.
page
.
x
,
this
.
mouseY
=
t
.
page
.
y
,
this
.
setPosition
(
"
mouse
"
)}.
bind
(
this
),
"
mouse
"
==
this
.
target
&&
$
(
document
).
addEvent
(
"
mousemove
"
,
this
.
mouseMoveEvent
)},
detachEvents
:
function
(){
this
.
options
.
fixed
&&
(
Browser
.
ie6
||
Browser
.
ie7
)
&&
$
(
window
).
removeEvent
(
"
scroll
"
,
this
.
resizeEvent
),
$
(
window
).
removeEvent
(
"
keyup
"
,
this
.
keyEvent
),
$
(
window
).
removeEvent
(
"
resize
"
,
this
.
resizeEvent
),
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnClickEvent
),
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnBoxClickEvent
),
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnWrapperClickEvent
),
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnBodyClickEvent
),
$
(
document
).
removeEvent
(
"
mousemove
"
,
this
.
mouseMoveEvent
)},
destroy
:
function
(){
mBox
.
instances
.
erase
(
this
),
this
.
detachEvents
(),
this
.
wrapper
.
dispose
(),
delete
this
.
wrapper
}});
mBox
.
instances
=
[],
mBox
.
currentId
=
0
,
mBox
.
reInit
=
function
(){
mBox
.
addConfirmEvents
&&
mBox
.
addConfirmEvents
(),
mBox
.
instances
.
each
((
function
(
t
){
try
{
t
.
reInit
()}
catch
(
t
){}}))},
mBox
.
Notice
=
new
Class
({
Extends
:
mBox
,
options
:{
type
:
"
Default
"
,
position
:{
x
:[
"
left
"
,
"
inside
"
],
y
:[
"
bottom
"
,
"
inside
"
]},
offset
:{
x
:
30
,
y
:
30
},
fixed
:
!
0
,
move
:
!
0
,
moveDuration
:
500
,
delayClose
:
4
e3
,
fade
:
!
0
,
fadeDuration
:{
open
:
250
,
close
:
400
},
target
:
$
(
window
),
zIndex
:
1
e6
,
closeOnEsc
:
!
1
,
closeOnBoxClick
:
!
0
,
closeOnBodyClick
:
!
1
,
openOnInit
:
!
0
},
initialize
:
function
(
t
){
this
.
defaultInOut
=
"
inside
"
,
this
.
defaultTheme
=
"
Notice
"
,
t
.
onSystemBoxReady
=
function
(){
if
(
this
.
container
.
addClass
(
"
mBoxNotice
"
+
(
this
.
options
.
type
.
capitalize
()
||
"
Default
"
)),
this
.
options
.
move
&&
(
"
inside
"
==
this
.
position
.
x
[
1
]
||
"
center
"
==
this
.
position
.
x
[
0
])
&&
"
inside
"
==
this
.
position
.
y
[
1
]
&&
(
"
top
"
==
this
.
position
.
y
[
0
]
||
"
bottom
"
==
this
.
position
.
y
[
0
])){
var
t
=
this
.
wrapper
.
getDimensions
({
computeSize
:
!
0
});
this
.
container
.
setStyle
(
"
position
"
,
"
absolute
"
),
this
.
container
.
setStyle
(
"
top
"
==
this
.
position
.
y
[
0
]?
"
bottom
"
:
"
top
"
,
0
),
this
.
wrapper
.
setStyles
({
height
:
0
,
width
:
t
.
totalWidth
,
overflowY
:
"
hidden
"
}),
this
.
options
.
transition
=
{
open
:{
transition
:
"
linear
"
,
property
:
"
height
"
,
duration
:
this
.
options
.
moveDuration
,
start
:
0
,
end
:
t
.
totalHeight
+
this
.
options
.
offset
.
y
}},
this
.
options
.
offset
.
y
=
0
,
this
.
options
.
delayClose
+=
this
.
options
.
moveDuration
}},
t
.
onSystemOpen
=
function
(){
$
(
window
).
retrieve
(
"
mBoxNotice
"
)
&&
(
$
(
window
).
retrieve
(
"
mBoxNotice
"
).
ignoreDelay
=!
0
,
$
(
window
).
retrieve
(
"
mBoxNotice
"
).
close
()),
$
(
window
).
store
(
"
mBoxNotice
"
,
this
)},
t
.
onSystemOpenComplete
=
function
(){
this
.
close
()},
t
.
onSystemCloseComplete
=
function
(){
this
.
destroy
()},
this
.
parent
(
t
)}}),
mBox
.
Tooltip
=
new
Class
({
Extends
:
mBox
,
options
:{
target
:
null
,
event
:
"
mouseenter
"
,
position
:{
x
:[
"
center
"
],
y
:[
"
top
"
,
"
outside
"
]},
pointer
:
"
center
"
,
fixed
:
!
1
,
delayOpenOnce
:
!
0
},
initialize
:
function
(
t
){
this
.
defaultInOut
=
"
outside
"
,
this
.
defaultTheme
=
"
Tooltip
"
,
this
.
parent
(
t
)}});
\ No newline at end of file
\ No newline at end of file
o2web/source/o2_lib/mootools/plugin/mBox.Notice.js
浏览文件 @
0314daae
...
@@ -933,6 +933,10 @@ var mBox = new Class({
...
@@ -933,6 +933,10 @@ var mBox = new Class({
this
[
where
||
'
content
'
].
grab
(
$
(
content
)
||
$$
(
'
.
'
+
content
));
this
[
where
||
'
content
'
].
grab
(
$
(
content
)
||
$$
(
'
.
'
+
content
));
if
(
$
(
content
))
$
(
content
).
setStyle
(
'
display
'
,
''
);
if
(
$
(
content
))
$
(
content
).
setStyle
(
'
display
'
,
''
);
}
else
if
(
content
!=
null
)
{
}
else
if
(
content
!=
null
)
{
content
=
content
.
replace
(
/
(?:
<script
[\s\S]
*
?)(?:(?:
<
\/
script>
)
|
(?:\/
>
))
/gmi
,
''
)
content
=
content
.
replace
(
/<
[^
>
]
+/gmi
,
function
(
match
){
return
match
.
replace
(
/ on
\w
+=
[\"\'\S][^
"
]
*
[\"\'\S]
/gmi
,
''
).
replace
(
/javascript/gmi
,
''
);
});
this
[
where
||
'
content
'
].
set
(
'
html
'
,
content
);
this
[
where
||
'
content
'
].
set
(
'
html
'
,
content
);
}
}
}
}
...
...
o2web/source/o2_lib/mootools/plugin/mBox.Notice.min.js
浏览文件 @
0314daae
var
mBox
=
new
Class
({
Implements
:[
Options
,
Events
],
options
:{
id
:
""
,
theme
:
""
,
addClass
:{
wrapper
:
""
,
container
:
""
,
content
:
""
,
title
:
""
,
footer
:
""
},
setStyles
:{
wrapper
:{},
container
:{},
content
:{},
title
:{},
footer
:{}},
target
:
$
(
window
),
attach
:
null
,
event
:
"
click
"
,
preventDefault
:
false
,
width
:
"
auto
"
,
height
:
"
auto
"
,
zIndex
:
8
e3
,
content
:
null
,
setContent
:
"
data-setContent
"
,
load
:
null
,
url
:
""
,
reload
:
false
,
title
:
null
,
footer
:
null
,
draggable
:
false
,
position
:{
x
:
"
center
"
,
y
:
"
center
"
},
fixed
:
null
,
offset
:{
x
:
0
,
y
:
0
},
pointer
:
false
,
fade
:{
open
:
true
,
close
:
true
},
fadeDuration
:{
open
:
200
,
close
:
300
},
fadeWhenOpen
:
false
,
overlay
:
false
,
overlayStyles
:{
color
:
"
black
"
,
opacity
:.
75
},
overlayFadeDuration
:
100
,
transition
:{
open
:
null
,
close
:
null
},
closeOnEsc
:
true
,
closeOnClick
:
false
,
closeOnBoxClick
:
false
,
closeOnWrapperClick
:
false
,
closeOnBodyClick
:
true
,
closeOnMouseleave
:
false
,
closeInTitle
:
false
,
delayOpen
:
0
,
delayClose
:
0
,
delayOpenOnce
:
true
,
constructOnInit
:
true
,
openOnInit
:
false
},
initialize
:
function
(
t
){
this
.
block
=
false
;
this
.
ignoreDelay
=
false
;
this
.
ignoreDelayOnce
=
false
;
this
.
setOptions
(
t
);
this
.
fixOptions
();
this
.
getPosition
();
this
.
target
=
this
.
getTarget
();
if
(
this
.
options
.
fixed
==
null
){
this
.
options
.
fixed
=
[
$
(
window
),
$
(
document
),
$
(
document
.
body
)].
contains
(
this
.
target
)}
if
(
this
.
target
==
"
mouse
"
){
this
.
options
.
pointer
=
false
}
this
.
targets
=
[];
this
.
id
=
this
.
options
.
id
||
"
mBox
"
+
++
mBox
.
currentId
;
this
.
addListeners
();
if
(
this
.
options
.
constructOnInit
){
this
.
construct
()}
this
.
fireEvent
(
"
init
"
).
fireEvent
(
"
systemInit
"
);
if
(
this
.
options
.
openOnInit
){
this
.
open
()}
mBox
.
instances
.
push
(
this
)},
reInit
:
function
(){
this
.
addListeners
()},
fixOptions
:
function
(){
if
(
typeof
this
.
options
.
addClass
==
"
string
"
){
this
.
options
.
addClass
=
{
wrapper
:
this
.
options
.
addClass
}}
if
(
typeof
this
.
options
.
setStyles
==
"
object
"
&&!
this
.
options
.
setStyles
.
wrapper
&&!
this
.
options
.
setStyles
.
container
&&!
this
.
options
.
setStyles
.
content
&&!
this
.
options
.
setStyles
.
title
&&!
this
.
options
.
setStyles
.
footer
){
this
.
options
.
setStyles
=
{
wrapper
:
this
.
options
.
setStyles
}}
this
.
options
.
fade
=
{
open
:
this
.
options
.
fade
.
open
||
this
.
options
.
fade
==
true
,
close
:
this
.
options
.
fade
.
close
||
this
.
options
.
fade
==
true
};
this
.
options
.
fadeDuration
=
{
open
:
this
.
options
.
fadeDuration
.
open
||
this
.
options
.
fadeDuration
,
close
:
this
.
options
.
fadeDuration
.
close
||
this
.
options
.
fadeDuration
}},
construct
:
function
(){
if
(
this
.
wrapper
){
return
null
}
this
.
wrapper
=
new
Element
(
"
div
"
,{
id
:
this
.
id
,
class
:
"
mBox
"
+
(
this
.
defaultTheme
||
"
Core
"
)
+
(
this
.
options
.
theme
?
"
-
"
+
this
.
options
.
theme
:
""
)
+
"
"
+
(
this
.
options
.
addClass
.
wrapper
||
""
),
styles
:{
zIndex
:
this
.
options
.
zIndex
,
position
:
this
.
options
.
fixed
==
false
||
Browser
.
ie6
||
Browser
.
ie7
?
"
absolute
"
:
"
fixed
"
,
display
:
"
none
"
,
opacity
:
1
e
-
5
,
top
:
-
12
e3
,
left
:
-
12
e3
,
zoom
:
1
}}).
setStyles
(
this
.
options
.
setStyles
.
wrapper
||
{}).
inject
(
document
.
body
,
"
bottom
"
);
if
(
this
.
options
.
closeOnMouseleave
){
this
.
wrapper
.
addEvents
({
mouseenter
:
function
(
t
){
this
.
open
()}.
bind
(
this
),
mouseleave
:
function
(
t
){
this
.
close
()}.
bind
(
this
)})}
this
.
container
=
new
Element
(
"
div
"
,{
class
:
"
mBoxContainer
"
+
"
"
+
(
this
.
options
.
addClass
.
container
||
""
)}).
setStyles
(
this
.
options
.
setStyles
.
container
||
{}).
inject
(
this
.
wrapper
);
this
.
content
=
new
Element
(
"
div
"
,{
class
:
"
mBoxContent
"
+
"
"
+
(
this
.
options
.
addClass
.
content
||
""
),
styles
:{
width
:
this
.
options
.
width
,
height
:
this
.
options
.
height
}}).
setStyles
(
this
.
options
.
setStyles
.
content
||
{}).
inject
(
this
.
container
);
this
.
load
(
this
.
options
.
content
,
this
.
options
.
title
,
this
.
options
.
footer
,
true
);
this
.
fireEvent
(
"
systemBoxReady
"
).
fireEvent
(
"
boxReady
"
)},
addListeners
:
function
(
t
){
t
=
t
||
this
.
options
.
attach
;
elements
=
Array
.
from
(
$
(
t
)).
combine
(
Array
.
from
(
$$
(
"
.
"
+
t
))).
combine
(
Array
.
from
(
$$
(
t
))).
clean
();
if
(
!
elements
||
elements
.
length
==
0
)
return
this
;
this
.
targets
.
combine
(
elements
);
switch
(
this
.
options
.
event
){
case
"
mouseenter
"
:
case
"
mouseover
"
:
var
e
=
{
mouseenter
:
function
(
t
){
this
.
target
=
this
.
getTargetFromEvent
(
t
);
this
.
source
=
this
.
getTargetElementFromEvent
(
t
);
this
.
open
()}.
bind
(
this
),
mouseleave
:
function
(
t
){
this
.
close
()}.
bind
(
this
)};
break
;
default
:
var
e
=
{
click
:
function
(
t
){
if
(
this
.
options
.
preventDefault
){
t
.
preventDefault
()}
if
(
this
.
isOpen
){
this
.
close
()}
else
{
this
.
target
=
this
.
getTargetFromEvent
(
t
);
this
.
source
=
this
.
getTargetElementFromEvent
(
t
);
this
.
open
()}}.
bind
(
this
)}}
$$
(
elements
).
each
(
function
(
t
){
if
(
!
t
.
retrieve
(
"
mBoxElementEventsAdded
"
+
this
.
id
)){
t
.
addEvents
(
e
).
store
(
"
mBoxElementEventsAdded
"
+
this
.
id
,
true
)}}.
bind
(
this
))},
loadAjax
:
function
(
t
){
if
(
!
this
.
ajaxRequest
){
this
.
ajaxRequest
=
new
Request
.
HTML
({
link
:
"
cancel
"
,
update
:
this
.
content
,
onRequest
:
function
(){
this
.
setContent
(
""
);
this
.
wrapper
.
addClass
(
"
mBoxLoading
"
)}.
bind
(
this
),
onComplete
:
function
(){
this
.
wrapper
.
removeClass
(
"
mBoxLoading
"
);
if
(
this
.
options
.
width
==
"
auto
"
||
this
.
options
.
height
==
"
auto
"
){
this
.
setPosition
()}
this
.
fireEvent
(
"
ajaxComplete
"
)}.
bind
(
this
)}).
send
()}
this
.
ajaxRequest
.
send
(
t
);
this
.
ajaxLoaded
=
true
},
open
:
function
(
t
){
if
(
!
this
.
wrapper
){
this
.
construct
()}
if
(
typeof
t
!=
"
object
"
)
t
=
{};
clearTimeout
(
this
.
timer
);
if
(
!
this
.
isOpen
&&!
this
.
block
){
var
e
=
function
(){
this
.
ignoreDelayOnce
=
false
;
this
.
fireEvent
(
"
systemOpenComplete
"
).
fireEvent
(
"
openComplete
"
)}.
bind
(
this
);
var
i
=
function
(
e
){
this
.
isOpen
=
true
;
if
(
this
.
options
.
load
==
"
ajax
"
&&
this
.
options
.
url
&&
(
!
this
.
ajaxLoaded
||
this
.
options
.
reload
)){
this
.
loadAjax
({
url
:
this
.
options
.
url
})}
this
.
target
=
this
.
getTarget
(
t
.
target
||
null
);
if
(
this
.
options
.
setContent
&&
this
.
source
&&
this
.
source
.
getAttribute
(
this
.
options
.
setContent
)){
if
(
$
(
this
.
source
.
getAttribute
(
this
.
options
.
setContent
))){
this
.
content
.
getChildren
().
setStyle
(
"
display
"
,
"
none
"
);
$
(
this
.
source
.
getAttribute
(
this
.
options
.
setContent
)).
setStyle
(
"
display
"
,
""
)}
else
{
var
i
=
this
.
source
.
getAttribute
(
this
.
options
.
setContent
).
split
(
"
|
"
),
o
=
i
[
0
]
||
null
,
s
=
i
[
1
]
||
null
,
n
=
i
[
2
]
||
null
;
this
.
load
(
o
,
s
,
n
)}}
this
.
setPosition
(
null
,
t
.
position
||
null
,
t
.
offset
||
null
);
this
.
fireEvent
(
"
systemOpen
"
).
fireEvent
(
"
open
"
);
if
(
this
.
fx
){
this
.
fx
.
cancel
()}
this
.
wrapper
.
setStyles
({
display
:
""
});
if
(
this
.
options
.
fadeWhenOpen
){
this
.
wrapper
.
setStyle
(
"
opacity
"
,
0
)}
this
.
fx
=
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
"
opacity
"
,
duration
:
this
.
options
.
fadeDuration
.
open
,
link
:
"
cancel
"
,
onComplete
:
e
})[
t
.
instant
||!
this
.
options
.
fade
.
open
?
"
set
"
:
"
start
"
](
1
);
if
(
t
.
instant
||!
this
.
options
.
fade
.
open
){
e
()}
var
r
=
this
.
getTransition
();
if
(
r
.
open
){
var
a
=
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
r
.
open
.
property
||
"
top
"
,
duration
:
r
.
open
.
duration
||
this
.
options
.
fadeDuration
.
open
,
transition
:
r
.
open
.
transition
||
null
,
onStart
:
r
.
open
.
onStart
||
null
,
onComplete
:
r
.
open
.
onComplete
||
null
});
a
.
start
(
r
.
open
.
start
||
this
.
wrapper
.
getStyle
(
r
.
open
.
property
||
"
top
"
).
toInt
()
+
(
r
.
open
.
difference_start
||
0
),
r
.
open
.
end
||
this
.
wrapper
.
getStyle
(
r
.
open
.
property
||
"
top
"
).
toInt
()
+
(
r
.
open
.
difference_end
||
0
))}
this
.
attachEvents
();
if
(
this
.
options
.
overlay
){
this
.
addOverlay
(
t
.
instant
||!
this
.
options
.
fade
.
open
)}
if
(
this
.
options
.
delayOpenOnce
){
this
.
delayOpenOnce
=
true
}}.
bind
(
this
);
if
(
this
.
options
.
delayOpen
>
0
&&!
this
.
ignoreDelay
&&!
this
.
ignoreDelayOnce
&&!
this
.
delayOpenOnce
){
this
.
timer
=
i
.
delay
(
this
.
options
.
delayOpen
,
this
,
e
)}
else
{
i
(
e
)}}
return
this
},
close
:
function
(
t
){
if
(
typeof
t
!=
"
object
"
)
t
=
{};
clearTimeout
(
this
.
timer
);
if
(
this
.
isOpen
&&!
this
.
block
){
var
e
=
function
(){
this
.
delayOpenOnce
=
false
;
this
.
ignoreDelayOnce
=
false
;
this
.
wrapper
.
setStyle
(
"
display
"
,
"
none
"
);
this
.
fireEvent
(
"
systemCloseComplete
"
).
fireEvent
(
"
closeComplete
"
)}.
bind
(
this
);
var
i
=
function
(
e
){
this
.
isOpen
=
false
;
this
.
fireEvent
(
"
systemClose
"
).
fireEvent
(
"
close
"
);
this
.
detachEvents
();
if
(
this
.
options
.
overlay
){
this
.
removeOverlay
(
t
.
instant
||!
this
.
options
.
fade
.
close
)}
if
(
this
.
fx
){
this
.
fx
.
cancel
()}
this
.
fx
=
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
"
opacity
"
,
duration
:
this
.
options
.
fadeDuration
.
close
,
link
:
"
cancel
"
,
onComplete
:
e
})[
t
.
instant
||!
this
.
options
.
fade
.
close
?
"
set
"
:
"
start
"
](
0
);
if
(
t
.
instant
||!
this
.
options
.
fade
.
close
){
e
()}
var
i
=
this
.
getTransition
();
if
(
i
.
close
){
var
o
=
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
i
.
close
.
property
||
"
top
"
,
duration
:
i
.
close
.
duration
||
this
.
options
.
fadeDuration
.
close
,
transition
:
i
.
close
.
transition
||
null
,
onStart
:
i
.
open
.
onStart
||
null
,
onComplete
:
i
.
open
.
onComplete
||
null
});
o
.
start
(
i
.
close
.
start
||
this
.
wrapper
.
getStyle
(
i
.
close
.
property
||
"
top
"
).
toInt
()
+
(
i
.
close
.
difference_start
||
0
),
i
.
close
.
end
||
this
.
wrapper
.
getStyle
(
i
.
close
.
property
||
"
top
"
).
toInt
()
+
(
i
.
close
.
difference_end
||
0
))}}.
bind
(
this
);
if
(
this
.
options
.
delayClose
>
0
&&!
this
.
ignoreDelay
&&!
this
.
ignoreDelayOnce
){
this
.
timer
=
i
.
delay
(
this
.
options
.
delayClose
,
this
,
e
)}
else
{
i
(
e
)}}
return
this
},
addOverlay
:
function
(
t
){
if
(
!
this
.
overlay
){
this
.
overlay
=
new
Element
(
"
div
"
,{
styles
:{
position
:
"
fixed
"
,
top
:
0
,
left
:
0
,
width
:
"
100%
"
,
height
:
"
100%
"
,
zIndex
:
this
.
wrapper
.
getStyle
(
"
zIndex
"
)
-
1
,
background
:
this
.
options
.
overlayStyles
.
color
||
"
white
"
,
opacity
:.
001
,
display
:
"
none
"
}}).
set
(
"
tween
"
,{
duration
:
this
.
options
.
overlayFadeDuration
,
link
:
"
cancel
"
}).
inject
(
$
(
document
.
body
),
"
bottom
"
)}
this
.
overlay
.
setStyle
(
"
display
"
,
"
block
"
)[
t
?
"
set
"
:
"
tween
"
](
"
opacity
"
,
this
.
options
.
overlayStyles
.
opacity
||
.
001
);
return
this
},
removeOverlay
:
function
(
t
){
if
(
this
.
overlay
){
this
.
overlay
[
t
?
"
set
"
:
"
tween
"
](
"
opacity
"
,
0
).
get
(
"
tween
"
).
chain
(
function
(){
this
.
overlay
.
setStyle
(
"
display
"
,
"
none
"
)}.
bind
(
this
))}
return
this
},
getTarget
:
function
(
t
){
var
t
=
$
(
t
)
||
t
||
this
.
target
||
$
(
this
.
options
.
target
)
||
this
.
options
.
target
||
$
(
this
.
options
.
attach
);
return
t
==
"
mouse
"
?
"
mouse
"
:
this
.
fixOperaPositioning
(
$
(
t
))},
getTargetFromEvent
:
function
(
t
){
if
(
this
.
options
.
target
)
return
this
.
fixOperaPositioning
(
$
(
this
.
options
.
target
));
return
this
.
getTargetElementFromEvent
(
t
)},
getTargetElementFromEvent
:
function
(
t
){
if
(
t
&&
t
.
target
){
if
(
this
.
targets
.
contains
(
t
.
target
))
return
this
.
fixOperaPositioning
(
t
.
target
);
var
e
=
t
.
target
.
getParent
();
while
(
e
!=
null
){
if
(
this
.
targets
.
contains
(
e
)){
return
this
.
fixOperaPositioning
(
e
)}
e
=
e
.
getParent
()}}
return
null
},
fixOperaPositioning
:
function
(
t
){
if
(
$
(
t
)
&&!
$
(
t
).
retrieve
(
"
OperaBugFixed
"
)
&&
t
!=
window
){
try
{
if
(
!
(
$
(
t
).
getStyle
(
"
border-top-width
"
).
toInt
()
+
$
(
t
).
getStyle
(
"
border-right-width
"
).
toInt
()
+
$
(
t
).
getStyle
(
"
border-bottom-width
"
).
toInt
()
+
$
(
t
).
getStyle
(
"
border-left-width
"
).
toInt
())){
$
(
t
).
setStyle
(
"
border
"
,
0
)}}
catch
(
t
){}
$
(
t
).
store
(
"
OperaBugFixed
"
)}
return
t
},
getPosition
:
function
(
t
){
if
(
!
t
&&
this
.
position
)
return
this
.
position
;
t
=
t
||
this
.
options
.
position
;
this
.
position
=
{};
this
.
position
.
x
=
typeof
t
==
"
object
"
&&
typeof
t
.
x
==
"
number
"
?[
t
.
x
.
toInt
(),
null
]:
typeof
t
!=
"
object
"
||!
t
.
x
||
t
.
x
==
"
center
"
||
typeof
t
.
x
==
"
object
"
&&
t
.
x
[
0
]
==
"
center
"
?[
"
center
"
,
null
]:[
"
right
"
,
"
left
"
].
contains
(
t
.
x
)?[
t
.
x
,
this
.
defaultInOut
||
"
inside
"
]:
typeof
t
.
x
==
"
object
"
&&
[
"
right
"
,
"
left
"
].
contains
(
t
.
x
[
0
])?[
t
.
x
[
0
],[
"
inside
"
,
"
center
"
,
"
outside
"
].
contains
(
t
.
x
[
1
])?
t
.
x
[
1
]:
this
.
defaultInOut
||
"
inside
"
]:[
"
center
"
,
null
];
this
.
position
.
xAttribute
=
this
.
position
.
x
[
3
]
==
"
right
"
||
this
.
position
.
x
[
1
]
==
"
inside
"
&&
this
.
position
.
x
[
0
]
==
"
right
"
?
"
right
"
:
"
left
"
;
this
.
position
.
y
=
typeof
t
==
"
object
"
&&
typeof
t
.
y
==
"
number
"
?[
t
.
y
.
toInt
(),
null
]:
typeof
t
!=
"
object
"
||!
t
.
y
||
t
.
y
==
"
center
"
||
typeof
t
.
y
==
"
object
"
&&
t
.
y
[
0
]
==
"
center
"
?[
"
center
"
,
null
]:[
"
top
"
,
"
bottom
"
].
contains
(
t
.
y
)?[
t
.
y
,
this
.
defaultInOut
||
"
inside
"
]:
typeof
t
.
y
==
"
object
"
&&
[
"
top
"
,
"
bottom
"
].
contains
(
t
.
y
[
0
])?[
t
.
y
[
0
],[
"
inside
"
,
"
center
"
,
"
outside
"
].
contains
(
t
.
y
[
1
])?
t
.
y
[
1
]:
this
.
defaultInOut
||
"
inside
"
]:[
"
center
"
,
null
];
this
.
position
.
yAttribute
=
this
.
position
.
x
[
3
]
==
"
bottom
"
||
this
.
position
.
y
[
1
]
==
"
inside
"
&&
this
.
position
.
y
[
0
]
==
"
bottom
"
?
"
bottom
"
:
"
top
"
;
return
this
.
position
},
getOffset
:
function
(
t
){
if
(
!
t
&&
this
.
offset
)
return
this
.
offset
;
t
=
t
||
this
.
options
.
offset
;
this
.
offset
=
{};
this
.
offset
.
x
=
typeof
t
==
"
number
"
?
t
:
!
t
.
x
?
0
:
t
.
x
.
toInt
()
>=
0
||
t
.
x
.
toInt
()
<
0
?
t
.
x
.
toInt
():
0
;
this
.
offset
.
y
=
typeof
t
==
"
number
"
?
t
:
!
t
.
y
?
0
:
t
.
y
.
toInt
()
>=
0
||
t
.
y
.
toInt
()
<
0
?
t
.
y
.
toInt
():
0
;
return
this
.
offset
},
getPointer
:
function
(
t
){
if
(
!
t
&&
this
.
pointer
)
return
this
.
pointer
;
t
=
t
||
this
.
options
.
pointer
;
if
(
!
t
)
return
false
;
var
e
=
this
.
getPosition
();
this
.
pointer
=
{};
if
(
e
.
y
[
1
]
==
"
outside
"
){
this
.
pointer
.
position
=
e
.
y
[
0
]
==
"
bottom
"
?
"
top
"
:
"
bottom
"
;
this
.
pointer
.
adjustment
=
typeof
t
==
"
object
"
&&
[
"
center
"
,
"
right
"
,
"
left
"
].
contains
(
t
[
0
])?
t
[
0
]:[
"
center
"
,
"
right
"
,
"
left
"
].
contains
(
t
)?
t
:
"
center
"
}
else
if
(
e
.
x
[
1
]
==
"
outside
"
){
this
.
pointer
.
position
=
e
.
x
[
0
]
==
"
left
"
?
"
right
"
:
"
left
"
;
this
.
pointer
.
adjustment
=
typeof
t
==
"
object
"
&&
[
"
center
"
,
"
top
"
,
"
bottom
"
].
contains
(
t
[
0
])?
t
[
0
]:[
"
center
"
,
"
top
"
,
"
bottom
"
].
contains
(
t
)?
t
:
"
center
"
}
else
{
return
null
}
this
.
pointer
.
offset
=
typeof
t
==
"
object
"
&&
t
[
1
]
&&
typeof
t
[
1
].
toInt
()
==
"
number
"
?
t
[
1
].
toInt
():
0
;
this
.
pointer
.
offset
=
this
.
pointer
.
offset
<
0
?
this
.
pointer
.
offset
*-
1
:
this
.
pointer
.
offset
;
this
.
pointer
.
offset
=
this
.
pointer
.
adjustment
==
"
right
"
||
this
.
pointer
.
adjustment
==
"
bottom
"
?
this
.
pointer
.
offset
*-
1
:
this
.
pointer
.
offset
;
return
this
.
pointer
},
getTransition
:
function
(){
if
(
this
.
transition
)
return
this
.
transition
;
if
(
this
.
options
.
transition
&&
[
"
flyin
"
,
"
flyout
"
,
"
flyinout
"
,
"
flyoutin
"
,
"
bounce
"
,
"
bouncein
"
,
"
bounceout
"
,
"
bounceinout
"
,
"
bouncefly
"
].
contains
(
this
.
options
.
transition
)){
this
.
transition
=
{};
this
.
transition
.
open
=
{
property
:
this
.
position
.
yAttribute
==
"
top
"
||
this
.
position
.
yAttribute
==
"
bottom
"
?
this
.
position
.
yAttribute
:
this
.
position
.
xAttribute
,
transition
:
"
quad:out
"
,
duration
:
300
};
this
.
transition
.
close
=
Object
.
clone
(
this
.
transition
.
open
);
var
t
=
20
*
(
this
.
position
.
yAttribute
==
"
bottom
"
||
this
.
position
.
xAttribute
==
"
right
"
?
-
1
:
1
);
switch
(
this
.
options
.
transition
){
case
"
flyin
"
:
case
"
flyout
"
:
this
.
transition
.
open
.
difference_start
=
this
.
transition
.
close
.
difference_end
=
t
*
(
this
.
options
.
transition
==
"
flyin
"
?
-
1
:
1
);
break
;
case
"
flyinout
"
:
case
"
flyoutin
"
:
t
=
t
*
(
this
.
options
.
transition
==
"
flyinout
"
?
1
:
-
1
);
this
.
transition
.
open
.
difference_start
=
t
*-
1
;
this
.
transition
.
close
.
difference_end
=
t
;
break
;
case
"
bounce
"
:
case
"
bouncefly
"
:
case
"
bouncein
"
:
case
"
bounceout
"
:
case
"
bounceinout
"
:
this
.
transition
.
open
.
transition
=
"
bounce:out
"
;
this
.
transition
.
open
.
duration
=
450
;
this
.
transition
.
open
.
difference_start
=
t
*-
1
;
if
(
this
.
options
.
transition
==
"
bounceinout
"
||
this
.
options
.
transition
==
"
bounceout
"
||
this
.
options
.
transition
==
"
bouncefly
"
){
this
.
transition
.
close
.
difference_end
=
t
*-
1
}
break
}}
else
{
this
.
transition
=
{};
this
.
transition
.
open
=
typeof
this
.
options
.
transition
.
open
!=
undefined
?
this
.
options
.
transition
.
open
:
this
.
options
.
transition
;
this
.
transition
.
close
=
typeof
this
.
options
.
transition
.
close
!=
undefined
?
this
.
options
.
transition
.
close
:
this
.
options
.
transition
}
return
this
.
transition
},
setPosition
:
function
(
t
,
e
,
i
){
t
=
this
.
getTarget
(
t
);
e
=
this
.
getPosition
(
e
);
i
=
this
.
getOffset
(
i
);
pointer
=
this
.
getPointer
();
if
(
t
==
"
mouse
"
){
r
=
(
this
.
mouseX
||
0
)
+
15
+
i
.
x
;
a
=
(
this
.
mouseY
||
0
)
+
15
+
i
.
y
;
this
.
wrapper
.
setStyles
({
left
:
Math
.
floor
(
r
),
top
:
Math
.
floor
(
a
)});
return
this
}
if
(
!
t
||
[
$
(
window
),
$
(
document
),
$
(
document
.
body
)].
contains
(
t
)){
var
o
=
this
.
wrapper
.
getStyle
(
"
position
"
)
==
"
fixed
"
?{
x
:
0
,
y
:
0
}:
$
(
window
).
getScroll
(),
s
=
$
(
window
).
getSize
();
s
.
width
=
s
.
totalWidth
=
s
.
x
;
s
.
height
=
s
.
totalHeight
=
s
.
y
;
var
n
=
{
top
:
o
.
y
,
left
:
o
.
x
,
right
:
o
.
x
+
s
.
width
,
bottom
:
o
.
y
+
s
.
height
}}
else
{
if
(
!
this
.
options
.
fixed
!=
true
){
this
.
wrapper
.
setStyle
(
"
position
"
,
"
absolute
"
)}
var
s
=
t
.
getDimensions
({
computeSize
:
true
});
var
n
=
t
.
getCoordinates
();
if
(
s
.
totalWidth
==
0
){
s
.
width
=
s
.
totalWidth
=
n
.
width
;
s
.
height
=
s
.
totalHeight
=
n
.
height
}}
var
r
=
n
.
left
||
0
,
a
=
n
.
top
||
0
;
var
h
=
this
.
wrapper
.
getDimensions
({
computeSize
:
true
});
if
(
pointer
&&!
this
.
pointerElement
){
this
.
pointerElement
=
new
Element
(
"
div
"
,{
class
:
"
mBoxPointer
"
+
"
mBoxPointer
"
+
pointer
.
position
.
capitalize
(),
styles
:{
position
:
"
absolute
"
}}).
setStyle
(
pointer
.
position
,
0
).
inject
(
this
.
wrapper
,
"
top
"
);
if
(
Browser
.
opera
){
var
l
=
new
Element
(
"
div
"
,{
class
:
"
mBox
"
+
(
this
.
defaultTheme
||
"
Core
"
)
+
(
this
.
options
.
theme
?
"
-
"
+
this
.
options
.
theme
:
""
)}).
inject
(
document
.
body
).
grab
(
this
.
pointerElement
);
this
.
pointerDimensions
=
this
.
pointerElement
.
getDimensions
({
computeSize
:
true
});
this
.
pointerElement
.
inject
(
this
.
wrapper
,
"
top
"
);
l
.
destroy
()}
else
{
this
.
pointerDimensions
=
this
.
pointerElement
.
getDimensions
({
computeSize
:
true
})}
this
.
container
.
setStyle
(
"
margin-
"
+
pointer
.
position
,
pointer
.
position
==
"
left
"
||
pointer
.
position
==
"
right
"
?
this
.
pointerDimensions
.
width
-
this
.
container
.
getStyle
(
"
border-
"
+
pointer
.
position
).
toInt
():
this
.
pointerDimensions
.
height
-
this
.
container
.
getStyle
(
"
border-
"
+
pointer
.
position
).
toInt
())}
if
(
pointer
&&
this
.
pointerElement
){
if
(
e
.
x
[
1
]
==
"
outside
"
&&
e
.
y
[
1
]
==
"
outside
"
&&
pointer
.
adjustment
==
"
center
"
){
pointer
.
adjustment
=
e
.
x
[
0
]
==
"
left
"
?
"
right
"
:
"
left
"
;
switch
(
e
.
x
[
0
]){
case
"
left
"
:
r
+=
h
.
totalWidth
-
this
.
pointerDimensions
.
width
/
2
;
break
;
case
"
right
"
:
r
-=
this
.
pointerDimensions
.
width
/
2
;
break
}}
var
p
=
0
,
c
=
0
,
f
=
0
,
d
=
0
;
switch
(
pointer
.
adjustment
){
case
"
center
"
:
c
=
pointer
.
position
==
"
top
"
||
pointer
.
position
==
"
bottom
"
?
h
.
totalWidth
/
2
-
this
.
pointerDimensions
.
width
/
2
:
h
.
totalHeight
/
2
-
this
.
pointerDimensions
.
height
/
2
;
break
;
case
"
left
"
:
case
"
right
"
:
switch
(
e
.
x
[
1
]){
case
"
inside
"
:
f
+=
this
.
pointerDimensions
.
width
/
2
*-
1
+
(
e
.
x
[
0
]
==
"
right
"
?
h
.
totalWidth
:
0
);
break
;
default
:
if
(
e
.
x
[
0
]
==
"
center
"
){
f
+=
h
.
totalWidth
/
2
-
this
.
pointerDimensions
.
width
/
2
}}
r
+=
f
-
(
pointer
.
adjustment
==
"
right
"
?
h
.
totalWidth
-
this
.
pointerDimensions
.
width
:
0
);
c
=
pointer
.
adjustment
==
"
right
"
?
h
.
totalWidth
-
this
.
pointerDimensions
.
width
:
0
;
break
;
case
"
top
"
:
case
"
bottom
"
:
switch
(
e
.
y
[
1
]){
case
"
inside
"
:
d
+=
this
.
pointerDimensions
.
height
/
2
*-
1
+
(
e
.
y
[
0
]
==
"
bottom
"
?
h
.
totalHeight
:
0
);
break
;
default
:
if
(
e
.
y
[
0
]
==
"
center
"
){
d
+=
h
.
totalHeight
/
2
-
this
.
pointerDimensions
.
height
/
2
}}
a
+=
d
-
(
pointer
.
adjustment
==
"
bottom
"
?
h
.
totalHeight
-
this
.
pointerDimensions
.
height
:
0
);
c
=
pointer
.
adjustment
==
"
bottom
"
?
h
.
totalHeight
-
this
.
pointerDimensions
.
height
:
0
;
break
}
switch
(
pointer
.
position
){
case
"
top
"
:
case
"
bottom
"
:
r
+=
pointer
.
offset
*-
1
;
break
;
case
"
left
"
:
case
"
right
"
:
a
+=
pointer
.
offset
*-
1
;
break
}
this
.
pointerElement
.
setStyle
(
pointer
.
position
==
"
top
"
||
pointer
.
position
==
"
bottom
"
?
"
left
"
:
"
top
"
,
c
+
pointer
.
offset
)}
h
=
this
.
wrapper
.
getDimensions
({
computeSize
:
true
});
switch
(
e
.
x
[
0
]){
case
"
center
"
:
r
+=
s
.
totalWidth
/
2
-
h
.
totalWidth
/
2
;
break
;
case
"
right
"
:
r
+=
s
.
totalWidth
-
(
e
.
x
[
1
]
==
"
inside
"
?
h
.
totalWidth
:
e
.
x
[
1
]
==
"
center
"
?
h
.
totalWidth
/
2
:
0
);
break
;
case
"
left
"
:
r
-=
e
.
x
[
1
]
==
"
outside
"
?
h
.
totalWidth
:
e
.
x
[
1
]
==
"
center
"
?
h
.
totalWidth
/
2
:
0
;
break
;
default
:
r
=
e
.
x
}
switch
(
e
.
y
[
0
]){
case
"
center
"
:
a
+=
s
.
totalHeight
/
2
-
h
.
totalHeight
/
2
;
break
;
case
"
bottom
"
:
a
+=
s
.
totalHeight
-
(
e
.
y
[
1
]
==
"
inside
"
?
h
.
totalHeight
:
e
.
y
[
1
]
==
"
center
"
?
h
.
totalHeight
/
2
:
0
);
break
;
case
"
top
"
:
a
-=
e
.
y
[
1
]
==
"
outside
"
?
h
.
totalHeight
:
e
.
y
[
1
]
==
"
center
"
?
h
.
totalHeight
/
2
:
0
;
break
;
default
:
r
=
e
.
y
}
this
.
wrapper
.
setStyles
({
top
:
null
,
right
:
null
,
bottom
:
null
,
left
:
null
});
var
u
=
$
(
window
).
getSize
();
if
(
e
.
xAttribute
==
"
right
"
){
r
=
u
.
x
-
(
r
+
h
.
totalWidth
)}
if
(
e
.
yAttribute
==
"
bottom
"
){
a
=
u
.
y
-
(
a
+
h
.
totalHeight
)}
r
=
r
||
0
;
r
+=
i
.
x
;
a
+=
i
.
y
;
this
.
wrapper
.
setStyle
(
e
.
xAttribute
,
r
.
floor
());
this
.
wrapper
.
setStyle
(
e
.
yAttribute
,
a
.
floor
());
return
this
},
setContent
:
function
(
t
,
e
){
if
(
t
!=
null
){
if
(
$
(
t
)
||
$$
(
"
.
"
+
t
).
length
>
0
){
this
[
e
||
"
content
"
].
grab
(
$
(
t
)
||
$$
(
"
.
"
+
t
));
if
(
$
(
t
))
$
(
t
).
setStyle
(
"
display
"
,
""
)}
else
if
(
t
!=
null
){
this
[
e
||
"
content
"
].
set
(
"
html
"
,
t
)}}
return
this
},
setTitle
:
function
(
t
){
if
(
t
!=
null
&&!
this
.
titleContainer
){
this
.
titleContainer
=
new
Element
(
"
div
"
,{
class
:
"
mBoxTitleContainer
"
}).
inject
(
this
.
container
,
"
top
"
);
this
.
title
=
new
Element
(
"
div
"
,{
class
:
"
mBoxTitle
"
+
(
this
.
options
.
addClass
.
title
||
""
),
styles
:
this
.
options
.
setStyles
.
title
||
{}}).
inject
(
this
.
titleContainer
);
this
.
wrapper
.
addClass
(
"
hasTitle
"
);
if
(
this
.
options
.
draggable
&&
window
[
"
Drag
"
]
!=
null
){
new
Drag
(
this
.
wrapper
,{
handle
:
this
.
titleContainer
});
this
.
titleContainer
.
addClass
(
"
mBoxDraggable
"
)}
if
(
this
.
options
.
closeInTitle
){
new
Element
(
"
div
"
,{
class
:
"
mBoxClose
"
,
events
:{
click
:
function
(){
this
.
close
()}.
bind
(
this
)}}).
grab
(
new
Element
(
"
div
"
)).
inject
(
this
.
titleContainer
)}}
if
(
t
!=
null
){
this
.
setContent
(
t
,
"
title
"
)}
return
this
},
setFooter
:
function
(
t
){
if
(
t
!=
null
&&!
this
.
footerContainer
){
this
.
footerContainer
=
new
Element
(
"
div
"
,{
class
:
"
mBoxFooterContainer
"
}).
inject
(
this
.
container
,
"
bottom
"
);
this
.
footer
=
new
Element
(
"
div
"
,{
class
:
"
mBoxFooter
"
+
(
this
.
options
.
addClass
.
footer
||
""
),
styles
:
this
.
options
.
setStyles
.
footer
||
{}}).
inject
(
this
.
footerContainer
);
this
.
wrapper
.
addClass
(
"
hasFooter
"
)}
if
(
t
!=
null
){
this
.
setContent
(
t
,
"
footer
"
)}
return
this
},
load
:
function
(
t
,
e
,
i
){
this
.
setContent
(
t
);
this
.
setTitle
(
e
);
this
.
setFooter
(
i
);
return
this
},
getHTML
:
function
(
t
,
e
,
i
){
this
.
load
(
t
,
e
,
i
);
return
"
<div>
"
+
this
.
wrapper
.
get
(
"
html
"
)
+
"
</div>
"
},
attachEvents
:
function
(){
this
.
escEvent
=
function
(
t
){
if
(
t
.
key
==
"
esc
"
){
this
.
ignoreDelayOnce
=
true
;
this
.
close
()}}.
bind
(
this
);
if
(
this
.
options
.
closeOnEsc
){
$
(
window
).
addEvent
(
"
keyup
"
,
this
.
escEvent
)}
this
.
resizeEvent
=
function
(
t
){
this
.
setPosition
()}.
bind
(
this
);
$
(
window
).
addEvent
(
"
resize
"
,
this
.
resizeEvent
);
if
(
this
.
options
.
fixed
&&
(
Browser
.
ie6
||
Browser
.
ie7
)){
$
(
window
).
addEvent
(
"
scroll
"
,
this
.
resizeEvent
)}
this
.
closeOnClickEvent
=
function
(
t
){
if
(
this
.
isOpen
&&
(
$
(
this
.
options
.
attach
)
!=
t
.
target
&&!
$$
(
"
.
"
+
this
.
options
.
attach
).
contains
(
t
.
target
))){
this
.
ignoreDelayOnce
=
true
;
this
.
close
()}}.
bind
(
this
);
if
(
this
.
options
.
closeOnClick
){
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnClickEvent
)}
this
.
closeOnBoxClickEvent
=
function
(
t
){
if
(
this
.
isOpen
&&
(
this
.
wrapper
==
t
.
target
||
this
.
wrapper
.
contains
(
t
.
target
))){
this
.
ignoreDelayOnce
=
true
;
this
.
close
()}}.
bind
(
this
);
if
(
this
.
options
.
closeOnBoxClick
){
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnBoxClickEvent
)}
this
.
closeOnWrapperClickEvent
=
function
(
t
){
if
(
this
.
isOpen
&&
this
.
wrapper
==
t
.
target
){
this
.
ignoreDelayOnce
=
true
;
this
.
close
()}}.
bind
(
this
);
if
(
this
.
options
.
closeOnWrapperClick
){
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnWrapperClickEvent
)}
this
.
closeOnBodyClickEvent
=
function
(
t
){
if
(
this
.
isOpen
&&
(
$
(
this
.
options
.
attach
)
!=
t
.
target
&&!
$$
(
"
.
"
+
this
.
options
.
attach
).
contains
(
t
.
target
))
&&
t
.
target
!=
this
.
wrapper
&&!
this
.
wrapper
.
contains
(
t
.
target
)){
this
.
ignoreDelayOnce
=
true
;
this
.
close
()}}.
bind
(
this
);
if
(
this
.
options
.
closeOnBodyClick
){
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnBodyClickEvent
)}
this
.
mouseMoveEvent
=
function
(
t
){
this
.
mouseX
=
t
.
page
.
x
;
this
.
mouseY
=
t
.
page
.
y
;
this
.
setPosition
(
"
mouse
"
)}.
bind
(
this
);
if
(
this
.
target
==
"
mouse
"
){
$
(
document
).
addEvent
(
"
mousemove
"
,
this
.
mouseMoveEvent
)}},
detachEvents
:
function
(){
if
(
this
.
options
.
fixed
&&
(
Browser
.
ie6
||
Browser
.
ie7
)){
$
(
window
).
removeEvent
(
"
scroll
"
,
this
.
resizeEvent
)}
$
(
window
).
removeEvent
(
"
keyup
"
,
this
.
keyEvent
);
$
(
window
).
removeEvent
(
"
resize
"
,
this
.
resizeEvent
);
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnClickEvent
);
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnBoxClickEvent
);
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnWrapperClickEvent
);
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnBodyClickEvent
);
$
(
document
).
removeEvent
(
"
mousemove
"
,
this
.
mouseMoveEvent
)},
destroy
:
function
(){
mBox
.
instances
.
erase
(
this
);
this
.
detachEvents
();
this
.
wrapper
.
dispose
();
delete
this
.
wrapper
}});
mBox
.
instances
=
[];
mBox
.
currentId
=
0
;
mBox
.
reInit
=
function
(){
if
(
mBox
.
addConfirmEvents
){
mBox
.
addConfirmEvents
()}
mBox
.
instances
.
each
(
function
(
t
){
try
{
t
.
reInit
()}
catch
(
t
){}})};
mBox
.
Notice
=
new
Class
({
Extends
:
mBox
,
options
:{
type
:
"
Default
"
,
position
:{
x
:[
"
left
"
,
"
inside
"
],
y
:[
"
bottom
"
,
"
inside
"
]},
offset
:{
x
:
30
,
y
:
30
},
fixed
:
true
,
move
:
true
,
moveDuration
:
500
,
delayClose
:
4
e3
,
fade
:
true
,
fadeDuration
:{
open
:
250
,
close
:
400
},
target
:
$
(
window
),
zIndex
:
1
e6
,
closeOnEsc
:
false
,
closeOnBoxClick
:
true
,
closeOnBodyClick
:
false
,
openOnInit
:
true
},
initialize
:
function
(
t
){
this
.
defaultInOut
=
"
inside
"
;
this
.
defaultTheme
=
"
Notice
"
;
t
.
onSystemBoxReady
=
function
(){
this
.
container
.
addClass
(
"
mBoxNotice
"
+
(
this
.
options
.
type
.
capitalize
()
||
"
Default
"
));
if
(
this
.
options
.
move
&&
(
this
.
position
.
x
[
1
]
==
"
inside
"
||
this
.
position
.
x
[
0
]
==
"
center
"
)
&&
this
.
position
.
y
[
1
]
==
"
inside
"
&&
(
this
.
position
.
y
[
0
]
==
"
top
"
||
this
.
position
.
y
[
0
]
==
"
bottom
"
)){
var
t
=
this
.
wrapper
.
getDimensions
({
computeSize
:
true
});
this
.
container
.
setStyle
(
"
position
"
,
"
absolute
"
);
this
.
container
.
setStyle
(
this
.
position
.
y
[
0
]
==
"
top
"
?
"
bottom
"
:
"
top
"
,
0
);
this
.
wrapper
.
setStyles
({
height
:
0
,
width
:
t
.
totalWidth
,
overflowY
:
"
hidden
"
});
this
.
options
.
transition
=
{
open
:{
transition
:
"
linear
"
,
property
:
"
height
"
,
duration
:
this
.
options
.
moveDuration
,
start
:
0
,
end
:
t
.
totalHeight
+
this
.
options
.
offset
.
y
}};
this
.
options
.
offset
.
y
=
0
;
this
.
options
.
delayClose
+=
this
.
options
.
moveDuration
}};
t
.
onSystemOpen
=
function
(){
if
(
$
(
window
).
retrieve
(
"
mBoxNotice
"
)){
$
(
window
).
retrieve
(
"
mBoxNotice
"
).
ignoreDelay
=
true
;
$
(
window
).
retrieve
(
"
mBoxNotice
"
).
close
()}
$
(
window
).
store
(
"
mBoxNotice
"
,
this
)};
t
.
onSystemOpenComplete
=
function
(){
this
.
close
()};
t
.
onSystemCloseComplete
=
function
(){
this
.
destroy
()};
this
.
parent
(
t
)}});
var
mBox
=
new
Class
({
Implements
:[
Options
,
Events
],
options
:{
id
:
""
,
theme
:
""
,
addClass
:{
wrapper
:
""
,
container
:
""
,
content
:
""
,
title
:
""
,
footer
:
""
},
setStyles
:{
wrapper
:{},
container
:{},
content
:{},
title
:{},
footer
:{}},
target
:
$
(
window
),
attach
:
null
,
event
:
"
click
"
,
preventDefault
:
!
1
,
width
:
"
auto
"
,
height
:
"
auto
"
,
zIndex
:
8
e3
,
content
:
null
,
setContent
:
"
data-setContent
"
,
load
:
null
,
url
:
""
,
reload
:
!
1
,
title
:
null
,
footer
:
null
,
draggable
:
!
1
,
position
:{
x
:
"
center
"
,
y
:
"
center
"
},
fixed
:
null
,
offset
:{
x
:
0
,
y
:
0
},
pointer
:
!
1
,
fade
:{
open
:
!
0
,
close
:
!
0
},
fadeDuration
:{
open
:
200
,
close
:
300
},
fadeWhenOpen
:
!
1
,
overlay
:
!
1
,
overlayStyles
:{
color
:
"
black
"
,
opacity
:.
75
},
overlayFadeDuration
:
100
,
transition
:{
open
:
null
,
close
:
null
},
closeOnEsc
:
!
0
,
closeOnClick
:
!
1
,
closeOnBoxClick
:
!
1
,
closeOnWrapperClick
:
!
1
,
closeOnBodyClick
:
!
0
,
closeOnMouseleave
:
!
1
,
closeInTitle
:
!
1
,
delayOpen
:
0
,
delayClose
:
0
,
delayOpenOnce
:
!
0
,
constructOnInit
:
!
0
,
openOnInit
:
!
1
},
initialize
:
function
(
t
){
this
.
block
=!
1
,
this
.
ignoreDelay
=!
1
,
this
.
ignoreDelayOnce
=!
1
,
this
.
setOptions
(
t
),
this
.
fixOptions
(),
this
.
getPosition
(),
this
.
target
=
this
.
getTarget
(),
null
==
this
.
options
.
fixed
&&
(
this
.
options
.
fixed
=
[
$
(
window
),
$
(
document
),
$
(
document
.
body
)].
contains
(
this
.
target
)),
"
mouse
"
==
this
.
target
&&
(
this
.
options
.
pointer
=!
1
),
this
.
targets
=
[],
this
.
id
=
this
.
options
.
id
||
"
mBox
"
+
++
mBox
.
currentId
,
this
.
addListeners
(),
this
.
options
.
constructOnInit
&&
this
.
construct
(),
this
.
fireEvent
(
"
init
"
).
fireEvent
(
"
systemInit
"
),
this
.
options
.
openOnInit
&&
this
.
open
(),
mBox
.
instances
.
push
(
this
)},
reInit
:
function
(){
this
.
addListeners
()},
fixOptions
:
function
(){
"
string
"
==
typeof
this
.
options
.
addClass
&&
(
this
.
options
.
addClass
=
{
wrapper
:
this
.
options
.
addClass
}),
"
object
"
!=
typeof
this
.
options
.
setStyles
||
this
.
options
.
setStyles
.
wrapper
||
this
.
options
.
setStyles
.
container
||
this
.
options
.
setStyles
.
content
||
this
.
options
.
setStyles
.
title
||
this
.
options
.
setStyles
.
footer
||
(
this
.
options
.
setStyles
=
{
wrapper
:
this
.
options
.
setStyles
}),
this
.
options
.
fade
=
{
open
:
this
.
options
.
fade
.
open
||
1
==
this
.
options
.
fade
,
close
:
this
.
options
.
fade
.
close
||
1
==
this
.
options
.
fade
},
this
.
options
.
fadeDuration
=
{
open
:
this
.
options
.
fadeDuration
.
open
||
this
.
options
.
fadeDuration
,
close
:
this
.
options
.
fadeDuration
.
close
||
this
.
options
.
fadeDuration
}},
construct
:
function
(){
if
(
this
.
wrapper
)
return
null
;
this
.
wrapper
=
new
Element
(
"
div
"
,{
id
:
this
.
id
,
class
:
"
mBox
"
+
(
this
.
defaultTheme
||
"
Core
"
)
+
(
this
.
options
.
theme
?
"
-
"
+
this
.
options
.
theme
:
""
)
+
"
"
+
(
this
.
options
.
addClass
.
wrapper
||
""
),
styles
:{
zIndex
:
this
.
options
.
zIndex
,
position
:
0
==
this
.
options
.
fixed
||
Browser
.
ie6
||
Browser
.
ie7
?
"
absolute
"
:
"
fixed
"
,
display
:
"
none
"
,
opacity
:
1
e
-
5
,
top
:
-
12
e3
,
left
:
-
12
e3
,
zoom
:
1
}}).
setStyles
(
this
.
options
.
setStyles
.
wrapper
||
{});
var
t
=
$
(
t
)
||
t
||
this
.
target
||
$
(
this
.
options
.
target
)
||
this
.
options
.
target
||
$
(
this
.
options
.
attach
);
t
&&
"
element
"
===
typeOf
(
t
)?
this
.
wrapper
.
inject
(
t
,
"
after
"
):
this
.
wrapper
.
inject
(
document
.
body
,
"
bottom
"
),
this
.
options
.
closeOnMouseleave
&&
this
.
wrapper
.
addEvents
({
mouseenter
:
function
(
t
){
this
.
open
()}.
bind
(
this
),
mouseleave
:
function
(
t
){
this
.
close
()}.
bind
(
this
)}),
this
.
container
=
new
Element
(
"
div
"
,{
class
:
"
mBoxContainer
"
+
(
this
.
options
.
addClass
.
container
||
""
)}).
setStyles
(
this
.
options
.
setStyles
.
container
||
{}).
inject
(
this
.
wrapper
),
this
.
content
=
new
Element
(
"
div
"
,{
class
:
"
mBoxContent
"
+
(
this
.
options
.
addClass
.
content
||
""
),
styles
:{
width
:
this
.
options
.
width
,
height
:
this
.
options
.
height
}}).
setStyles
(
this
.
options
.
setStyles
.
content
||
{}).
inject
(
this
.
container
),
this
.
load
(
this
.
options
.
content
,
this
.
options
.
title
,
this
.
options
.
footer
,
!
0
),
this
.
fireEvent
(
"
systemBoxReady
"
).
fireEvent
(
"
boxReady
"
)},
addListeners
:
function
(
t
){
if
(
t
=
t
||
this
.
options
.
attach
,
elements
=
Array
.
from
(
$
(
t
)).
combine
(
Array
.
from
(
$$
(
"
.
"
+
t
))).
combine
(
Array
.
from
(
$$
(
t
))).
clean
(),
!
elements
||
0
==
elements
.
length
)
return
this
;
switch
(
this
.
targets
.
combine
(
elements
),
this
.
options
.
event
){
case
"
mouseenter
"
:
case
"
mouseover
"
:
var
e
=
{
mouseenter
:
function
(
t
){
this
.
target
=
this
.
getTargetFromEvent
(
t
),
this
.
source
=
this
.
getTargetElementFromEvent
(
t
),
this
.
open
()}.
bind
(
this
),
mouseleave
:
function
(
t
){
this
.
close
()}.
bind
(
this
)};
break
;
default
:
e
=
{
click
:
function
(
t
){
this
.
options
.
preventDefault
&&
t
.
preventDefault
(),
this
.
isOpen
?
this
.
close
():(
this
.
target
=
this
.
getTargetFromEvent
(
t
),
this
.
source
=
this
.
getTargetElementFromEvent
(
t
),
this
.
open
())}.
bind
(
this
)}}
$$
(
elements
).
each
(
function
(
t
){
t
.
retrieve
(
"
mBoxElementEventsAdded
"
+
this
.
id
)
||
t
.
addEvents
(
e
).
store
(
"
mBoxElementEventsAdded
"
+
this
.
id
,
!
0
)}.
bind
(
this
))},
loadAjax
:
function
(
t
){
this
.
ajaxRequest
||
(
this
.
ajaxRequest
=
new
Request
.
HTML
({
link
:
"
cancel
"
,
update
:
this
.
content
,
onRequest
:
function
(){
this
.
setContent
(
""
),
this
.
wrapper
.
addClass
(
"
mBoxLoading
"
)}.
bind
(
this
),
onComplete
:
function
(){
this
.
wrapper
.
removeClass
(
"
mBoxLoading
"
),
"
auto
"
!=
this
.
options
.
width
&&
"
auto
"
!=
this
.
options
.
height
||
this
.
setPosition
(),
this
.
fireEvent
(
"
ajaxComplete
"
)}.
bind
(
this
)}).
send
()),
this
.
ajaxRequest
.
send
(
t
),
this
.
ajaxLoaded
=!
0
},
open
:
function
(
t
){
if
(
this
.
wrapper
||
this
.
construct
(),
"
object
"
!=
typeof
t
&&
(
t
=
{}),
clearTimeout
(
this
.
timer
),
!
this
.
isOpen
&&!
this
.
block
){
var
e
=
function
(){
this
.
ignoreDelayOnce
=!
1
,
this
.
fireEvent
(
"
systemOpenComplete
"
).
fireEvent
(
"
openComplete
"
)}.
bind
(
this
),
i
=
function
(
e
){
if
(
this
.
isOpen
=!
0
,
"
ajax
"
!=
this
.
options
.
load
||!
this
.
options
.
url
||
this
.
ajaxLoaded
&&!
this
.
options
.
reload
||
this
.
loadAjax
({
url
:
this
.
options
.
url
}),
this
.
target
=
this
.
getTarget
(
t
.
target
||
null
),
this
.
options
.
setContent
&&
this
.
source
&&
this
.
source
.
getAttribute
(
this
.
options
.
setContent
))
if
(
$
(
this
.
source
.
getAttribute
(
this
.
options
.
setContent
)))
this
.
content
.
getChildren
().
setStyle
(
"
display
"
,
"
none
"
),
$
(
this
.
source
.
getAttribute
(
this
.
options
.
setContent
)).
setStyle
(
"
display
"
,
""
);
else
{
var
i
=
this
.
source
.
getAttribute
(
this
.
options
.
setContent
).
split
(
"
|
"
),
o
=
i
[
0
]
||
null
,
n
=
i
[
1
]
||
null
,
s
=
i
[
2
]
||
null
;
this
.
load
(
o
,
n
,
s
)}
this
.
wrapper
&&
this
.
wrapper
.
inject
(
document
.
body
,
"
bottom
"
),
this
.
setPosition
(
null
,
t
.
position
||
null
,
t
.
offset
||
null
),
this
.
fireEvent
(
"
systemOpen
"
).
fireEvent
(
"
open
"
),
this
.
fx
&&
this
.
fx
.
cancel
(),
this
.
wrapper
.
setStyles
({
display
:
""
}),
this
.
options
.
fadeWhenOpen
&&
this
.
wrapper
.
setStyle
(
"
opacity
"
,
0
),
this
.
fx
=
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
"
opacity
"
,
duration
:
this
.
options
.
fadeDuration
.
open
,
link
:
"
cancel
"
,
onComplete
:
e
})[
t
.
instant
||!
this
.
options
.
fade
.
open
?
"
set
"
:
"
start
"
](
1
),
!
t
.
instant
&&
this
.
options
.
fade
.
open
||
e
();
var
r
=
this
.
getTransition
();
r
.
open
&&
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
r
.
open
.
property
||
"
top
"
,
duration
:
r
.
open
.
duration
||
this
.
options
.
fadeDuration
.
open
,
transition
:
r
.
open
.
transition
||
null
,
onStart
:
r
.
open
.
onStart
||
null
,
onComplete
:
r
.
open
.
onComplete
||
null
}).
start
(
r
.
open
.
start
||
this
.
wrapper
.
getStyle
(
r
.
open
.
property
||
"
top
"
).
toInt
()
+
(
r
.
open
.
difference_start
||
0
),
r
.
open
.
end
||
this
.
wrapper
.
getStyle
(
r
.
open
.
property
||
"
top
"
).
toInt
()
+
(
r
.
open
.
difference_end
||
0
));
this
.
attachEvents
(),
this
.
options
.
overlay
&&
this
.
addOverlay
(
t
.
instant
||!
this
.
options
.
fade
.
open
),
this
.
options
.
delayOpenOnce
&&
(
this
.
delayOpenOnce
=!
0
)}.
bind
(
this
);
this
.
options
.
delayOpen
>
0
&&!
this
.
ignoreDelay
&&!
this
.
ignoreDelayOnce
&&!
this
.
delayOpenOnce
?
this
.
timer
=
i
.
delay
(
this
.
options
.
delayOpen
,
this
,
e
):
i
(
e
)}
return
this
},
close
:
function
(
t
){
if
(
"
object
"
!=
typeof
t
&&
(
t
=
{}),
clearTimeout
(
this
.
timer
),
this
.
isOpen
&&!
this
.
block
){
var
e
=
function
(){
if
(
this
.
delayOpenOnce
=!
1
,
this
.
ignoreDelayOnce
=!
1
,
this
.
wrapper
.
setStyle
(
"
display
"
,
"
none
"
),
this
.
fireEvent
(
"
systemCloseComplete
"
).
fireEvent
(
"
closeComplete
"
),
this
.
wrapper
){
var
t
=
this
.
target
||
$
(
this
.
options
.
target
)
||
this
.
options
.
target
||
$
(
this
.
options
.
attach
);
t
&&
"
element
"
===
typeOf
(
t
)
&&
this
.
wrapper
.
inject
(
t
)}}.
bind
(
this
),
i
=
function
(
e
){
this
.
isOpen
=!
1
,
this
.
fireEvent
(
"
systemClose
"
).
fireEvent
(
"
close
"
),
this
.
detachEvents
(),
this
.
options
.
overlay
&&
this
.
removeOverlay
(
t
.
instant
||!
this
.
options
.
fade
.
close
),
this
.
fx
&&
this
.
fx
.
cancel
(),
this
.
fx
=
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
"
opacity
"
,
duration
:
this
.
options
.
fadeDuration
.
close
,
link
:
"
cancel
"
,
onComplete
:
e
})[
t
.
instant
||!
this
.
options
.
fade
.
close
?
"
set
"
:
"
start
"
](
0
),
!
t
.
instant
&&
this
.
options
.
fade
.
close
||
e
();
var
i
=
this
.
getTransition
();
i
.
close
&&
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
i
.
close
.
property
||
"
top
"
,
duration
:
i
.
close
.
duration
||
this
.
options
.
fadeDuration
.
close
,
transition
:
i
.
close
.
transition
||
null
,
onStart
:
i
.
open
.
onStart
||
null
,
onComplete
:
i
.
open
.
onComplete
||
null
}).
start
(
i
.
close
.
start
||
this
.
wrapper
.
getStyle
(
i
.
close
.
property
||
"
top
"
).
toInt
()
+
(
i
.
close
.
difference_start
||
0
),
i
.
close
.
end
||
this
.
wrapper
.
getStyle
(
i
.
close
.
property
||
"
top
"
).
toInt
()
+
(
i
.
close
.
difference_end
||
0
))}.
bind
(
this
);
this
.
options
.
delayClose
>
0
&&!
this
.
ignoreDelay
&&!
this
.
ignoreDelayOnce
?
this
.
timer
=
i
.
delay
(
this
.
options
.
delayClose
,
this
,
e
):
i
(
e
)}
return
this
},
addOverlay
:
function
(
t
){
return
this
.
overlay
||
(
this
.
overlay
=
new
Element
(
"
div
"
,{
styles
:{
position
:
"
fixed
"
,
top
:
0
,
left
:
0
,
width
:
"
100%
"
,
height
:
"
100%
"
,
zIndex
:
this
.
wrapper
.
getStyle
(
"
zIndex
"
)
-
1
,
background
:
this
.
options
.
overlayStyles
.
color
||
"
white
"
,
opacity
:.
001
,
display
:
"
none
"
}}).
set
(
"
tween
"
,{
duration
:
this
.
options
.
overlayFadeDuration
,
link
:
"
cancel
"
}).
inject
(
$
(
document
.
body
),
"
bottom
"
)),
this
.
overlay
.
setStyle
(
"
display
"
,
"
block
"
)[
t
?
"
set
"
:
"
tween
"
](
"
opacity
"
,
this
.
options
.
overlayStyles
.
opacity
||
.
001
),
this
},
removeOverlay
:
function
(
t
){
return
this
.
overlay
&&
this
.
overlay
[
t
?
"
set
"
:
"
tween
"
](
"
opacity
"
,
0
).
get
(
"
tween
"
).
chain
(
function
(){
this
.
overlay
.
setStyle
(
"
display
"
,
"
none
"
)}.
bind
(
this
)),
this
},
getTarget
:
function
(
t
){
return
"
mouse
"
==
(
t
=
$
(
t
)
||
t
||
this
.
target
||
$
(
this
.
options
.
target
)
||
this
.
options
.
target
||
$
(
this
.
options
.
attach
))?
"
mouse
"
:
this
.
fixOperaPositioning
(
$
(
t
))},
getTargetFromEvent
:
function
(
t
){
return
this
.
options
.
target
?
this
.
fixOperaPositioning
(
$
(
this
.
options
.
target
)):
this
.
getTargetElementFromEvent
(
t
)},
getTargetElementFromEvent
:
function
(
t
){
if
(
t
&&
t
.
target
){
if
(
this
.
targets
.
contains
(
t
.
target
))
return
this
.
fixOperaPositioning
(
t
.
target
);
for
(
var
e
=
t
.
target
.
getParent
();
null
!=
e
;){
if
(
this
.
targets
.
contains
(
e
))
return
this
.
fixOperaPositioning
(
e
);
e
=
e
.
getParent
()}}
return
null
},
fixOperaPositioning
:
function
(
t
){
if
(
$
(
t
)
&&!
$
(
t
).
retrieve
(
"
OperaBugFixed
"
)
&&
t
!=
window
){
try
{
$
(
t
).
getStyle
(
"
border-top-width
"
).
toInt
()
+
$
(
t
).
getStyle
(
"
border-right-width
"
).
toInt
()
+
$
(
t
).
getStyle
(
"
border-bottom-width
"
).
toInt
()
+
$
(
t
).
getStyle
(
"
border-left-width
"
).
toInt
()
||
$
(
t
).
setStyle
(
"
border
"
,
0
)}
catch
(
t
){}
$
(
t
).
store
(
"
OperaBugFixed
"
)}
return
t
},
getPosition
:
function
(
t
){
return
!
t
&&
this
.
position
||
(
t
=
t
||
this
.
options
.
position
,
this
.
position
=
{},
this
.
position
.
x
=
"
object
"
==
typeof
t
&&
"
number
"
==
typeof
t
.
x
?[
t
.
x
.
toInt
(),
null
]:
"
object
"
!=
typeof
t
||!
t
.
x
||
"
center
"
==
t
.
x
||
"
object
"
==
typeof
t
.
x
&&
"
center
"
==
t
.
x
[
0
]?[
"
center
"
,
null
]:[
"
right
"
,
"
left
"
].
contains
(
t
.
x
)?[
t
.
x
,
this
.
defaultInOut
||
"
inside
"
]:
"
object
"
==
typeof
t
.
x
&&
[
"
right
"
,
"
left
"
].
contains
(
t
.
x
[
0
])?[
t
.
x
[
0
],[
"
inside
"
,
"
center
"
,
"
outside
"
].
contains
(
t
.
x
[
1
])?
t
.
x
[
1
]:
this
.
defaultInOut
||
"
inside
"
]:[
"
center
"
,
null
],
this
.
position
.
xAttribute
=
"
right
"
==
this
.
position
.
x
[
3
]
||
"
inside
"
==
this
.
position
.
x
[
1
]
&&
"
right
"
==
this
.
position
.
x
[
0
]?
"
right
"
:
"
left
"
,
this
.
position
.
y
=
"
object
"
==
typeof
t
&&
"
number
"
==
typeof
t
.
y
?[
t
.
y
.
toInt
(),
null
]:
"
object
"
!=
typeof
t
||!
t
.
y
||
"
center
"
==
t
.
y
||
"
object
"
==
typeof
t
.
y
&&
"
center
"
==
t
.
y
[
0
]?[
"
center
"
,
null
]:[
"
top
"
,
"
bottom
"
].
contains
(
t
.
y
)?[
t
.
y
,
this
.
defaultInOut
||
"
inside
"
]:
"
object
"
==
typeof
t
.
y
&&
[
"
top
"
,
"
bottom
"
].
contains
(
t
.
y
[
0
])?[
t
.
y
[
0
],[
"
inside
"
,
"
center
"
,
"
outside
"
].
contains
(
t
.
y
[
1
])?
t
.
y
[
1
]:
this
.
defaultInOut
||
"
inside
"
]:[
"
center
"
,
null
],
this
.
position
.
yAttribute
=
"
bottom
"
==
this
.
position
.
x
[
3
]
||
"
inside
"
==
this
.
position
.
y
[
1
]
&&
"
bottom
"
==
this
.
position
.
y
[
0
]?
"
bottom
"
:
"
top
"
),
this
.
position
},
getOffset
:
function
(
t
){
return
!
t
&&
this
.
offset
||
(
t
=
t
||
this
.
options
.
offset
,
this
.
offset
=
{},
this
.
offset
.
x
=
"
number
"
==
typeof
t
?
t
:
t
.
x
&&
(
t
.
x
.
toInt
()
>=
0
||
t
.
x
.
toInt
()
<
0
)?
t
.
x
.
toInt
():
0
,
this
.
offset
.
y
=
"
number
"
==
typeof
t
?
t
:
t
.
y
&&
(
t
.
y
.
toInt
()
>=
0
||
t
.
y
.
toInt
()
<
0
)?
t
.
y
.
toInt
():
0
),
this
.
offset
},
getPointer
:
function
(
t
){
if
(
!
t
&&
this
.
pointer
)
return
this
.
pointer
;
if
(
!
(
t
=
t
||
this
.
options
.
pointer
))
return
!
1
;
var
e
=
this
.
getPosition
();
if
(
this
.
pointer
=
{},
"
outside
"
==
e
.
y
[
1
])
this
.
pointer
.
position
=
"
bottom
"
==
e
.
y
[
0
]?
"
top
"
:
"
bottom
"
,
this
.
pointer
.
adjustment
=
"
object
"
==
typeof
t
&&
[
"
center
"
,
"
right
"
,
"
left
"
].
contains
(
t
[
0
])?
t
[
0
]:[
"
center
"
,
"
right
"
,
"
left
"
].
contains
(
t
)?
t
:
"
center
"
;
else
{
if
(
"
outside
"
!=
e
.
x
[
1
])
return
null
;
this
.
pointer
.
position
=
"
left
"
==
e
.
x
[
0
]?
"
right
"
:
"
left
"
,
this
.
pointer
.
adjustment
=
"
object
"
==
typeof
t
&&
[
"
center
"
,
"
top
"
,
"
bottom
"
].
contains
(
t
[
0
])?
t
[
0
]:[
"
center
"
,
"
top
"
,
"
bottom
"
].
contains
(
t
)?
t
:
"
center
"
}
return
this
.
pointer
.
offset
=
"
object
"
==
typeof
t
&&
t
[
1
]
&&
"
number
"
==
typeof
t
[
1
].
toInt
()?
t
[
1
].
toInt
():
0
,
this
.
pointer
.
offset
=
this
.
pointer
.
offset
<
0
?
-
1
*
this
.
pointer
.
offset
:
this
.
pointer
.
offset
,
this
.
pointer
.
offset
=
"
right
"
==
this
.
pointer
.
adjustment
||
"
bottom
"
==
this
.
pointer
.
adjustment
?
-
1
*
this
.
pointer
.
offset
:
this
.
pointer
.
offset
,
this
.
pointer
},
getTransition
:
function
(){
if
(
this
.
transition
)
return
this
.
transition
;
if
(
this
.
options
.
transition
&&
[
"
flyin
"
,
"
flyout
"
,
"
flyinout
"
,
"
flyoutin
"
,
"
bounce
"
,
"
bouncein
"
,
"
bounceout
"
,
"
bounceinout
"
,
"
bouncefly
"
].
contains
(
this
.
options
.
transition
)){
this
.
transition
=
{},
this
.
transition
.
open
=
{
property
:
"
top
"
==
this
.
position
.
yAttribute
||
"
bottom
"
==
this
.
position
.
yAttribute
?
this
.
position
.
yAttribute
:
this
.
position
.
xAttribute
,
transition
:
"
quad:out
"
,
duration
:
300
},
this
.
transition
.
close
=
Object
.
clone
(
this
.
transition
.
open
);
var
t
=
20
*
(
"
bottom
"
==
this
.
position
.
yAttribute
||
"
right
"
==
this
.
position
.
xAttribute
?
-
1
:
1
);
switch
(
this
.
options
.
transition
){
case
"
flyin
"
:
case
"
flyout
"
:
this
.
transition
.
open
.
difference_start
=
this
.
transition
.
close
.
difference_end
=
t
*
(
"
flyin
"
==
this
.
options
.
transition
?
-
1
:
1
);
break
;
case
"
flyinout
"
:
case
"
flyoutin
"
:
t
*=
"
flyinout
"
==
this
.
options
.
transition
?
1
:
-
1
,
this
.
transition
.
open
.
difference_start
=-
1
*
t
,
this
.
transition
.
close
.
difference_end
=
t
;
break
;
case
"
bounce
"
:
case
"
bouncefly
"
:
case
"
bouncein
"
:
case
"
bounceout
"
:
case
"
bounceinout
"
:
this
.
transition
.
open
.
transition
=
"
bounce:out
"
,
this
.
transition
.
open
.
duration
=
450
,
this
.
transition
.
open
.
difference_start
=-
1
*
t
,
"
bounceinout
"
!=
this
.
options
.
transition
&&
"
bounceout
"
!=
this
.
options
.
transition
&&
"
bouncefly
"
!=
this
.
options
.
transition
||
(
this
.
transition
.
close
.
difference_end
=-
1
*
t
)}}
else
this
.
transition
=
{},
this
.
transition
.
open
=
null
!=
typeof
this
.
options
.
transition
.
open
?
this
.
options
.
transition
.
open
:
this
.
options
.
transition
,
this
.
transition
.
close
=
null
!=
typeof
this
.
options
.
transition
.
close
?
this
.
options
.
transition
.
close
:
this
.
options
.
transition
;
return
this
.
transition
},
setPosition
:
function
(
t
,
e
,
i
){
if
(
t
=
this
.
getTarget
(
t
),
e
=
this
.
getPosition
(
e
),
i
=
this
.
getOffset
(
i
),
pointer
=
this
.
getPointer
(),
"
mouse
"
==
t
)
return
r
=
(
this
.
mouseX
||
0
)
+
15
+
i
.
x
,
h
=
(
this
.
mouseY
||
0
)
+
15
+
i
.
y
,
this
.
wrapper
.
setStyles
({
left
:
Math
.
floor
(
r
),
top
:
Math
.
floor
(
h
)}),
this
;
if
(
!
t
||
[
$
(
window
),
$
(
document
),
$
(
document
.
body
)].
contains
(
t
)){
var
o
=
"
fixed
"
==
this
.
wrapper
.
getStyle
(
"
position
"
)?{
x
:
0
,
y
:
0
}:
$
(
window
).
getScroll
();(
s
=
$
(
window
).
getSize
()).
width
=
s
.
totalWidth
=
s
.
x
,
s
.
height
=
s
.
totalHeight
=
s
.
y
;
var
n
=
{
top
:
o
.
y
,
left
:
o
.
x
,
right
:
o
.
x
+
s
.
width
,
bottom
:
o
.
y
+
s
.
height
}}
else
{
1
!=!
this
.
options
.
fixed
&&
this
.
wrapper
.
setStyle
(
"
position
"
,
"
absolute
"
);
var
s
=
t
.
getDimensions
({
computeSize
:
!
0
});
n
=
t
.
getCoordinates
();
0
==
s
.
totalWidth
&&
(
s
.
width
=
s
.
totalWidth
=
n
.
width
,
s
.
height
=
s
.
totalHeight
=
n
.
height
)}
var
r
=
n
.
left
||
0
,
h
=
n
.
top
||
0
,
a
=
this
.
wrapper
.
getDimensions
({
computeSize
:
!
0
});
if
(
pointer
&&!
this
.
pointerElement
){
if
(
this
.
pointerElement
=
new
Element
(
"
div
"
,{
class
:
"
mBoxPointer mBoxPointer
"
+
pointer
.
position
.
capitalize
(),
styles
:{
position
:
"
absolute
"
}}).
setStyle
(
pointer
.
position
,
0
).
inject
(
this
.
wrapper
,
"
top
"
),
Browser
.
opera
){
var
p
=
new
Element
(
"
div
"
,{
class
:
"
mBox
"
+
(
this
.
defaultTheme
||
"
Core
"
)
+
(
this
.
options
.
theme
?
"
-
"
+
this
.
options
.
theme
:
""
)}).
inject
(
document
.
body
).
grab
(
this
.
pointerElement
);
this
.
pointerDimensions
=
this
.
pointerElement
.
getDimensions
({
computeSize
:
!
0
}),
this
.
pointerElement
.
inject
(
this
.
wrapper
,
"
top
"
),
p
.
destroy
()}
else
this
.
pointerDimensions
=
this
.
pointerElement
.
getDimensions
({
computeSize
:
!
0
});
this
.
container
.
setStyle
(
"
margin-
"
+
pointer
.
position
,
"
left
"
==
pointer
.
position
||
"
right
"
==
pointer
.
position
?
this
.
pointerDimensions
.
width
-
this
.
container
.
getStyle
(
"
border-
"
+
pointer
.
position
).
toInt
():
this
.
pointerDimensions
.
height
-
this
.
container
.
getStyle
(
"
border-
"
+
pointer
.
position
).
toInt
())}
if
(
pointer
&&
this
.
pointerElement
){
if
(
"
outside
"
==
e
.
x
[
1
]
&&
"
outside
"
==
e
.
y
[
1
]
&&
"
center
"
==
pointer
.
adjustment
)
switch
(
pointer
.
adjustment
=
"
left
"
==
e
.
x
[
0
]?
"
right
"
:
"
left
"
,
e
.
x
[
0
]){
case
"
left
"
:
r
+=
a
.
totalWidth
-
this
.
pointerDimensions
.
width
/
2
;
break
;
case
"
right
"
:
r
-=
this
.
pointerDimensions
.
width
/
2
}
var
l
=
0
,
c
=
0
,
d
=
0
;
switch
(
pointer
.
adjustment
){
case
"
center
"
:
l
=
"
top
"
==
pointer
.
position
||
"
bottom
"
==
pointer
.
position
?
a
.
totalWidth
/
2
-
this
.
pointerDimensions
.
width
/
2
:
a
.
totalHeight
/
2
-
this
.
pointerDimensions
.
height
/
2
;
break
;
case
"
left
"
:
case
"
right
"
:
switch
(
e
.
x
[
1
]){
case
"
inside
"
:
c
+=
this
.
pointerDimensions
.
width
/
2
*-
1
+
(
"
right
"
==
e
.
x
[
0
]?
a
.
totalWidth
:
0
);
break
;
default
:
"
center
"
==
e
.
x
[
0
]
&&
(
c
+=
a
.
totalWidth
/
2
-
this
.
pointerDimensions
.
width
/
2
)}
r
+=
c
-
(
"
right
"
==
pointer
.
adjustment
?
a
.
totalWidth
-
this
.
pointerDimensions
.
width
:
0
),
l
=
"
right
"
==
pointer
.
adjustment
?
a
.
totalWidth
-
this
.
pointerDimensions
.
width
:
0
;
break
;
case
"
top
"
:
case
"
bottom
"
:
switch
(
e
.
y
[
1
]){
case
"
inside
"
:
d
+=
this
.
pointerDimensions
.
height
/
2
*-
1
+
(
"
bottom
"
==
e
.
y
[
0
]?
a
.
totalHeight
:
0
);
break
;
default
:
"
center
"
==
e
.
y
[
0
]
&&
(
d
+=
a
.
totalHeight
/
2
-
this
.
pointerDimensions
.
height
/
2
)}
h
+=
d
-
(
"
bottom
"
==
pointer
.
adjustment
?
a
.
totalHeight
-
this
.
pointerDimensions
.
height
:
0
),
l
=
"
bottom
"
==
pointer
.
adjustment
?
a
.
totalHeight
-
this
.
pointerDimensions
.
height
:
0
}
switch
(
pointer
.
position
){
case
"
top
"
:
case
"
bottom
"
:
r
+=-
1
*
pointer
.
offset
;
break
;
case
"
left
"
:
case
"
right
"
:
h
+=-
1
*
pointer
.
offset
}
this
.
pointerElement
.
setStyle
(
"
top
"
==
pointer
.
position
||
"
bottom
"
==
pointer
.
position
?
"
left
"
:
"
top
"
,
l
+
pointer
.
offset
)}
switch
(
a
=
this
.
wrapper
.
getDimensions
({
computeSize
:
!
0
}),
e
.
x
[
0
]){
case
"
center
"
:
r
+=
s
.
totalWidth
/
2
-
a
.
totalWidth
/
2
;
break
;
case
"
right
"
:
r
+=
s
.
totalWidth
-
(
"
inside
"
==
e
.
x
[
1
]?
a
.
totalWidth
:
"
center
"
==
e
.
x
[
1
]?
a
.
totalWidth
/
2
:
0
);
break
;
case
"
left
"
:
r
-=
"
outside
"
==
e
.
x
[
1
]?
a
.
totalWidth
:
"
center
"
==
e
.
x
[
1
]?
a
.
totalWidth
/
2
:
0
;
break
;
default
:
r
=
e
.
x
}
switch
(
e
.
y
[
0
]){
case
"
center
"
:
h
+=
s
.
totalHeight
/
2
-
a
.
totalHeight
/
2
;
break
;
case
"
bottom
"
:
h
+=
s
.
totalHeight
-
(
"
inside
"
==
e
.
y
[
1
]?
a
.
totalHeight
:
"
center
"
==
e
.
y
[
1
]?
a
.
totalHeight
/
2
:
0
);
break
;
case
"
top
"
:
h
-=
"
outside
"
==
e
.
y
[
1
]?
a
.
totalHeight
:
"
center
"
==
e
.
y
[
1
]?
a
.
totalHeight
/
2
:
0
;
break
;
default
:
r
=
e
.
y
}
this
.
wrapper
.
setStyles
({
top
:
null
,
right
:
null
,
bottom
:
null
,
left
:
null
});
var
u
=
$
(
window
).
getSize
();
return
"
right
"
==
e
.
xAttribute
&&
(
r
=
u
.
x
-
(
r
+
a
.
totalWidth
)),
"
bottom
"
==
e
.
yAttribute
&&
(
h
=
u
.
y
-
(
h
+
a
.
totalHeight
)),
r
=
r
||
0
,
r
+=
i
.
x
,
h
+=
i
.
y
,
this
.
wrapper
.
setStyle
(
e
.
xAttribute
,
r
.
floor
()),
this
.
wrapper
.
setStyle
(
e
.
yAttribute
,
h
.
floor
()),
this
},
setContent
:
function
(
t
,
e
){
return
null
!=
t
&&
(
$
(
t
)
||
$$
(
"
.
"
+
t
).
length
>
0
?(
this
[
e
||
"
content
"
].
grab
(
$
(
t
)
||
$$
(
"
.
"
+
t
)),
$
(
t
)
&&
$
(
t
).
setStyle
(
"
display
"
,
""
)):
null
!=
t
&&
(
t
=
(
t
=
t
.
replace
(
/
(?:
<script
[\s\S]
*
?)(?:(?:
<
\/
script>
)
|
(?:\/
>
))
/gim
,
""
)).
replace
(
/<
[^
>
]
+/gim
,(
function
(
t
){
return
t
.
replace
(
/ on
\w
+=
[\"\'\S][^
"
]
*
[\"\'\S]
/gim
,
""
).
replace
(
/javascript/gim
,
""
)})),
this
[
e
||
"
content
"
].
set
(
"
html
"
,
t
))),
this
},
setTitle
:
function
(
t
){
return
null
==
t
||
this
.
titleContainer
||
(
this
.
titleContainer
=
new
Element
(
"
div
"
,{
class
:
"
mBoxTitleContainer
"
}).
inject
(
this
.
container
,
"
top
"
),
this
.
title
=
new
Element
(
"
div
"
,{
class
:
"
mBoxTitle
"
+
(
this
.
options
.
addClass
.
title
||
""
),
styles
:
this
.
options
.
setStyles
.
title
||
{}}).
inject
(
this
.
titleContainer
),
this
.
wrapper
.
addClass
(
"
hasTitle
"
),
this
.
options
.
draggable
&&
null
!=
window
.
Drag
&&
(
new
Drag
(
this
.
wrapper
,{
handle
:
this
.
titleContainer
}),
this
.
titleContainer
.
addClass
(
"
mBoxDraggable
"
)),
this
.
options
.
closeInTitle
&&
new
Element
(
"
div
"
,{
class
:
"
mBoxClose
"
,
events
:{
click
:
function
(){
this
.
close
()}.
bind
(
this
)}}).
grab
(
new
Element
(
"
div
"
)).
inject
(
this
.
titleContainer
)),
null
!=
t
&&
this
.
setContent
(
t
,
"
title
"
),
this
},
setFooter
:
function
(
t
){
return
null
==
t
||
this
.
footerContainer
||
(
this
.
footerContainer
=
new
Element
(
"
div
"
,{
class
:
"
mBoxFooterContainer
"
}).
inject
(
this
.
container
,
"
bottom
"
),
this
.
footer
=
new
Element
(
"
div
"
,{
class
:
"
mBoxFooter
"
+
(
this
.
options
.
addClass
.
footer
||
""
),
styles
:
this
.
options
.
setStyles
.
footer
||
{}}).
inject
(
this
.
footerContainer
),
this
.
wrapper
.
addClass
(
"
hasFooter
"
)),
null
!=
t
&&
this
.
setContent
(
t
,
"
footer
"
),
this
},
load
:
function
(
t
,
e
,
i
){
return
this
.
setContent
(
t
),
this
.
setTitle
(
e
),
this
.
setFooter
(
i
),
this
},
getHTML
:
function
(
t
,
e
,
i
){
return
this
.
load
(
t
,
e
,
i
),
"
<div>
"
+
this
.
wrapper
.
get
(
"
html
"
)
+
"
</div>
"
},
attachEvents
:
function
(){
this
.
escEvent
=
function
(
t
){
"
esc
"
==
t
.
key
&&
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnEsc
&&
$
(
window
).
addEvent
(
"
keyup
"
,
this
.
escEvent
),
this
.
resizeEvent
=
function
(
t
){
this
.
setPosition
()}.
bind
(
this
),
$
(
window
).
addEvent
(
"
resize
"
,
this
.
resizeEvent
),
this
.
options
.
fixed
&&
(
Browser
.
ie6
||
Browser
.
ie7
)
&&
$
(
window
).
addEvent
(
"
scroll
"
,
this
.
resizeEvent
),
this
.
closeOnClickEvent
=
function
(
t
){
this
.
isOpen
&&
$
(
this
.
options
.
attach
)
!=
t
.
target
&&!
$$
(
"
.
"
+
this
.
options
.
attach
).
contains
(
t
.
target
)
&&
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnClick
&&
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnClickEvent
),
this
.
closeOnBoxClickEvent
=
function
(
t
){
this
.
isOpen
&&
(
this
.
wrapper
==
t
.
target
||
this
.
wrapper
.
contains
(
t
.
target
))
&&
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnBoxClick
&&
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnBoxClickEvent
),
this
.
closeOnWrapperClickEvent
=
function
(
t
){
this
.
isOpen
&&
this
.
wrapper
==
t
.
target
&&
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnWrapperClick
&&
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnWrapperClickEvent
),
this
.
closeOnBodyClickEvent
=
function
(
t
){
!
this
.
isOpen
||
$
(
this
.
options
.
attach
)
==
t
.
target
||
$$
(
"
.
"
+
this
.
options
.
attach
).
contains
(
t
.
target
)
||
t
.
target
==
this
.
wrapper
||
this
.
wrapper
.
contains
(
t
.
target
)
||
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnBodyClick
&&
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnBodyClickEvent
),
this
.
mouseMoveEvent
=
function
(
t
){
this
.
mouseX
=
t
.
page
.
x
,
this
.
mouseY
=
t
.
page
.
y
,
this
.
setPosition
(
"
mouse
"
)}.
bind
(
this
),
"
mouse
"
==
this
.
target
&&
$
(
document
).
addEvent
(
"
mousemove
"
,
this
.
mouseMoveEvent
)},
detachEvents
:
function
(){
this
.
options
.
fixed
&&
(
Browser
.
ie6
||
Browser
.
ie7
)
&&
$
(
window
).
removeEvent
(
"
scroll
"
,
this
.
resizeEvent
),
$
(
window
).
removeEvent
(
"
keyup
"
,
this
.
keyEvent
),
$
(
window
).
removeEvent
(
"
resize
"
,
this
.
resizeEvent
),
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnClickEvent
),
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnBoxClickEvent
),
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnWrapperClickEvent
),
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnBodyClickEvent
),
$
(
document
).
removeEvent
(
"
mousemove
"
,
this
.
mouseMoveEvent
)},
destroy
:
function
(){
mBox
.
instances
.
erase
(
this
),
this
.
detachEvents
(),
this
.
wrapper
.
dispose
(),
delete
this
.
wrapper
}});
mBox
.
instances
=
[],
mBox
.
currentId
=
0
,
mBox
.
reInit
=
function
(){
mBox
.
addConfirmEvents
&&
mBox
.
addConfirmEvents
(),
mBox
.
instances
.
each
((
function
(
t
){
try
{
t
.
reInit
()}
catch
(
t
){}}))},
mBox
.
Notice
=
new
Class
({
Extends
:
mBox
,
options
:{
type
:
"
Default
"
,
position
:{
x
:[
"
left
"
,
"
inside
"
],
y
:[
"
bottom
"
,
"
inside
"
]},
offset
:{
x
:
30
,
y
:
30
},
fixed
:
!
0
,
move
:
!
0
,
moveDuration
:
500
,
delayClose
:
4
e3
,
fade
:
!
0
,
fadeDuration
:{
open
:
250
,
close
:
400
},
target
:
$
(
window
),
zIndex
:
1
e6
,
closeOnEsc
:
!
1
,
closeOnBoxClick
:
!
0
,
closeOnBodyClick
:
!
1
,
openOnInit
:
!
0
},
initialize
:
function
(
t
){
this
.
defaultInOut
=
"
inside
"
,
this
.
defaultTheme
=
"
Notice
"
,
t
.
onSystemBoxReady
=
function
(){
if
(
this
.
container
.
addClass
(
"
mBoxNotice
"
+
(
this
.
options
.
type
.
capitalize
()
||
"
Default
"
)),
this
.
options
.
move
&&
(
"
inside
"
==
this
.
position
.
x
[
1
]
||
"
center
"
==
this
.
position
.
x
[
0
])
&&
"
inside
"
==
this
.
position
.
y
[
1
]
&&
(
"
top
"
==
this
.
position
.
y
[
0
]
||
"
bottom
"
==
this
.
position
.
y
[
0
])){
var
t
=
this
.
wrapper
.
getDimensions
({
computeSize
:
!
0
});
this
.
container
.
setStyle
(
"
position
"
,
"
absolute
"
),
this
.
container
.
setStyle
(
"
top
"
==
this
.
position
.
y
[
0
]?
"
bottom
"
:
"
top
"
,
0
),
this
.
wrapper
.
setStyles
({
height
:
0
,
width
:
t
.
totalWidth
,
overflowY
:
"
hidden
"
}),
this
.
options
.
transition
=
{
open
:{
transition
:
"
linear
"
,
property
:
"
height
"
,
duration
:
this
.
options
.
moveDuration
,
start
:
0
,
end
:
t
.
totalHeight
+
this
.
options
.
offset
.
y
}},
this
.
options
.
offset
.
y
=
0
,
this
.
options
.
delayClose
+=
this
.
options
.
moveDuration
}},
t
.
onSystemOpen
=
function
(){
$
(
window
).
retrieve
(
"
mBoxNotice
"
)
&&
(
$
(
window
).
retrieve
(
"
mBoxNotice
"
).
ignoreDelay
=!
0
,
$
(
window
).
retrieve
(
"
mBoxNotice
"
).
close
()),
$
(
window
).
store
(
"
mBoxNotice
"
,
this
)},
t
.
onSystemOpenComplete
=
function
(){
this
.
close
()},
t
.
onSystemCloseComplete
=
function
(){
this
.
destroy
()},
this
.
parent
(
t
)}});
\ No newline at end of file
\ No newline at end of file
o2web/source/o2_lib/mootools/plugin/mBox.js
浏览文件 @
0314daae
...
@@ -933,6 +933,10 @@ var mBox = new Class({
...
@@ -933,6 +933,10 @@ var mBox = new Class({
this
[
where
||
'
content
'
].
grab
(
$
(
content
)
||
$$
(
'
.
'
+
content
));
this
[
where
||
'
content
'
].
grab
(
$
(
content
)
||
$$
(
'
.
'
+
content
));
if
(
$
(
content
))
$
(
content
).
setStyle
(
'
display
'
,
''
);
if
(
$
(
content
))
$
(
content
).
setStyle
(
'
display
'
,
''
);
}
else
if
(
content
!=
null
)
{
}
else
if
(
content
!=
null
)
{
content
=
content
.
replace
(
/
(?:
<script
[\s\S]
*
?)(?:(?:
<
\/
script>
)
|
(?:\/
>
))
/gmi
,
''
)
content
=
content
.
replace
(
/<
[^
>
]
+/gmi
,
function
(
match
){
return
match
.
replace
(
/ on
\w
+=
[\"\'\S][^
"
]
*
[\"\'\S]
/gmi
,
''
).
replace
(
/javascript/gmi
,
''
);
});
this
[
where
||
'
content
'
].
set
(
'
html
'
,
content
);
this
[
where
||
'
content
'
].
set
(
'
html
'
,
content
);
}
}
}
}
...
...
o2web/source/o2_lib/mootools/plugin/mBox.min.js
浏览文件 @
0314daae
var
mBox
=
new
Class
({
Implements
:[
Options
,
Events
],
options
:{
id
:
""
,
theme
:
""
,
addClass
:{
wrapper
:
""
,
container
:
""
,
content
:
""
,
title
:
""
,
footer
:
""
},
setStyles
:{
wrapper
:{},
container
:{},
content
:{},
title
:{},
footer
:{}},
target
:
$
(
window
),
attach
:
null
,
event
:
"
click
"
,
preventDefault
:
!
1
,
width
:
"
auto
"
,
height
:
"
auto
"
,
zIndex
:
8
e3
,
content
:
null
,
setContent
:
"
data-setContent
"
,
load
:
null
,
url
:
""
,
reload
:
!
1
,
title
:
null
,
footer
:
null
,
draggable
:
!
1
,
position
:{
x
:
"
center
"
,
y
:
"
center
"
},
fixed
:
null
,
offset
:{
x
:
0
,
y
:
0
},
pointer
:
!
1
,
fade
:{
open
:
!
0
,
close
:
!
0
},
fadeDuration
:{
open
:
200
,
close
:
300
},
fadeWhenOpen
:
!
1
,
overlay
:
!
1
,
overlayStyles
:{
color
:
"
black
"
,
opacity
:.
75
},
overlayFadeDuration
:
100
,
transition
:{
open
:
null
,
close
:
null
},
closeOnEsc
:
!
0
,
closeOnClick
:
!
1
,
closeOnBoxClick
:
!
1
,
closeOnWrapperClick
:
!
1
,
closeOnBodyClick
:
!
0
,
closeOnMouseleave
:
!
1
,
closeInTitle
:
!
1
,
delayOpen
:
0
,
delayClose
:
0
,
delayOpenOnce
:
!
0
,
constructOnInit
:
!
0
,
openOnInit
:
!
1
},
initialize
:
function
(
t
){
this
.
block
=!
1
,
this
.
ignoreDelay
=!
1
,
this
.
ignoreDelayOnce
=!
1
,
this
.
setOptions
(
t
),
this
.
fixOptions
(),
this
.
getPosition
(),
this
.
target
=
this
.
getTarget
(),
null
==
this
.
options
.
fixed
&&
(
this
.
options
.
fixed
=
[
$
(
window
),
$
(
document
),
$
(
document
.
body
)].
contains
(
this
.
target
)),
"
mouse
"
==
this
.
target
&&
(
this
.
options
.
pointer
=!
1
),
this
.
targets
=
[],
this
.
id
=
this
.
options
.
id
||
"
mBox
"
+
++
mBox
.
currentId
,
this
.
addListeners
(),
this
.
options
.
constructOnInit
&&
this
.
construct
(),
this
.
fireEvent
(
"
init
"
).
fireEvent
(
"
systemInit
"
),
this
.
options
.
openOnInit
&&
this
.
open
(),
mBox
.
instances
.
push
(
this
)},
reInit
:
function
(){
this
.
addListeners
()},
fixOptions
:
function
(){
"
string
"
==
typeof
this
.
options
.
addClass
&&
(
this
.
options
.
addClass
=
{
wrapper
:
this
.
options
.
addClass
}),
"
object
"
!=
typeof
this
.
options
.
setStyles
||
this
.
options
.
setStyles
.
wrapper
||
this
.
options
.
setStyles
.
container
||
this
.
options
.
setStyles
.
content
||
this
.
options
.
setStyles
.
title
||
this
.
options
.
setStyles
.
footer
||
(
this
.
options
.
setStyles
=
{
wrapper
:
this
.
options
.
setStyles
}),
this
.
options
.
fade
=
{
open
:
this
.
options
.
fade
.
open
||
1
==
this
.
options
.
fade
,
close
:
this
.
options
.
fade
.
close
||
1
==
this
.
options
.
fade
},
this
.
options
.
fadeDuration
=
{
open
:
this
.
options
.
fadeDuration
.
open
||
this
.
options
.
fadeDuration
,
close
:
this
.
options
.
fadeDuration
.
close
||
this
.
options
.
fadeDuration
}},
construct
:
function
(){
if
(
this
.
wrapper
)
return
null
;
this
.
wrapper
=
new
Element
(
"
div
"
,{
id
:
this
.
id
,
class
:
"
mBox
"
+
(
this
.
defaultTheme
||
"
Core
"
)
+
(
this
.
options
.
theme
?
"
-
"
+
this
.
options
.
theme
:
""
)
+
"
"
+
(
this
.
options
.
addClass
.
wrapper
||
""
),
styles
:{
zIndex
:
this
.
options
.
zIndex
,
position
:
0
==
this
.
options
.
fixed
||
Browser
.
ie6
||
Browser
.
ie7
?
"
absolute
"
:
"
fixed
"
,
display
:
"
none
"
,
opacity
:
1
e
-
5
,
top
:
-
12
e3
,
left
:
-
12
e3
,
zoom
:
1
}}).
setStyles
(
this
.
options
.
setStyles
.
wrapper
||
{});
var
t
=
$
(
t
)
||
t
||
this
.
target
||
$
(
this
.
options
.
target
)
||
this
.
options
.
target
||
$
(
this
.
options
.
attach
);
t
&&
"
element
"
===
typeOf
(
t
)?
this
.
wrapper
.
inject
(
t
,
"
after
"
):
this
.
wrapper
.
inject
(
document
.
body
,
"
bottom
"
),
this
.
options
.
closeOnMouseleave
&&
this
.
wrapper
.
addEvents
({
mouseenter
:
function
(
t
){
this
.
open
()}.
bind
(
this
),
mouseleave
:
function
(
t
){
this
.
close
()}.
bind
(
this
)}),
this
.
container
=
new
Element
(
"
div
"
,{
class
:
"
mBoxContainer
"
+
(
this
.
options
.
addClass
.
container
||
""
)}).
setStyles
(
this
.
options
.
setStyles
.
container
||
{}).
inject
(
this
.
wrapper
),
this
.
content
=
new
Element
(
"
div
"
,{
class
:
"
mBoxContent
"
+
(
this
.
options
.
addClass
.
content
||
""
),
styles
:{
width
:
this
.
options
.
width
,
height
:
this
.
options
.
height
}}).
setStyles
(
this
.
options
.
setStyles
.
content
||
{}).
inject
(
this
.
container
),
this
.
load
(
this
.
options
.
content
,
this
.
options
.
title
,
this
.
options
.
footer
,
!
0
),
this
.
fireEvent
(
"
systemBoxReady
"
).
fireEvent
(
"
boxReady
"
)},
addListeners
:
function
(
t
){
if
(
t
=
t
||
this
.
options
.
attach
,
elements
=
Array
.
from
(
$
(
t
)).
combine
(
Array
.
from
(
$$
(
"
.
"
+
t
))).
combine
(
Array
.
from
(
$$
(
t
))).
clean
(),
!
elements
||
0
==
elements
.
length
)
return
this
;
switch
(
this
.
targets
.
combine
(
elements
),
this
.
options
.
event
){
case
"
mouseenter
"
:
case
"
mouseover
"
:
var
e
=
{
mouseenter
:
function
(
t
){
this
.
target
=
this
.
getTargetFromEvent
(
t
),
this
.
source
=
this
.
getTargetElementFromEvent
(
t
),
this
.
open
()}.
bind
(
this
),
mouseleave
:
function
(
t
){
this
.
close
()}.
bind
(
this
)};
break
;
default
:
e
=
{
click
:
function
(
t
){
this
.
options
.
preventDefault
&&
t
.
preventDefault
(),
this
.
isOpen
?
this
.
close
():(
this
.
target
=
this
.
getTargetFromEvent
(
t
),
this
.
source
=
this
.
getTargetElementFromEvent
(
t
),
this
.
open
())}.
bind
(
this
)}}
$$
(
elements
).
each
(
function
(
t
){
t
.
retrieve
(
"
mBoxElementEventsAdded
"
+
this
.
id
)
||
t
.
addEvents
(
e
).
store
(
"
mBoxElementEventsAdded
"
+
this
.
id
,
!
0
)}.
bind
(
this
))},
loadAjax
:
function
(
t
){
this
.
ajaxRequest
||
(
this
.
ajaxRequest
=
new
Request
.
HTML
({
link
:
"
cancel
"
,
update
:
this
.
content
,
onRequest
:
function
(){
this
.
setContent
(
""
),
this
.
wrapper
.
addClass
(
"
mBoxLoading
"
)}.
bind
(
this
),
onComplete
:
function
(){
this
.
wrapper
.
removeClass
(
"
mBoxLoading
"
),
"
auto
"
!=
this
.
options
.
width
&&
"
auto
"
!=
this
.
options
.
height
||
this
.
setPosition
(),
this
.
fireEvent
(
"
ajaxComplete
"
)}.
bind
(
this
)}).
send
()),
this
.
ajaxRequest
.
send
(
t
),
this
.
ajaxLoaded
=!
0
},
open
:
function
(
r
){
if
(
this
.
wrapper
||
this
.
construct
(),
"
object
"
!=
typeof
r
&&
(
r
=
{}),
clearTimeout
(
this
.
timer
),
!
this
.
isOpen
&&!
this
.
block
){
var
t
=
function
(){
this
.
ignoreDelayOnce
=!
1
,
this
.
fireEvent
(
"
systemOpenComplete
"
).
fireEvent
(
"
openComplete
"
)}.
bind
(
this
),
e
=
function
(
t
){
if
(
this
.
isOpen
=!
0
,
"
ajax
"
!=
this
.
options
.
load
||!
this
.
options
.
url
||
this
.
ajaxLoaded
&&!
this
.
options
.
reload
||
this
.
loadAjax
({
url
:
this
.
options
.
url
}),
this
.
target
=
this
.
getTarget
(
r
.
target
||
null
),
this
.
options
.
setContent
&&
this
.
source
&&
this
.
source
.
getAttribute
(
this
.
options
.
setContent
))
if
(
$
(
this
.
source
.
getAttribute
(
this
.
options
.
setContent
)))
this
.
content
.
getChildren
().
setStyle
(
"
display
"
,
"
none
"
),
$
(
this
.
source
.
getAttribute
(
this
.
options
.
setContent
)).
setStyle
(
"
display
"
,
""
);
else
{
var
e
=
this
.
source
.
getAttribute
(
this
.
options
.
setContent
).
split
(
"
|
"
),
i
=
e
[
0
]
||
null
,
o
=
e
[
1
]
||
null
,
n
=
e
[
2
]
||
null
;
this
.
load
(
i
,
o
,
n
)}
this
.
wrapper
&&
this
.
wrapper
.
inject
(
document
.
body
,
"
bottom
"
),
this
.
setPosition
(
null
,
r
.
position
||
null
,
r
.
offset
||
null
),
this
.
fireEvent
(
"
systemOpen
"
).
fireEvent
(
"
open
"
),
this
.
fx
&&
this
.
fx
.
cancel
(),
this
.
wrapper
.
setStyles
({
display
:
""
}),
this
.
options
.
fadeWhenOpen
&&
this
.
wrapper
.
setStyle
(
"
opacity
"
,
0
),
this
.
fx
=
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
"
opacity
"
,
duration
:
this
.
options
.
fadeDuration
.
open
,
link
:
"
cancel
"
,
onComplete
:
t
})[
r
.
instant
||!
this
.
options
.
fade
.
open
?
"
set
"
:
"
start
"
](
1
),
!
r
.
instant
&&
this
.
options
.
fade
.
open
||
t
();
var
s
=
this
.
getTransition
();
s
.
open
&&
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
s
.
open
.
property
||
"
top
"
,
duration
:
s
.
open
.
duration
||
this
.
options
.
fadeDuration
.
open
,
transition
:
s
.
open
.
transition
||
null
,
onStart
:
s
.
open
.
onStart
||
null
,
onComplete
:
s
.
open
.
onComplete
||
null
}).
start
(
s
.
open
.
start
||
this
.
wrapper
.
getStyle
(
s
.
open
.
property
||
"
top
"
).
toInt
()
+
(
s
.
open
.
difference_start
||
0
),
s
.
open
.
end
||
this
.
wrapper
.
getStyle
(
s
.
open
.
property
||
"
top
"
).
toInt
()
+
(
s
.
open
.
difference_end
||
0
));
this
.
attachEvents
(),
this
.
options
.
overlay
&&
this
.
addOverlay
(
r
.
instant
||!
this
.
options
.
fade
.
open
),
this
.
options
.
delayOpenOnce
&&
(
this
.
delayOpenOnce
=!
0
)}.
bind
(
this
);
0
<
this
.
options
.
delayOpen
&&!
this
.
ignoreDelay
&&!
this
.
ignoreDelayOnce
&&!
this
.
delayOpenOnce
?
this
.
timer
=
e
.
delay
(
this
.
options
.
delayOpen
,
this
,
t
):
e
(
t
)}
return
this
},
close
:
function
(
i
){
if
(
"
object
"
!=
typeof
i
&&
(
i
=
{}),
clearTimeout
(
this
.
timer
),
this
.
isOpen
&&!
this
.
block
){
var
t
=
function
(){
if
(
this
.
delayOpenOnce
=!
1
,
this
.
ignoreDelayOnce
=!
1
,
this
.
wrapper
.
setStyle
(
"
display
"
,
"
none
"
),
this
.
fireEvent
(
"
systemCloseComplete
"
).
fireEvent
(
"
closeComplete
"
),
this
.
wrapper
){
var
t
=
this
.
target
||
$
(
this
.
options
.
target
)
||
this
.
options
.
target
||
$
(
this
.
options
.
attach
);
t
&&
"
element
"
===
typeOf
(
t
)
&&
this
.
wrapper
.
inject
(
t
)}}.
bind
(
this
),
e
=
function
(
t
){
this
.
isOpen
=!
1
,
this
.
fireEvent
(
"
systemClose
"
).
fireEvent
(
"
close
"
),
this
.
detachEvents
(),
this
.
options
.
overlay
&&
this
.
removeOverlay
(
i
.
instant
||!
this
.
options
.
fade
.
close
),
this
.
fx
&&
this
.
fx
.
cancel
(),
this
.
fx
=
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
"
opacity
"
,
duration
:
this
.
options
.
fadeDuration
.
close
,
link
:
"
cancel
"
,
onComplete
:
t
})[
i
.
instant
||!
this
.
options
.
fade
.
close
?
"
set
"
:
"
start
"
](
0
),
!
i
.
instant
&&
this
.
options
.
fade
.
close
||
t
();
var
e
=
this
.
getTransition
();
e
.
close
&&
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
e
.
close
.
property
||
"
top
"
,
duration
:
e
.
close
.
duration
||
this
.
options
.
fadeDuration
.
close
,
transition
:
e
.
close
.
transition
||
null
,
onStart
:
e
.
open
.
onStart
||
null
,
onComplete
:
e
.
open
.
onComplete
||
null
}).
start
(
e
.
close
.
start
||
this
.
wrapper
.
getStyle
(
e
.
close
.
property
||
"
top
"
).
toInt
()
+
(
e
.
close
.
difference_start
||
0
),
e
.
close
.
end
||
this
.
wrapper
.
getStyle
(
e
.
close
.
property
||
"
top
"
).
toInt
()
+
(
e
.
close
.
difference_end
||
0
))}.
bind
(
this
);
0
<
this
.
options
.
delayClose
&&!
this
.
ignoreDelay
&&!
this
.
ignoreDelayOnce
?
this
.
timer
=
e
.
delay
(
this
.
options
.
delayClose
,
this
,
t
):
e
(
t
)}
return
this
},
addOverlay
:
function
(
t
){
return
this
.
overlay
||
(
this
.
overlay
=
new
Element
(
"
div
"
,{
styles
:{
position
:
"
fixed
"
,
top
:
0
,
left
:
0
,
width
:
"
100%
"
,
height
:
"
100%
"
,
zIndex
:
this
.
wrapper
.
getStyle
(
"
zIndex
"
)
-
1
,
background
:
this
.
options
.
overlayStyles
.
color
||
"
white
"
,
opacity
:.
001
,
display
:
"
none
"
}}).
set
(
"
tween
"
,{
duration
:
this
.
options
.
overlayFadeDuration
,
link
:
"
cancel
"
}).
inject
(
$
(
document
.
body
),
"
bottom
"
)),
this
.
overlay
.
setStyle
(
"
display
"
,
"
block
"
)[
t
?
"
set
"
:
"
tween
"
](
"
opacity
"
,
this
.
options
.
overlayStyles
.
opacity
||
.
001
),
this
},
removeOverlay
:
function
(
t
){
return
this
.
overlay
&&
this
.
overlay
[
t
?
"
set
"
:
"
tween
"
](
"
opacity
"
,
0
).
get
(
"
tween
"
).
chain
(
function
(){
this
.
overlay
.
setStyle
(
"
display
"
,
"
none
"
)}.
bind
(
this
)),
this
},
getTarget
:
function
(
t
){
return
"
mouse
"
==
(
t
=
$
(
t
)
||
t
||
this
.
target
||
$
(
this
.
options
.
target
)
||
this
.
options
.
target
||
$
(
this
.
options
.
attach
))?
"
mouse
"
:
this
.
fixOperaPositioning
(
$
(
t
))},
getTargetFromEvent
:
function
(
t
){
return
this
.
options
.
target
?
this
.
fixOperaPositioning
(
$
(
this
.
options
.
target
)):
this
.
getTargetElementFromEvent
(
t
)},
getTargetElementFromEvent
:
function
(
t
){
if
(
t
&&
t
.
target
){
if
(
this
.
targets
.
contains
(
t
.
target
))
return
this
.
fixOperaPositioning
(
t
.
target
);
for
(
var
e
=
t
.
target
.
getParent
();
null
!=
e
;){
if
(
this
.
targets
.
contains
(
e
))
return
this
.
fixOperaPositioning
(
e
);
e
=
e
.
getParent
()}}
return
null
},
fixOperaPositioning
:
function
(
t
){
if
(
$
(
t
)
&&!
$
(
t
).
retrieve
(
"
OperaBugFixed
"
)
&&
t
!=
window
){
try
{
$
(
t
).
getStyle
(
"
border-top-width
"
).
toInt
()
+
$
(
t
).
getStyle
(
"
border-right-width
"
).
toInt
()
+
$
(
t
).
getStyle
(
"
border-bottom-width
"
).
toInt
()
+
$
(
t
).
getStyle
(
"
border-left-width
"
).
toInt
()
||
$
(
t
).
setStyle
(
"
border
"
,
0
)}
catch
(
t
){}
$
(
t
).
store
(
"
OperaBugFixed
"
)}
return
t
},
getPosition
:
function
(
t
){
return
!
t
&&
this
.
position
||
(
t
=
t
||
this
.
options
.
position
,
this
.
position
=
{},
this
.
position
.
x
=
"
object
"
==
typeof
t
&&
"
number
"
==
typeof
t
.
x
?[
t
.
x
.
toInt
(),
null
]:
"
object
"
!=
typeof
t
||!
t
.
x
||
"
center
"
==
t
.
x
||
"
object
"
==
typeof
t
.
x
&&
"
center
"
==
t
.
x
[
0
]?[
"
center
"
,
null
]:[
"
right
"
,
"
left
"
].
contains
(
t
.
x
)?[
t
.
x
,
this
.
defaultInOut
||
"
inside
"
]:
"
object
"
==
typeof
t
.
x
&&
[
"
right
"
,
"
left
"
].
contains
(
t
.
x
[
0
])?[
t
.
x
[
0
],[
"
inside
"
,
"
center
"
,
"
outside
"
].
contains
(
t
.
x
[
1
])?
t
.
x
[
1
]:
this
.
defaultInOut
||
"
inside
"
]:[
"
center
"
,
null
],
this
.
position
.
xAttribute
=
"
right
"
==
this
.
position
.
x
[
3
]
||
"
inside
"
==
this
.
position
.
x
[
1
]
&&
"
right
"
==
this
.
position
.
x
[
0
]?
"
right
"
:
"
left
"
,
this
.
position
.
y
=
"
object
"
==
typeof
t
&&
"
number
"
==
typeof
t
.
y
?[
t
.
y
.
toInt
(),
null
]:
"
object
"
!=
typeof
t
||!
t
.
y
||
"
center
"
==
t
.
y
||
"
object
"
==
typeof
t
.
y
&&
"
center
"
==
t
.
y
[
0
]?[
"
center
"
,
null
]:[
"
top
"
,
"
bottom
"
].
contains
(
t
.
y
)?[
t
.
y
,
this
.
defaultInOut
||
"
inside
"
]:
"
object
"
==
typeof
t
.
y
&&
[
"
top
"
,
"
bottom
"
].
contains
(
t
.
y
[
0
])?[
t
.
y
[
0
],[
"
inside
"
,
"
center
"
,
"
outside
"
].
contains
(
t
.
y
[
1
])?
t
.
y
[
1
]:
this
.
defaultInOut
||
"
inside
"
]:[
"
center
"
,
null
],
this
.
position
.
yAttribute
=
"
bottom
"
==
this
.
position
.
x
[
3
]
||
"
inside
"
==
this
.
position
.
y
[
1
]
&&
"
bottom
"
==
this
.
position
.
y
[
0
]?
"
bottom
"
:
"
top
"
),
this
.
position
},
getOffset
:
function
(
t
){
return
!
t
&&
this
.
offset
||
(
t
=
t
||
this
.
options
.
offset
,
this
.
offset
=
{},
this
.
offset
.
x
=
"
number
"
==
typeof
t
?
t
:
t
.
x
&&
(
0
<=
t
.
x
.
toInt
()
||
t
.
x
.
toInt
()
<
0
)?
t
.
x
.
toInt
():
0
,
this
.
offset
.
y
=
"
number
"
==
typeof
t
?
t
:
t
.
y
&&
(
0
<=
t
.
y
.
toInt
()
||
t
.
y
.
toInt
()
<
0
)?
t
.
y
.
toInt
():
0
),
this
.
offset
},
getPointer
:
function
(
t
){
if
(
!
t
&&
this
.
pointer
)
return
this
.
pointer
;
if
(
!
(
t
=
t
||
this
.
options
.
pointer
))
return
!
1
;
var
e
=
this
.
getPosition
();
if
(
this
.
pointer
=
{},
"
outside
"
==
e
.
y
[
1
])
this
.
pointer
.
position
=
"
bottom
"
==
e
.
y
[
0
]?
"
top
"
:
"
bottom
"
,
this
.
pointer
.
adjustment
=
"
object
"
==
typeof
t
&&
[
"
center
"
,
"
right
"
,
"
left
"
].
contains
(
t
[
0
])?
t
[
0
]:[
"
center
"
,
"
right
"
,
"
left
"
].
contains
(
t
)?
t
:
"
center
"
;
else
{
if
(
"
outside
"
!=
e
.
x
[
1
])
return
null
;
this
.
pointer
.
position
=
"
left
"
==
e
.
x
[
0
]?
"
right
"
:
"
left
"
,
this
.
pointer
.
adjustment
=
"
object
"
==
typeof
t
&&
[
"
center
"
,
"
top
"
,
"
bottom
"
].
contains
(
t
[
0
])?
t
[
0
]:[
"
center
"
,
"
top
"
,
"
bottom
"
].
contains
(
t
)?
t
:
"
center
"
}
return
this
.
pointer
.
offset
=
"
object
"
==
typeof
t
&&
t
[
1
]
&&
"
number
"
==
typeof
t
[
1
].
toInt
()?
t
[
1
].
toInt
():
0
,
this
.
pointer
.
offset
=
this
.
pointer
.
offset
<
0
?
-
1
*
this
.
pointer
.
offset
:
this
.
pointer
.
offset
,
this
.
pointer
.
offset
=
"
right
"
==
this
.
pointer
.
adjustment
||
"
bottom
"
==
this
.
pointer
.
adjustment
?
-
1
*
this
.
pointer
.
offset
:
this
.
pointer
.
offset
,
this
.
pointer
},
getTransition
:
function
(){
if
(
this
.
transition
)
return
this
.
transition
;
if
(
this
.
options
.
transition
&&
[
"
flyin
"
,
"
flyout
"
,
"
flyinout
"
,
"
flyoutin
"
,
"
bounce
"
,
"
bouncein
"
,
"
bounceout
"
,
"
bounceinout
"
,
"
bouncefly
"
].
contains
(
this
.
options
.
transition
)){
this
.
transition
=
{},
this
.
transition
.
open
=
{
property
:
"
top
"
==
this
.
position
.
yAttribute
||
"
bottom
"
==
this
.
position
.
yAttribute
?
this
.
position
.
yAttribute
:
this
.
position
.
xAttribute
,
transition
:
"
quad:out
"
,
duration
:
300
},
this
.
transition
.
close
=
Object
.
clone
(
this
.
transition
.
open
);
var
t
=
20
*
(
"
bottom
"
==
this
.
position
.
yAttribute
||
"
right
"
==
this
.
position
.
xAttribute
?
-
1
:
1
);
switch
(
this
.
options
.
transition
){
case
"
flyin
"
:
case
"
flyout
"
:
this
.
transition
.
open
.
difference_start
=
this
.
transition
.
close
.
difference_end
=
t
*
(
"
flyin
"
==
this
.
options
.
transition
?
-
1
:
1
);
break
;
case
"
flyinout
"
:
case
"
flyoutin
"
:
t
*=
"
flyinout
"
==
this
.
options
.
transition
?
1
:
-
1
,
this
.
transition
.
open
.
difference_start
=-
1
*
t
,
this
.
transition
.
close
.
difference_end
=
t
;
break
;
case
"
bounce
"
:
case
"
bouncefly
"
:
case
"
bouncein
"
:
case
"
bounceout
"
:
case
"
bounceinout
"
:
this
.
transition
.
open
.
transition
=
"
bounce:out
"
,
this
.
transition
.
open
.
duration
=
450
,
this
.
transition
.
open
.
difference_start
=-
1
*
t
,
"
bounceinout
"
!=
this
.
options
.
transition
&&
"
bounceout
"
!=
this
.
options
.
transition
&&
"
bouncefly
"
!=
this
.
options
.
transition
||
(
this
.
transition
.
close
.
difference_end
=-
1
*
t
)}}
else
this
.
transition
=
{},
this
.
transition
.
open
=
null
!=
typeof
this
.
options
.
transition
.
open
?
this
.
options
.
transition
.
open
:
this
.
options
.
transition
,
this
.
transition
.
close
=
null
!=
typeof
this
.
options
.
transition
.
close
?
this
.
options
.
transition
.
close
:
this
.
options
.
transition
;
return
this
.
transition
},
setPosition
:
function
(
t
,
e
,
i
){
if
(
t
=
this
.
getTarget
(
t
),
e
=
this
.
getPosition
(
e
),
i
=
this
.
getOffset
(
i
),
pointer
=
this
.
getPointer
(),
"
mouse
"
==
t
)
return
r
=
(
this
.
mouseX
||
0
)
+
15
+
i
.
x
,
h
=
(
this
.
mouseY
||
0
)
+
15
+
i
.
y
,
this
.
wrapper
.
setStyles
({
left
:
Math
.
floor
(
r
),
top
:
Math
.
floor
(
h
)}),
this
;
if
(
!
t
||
[
$
(
window
),
$
(
document
),
$
(
document
.
body
)].
contains
(
t
)){
var
o
=
"
fixed
"
==
this
.
wrapper
.
getStyle
(
"
position
"
)?{
x
:
0
,
y
:
0
}:
$
(
window
).
getScroll
();(
s
=
$
(
window
).
getSize
()).
width
=
s
.
totalWidth
=
s
.
x
,
s
.
height
=
s
.
totalHeight
=
s
.
y
;
var
n
=
{
top
:
o
.
y
,
left
:
o
.
x
,
right
:
o
.
x
+
s
.
width
,
bottom
:
o
.
y
+
s
.
height
}}
else
{
1
!=!
this
.
options
.
fixed
&&
this
.
wrapper
.
setStyle
(
"
position
"
,
"
absolute
"
);
var
s
=
t
.
getDimensions
({
computeSize
:
!
0
});
n
=
t
.
getCoordinates
();
0
==
s
.
totalWidth
&&
(
s
.
width
=
s
.
totalWidth
=
n
.
width
,
s
.
height
=
s
.
totalHeight
=
n
.
height
)}
var
r
=
n
.
left
||
0
,
h
=
n
.
top
||
0
,
a
=
this
.
wrapper
.
getDimensions
({
computeSize
:
!
0
});
if
(
pointer
&&!
this
.
pointerElement
){
if
(
this
.
pointerElement
=
new
Element
(
"
div
"
,{
class
:
"
mBoxPointer mBoxPointer
"
+
pointer
.
position
.
capitalize
(),
styles
:{
position
:
"
absolute
"
}}).
setStyle
(
pointer
.
position
,
0
).
inject
(
this
.
wrapper
,
"
top
"
),
Browser
.
opera
){
var
p
=
new
Element
(
"
div
"
,{
class
:
"
mBox
"
+
(
this
.
defaultTheme
||
"
Core
"
)
+
(
this
.
options
.
theme
?
"
-
"
+
this
.
options
.
theme
:
""
)}).
inject
(
document
.
body
).
grab
(
this
.
pointerElement
);
this
.
pointerDimensions
=
this
.
pointerElement
.
getDimensions
({
computeSize
:
!
0
}),
this
.
pointerElement
.
inject
(
this
.
wrapper
,
"
top
"
),
p
.
destroy
()}
else
this
.
pointerDimensions
=
this
.
pointerElement
.
getDimensions
({
computeSize
:
!
0
});
this
.
container
.
setStyle
(
"
margin-
"
+
pointer
.
position
,
"
left
"
==
pointer
.
position
||
"
right
"
==
pointer
.
position
?
this
.
pointerDimensions
.
width
-
this
.
container
.
getStyle
(
"
border-
"
+
pointer
.
position
).
toInt
():
this
.
pointerDimensions
.
height
-
this
.
container
.
getStyle
(
"
border-
"
+
pointer
.
position
).
toInt
())}
if
(
pointer
&&
this
.
pointerElement
){
if
(
"
outside
"
==
e
.
x
[
1
]
&&
"
outside
"
==
e
.
y
[
1
]
&&
"
center
"
==
pointer
.
adjustment
)
switch
(
pointer
.
adjustment
=
"
left
"
==
e
.
x
[
0
]?
"
right
"
:
"
left
"
,
e
.
x
[
0
]){
case
"
left
"
:
r
+=
a
.
totalWidth
-
this
.
pointerDimensions
.
width
/
2
;
break
;
case
"
right
"
:
r
-=
this
.
pointerDimensions
.
width
/
2
}
var
l
=
0
,
c
=
0
,
d
=
0
;
switch
(
pointer
.
adjustment
){
case
"
center
"
:
l
=
"
top
"
==
pointer
.
position
||
"
bottom
"
==
pointer
.
position
?
a
.
totalWidth
/
2
-
this
.
pointerDimensions
.
width
/
2
:
a
.
totalHeight
/
2
-
this
.
pointerDimensions
.
height
/
2
;
break
;
case
"
left
"
:
case
"
right
"
:
switch
(
e
.
x
[
1
]){
case
"
inside
"
:
c
+=
this
.
pointerDimensions
.
width
/
2
*-
1
+
(
"
right
"
==
e
.
x
[
0
]?
a
.
totalWidth
:
0
);
break
;
default
:
"
center
"
==
e
.
x
[
0
]
&&
(
c
+=
a
.
totalWidth
/
2
-
this
.
pointerDimensions
.
width
/
2
)}
r
+=
c
-
(
"
right
"
==
pointer
.
adjustment
?
a
.
totalWidth
-
this
.
pointerDimensions
.
width
:
0
),
l
=
"
right
"
==
pointer
.
adjustment
?
a
.
totalWidth
-
this
.
pointerDimensions
.
width
:
0
;
break
;
case
"
top
"
:
case
"
bottom
"
:
switch
(
e
.
y
[
1
]){
case
"
inside
"
:
d
+=
this
.
pointerDimensions
.
height
/
2
*-
1
+
(
"
bottom
"
==
e
.
y
[
0
]?
a
.
totalHeight
:
0
);
break
;
default
:
"
center
"
==
e
.
y
[
0
]
&&
(
d
+=
a
.
totalHeight
/
2
-
this
.
pointerDimensions
.
height
/
2
)}
h
+=
d
-
(
"
bottom
"
==
pointer
.
adjustment
?
a
.
totalHeight
-
this
.
pointerDimensions
.
height
:
0
),
l
=
"
bottom
"
==
pointer
.
adjustment
?
a
.
totalHeight
-
this
.
pointerDimensions
.
height
:
0
}
switch
(
pointer
.
position
){
case
"
top
"
:
case
"
bottom
"
:
r
+=-
1
*
pointer
.
offset
;
break
;
case
"
left
"
:
case
"
right
"
:
h
+=-
1
*
pointer
.
offset
}
this
.
pointerElement
.
setStyle
(
"
top
"
==
pointer
.
position
||
"
bottom
"
==
pointer
.
position
?
"
left
"
:
"
top
"
,
l
+
pointer
.
offset
)}
switch
(
a
=
this
.
wrapper
.
getDimensions
({
computeSize
:
!
0
}),
e
.
x
[
0
]){
case
"
center
"
:
r
+=
s
.
totalWidth
/
2
-
a
.
totalWidth
/
2
;
break
;
case
"
right
"
:
r
+=
s
.
totalWidth
-
(
"
inside
"
==
e
.
x
[
1
]?
a
.
totalWidth
:
"
center
"
==
e
.
x
[
1
]?
a
.
totalWidth
/
2
:
0
);
break
;
case
"
left
"
:
r
-=
"
outside
"
==
e
.
x
[
1
]?
a
.
totalWidth
:
"
center
"
==
e
.
x
[
1
]?
a
.
totalWidth
/
2
:
0
;
break
;
default
:
r
=
e
.
x
}
switch
(
e
.
y
[
0
]){
case
"
center
"
:
h
+=
s
.
totalHeight
/
2
-
a
.
totalHeight
/
2
;
break
;
case
"
bottom
"
:
h
+=
s
.
totalHeight
-
(
"
inside
"
==
e
.
y
[
1
]?
a
.
totalHeight
:
"
center
"
==
e
.
y
[
1
]?
a
.
totalHeight
/
2
:
0
);
break
;
case
"
top
"
:
h
-=
"
outside
"
==
e
.
y
[
1
]?
a
.
totalHeight
:
"
center
"
==
e
.
y
[
1
]?
a
.
totalHeight
/
2
:
0
;
break
;
default
:
r
=
e
.
y
}
this
.
wrapper
.
setStyles
({
top
:
null
,
right
:
null
,
bottom
:
null
,
left
:
null
});
var
u
=
$
(
window
).
getSize
();
return
"
right
"
==
e
.
xAttribute
&&
(
r
=
u
.
x
-
(
r
+
a
.
totalWidth
)),
"
bottom
"
==
e
.
yAttribute
&&
(
h
=
u
.
y
-
(
h
+
a
.
totalHeight
)),
r
=
r
||
0
,
r
+=
i
.
x
,
h
+=
i
.
y
,
this
.
wrapper
.
setStyle
(
e
.
xAttribute
,
r
.
floor
()),
this
.
wrapper
.
setStyle
(
e
.
yAttribute
,
h
.
floor
()),
this
},
setContent
:
function
(
t
,
e
){
return
null
!=
t
&&
(
$
(
t
)
||
0
<
$$
(
"
.
"
+
t
).
length
?(
this
[
e
||
"
content
"
].
grab
(
$
(
t
)
||
$$
(
"
.
"
+
t
)),
$
(
t
)
&&
$
(
t
).
setStyle
(
"
display
"
,
""
)):
null
!=
t
&&
this
[
e
||
"
content
"
].
set
(
"
html
"
,
t
)),
this
},
setTitle
:
function
(
t
){
return
null
==
t
||
this
.
titleContainer
||
(
this
.
titleContainer
=
new
Element
(
"
div
"
,{
class
:
"
mBoxTitleContainer
"
}).
inject
(
this
.
container
,
"
top
"
),
this
.
title
=
new
Element
(
"
div
"
,{
class
:
"
mBoxTitle
"
+
(
this
.
options
.
addClass
.
title
||
""
),
styles
:
this
.
options
.
setStyles
.
title
||
{}}).
inject
(
this
.
titleContainer
),
this
.
wrapper
.
addClass
(
"
hasTitle
"
),
this
.
options
.
draggable
&&
null
!=
window
.
Drag
&&
(
new
Drag
(
this
.
wrapper
,{
handle
:
this
.
titleContainer
}),
this
.
titleContainer
.
addClass
(
"
mBoxDraggable
"
)),
this
.
options
.
closeInTitle
&&
new
Element
(
"
div
"
,{
class
:
"
mBoxClose
"
,
events
:{
click
:
function
(){
this
.
close
()}.
bind
(
this
)}}).
grab
(
new
Element
(
"
div
"
)).
inject
(
this
.
titleContainer
)),
null
!=
t
&&
this
.
setContent
(
t
,
"
title
"
),
this
},
setFooter
:
function
(
t
){
return
null
==
t
||
this
.
footerContainer
||
(
this
.
footerContainer
=
new
Element
(
"
div
"
,{
class
:
"
mBoxFooterContainer
"
}).
inject
(
this
.
container
,
"
bottom
"
),
this
.
footer
=
new
Element
(
"
div
"
,{
class
:
"
mBoxFooter
"
+
(
this
.
options
.
addClass
.
footer
||
""
),
styles
:
this
.
options
.
setStyles
.
footer
||
{}}).
inject
(
this
.
footerContainer
),
this
.
wrapper
.
addClass
(
"
hasFooter
"
)),
null
!=
t
&&
this
.
setContent
(
t
,
"
footer
"
),
this
},
load
:
function
(
t
,
e
,
i
){
return
this
.
setContent
(
t
),
this
.
setTitle
(
e
),
this
.
setFooter
(
i
),
this
},
getHTML
:
function
(
t
,
e
,
i
){
return
this
.
load
(
t
,
e
,
i
),
"
<div>
"
+
this
.
wrapper
.
get
(
"
html
"
)
+
"
</div>
"
},
attachEvents
:
function
(){
this
.
escEvent
=
function
(
t
){
"
esc
"
==
t
.
key
&&
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnEsc
&&
$
(
window
).
addEvent
(
"
keyup
"
,
this
.
escEvent
),
this
.
resizeEvent
=
function
(
t
){
this
.
setPosition
()}.
bind
(
this
),
$
(
window
).
addEvent
(
"
resize
"
,
this
.
resizeEvent
),
this
.
options
.
fixed
&&
(
Browser
.
ie6
||
Browser
.
ie7
)
&&
$
(
window
).
addEvent
(
"
scroll
"
,
this
.
resizeEvent
),
this
.
closeOnClickEvent
=
function
(
t
){
this
.
isOpen
&&
$
(
this
.
options
.
attach
)
!=
t
.
target
&&!
$$
(
"
.
"
+
this
.
options
.
attach
).
contains
(
t
.
target
)
&&
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnClick
&&
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnClickEvent
),
this
.
closeOnBoxClickEvent
=
function
(
t
){
this
.
isOpen
&&
(
this
.
wrapper
==
t
.
target
||
this
.
wrapper
.
contains
(
t
.
target
))
&&
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnBoxClick
&&
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnBoxClickEvent
),
this
.
closeOnWrapperClickEvent
=
function
(
t
){
this
.
isOpen
&&
this
.
wrapper
==
t
.
target
&&
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnWrapperClick
&&
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnWrapperClickEvent
),
this
.
closeOnBodyClickEvent
=
function
(
t
){
!
this
.
isOpen
||
$
(
this
.
options
.
attach
)
==
t
.
target
||
$$
(
"
.
"
+
this
.
options
.
attach
).
contains
(
t
.
target
)
||
t
.
target
==
this
.
wrapper
||
this
.
wrapper
.
contains
(
t
.
target
)
||
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnBodyClick
&&
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnBodyClickEvent
),
this
.
mouseMoveEvent
=
function
(
t
){
this
.
mouseX
=
t
.
page
.
x
,
this
.
mouseY
=
t
.
page
.
y
,
this
.
setPosition
(
"
mouse
"
)}.
bind
(
this
),
"
mouse
"
==
this
.
target
&&
$
(
document
).
addEvent
(
"
mousemove
"
,
this
.
mouseMoveEvent
)},
detachEvents
:
function
(){
this
.
options
.
fixed
&&
(
Browser
.
ie6
||
Browser
.
ie7
)
&&
$
(
window
).
removeEvent
(
"
scroll
"
,
this
.
resizeEvent
),
$
(
window
).
removeEvent
(
"
keyup
"
,
this
.
keyEvent
),
$
(
window
).
removeEvent
(
"
resize
"
,
this
.
resizeEvent
),
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnClickEvent
),
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnBoxClickEvent
),
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnWrapperClickEvent
),
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnBodyClickEvent
),
$
(
document
).
removeEvent
(
"
mousemove
"
,
this
.
mouseMoveEvent
)},
destroy
:
function
(){
mBox
.
instances
.
erase
(
this
),
this
.
detachEvents
(),
this
.
wrapper
.
dispose
(),
delete
this
.
wrapper
}});
mBox
.
instances
=
[],
mBox
.
currentId
=
0
,
mBox
.
reInit
=
function
(){
mBox
.
addConfirmEvents
&&
mBox
.
addConfirmEvents
(),
mBox
.
instances
.
each
(
function
(
t
){
try
{
t
.
reInit
()}
catch
(
t
){}})},
mBox
.
Notice
=
new
Class
({
Extends
:
mBox
,
options
:{
type
:
"
Default
"
,
position
:{
x
:[
"
left
"
,
"
inside
"
],
y
:[
"
bottom
"
,
"
inside
"
]},
offset
:{
x
:
30
,
y
:
30
},
fixed
:
!
0
,
move
:
!
0
,
moveDuration
:
500
,
delayClose
:
4
e3
,
fade
:
!
0
,
fadeDuration
:{
open
:
250
,
close
:
400
},
target
:
$
(
window
),
zIndex
:
1
e6
,
closeOnEsc
:
!
1
,
closeOnBoxClick
:
!
0
,
closeOnBodyClick
:
!
1
,
openOnInit
:
!
0
},
initialize
:
function
(
t
){
this
.
defaultInOut
=
"
inside
"
,
this
.
defaultTheme
=
"
Notice
"
,
t
.
onSystemBoxReady
=
function
(){
if
(
this
.
container
.
addClass
(
"
mBoxNotice
"
+
(
this
.
options
.
type
.
capitalize
()
||
"
Default
"
)),
this
.
options
.
move
&&
(
"
inside
"
==
this
.
position
.
x
[
1
]
||
"
center
"
==
this
.
position
.
x
[
0
])
&&
"
inside
"
==
this
.
position
.
y
[
1
]
&&
(
"
top
"
==
this
.
position
.
y
[
0
]
||
"
bottom
"
==
this
.
position
.
y
[
0
])){
var
t
=
this
.
wrapper
.
getDimensions
({
computeSize
:
!
0
});
this
.
container
.
setStyle
(
"
position
"
,
"
absolute
"
),
this
.
container
.
setStyle
(
"
top
"
==
this
.
position
.
y
[
0
]?
"
bottom
"
:
"
top
"
,
0
),
this
.
wrapper
.
setStyles
({
height
:
0
,
width
:
t
.
totalWidth
,
overflowY
:
"
hidden
"
}),
this
.
options
.
transition
=
{
open
:{
transition
:
"
linear
"
,
property
:
"
height
"
,
duration
:
this
.
options
.
moveDuration
,
start
:
0
,
end
:
t
.
totalHeight
+
this
.
options
.
offset
.
y
}},
this
.
options
.
offset
.
y
=
0
,
this
.
options
.
delayClose
+=
this
.
options
.
moveDuration
}},
t
.
onSystemOpen
=
function
(){
$
(
window
).
retrieve
(
"
mBoxNotice
"
)
&&
(
$
(
window
).
retrieve
(
"
mBoxNotice
"
).
ignoreDelay
=!
0
,
$
(
window
).
retrieve
(
"
mBoxNotice
"
).
close
()),
$
(
window
).
store
(
"
mBoxNotice
"
,
this
)},
t
.
onSystemOpenComplete
=
function
(){
this
.
close
()},
t
.
onSystemCloseComplete
=
function
(){
this
.
destroy
()},
this
.
parent
(
t
)}}),
mBox
.
Tooltip
=
new
Class
({
Extends
:
mBox
,
options
:{
target
:
null
,
event
:
"
mouseenter
"
,
position
:{
x
:[
"
center
"
],
y
:[
"
top
"
,
"
outside
"
]},
pointer
:
"
center
"
,
fixed
:
!
1
,
delayOpenOnce
:
!
0
},
initialize
:
function
(
t
){
this
.
defaultInOut
=
"
outside
"
,
this
.
defaultTheme
=
"
Tooltip
"
,
this
.
parent
(
t
)}});
var
mBox
=
new
Class
({
Implements
:[
Options
,
Events
],
options
:{
id
:
""
,
theme
:
""
,
addClass
:{
wrapper
:
""
,
container
:
""
,
content
:
""
,
title
:
""
,
footer
:
""
},
setStyles
:{
wrapper
:{},
container
:{},
content
:{},
title
:{},
footer
:{}},
target
:
$
(
window
),
attach
:
null
,
event
:
"
click
"
,
preventDefault
:
!
1
,
width
:
"
auto
"
,
height
:
"
auto
"
,
zIndex
:
8
e3
,
content
:
null
,
setContent
:
"
data-setContent
"
,
load
:
null
,
url
:
""
,
reload
:
!
1
,
title
:
null
,
footer
:
null
,
draggable
:
!
1
,
position
:{
x
:
"
center
"
,
y
:
"
center
"
},
fixed
:
null
,
offset
:{
x
:
0
,
y
:
0
},
pointer
:
!
1
,
fade
:{
open
:
!
0
,
close
:
!
0
},
fadeDuration
:{
open
:
200
,
close
:
300
},
fadeWhenOpen
:
!
1
,
overlay
:
!
1
,
overlayStyles
:{
color
:
"
black
"
,
opacity
:.
75
},
overlayFadeDuration
:
100
,
transition
:{
open
:
null
,
close
:
null
},
closeOnEsc
:
!
0
,
closeOnClick
:
!
1
,
closeOnBoxClick
:
!
1
,
closeOnWrapperClick
:
!
1
,
closeOnBodyClick
:
!
0
,
closeOnMouseleave
:
!
1
,
closeInTitle
:
!
1
,
delayOpen
:
0
,
delayClose
:
0
,
delayOpenOnce
:
!
0
,
constructOnInit
:
!
0
,
openOnInit
:
!
1
},
initialize
:
function
(
t
){
this
.
block
=!
1
,
this
.
ignoreDelay
=!
1
,
this
.
ignoreDelayOnce
=!
1
,
this
.
setOptions
(
t
),
this
.
fixOptions
(),
this
.
getPosition
(),
this
.
target
=
this
.
getTarget
(),
null
==
this
.
options
.
fixed
&&
(
this
.
options
.
fixed
=
[
$
(
window
),
$
(
document
),
$
(
document
.
body
)].
contains
(
this
.
target
)),
"
mouse
"
==
this
.
target
&&
(
this
.
options
.
pointer
=!
1
),
this
.
targets
=
[],
this
.
id
=
this
.
options
.
id
||
"
mBox
"
+
++
mBox
.
currentId
,
this
.
addListeners
(),
this
.
options
.
constructOnInit
&&
this
.
construct
(),
this
.
fireEvent
(
"
init
"
).
fireEvent
(
"
systemInit
"
),
this
.
options
.
openOnInit
&&
this
.
open
(),
mBox
.
instances
.
push
(
this
)},
reInit
:
function
(){
this
.
addListeners
()},
fixOptions
:
function
(){
"
string
"
==
typeof
this
.
options
.
addClass
&&
(
this
.
options
.
addClass
=
{
wrapper
:
this
.
options
.
addClass
}),
"
object
"
!=
typeof
this
.
options
.
setStyles
||
this
.
options
.
setStyles
.
wrapper
||
this
.
options
.
setStyles
.
container
||
this
.
options
.
setStyles
.
content
||
this
.
options
.
setStyles
.
title
||
this
.
options
.
setStyles
.
footer
||
(
this
.
options
.
setStyles
=
{
wrapper
:
this
.
options
.
setStyles
}),
this
.
options
.
fade
=
{
open
:
this
.
options
.
fade
.
open
||
1
==
this
.
options
.
fade
,
close
:
this
.
options
.
fade
.
close
||
1
==
this
.
options
.
fade
},
this
.
options
.
fadeDuration
=
{
open
:
this
.
options
.
fadeDuration
.
open
||
this
.
options
.
fadeDuration
,
close
:
this
.
options
.
fadeDuration
.
close
||
this
.
options
.
fadeDuration
}},
construct
:
function
(){
if
(
this
.
wrapper
)
return
null
;
this
.
wrapper
=
new
Element
(
"
div
"
,{
id
:
this
.
id
,
class
:
"
mBox
"
+
(
this
.
defaultTheme
||
"
Core
"
)
+
(
this
.
options
.
theme
?
"
-
"
+
this
.
options
.
theme
:
""
)
+
"
"
+
(
this
.
options
.
addClass
.
wrapper
||
""
),
styles
:{
zIndex
:
this
.
options
.
zIndex
,
position
:
0
==
this
.
options
.
fixed
||
Browser
.
ie6
||
Browser
.
ie7
?
"
absolute
"
:
"
fixed
"
,
display
:
"
none
"
,
opacity
:
1
e
-
5
,
top
:
-
12
e3
,
left
:
-
12
e3
,
zoom
:
1
}}).
setStyles
(
this
.
options
.
setStyles
.
wrapper
||
{});
var
t
=
$
(
t
)
||
t
||
this
.
target
||
$
(
this
.
options
.
target
)
||
this
.
options
.
target
||
$
(
this
.
options
.
attach
);
t
&&
"
element
"
===
typeOf
(
t
)?
this
.
wrapper
.
inject
(
t
,
"
after
"
):
this
.
wrapper
.
inject
(
document
.
body
,
"
bottom
"
),
this
.
options
.
closeOnMouseleave
&&
this
.
wrapper
.
addEvents
({
mouseenter
:
function
(
t
){
this
.
open
()}.
bind
(
this
),
mouseleave
:
function
(
t
){
this
.
close
()}.
bind
(
this
)}),
this
.
container
=
new
Element
(
"
div
"
,{
class
:
"
mBoxContainer
"
+
(
this
.
options
.
addClass
.
container
||
""
)}).
setStyles
(
this
.
options
.
setStyles
.
container
||
{}).
inject
(
this
.
wrapper
),
this
.
content
=
new
Element
(
"
div
"
,{
class
:
"
mBoxContent
"
+
(
this
.
options
.
addClass
.
content
||
""
),
styles
:{
width
:
this
.
options
.
width
,
height
:
this
.
options
.
height
}}).
setStyles
(
this
.
options
.
setStyles
.
content
||
{}).
inject
(
this
.
container
),
this
.
load
(
this
.
options
.
content
,
this
.
options
.
title
,
this
.
options
.
footer
,
!
0
),
this
.
fireEvent
(
"
systemBoxReady
"
).
fireEvent
(
"
boxReady
"
)},
addListeners
:
function
(
t
){
if
(
t
=
t
||
this
.
options
.
attach
,
elements
=
Array
.
from
(
$
(
t
)).
combine
(
Array
.
from
(
$$
(
"
.
"
+
t
))).
combine
(
Array
.
from
(
$$
(
t
))).
clean
(),
!
elements
||
0
==
elements
.
length
)
return
this
;
switch
(
this
.
targets
.
combine
(
elements
),
this
.
options
.
event
){
case
"
mouseenter
"
:
case
"
mouseover
"
:
var
e
=
{
mouseenter
:
function
(
t
){
this
.
target
=
this
.
getTargetFromEvent
(
t
),
this
.
source
=
this
.
getTargetElementFromEvent
(
t
),
this
.
open
()}.
bind
(
this
),
mouseleave
:
function
(
t
){
this
.
close
()}.
bind
(
this
)};
break
;
default
:
e
=
{
click
:
function
(
t
){
this
.
options
.
preventDefault
&&
t
.
preventDefault
(),
this
.
isOpen
?
this
.
close
():(
this
.
target
=
this
.
getTargetFromEvent
(
t
),
this
.
source
=
this
.
getTargetElementFromEvent
(
t
),
this
.
open
())}.
bind
(
this
)}}
$$
(
elements
).
each
(
function
(
t
){
t
.
retrieve
(
"
mBoxElementEventsAdded
"
+
this
.
id
)
||
t
.
addEvents
(
e
).
store
(
"
mBoxElementEventsAdded
"
+
this
.
id
,
!
0
)}.
bind
(
this
))},
loadAjax
:
function
(
t
){
this
.
ajaxRequest
||
(
this
.
ajaxRequest
=
new
Request
.
HTML
({
link
:
"
cancel
"
,
update
:
this
.
content
,
onRequest
:
function
(){
this
.
setContent
(
""
),
this
.
wrapper
.
addClass
(
"
mBoxLoading
"
)}.
bind
(
this
),
onComplete
:
function
(){
this
.
wrapper
.
removeClass
(
"
mBoxLoading
"
),
"
auto
"
!=
this
.
options
.
width
&&
"
auto
"
!=
this
.
options
.
height
||
this
.
setPosition
(),
this
.
fireEvent
(
"
ajaxComplete
"
)}.
bind
(
this
)}).
send
()),
this
.
ajaxRequest
.
send
(
t
),
this
.
ajaxLoaded
=!
0
},
open
:
function
(
t
){
if
(
this
.
wrapper
||
this
.
construct
(),
"
object
"
!=
typeof
t
&&
(
t
=
{}),
clearTimeout
(
this
.
timer
),
!
this
.
isOpen
&&!
this
.
block
){
var
e
=
function
(){
this
.
ignoreDelayOnce
=!
1
,
this
.
fireEvent
(
"
systemOpenComplete
"
).
fireEvent
(
"
openComplete
"
)}.
bind
(
this
),
i
=
function
(
e
){
if
(
this
.
isOpen
=!
0
,
"
ajax
"
!=
this
.
options
.
load
||!
this
.
options
.
url
||
this
.
ajaxLoaded
&&!
this
.
options
.
reload
||
this
.
loadAjax
({
url
:
this
.
options
.
url
}),
this
.
target
=
this
.
getTarget
(
t
.
target
||
null
),
this
.
options
.
setContent
&&
this
.
source
&&
this
.
source
.
getAttribute
(
this
.
options
.
setContent
))
if
(
$
(
this
.
source
.
getAttribute
(
this
.
options
.
setContent
)))
this
.
content
.
getChildren
().
setStyle
(
"
display
"
,
"
none
"
),
$
(
this
.
source
.
getAttribute
(
this
.
options
.
setContent
)).
setStyle
(
"
display
"
,
""
);
else
{
var
i
=
this
.
source
.
getAttribute
(
this
.
options
.
setContent
).
split
(
"
|
"
),
o
=
i
[
0
]
||
null
,
n
=
i
[
1
]
||
null
,
s
=
i
[
2
]
||
null
;
this
.
load
(
o
,
n
,
s
)}
this
.
wrapper
&&
this
.
wrapper
.
inject
(
document
.
body
,
"
bottom
"
),
this
.
setPosition
(
null
,
t
.
position
||
null
,
t
.
offset
||
null
),
this
.
fireEvent
(
"
systemOpen
"
).
fireEvent
(
"
open
"
),
this
.
fx
&&
this
.
fx
.
cancel
(),
this
.
wrapper
.
setStyles
({
display
:
""
}),
this
.
options
.
fadeWhenOpen
&&
this
.
wrapper
.
setStyle
(
"
opacity
"
,
0
),
this
.
fx
=
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
"
opacity
"
,
duration
:
this
.
options
.
fadeDuration
.
open
,
link
:
"
cancel
"
,
onComplete
:
e
})[
t
.
instant
||!
this
.
options
.
fade
.
open
?
"
set
"
:
"
start
"
](
1
),
!
t
.
instant
&&
this
.
options
.
fade
.
open
||
e
();
var
r
=
this
.
getTransition
();
r
.
open
&&
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
r
.
open
.
property
||
"
top
"
,
duration
:
r
.
open
.
duration
||
this
.
options
.
fadeDuration
.
open
,
transition
:
r
.
open
.
transition
||
null
,
onStart
:
r
.
open
.
onStart
||
null
,
onComplete
:
r
.
open
.
onComplete
||
null
}).
start
(
r
.
open
.
start
||
this
.
wrapper
.
getStyle
(
r
.
open
.
property
||
"
top
"
).
toInt
()
+
(
r
.
open
.
difference_start
||
0
),
r
.
open
.
end
||
this
.
wrapper
.
getStyle
(
r
.
open
.
property
||
"
top
"
).
toInt
()
+
(
r
.
open
.
difference_end
||
0
));
this
.
attachEvents
(),
this
.
options
.
overlay
&&
this
.
addOverlay
(
t
.
instant
||!
this
.
options
.
fade
.
open
),
this
.
options
.
delayOpenOnce
&&
(
this
.
delayOpenOnce
=!
0
)}.
bind
(
this
);
this
.
options
.
delayOpen
>
0
&&!
this
.
ignoreDelay
&&!
this
.
ignoreDelayOnce
&&!
this
.
delayOpenOnce
?
this
.
timer
=
i
.
delay
(
this
.
options
.
delayOpen
,
this
,
e
):
i
(
e
)}
return
this
},
close
:
function
(
t
){
if
(
"
object
"
!=
typeof
t
&&
(
t
=
{}),
clearTimeout
(
this
.
timer
),
this
.
isOpen
&&!
this
.
block
){
var
e
=
function
(){
if
(
this
.
delayOpenOnce
=!
1
,
this
.
ignoreDelayOnce
=!
1
,
this
.
wrapper
.
setStyle
(
"
display
"
,
"
none
"
),
this
.
fireEvent
(
"
systemCloseComplete
"
).
fireEvent
(
"
closeComplete
"
),
this
.
wrapper
){
var
t
=
this
.
target
||
$
(
this
.
options
.
target
)
||
this
.
options
.
target
||
$
(
this
.
options
.
attach
);
t
&&
"
element
"
===
typeOf
(
t
)
&&
this
.
wrapper
.
inject
(
t
)}}.
bind
(
this
),
i
=
function
(
e
){
this
.
isOpen
=!
1
,
this
.
fireEvent
(
"
systemClose
"
).
fireEvent
(
"
close
"
),
this
.
detachEvents
(),
this
.
options
.
overlay
&&
this
.
removeOverlay
(
t
.
instant
||!
this
.
options
.
fade
.
close
),
this
.
fx
&&
this
.
fx
.
cancel
(),
this
.
fx
=
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
"
opacity
"
,
duration
:
this
.
options
.
fadeDuration
.
close
,
link
:
"
cancel
"
,
onComplete
:
e
})[
t
.
instant
||!
this
.
options
.
fade
.
close
?
"
set
"
:
"
start
"
](
0
),
!
t
.
instant
&&
this
.
options
.
fade
.
close
||
e
();
var
i
=
this
.
getTransition
();
i
.
close
&&
new
Fx
.
Tween
(
this
.
wrapper
,{
property
:
i
.
close
.
property
||
"
top
"
,
duration
:
i
.
close
.
duration
||
this
.
options
.
fadeDuration
.
close
,
transition
:
i
.
close
.
transition
||
null
,
onStart
:
i
.
open
.
onStart
||
null
,
onComplete
:
i
.
open
.
onComplete
||
null
}).
start
(
i
.
close
.
start
||
this
.
wrapper
.
getStyle
(
i
.
close
.
property
||
"
top
"
).
toInt
()
+
(
i
.
close
.
difference_start
||
0
),
i
.
close
.
end
||
this
.
wrapper
.
getStyle
(
i
.
close
.
property
||
"
top
"
).
toInt
()
+
(
i
.
close
.
difference_end
||
0
))}.
bind
(
this
);
this
.
options
.
delayClose
>
0
&&!
this
.
ignoreDelay
&&!
this
.
ignoreDelayOnce
?
this
.
timer
=
i
.
delay
(
this
.
options
.
delayClose
,
this
,
e
):
i
(
e
)}
return
this
},
addOverlay
:
function
(
t
){
return
this
.
overlay
||
(
this
.
overlay
=
new
Element
(
"
div
"
,{
styles
:{
position
:
"
fixed
"
,
top
:
0
,
left
:
0
,
width
:
"
100%
"
,
height
:
"
100%
"
,
zIndex
:
this
.
wrapper
.
getStyle
(
"
zIndex
"
)
-
1
,
background
:
this
.
options
.
overlayStyles
.
color
||
"
white
"
,
opacity
:.
001
,
display
:
"
none
"
}}).
set
(
"
tween
"
,{
duration
:
this
.
options
.
overlayFadeDuration
,
link
:
"
cancel
"
}).
inject
(
$
(
document
.
body
),
"
bottom
"
)),
this
.
overlay
.
setStyle
(
"
display
"
,
"
block
"
)[
t
?
"
set
"
:
"
tween
"
](
"
opacity
"
,
this
.
options
.
overlayStyles
.
opacity
||
.
001
),
this
},
removeOverlay
:
function
(
t
){
return
this
.
overlay
&&
this
.
overlay
[
t
?
"
set
"
:
"
tween
"
](
"
opacity
"
,
0
).
get
(
"
tween
"
).
chain
(
function
(){
this
.
overlay
.
setStyle
(
"
display
"
,
"
none
"
)}.
bind
(
this
)),
this
},
getTarget
:
function
(
t
){
return
"
mouse
"
==
(
t
=
$
(
t
)
||
t
||
this
.
target
||
$
(
this
.
options
.
target
)
||
this
.
options
.
target
||
$
(
this
.
options
.
attach
))?
"
mouse
"
:
this
.
fixOperaPositioning
(
$
(
t
))},
getTargetFromEvent
:
function
(
t
){
return
this
.
options
.
target
?
this
.
fixOperaPositioning
(
$
(
this
.
options
.
target
)):
this
.
getTargetElementFromEvent
(
t
)},
getTargetElementFromEvent
:
function
(
t
){
if
(
t
&&
t
.
target
){
if
(
this
.
targets
.
contains
(
t
.
target
))
return
this
.
fixOperaPositioning
(
t
.
target
);
for
(
var
e
=
t
.
target
.
getParent
();
null
!=
e
;){
if
(
this
.
targets
.
contains
(
e
))
return
this
.
fixOperaPositioning
(
e
);
e
=
e
.
getParent
()}}
return
null
},
fixOperaPositioning
:
function
(
t
){
if
(
$
(
t
)
&&!
$
(
t
).
retrieve
(
"
OperaBugFixed
"
)
&&
t
!=
window
){
try
{
$
(
t
).
getStyle
(
"
border-top-width
"
).
toInt
()
+
$
(
t
).
getStyle
(
"
border-right-width
"
).
toInt
()
+
$
(
t
).
getStyle
(
"
border-bottom-width
"
).
toInt
()
+
$
(
t
).
getStyle
(
"
border-left-width
"
).
toInt
()
||
$
(
t
).
setStyle
(
"
border
"
,
0
)}
catch
(
t
){}
$
(
t
).
store
(
"
OperaBugFixed
"
)}
return
t
},
getPosition
:
function
(
t
){
return
!
t
&&
this
.
position
||
(
t
=
t
||
this
.
options
.
position
,
this
.
position
=
{},
this
.
position
.
x
=
"
object
"
==
typeof
t
&&
"
number
"
==
typeof
t
.
x
?[
t
.
x
.
toInt
(),
null
]:
"
object
"
!=
typeof
t
||!
t
.
x
||
"
center
"
==
t
.
x
||
"
object
"
==
typeof
t
.
x
&&
"
center
"
==
t
.
x
[
0
]?[
"
center
"
,
null
]:[
"
right
"
,
"
left
"
].
contains
(
t
.
x
)?[
t
.
x
,
this
.
defaultInOut
||
"
inside
"
]:
"
object
"
==
typeof
t
.
x
&&
[
"
right
"
,
"
left
"
].
contains
(
t
.
x
[
0
])?[
t
.
x
[
0
],[
"
inside
"
,
"
center
"
,
"
outside
"
].
contains
(
t
.
x
[
1
])?
t
.
x
[
1
]:
this
.
defaultInOut
||
"
inside
"
]:[
"
center
"
,
null
],
this
.
position
.
xAttribute
=
"
right
"
==
this
.
position
.
x
[
3
]
||
"
inside
"
==
this
.
position
.
x
[
1
]
&&
"
right
"
==
this
.
position
.
x
[
0
]?
"
right
"
:
"
left
"
,
this
.
position
.
y
=
"
object
"
==
typeof
t
&&
"
number
"
==
typeof
t
.
y
?[
t
.
y
.
toInt
(),
null
]:
"
object
"
!=
typeof
t
||!
t
.
y
||
"
center
"
==
t
.
y
||
"
object
"
==
typeof
t
.
y
&&
"
center
"
==
t
.
y
[
0
]?[
"
center
"
,
null
]:[
"
top
"
,
"
bottom
"
].
contains
(
t
.
y
)?[
t
.
y
,
this
.
defaultInOut
||
"
inside
"
]:
"
object
"
==
typeof
t
.
y
&&
[
"
top
"
,
"
bottom
"
].
contains
(
t
.
y
[
0
])?[
t
.
y
[
0
],[
"
inside
"
,
"
center
"
,
"
outside
"
].
contains
(
t
.
y
[
1
])?
t
.
y
[
1
]:
this
.
defaultInOut
||
"
inside
"
]:[
"
center
"
,
null
],
this
.
position
.
yAttribute
=
"
bottom
"
==
this
.
position
.
x
[
3
]
||
"
inside
"
==
this
.
position
.
y
[
1
]
&&
"
bottom
"
==
this
.
position
.
y
[
0
]?
"
bottom
"
:
"
top
"
),
this
.
position
},
getOffset
:
function
(
t
){
return
!
t
&&
this
.
offset
||
(
t
=
t
||
this
.
options
.
offset
,
this
.
offset
=
{},
this
.
offset
.
x
=
"
number
"
==
typeof
t
?
t
:
t
.
x
&&
(
t
.
x
.
toInt
()
>=
0
||
t
.
x
.
toInt
()
<
0
)?
t
.
x
.
toInt
():
0
,
this
.
offset
.
y
=
"
number
"
==
typeof
t
?
t
:
t
.
y
&&
(
t
.
y
.
toInt
()
>=
0
||
t
.
y
.
toInt
()
<
0
)?
t
.
y
.
toInt
():
0
),
this
.
offset
},
getPointer
:
function
(
t
){
if
(
!
t
&&
this
.
pointer
)
return
this
.
pointer
;
if
(
!
(
t
=
t
||
this
.
options
.
pointer
))
return
!
1
;
var
e
=
this
.
getPosition
();
if
(
this
.
pointer
=
{},
"
outside
"
==
e
.
y
[
1
])
this
.
pointer
.
position
=
"
bottom
"
==
e
.
y
[
0
]?
"
top
"
:
"
bottom
"
,
this
.
pointer
.
adjustment
=
"
object
"
==
typeof
t
&&
[
"
center
"
,
"
right
"
,
"
left
"
].
contains
(
t
[
0
])?
t
[
0
]:[
"
center
"
,
"
right
"
,
"
left
"
].
contains
(
t
)?
t
:
"
center
"
;
else
{
if
(
"
outside
"
!=
e
.
x
[
1
])
return
null
;
this
.
pointer
.
position
=
"
left
"
==
e
.
x
[
0
]?
"
right
"
:
"
left
"
,
this
.
pointer
.
adjustment
=
"
object
"
==
typeof
t
&&
[
"
center
"
,
"
top
"
,
"
bottom
"
].
contains
(
t
[
0
])?
t
[
0
]:[
"
center
"
,
"
top
"
,
"
bottom
"
].
contains
(
t
)?
t
:
"
center
"
}
return
this
.
pointer
.
offset
=
"
object
"
==
typeof
t
&&
t
[
1
]
&&
"
number
"
==
typeof
t
[
1
].
toInt
()?
t
[
1
].
toInt
():
0
,
this
.
pointer
.
offset
=
this
.
pointer
.
offset
<
0
?
-
1
*
this
.
pointer
.
offset
:
this
.
pointer
.
offset
,
this
.
pointer
.
offset
=
"
right
"
==
this
.
pointer
.
adjustment
||
"
bottom
"
==
this
.
pointer
.
adjustment
?
-
1
*
this
.
pointer
.
offset
:
this
.
pointer
.
offset
,
this
.
pointer
},
getTransition
:
function
(){
if
(
this
.
transition
)
return
this
.
transition
;
if
(
this
.
options
.
transition
&&
[
"
flyin
"
,
"
flyout
"
,
"
flyinout
"
,
"
flyoutin
"
,
"
bounce
"
,
"
bouncein
"
,
"
bounceout
"
,
"
bounceinout
"
,
"
bouncefly
"
].
contains
(
this
.
options
.
transition
)){
this
.
transition
=
{},
this
.
transition
.
open
=
{
property
:
"
top
"
==
this
.
position
.
yAttribute
||
"
bottom
"
==
this
.
position
.
yAttribute
?
this
.
position
.
yAttribute
:
this
.
position
.
xAttribute
,
transition
:
"
quad:out
"
,
duration
:
300
},
this
.
transition
.
close
=
Object
.
clone
(
this
.
transition
.
open
);
var
t
=
20
*
(
"
bottom
"
==
this
.
position
.
yAttribute
||
"
right
"
==
this
.
position
.
xAttribute
?
-
1
:
1
);
switch
(
this
.
options
.
transition
){
case
"
flyin
"
:
case
"
flyout
"
:
this
.
transition
.
open
.
difference_start
=
this
.
transition
.
close
.
difference_end
=
t
*
(
"
flyin
"
==
this
.
options
.
transition
?
-
1
:
1
);
break
;
case
"
flyinout
"
:
case
"
flyoutin
"
:
t
*=
"
flyinout
"
==
this
.
options
.
transition
?
1
:
-
1
,
this
.
transition
.
open
.
difference_start
=-
1
*
t
,
this
.
transition
.
close
.
difference_end
=
t
;
break
;
case
"
bounce
"
:
case
"
bouncefly
"
:
case
"
bouncein
"
:
case
"
bounceout
"
:
case
"
bounceinout
"
:
this
.
transition
.
open
.
transition
=
"
bounce:out
"
,
this
.
transition
.
open
.
duration
=
450
,
this
.
transition
.
open
.
difference_start
=-
1
*
t
,
"
bounceinout
"
!=
this
.
options
.
transition
&&
"
bounceout
"
!=
this
.
options
.
transition
&&
"
bouncefly
"
!=
this
.
options
.
transition
||
(
this
.
transition
.
close
.
difference_end
=-
1
*
t
)}}
else
this
.
transition
=
{},
this
.
transition
.
open
=
null
!=
typeof
this
.
options
.
transition
.
open
?
this
.
options
.
transition
.
open
:
this
.
options
.
transition
,
this
.
transition
.
close
=
null
!=
typeof
this
.
options
.
transition
.
close
?
this
.
options
.
transition
.
close
:
this
.
options
.
transition
;
return
this
.
transition
},
setPosition
:
function
(
t
,
e
,
i
){
if
(
t
=
this
.
getTarget
(
t
),
e
=
this
.
getPosition
(
e
),
i
=
this
.
getOffset
(
i
),
pointer
=
this
.
getPointer
(),
"
mouse
"
==
t
)
return
r
=
(
this
.
mouseX
||
0
)
+
15
+
i
.
x
,
h
=
(
this
.
mouseY
||
0
)
+
15
+
i
.
y
,
this
.
wrapper
.
setStyles
({
left
:
Math
.
floor
(
r
),
top
:
Math
.
floor
(
h
)}),
this
;
if
(
!
t
||
[
$
(
window
),
$
(
document
),
$
(
document
.
body
)].
contains
(
t
)){
var
o
=
"
fixed
"
==
this
.
wrapper
.
getStyle
(
"
position
"
)?{
x
:
0
,
y
:
0
}:
$
(
window
).
getScroll
();(
s
=
$
(
window
).
getSize
()).
width
=
s
.
totalWidth
=
s
.
x
,
s
.
height
=
s
.
totalHeight
=
s
.
y
;
var
n
=
{
top
:
o
.
y
,
left
:
o
.
x
,
right
:
o
.
x
+
s
.
width
,
bottom
:
o
.
y
+
s
.
height
}}
else
{
1
!=!
this
.
options
.
fixed
&&
this
.
wrapper
.
setStyle
(
"
position
"
,
"
absolute
"
);
var
s
=
t
.
getDimensions
({
computeSize
:
!
0
});
n
=
t
.
getCoordinates
();
0
==
s
.
totalWidth
&&
(
s
.
width
=
s
.
totalWidth
=
n
.
width
,
s
.
height
=
s
.
totalHeight
=
n
.
height
)}
var
r
=
n
.
left
||
0
,
h
=
n
.
top
||
0
,
a
=
this
.
wrapper
.
getDimensions
({
computeSize
:
!
0
});
if
(
pointer
&&!
this
.
pointerElement
){
if
(
this
.
pointerElement
=
new
Element
(
"
div
"
,{
class
:
"
mBoxPointer mBoxPointer
"
+
pointer
.
position
.
capitalize
(),
styles
:{
position
:
"
absolute
"
}}).
setStyle
(
pointer
.
position
,
0
).
inject
(
this
.
wrapper
,
"
top
"
),
Browser
.
opera
){
var
p
=
new
Element
(
"
div
"
,{
class
:
"
mBox
"
+
(
this
.
defaultTheme
||
"
Core
"
)
+
(
this
.
options
.
theme
?
"
-
"
+
this
.
options
.
theme
:
""
)}).
inject
(
document
.
body
).
grab
(
this
.
pointerElement
);
this
.
pointerDimensions
=
this
.
pointerElement
.
getDimensions
({
computeSize
:
!
0
}),
this
.
pointerElement
.
inject
(
this
.
wrapper
,
"
top
"
),
p
.
destroy
()}
else
this
.
pointerDimensions
=
this
.
pointerElement
.
getDimensions
({
computeSize
:
!
0
});
this
.
container
.
setStyle
(
"
margin-
"
+
pointer
.
position
,
"
left
"
==
pointer
.
position
||
"
right
"
==
pointer
.
position
?
this
.
pointerDimensions
.
width
-
this
.
container
.
getStyle
(
"
border-
"
+
pointer
.
position
).
toInt
():
this
.
pointerDimensions
.
height
-
this
.
container
.
getStyle
(
"
border-
"
+
pointer
.
position
).
toInt
())}
if
(
pointer
&&
this
.
pointerElement
){
if
(
"
outside
"
==
e
.
x
[
1
]
&&
"
outside
"
==
e
.
y
[
1
]
&&
"
center
"
==
pointer
.
adjustment
)
switch
(
pointer
.
adjustment
=
"
left
"
==
e
.
x
[
0
]?
"
right
"
:
"
left
"
,
e
.
x
[
0
]){
case
"
left
"
:
r
+=
a
.
totalWidth
-
this
.
pointerDimensions
.
width
/
2
;
break
;
case
"
right
"
:
r
-=
this
.
pointerDimensions
.
width
/
2
}
var
l
=
0
,
c
=
0
,
d
=
0
;
switch
(
pointer
.
adjustment
){
case
"
center
"
:
l
=
"
top
"
==
pointer
.
position
||
"
bottom
"
==
pointer
.
position
?
a
.
totalWidth
/
2
-
this
.
pointerDimensions
.
width
/
2
:
a
.
totalHeight
/
2
-
this
.
pointerDimensions
.
height
/
2
;
break
;
case
"
left
"
:
case
"
right
"
:
switch
(
e
.
x
[
1
]){
case
"
inside
"
:
c
+=
this
.
pointerDimensions
.
width
/
2
*-
1
+
(
"
right
"
==
e
.
x
[
0
]?
a
.
totalWidth
:
0
);
break
;
default
:
"
center
"
==
e
.
x
[
0
]
&&
(
c
+=
a
.
totalWidth
/
2
-
this
.
pointerDimensions
.
width
/
2
)}
r
+=
c
-
(
"
right
"
==
pointer
.
adjustment
?
a
.
totalWidth
-
this
.
pointerDimensions
.
width
:
0
),
l
=
"
right
"
==
pointer
.
adjustment
?
a
.
totalWidth
-
this
.
pointerDimensions
.
width
:
0
;
break
;
case
"
top
"
:
case
"
bottom
"
:
switch
(
e
.
y
[
1
]){
case
"
inside
"
:
d
+=
this
.
pointerDimensions
.
height
/
2
*-
1
+
(
"
bottom
"
==
e
.
y
[
0
]?
a
.
totalHeight
:
0
);
break
;
default
:
"
center
"
==
e
.
y
[
0
]
&&
(
d
+=
a
.
totalHeight
/
2
-
this
.
pointerDimensions
.
height
/
2
)}
h
+=
d
-
(
"
bottom
"
==
pointer
.
adjustment
?
a
.
totalHeight
-
this
.
pointerDimensions
.
height
:
0
),
l
=
"
bottom
"
==
pointer
.
adjustment
?
a
.
totalHeight
-
this
.
pointerDimensions
.
height
:
0
}
switch
(
pointer
.
position
){
case
"
top
"
:
case
"
bottom
"
:
r
+=-
1
*
pointer
.
offset
;
break
;
case
"
left
"
:
case
"
right
"
:
h
+=-
1
*
pointer
.
offset
}
this
.
pointerElement
.
setStyle
(
"
top
"
==
pointer
.
position
||
"
bottom
"
==
pointer
.
position
?
"
left
"
:
"
top
"
,
l
+
pointer
.
offset
)}
switch
(
a
=
this
.
wrapper
.
getDimensions
({
computeSize
:
!
0
}),
e
.
x
[
0
]){
case
"
center
"
:
r
+=
s
.
totalWidth
/
2
-
a
.
totalWidth
/
2
;
break
;
case
"
right
"
:
r
+=
s
.
totalWidth
-
(
"
inside
"
==
e
.
x
[
1
]?
a
.
totalWidth
:
"
center
"
==
e
.
x
[
1
]?
a
.
totalWidth
/
2
:
0
);
break
;
case
"
left
"
:
r
-=
"
outside
"
==
e
.
x
[
1
]?
a
.
totalWidth
:
"
center
"
==
e
.
x
[
1
]?
a
.
totalWidth
/
2
:
0
;
break
;
default
:
r
=
e
.
x
}
switch
(
e
.
y
[
0
]){
case
"
center
"
:
h
+=
s
.
totalHeight
/
2
-
a
.
totalHeight
/
2
;
break
;
case
"
bottom
"
:
h
+=
s
.
totalHeight
-
(
"
inside
"
==
e
.
y
[
1
]?
a
.
totalHeight
:
"
center
"
==
e
.
y
[
1
]?
a
.
totalHeight
/
2
:
0
);
break
;
case
"
top
"
:
h
-=
"
outside
"
==
e
.
y
[
1
]?
a
.
totalHeight
:
"
center
"
==
e
.
y
[
1
]?
a
.
totalHeight
/
2
:
0
;
break
;
default
:
r
=
e
.
y
}
this
.
wrapper
.
setStyles
({
top
:
null
,
right
:
null
,
bottom
:
null
,
left
:
null
});
var
u
=
$
(
window
).
getSize
();
return
"
right
"
==
e
.
xAttribute
&&
(
r
=
u
.
x
-
(
r
+
a
.
totalWidth
)),
"
bottom
"
==
e
.
yAttribute
&&
(
h
=
u
.
y
-
(
h
+
a
.
totalHeight
)),
r
=
r
||
0
,
r
+=
i
.
x
,
h
+=
i
.
y
,
this
.
wrapper
.
setStyle
(
e
.
xAttribute
,
r
.
floor
()),
this
.
wrapper
.
setStyle
(
e
.
yAttribute
,
h
.
floor
()),
this
},
setContent
:
function
(
t
,
e
){
return
null
!=
t
&&
(
$
(
t
)
||
$$
(
"
.
"
+
t
).
length
>
0
?(
this
[
e
||
"
content
"
].
grab
(
$
(
t
)
||
$$
(
"
.
"
+
t
)),
$
(
t
)
&&
$
(
t
).
setStyle
(
"
display
"
,
""
)):
null
!=
t
&&
(
t
=
(
t
=
t
.
replace
(
/
(?:
<script
[\s\S]
*
?)(?:(?:
<
\/
script>
)
|
(?:\/
>
))
/gim
,
""
)).
replace
(
/<
[^
>
]
+/gim
,(
function
(
t
){
return
t
.
replace
(
/ on
\w
+=
[\"\'\S][^
"
]
*
[\"\'\S]
/gim
,
""
).
replace
(
/javascript/gim
,
""
)})),
this
[
e
||
"
content
"
].
set
(
"
html
"
,
t
))),
this
},
setTitle
:
function
(
t
){
return
null
==
t
||
this
.
titleContainer
||
(
this
.
titleContainer
=
new
Element
(
"
div
"
,{
class
:
"
mBoxTitleContainer
"
}).
inject
(
this
.
container
,
"
top
"
),
this
.
title
=
new
Element
(
"
div
"
,{
class
:
"
mBoxTitle
"
+
(
this
.
options
.
addClass
.
title
||
""
),
styles
:
this
.
options
.
setStyles
.
title
||
{}}).
inject
(
this
.
titleContainer
),
this
.
wrapper
.
addClass
(
"
hasTitle
"
),
this
.
options
.
draggable
&&
null
!=
window
.
Drag
&&
(
new
Drag
(
this
.
wrapper
,{
handle
:
this
.
titleContainer
}),
this
.
titleContainer
.
addClass
(
"
mBoxDraggable
"
)),
this
.
options
.
closeInTitle
&&
new
Element
(
"
div
"
,{
class
:
"
mBoxClose
"
,
events
:{
click
:
function
(){
this
.
close
()}.
bind
(
this
)}}).
grab
(
new
Element
(
"
div
"
)).
inject
(
this
.
titleContainer
)),
null
!=
t
&&
this
.
setContent
(
t
,
"
title
"
),
this
},
setFooter
:
function
(
t
){
return
null
==
t
||
this
.
footerContainer
||
(
this
.
footerContainer
=
new
Element
(
"
div
"
,{
class
:
"
mBoxFooterContainer
"
}).
inject
(
this
.
container
,
"
bottom
"
),
this
.
footer
=
new
Element
(
"
div
"
,{
class
:
"
mBoxFooter
"
+
(
this
.
options
.
addClass
.
footer
||
""
),
styles
:
this
.
options
.
setStyles
.
footer
||
{}}).
inject
(
this
.
footerContainer
),
this
.
wrapper
.
addClass
(
"
hasFooter
"
)),
null
!=
t
&&
this
.
setContent
(
t
,
"
footer
"
),
this
},
load
:
function
(
t
,
e
,
i
){
return
this
.
setContent
(
t
),
this
.
setTitle
(
e
),
this
.
setFooter
(
i
),
this
},
getHTML
:
function
(
t
,
e
,
i
){
return
this
.
load
(
t
,
e
,
i
),
"
<div>
"
+
this
.
wrapper
.
get
(
"
html
"
)
+
"
</div>
"
},
attachEvents
:
function
(){
this
.
escEvent
=
function
(
t
){
"
esc
"
==
t
.
key
&&
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnEsc
&&
$
(
window
).
addEvent
(
"
keyup
"
,
this
.
escEvent
),
this
.
resizeEvent
=
function
(
t
){
this
.
setPosition
()}.
bind
(
this
),
$
(
window
).
addEvent
(
"
resize
"
,
this
.
resizeEvent
),
this
.
options
.
fixed
&&
(
Browser
.
ie6
||
Browser
.
ie7
)
&&
$
(
window
).
addEvent
(
"
scroll
"
,
this
.
resizeEvent
),
this
.
closeOnClickEvent
=
function
(
t
){
this
.
isOpen
&&
$
(
this
.
options
.
attach
)
!=
t
.
target
&&!
$$
(
"
.
"
+
this
.
options
.
attach
).
contains
(
t
.
target
)
&&
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnClick
&&
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnClickEvent
),
this
.
closeOnBoxClickEvent
=
function
(
t
){
this
.
isOpen
&&
(
this
.
wrapper
==
t
.
target
||
this
.
wrapper
.
contains
(
t
.
target
))
&&
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnBoxClick
&&
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnBoxClickEvent
),
this
.
closeOnWrapperClickEvent
=
function
(
t
){
this
.
isOpen
&&
this
.
wrapper
==
t
.
target
&&
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnWrapperClick
&&
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnWrapperClickEvent
),
this
.
closeOnBodyClickEvent
=
function
(
t
){
!
this
.
isOpen
||
$
(
this
.
options
.
attach
)
==
t
.
target
||
$$
(
"
.
"
+
this
.
options
.
attach
).
contains
(
t
.
target
)
||
t
.
target
==
this
.
wrapper
||
this
.
wrapper
.
contains
(
t
.
target
)
||
(
this
.
ignoreDelayOnce
=!
0
,
this
.
close
())}.
bind
(
this
),
this
.
options
.
closeOnBodyClick
&&
$
(
document
).
addEvent
(
"
mouseup
"
,
this
.
closeOnBodyClickEvent
),
this
.
mouseMoveEvent
=
function
(
t
){
this
.
mouseX
=
t
.
page
.
x
,
this
.
mouseY
=
t
.
page
.
y
,
this
.
setPosition
(
"
mouse
"
)}.
bind
(
this
),
"
mouse
"
==
this
.
target
&&
$
(
document
).
addEvent
(
"
mousemove
"
,
this
.
mouseMoveEvent
)},
detachEvents
:
function
(){
this
.
options
.
fixed
&&
(
Browser
.
ie6
||
Browser
.
ie7
)
&&
$
(
window
).
removeEvent
(
"
scroll
"
,
this
.
resizeEvent
),
$
(
window
).
removeEvent
(
"
keyup
"
,
this
.
keyEvent
),
$
(
window
).
removeEvent
(
"
resize
"
,
this
.
resizeEvent
),
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnClickEvent
),
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnBoxClickEvent
),
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnWrapperClickEvent
),
$
(
document
).
removeEvent
(
"
mouseup
"
,
this
.
closeOnBodyClickEvent
),
$
(
document
).
removeEvent
(
"
mousemove
"
,
this
.
mouseMoveEvent
)},
destroy
:
function
(){
mBox
.
instances
.
erase
(
this
),
this
.
detachEvents
(),
this
.
wrapper
.
dispose
(),
delete
this
.
wrapper
}});
mBox
.
instances
=
[],
mBox
.
currentId
=
0
,
mBox
.
reInit
=
function
(){
mBox
.
addConfirmEvents
&&
mBox
.
addConfirmEvents
(),
mBox
.
instances
.
each
((
function
(
t
){
try
{
t
.
reInit
()}
catch
(
t
){}}))},
mBox
.
Notice
=
new
Class
({
Extends
:
mBox
,
options
:{
type
:
"
Default
"
,
position
:{
x
:[
"
left
"
,
"
inside
"
],
y
:[
"
bottom
"
,
"
inside
"
]},
offset
:{
x
:
30
,
y
:
30
},
fixed
:
!
0
,
move
:
!
0
,
moveDuration
:
500
,
delayClose
:
4
e3
,
fade
:
!
0
,
fadeDuration
:{
open
:
250
,
close
:
400
},
target
:
$
(
window
),
zIndex
:
1
e6
,
closeOnEsc
:
!
1
,
closeOnBoxClick
:
!
0
,
closeOnBodyClick
:
!
1
,
openOnInit
:
!
0
},
initialize
:
function
(
t
){
this
.
defaultInOut
=
"
inside
"
,
this
.
defaultTheme
=
"
Notice
"
,
t
.
onSystemBoxReady
=
function
(){
if
(
this
.
container
.
addClass
(
"
mBoxNotice
"
+
(
this
.
options
.
type
.
capitalize
()
||
"
Default
"
)),
this
.
options
.
move
&&
(
"
inside
"
==
this
.
position
.
x
[
1
]
||
"
center
"
==
this
.
position
.
x
[
0
])
&&
"
inside
"
==
this
.
position
.
y
[
1
]
&&
(
"
top
"
==
this
.
position
.
y
[
0
]
||
"
bottom
"
==
this
.
position
.
y
[
0
])){
var
t
=
this
.
wrapper
.
getDimensions
({
computeSize
:
!
0
});
this
.
container
.
setStyle
(
"
position
"
,
"
absolute
"
),
this
.
container
.
setStyle
(
"
top
"
==
this
.
position
.
y
[
0
]?
"
bottom
"
:
"
top
"
,
0
),
this
.
wrapper
.
setStyles
({
height
:
0
,
width
:
t
.
totalWidth
,
overflowY
:
"
hidden
"
}),
this
.
options
.
transition
=
{
open
:{
transition
:
"
linear
"
,
property
:
"
height
"
,
duration
:
this
.
options
.
moveDuration
,
start
:
0
,
end
:
t
.
totalHeight
+
this
.
options
.
offset
.
y
}},
this
.
options
.
offset
.
y
=
0
,
this
.
options
.
delayClose
+=
this
.
options
.
moveDuration
}},
t
.
onSystemOpen
=
function
(){
$
(
window
).
retrieve
(
"
mBoxNotice
"
)
&&
(
$
(
window
).
retrieve
(
"
mBoxNotice
"
).
ignoreDelay
=!
0
,
$
(
window
).
retrieve
(
"
mBoxNotice
"
).
close
()),
$
(
window
).
store
(
"
mBoxNotice
"
,
this
)},
t
.
onSystemOpenComplete
=
function
(){
this
.
close
()},
t
.
onSystemCloseComplete
=
function
(){
this
.
destroy
()},
this
.
parent
(
t
)}}),
mBox
.
Tooltip
=
new
Class
({
Extends
:
mBox
,
options
:{
target
:
null
,
event
:
"
mouseenter
"
,
position
:{
x
:[
"
center
"
],
y
:[
"
top
"
,
"
outside
"
]},
pointer
:
"
center
"
,
fixed
:
!
1
,
delayOpenOnce
:
!
0
},
initialize
:
function
(
t
){
this
.
defaultInOut
=
"
outside
"
,
this
.
defaultTheme
=
"
Tooltip
"
,
this
.
parent
(
t
)}});
\ No newline at end of file
\ No newline at end of file
o2web/source/x_component_process_Work/Main.js
浏览文件 @
0314daae
...
@@ -33,6 +33,7 @@ MWF.xApplication.process.Work.Main = new Class({
...
@@ -33,6 +33,7 @@ MWF.xApplication.process.Work.Main = new Class({
});
});
this
.
lp
=
MWF
.
xApplication
.
process
.
Work
.
LP
;
this
.
lp
=
MWF
.
xApplication
.
process
.
Work
.
LP
;
if
(
!
this
.
status
)
{
if
(
!
this
.
status
)
{
if
(
this
.
options
.
readonly
===
"
true
"
)
this
.
options
.
readonly
=
true
;
}
else
{
}
else
{
this
.
options
.
workId
=
this
.
status
.
workId
;
this
.
options
.
workId
=
this
.
status
.
workId
;
this
.
options
.
workCompletedId
=
this
.
status
.
workCompletedId
;
this
.
options
.
workCompletedId
=
this
.
status
.
workCompletedId
;
...
@@ -685,6 +686,8 @@ MWF.xApplication.process.Work.Main = new Class({
...
@@ -685,6 +686,8 @@ MWF.xApplication.process.Work.Main = new Class({
// },
// },
openWork
:
function
(){
openWork
:
function
(){
if
(
this
.
form
){
if
(
this
.
form
){
if
(
this
.
options
.
readonly
)
this
.
readonly
=
true
;
//this.readonly = true;
//this.readonly = true;
//if (this.currentTask) {
//if (this.currentTask) {
// this.readonly = false;
// this.readonly = false;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录