nodebb-plugin-composer-default 7.0.11 → 7.0.15

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/.jshintrc CHANGED
@@ -1,86 +1,86 @@
1
- {
2
- // JSHint Default Configuration File (as on JSHint website)
3
- // See http://jshint.com/docs/ for more details
4
-
5
- "maxerr" : 50, // {int} Maximum error before stopping
6
-
7
- // Enforcing
8
- "bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
9
- "camelcase" : false, // true: Identifiers must be in camelCase
10
- "curly" : true, // true: Require {} for every new block or scope
11
- "eqeqeq" : true, // true: Require triple equals (===) for comparison
12
- "forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
13
- "immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
14
- "indent" : 4, // {int} Number of spaces to use for indentation
15
- "latedef" : false, // true: Require variables/functions to be defined before being used
16
- "newcap" : false, // true: Require capitalization of all constructor functions e.g. `new F()`
17
- "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
18
- "noempty" : true, // true: Prohibit use of empty blocks
19
- "nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment)
20
- "plusplus" : false, // true: Prohibit use of `++` & `--`
21
- "quotmark" : false, // Quotation mark consistency:
22
- // false : do nothing (default)
23
- // true : ensure whatever is used is consistent
24
- // "single" : require single quotes
25
- // "double" : require double quotes
26
- "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
27
- "unused" : true, // true: Require all defined variables be used
28
- "strict" : true, // true: Requires all functions run in ES5 Strict Mode
29
- "trailing" : false, // true: Prohibit trailing whitespaces
30
- "maxparams" : false, // {int} Max number of formal params allowed per function
31
- "maxdepth" : false, // {int} Max depth of nested blocks (within functions)
32
- "maxstatements" : false, // {int} Max number statements per function
33
- "maxcomplexity" : false, // {int} Max cyclomatic complexity per function
34
- "maxlen" : false, // {int} Max number of characters per line
35
-
36
- // Relaxing
37
- "asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
38
- "boss" : false, // true: Tolerate assignments where comparisons would be expected
39
- "debug" : false, // true: Allow debugger statements e.g. browser breakpoints.
40
- "eqnull" : false, // true: Tolerate use of `== null`
41
- "es5" : false, // true: Allow ES5 syntax (ex: getters and setters)
42
- "esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`)
43
- "moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
44
- // (ex: `for each`, multiple try/catch, function expression…)
45
- "evil" : false, // true: Tolerate use of `eval` and `new Function()`
46
- "expr" : false, // true: Tolerate `ExpressionStatement` as Programs
47
- "funcscope" : false, // true: Tolerate defining variables inside control statements"
48
- "globalstrict" : false, // true: Allow global "use strict" (also enables 'strict')
49
- "iterator" : false, // true: Tolerate using the `__iterator__` property
50
- "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
51
- "laxbreak" : false, // true: Tolerate possibly unsafe line breakings
52
- "laxcomma" : false, // true: Tolerate comma-first style coding
53
- "loopfunc" : false, // true: Tolerate functions being defined in loops
54
- "multistr" : false, // true: Tolerate multi-line strings
55
- "proto" : false, // true: Tolerate using the `__proto__` property
56
- "scripturl" : false, // true: Tolerate script-targeted URLs
57
- "smarttabs" : false, // true: Tolerate mixed tabs/spaces when used for alignment
58
- "shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
59
- "sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
60
- "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;`
61
- "validthis" : false, // true: Tolerate using this in a non-constructor function
62
-
63
- // Environments
64
- "browser" : true, // Web Browser (window, document, etc)
65
- "couch" : false, // CouchDB
66
- "devel" : true, // Development/debugging (alert, confirm, etc)
67
- "dojo" : false, // Dojo Toolkit
68
- "jquery" : true, // jQuery
69
- "mootools" : false, // MooTools
70
- "node" : true, // Node.js
71
- "nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
72
- "prototypejs" : false, // Prototype and Scriptaculous
73
- "rhino" : false, // Rhino
74
- "worker" : false, // Web Workers
75
- "wsh" : false, // Windows Scripting Host
76
- "yui" : false, // Yahoo User Interface
77
-
78
- // Legacy
79
- "nomen" : false, // true: Prohibit dangling `_` in variables
80
- "onevar" : false, // true: Allow only one `var` statement per function
81
- "passfail" : false, // true: Stop on first error
82
- "white" : false, // true: Check against strict whitespace and indentation rules
83
-
84
- // Custom Globals
85
- "globals" : {} // additional predefined global variables
1
+ {
2
+ // JSHint Default Configuration File (as on JSHint website)
3
+ // See http://jshint.com/docs/ for more details
4
+
5
+ "maxerr" : 50, // {int} Maximum error before stopping
6
+
7
+ // Enforcing
8
+ "bitwise" : true, // true: Prohibit bitwise operators (&, |, ^, etc.)
9
+ "camelcase" : false, // true: Identifiers must be in camelCase
10
+ "curly" : true, // true: Require {} for every new block or scope
11
+ "eqeqeq" : true, // true: Require triple equals (===) for comparison
12
+ "forin" : true, // true: Require filtering for..in loops with obj.hasOwnProperty()
13
+ "immed" : false, // true: Require immediate invocations to be wrapped in parens e.g. `(function () { } ());`
14
+ "indent" : 4, // {int} Number of spaces to use for indentation
15
+ "latedef" : false, // true: Require variables/functions to be defined before being used
16
+ "newcap" : false, // true: Require capitalization of all constructor functions e.g. `new F()`
17
+ "noarg" : true, // true: Prohibit use of `arguments.caller` and `arguments.callee`
18
+ "noempty" : true, // true: Prohibit use of empty blocks
19
+ "nonew" : false, // true: Prohibit use of constructors for side-effects (without assignment)
20
+ "plusplus" : false, // true: Prohibit use of `++` & `--`
21
+ "quotmark" : false, // Quotation mark consistency:
22
+ // false : do nothing (default)
23
+ // true : ensure whatever is used is consistent
24
+ // "single" : require single quotes
25
+ // "double" : require double quotes
26
+ "undef" : true, // true: Require all non-global variables to be declared (prevents global leaks)
27
+ "unused" : true, // true: Require all defined variables be used
28
+ "strict" : true, // true: Requires all functions run in ES5 Strict Mode
29
+ "trailing" : false, // true: Prohibit trailing whitespaces
30
+ "maxparams" : false, // {int} Max number of formal params allowed per function
31
+ "maxdepth" : false, // {int} Max depth of nested blocks (within functions)
32
+ "maxstatements" : false, // {int} Max number statements per function
33
+ "maxcomplexity" : false, // {int} Max cyclomatic complexity per function
34
+ "maxlen" : false, // {int} Max number of characters per line
35
+
36
+ // Relaxing
37
+ "asi" : false, // true: Tolerate Automatic Semicolon Insertion (no semicolons)
38
+ "boss" : false, // true: Tolerate assignments where comparisons would be expected
39
+ "debug" : false, // true: Allow debugger statements e.g. browser breakpoints.
40
+ "eqnull" : false, // true: Tolerate use of `== null`
41
+ "es5" : false, // true: Allow ES5 syntax (ex: getters and setters)
42
+ "esnext" : false, // true: Allow ES.next (ES6) syntax (ex: `const`)
43
+ "moz" : false, // true: Allow Mozilla specific syntax (extends and overrides esnext features)
44
+ // (ex: `for each`, multiple try/catch, function expression…)
45
+ "evil" : false, // true: Tolerate use of `eval` and `new Function()`
46
+ "expr" : false, // true: Tolerate `ExpressionStatement` as Programs
47
+ "funcscope" : false, // true: Tolerate defining variables inside control statements"
48
+ "globalstrict" : false, // true: Allow global "use strict" (also enables 'strict')
49
+ "iterator" : false, // true: Tolerate using the `__iterator__` property
50
+ "lastsemic" : false, // true: Tolerate omitting a semicolon for the last statement of a 1-line block
51
+ "laxbreak" : false, // true: Tolerate possibly unsafe line breakings
52
+ "laxcomma" : false, // true: Tolerate comma-first style coding
53
+ "loopfunc" : false, // true: Tolerate functions being defined in loops
54
+ "multistr" : false, // true: Tolerate multi-line strings
55
+ "proto" : false, // true: Tolerate using the `__proto__` property
56
+ "scripturl" : false, // true: Tolerate script-targeted URLs
57
+ "smarttabs" : false, // true: Tolerate mixed tabs/spaces when used for alignment
58
+ "shadow" : false, // true: Allows re-define variables later in code e.g. `var x=1; x=2;`
59
+ "sub" : false, // true: Tolerate using `[]` notation when it can still be expressed in dot notation
60
+ "supernew" : false, // true: Tolerate `new function () { ... };` and `new Object;`
61
+ "validthis" : false, // true: Tolerate using this in a non-constructor function
62
+
63
+ // Environments
64
+ "browser" : true, // Web Browser (window, document, etc)
65
+ "couch" : false, // CouchDB
66
+ "devel" : true, // Development/debugging (alert, confirm, etc)
67
+ "dojo" : false, // Dojo Toolkit
68
+ "jquery" : true, // jQuery
69
+ "mootools" : false, // MooTools
70
+ "node" : true, // Node.js
71
+ "nonstandard" : false, // Widely adopted globals (escape, unescape, etc)
72
+ "prototypejs" : false, // Prototype and Scriptaculous
73
+ "rhino" : false, // Rhino
74
+ "worker" : false, // Web Workers
75
+ "wsh" : false, // Windows Scripting Host
76
+ "yui" : false, // Yahoo User Interface
77
+
78
+ // Legacy
79
+ "nomen" : false, // true: Prohibit dangling `_` in variables
80
+ "onevar" : false, // true: Allow only one `var` statement per function
81
+ "passfail" : false, // true: Stop on first error
82
+ "white" : false, // true: Check against strict whitespace and indentation rules
83
+
84
+ // Custom Globals
85
+ "globals" : {} // additional predefined global variables
86
86
  }
package/LICENSE CHANGED
@@ -1,7 +1,7 @@
1
- Copyright (c) 2016 NodeBB Inc.
2
-
3
- Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
-
5
- The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
-
1
+ Copyright (c) 2016 NodeBB Inc.
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
4
+
5
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
6
+
7
7
  THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
package/README.md CHANGED
@@ -1,11 +1,11 @@
1
- # Default Composer for NodeBB
2
-
3
- This plugin activates the default composer for NodeBB. It is activated by default, but can be swapped out as necessary.
4
-
5
- ## Screenshots
6
-
7
- ### Desktop
8
- ![Desktop Composer](screenshots/desktop.png?raw=true)
9
-
10
- ### Mobile Devices
1
+ # Default Composer for NodeBB
2
+
3
+ This plugin activates the default composer for NodeBB. It is activated by default, but can be swapped out as necessary.
4
+
5
+ ## Screenshots
6
+
7
+ ### Desktop
8
+ ![Desktop Composer](screenshots/desktop.png?raw=true)
9
+
10
+ ### Mobile Devices
11
11
  ![Mobile Composer](screenshots/mobile.png?raw=true)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-composer-default",
3
- "version": "7.0.11",
3
+ "version": "7.0.15",
4
4
  "description": "Default composer for NodeBB",
5
5
  "main": "library.js",
6
6
  "repository": {
@@ -26,11 +26,11 @@
26
26
  },
27
27
  "readmeFilename": "README.md",
28
28
  "nbbpm": {
29
- "compatibility": "^1.17.2"
29
+ "compatibility": "^1.18.6"
30
30
  },
31
31
  "dependencies": {
32
32
  "screenfull": "^5.0.2",
33
- "validator": "^13.1.17"
33
+ "validator": "^13.7.0"
34
34
  },
35
35
  "devDependencies": {
36
36
  "eslint": "^7.32.0",
@@ -1,66 +1,66 @@
1
- .composer {
2
- min-height: 400px;
3
-
4
- .resizer {
5
- display: block;
6
- }
7
-
8
- .minimize {
9
- display: block;
10
- }
11
-
12
- &.reply .title-container {
13
- display: flex;
14
- }
15
-
16
- .title-container {
17
- border: 0;
18
-
19
- .title, .handle {
20
- font-size: 22px;
21
- padding: 4px 18px;
22
- }
23
- }
24
-
25
- .formatting-bar .formatting-group {
26
- display: inline-block;
27
- }
28
-
29
- &.resizable {
30
- .box-shadow(0px 6px 12px rgba(0, 0, 0, 0.5));
31
-
32
- padding-top: 30px;
33
- padding-left: 15px;
34
- padding-right: 15px;
35
- }
36
-
37
- .category-tag-row {
38
- margin-top: 5px;
39
- margin-bottom: 8px;
40
- }
41
-
42
- .write-preview-container {
43
- margin-bottom: 15px;
44
- }
45
-
46
- .write, .preview {
47
- padding: 20px;
48
- }
49
-
50
- .write {
51
- border: 1px solid #EDEDED;
52
- }
53
-
54
- .tags-container {
55
- margin-top: 8px - 15px;
56
- margin-bottom: 8px;
57
-
58
- .bootstrap-tagsinput {
59
- padding: 0;
60
-
61
- input {
62
- margin-left: -6px;
63
- }
64
- }
65
- }
66
- }
1
+ .composer {
2
+ min-height: 400px;
3
+
4
+ .resizer {
5
+ display: block;
6
+ }
7
+
8
+ .minimize {
9
+ display: block;
10
+ }
11
+
12
+ &.reply .title-container {
13
+ display: flex;
14
+ }
15
+
16
+ .title-container {
17
+ border: 0;
18
+
19
+ .title, .handle {
20
+ font-size: 22px;
21
+ padding: 4px 18px;
22
+ }
23
+ }
24
+
25
+ .formatting-bar .formatting-group {
26
+ display: inline-block;
27
+ }
28
+
29
+ &.resizable {
30
+ .box-shadow(0px 6px 12px rgba(0, 0, 0, 0.5));
31
+
32
+ padding-top: 30px;
33
+ padding-left: 15px;
34
+ padding-right: 15px;
35
+ }
36
+
37
+ .category-tag-row {
38
+ margin-top: 5px;
39
+ margin-bottom: 8px;
40
+ }
41
+
42
+ .write-preview-container {
43
+ margin-bottom: 15px;
44
+ }
45
+
46
+ .write, .preview {
47
+ padding: 20px;
48
+ }
49
+
50
+ .write {
51
+ border: 1px solid #EDEDED;
52
+ }
53
+
54
+ .tags-container {
55
+ margin-top: 8px - 15px;
56
+ margin-bottom: 8px;
57
+
58
+ .bootstrap-tagsinput {
59
+ padding: 0;
60
+
61
+ input {
62
+ margin-left: -6px;
63
+ }
64
+ }
65
+ }
66
+ }
@@ -1,55 +1,55 @@
1
- html.zen-mode {
2
- overflow: hidden;
3
- }
4
-
5
- .zen-mode .composer {
6
- &.resizable {
7
- padding-top: 0;
8
- }
9
-
10
- .composer-container {
11
- padding-top: 5px;
12
- }
13
-
14
- .tag-row {
15
- display: none;
16
- }
17
-
18
- .title-container .category-list-container {
19
- margin-top: 3px;
20
- }
21
-
22
- .write, .preview {
23
- border: none;
24
- outline: none;
25
- }
26
-
27
- .resizer {
28
- display: none;
29
- }
30
-
31
- &.reply {
32
- .title-container {
33
- display: none;
34
- }
35
-
36
- .category-tag-row {
37
- margin-top: 3px;
38
- }
39
- }
40
-
41
- @media (min-width: @screen-md-min) {
42
- & {
43
- padding-left: 15px;
44
- padding-right: 15px;
45
- }
46
- .write-preview-container {
47
- margin-bottom: 0;
48
-
49
- > div {
50
- padding: 0;
51
- margin: 0;
52
- }
53
- }
54
- }
1
+ html.zen-mode {
2
+ overflow: hidden;
3
+ }
4
+
5
+ .zen-mode .composer {
6
+ &.resizable {
7
+ padding-top: 0;
8
+ }
9
+
10
+ .composer-container {
11
+ padding-top: 5px;
12
+ }
13
+
14
+ .tag-row {
15
+ display: none;
16
+ }
17
+
18
+ .title-container .category-list-container {
19
+ margin-top: 3px;
20
+ }
21
+
22
+ .write, .preview {
23
+ border: none;
24
+ outline: none;
25
+ }
26
+
27
+ .resizer {
28
+ display: none;
29
+ }
30
+
31
+ &.reply {
32
+ .title-container {
33
+ display: none;
34
+ }
35
+
36
+ .category-tag-row {
37
+ margin-top: 3px;
38
+ }
39
+ }
40
+
41
+ @media (min-width: @screen-md-min) {
42
+ & {
43
+ padding-left: 15px;
44
+ padding-right: 15px;
45
+ }
46
+ .write-preview-container {
47
+ margin-bottom: 0;
48
+
49
+ > div {
50
+ padding: 0;
51
+ margin: 0;
52
+ }
53
+ }
54
+ }
55
55
  }
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- define('admin/plugins/composer-default', ['settings'], function (Settings) {
3
+ define('admin/plugins/composer-default', ['settings', 'alerts'], function (Settings, alerts) {
4
4
  var ACP = {};
5
5
 
6
6
  ACP.init = function () {
@@ -8,7 +8,7 @@ define('admin/plugins/composer-default', ['settings'], function (Settings) {
8
8
 
9
9
  $('#save').on('click', function () {
10
10
  Settings.save('composer-default', $('.composer-default-settings'), function () {
11
- app.alert({
11
+ alerts.alert({
12
12
  type: 'success',
13
13
  alert_id: 'composer-default-saved',
14
14
  title: 'Settings Saved',
@@ -1,8 +1,8 @@
1
1
  'use strict';
2
2
 
3
- define('composer/drafts', ['api'], function (api) {
3
+ define('composer/drafts', ['api', 'alerts'], function (api, alerts) {
4
4
  var drafts = {};
5
- var saveThrottleId;
5
+ var saveThrottleId;
6
6
 
7
7
  drafts.init = function (postContainer, postData) {
8
8
  var draftIconEl = postContainer.find('.draft-icon');
@@ -263,7 +263,7 @@ define('composer/drafts', ['api'], function (api) {
263
263
  } else if (type === 'tid') {
264
264
  socket.emit('topics.getTopic', id, function (err, topicObj) {
265
265
  if (err) {
266
- return app.alertError(err.message);
266
+ return alerts.error(err);
267
267
  }
268
268
  composer.newReply(id, undefined, topicObj.title, draft.text);
269
269
  });
@@ -100,7 +100,7 @@ define('composer/resize', ['taskbar'], function (taskbar) {
100
100
  }
101
101
 
102
102
  resize.reposition = function (postContainer) {
103
- var ratio = getSavedRatio();
103
+ var ratio = getSavedRatio();
104
104
 
105
105
  if (ratio >= 1 - snapMargin) {
106
106
  ratio = 1;
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- define('composer/scheduler', ['benchpress', 'bootbox'], function (Benchpress, bootbox) {
3
+ define('composer/scheduler', ['benchpress', 'bootbox', 'alerts'], function (Benchpress, bootbox, alerts) {
4
4
  const scheduler = {};
5
5
  const state = {
6
6
  timestamp: 0,
@@ -128,7 +128,7 @@ define('composer/scheduler', ['benchpress', 'bootbox'], function (Benchpress, bo
128
128
  if (!bothFilled || isNaN(timestamp) || timestamp < Date.now()) {
129
129
  state.timestamp = 0;
130
130
  const message = timestamp < Date.now() ? '[[error:scheduling-to-past]]' : '[[error:invalid-schedule-date]]';
131
- app.alert({
131
+ alerts.alert({
132
132
  type: 'danger',
133
133
  timeout: 3000,
134
134
  title: '',
@@ -1,7 +1,7 @@
1
1
 
2
2
  'use strict';
3
3
 
4
- define('composer/tags', function () {
4
+ define('composer/tags', ['alerts'], function (alerts) {
5
5
  var tags = {};
6
6
 
7
7
  var minTags;
@@ -38,7 +38,7 @@ define('composer/tags', function () {
38
38
  cid: postData.cid,
39
39
  }, function (err, tags) {
40
40
  if (err) {
41
- return app.alertError(err.message);
41
+ return alerts.error(err);
42
42
  }
43
43
  if (tags) {
44
44
  response(tags);
@@ -64,11 +64,11 @@ define('composer/tags', function () {
64
64
  reachedMaxTags;
65
65
 
66
66
  if (event.item.length < config.minimumTagLength) {
67
- return app.alertError('[[error:tag-too-short, ' + config.minimumTagLength + ']]');
67
+ return alerts.error('[[error:tag-too-short, ' + config.minimumTagLength + ']]');
68
68
  } else if (event.item.length > config.maximumTagLength) {
69
- return app.alertError('[[error:tag-too-long, ' + config.maximumTagLength + ']]');
69
+ return alerts.error('[[error:tag-too-long, ' + config.maximumTagLength + ']]');
70
70
  } else if (reachedMaxTags) {
71
- return app.alertError('[[error:too-many-tags, ' + maxTags + ']]');
71
+ return alerts.error('[[error:too-many-tags, ' + maxTags + ']]');
72
72
  }
73
73
  if (different) {
74
74
  tagEl.tagsinput('add', cleanTag);
@@ -88,10 +88,10 @@ define('composer/tags', function () {
88
88
  }
89
89
  socket.emit('topics.canRemoveTag', { tag: event.item }, function (err, allowed) {
90
90
  if (err) {
91
- return app.alertError(err.message);
91
+ return alerts.error(err);
92
92
  }
93
93
  if (!allowed) {
94
- app.alertError('[[error:cant-remove-system-tag]]');
94
+ alerts.error('[[error:cant-remove-system-tag]]');
95
95
  skipAddCheck = true;
96
96
  tagEl.tagsinput('add', event.item);
97
97
  }
@@ -106,7 +106,7 @@ define('composer/tags', function () {
106
106
  var cid = postData.hasOwnProperty('cid') ? postData.cid : ajaxify.data.cid;
107
107
  socket.emit('topics.isTagAllowed', { tag: event.item, cid: cid || 0 }, function (err, allowed) {
108
108
  if (err) {
109
- return app.alertError(err.message);
109
+ return alerts.error(err);
110
110
  }
111
111
  if (!allowed) {
112
112
  skipRemoveCheck = true;
@@ -4,8 +4,9 @@ define('composer/uploads', [
4
4
  'composer/preview',
5
5
  'composer/categoryList',
6
6
  'translator',
7
+ 'alerts',
7
8
  'jquery-form',
8
- ], function (preview, categoryList, translator) {
9
+ ], function (preview, categoryList, translator, alerts) {
9
10
  var uploads = {
10
11
  inProgress: {},
11
12
  };
@@ -193,7 +194,7 @@ define('composer/uploads', [
193
194
  for (i = 0; i < files.length; ++i) {
194
195
  isImage = files[i].type.match(/image./);
195
196
  if ((isImage && !app.user.privileges['upload:post:image']) || (!isImage && !app.user.privileges['upload:post:file'])) {
196
- return app.alertError('[[error:no-privileges]]');
197
+ return alerts.error('[[error:no-privileges]]');
197
198
  }
198
199
  }
199
200
 
@@ -207,7 +208,7 @@ define('composer/uploads', [
207
208
 
208
209
  if (files[i].size > parseInt(config.maximumFileSize, 10) * 1024) {
209
210
  uploadForm[0].reset();
210
- return app.alertError('[[error:file-too-big, ' + config.maximumFileSize + ']]');
211
+ return alerts.error('[[error:file-too-big, ' + config.maximumFileSize + ']]');
211
212
  }
212
213
 
213
214
  text = insertText(text, textarea.getCursorPosition(), (isImage ? '!' : '') + '[' + filenameMapping[i] + '](' + uploadingText + ') ');
@@ -321,7 +322,7 @@ define('composer/uploads', [
321
322
  if (xhr && xhr.status === 413) {
322
323
  msg = xhr.statusText || 'Request Entity Too Large';
323
324
  }
324
- app.alertError(msg);
325
+ alerts.error(msg);
325
326
  $(window).trigger('action:composer.uploadError', {
326
327
  post_uuid: post_uuid,
327
328
  message: msg,
@@ -18,9 +18,14 @@ define('composer', [
18
18
  'topicThumbs',
19
19
  'api',
20
20
  'bootbox',
21
+ 'alerts',
21
22
  'hooks',
23
+ 'messages',
24
+ 'search',
22
25
  ], function (taskbar, translator, uploads, formatting, drafts, tags,
23
- categoryList, preview, resize, autocomplete, scheduler, scrollStop, topicThumbs, api, bootbox, hooks) {
26
+ categoryList, preview, resize, autocomplete, scheduler, scrollStop,
27
+ topicThumbs, api, bootbox, alerts, hooks, messagesModule, search
28
+ ) {
24
29
  var composer = {
25
30
  active: undefined,
26
31
  posts: {},
@@ -103,7 +108,7 @@ define('composer', [
103
108
 
104
109
  function alreadyOpen(post) {
105
110
  // If a composer for the same cid/tid/pid is already open, return the uuid, else return bool false
106
- var type;
111
+ var type;
107
112
  var id;
108
113
 
109
114
  if (post.hasOwnProperty('cid')) {
@@ -168,7 +173,7 @@ define('composer', [
168
173
  const { showAlert } = await hooks.fire('filter:composer.error', { post_uuid, message, showAlert: true });
169
174
 
170
175
  if (showAlert) {
171
- app.alert({
176
+ alerts.alert({
172
177
  type: 'danger',
173
178
  timeout: 3000,
174
179
  title: '',
@@ -272,7 +277,7 @@ define('composer', [
272
277
  composer.editPost = function (pid) {
273
278
  socket.emit('plugins.composer.push', pid, function (err, threadData) {
274
279
  if (err) {
275
- return app.alertError(err.message);
280
+ return alerts.error(err);
276
281
  }
277
282
  threadData.action = 'posts.edit';
278
283
  threadData.pid = pid;
@@ -293,7 +298,7 @@ define('composer', [
293
298
  } else {
294
299
  socket.emit('plugins.composer.getFormattingOptions', function (err, options) {
295
300
  if (err) {
296
- return app.alertError(err);
301
+ return alerts.error(err);
297
302
  }
298
303
  composer.formatting = options;
299
304
  createNewComposer(post_uuid);
@@ -609,7 +614,7 @@ define('composer', [
609
614
  return;
610
615
  }
611
616
 
612
- app.enableTopicSearch({
617
+ search.enableQuickSearch({
613
618
  searchElements: {
614
619
  inputEl: postContainer.find('input.title'),
615
620
  resultEl: postContainer.find('.quick-search-container'),
@@ -791,7 +796,7 @@ define('composer', [
791
796
  composer.load(post_uuid);
792
797
  textareaEl.prop('readonly', false);
793
798
  if (err.message === '[[error:email-not-confirmed]]') {
794
- return app.showEmailConfirmWarning(err);
799
+ return messagesModule.showEmailConfirmWarning(err.message);
795
800
  }
796
801
  composerAlert(post_uuid, err.message);
797
802
  });
@@ -1,17 +1,17 @@
1
- <form role="form" class="composer-default-settings">
2
- <div class="row">
3
- <div class="col-sm-2 col-xs-12 settings-header">General</div>
4
- <div class="col-sm-10 col-xs-12">
5
- <div class="checkbox">
6
- <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
7
- <input class="mdl-switch__input" type="checkbox" name="composeRouteEnabled" />
8
- <span class="mdl-switch__label"><strong>Use a separate route for the composer</strong></span>
9
- </label>
10
- </div>
11
- </div>
12
- </div>
13
- </form>
14
-
15
- <button id="save" class="floating-button mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored">
16
- <i class="material-icons">save</i>
1
+ <form role="form" class="composer-default-settings">
2
+ <div class="row">
3
+ <div class="col-sm-2 col-xs-12 settings-header">General</div>
4
+ <div class="col-sm-10 col-xs-12">
5
+ <div class="checkbox">
6
+ <label class="mdl-switch mdl-js-switch mdl-js-ripple-effect">
7
+ <input class="mdl-switch__input" type="checkbox" name="composeRouteEnabled" />
8
+ <span class="mdl-switch__label"><strong>Use a separate route for the composer</strong></span>
9
+ </label>
10
+ </div>
11
+ </div>
12
+ </div>
13
+ </form>
14
+
15
+ <button id="save" class="floating-button mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored">
16
+ <i class="material-icons">save</i>
17
17
  </button>
File without changes