Commit 4fe8cff6 authored by Liang Ding's avatar Liang Ding

Fix #12186

parent 41c3a37b
#
# Copyright (c) 2010-2016, b3log.org & hacpai.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Description: Language configurations(en_US) of plugin symphony-news-getter.
# Version: 1.0.0.2, Feb 20, 2016
# Author: Liang Ding
# Author: Liyuan Li
#
b3logAnnounceLabel=<a href="https://hacpai.com/tags/B3log%20Announcement" target="_blank">B3log Announcements</a>
\ No newline at end of file
#
# Copyright (c) 2010-2016, b3log.org & hacpai.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Description: Language configurations(zh_CN) of plugin symphony-news-getter.
# Version: 1.0.0.3, Feb 20, 2016
# Author: Liang Ding
# Author: Liyuan Li
#
b3logAnnounceLabel=<a href="https://hacpai.com/tags/B3log%20Announcement" target="_blank">B3log \u516c\u544a</a>
<link type="text/css" rel="stylesheet" href="${staticServePath}/plugins/symphony-news-getter/style.css"/>
<div id="symphonyNewsGetterPanel">
<div class="module-panel">
<div class="module-header">
<h2>${b3logAnnounceLabel}</h2>
</div>
<div class="module-body padding12">
<div id="symphonyNewsGetter">
</div>
</div>
</div>
</div>
<script type="text/javascript">
plugins.symphonyNewsGetter = {
init: function () {
$("#loadMsg").text("${loadingLabel}");
$("#symphonyNewsGetter").css("background",
"url(${staticServePath}/images/loader.gif) no-repeat scroll center center transparent");
$.ajax({
url: "https://hacpai.com/apis/news",
type: "GET",
dataType:"jsonp",
jsonp: "callback",
error: function(){
$("#symphonyNewsGetter").html("Loading B3log Announcement 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>&nbsp; <span class='date'>" + $.bowknot.getDate(article.articleCreateTime, 1); + "</span></li>"
listHTML += articleLiHtml
}
listHTML += "</ul>";
$("#symphonyNewsGetter").html(listHTML).css("background", "none");
}
});
$("#loadMsg").text("");
}
};
/*
* 添加插件
*/
admin.plugin.add({
"id": "symphonyNewsGetter",
"path": "/main/panel1",
"content": $("#symphonyNewsGetterPanel").html()
});
// 移除现有内容
$("#symphonyNewsGetterPanel").remove();
</script>
#
# Copyright (c) 2010-2016, b3log.org & hacpai.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
#
# Description: Description of plugin symphony-news-getter.
# Version: 1.0.0.2, Nov 8, 2012
# Author: Liang Ding
#
rendererId=admin-main.ftl
author=<a href="http://88250.b3log.org">88250</a> & <a href="http://vanessa.b3log.org">Vanessa</a>
name=Symphony News Getter
version=0.0.3
types=ADMIN
classesDirPath=/WEB-INF/classes/
# TODO: libDirPath=/WEB-INF/lib/
pluginClass=
eventListenerClasses=
\ No newline at end of file
/*
* plugin style for symphony-news-getter
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 1.0.0.1, Aug 9, 2011
*/
#symphonyNewsGetter ul {
list-style: none;
}
#symphonyNewsGetter a {
text-decoration: none;
}
#symphonyNewsGetter .date {
color: #686868;
font-size: 12px;
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment