File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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 }
Original file line number Diff line number Diff line change 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}
Original file line number Diff line number Diff line change 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" },
Original file line number Diff line number Diff line change 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+ } ) ;
Original file line number Diff line number Diff line change 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" >
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>
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>
You can’t perform that action at this time.
0 commit comments