Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
solo
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
Commits
e70f4bde
Commit
e70f4bde
authored
Apr 24, 2013
by
Vanessa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
多语言
parent
cf54a811
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
195 additions
and
168 deletions
+195
-168
war/src/main/webapp/plugins/b3log-broadcast/lang_en_US.properties
...main/webapp/plugins/b3log-broadcast/lang_en_US.properties
+11
-3
war/src/main/webapp/plugins/b3log-broadcast/lang_zh_CN.properties
...main/webapp/plugins/b3log-broadcast/lang_zh_CN.properties
+10
-3
war/src/main/webapp/plugins/b3log-broadcast/plugin.ftl
war/src/main/webapp/plugins/b3log-broadcast/plugin.ftl
+159
-162
war/src/main/webapp/plugins/b3log-broadcast/style.css
war/src/main/webapp/plugins/b3log-broadcast/style.css
+15
-0
No files found.
war/src/main/webapp/plugins/b3log-broadcast/lang_en_US.properties
View file @
e70f4bde
...
...
@@ -15,8 +15,16 @@
#
#
# Description: Language configurations(en_US) of plugin symphony-news-getter.
# Version: 1.0.0.1, Aug 9, 2011
# Author: Liang Ding
# Description: Language configurations(zh_CN) of plugin b3log broadcast.
# Version: 1.0.0.1, Apr 24, 2013
# Author: Liyuan Li
#
userBroadcastLabel
=
User Broadcast
titleLabel1
=
Title:
linkLabel1
=
Link:
contentLabel1
=
Content:
noEmptyLabel
=
No Empty
submitLabel
=
Submit
submitErrorLabel
=
Error
chanceBroadcastLabel
=
Second Chance
war/src/main/webapp/plugins/b3log-broadcast/lang_zh_CN.properties
View file @
e70f4bde
...
...
@@ -15,9 +15,16 @@
#
#
# Description: Language configurations(zh_CN) of plugin symphony-news-getter.
# Version: 1.0.0.2, Aug 10, 2011
# Author: Liang Ding
# Description: Language configurations(zh_CN) of plugin b3log broadcast.
# Version: 1.0.0.1, Apr 24, 2013
# Author: Liyuan Li
#
userBroadcastLabel
=
\u7528\u6237\u
5e7f
\u
64ad
titleLabel1
=
\u6807\u9898\u
ff1a
linkLabel1
=
\u
94fe
\u
63a5
\u
ff1a
contentLabel1
=
\u5185\u
5bb9
\u
ff1a
noEmptyLabel
=
\u
4e0d
\u
80fd
\u
4e3a
\u
7a7a
submitLabel
=
\u
63d0
\u
4ea4
submitErrorLabel
=
\u
63d0
\u
4ea4
\u
5f02
\u
5e38
chanceBroadcastLabel
=
\u
79d2
\u
673a
\u
4f1a
\u
8fdb
\u
884c
\u
5e7f
\u
64ad
\ No newline at end of file
war/src/main/webapp/plugins/b3log-broadcast/plugin.ftl
View file @
e70f4bde
<link type="text/css" rel="stylesheet" href="${staticServePath}/plugins/b3log-broadcast/style.css"/>
<div id="b3logBroadcastPanel">
<div id="b3logBroadcast">
<div class="module-panel">
<div class="module-header">
<h2 class="left">
<a target="_blank" href="http://symphony.b3log.org/tags/B3log%20Broadcast">
用户广播
</a>
</h2>
<button class="none right msg"></button>
<span class="clear"></span>
</div>
<div class="module-body padding12">
<div id="b3logBroadcastList">
</div>
</div>
</div>
</div>
<div id="b3logBroadcastDialog" class="form">
<label>标题:</label>
<span class="none msg">不本能为空</span>
<input type="text" id="b3logBroadcastTitle">
<label>链接:</label>
<input type="text" id="b3logBroadcastLink">
<label>内容:</label>
<span class="none msg">不本能为空</span>
<textarea id="b3logBroadcastContent"></textarea>
<button class="marginTop12">提交</button><span class="none msg">提交异常</span>
</div>
</div>
<script type="text/javascript">
plugins.b3logBroadcast = {
init: function() {
$("#loadMsg").text("${loadingLabel}");
// dialog
$("#b3logBroadcastDialog").dialog({
width: 700,
height: 245,
"modal": true,
"hideFooter": true
});
// 打开广播窗口
$("#b3logBroadcast .module-header > button").click(function() {
$("#b3logBroadcastDialog").dialog("open");
});
// 广播提交
$("#b3logBroadcastDialog button").click(function() {
var data = {
"broadcast": {
"title": $("#b3logBroadcastTitle").val().replace(/(^\s*)|(\s*$)/g, ""),
"content": $("#b3logBroadcastContent").val().replace(/(^\s*)|(\s*$)/g, ""),
"link": $("#b3logBroadcastLink").val()
}
};
console.log(data);
if (data.broadcast.title === "") {
$("#b3logBroadcastTitle").prev().show();
}
if (data.broadcast.content === "") {
$("#b3logBroadcastContent").prev().show();
}
if (data.broadcast.title === "" || data.broadcast.content === "") {
return;
}
$.ajax({
type: "POST",
url: latkeConfig.servePath + "/console/plugins/b3log-broadcast",
data: JSON.stringify(data),
success: function(result) {
if (result.sc) {
$("#b3logBroadcastTitle").val("");
$("#b3logBroadcastLink").val("");
$("#b3logBroadcastContent").val("");
$("#b3logBroadcastDialog").dialog("close");
$("#b3logBroadcastDialog > button").next().hide();
$("#b3logBroadcast .module-header > button").hide();
$("#b3logBroadcastTitle").prev().hide();
$("#b3logBroadcastContent").prev().hide();
} else {
$("#b3logBroadcastDialog > button").next().show();
}
}
});
});
// 获取广播
$.ajax({
type: "GET",
url: "http://symphony.b3log.org/apis/broadcasts",
dataType: "jsonp",
jsonp: "callback",
before: function () {
$("#b3logBroadcastList").css("background",
"url(${staticServePath}/images/loader.gif) no-repeat scroll center center transparent");
},
error: function() {
$("#b3logBroadcastList").html("Loading B3log Announcement failed :-(").css("background", "none");
},
success: function(result) {
if (result.sc) {
var articles = result.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>";
$("#b3logBroadcastList").html(listHTML).css("background", "none");
}
},
complete: function(XMLHttpRequest, textStatus) {
$("#loadMsg").text("");
}
});
// 广播机会
setInterval(function() {
$.ajax({
type: "GET",
url: latkeConfig.servePath + "/console/plugins/b3log-broadcast/chance",
success: function(result) {
if (!result.sc) {
$("#b3logBroadcast .module-header > button").text("您有" + result.broadcastChanceExpirationTime + "秒机会进行广播").show();
} else {
$("#b3logBroadcast .module-header > button").hide();
}
}
});
}, 10000);
}
};
/*
* 添加插件
*/
admin.plugin.add({
"id": "b3logBroadcast",
"path": "/main/panel2",
"content": $("#b3logBroadcastPanel").html()
});
// 移除现有内容
$("#b3logBroadcastPanel").remove();
<link type="text/css" rel="stylesheet" href="${staticServePath}/plugins/b3log-broadcast/style.css"/>
<div id="b3logBroadcastPanel">
<div id="b3logBroadcast">
<div class="module-panel">
<div class="module-header">
<h2 class="left">
<a target="_blank" href="http://symphony.b3log.org/tags/B3log%20Broadcast">
${userBroadcastLabel}
</a>
</h2>
<button class="none right msg"></button>
<span class="clear"></span>
</div>
<div class="module-body padding12">
<div id="b3logBroadcastList">
</div>
</div>
</div>
</div>
<div id="b3logBroadcastDialog" class="form">
<label>${titleLabel1}</label>
<span class="none msg">${noEmptyLabel}</span>
<input type="text" id="b3logBroadcastTitle">
<label>${linkLabel1}</label>
<input type="text" id="b3logBroadcastLink">
<label>${contentLabel1}</label>
<span class="none msg">${noEmptyLabel}</span>
<textarea id="b3logBroadcastContent"></textarea>
<button class="marginTop12">${submitLabel}</button><span class="none msg">${submitErrorLabel}</span>
</div>
</div>
<script type="text/javascript">
plugins.b3logBroadcast = {
init: function() {
$("#loadMsg").text("${loadingLabel}");
// dialog
$("#b3logBroadcastDialog").dialog({
width: 700,
height: 245,
"modal": true,
"hideFooter": true
});
// 打开广播窗口
$("#b3logBroadcast .module-header > button").click(function() {
$("#b3logBroadcastDialog").dialog("open");
});
// 广播提交
$("#b3logBroadcastDialog button").click(function() {
var data = {
"broadcast": {
"title": $("#b3logBroadcastTitle").val().replace(/(^\s*)|(\s*$)/g, ""),
"content": $("#b3logBroadcastContent").val().replace(/(^\s*)|(\s*$)/g, ""),
"link": $("#b3logBroadcastLink").val()
}
};
if (data.broadcast.title === "") {
$("#b3logBroadcastTitle").prev().show();
}
if (data.broadcast.content === "") {
$("#b3logBroadcastContent").prev().show();
}
if (data.broadcast.title === "" || data.broadcast.content === "") {
return;
}
$.ajax({
type: "POST",
url: latkeConfig.servePath + "/console/plugins/b3log-broadcast",
data: JSON.stringify(data),
success: function(result) {
if (result.sc) {
$("#b3logBroadcastTitle").val("");
$("#b3logBroadcastLink").val("");
$("#b3logBroadcastContent").val("");
$("#b3logBroadcastDialog").dialog("close");
$("#b3logBroadcastDialog > button").next().hide();
$("#b3logBroadcast .module-header > button").hide();
$("#b3logBroadcastTitle").prev().hide();
$("#b3logBroadcastContent").prev().hide();
} else {
$("#b3logBroadcastDialog > button").next().show();
}
}
});
});
// 获取广播
$.ajax({
type: "GET",
url: "http://symphony.b3log.org/apis/broadcasts",
dataType: "jsonp",
jsonp: "callback",
beforeSend: function () {
$("#b3logBroadcastList").css("background",
"url(${staticServePath}/images/loader.gif) no-repeat scroll center center transparent");
},
error: function() {
$("#b3logBroadcastList").html("Loading Symphony broadcasts failed :-(").css("background", "none");
},
success: function(result) {
if (result.sc) {
var articles = result.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>";
$("#b3logBroadcastList").html(listHTML).css("background", "none");
}
},
complete: function(XMLHttpRequest, textStatus) {
$("#loadMsg").text("");
}
});
// 广播机会
setInterval(function() {
$.ajax({
type: "GET",
url: latkeConfig.servePath + "/console/plugins/b3log-broadcast/chance",
success: function(result) {
if (result.sc) {
$("#b3logBroadcast .module-header > button").text(result.broadcastChanceExpirationTime + "${chanceBroadcastLabel}").show();
} else {
$("#b3logBroadcast .module-header > button").hide();
}
}
});
}, 10000);
}
};
/*
* 添加插件
*/
admin.plugin.add({
"id": "b3logBroadcast",
"path": "/main/panel2",
"content": $("#b3logBroadcastPanel").html()
});
// 移除现有内容
$("#b3logBroadcastPanel").remove();
</script>
\ No newline at end of file
war/src/main/webapp/plugins/b3log-broadcast/style.css
View file @
e70f4bde
...
...
@@ -9,6 +9,10 @@
width
:
98%
;
}
#b3logBroadcast
.module-header
>
button
{
height
:
22px
;
}
#b3logBroadcastDialog
label
{
line-height
:
30px
;
}
...
...
@@ -16,4 +20,15 @@
#b3logBroadcast
.msg
,
#b3logBroadcastDialog
.msg
{
color
:
#D54121
;
}
#b3logBroadcastList
ul
{
list-style
:
none
;
}
#b3logBroadcastList
a
{
text-decoration
:
none
;
}
#b3logBroadcastList
.date
{
color
:
#686868
;
font-size
:
12px
;
}
\ No newline at end of file
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