nodebb-plugin-audio-embed 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.gitattributes CHANGED
@@ -1,22 +1,22 @@
1
- # Auto detect text files and perform LF normalization
2
- * text=auto
3
-
4
- # Custom for Visual Studio
5
- *.cs diff=csharp
6
- *.sln merge=union
7
- *.csproj merge=union
8
- *.vbproj merge=union
9
- *.fsproj merge=union
10
- *.dbproj merge=union
11
-
12
- # Standard to msysgit
13
- *.doc diff=astextplain
14
- *.DOC diff=astextplain
15
- *.docx diff=astextplain
16
- *.DOCX diff=astextplain
17
- *.dot diff=astextplain
18
- *.DOT diff=astextplain
19
- *.pdf diff=astextplain
20
- *.PDF diff=astextplain
21
- *.rtf diff=astextplain
22
- *.RTF diff=astextplain
1
+ # Auto detect text files and perform LF normalization
2
+ * text=auto
3
+
4
+ # Custom for Visual Studio
5
+ *.cs diff=csharp
6
+ *.sln merge=union
7
+ *.csproj merge=union
8
+ *.vbproj merge=union
9
+ *.fsproj merge=union
10
+ *.dbproj merge=union
11
+
12
+ # Standard to msysgit
13
+ *.doc diff=astextplain
14
+ *.DOC diff=astextplain
15
+ *.docx diff=astextplain
16
+ *.DOCX diff=astextplain
17
+ *.dot diff=astextplain
18
+ *.DOT diff=astextplain
19
+ *.pdf diff=astextplain
20
+ *.PDF diff=astextplain
21
+ *.rtf diff=astextplain
22
+ *.RTF diff=astextplain
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2015 NodeBB Inc. <sales@nodebb.org>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in
13
- all copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2015 NodeBB Inc. <sales@nodebb.org>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
21
  THE SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,3 @@
1
- # Audio Embed Plugin for NodeBB
2
-
1
+ # Audio Embed Plugin for NodeBB
2
+
3
3
  This plugin allows users to upload audio files (mp3 files, specifically) and embed them into posts.
@@ -1,25 +1,25 @@
1
- 'use strict';
2
-
3
- var Controllers = {};
4
-
5
- Controllers.renderAdminPage = function (req, res, next) {
6
- res.render('admin/plugins/audio-embed', {});
7
- };
8
-
9
- Controllers.upload = function(req, res, next) {
10
- var main = module.parent.exports;
11
-
12
- main.processUpload(req.files.files[0], function(err, payload) {
13
- if (!err) {
14
- res.json([{
15
- url: payload.id
16
- }]);
17
- } else {
18
- res.json({
19
- error: err.message === 'invalid-file-type' ? 'Invalid File Type Uploaded. Please check the file format or extension to ensure it is an audio file.' : 'An unknown error occured'
20
- });
21
- }
22
- });
23
- };
24
-
1
+ 'use strict';
2
+
3
+ var Controllers = {};
4
+
5
+ Controllers.renderAdminPage = function (req, res, next) {
6
+ res.render('admin/plugins/audio-embed', {});
7
+ };
8
+
9
+ Controllers.upload = function(req, res, next) {
10
+ var main = module.parent.exports;
11
+
12
+ main.processUpload(req.files.files[0], function(err, payload) {
13
+ if (!err) {
14
+ res.json([{
15
+ url: payload.id
16
+ }]);
17
+ } else {
18
+ res.json({
19
+ error: err.message === 'invalid-file-type' ? 'Invalid File Type Uploaded. Please check the file format or extension to ensure it is an audio file.' : 'An unknown error occured'
20
+ });
21
+ }
22
+ });
23
+ };
24
+
25
25
  module.exports = Controllers;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-audio-embed",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "",
5
5
  "main": "library.js",
6
6
  "repository": {
package/plugin.json CHANGED
@@ -1,25 +1,25 @@
1
- {
2
- "id": "nodebb-plugin-audio-embed",
3
- "url": "https://github.com/julianlam/nodebb-plugin-audio-embed",
4
- "library": "./library.js",
5
- "hooks": [
6
- { "hook": "static:app.load", "method": "init" },
7
- { "hook": "filter:admin.header.build", "method": "addAdminNavigation" },
8
- { "hook": "filter:composer.formatting", "method": "registerFormatting" },
9
- { "hook": "filter:parse.post", "method": "parsePost" },
10
- { "hook": "filter:parse.raw", "method": "parseRaw" }
11
- ],
12
- "staticDirs": {
13
- "static": "./static"
14
- },
15
- "less": [
16
- "static/style.less"
17
- ],
18
- "scripts": [
19
- "static/lib/main.js"
20
- ],
21
- "acpScripts": [
22
- "static/lib/admin.js"
23
- ],
24
- "templates": "static/templates"
1
+ {
2
+ "id": "nodebb-plugin-audio-embed",
3
+ "url": "https://github.com/julianlam/nodebb-plugin-audio-embed",
4
+ "library": "./library.js",
5
+ "hooks": [
6
+ { "hook": "static:app.load", "method": "init" },
7
+ { "hook": "filter:admin.header.build", "method": "addAdminNavigation" },
8
+ { "hook": "filter:composer.formatting", "method": "registerFormatting" },
9
+ { "hook": "filter:parse.post", "method": "parsePost" },
10
+ { "hook": "filter:parse.raw", "method": "parseRaw" }
11
+ ],
12
+ "staticDirs": {
13
+ "static": "./static"
14
+ },
15
+ "less": [
16
+ "static/style.less"
17
+ ],
18
+ "scripts": [
19
+ "static/lib/main.js"
20
+ ],
21
+ "modules": {
22
+ "../admin/plugins/audio-embed.js": "static/lib/admin.js"
23
+ },
24
+ "templates": "static/templates"
25
25
  }
@@ -1,27 +1,27 @@
1
- 'use strict';
2
- /* globals $, app, socket, define */
3
-
4
- define('admin/plugins/audio-embed', ['settings'], function(Settings) {
5
-
6
- var ACP = {};
7
-
8
- ACP.init = function() {
9
- Settings.load('audio-embed', $('.audio-embed-settings'));
10
-
11
- $('#save').on('click', function() {
12
- Settings.save('audio-embed', $('.audio-embed-settings'), function() {
13
- app.alert({
14
- type: 'success',
15
- alert_id: 'audio-embed-saved',
16
- title: 'Settings Saved',
17
- message: 'Please reload your NodeBB to apply these settings',
18
- clickfn: function() {
19
- socket.emit('admin.reload');
20
- }
21
- });
22
- });
23
- });
24
- };
25
-
26
- return ACP;
1
+ 'use strict';
2
+ /* globals $, app, socket, define */
3
+
4
+ define('admin/plugins/audio-embed', ['settings', 'alerts'], function(Settings, alerts) {
5
+
6
+ var ACP = {};
7
+
8
+ ACP.init = function() {
9
+ Settings.load('audio-embed', $('.audio-embed-settings'));
10
+
11
+ $('#save').on('click', function() {
12
+ Settings.save('audio-embed', $('.audio-embed-settings'), function() {
13
+ alerts.alert({
14
+ type: 'success',
15
+ alert_id: 'audio-embed-saved',
16
+ title: 'Settings Saved',
17
+ message: 'Please reload your NodeBB to apply these settings',
18
+ clickfn: function() {
19
+ socket.emit('admin.reload');
20
+ }
21
+ });
22
+ });
23
+ });
24
+ };
25
+
26
+ return ACP;
27
27
  });
@@ -1,10 +1,10 @@
1
- <form role="form" class="quickstart-settings">
2
- <div class="row">
3
- <div class="col-sm-2 col-xs-12 settings-header">Uploaded Media</div>
4
- <div class="col-sm-10 col-xs-12">
5
- <p class="lead">
6
- In a later version of this plugin, a listing of all uploaded media will be shown here.
7
- </p>
8
- </div>
9
- </div>
1
+ <form role="form" class="quickstart-settings">
2
+ <div class="row">
3
+ <div class="col-sm-2 col-xs-12 settings-header">Uploaded Media</div>
4
+ <div class="col-sm-10 col-xs-12">
5
+ <p class="lead">
6
+ In a later version of this plugin, a listing of all uploaded media will be shown here.
7
+ </p>
8
+ </div>
9
+ </div>
10
10
  </form>
@@ -1,3 +1,3 @@
1
- <audio src="{path}" controls="controls" preload="none">
2
- Your browser does not support the <code>audio</code> element.
1
+ <audio src="{path}" controls="controls" preload="none">
2
+ Your browser does not support the <code>audio</code> element.
3
3
  </audio>