nodebb-plugin-tenor-gif 4.1.0 → 4.1.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/library.js CHANGED
@@ -86,6 +86,10 @@ plugin.query = async (query) => {
86
86
 
87
87
  // Malformed return handling
88
88
  if (!body.results) {
89
+ const invalidAPIKey = String(body?.errors?.message?.[0]).includes('The provided API key is invalid');
90
+ if (invalidAPIKey) {
91
+ throw new Error('[[error:invalid-api-key]]');
92
+ }
89
93
  throw new Error('[[error:invalid-data]]');
90
94
  }
91
95
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nodebb-plugin-tenor-gif",
3
- "version": "4.1.0",
3
+ "version": "4.1.1",
4
4
  "description": "",
5
5
  "main": "library.js",
6
6
  "repository": {
@@ -1,65 +1,65 @@
1
- <?xml version="1.0" encoding="utf-8"?>
2
- <!-- Generator: Adobe Illustrator 28.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
- <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
- viewBox="0 0 640 107.3" style="enable-background:new 0 0 640 107.3;" xml:space="preserve">
5
- <style type="text/css">
6
- .st0{opacity:0.4;}
7
- .st1{fill:#F7DC3C;}
8
- .st2{fill:#EE4523;}
9
- </style>
10
- <g>
11
- <g>
12
- <g>
13
- <path d="M498.7,107.1h-16.5c-1.9,0-3.3-1.5-3.3-3.3V33.1c0-1.9,1.5-3.3,3.3-3.3h16.5c1.9,0,3.3,1.5,3.3,3.3v70.6
14
- C502.1,105.7,500.7,107.1,498.7,107.1z"/>
15
- <path d="M441.4,83.4V33.1c0-1.9-1.5-3.3-3.3-3.3h-16.5c-1.9,0-3.3,1.5-3.3,3.3v53.7v17c0,1.9,1.5,3.3,3.3,3.3h19.7h29.3
16
- c1.9,0,3.3-1.5,3.3-3.3V90.1c0-1.9-1.5-3.3-3.3-3.3h-25.9C442.9,86.7,441.4,85.4,441.4,83.4z"/>
17
- <path d="M539.2,29.8c-0.8,0-2.6,0-2.7,0h-8.2h-18.1c-1.9,0-3.3,1.5-3.3,3.3v70.6c0,1.9,1.5,3.3,3.3,3.3h16.5
18
- c1.9,0,3.3-1.5,3.3-3.3V84.3c0-0.6,0.6-1,1-0.8c8.3,2.4,19,2.6,28.4-6.6C579.4,56.9,560.7,29.8,539.2,29.8z M545,63.7
19
- c-8.8,6.3-18.6-3.5-12.3-12.3c0.2-0.3,0.5-0.6,0.8-0.8c8.8-6.3,18.6,3.5,12.3,12.3C545.5,63.2,545.2,63.5,545,63.7z"/>
20
- <path d="M639.1,42l-11.3-11.3c-1.3-1.3-3.3-1.3-4.7,0l-18.1,18.1c-0.5,0.5-1.4,0.5-1.8,0l-18.1-18.1c-1.3-1.3-3.3-1.3-4.7,0
21
- L569.3,42c-1.3,1.3-1.3,3.3,0,4.7l23.2,23.2c0.2,0.2,0.3,0.6,0.3,0.9v33.1c0,1.8,1.5,3.2,3.2,3.2h16.1c1.8,0,3.2-1.5,3.2-3.2v-33
22
- c0-0.3,0.1-0.7,0.3-0.9l23.2-23.2C640.3,45.4,640.3,43.3,639.1,42z"/>
23
- </g>
24
- </g>
25
- <g class="st0">
26
- <path d="M23,54.1c2,2,3,4.7,3,8.1c0,2.3-0.5,4.4-1.4,6c-0.9,1.7-2.3,2.9-4,3.8c-1.7,0.8-3.6,1.4-5.8,1.4h-8v12.5H0V51.2h14.9
27
- C18.3,51.2,21,52.1,23,54.1z M14.1,67.2c1.5,0,2.6-0.5,3.5-1.4c0.9-0.8,1.4-2.1,1.4-3.6c0-1.7-0.5-2.9-1.4-3.7
28
- c-0.9-0.8-2.2-1.4-3.5-1.4H6.9v10.1L14.1,67.2L14.1,67.2z"/>
29
- <path d="M56.9,52.8c2.7,1.5,4.8,3.5,6.4,6.2s2.3,5.8,2.3,9.4s-0.8,6.8-2.3,9.4c-1.6,2.7-3.6,4.7-6.4,6.2c-2.8,1.4-5.7,2.2-9.3,2.2
30
- S41,85.5,38.3,84c-2.7-1.5-4.9-3.5-6.5-6.2c-1.6-2.7-2.3-5.8-2.3-9.4s0.8-6.8,2.3-9.4c1.6-2.7,3.6-4.7,6.5-6.2
31
- c2.7-1.5,5.8-2.2,9.3-2.2C51.1,50.6,54.2,51.4,56.9,52.8z M38,74.7c0.9,1.8,2.3,3.1,3.9,4.1c1.7,1,3.5,1.4,5.7,1.4
32
- c2.1,0,4.1-0.5,5.6-1.4c1.7-0.9,2.9-2.3,3.9-4.1c0.9-1.8,1.4-3.9,1.4-6.3s-0.5-4.5-1.4-6.3c-0.9-1.8-2.2-3.1-3.9-4.1
33
- c-1.7-0.9-3.5-1.4-5.6-1.4c-2.2,0-4.1,0.5-5.7,1.4c-1.7,0.9-2.9,2.3-3.9,4.1c-0.9,1.8-1.4,3.9-1.4,6.3S37.1,72.9,38,74.7z"/>
34
- <path d="M92.9,63.1l-7.5,22.6h-5.8L67.5,51.1H75l7.5,23.3l7.5-23.3h5.6l7.5,23.3l7.5-23.3h7.5l-12.1,34.7h-5.8L92.9,63.1z"/>
35
- <path d="M129.4,65h13.3v6h-13.3v8.7h15.3v6.1h-22.2V51.2h22.1v6h-15.3L129.4,65L129.4,65z"/>
36
- <path d="M150.5,51.2h14.7c3.3,0,6,1,8.1,2.9s3,4.7,3,8.1c0,2.4-0.5,4.4-1.5,6.1c-1,1.7-2.4,2.9-4.2,3.8l7.5,13.7h-7.8l-6.9-12.6
37
- h-0.6h-5.4v12.6h-6.9L150.5,51.2L150.5,51.2z M164.3,67.1c1.5,0,2.7-0.5,3.6-1.4c0.9-0.9,1.4-2.1,1.4-3.6c0-1.6-0.5-2.8-1.4-3.6
38
- c-0.9-0.8-2.1-1.4-3.6-1.4h-7v9.9L164.3,67.1L164.3,67.1z"/>
39
- <path d="M190,65h13.3v6H190v8.7h15.3v6.1h-22.2V51.2h22.1v6H190L190,65L190,65z"/>
40
- <path d="M234,53.1c2.6,1.4,4.7,3.4,6.1,6c1.5,2.6,2.3,5.6,2.3,9.3s-0.8,6.7-2.3,9.3c-1.5,2.6-3.5,4.6-6.1,6
41
- c-2.6,1.4-5.6,2.1-8.9,2.1H211V51.2h14.2C228.5,51.2,231.5,51.8,234,53.1z M225.3,79.9c3.2,0,5.6-1,7.5-2.9c1.9-2,2.8-4.8,2.8-8.4
42
- c0-3.7-0.9-6.6-2.8-8.4c-1.9-2-4.4-2.9-7.5-2.9h-7.4v22.8L225.3,79.9L225.3,79.9z"/>
43
- <path d="M281,53.6c2,1.7,2.9,4.1,2.9,7.2c0,1.6-0.3,2.9-0.8,4.1c-0.6,1.1-1.4,2.1-2.3,2.8c1.4,0.6,2.4,1.6,3.2,3
44
- c0.8,1.4,1.4,3.1,1.4,5.2c0,3.2-1,5.7-3,7.5s-4.7,2.6-8.1,2.6h-15.4V51.2h14.4C276.4,51.2,279,51.9,281,53.6z M272.8,65.1
45
- c1.2,0,2.3-0.3,3-0.9c0.7-0.6,1.1-1.7,1.1-2.9c0-1.4-0.4-2.3-1.2-3c-0.8-0.7-2-1-3.3-1h-6.7v7.8H272.8L272.8,65.1z M273.3,79.7
46
- c1.6,0,2.7-0.4,3.6-1.1c0.9-0.7,1.4-1.8,1.4-3.2c0-1.5-0.5-2.6-1.4-3.2c-0.8-0.7-2-1.1-3.5-1.1h-7.8v8.7L273.3,79.7L273.3,79.7z"
47
- />
48
- <path d="M300.4,85.7V72.3L287.2,51h8l8.6,14.5l8.7-14.4h8l-13.1,21.3v13.4L300.4,85.7L300.4,85.7z"/>
49
- </g>
50
- <g>
51
- <g>
52
- <g>
53
- <path class="st1" d="M407.6,104.3L385,69.4c-0.4-0.7-0.4-1.4,0-2l21.2-34.9c0.8-1.3-0.1-3-1.7-3l-13.4,3
54
- c-10.6,2.4-13.8,8.6-20.2,17.5c-1.2,1.7-2,2.9-2,2.9c-1,1.8-3.7,1.1-3.7-1V23.2c-8.1,0-12.4,3-15.6,5.7
55
- c-10.2,8.4-12.4,18.8-12.4,32v44.4c0,1.1,0.9,2,2,2h24.2c1.1,0,2-0.9,2-2V83.2c0-2,2.6-2.7,3.6-1l8.2,24.2c0.4,0.7,1,1,1.7,1
56
- h27.2C407.5,107.2,408.5,105.5,407.6,104.3z M359.7,33.4c-1.5,0-2.7-1.2-2.7-2.7s1.2-2.7,2.7-2.7c1.5,0,2.7,1.2,2.7,2.7
57
- C362.3,32.3,361.2,33.4,359.7,33.4z"/>
58
- </g>
59
- <path class="st2" d="M333.8,48.8c0.2,0.6,2.1-29.7,31.7-30c0,0-24-28.2-32.9-15.6c0,0-4.4,6.9,4.1,9.1c0,0-13.7,3.6-13.5,13.1
60
- c0.1,3,3.1,4.9,5.9,3.7c1.6-0.7,3.6-2,6.2-4.4C335.3,24.6,329.3,36.7,333.8,48.8z"/>
61
- </g>
62
- <path class="st2" d="M368.5,24.4v7.4c0,0.6,0.6,0.9,1,0.6l7.1-4.7l-7.1-3.8C369,23.6,368.5,23.9,368.5,24.4z"/>
63
- </g>
64
- </g>
65
- </svg>
1
+ <?xml version="1.0" encoding="utf-8"?>
2
+ <!-- Generator: Adobe Illustrator 28.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 640 107.3" style="enable-background:new 0 0 640 107.3;" xml:space="preserve">
5
+ <style type="text/css">
6
+ .st0{opacity:0.4;}
7
+ .st1{fill:#F7DC3C;}
8
+ .st2{fill:#EE4523;}
9
+ </style>
10
+ <g>
11
+ <g>
12
+ <g>
13
+ <path d="M498.7,107.1h-16.5c-1.9,0-3.3-1.5-3.3-3.3V33.1c0-1.9,1.5-3.3,3.3-3.3h16.5c1.9,0,3.3,1.5,3.3,3.3v70.6
14
+ C502.1,105.7,500.7,107.1,498.7,107.1z"/>
15
+ <path d="M441.4,83.4V33.1c0-1.9-1.5-3.3-3.3-3.3h-16.5c-1.9,0-3.3,1.5-3.3,3.3v53.7v17c0,1.9,1.5,3.3,3.3,3.3h19.7h29.3
16
+ c1.9,0,3.3-1.5,3.3-3.3V90.1c0-1.9-1.5-3.3-3.3-3.3h-25.9C442.9,86.7,441.4,85.4,441.4,83.4z"/>
17
+ <path d="M539.2,29.8c-0.8,0-2.6,0-2.7,0h-8.2h-18.1c-1.9,0-3.3,1.5-3.3,3.3v70.6c0,1.9,1.5,3.3,3.3,3.3h16.5
18
+ c1.9,0,3.3-1.5,3.3-3.3V84.3c0-0.6,0.6-1,1-0.8c8.3,2.4,19,2.6,28.4-6.6C579.4,56.9,560.7,29.8,539.2,29.8z M545,63.7
19
+ c-8.8,6.3-18.6-3.5-12.3-12.3c0.2-0.3,0.5-0.6,0.8-0.8c8.8-6.3,18.6,3.5,12.3,12.3C545.5,63.2,545.2,63.5,545,63.7z"/>
20
+ <path d="M639.1,42l-11.3-11.3c-1.3-1.3-3.3-1.3-4.7,0l-18.1,18.1c-0.5,0.5-1.4,0.5-1.8,0l-18.1-18.1c-1.3-1.3-3.3-1.3-4.7,0
21
+ L569.3,42c-1.3,1.3-1.3,3.3,0,4.7l23.2,23.2c0.2,0.2,0.3,0.6,0.3,0.9v33.1c0,1.8,1.5,3.2,3.2,3.2h16.1c1.8,0,3.2-1.5,3.2-3.2v-33
22
+ c0-0.3,0.1-0.7,0.3-0.9l23.2-23.2C640.3,45.4,640.3,43.3,639.1,42z"/>
23
+ </g>
24
+ </g>
25
+ <g class="st0">
26
+ <path d="M23,54.1c2,2,3,4.7,3,8.1c0,2.3-0.5,4.4-1.4,6c-0.9,1.7-2.3,2.9-4,3.8c-1.7,0.8-3.6,1.4-5.8,1.4h-8v12.5H0V51.2h14.9
27
+ C18.3,51.2,21,52.1,23,54.1z M14.1,67.2c1.5,0,2.6-0.5,3.5-1.4c0.9-0.8,1.4-2.1,1.4-3.6c0-1.7-0.5-2.9-1.4-3.7
28
+ c-0.9-0.8-2.2-1.4-3.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
38
+ c-0.9-0.8-2.1-1.4-3.6-1.4h-7v9.9L164.3,67.1L164.3,67.1z"/>
39
+ <path d="M190,65h13.3v6H190v8.7h15.3v6.1h-22.2V51.2h22.1v6H190L190,65L190,65z"/>
40
+ <path d="M234,53.1c2.6,1.4,4.7,3.4,6.1,6c1.5,2.6,2.3,5.6,2.3,9.3s-0.8,6.7-2.3,9.3c-1.5,2.6-3.5,4.6-6.1,6
41
+ c-2.6,1.4-5.6,2.1-8.9,2.1H211V51.2h14.2C228.5,51.2,231.5,51.8,234,53.1z M225.3,79.9c3.2,0,5.6-1,7.5-2.9c1.9-2,2.8-4.8,2.8-8.4
42
+ c0-3.7-0.9-6.6-2.8-8.4c-1.9-2-4.4-2.9-7.5-2.9h-7.4v22.8L225.3,79.9L225.3,79.9z"/>
43
+ <path d="M281,53.6c2,1.7,2.9,4.1,2.9,7.2c0,1.6-0.3,2.9-0.8,4.1c-0.6,1.1-1.4,2.1-2.3,2.8c1.4,0.6,2.4,1.6,3.2,3
44
+ c0.8,1.4,1.4,3.1,1.4,5.2c0,3.2-1,5.7-3,7.5s-4.7,2.6-8.1,2.6h-15.4V51.2h14.4C276.4,51.2,279,51.9,281,53.6z M272.8,65.1
45
+ c1.2,0,2.3-0.3,3-0.9c0.7-0.6,1.1-1.7,1.1-2.9c0-1.4-0.4-2.3-1.2-3c-0.8-0.7-2-1-3.3-1h-6.7v7.8H272.8L272.8,65.1z M273.3,79.7
46
+ c1.6,0,2.7-0.4,3.6-1.1c0.9-0.7,1.4-1.8,1.4-3.2c0-1.5-0.5-2.6-1.4-3.2c-0.8-0.7-2-1.1-3.5-1.1h-7.8v8.7L273.3,79.7L273.3,79.7z"
47
+ />
48
+ <path d="M300.4,85.7V72.3L287.2,51h8l8.6,14.5l8.7-14.4h8l-13.1,21.3v13.4L300.4,85.7L300.4,85.7z"/>
49
+ </g>
50
+ <g>
51
+ <g>
52
+ <g>
53
+ <path class="st1" d="M407.6,104.3L385,69.4c-0.4-0.7-0.4-1.4,0-2l21.2-34.9c0.8-1.3-0.1-3-1.7-3l-13.4,3
54
+ c-10.6,2.4-13.8,8.6-20.2,17.5c-1.2,1.7-2,2.9-2,2.9c-1,1.8-3.7,1.1-3.7-1V23.2c-8.1,0-12.4,3-15.6,5.7
55
+ c-10.2,8.4-12.4,18.8-12.4,32v44.4c0,1.1,0.9,2,2,2h24.2c1.1,0,2-0.9,2-2V83.2c0-2,2.6-2.7,3.6-1l8.2,24.2c0.4,0.7,1,1,1.7,1
56
+ h27.2C407.5,107.2,408.5,105.5,407.6,104.3z M359.7,33.4c-1.5,0-2.7-1.2-2.7-2.7s1.2-2.7,2.7-2.7c1.5,0,2.7,1.2,2.7,2.7
57
+ C362.3,32.3,361.2,33.4,359.7,33.4z"/>
58
+ </g>
59
+ <path class="st2" d="M333.8,48.8c0.2,0.6,2.1-29.7,31.7-30c0,0-24-28.2-32.9-15.6c0,0-4.4,6.9,4.1,9.1c0,0-13.7,3.6-13.5,13.1
60
+ c0.1,3,3.1,4.9,5.9,3.7c1.6-0.7,3.6-2,6.2-4.4C335.3,24.6,329.3,36.7,333.8,48.8z"/>
61
+ </g>
62
+ <path class="st2" d="M368.5,24.4v7.4c0,0.6,0.6,0.9,1,0.6l7.1-4.7l-7.1-3.8C369,23.6,368.5,23.9,368.5,24.4z"/>
63
+ </g>
64
+ </g>
65
+ </svg>
@@ -80,9 +80,9 @@ $(document).ready(function () {
80
80
 
81
81
  Tenor.populateDOM = function (resultsEl, gifs) {
82
82
  require(['benchpress'], function (Benchpress) {
83
- Benchpress.parse('partials/tenor-gif/list', {
83
+ Benchpress.render('partials/tenor-gif/list', {
84
84
  gifs: gifs,
85
- }, function (html) {
85
+ }).then(function (html) {
86
86
  resultsEl.html(html);
87
87
  });
88
88
  });
@@ -90,7 +90,7 @@ $(document).ready(function () {
90
90
 
91
91
  Tenor.showModal = function (callback) {
92
92
  require(['benchpress', 'modals'], function (Benchpress, modals) {
93
- Benchpress.parse('plugins/tenor-gif/modal', {}, async function (html) {
93
+ Benchpress.render('plugins/tenor-gif/modal', {}).then(async function (html) {
94
94
  const modal = await modals.dialog({
95
95
  title: 'Insert GIF',
96
96
  message: html,
@@ -1 +1 @@
1
- <!-- BEGIN gifs --><img data-url="{../url}" src="{../thumb}" alt="{../alt}" /><!-- END -->
1
+ {{{ each gifs }}}<img data-url="{./url}" src="{./thumb}" alt="{./alt}" />{{{ end }}}