Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo-1
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Administrator
solo-1
Commits
35a03bd1
Unverified
Commit
35a03bd1
authored
Oct 20, 2018
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🎨
调整后台首页推荐贴
parent
4a9f5721
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
49 deletions
+32
-49
src/main/webapp/plugins/symphony-interest/plugin.ftl
src/main/webapp/plugins/symphony-interest/plugin.ftl
+32
-49
No files found.
src/main/webapp/plugins/symphony-interest/plugin.ftl
View file @
35a03bd1
...
@@ -32,71 +32,54 @@
...
@@ -32,71 +32,54 @@
<script type="text/javascript">
<script type="text/javascript">
plugins.symphonyInterest = {
plugins.symphonyInterest = {
init: function () {
init: function () {
$(
"#loadMsg").text("${loadingLabel}");
$(
'#loadMsg').text("${loadingLabel}")
$(
"#symphonyInterest").css("background"
,
$(
'#symphonyInterest').css('background'
,
"url(${staticServePath}/images/loader.gif) no-repeat scroll center center transparent")
;
"url(${staticServePath}/images/loader.gif) no-repeat scroll center center transparent")
$.ajax({
$.ajax({
url: "${servePath}/blog/interest-tags",
url: 'https://hacpai.com/apis/articles?',
type: "GET",
type: 'GET',
dataType: "json",
dataType: 'jsonp',
jsonp: 'callback',
error: function () {
error: function () {
$(
"#symphonyInterest").html("Loading Interest failed :-(").css("background", "none");
$(
'#symphonyInterest').html('Loading Interest failed :-(').css('background', 'none')
},
},
success: function (
result
, textStatus) {
success: function (
data
, textStatus) {
var
tags = result.data;
var
articles = data.articles
if (0 ===
tag
s.length) {
if (0 ===
article
s.length) {
return
;
return
}
}
$.ajax({
url: "https://hacpai.com/apis/articles?p=1&size=7&tags=" + tags.join(),
type: "GET",
dataType: "jsonp",
jsonp: "callback",
error: function () {
$("#symphonyInterest").html("Loading Interest failed :-(").css("background", "none");
},
success: function (data, textStatus) {
var articles = data.articles;
if (0 === articles.length) {
return;
}
var listHTML = "<ul>";
for (var i = 0; i < articles.length; i++) {
var article = articles[i];
var articleLiHtml = "<li>"
+ "<a target='_blank' href='" + article.articlePermalink + "'>"
+ article.articleTitle + "</a> <span class='date'>" + $.bowknot.getDate(article.articleCreateTime, 1);
+"</span></li>"
listHTML += articleLiHtml
}
listHTML += "</ul>";
$("#symphonyInterest").html(listHTML).css("background", "none");
var listHTML = '<ul>'
}
for (var i = 0; i < articles.length; i++) {
});
var article = articles[i]
}
});
var articleLiHtml = '<li>'
+ '<a target=\'_blank\' href=\'' + article.articlePermalink + '\'>'
+ article.articleTitle + '</a> <span class=\'date\'>' + $.bowknot.getDate(article.articleCreateTime, 1);
+'</span></li>'
listHTML += articleLiHtml
}
listHTML += '</ul>'
$('#symphonyInterest').html(listHTML).css('background', 'none')
}
})
$(
"#loadMsg").text("");
$(
'#loadMsg').text('')
}
}
}
;
}
/*
/*
* 添加插件
* 添加插件
*/
*/
admin.plugin.add({
admin.plugin.add({
"id": "symphonyInterest"
,
'id': 'symphonyInterest'
,
"path": "/main/panel1"
,
'path': '/main/panel1'
,
"content": $("#symphonyInterestPanel"
).html()
'content': $('#symphonyInterestPanel'
).html()
})
;
})
// 移除现有内容
// 移除现有内容
$(
"#symphonyInterestPanel").remove();
$(
'#symphonyInterestPanel').remove()
</script>
</script>
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