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
38beb324
Commit
38beb324
authored
Apr 24, 2013
by
Vanessa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
about #216
parent
44ac72ef
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
259 additions
and
0 deletions
+259
-0
war/src/main/webapp/plugins/b3log-broadcast/lang_en_US.properties
...main/webapp/plugins/b3log-broadcast/lang_en_US.properties
+22
-0
war/src/main/webapp/plugins/b3log-broadcast/lang_zh_CN.properties
...main/webapp/plugins/b3log-broadcast/lang_zh_CN.properties
+23
-0
war/src/main/webapp/plugins/b3log-broadcast/plugin.ftl
war/src/main/webapp/plugins/b3log-broadcast/plugin.ftl
+163
-0
war/src/main/webapp/plugins/b3log-broadcast/plugin.properties
...src/main/webapp/plugins/b3log-broadcast/plugin.properties
+32
-0
war/src/main/webapp/plugins/b3log-broadcast/style.css
war/src/main/webapp/plugins/b3log-broadcast/style.css
+19
-0
No files found.
war/src/main/webapp/plugins/b3log-broadcast/lang_en_US.properties
0 → 100644
View file @
38beb324
#
# Copyright (c) 2009, 2010, 2011, B3log Team
#
# 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.1, Aug 9, 2011
# Author: Liang Ding
# Author: Liyuan Li
#
war/src/main/webapp/plugins/b3log-broadcast/lang_zh_CN.properties
0 → 100644
View file @
38beb324
#
# Copyright (c) 2009, 2010, 2011, B3log Team
#
# 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.2, Aug 10, 2011
# Author: Liang Ding
# Author: Liyuan Li
#
war/src/main/webapp/plugins/b3log-broadcast/plugin.ftl
0 → 100644
View file @
38beb324
<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();
</script>
\ No newline at end of file
war/src/main/webapp/plugins/b3log-broadcast/plugin.properties
0 → 100644
View file @
38beb324
#
# Copyright (c) 2009, 2010, 2011, B3log Team
#
# 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 b3log-broadcast.
# Version: 1.0.0.1, Apr 24, 2013
# 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
=
b3log broadcast
version
=
0.0.1
types
=
ADMIN
classesDirPath
=
/WEB-INF/classes/
# TODO: libDirPath=/WEB-INF/lib/
pluginClass
=
eventListenerClasses
=
\ No newline at end of file
war/src/main/webapp/plugins/b3log-broadcast/style.css
0 → 100644
View file @
38beb324
/*
* plugin style for b3log-broadcast
*
* @author <a href="mailto:LLY219@gmail.com">Liyuan Li</a>
* @version 1.0.0.1, Apr 24, 2011
*/
#b3logBroadcastDialog
input
,
#b3logBroadcastDialog
textarea
{
width
:
98%
;
}
#b3logBroadcastDialog
label
{
line-height
:
30px
;
}
#b3logBroadcast
.msg
,
#b3logBroadcastDialog
.msg
{
color
:
#D54121
;
}
\ 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