Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
s_ibanshou
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
蒋林
s_ibanshou
Commits
dad30388
Commit
dad30388
authored
Apr 09, 2018
by
wangjj
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cookie path 限制
parent
d7fb4e61
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
34 additions
and
28 deletions
+34
-28
credit.php
e/action/credit.php
+0
-1
news.js
skin/default/js/news.js
+34
-27
No files found.
e/action/credit.php
View file @
dad30388
...
@@ -21,7 +21,6 @@ $typeMap = [
...
@@ -21,7 +21,6 @@ $typeMap = [
'share'
=>
1
,
'share'
=>
1
,
];
];
if
(
$mod
==
'credit'
){
if
(
$mod
==
'credit'
){
$userId
=
$user
[
'ucid'
];
$userId
=
$user
[
'ucid'
];
if
(
isset
(
$typeMap
[
$type
]))
{
if
(
isset
(
$typeMap
[
$type
]))
{
...
...
skin/default/js/news.js
View file @
dad30388
...
@@ -51,21 +51,21 @@ function comments() {
...
@@ -51,21 +51,21 @@ function comments() {
function
tpl
(
comment
)
{
function
tpl
(
comment
)
{
var
html
=
'<li data-id="'
+
comment
.
id
+
'">
\
var
html
=
'<li data-id="'
+
comment
.
id
+
'">
\
<img src="'
+
comment
.
avatar
+
'">
\
<img src="'
+
comment
.
avatar
+
'">
\
<div class="name">'
+
comment
.
nickname
+
'</div>
\
<div class="name">'
+
comment
.
nickname
+
'</div>
\
<div class="comment-main">'
+
comment
.
content
+
'</div>
\
<div class="comment-main">'
+
comment
.
content
+
'</div>
\
<div class="comment-footbar clearfix">
\
<div class="comment-footbar clearfix">
\
<span>'
+
comment
.
created_at
+
'</span>
\
<span>'
+
comment
.
created_at
+
'</span>
\
<a href="javascript:popReplyComment('
+
comment
.
id
+
');" class="pl-reply"><i class="iconfont icon-comment_light"></i>回复</a>
\
<a href="javascript:popReplyComment('
+
comment
.
id
+
');" class="pl-reply"><i class="iconfont icon-comment_light"></i>回复</a>
\
<a href="javascript:likeComment('
+
comment
.
id
+
', '
+
comment
.
islike
+
');" class="pl-zan"><i class="iconfont '
+
(
comment
.
islike
?
"icon-zan-fill"
:
"icon-zan"
)
+
'"></i>赞</a>
\
<a href="javascript:likeComment('
+
comment
.
id
+
', '
+
comment
.
islike
+
');" class="pl-zan"><i class="iconfont '
+
(
comment
.
islike
?
"icon-zan-fill"
:
"icon-zan"
)
+
'"></i>赞</a>
\
</div>'
;
</div>'
;
if
(
!
$
.
isEmptyObject
(
comment
.
reply
))
{
if
(
!
$
.
isEmptyObject
(
comment
.
reply
))
{
var
replys
=
comment
.
reply
;
var
replys
=
comment
.
reply
;
html
+=
'<div class="comment-replay">'
;
html
+=
'<div class="comment-replay">'
;
for
(
i
in
replys
)
{
for
(
i
in
replys
)
{
html
+=
'<div class="comment-replay-list"><span>'
+
replys
[
i
].
nickname
+
':</span>'
+
replys
[
i
].
content
+
' <span>'
+
replys
[
i
].
created_at
+
'</span></div>'
;
html
+=
'<div class="comment-replay-list"><span>'
+
replys
[
i
].
nickname
+
':</span>'
+
replys
[
i
].
content
+
' <span>'
+
replys
[
i
].
created_at
+
'</span></div>'
;
}
}
html
+=
'</div>'
;
html
+=
'</div>'
;
}
}
...
@@ -74,7 +74,7 @@ function tpl(comment) {
...
@@ -74,7 +74,7 @@ function tpl(comment) {
//回复弹窗
//回复弹窗
function
popReplyComment
(
id
)
{
function
popReplyComment
(
id
)
{
var
parent
=
$
(
'.comment-list'
).
find
(
'> li[data-id='
+
id
+
']'
);
var
parent
=
$
(
'.comment-list'
).
find
(
'> li[data-id='
+
id
+
']'
);
var
name
=
parent
.
find
(
'> .name'
).
text
()
+
':'
;
var
name
=
parent
.
find
(
'> .name'
).
text
()
+
':'
;
var
content
=
parent
.
find
(
'> .comment-main'
).
text
();
var
content
=
parent
.
find
(
'> .comment-main'
).
text
();
$
(
'#reply-name'
).
text
(
name
);
$
(
'#reply-name'
).
text
(
name
);
...
@@ -119,15 +119,15 @@ $(".reply-pl").click(function () {
...
@@ -119,15 +119,15 @@ $(".reply-pl").click(function () {
});
});
function
handelReplyComment
(
plid
,
comment
)
{
function
handelReplyComment
(
plid
,
comment
)
{
$
.
each
(
$
(
'.comment-list li'
),
function
()
{
$
.
each
(
$
(
'.comment-list li'
),
function
()
{
if
(
$
(
this
).
attr
(
'data-id'
)
==
plid
)
{
if
(
$
(
this
).
attr
(
'data-id'
)
==
plid
)
{
var
html
=
''
;
var
html
=
''
;
if
(
$
(
this
).
children
(
".comment-replay"
).
html
())
{
if
(
$
(
this
).
children
(
".comment-replay"
).
html
())
{
html
=
'<div class="comment-replay-list"><span>'
+
comment
.
nickname
+
':</span>'
+
comment
.
content
+
' <span>'
+
comment
.
created_at
+
'</span></div>'
;
html
=
'<div class="comment-replay-list"><span>'
+
comment
.
nickname
+
':</span>'
+
comment
.
content
+
' <span>'
+
comment
.
created_at
+
'</span></div>'
;
$
(
this
).
children
(
".comment-replay"
).
append
(
html
);
$
(
this
).
children
(
".comment-replay"
).
append
(
html
);
}
else
{
}
else
{
html
=
'<div class="comment-replay">
\
html
=
'<div class="comment-replay">
\
<div class="comment-replay-list"><span>'
+
comment
.
nickname
+
':</span>'
+
comment
.
content
+
' <span>'
+
comment
.
created_at
+
'</span></div>
\
<div class="comment-replay-list"><span>'
+
comment
.
nickname
+
':</span>'
+
comment
.
content
+
' <span>'
+
comment
.
created_at
+
'</span></div>
\
</div>'
;
</div>'
;
$
(
this
).
append
(
html
);
$
(
this
).
append
(
html
);
}
}
...
@@ -143,7 +143,7 @@ function likeComment(plid, islike) {
...
@@ -143,7 +143,7 @@ function likeComment(plid, islike) {
$
.
post
(
"/e/action/news/comment.php?mod=like"
,
{
plid
:
plid
},
function
(
e
)
{
$
.
post
(
"/e/action/news/comment.php?mod=like"
,
{
plid
:
plid
},
function
(
e
)
{
if
(
e
.
status
)
{
if
(
e
.
status
)
{
$
.
each
(
$
(
'.comment-list li'
),
function
()
{
$
.
each
(
$
(
'.comment-list li'
),
function
()
{
if
(
$
(
this
).
attr
(
'data-id'
)
==
plid
)
{
if
(
$
(
this
).
attr
(
'data-id'
)
==
plid
)
{
$
(
this
).
find
(
".icon-zan"
).
addClass
(
"icon-zan-fill"
).
removeClass
(
"icon-zan"
);
$
(
this
).
find
(
".icon-zan"
).
addClass
(
"icon-zan-fill"
).
removeClass
(
"icon-zan"
);
}
}
...
@@ -158,40 +158,47 @@ function likeComment(plid, islike) {
...
@@ -158,40 +158,47 @@ function likeComment(plid, islike) {
function
shareSuccessCallback
(
type
)
{
function
shareSuccessCallback
(
type
)
{
$
.
ajax
({
$
.
ajax
({
type
:
"GET"
,
type
:
"GET"
,
url
:
"/e/action/credit.php?mod=credit&type="
+
type
,
url
:
"/e/action/credit.php?mod=credit&type="
+
type
,
data
:
''
,
data
:
''
,
dataType
:
"json"
,
dataType
:
"json"
,
success
:
function
(
response
)
{
success
:
function
(
response
)
{
if
(
response
.
status
)
{
if
(
response
.
status
)
{
cookieTips
();
cookieTips
();
}
}
}
}
});
});
}
}
function
getCookie
(
sName
)
function
getCookie
(
sName
)
{
{
var
aCookie
=
document
.
cookie
.
split
(
"; "
);
var
aCookie
=
document
.
cookie
.
split
(
"; "
);
for
(
var
i
=
0
;
i
<
aCookie
.
length
;
i
++
)
for
(
var
i
=
0
;
i
<
aCookie
.
length
;
i
++
)
{
{
var
aCrumb
=
aCookie
[
i
].
split
(
"="
);
var
aCrumb
=
aCookie
[
i
].
split
(
"="
);
if
(
sName
==
aCrumb
[
0
])
if
(
sName
==
aCrumb
[
0
])
return
unescape
(
aCrumb
[
1
]);
return
unescape
(
aCrumb
[
1
]);
}
}
return
null
;
return
null
;
}
}
function
setCookie
(
cname
,
cvalue
)
{
function
setCookie
(
cname
,
cvalue
)
{
document
.
cookie
=
cname
+
"="
+
cvalue
+
"; "
;
document
.
cookie
=
cname
+
"="
+
cvalue
+
"; "
;
}
}
function
deleteCookie
(
name
,
path
)
{
// 删除Cookie
var
strCookie
;
// 检查Cookie是否存在
// 设置Cookie的期限为己过期
strCookie
=
name
+
"="
;
strCookie
+=
(
path
)
?
"; path="
+
path
:
""
;
document
.
cookie
=
strCookie
;
}
//end function deleteCookie
function
cookieTips
()
{
function
cookieTips
()
{
var
obj
=
getCookie
(
'creditNotice'
);
var
obj
=
getCookie
(
'creditNotice'
);
if
(
obj
)
{
if
(
obj
)
{
obj
=
JSON
.
parse
(
obj
);
obj
=
JSON
.
parse
(
obj
);
var
desc
=
'分享成功金币 +'
+
obj
.
number
;
var
desc
=
'分享成功金币 +'
+
obj
.
number
;
Banshou
.
creditTip
(
obj
.
title
,
desc
,
2000
);
Banshou
.
creditTip
(
obj
.
title
,
desc
,
2000
);
setCookie
(
'creditNotice'
,
'
'
);
deleteCookie
(
'creditNotice'
,
'/
'
);
}
}
}
}
...
@@ -220,7 +227,7 @@ function scrollLoading() {
...
@@ -220,7 +227,7 @@ function scrollLoading() {
var
lastplid
=
$
(
".comment-list li:last-child"
).
attr
(
'data-id'
);
var
lastplid
=
$
(
".comment-list li:last-child"
).
attr
(
'data-id'
);
lastplid
=
lastplid
?
lastplid
:
0
;
lastplid
=
lastplid
?
lastplid
:
0
;
scrollLoad
.
html
(
"<img src='"
+
spinner
+
"'>"
);
scrollLoad
.
html
(
"<img src='"
+
spinner
+
"'>"
);
$
.
post
(
"/e/action/news/comment.php"
,
{
newsid
:
newsid
,
lastplid
:
lastplid
},
function
(
e
)
{
$
.
post
(
"/e/action/news/comment.php"
,
{
newsid
:
newsid
,
lastplid
:
lastplid
},
function
(
e
)
{
if
(
!
$
.
isEmptyObject
(
e
.
data
))
{
if
(
!
$
.
isEmptyObject
(
e
.
data
))
{
var
comments
=
e
.
data
;
var
comments
=
e
.
data
;
var
html
=
''
;
var
html
=
''
;
...
@@ -231,7 +238,7 @@ function scrollLoading() {
...
@@ -231,7 +238,7 @@ function scrollLoading() {
}
else
{
}
else
{
scrollLoad
.
html
(
"全部加载完毕"
);
scrollLoad
.
html
(
"全部加载完毕"
);
$
(
window
).
off
(
"scroll"
,
scrollLoading
);
$
(
window
).
off
(
"scroll"
,
scrollLoading
);
setTimeout
(
function
()
{
setTimeout
(
function
()
{
scrollLoad
.
slideUp
();
scrollLoad
.
slideUp
();
},
1000
);
},
1000
);
}
}
...
@@ -266,11 +273,11 @@ $.post("/e/action/news/index.php?mod=init", {newsid: newsid}, function (e) {
...
@@ -266,11 +273,11 @@ $.post("/e/action/news/index.php?mod=init", {newsid: newsid}, function (e) {
//点赞
//点赞
function
diggtop
()
{
function
diggtop
()
{
$
(
'#zan'
).
one
(
'click'
,
function
()
{
$
(
'#zan'
).
one
(
'click'
,
function
()
{
$
.
post
(
"/e/action/news/index.php?mod=diggtop"
,
{
newsid
:
newsid
},
function
(
e
)
{
$
.
post
(
"/e/action/news/index.php?mod=diggtop"
,
{
newsid
:
newsid
},
function
(
e
)
{
if
(
e
.
status
)
{
if
(
e
.
status
)
{
$
(
"#zan"
).
find
(
'i'
).
removeClass
(
'icon-zan'
).
addClass
(
'icon-zan-fill'
);
$
(
"#zan"
).
find
(
'i'
).
removeClass
(
'icon-zan'
).
addClass
(
'icon-zan-fill'
);
$
(
'.zan-tip'
).
animate
({
opacity
:
"1"
,
top
:
"-=30"
},
500
).
animate
({
opacity
:
"0"
,
top
:
"-30"
},
"slow"
);
$
(
'.zan-tip'
).
animate
({
opacity
:
"1"
,
top
:
"-=30"
},
500
).
animate
({
opacity
:
"0"
,
top
:
"-30"
},
"slow"
);
}
else
{
}
else
{
pop
(
e
.
msg
,
e
.
data
);
pop
(
e
.
msg
,
e
.
data
);
}
}
...
@@ -295,9 +302,9 @@ $('#favor').click(function () {
...
@@ -295,9 +302,9 @@ $('#favor').click(function () {
},
'json'
);
},
'json'
);
});
});
(
function
(
$
)
{
(
function
(
$
)
{
//加载乐视视频
//加载乐视视频
$
(
"div.lecloud-video"
).
each
(
function
()
{
$
(
"div.lecloud-video"
).
each
(
function
()
{
var
width
=
640
,
height
=
360
,
rate
=
width
/
height
;
var
width
=
640
,
height
=
360
,
rate
=
width
/
height
;
var
video
=
createVideoElement
(
width
,
height
);
var
video
=
createVideoElement
(
width
,
height
);
$
(
this
).
replaceWith
(
video
);
$
(
this
).
replaceWith
(
video
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment