Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
浙江兰德纵横网络技术股份有限公司
o2oa
提交
00d6cd1a
o2oa
项目概览
浙江兰德纵横网络技术股份有限公司
/
o2oa
通知
339
Star
10
Fork
6
代码
文件
提交
分支
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,发现更多精彩内容 >>
提交
00d6cd1a
编写于
8月 17, 2021
作者:
U
unknown
1
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
图片延迟加载
上级
89c9df8a
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
39 addition
and
19 deletion
+39
-19
o2web/source/o2_core/o2/widget/ImageLazyLoadder.js
o2web/source/o2_core/o2/widget/ImageLazyLoadder.js
+38
-18
o2web/source/x_component_process_FormDesigner/lp/zh-cn.js
o2web/source/x_component_process_FormDesigner/lp/zh-cn.js
+1
-1
未找到文件。
o2web/source/o2_core/o2/widget/ImageLazyLoadder.js
浏览文件 @
00d6cd1a
...
...
@@ -20,9 +20,23 @@ o2.widget.ImageLazyLoadder = o2.ImageLazyLoadder = new Class({
this
.
fireEvent
(
"
init
"
);
},
load
:
function
(){
this
.
loadRerource
(
function
()
{
this
.
parseHtml
()
}.
bind
(
this
))
var
checkLoaded
=
function
()
{
if
(
this
.
resourceLoaded
&&
this
.
parseDone
){
this
.
node
.
set
(
"
html
"
,
this
.
html
);
var
observer
=
lozad
(
'
.lozad
'
,
{
rootMargin
:
'
10px 0px
'
,
// syntax similar to that of CSS Margin
threshold
:
0.1
,
// ratio of element convergence
enableAutoReload
:
true
// it will reload the new image when validating attributes changes
});
observer
.
observe
();
}
}.
bind
(
this
);
this
.
loadResource
(
function
()
{
this
.
resourceLoaded
=
true
;
checkLoaded
()
}.
bind
(
this
));
this
.
parseHtml
();
checkLoaded
()
},
parseHtml
:
function
(){
debugger
;
...
...
@@ -33,24 +47,30 @@ o2.widget.ImageLazyLoadder = o2.ImageLazyLoadder = new Class({
if
(
images
.
length
){
for
(
var
i
=
0
;
i
<
images
.
length
;
i
++
){
var
image
=
images
[
i
];
var
size
=
this
.
getSize
(
image
);
if
(
size
){
var
src
=
this
.
getAttributeValue
(
image
,
"
src
"
);
if
(
src
.
substr
(
0
,
5
)
!==
"
data:
"
){
//不是base64位
var
size
=
this
.
getSize
(
image
);
if
(
size
){
var
image1
=
this
.
removeAttribute
(
image
,
"
src
"
);
var
id
=
this
.
getAttributeValue
(
image1
,
"
data-id
"
);
var
src2
=
id
?
MWF
.
xDesktop
.
getImageSrc
(
id
)
:
src
;
image1
=
this
.
addAttribute
(
image1
,
"
data-src
"
,
src2
);
var
id
=
this
.
getAttributeValue
(
image
,
"
data-id
"
);
var
src
=
id
?
MWF
.
xDesktop
.
getImageSrc
(
id
)
:
this
.
getAttributeValue
(
image
,
"
src
"
);
var
image1
=
this
.
addAttribute
(
image
,
"
data-src
"
,
src
);
image1
=
this
.
replaceStyles
(
image1
,
{
"
height
"
:
size
.
y
+
"
px
"
,
"
width
"
:
size
.
x
+
"
px
"
});
image1
=
this
.
removeAttribute
(
image1
,
"
src
"
);
image1
=
this
.
addAttribute
(
image1
,
"
class
"
,
"
lozad
"
);
image1
=
this
.
replaceStyles
(
image1
,
{
"
height
"
:
size
.
y
+
"
px
"
,
"
width
"
:
size
.
x
+
"
px
"
});
html
=
html
.
replace
(
image
,
image1
);
html
=
html
.
replace
(
image
,
image1
);
}
}
}
}
}
this
.
parseDone
=
true
;
this
.
html
=
html
;
},
getAttrRegExp
:
function
(
attr
){
...
...
@@ -81,10 +101,10 @@ o2.widget.ImageLazyLoadder = o2.ImageLazyLoadder = new Class({
if
(
value
)
newArray
.
push
(
key
+
"
:
"
+
value
)
});
if
(
o2
.
typeOf
(
array
)
===
"
array
"
&&
array
.
length
>
1
){
var
styles
=
array
[
1
].
split
(
"
;
"
);
var
styles
=
array
[
1
].
split
(
/
\s
*;
\s
*/gi
);
for
(
var
j
=
0
;
j
<
styles
.
length
;
j
++
){
var
ar
=
styles
[
j
].
split
(
"
:
"
);
var
key
=
ar
[
0
].
t
rim
().
t
oLowerCase
();
var
ar
=
styles
[
j
].
split
(
/
\s
*:
\s
*/gi
);
var
key
=
ar
[
0
].
toLowerCase
();
if
(
!
object
.
hasOwnProperty
(
key
)
){
newArray
.
push
(
styles
[
j
]
);
}
...
...
@@ -146,7 +166,7 @@ o2.widget.ImageLazyLoadder = o2.ImageLazyLoadder = new Class({
}
return
null
;
},
loadRe
r
ource
:
function
(
callback
)
{
loadRe
s
ource
:
function
(
callback
)
{
var
lozadPath
=
"
../o2_lib/lozad/lozad.min.js
"
;
var
observerPath
=
"
../o2_lib/IntersectionObserver/intersection-observer.min.js
"
;
if
(
window
.
IntersectionObserver
||
window
.
MutationObserver
){
...
...
o2web/source/x_component_process_FormDesigner/lp/zh-cn.js
浏览文件 @
00d6cd1a
...
...
@@ -835,7 +835,7 @@ MWF.xApplication.process.FormDesigner.LP = {
"
ckeditorInfo2
"
:
"
返回CKEditor的Config对象,用于编辑器初始化
"
,
"
ckeditorInfo3
"
:
"
更多事件帮助请查看
"
,
"
base64Encode
"
:
"
图片Base64编码
"
,
"
imagePreview
"
:
"
浏览
大
图
"
,
"
imagePreview
"
:
"
浏览
原
图
"
,
"
ieOnly
"
:
"
仅IE浏览器可用
"
,
"
keepHistory
"
:
"
是否保留历史版本
"
,
...
...
liyi_hz2008
@liyi_hz2008
mentioned in commit
eb71d00c
·
8月 17, 2021
mentioned in commit
eb71d00c
mentioned in commit eb71d00ca850e3aa8f750899883b4d23b79ca4fe
开关提交列表
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录