Skip to content

Commit eb0b882

Browse files
authored
Merge pull request ninenine#37 from NodeBB-Community/master
fix: update for 2.x fix acp page
2 parents f3e3409 + 80a5361 commit eb0b882

5 files changed

Lines changed: 29 additions & 22 deletions

File tree

index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,15 @@ var Beep = {
141141
parseTopic: function (data, callback) {
142142
// from http://htmlarrows.com/symbols/
143143
var starHTML = '*';
144-
144+
145145
if (data.topic.hasOwnProperty('title')) {
146146
data.topic.title = Beep.parseContent(data.topic.title, starHTML);
147147
}
148-
148+
149149
if (data.topic.hasOwnProperty('slug')) {
150150
data.topic.slug = Beep.parseContent(data.topic.slug, starHTML);
151151
}
152-
152+
153153
if (data.topic.hasOwnProperty('titleRaw')) {
154154
data.topic.titleRaw = Beep.parseContent(data.topic.titleRaw, starHTML);
155155
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,6 @@
3232
"_id": "nodebb-plugin-beep@0.4.4",
3333
"_from": "nodebb-plugin-beep@0.4.4",
3434
"nbbpm": {
35-
"compatibility": "^0.6.0 || ^0.7.0 || ^0.8.0 || ^0.9.0 || ^1.0.0 || ^1.1.0 || ^1.13.0 || ^1.16.1 "
35+
"compatibility": "^1.0.0 || ^1.1.0 || ^1.13.0 || ^1.16.1 || ^2.0.0"
3636
}
3737
}

plugin.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"url": "https://github.com/ninenine/nodebb-plugin-beep",
66
"library": "./index.js",
77
"templates":"public/templates",
8+
"modules": {
9+
"../admin/plugins/beep.js": "public/admin.js"
10+
},
811
"hooks": [
912
{ "hook": "static:app.load", "method": "init" },
1013
{ "hook": "action:settings.set", "method": "onListChange" },

public/admin.js

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
'use strict';
2+
3+
define('admin/plugins/beep', ['settings'], function (Settings) {
4+
const admin = {};
5+
admin.init = function () {
6+
Settings.load('beep', $('.beep-settings'));
7+
8+
$('#save').on('click', function() {
9+
Settings.save('beep', $('.beep-settings'), function() {
10+
app.alert({
11+
type: 'success',
12+
alert_id: 'beep-saved',
13+
title: 'Success',
14+
message: 'Curse word settings have been successfully saved'
15+
});
16+
});
17+
});
18+
};
19+
return admin;
20+
});

public/templates/admin/plugins/beep.tpl

Lines changed: 2 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="beep settings" class="row">
1+
<div class="beep" class="row">
22
<div class="col-xs-12">
33
<form role="form" class="beep-settings">
44
<div class="row">
@@ -33,7 +33,7 @@
3333
<label for="urls"><i>comma-separated</i> list of Banned URLs (link will be shown as [link removed])</label>
3434
<textarea class="form-control" id="urls" name="urls" placeholder="eg. google.com, yahoo.com"></textarea>
3535
</div>
36-
36+
3737
</fieldset>
3838
</div>
3939
</div>
@@ -60,19 +60,3 @@
6060
<i class="material-icons">save</i>
6161
</button>
6262

63-
<script type="text/javascript">
64-
require(['settings'], function(Settings) {
65-
Settings.load('beep', $('.beep-settings'));
66-
67-
$('#save').on('click', function() {
68-
Settings.save('beep', $('.beep-settings'), function() {
69-
app.alert({
70-
type: 'success',
71-
alert_id: 'beep-saved',
72-
title: 'Success',
73-
message: 'Curse word settings have been successfully saved'
74-
});
75-
});
76-
});
77-
});
78-
</script>

0 commit comments

Comments
 (0)