nodebb-plugin-tenor-gif 2.2.0 → 3.0.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/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 +5 -5
- package/static/templates/partials/tenor-gif/list.tpl +1 -1
- package/static/templates/plugins/tenor-gif/modal.tpl +1 -1
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.0.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": "^
|
|
24
|
+
"compatibility": "^3.0.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,18 +1,18 @@
|
|
|
1
1
|
<form role="form" class="tenor-gif-settings">
|
|
2
2
|
<div class="row">
|
|
3
|
-
<div class="col-sm-2 col-
|
|
4
|
-
<div class="col-sm-10 col-
|
|
3
|
+
<div class="col-sm-2 col-12 settings-header">General</div>
|
|
4
|
+
<div class="col-sm-10 col-12">
|
|
5
5
|
<p class="lead">
|
|
6
6
|
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.
|
|
7
7
|
</p>
|
|
8
8
|
<p>
|
|
9
9
|
<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.
|
|
10
10
|
</p>
|
|
11
|
-
<div class="
|
|
11
|
+
<div class="mb-3">
|
|
12
12
|
<label for="key">API Key</label>
|
|
13
13
|
<input type="text" id="key" name="key" title="API Key" class="form-control" placeholder="API Key">
|
|
14
14
|
</div>
|
|
15
|
-
<div class="
|
|
15
|
+
<div class="mb-3">
|
|
16
16
|
<label for="contentFilter">Content Filter</label>
|
|
17
17
|
<select class="form-control" id="contentFilter" name="contentFilter">
|
|
18
18
|
<option value="off">Off</option>
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
<option value="high">High</option>
|
|
22
22
|
</select>
|
|
23
23
|
</div>
|
|
24
|
-
<div class="
|
|
24
|
+
<div class="mb-3">
|
|
25
25
|
<label for="limit">Limit results</label>
|
|
26
26
|
<input class="form-control" type="number" min="1" max="50" id="limit" placeholder="10" name="limit" />
|
|
27
27
|
</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 -->
|