nodebb-plugin-tenor-gif 2.2.0 → 3.1.0
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/lib/controllers.js +3 -1
- package/library.js +1 -0
- package/package.json +2 -2
- package/plugin.json +2 -3
- package/static/lib/main.js +6 -6
- package/static/{less/modal.less → scss/modal.scss} +2 -2
- package/static/templates/admin/plugins/tenor-gif.tpl +36 -32
- package/static/templates/partials/tenor-gif/list.tpl +1 -1
- package/static/templates/plugins/tenor-gif/modal.tpl +1 -1
package/lib/controllers.js
CHANGED
package/library.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "nodebb-plugin-tenor-gif",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "library.js",
|
|
6
6
|
"repository": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"readmeFilename": "README.md",
|
|
23
23
|
"nbbpm": {
|
|
24
|
-
"compatibility": "^2.
|
|
24
|
+
"compatibility": "^3.2.0"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@commitlint/cli": "^9.1.2",
|
package/plugin.json
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"id": "nodebb-plugin-tenor-gif",
|
|
3
3
|
"url": "https://github.com/NodeBB/nodebb-plugin-tenor-gif",
|
|
4
|
-
"library": "./library.js",
|
|
5
4
|
"hooks": [
|
|
6
5
|
{ "hook": "static:app.load", "method": "init" },
|
|
7
6
|
{ "hook": "filter:admin.header.build", "method": "addAdminNavigation" },
|
|
@@ -13,8 +12,8 @@
|
|
|
13
12
|
"modules": {
|
|
14
13
|
"../admin/plugins/tenor-gif.js": "static/lib/admin.js"
|
|
15
14
|
},
|
|
16
|
-
"
|
|
17
|
-
"static/
|
|
15
|
+
"scss": [
|
|
16
|
+
"static/scss/modal.scss"
|
|
18
17
|
],
|
|
19
18
|
"templates": "static/templates"
|
|
20
19
|
}
|
package/static/lib/main.js
CHANGED
|
@@ -24,8 +24,8 @@ $(document).ready(function () {
|
|
|
24
24
|
], function (formatting, controls) {
|
|
25
25
|
if (formatting && controls) {
|
|
26
26
|
formatting.addButtonDispatch('gif', function (textarea, selectionStart, selectionEnd) {
|
|
27
|
-
Tenor.showModal(function (url, query) {
|
|
28
|
-
Tenor.select(textarea, selectionStart, selectionEnd, url, query);
|
|
27
|
+
Tenor.showModal(function (url, query, alt) {
|
|
28
|
+
Tenor.select(textarea, selectionStart, selectionEnd, url, query, alt);
|
|
29
29
|
});
|
|
30
30
|
});
|
|
31
31
|
}
|
|
@@ -103,7 +103,7 @@ $(document).ready(function () {
|
|
|
103
103
|
});
|
|
104
104
|
|
|
105
105
|
resultsEl.on('click', 'img[data-url]', function () {
|
|
106
|
-
callback(this.getAttribute('data-url'), queryEl.val());
|
|
106
|
+
callback(this.getAttribute('data-url'), queryEl.val(), this.getAttribute('alt'));
|
|
107
107
|
modal.modal('hide');
|
|
108
108
|
});
|
|
109
109
|
|
|
@@ -113,15 +113,15 @@ $(document).ready(function () {
|
|
|
113
113
|
});
|
|
114
114
|
};
|
|
115
115
|
|
|
116
|
-
Tenor.select = function (textarea, selectionStart, selectionEnd, url, query) {
|
|
116
|
+
Tenor.select = function (textarea, selectionStart, selectionEnd, url, query, alt) {
|
|
117
117
|
require([
|
|
118
118
|
'composer/formatting',
|
|
119
119
|
'composer/controls',
|
|
120
120
|
], function (formatting, controls) {
|
|
121
121
|
if (selectionStart === selectionEnd) {
|
|
122
|
-
controls.insertIntoTextarea(textarea, '');
|
|
123
123
|
controls.updateTextareaSelection(
|
|
124
|
-
textarea, selectionStart +
|
|
124
|
+
textarea, selectionStart + alt.length + 4, selectionEnd + alt.length + url.length + 4
|
|
125
125
|
);
|
|
126
126
|
} else {
|
|
127
127
|
var wrapDelta = controls.wrapSelectionInTextareaWith(textarea, '');
|
|
@@ -19,12 +19,12 @@
|
|
|
19
19
|
/* Composer formatting icon override */
|
|
20
20
|
.fa-tenor-gif::before {
|
|
21
21
|
content: 'GIF';
|
|
22
|
-
font-size:
|
|
22
|
+
font-size: calc($font-size-base / 2);
|
|
23
23
|
font-family: sans;
|
|
24
24
|
background: #333;
|
|
25
25
|
color: #fff;
|
|
26
26
|
padding: 0.25rem 0.5rem;
|
|
27
27
|
border-radius: 0.5em;
|
|
28
28
|
position: relative;
|
|
29
|
-
top: -0.
|
|
29
|
+
top: -0.15rem;
|
|
30
30
|
}
|
|
@@ -1,34 +1,38 @@
|
|
|
1
|
-
<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
<div class="acp-page-container">
|
|
2
|
+
<!-- IMPORT admin/partials/settings/header.tpl -->
|
|
3
|
+
|
|
4
|
+
<div class="row m-0">
|
|
5
|
+
<div id="spy-container" class="col-12 px-0 mb-4" tabindex="0">
|
|
6
|
+
<form role="form" class="tenor-gif-settings">
|
|
7
|
+
<div class="row">
|
|
8
|
+
<div class="col-sm-2 col-12 settings-header">General</div>
|
|
9
|
+
<div class="col-sm-10 col-12">
|
|
10
|
+
<p class="lead">
|
|
11
|
+
Sign up for your Tenor GIF API Key from the <a href="https://console.cloud.google.com/apis/credentials">Google Cloud Console</a>, then enter it below and reload your NodeBB.
|
|
12
|
+
</p>
|
|
13
|
+
<p>
|
|
14
|
+
<strong>Be careful</strong>: If you use the <i class="fa fa-copy"></i> button to copy the API key, it'll add spaces to the beginning and end. You'll need to remove those.
|
|
15
|
+
</p>
|
|
16
|
+
<div class="mb-3">
|
|
17
|
+
<label for="key">API Key</label>
|
|
18
|
+
<input type="text" id="key" name="key" title="API Key" class="form-control" placeholder="API Key">
|
|
19
|
+
</div>
|
|
20
|
+
<div class="mb-3">
|
|
21
|
+
<label for="contentFilter">Content Filter</label>
|
|
22
|
+
<select class="form-control" id="contentFilter" name="contentFilter">
|
|
23
|
+
<option value="off">Off</option>
|
|
24
|
+
<option value="low">Low</option>
|
|
25
|
+
<option value="medium" selected>Medium (default)</option>
|
|
26
|
+
<option value="high">High</option>
|
|
27
|
+
</select>
|
|
28
|
+
</div>
|
|
29
|
+
<div class="mb-3">
|
|
30
|
+
<label for="limit">Limit results</label>
|
|
31
|
+
<input class="form-control" type="number" min="1" max="50" id="limit" placeholder="10" name="limit" />
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
</form>
|
|
28
36
|
</div>
|
|
29
37
|
</div>
|
|
30
|
-
</
|
|
31
|
-
|
|
32
|
-
<button id="save" class="floating-button mdl-button mdl-js-button mdl-button--fab mdl-js-ripple-effect mdl-button--colored">
|
|
33
|
-
<i class="material-icons">save</i>
|
|
34
|
-
</button>
|
|
38
|
+
</div>
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<!-- BEGIN gifs --><img data-url="{../url}" src="{../thumb}" /><!-- END -->
|
|
1
|
+
<!-- BEGIN gifs --><img data-url="{../url}" src="{../thumb}" alt="{../alt}" /><!-- END -->
|