diff --git a/LICENSE.md b/LICENSE.md old mode 100644 new mode 100755 diff --git a/README.md b/README.md old mode 100644 new mode 100755 index 5ccfd84..af4039d --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ A [Flarum](http://flarum.org) extension that integrates your forum with GIF sear ### Preview -![Preview](https://i.imgur.com/HdhAWeo.png) +![Preview](https://i.imgur.com/kHJZAPC.gif) ### Available GIF search engines @@ -36,5 +36,4 @@ composer update therealsujitk/flarum-ext-gifs - [Packagist](https://packagist.org/packages/therealsujitk/flarum-ext-gifs) - [Discussion Page](https://discuss.flarum.org/d/23101) - [Github](https://therealsuji.tk/extensions/flarum-ext-gifs) -- [Donate on PayPal](https://therealsuji.tk/donate) - +- [Donate on PayPal](https://therealsuji.tk/donate) \ No newline at end of file diff --git a/assets/powered_by_giphy.svg b/assets/powered_by_giphy.svg old mode 100644 new mode 100755 index 4ebbfbc..e86c6cb --- a/assets/powered_by_giphy.svg +++ b/assets/powered_by_giphy.svg @@ -1 +1,62 @@ - \ No newline at end of file + + + + + + image/svg+xml + + + + + + + + + + + diff --git a/composer.json b/composer.json old mode 100644 new mode 100755 index 1589996..d5a7f32 --- a/composer.json +++ b/composer.json @@ -12,7 +12,8 @@ "authors": [ { "name": "Sujit Kumar", - "role": "Developer" + "role": "Developer", + "email": "sujit@binarystack.cf" } ], "autoload": { diff --git a/extend.php b/extend.php old mode 100644 new mode 100755 index 773fdcc..cd8f295 --- a/extend.php +++ b/extend.php @@ -16,12 +16,12 @@ use Illuminate\Contracts\Events\Dispatcher; return [ - (new Extend\Frontend('forum')) - ->js(__DIR__.'/js/dist/forum.js'), - (new Extend\Frontend('admin')) - ->js(__DIR__.'/js/dist/admin.js'), - new Extend\Locales(__DIR__ . '/resources/locale'), - function (Dispatcher $dispatcher) { - $dispatcher->listen(Serializing::class, Listeners\SaveSettings::class); - }, + (new Extend\Frontend('forum')) + ->js(__DIR__.'/js/dist/forum.js'), + (new Extend\Frontend('admin')) + ->js(__DIR__.'/js/dist/admin.js'), + new Extend\Locales(__DIR__ . '/resources/locale'), + function (Dispatcher $dispatcher) { + $dispatcher->listen(Serializing::class, Listeners\SaveSettings::class); + }, ]; diff --git a/icon.svg b/icon.svg old mode 100644 new mode 100755 diff --git a/js/admin.js b/js/admin.js old mode 100644 new mode 100755 diff --git a/js/dist/admin.js b/js/dist/admin.js old mode 100644 new mode 100755 index ba55562..626ee62 --- a/js/dist/admin.js +++ b/js/dist/admin.js @@ -1,2 +1,2 @@ -module.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var a=e[n]={i:n,l:!1,exports:{}};return t[n].call(a.exports,a,a.exports,r),a.l=!0,a.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var a in t)r.d(n,a,function(e){return t[e]}.bind(null,a));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=8)}([function(t,e){t.exports=flarum.core.compat.app},function(t,e,r){"use strict";function n(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}r.d(e,"a",(function(){return n}))},,,,function(t,e){t.exports=flarum.core.compat["components/SettingsModal"]},,,function(t,e,r){"use strict";r.r(e);var n=r(0),a=r.n(n),o=r(1),i=r(5),u=function(t){function e(){return t.apply(this,arguments)||this}Object(o.a)(e,t);var r=e.prototype;return r.className=function(){return"Modal--small"},r.title=function(){return app.translator.trans("therealsujitk.admin.gifs.title")},r.form=function(){return[m("div[class = Form-group]",[m("label",app.translator.trans("therealsujitk.admin.gifs.giphyAPIkey")),m("input",{class:"FormControl",bidi:this.setting("therealsujitk-gifs.giphy_api_key")}),m("hr"),m("div",[m("p[style = display: inline;]",app.translator.trans("therealsujitk.admin.about.stringA")),m("a",{href:"https://github.com/therealsujitk",target:"_blank"},"@therealsujitk"),m("br"),m("p[style = display: inline;]",app.translator.trans("therealsujitk.admin.about.stringB")),m("a",{href:"https://paypal.me/suchitrakumar",target:"_blank"},"PayPal")])])]},e}(r.n(i).a);a.a.initializers.add("therealsujitk/flarum-ext-gifs",(function(){a.a.extensionSettings["therealsujitk-gifs"]=function(){return a.a.modal.show(new u)}}))}]); +module.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=8)}([function(t,e){t.exports=flarum.core.compat.app},function(t,e,r){"use strict";function n(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}r.d(e,"a",(function(){return n}))},,,,function(t,e){t.exports=flarum.core.compat["components/SettingsModal"]},,,function(t,e,r){"use strict";r.r(e);var n=r(0),o=r.n(n),a=r(1),i=r(5),u=function(t){function e(){return t.apply(this,arguments)||this}Object(a.a)(e,t);var r=e.prototype;return r.className=function(){return"Modal--small"},r.title=function(){return app.translator.trans("therealsujitk.admin.gifs.title")},r.form=function(){return[m("div[class = Form-group]",[m("label",app.translator.trans("therealsujitk.admin.gifs.giphyAPIkey")),m("input",{class:"FormControl",bidi:this.setting("therealsujitk-gifs.giphy_api_key")}),m("hr"),m("div",[m("p[style = display: inline;]",app.translator.trans("therealsujitk.admin.about.stringA")),m("a",{href:"https://therealsuji.tk/github",target:"_blank"},"@therealsujitk"),m("br"),m("p[style = display: inline;]",app.translator.trans("therealsujitk.admin.about.stringB")),m("a",{href:"https://therealsuji.tk/donate",target:"_blank"},"PayPal")])])]},e}(r.n(i).a);o.a.initializers.add("therealsujitk/flarum-ext-gifs",(function(){o.a.extensionSettings["therealsujitk-gifs"]=function(){return o.a.modal.show(new u)}}))}]); //# sourceMappingURL=admin.js.map \ No newline at end of file diff --git a/js/dist/admin.js.map b/js/dist/admin.js.map old mode 100644 new mode 100755 index 1c272bd..b43afc6 --- a/js/dist/admin.js.map +++ b/js/dist/admin.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack://@therealsujitk/flarum-ext-gifs/webpack/bootstrap","webpack://@therealsujitk/flarum-ext-gifs/external \"flarum.core.compat['app']\"","webpack://@therealsujitk/flarum-ext-gifs/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@therealsujitk/flarum-ext-gifs/external \"flarum.core.compat['components/SettingsModal']\"","webpack://@therealsujitk/flarum-ext-gifs/./src/admin/components/GIFsSettingsModal.js","webpack://@therealsujitk/flarum-ext-gifs/./src/admin/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","_inheritsLoose","subClass","superClass","constructor","__proto__","GIFsSettingsModal","className","title","app","translator","trans","form","class","bidi","this","setting","href","target","SettingsModal","initializers","add","extensionSettings","modal","show"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAOC,eAAeb,EAAS,aAAc,CAAEmB,OAAO,KAQvDrB,EAAoBsB,EAAI,SAASD,EAAOE,GAEvC,GADU,EAAPA,IAAUF,EAAQrB,EAAoBqB,IAC/B,EAAPE,EAAU,OAAOF,EACpB,GAAW,EAAPE,GAA8B,iBAAVF,GAAsBA,GAASA,EAAMG,WAAY,OAAOH,EAChF,IAAII,EAAKX,OAAOY,OAAO,MAGvB,GAFA1B,EAAoBkB,EAAEO,GACtBX,OAAOC,eAAeU,EAAI,UAAW,CAAET,YAAY,EAAMK,MAAOA,IACtD,EAAPE,GAA4B,iBAATF,EAAmB,IAAI,IAAIM,KAAON,EAAOrB,EAAoBU,EAAEe,EAAIE,EAAK,SAASA,GAAO,OAAON,EAAMM,IAAQC,KAAK,KAAMD,IAC9I,OAAOF,GAIRzB,EAAoB6B,EAAI,SAAS1B,GAChC,IAAIS,EAAST,GAAUA,EAAOqB,WAC7B,WAAwB,OAAOrB,EAAgB,SAC/C,WAA8B,OAAOA,GAEtC,OADAH,EAAoBU,EAAEE,EAAQ,IAAKA,GAC5BA,GAIRZ,EAAoBa,EAAI,SAASiB,EAAQC,GAAY,OAAOjB,OAAOkB,UAAUC,eAAe1B,KAAKuB,EAAQC,IAGzG/B,EAAoBkC,EAAI,GAIjBlC,EAAoBA,EAAoBmC,EAAI,G,gBClFrDhC,EAAOD,QAAUkC,OAAOC,KAAKC,OAAY,K,6BCA1B,SAASC,EAAeC,EAAUC,GAC/CD,EAASR,UAAYlB,OAAOY,OAAOe,EAAWT,WAC9CQ,EAASR,UAAUU,YAAcF,EACjCA,EAASG,UAAYF,EAHvB,mC,iBCAAtC,EAAOD,QAAUkC,OAAOC,KAAKC,OAAO,6B,wECEfM,E,0GACpBC,UAAA,WACC,MAAO,gB,EAGRC,MAAA,WACC,OAAOC,IAAIC,WAAWC,MAAM,mC,EAG7BC,KAAA,WACC,MAAO,CACN1C,EAAE,0BAA2B,CAC5BA,EAAE,QAASuC,IAAIC,WAAWC,MAAM,yCAChCzC,EAAE,QAAS,CACV2C,MAAO,cACPC,KAAMC,KAAKC,QAAQ,sCAEpB9C,EAAE,MAAOA,EAAE,MAAO,CACjBA,EAAE,8BAA+BuC,IAAIC,WAAWC,MAAM,sCAAuCzC,EAAE,IAAK,CAAE+C,KAAM,mCAAoCC,OAAQ,UAAY,kBACpKhD,EAAE,MACFA,EAAE,8BAA+BuC,IAAIC,WAAWC,MAAM,sCAAuCzC,EAAE,IAAK,CAAE+C,KAAM,kCAAmCC,OAAQ,UAAY,gB,UApBzHC,GCC/CV,IAAIW,aAAaC,IAAI,iCAAiC,WACrDZ,IAAIa,kBAAkB,sBAAwB,kBAAMb,IAAIc,MAAMC,KAAK,IAAIlB","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 8);\n","module.exports = flarum.core.compat['app'];","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","module.exports = flarum.core.compat['components/SettingsModal'];","import SettingsModal from 'flarum/components/SettingsModal';\n\nexport default class GIFsSettingsModal extends SettingsModal {\n\tclassName() {\n\t\treturn 'Modal--small';\n\t}\n\n\ttitle() {\n\t\treturn app.translator.trans('therealsujitk.admin.gifs.title');\n\t}\n\n\tform() {\n\t\treturn [\n\t\t\tm('div[class = Form-group]', [\n\t\t\t\tm('label', app.translator.trans('therealsujitk.admin.gifs.giphyAPIkey')),\n\t\t\t\tm('input', {\n\t\t\t\t\tclass: 'FormControl',\n\t\t\t\t\tbidi: this.setting('therealsujitk-gifs.giphy_api_key')\n\t\t\t\t}),\n\t\t\t\tm('hr'), m('div', [\n\t\t\t\t\tm('p[style = display: inline;]', app.translator.trans('therealsujitk.admin.about.stringA')), m('a', { href: 'https://github.com/therealsujitk', target: '_blank' }, '@therealsujitk'), \n\t\t\t\t\tm('br'),\n\t\t\t\t\tm('p[style = display: inline;]', app.translator.trans('therealsujitk.admin.about.stringB')), m('a', { href: 'https://paypal.me/suchitrakumar', target: '_blank' }, 'PayPal')\n\t\t\t\t])\n\t\t\t])\n \t];\n\t}\n}\n","import app from 'flarum/app';\r\nimport GIFsSettingsModal from './components/GIFsSettingsModal';\r\n\r\napp.initializers.add('therealsujitk/flarum-ext-gifs', () => {\r\n\tapp.extensionSettings['therealsujitk-gifs'] = () => app.modal.show(new GIFsSettingsModal());\r\n});\r\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@therealsujitk/flarum-ext-gifs/webpack/bootstrap","webpack://@therealsujitk/flarum-ext-gifs/external \"flarum.core.compat['app']\"","webpack://@therealsujitk/flarum-ext-gifs/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@therealsujitk/flarum-ext-gifs/external \"flarum.core.compat['components/SettingsModal']\"","webpack://@therealsujitk/flarum-ext-gifs/./src/admin/components/GIFsSettingsModal.js","webpack://@therealsujitk/flarum-ext-gifs/./src/admin/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","_inheritsLoose","subClass","superClass","constructor","__proto__","GIFsSettingsModal","className","title","app","translator","trans","form","class","bidi","this","setting","href","target","SettingsModal","initializers","add","extensionSettings","modal","show"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GAAY,CACzCG,EAAGH,EACHI,GAAG,EACHH,QAAS,IAUV,OANAI,EAAQL,GAAUM,KAAKJ,EAAOD,QAASC,EAAQA,EAAOD,QAASF,GAG/DG,EAAOE,GAAI,EAGJF,EAAOD,QA0Df,OArDAF,EAAoBQ,EAAIF,EAGxBN,EAAoBS,EAAIV,EAGxBC,EAAoBU,EAAI,SAASR,EAASS,EAAMC,GAC3CZ,EAAoBa,EAAEX,EAASS,IAClCG,OAAOC,eAAeb,EAASS,EAAM,CAAEK,YAAY,EAAMC,IAAKL,KAKhEZ,EAAoBkB,EAAI,SAAShB,GACX,oBAAXiB,QAA0BA,OAAOC,aAC1CN,OAAOC,eAAeb,EAASiB,OAAOC,YAAa,CAAEC,MAAO,WAE7DP,OAAO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CzC,EAAE,QAAS,CACV2C,MAAO,cACPC,KAAMC,KAAKC,QAAQ,sCAEpB9C,EAAE,MAAOA,EAAE,MAAO,CACjBA,EAAE,8BAA+BuC,IAAIC,WAAWC,MAAM,sCAAuCzC,EAAE,IAAK,CAAE+C,KAAM,gCAAiCC,OAAQ,UAAY,kBACjKhD,EAAE,MACFA,EAAE,8BAA+BuC,IAAIC,WAAWC,MAAM,sCAAuCzC,EAAE,IAAK,CAAE+C,KAAM,gCAAiCC,OAAQ,UAAY,gB,UApBvHC,GCC/CV,IAAIW,aAAaC,IAAI,iCAAiC,WACrDZ,IAAIa,kBAAkB,sBAAwB,kBAAMb,IAAIc,MAAMC,KAAK,IAAIlB","file":"admin.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 8);\n","module.exports = flarum.core.compat['app'];","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","module.exports = flarum.core.compat['components/SettingsModal'];","import SettingsModal from 'flarum/components/SettingsModal';\n\nexport default class GIFsSettingsModal extends SettingsModal {\n\tclassName() {\n\t\treturn 'Modal--small';\n\t}\n\n\ttitle() {\n\t\treturn app.translator.trans('therealsujitk.admin.gifs.title');\n\t}\n\n\tform() {\n\t\treturn [\n\t\t\tm('div[class = Form-group]', [\n\t\t\t\tm('label', app.translator.trans('therealsujitk.admin.gifs.giphyAPIkey')),\n\t\t\t\tm('input', {\n\t\t\t\t\tclass: 'FormControl',\n\t\t\t\t\tbidi: this.setting('therealsujitk-gifs.giphy_api_key')\n\t\t\t\t}),\n\t\t\t\tm('hr'), m('div', [\n\t\t\t\t\tm('p[style = display: inline;]', app.translator.trans('therealsujitk.admin.about.stringA')), m('a', { href: 'https://therealsuji.tk/github', target: '_blank' }, '@therealsujitk'), \n\t\t\t\t\tm('br'),\n\t\t\t\t\tm('p[style = display: inline;]', app.translator.trans('therealsujitk.admin.about.stringB')), m('a', { href: 'https://therealsuji.tk/donate', target: '_blank' }, 'PayPal')\n\t\t\t\t])\n\t\t\t])\n \t];\n\t}\n}\n","import app from 'flarum/app';\r\nimport GIFsSettingsModal from './components/GIFsSettingsModal';\r\n\r\napp.initializers.add('therealsujitk/flarum-ext-gifs', () => {\r\n\tapp.extensionSettings['therealsujitk-gifs'] = () => app.modal.show(new GIFsSettingsModal());\r\n});\r\n"],"sourceRoot":""} \ No newline at end of file diff --git a/js/dist/forum.js b/js/dist/forum.js old mode 100644 new mode 100755 index f11f6e0..66147ec --- a/js/dist/forum.js +++ b/js/dist/forum.js @@ -1,2 +1,2 @@ -module.exports=function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=7)}([function(t,e){t.exports=flarum.core.compat.app},function(t,e,r){"use strict";function n(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}r.d(e,"a",(function(){return n}))},function(t,e){t.exports=flarum.core.compat.extend},function(t,e){t.exports=flarum.core.compat["components/TextEditor"]},function(t,e){t.exports=flarum.core.compat["components/Modal"]},,function(t,e){t.exports=flarum.core.compat.Component},function(t,e,r){"use strict";r.r(e);var n=r(2),o=r(0),a=r.n(o),i=(r(6),r(3)),s=r.n(i),l=r(1),u=r(4),p="",c=0;function d(t,e){var r;r=""===p?"https://api.giphy.com/v1/gifs/trending?api_key="+e+"&limit=40&offset="+c.toString(10):"https://api.giphy.com/v1/gifs/search?api_key="+e+"&q="+p+"&limit=40&offset="+c.toString(10),fetch(r).then((function(t){return t.json()})).then((function(e){for(var r=document.getElementById("LeftResults"),n=document.getElementById("RightResults"),o=0,a=function(){var a=document.createElement("img"),s=document.createElement("img");return document.getElementsByClassName("temp-text")[0].textContent="",document.getElementById("LoadMore").style.visibility="hidden",document.getElementById("LoadMoreSpan").textContent=app.translator.trans("therealsujitk.forum.gifs.loadmore"),void 0===e.data[0]?(document.getElementsByClassName("temp-text")[0].textContent=app.translator.trans("therealsujitk.forum.gifs.noresults"),++o,"break"):void 0===e.data[i]?(++o,"break"):(a.src=e.data[i].images.downsized.url,a.alt=e.data[i].title,a.style="min-width: 97.5%; width: 97.5%; border-radius: 5px; margin: 1.25%; margin-left: 0%; margin-right: 0.3125%; vertical-align: top; cursor: pointer;",r.insertAdjacentElement("beforeend",a),a.onclick=function(){var e="![Giphy - "+a.alt+"]("+a.src+")";app.modal.close(),t.insertAtCursor(e)},void 0===e.data[i+1]?(++o,"break"):(s.src=e.data[i+1].images.downsized.url,s.alt=e.data[i+1].title,s.style="min-width: 97.5%; width: 97.5%; border-radius: 5px; margin: 1.25%; margin-left: 0.3125%; margin-right: 0%; vertical-align: top; cursor: pointer;",n.insertAdjacentElement("beforeend",s),void(s.onclick=function(){var e="![Giphy - "+s.alt+"]("+s.src+")";app.modal.close(),t.insertAtCursor(e)})))},i=0;i {\n\t\t\t\tlet embed = '![Giphy - ' + imgL.alt + ']' + '(' + imgL.src + ')';\n\t\t\t\tapp.modal.close();\n\t\t\t\ttextarea.insertAtCursor(embed);\n\t\t\t};\n\n\t\t\tif(typeof content.data[i+1] === 'undefined') {\n\t\t\t\t++flag;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\timgR.src = content.data[i+1].images.downsized.url;\n\t\t\timgR.alt = content.data[i+1].title;\n\t\t\timgR.style = 'min-width: 97.5%; width: 97.5%; border-radius: 5px; margin: 1.25%; margin-left: 0.3125%; margin-right: 0%; vertical-align: top; cursor: pointer;';\n\t\t\tresultsRight.insertAdjacentElement(\"beforeend\", imgR);\n\t\t\timgR.onclick = () => {\n\t\t\t\tlet embed = '![Giphy - ' + imgR.alt + ']' + '(' + imgR.src + ')';\n\t\t\t\tapp.modal.close();\n\t\t\t\ttextarea.insertAtCursor(embed);\n\t\t\t};\n\t\t}\n\t\tif(flag === 0) {\n\t\t\tdocument.getElementById('LoadMore').style.visibility = 'visible';\n\t\t}\n\t});\n}\n\nexport default class SearchGIFModal extends Modal {\n\tclassName() {\n\t\treturn '';\n\t}\n\n\ttitle() {\n\t\treturn app.translator.trans('therealsujitk.forum.gifs.title');\n\t}\n\n\tcontent() {\n\t\treturn m('.Modal-body', {\n\t\t\tconfig: (content, isInitialized) => {\n\t\t\t\t\t\tif(!isInitialized) {\n\t\t\t\t\t\t\tdocument.getElementsByClassName('temp-text')[0].textContent = app.translator.trans('therealsujitk.forum.gifs.loading');\n\t\t\t\t\t\t\tconst textarea = this.props.textArea;\n\t\t\t\t\t\t\tconst giphyAPI = app.forum.attribute('therealsujitk-gifs.giphy_api_key');\n\t\t\t\t\t\t\tquery = document.getElementById('GIFSearchBar').value.trim();\n\t\t\t\t\t\t\tgetGiphyURL(textarea, giphyAPI);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}, m('span[style = position: absolute; left: 50%; top: 200px; transform: translate(-50%, -50%);]', {\n\t\t\t\tid: 'flarum-loading',\n\t\t\t\tclass: 'temp-text'\n\t\t\t}),\n\t\t\tm('div', [m('table[style = vertical-align: top; width: 100%;]',[\n\t\t\tm('td', [\n\t\t\t\tm('form[style = margin-right: 1.25%;]', {\n\t\t\t\t\tclass: 'Search-input',\n\t\t\t\t\tonsubmit: () => { return false; },\n\t\t\t\t\tonkeyup: () => {\n\t\t\t\t\t\tif(event.keyCode === 13) {\n\t\t\t\t\t\t\tlastResult = 0;\n\t\t\t\t\t\t\tdocument.getElementById('LeftResults').innerHTML = '';\n\t\t\t\t\t\t\tdocument.getElementById('RightResults').innerHTML = '';\n\t\t\t\t\t\t\tdocument.getElementById('LeftResults').scrollTop = 0;\n\t\t\t\t\t\t\tdocument.getElementsByClassName('temp-text')[0].textContent = app.translator.trans('therealsujitk.forum.gifs.loading');\n\t\t\t\t\t\t\tdocument.getElementById('LoadMore').style.visibility = 'hidden';\n\t\t\t\t\t\t\tconst textarea = this.props.textArea;\n\t\t\t\t\t\t\tconst giphyAPI = app.forum.attribute('therealsujitk-gifs.giphy_api_key');\n\t\t\t\t\t\t\tquery = document.getElementById('GIFSearchBar').value.trim();\n\t\t\t\t\t\t\tgetGiphyURL(textarea, giphyAPI);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}, [\n\t\t\t\t\tm('input[style = width: 100%;]', {\n\t\t\t\t\t\tid: 'GIFSearchBar',\n\t\t\t\t\t\tclass: 'FormControl',\n\t\t\t\t\t\ttype: 'search',\n\t\t\t\t\t\tautocomplete: 'off',\n\t\t\t\t\t\tplaceholder: app.translator.trans('therealsujitk.forum.gifs.searchbar'),\n\t\t\t\t\t})\n\t\t\t\t])\n\t\t\t]),\n\t\t\tm('td', [\n\t\t\t\tm('button[style = margin-left: 1.25%; width: 100%;]', {\n\t\t\t\t\tclass: 'Button Button--primary hasIcon',\n\t\t\t\t\titemclassname: 'App-primaryControl',\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\ttitle: app.translator.trans('therealsujitk.forum.gifs.search'),\n\t\t\t\t\tonclick: () => {\n\t\t\t\t\t\tlastResult = 0;\n\t\t\t\t\t\tdocument.getElementById('LeftResults').innerHTML = '';\n\t\t\t\t\t\tdocument.getElementById('RightResults').innerHTML = '';\n\t\t\t\t\t\tdocument.getElementById('LeftResults').scrollTop = 0;\n\t\t\t\t\t\tdocument.getElementsByClassName('temp-text')[0].textContent = app.translator.trans('therealsujitk.forum.gifs.loading');\n\t\t\t\t\t\tdocument.getElementById('LoadMore').style.visibility = 'hidden';\n\t\t\t\t\t\tconst textarea = this.props.textArea;\n\t\t\t\t\t\tconst giphyAPI = app.forum.attribute('therealsujitk-gifs.giphy_api_key');\n\t\t\t\t\t\tquery = document.getElementById('GIFSearchBar').value.trim();\n\t\t\t\t\t\tgetGiphyURL(textarea, giphyAPI);\n\t\t\t\t\t}\n\t\t\t\t}, [m('span', { class: 'Button-label' }, app.translator.trans('therealsujitk.forum.gifs.search'))])\n\t\t\t])])]), m('div[style = margin-top: 10px; margin-bottom: 10px; min-height: 45vh; height: 45vh; overflow: auto;]', [\n\t\t\t\tm('table', { width: '100%' }, [\n\t\t\t\t\tm('td', {\n\t\t\t\t\t\tid: 'LeftResults',\n\t\t\t\t\t\twidth: '50%'\n\t\t\t\t\t}),\n\t\t\t\t\tm('td', {\n\t\t\t\t\t\tid: 'RightResults',\n\t\t\t\t\t\twidth: '50%'\n\t\t\t\t\t})\n\t\t\t\t]),\n\t\t\t\tm('button[style = position: relative; left: 50%; transform: translate(-50%, 0%); margin-top: 10px; visibility: hidden;]', {\n\t\t\t\t\tid: 'LoadMore',\n\t\t\t\t\tclass: 'Button',\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\ttitle: app.translator.trans('therealsujitk.forum.gifs.loadmore'),\n\t\t\t\t\tonclick: () => {\n\t\t\t\t\t\tlastResult += parseInt(giphyLimit);\n\t\t\t\t\t\tdocument.getElementById('LoadMoreSpan').textContent = app.translator.trans('therealsujitk.forum.gifs.loading');\n\t\t\t\t\t\tconst textarea = this.props.textArea;\n\t\t\t\t\t\tconst giphyAPI = app.forum.attribute('therealsujitk-gifs.giphy_api_key');\n\t\t\t\t\t\tgetGiphyURL(textarea, giphyAPI);\n\t\t\t\t\t}\n\t\t\t\t}, [m('span', {id: 'LoadMoreSpan', class: 'Button-label'}, app.translator.trans('therealsujitk.forum.gifs.loadmore'))])\n\t\t\t]), m('div[style = padding-top: 10px; padding-bottom: 30px;]', [m('img[style = float: right;]', {\n\t\t\t\tsrc: app.forum.attribute('baseUrl') + '/assets/extensions/therealsujitk-gifs/powered_by_giphy.svg'\n\t\t\t})])\n\t\t);\n\t}\n}\n","import {extend} from 'flarum/extend';\r\nimport app from 'flarum/app';\r\nimport Component from 'flarum/Component';\r\nimport TextEditor from 'flarum/components/TextEditor';\r\nimport SearchGIFModal from './components/SearchGIFModal';\r\n\r\napp.initializers.add('therealsujitk/flarum-ext-gifs', () => {\r\n\textend(TextEditor.prototype, 'toolbarItems', function (items) {\r\n\t\titems.add('therealsujitk-gifs',\r\n\t\t\tm('button', {\r\n\t\t\t\ttype: 'buton',\r\n\t\t\t\tclass: 'Button Button--icon Button--link hasIcon',\r\n\t\t\t\ttitle: app.translator.trans('therealsujitk.forum.gifs.label'),\r\n\t\t\t\tonclick: () => {\r\n\t\t\t\t\tapp.modal.show(new SearchGIFModal({\r\n\t\t\t\t\t\ttextArea: this\r\n\t\t\t\t\t}));\r\n\t\t\t\t}\r\n\t\t\t}, [\r\n\t\t\t\tm('svg', {\r\n\t\t\t\t\tclass: 'fas fa-this-icon-does-not-exist',\r\n\t\t\t\t\txmlns: 'http://www.w3.org/2000/svg',\r\n\t\t\t\t\txlink: 'http://www.w3.org/1999/xlink',\r\n\t\t\t\t\twidth: '16pt',\r\n\t\t\t\t\theight: '7pt',\r\n\t\t\t\t\tviewBox: '0 0 16 7',\r\n\t\t\t\t\tversion: '1.1'\r\n\t\t\t\t}, [\r\n\t\t\t\t\tm('g', { id: 'surface1' }, [\r\n\t\t\t\t\t\tm('path[fill = currentColor]', {\r\n\t\t\t\t\t\t\td: 'M 0.78125 7.042969 C 0.496094 6.933594 0.265625 6.738281 0.132812 6.480469 L 0 6.234375 L 0 0.875 L 0.132812 0.625 C 0.277344 0.355469 0.558594 0.128906 0.847656 0.0429688 C 0.957031 0.015625 1.71875 0 2.917969 0.0078125 L 4.808594 0.0234375 L 5.050781 0.15625 C 5.21875 0.246094 5.332031 0.355469 5.425781 0.511719 C 5.597656 0.800781 5.648438 0.992188 5.648438 1.410156 L 5.648438 1.753906 L 1.65625 1.753906 L 1.65625 5.355469 L 3.96875 5.355469 L 3.96875 3.554688 L 5.648438 3.554688 L 5.648438 4.800781 C 5.648438 5.484375 5.628906 6.117188 5.605469 6.207031 C 5.523438 6.527344 5.308594 6.808594 5.050781 6.953125 L 4.808594 7.085938 L 2.878906 7.09375 C 1.339844 7.105469 0.917969 7.09375 0.78125 7.042969 Z M 0.78125 7.042969 '\r\n\t\t\t\t\t\t}),\r\n\t\t\t\t\t\tm('path[fill = currentColor]', {\r\n\t\t\t\t\t\t\td: 'M 7.371094 3.554688 L 7.371094 0 L 9.050781 0 L 9.050781 7.109375 L 7.371094 7.109375 Z M 7.371094 3.554688 '\r\n\t\t\t\t\t\t}),\r\n\t\t\t\t\t\tm('path[fill = currentColor]', {\r\n\t\t\t\t\t\t\td: 'M 10.773438 3.554688 L 10.773438 0 L 15.855469 0 L 15.855469 1.753906 L 12.453125 1.753906 L 12.453125 2.988281 L 14.722656 2.988281 L 14.722656 4.742188 L 12.453125 4.742188 L 12.453125 7.109375 L 10.773438 7.109375 Z M 10.773438 3.554688 '\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t])\r\n\t\t\t\t]),\r\n\t\t\t\tm('span', { class: 'Button-label' }, app.translator.trans('therealsujitk.forum.gifs.label'))\r\n\t\t\t]),\r\n\t\t10);\r\n\t});\r\n});\r\n"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack://@therealsujitk/flarum-ext-gifs/webpack/bootstrap","webpack://@therealsujitk/flarum-ext-gifs/external \"flarum.core.compat['app']\"","webpack://@therealsujitk/flarum-ext-gifs/./node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","webpack://@therealsujitk/flarum-ext-gifs/external \"flarum.core.compat['extend']\"","webpack://@therealsujitk/flarum-ext-gifs/external \"flarum.core.compat['components/TextEditor']\"","webpack://@therealsujitk/flarum-ext-gifs/external \"flarum.core.compat['components/Modal']\"","webpack://@therealsujitk/flarum-ext-gifs/external \"flarum.core.compat['Component']\"","webpack://@therealsujitk/flarum-ext-gifs/./src/forum/components/SearchGIFModal.js","webpack://@therealsujitk/flarum-ext-gifs/./src/forum/index.js"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","flarum","core","compat","_inheritsLoose","subClass","superClass","constructor","__proto__","query","lastResult","getGiphyURL","textarea","giphyAPI","url","toString","fetch","then","response","json","content","resultsLeft","document","getElementById","resultsRight","flag","imgL","createElement","imgR","getElementsByClassName","textContent","style","visibility","app","translator","trans","data","src","images","downsized","alt","title","insertAdjacentElement","onclick","embed","modal","close","insertAtCursor","parseInt","SearchGIFModal","className","config","isInitialized","props","textArea","forum","attribute","trim","id","class","onsubmit","onkeyup","e","keyCode","innerHTML","scrollTop","type","autocomplete","placeholder","itemclassname","width","Modal","initializers","add","extend","TextEditor","items","show","xmlns","xlink","height","viewBox","version"],"mappings":"2BACE,IAAIA,EAAmB,GAGvB,SAASC,EAAoBC,GAG5B,GAAGF,EAAiBE,GACnB,OAAOF,EAAiBE,GAAUC,QAGnC,IAAIC,EAASJ,EAAiBE,GA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,KAAM,CACPqF,GAAI,cACJY,MAAO,QAERjG,EAAE,KAAM,CACPqF,GAAI,eACJY,MAAO,UAGTjG,EAAE,uHAAwH,CACzHqF,GAAI,WACJC,MAAO,SACPO,KAAM,SACNzB,MAAOR,IAAIC,WAAWC,MAAM,qCAC5BQ,QAAS,WACRjC,GAAcsC,SAzJD,MA0Jb1B,SAASC,eAAe,gBAAgBO,YAAcG,IAAIC,WAAWC,MAAM,oCAG3ExB,EAFiB,EAAK0C,MAAMC,SACXrB,IAAIsB,MAAMC,UAAU,uCAGpC,CAACnF,EAAE,OAAQ,CAACqF,GAAI,eAAgBC,MAAO,gBAAiB1B,IAAIC,WAAWC,MAAM,0CAC7E9D,EAAE,wDAAyD,CAACA,EAAE,6BAA8B,CAC/FgE,IAAKJ,IAAIsB,MAAMC,UAAU,WAAa,mE,UAjGEe,GC5D5CtC,IAAIuC,aAAaC,IAAI,iCAAiC,WACrDC,iBAAOC,IAAW9E,UAAW,gBAAgB,SAAU+E,GAAO,WAC7DA,EAAMH,IAAI,qBACTpG,EAAE,SAAU,CACX6F,KAAM,QACNP,MAAO,2CACPlB,MAAOR,IAAIC,WAAWC,MAAM,kCAC5BQ,QAAS,WACRV,IAAIY,MAAMgC,KAAK,IAAI5B,EAAe,CACjCK,SAAU,OAGV,CACFjF,EAAE,MAAO,CACRsF,MAAO,kCACPmB,MAAO,6BACPC,MAAO,+BACPT,MAAO,OACPU,OAAQ,MACRC,QAAS,WACTC,QAAS,OACP,CACF7G,EAAE,IAAK,CAAEqF,GAAI,YAAc,CAC1BrF,EAAE,4BAA6B,CAC9BE,EAAG,muBAEJF,EAAE,4BAA6B,CAC9BE,EAAG,iHAEJF,EAAE,4BAA6B,CAC9BE,EAAG,yPAINF,EAAE,OAAQ,CAAEsF,MAAO,gBAAkB1B,IAAIC,WAAWC,MAAM,qCAE5D","file":"forum.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 7);\n","module.exports = flarum.core.compat['app'];","export default function _inheritsLoose(subClass, superClass) {\n subClass.prototype = Object.create(superClass.prototype);\n subClass.prototype.constructor = subClass;\n subClass.__proto__ = superClass;\n}","module.exports = flarum.core.compat['extend'];","module.exports = flarum.core.compat['components/TextEditor'];","module.exports = flarum.core.compat['components/Modal'];","module.exports = flarum.core.compat['Component'];","import Modal from 'flarum/components/Modal';\n\nconst giphyLimit = '40';\nvar query = '';\nvar lastResult = 0;\n\nfunction getGiphyURL(textarea, giphyAPI) {\n\tlet url;\n\tif(query === '')\n\t\turl = 'https://api.giphy.com/v1/gifs/trending?api_key=' + giphyAPI + '&limit=' + giphyLimit + '&offset=' + lastResult.toString(10);\n\telse\n\t\turl = 'https://api.giphy.com/v1/gifs/search?api_key=' + giphyAPI + '&q=' + query + '&limit=' + giphyLimit + '&offset=' + lastResult.toString(10);\n\n\tfetch(url).then(response => response.json()).then(content => {\n\t\tlet resultsLeft = document.getElementById('LeftResults');\n\t\tlet resultsRight = document.getElementById('RightResults');\n\t\tlet flag = 0;\n\n\t\tfor(var i=0; i {\n\t\t\t\tlet embed = '![Giphy - ' + imgL.alt + ']' + '(' + imgL.src + ')';\n\t\t\t\tapp.modal.close();\n\t\t\t\ttextarea.insertAtCursor(embed);\n\t\t\t};\n\n\t\t\tif(typeof content.data[i+1] === 'undefined') {\n\t\t\t\t++flag;\n\t\t\t\tbreak;\n\t\t\t}\n\t\t\timgR.src = content.data[i+1].images.downsized.url;\n\t\t\timgR.alt = content.data[i+1].title;\n\t\t\timgR.style = 'min-width: 97.5%; width: 97.5%; border-radius: 5px; margin: 1.25%; margin-left: 0.3125%; margin-right: 0%; vertical-align: top; cursor: pointer;';\n\t\t\tresultsRight.insertAdjacentElement(\"beforeend\", imgR);\n\t\t\timgR.onclick = () => {\n\t\t\t\tlet embed = '![Giphy - ' + imgR.alt + ']' + '(' + imgR.src + ')';\n\t\t\t\tapp.modal.close();\n\t\t\t\ttextarea.insertAtCursor(embed);\n\t\t\t};\n\t\t}\n\t\tif(flag === 0) {\n\t\t\tdocument.getElementById('LoadMore').style.visibility = 'visible';\n\t\t}\n\t});\n}\n\nexport default class SearchGIFModal extends Modal {\n\tclassName() {\n\t\treturn '';\n\t}\n\n\ttitle() {\n\t\treturn app.translator.trans('therealsujitk.forum.gifs.title');\n\t}\n\n\tcontent() {\n\t\treturn m('.Modal-body', {\n\t\t\tconfig: (content, isInitialized) => {\n\t\t\t\t\t\tif(!isInitialized) {\n\t\t\t\t\t\t\tdocument.getElementsByClassName('temp-text')[0].textContent = app.translator.trans('therealsujitk.forum.gifs.loading');\n\t\t\t\t\t\t\tconst textarea = this.props.textArea;\n\t\t\t\t\t\t\tconst giphyAPI = app.forum.attribute('therealsujitk-gifs.giphy_api_key');\n\t\t\t\t\t\t\tquery = document.getElementById('GIFSearchBar').value.trim();\n\t\t\t\t\t\t\tgetGiphyURL(textarea, giphyAPI);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t}, m('span[style = position: absolute; left: 50%; top: 200px; transform: translate(-50%, -50%);]', {\n\t\t\t\tid: 'flarum-loading',\n\t\t\t\tclass: 'temp-text'\n\t\t\t}),\n\t\t\tm('div', [m('table[style = vertical-align: top; width: 100%;]',[\n\t\t\tm('td[style = width: 100%;]', [\n\t\t\t\tm('form[style = margin-right: 1.25%;]', {\n\t\t\t\t\tclass: 'Search-input',\n\t\t\t\t\tonsubmit: () => { return false; },\n\t\t\t\t\tonkeyup: (e) => {\n\t\t\t\t\t\tif(e.keyCode === 13) {\n\t\t\t\t\t\t\tlastResult = 0;\n\t\t\t\t\t\t\tdocument.getElementById('LeftResults').innerHTML = '';\n\t\t\t\t\t\t\tdocument.getElementById('RightResults').innerHTML = '';\n\t\t\t\t\t\t\tdocument.getElementById('LeftResults').scrollTop = 0;\n\t\t\t\t\t\t\tdocument.getElementsByClassName('temp-text')[0].textContent = app.translator.trans('therealsujitk.forum.gifs.loading');\n\t\t\t\t\t\t\tdocument.getElementById('LoadMore').style.visibility = 'hidden';\n\t\t\t\t\t\t\tconst textarea = this.props.textArea;\n\t\t\t\t\t\t\tconst giphyAPI = app.forum.attribute('therealsujitk-gifs.giphy_api_key');\n\t\t\t\t\t\t\tquery = document.getElementById('GIFSearchBar').value.trim();\n\t\t\t\t\t\t\tgetGiphyURL(textarea, giphyAPI);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}, [\n\t\t\t\t\tm('input[style = width: 100%;]', {\n\t\t\t\t\t\tid: 'GIFSearchBar',\n\t\t\t\t\t\tclass: 'FormControl',\n\t\t\t\t\t\ttype: 'search',\n\t\t\t\t\t\tautocomplete: 'off',\n\t\t\t\t\t\tplaceholder: app.translator.trans('therealsujitk.forum.gifs.searchbar'),\n\t\t\t\t\t})\n\t\t\t\t])\n\t\t\t]),\n\t\t\tm('td', [\n\t\t\t\tm('button[style = margin-left: 1.25%;]', {\n\t\t\t\t\tclass: 'Button Button--primary hasIcon',\n\t\t\t\t\titemclassname: 'App-primaryControl',\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\ttitle: app.translator.trans('therealsujitk.forum.gifs.search'),\n\t\t\t\t\tonclick: () => {\n\t\t\t\t\t\tlastResult = 0;\n\t\t\t\t\t\tdocument.getElementById('LeftResults').innerHTML = '';\n\t\t\t\t\t\tdocument.getElementById('RightResults').innerHTML = '';\n\t\t\t\t\t\tdocument.getElementById('LeftResults').scrollTop = 0;\n\t\t\t\t\t\tdocument.getElementsByClassName('temp-text')[0].textContent = app.translator.trans('therealsujitk.forum.gifs.loading');\n\t\t\t\t\t\tdocument.getElementById('LoadMore').style.visibility = 'hidden';\n\t\t\t\t\t\tconst textarea = this.props.textArea;\n\t\t\t\t\t\tconst giphyAPI = app.forum.attribute('therealsujitk-gifs.giphy_api_key');\n\t\t\t\t\t\tquery = document.getElementById('GIFSearchBar').value.trim();\n\t\t\t\t\t\tgetGiphyURL(textarea, giphyAPI);\n\t\t\t\t\t}\n\t\t\t\t}, [m('span', { class: 'Button-label' }, app.translator.trans('therealsujitk.forum.gifs.search'))])\n\t\t\t])])]), m('div[style = margin-top: 10px; margin-bottom: 10px; min-height: 45vh; height: 45vh; overflow: auto;]', [\n\t\t\t\tm('table', { width: '100%' }, [\n\t\t\t\t\tm('td', {\n\t\t\t\t\t\tid: 'LeftResults',\n\t\t\t\t\t\twidth: '50%'\n\t\t\t\t\t}),\n\t\t\t\t\tm('td', {\n\t\t\t\t\t\tid: 'RightResults',\n\t\t\t\t\t\twidth: '50%'\n\t\t\t\t\t})\n\t\t\t\t]),\n\t\t\t\tm('button[style = position: relative; left: 50%; transform: translate(-50%, 0%); margin-top: 10px; visibility: hidden;]', {\n\t\t\t\t\tid: 'LoadMore',\n\t\t\t\t\tclass: 'Button',\n\t\t\t\t\ttype: 'button',\n\t\t\t\t\ttitle: app.translator.trans('therealsujitk.forum.gifs.loadmore'),\n\t\t\t\t\tonclick: () => {\n\t\t\t\t\t\tlastResult += parseInt(giphyLimit);\n\t\t\t\t\t\tdocument.getElementById('LoadMoreSpan').textContent = app.translator.trans('therealsujitk.forum.gifs.loading');\n\t\t\t\t\t\tconst textarea = this.props.textArea;\n\t\t\t\t\t\tconst giphyAPI = app.forum.attribute('therealsujitk-gifs.giphy_api_key');\n\t\t\t\t\t\tgetGiphyURL(textarea, giphyAPI);\n\t\t\t\t\t}\n\t\t\t\t}, [m('span', {id: 'LoadMoreSpan', class: 'Button-label'}, app.translator.trans('therealsujitk.forum.gifs.loadmore'))])\n\t\t\t]), m('div[style = padding-top: 10px; padding-bottom: 30px;]', [m('img[style = float: right;]', {\n\t\t\t\tsrc: app.forum.attribute('baseUrl') + '/assets/extensions/therealsujitk-gifs/powered_by_giphy.svg'\n\t\t\t})])\n\t\t);\n\t}\n}\n","import {extend} from 'flarum/extend';\r\nimport app from 'flarum/app';\r\nimport Component from 'flarum/Component';\r\nimport TextEditor from 'flarum/components/TextEditor';\r\nimport SearchGIFModal from './components/SearchGIFModal';\r\n\r\napp.initializers.add('therealsujitk/flarum-ext-gifs', () => {\r\n\textend(TextEditor.prototype, 'toolbarItems', function (items) {\r\n\t\titems.add('therealsujitk-gifs',\r\n\t\t\tm('button', {\r\n\t\t\t\ttype: 'buton',\r\n\t\t\t\tclass: 'Button Button--icon Button--link hasIcon',\r\n\t\t\t\ttitle: app.translator.trans('therealsujitk.forum.gifs.label'),\r\n\t\t\t\tonclick: () => {\r\n\t\t\t\t\tapp.modal.show(new SearchGIFModal({\r\n\t\t\t\t\t\ttextArea: this\r\n\t\t\t\t\t}));\r\n\t\t\t\t}\r\n\t\t\t}, [\r\n\t\t\t\tm('svg', {\r\n\t\t\t\t\tclass: 'fas fa-this-icon-does-not-exist',\r\n\t\t\t\t\txmlns: 'http://www.w3.org/2000/svg',\r\n\t\t\t\t\txlink: 'http://www.w3.org/1999/xlink',\r\n\t\t\t\t\twidth: '16pt',\r\n\t\t\t\t\theight: '7pt',\r\n\t\t\t\t\tviewBox: '0 0 16 7',\r\n\t\t\t\t\tversion: '1.1'\r\n\t\t\t\t}, [\r\n\t\t\t\t\tm('g', { id: 'surface1' }, [\r\n\t\t\t\t\t\tm('path[fill = currentColor]', {\r\n\t\t\t\t\t\t\td: 'M 0.78125 7.042969 C 0.496094 6.933594 0.265625 6.738281 0.132812 6.480469 L 0 6.234375 L 0 0.875 L 0.132812 0.625 C 0.277344 0.355469 0.558594 0.128906 0.847656 0.0429688 C 0.957031 0.015625 1.71875 0 2.917969 0.0078125 L 4.808594 0.0234375 L 5.050781 0.15625 C 5.21875 0.246094 5.332031 0.355469 5.425781 0.511719 C 5.597656 0.800781 5.648438 0.992188 5.648438 1.410156 L 5.648438 1.753906 L 1.65625 1.753906 L 1.65625 5.355469 L 3.96875 5.355469 L 3.96875 3.554688 L 5.648438 3.554688 L 5.648438 4.800781 C 5.648438 5.484375 5.628906 6.117188 5.605469 6.207031 C 5.523438 6.527344 5.308594 6.808594 5.050781 6.953125 L 4.808594 7.085938 L 2.878906 7.09375 C 1.339844 7.105469 0.917969 7.09375 0.78125 7.042969 Z M 0.78125 7.042969 '\r\n\t\t\t\t\t\t}),\r\n\t\t\t\t\t\tm('path[fill = currentColor]', {\r\n\t\t\t\t\t\t\td: 'M 7.371094 3.554688 L 7.371094 0 L 9.050781 0 L 9.050781 7.109375 L 7.371094 7.109375 Z M 7.371094 3.554688 '\r\n\t\t\t\t\t\t}),\r\n\t\t\t\t\t\tm('path[fill = currentColor]', {\r\n\t\t\t\t\t\t\td: 'M 10.773438 3.554688 L 10.773438 0 L 15.855469 0 L 15.855469 1.753906 L 12.453125 1.753906 L 12.453125 2.988281 L 14.722656 2.988281 L 14.722656 4.742188 L 12.453125 4.742188 L 12.453125 7.109375 L 10.773438 7.109375 Z M 10.773438 3.554688 '\r\n\t\t\t\t\t\t})\r\n\t\t\t\t\t])\r\n\t\t\t\t]),\r\n\t\t\t\tm('span', { class: 'Button-label' }, app.translator.trans('therealsujitk.forum.gifs.label'))\r\n\t\t\t]),\r\n\t\t10);\r\n\t});\r\n});\r\n"],"sourceRoot":""} \ No newline at end of file diff --git a/js/forum.js b/js/forum.js old mode 100644 new mode 100755 diff --git a/js/package-lock.json b/js/package-lock.json old mode 100644 new mode 100755 diff --git a/js/package.json b/js/package.json old mode 100644 new mode 100755 diff --git a/js/src/admin/components/GIFsSettingsModal.js b/js/src/admin/components/GIFsSettingsModal.js old mode 100644 new mode 100755 index b794676..b788e7b --- a/js/src/admin/components/GIFsSettingsModal.js +++ b/js/src/admin/components/GIFsSettingsModal.js @@ -18,9 +18,9 @@ export default class GIFsSettingsModal extends SettingsModal { bidi: this.setting('therealsujitk-gifs.giphy_api_key') }), m('hr'), m('div', [ - m('p[style = display: inline;]', app.translator.trans('therealsujitk.admin.about.stringA')), m('a', { href: 'https://github.com/therealsujitk', target: '_blank' }, '@therealsujitk'), + m('p[style = display: inline;]', app.translator.trans('therealsujitk.admin.about.stringA')), m('a', { href: 'https://therealsuji.tk/github', target: '_blank' }, '@therealsujitk'), m('br'), - m('p[style = display: inline;]', app.translator.trans('therealsujitk.admin.about.stringB')), m('a', { href: 'https://paypal.me/suchitrakumar', target: '_blank' }, 'PayPal') + m('p[style = display: inline;]', app.translator.trans('therealsujitk.admin.about.stringB')), m('a', { href: 'https://therealsuji.tk/donate', target: '_blank' }, 'PayPal') ]) ]) ]; diff --git a/js/src/admin/index.js b/js/src/admin/index.js old mode 100644 new mode 100755 diff --git a/js/src/forum/components/SearchGIFModal.js b/js/src/forum/components/SearchGIFModal.js old mode 100644 new mode 100755 index c2ede54..1c1f451 --- a/js/src/forum/components/SearchGIFModal.js +++ b/js/src/forum/components/SearchGIFModal.js @@ -89,12 +89,12 @@ export default class SearchGIFModal extends Modal { class: 'temp-text' }), m('div', [m('table[style = vertical-align: top; width: 100%;]',[ - m('td', [ + m('td[style = width: 100%;]', [ m('form[style = margin-right: 1.25%;]', { class: 'Search-input', onsubmit: () => { return false; }, - onkeyup: () => { - if(event.keyCode === 13) { + onkeyup: (e) => { + if(e.keyCode === 13) { lastResult = 0; document.getElementById('LeftResults').innerHTML = ''; document.getElementById('RightResults').innerHTML = ''; @@ -118,7 +118,7 @@ export default class SearchGIFModal extends Modal { ]) ]), m('td', [ - m('button[style = margin-left: 1.25%; width: 100%;]', { + m('button[style = margin-left: 1.25%;]', { class: 'Button Button--primary hasIcon', itemclassname: 'App-primaryControl', type: 'button', diff --git a/js/src/forum/index.js b/js/src/forum/index.js old mode 100644 new mode 100755 diff --git a/js/webpack.config.js b/js/webpack.config.js old mode 100644 new mode 100755 diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..48e341a --- /dev/null +++ b/package-lock.json @@ -0,0 +1,3 @@ +{ + "lockfileVersion": 1 +} diff --git a/resources/locale/en.yml b/resources/locale/en.yml old mode 100644 new mode 100755 diff --git a/src/Listeners/SaveSettings.php b/src/Listeners/SaveSettings.php old mode 100644 new mode 100755 index 0db6df7..75218dd --- a/src/Listeners/SaveSettings.php +++ b/src/Listeners/SaveSettings.php @@ -8,17 +8,15 @@ class SaveSettings { - protected $settings; + protected $settings; - public function __construct(SettingsRepositoryInterface $settings) - { - $this->settings = $settings; - } + public function __construct(SettingsRepositoryInterface $settings) { + $this->settings = $settings; + } - public function handle(Serializing $event) - { - if ($event->isSerializer(ForumSerializer::class)) { - $event->attributes['therealsujitk-gifs.giphy_api_key'] = $this->settings->get('therealsujitk-gifs.giphy_api_key'); - } - } + public function handle(Serializing $event) { + if ($event->isSerializer(ForumSerializer::class)) { + $event->attributes['therealsujitk-gifs.giphy_api_key'] = $this->settings->get('therealsujitk-gifs.giphy_api_key'); + } + } }