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
44acc473
Commit
44acc473
authored
Aug 17, 2017
by
Liang Ding
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
🔥
Fix #12336
parent
6d37999e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
0 additions
and
315 deletions
+0
-315
src/test/resources/plugins/b3log-broadcast/lang_en_US.properties
...t/resources/plugins/b3log-broadcast/lang_en_US.properties
+0
-31
src/test/resources/plugins/b3log-broadcast/lang_zh_CN.properties
...t/resources/plugins/b3log-broadcast/lang_zh_CN.properties
+0
-30
src/test/resources/plugins/b3log-broadcast/plugin.ftl
src/test/resources/plugins/b3log-broadcast/plugin.ftl
+0
-188
src/test/resources/plugins/b3log-broadcast/plugin.properties
src/test/resources/plugins/b3log-broadcast/plugin.properties
+0
-32
src/test/resources/plugins/b3log-broadcast/style.css
src/test/resources/plugins/b3log-broadcast/style.css
+0
-34
No files found.
src/test/resources/plugins/b3log-broadcast/lang_en_US.properties
deleted
100644 → 0
View file @
6d37999e
#
# 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 b3log broadcast.
# Version: 1.0.1.1, Sep 4, 2016
# Author: Liyuan Li
# Author: Liang Ding
#
userBroadcastLabel
=
User Broadcast
titleLabel1
=
Title:
linkLabel1
=
Link:
contentLabel1
=
Content:
noEmptyLabel
=
No Empty
submitLabel
=
Submit
submitErrorLabel
=
Error
chanceBroadcastLabel1
=
Time to post:
src/test/resources/plugins/b3log-broadcast/lang_zh_CN.properties
deleted
100644 → 0
View file @
6d37999e
#
# 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 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
chanceBroadcastLabel1
=
\u
5e7f
\u
64ad
\u5269\u
4f59
\u
65f6
\u
95f4
\u
ff1a
\ No newline at end of file
src/test/resources/plugins/b3log-broadcast/plugin.ftl
deleted
100644 → 0
View file @
6d37999e
<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="https://hacpai.com/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();
$("#b3logBroadcastTitle").prev().hide();
$("#b3logBroadcastContent").prev().hide();
broadcastChange();
} else {
$("#b3logBroadcastDialog > button").next().show();
}
}
});
});
// 获取广播
$.ajax({
type: "GET",
url: "https://hacpai.com/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) {
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("");
}
});
// 广播机会
var interval;
var broadcastChange = function() {
$.ajax({
type: "GET",
url: latkeConfig.servePath + "/console/plugins/b3log-broadcast/chance",
cache: false,
success: function(result) {
if (result.sc) {
var showCountDown = function() {
var now = new Date();
var leftTime = result.broadcastChanceExpirationTime - now.getTime();
var leftsecond = parseInt(leftTime / 1000);
if (leftsecond < 0) {
$("#b3logBroadcast .module-header > button").hide();
clearInterval(interval);
interval = undefined;
return;
} else {
var minute = Math.floor(leftsecond / 60),
second = Math.floor(leftsecond - minute * 60);
$("#b3logBroadcast .module-header > button").text("${chanceBroadcastLabel1}" + minute + ":" + second).show();
}
};
if (!interval) {
interval = window.setInterval(function() {
showCountDown();
}, 1000);
}
} else {
$("#b3logBroadcast .module-header > button").hide();
clearInterval(interval);
interval = undefined;
}
}
});
};
setInterval(function() {
broadcastChange();
}, 10000);
broadcastChange();
}
};
/*
* 添加插件
*/
admin.plugin.add({
"id": "b3logBroadcast",
"path": "/main/panel2",
"content": $("#b3logBroadcastPanel").html()
});
// 移除现有内容
$("#b3logBroadcastPanel").remove();
</script>
\ No newline at end of file
src/test/resources/plugins/b3log-broadcast/plugin.properties
deleted
100644 → 0
View file @
6d37999e
#
# 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 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
src/test/resources/plugins/b3log-broadcast/style.css
deleted
100644 → 0
View file @
6d37999e
/*
* plugin style for b3log-broadcast
*
* @author <a href="http://vanessa.b3log.org">Liyuan Li</a>
* @version 1.0.0.1, Apr 24, 2011
*/
#b3logBroadcastDialog
input
,
#b3logBroadcastDialog
textarea
{
width
:
98%
;
}
#b3logBroadcast
.module-header
>
button
{
height
:
22px
;
}
#b3logBroadcastDialog
label
{
line-height
:
30px
;
}
#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