|
|
|
/*
|
|
|
|
* ATTENTION: The "eval" devtool has been used (maybe by default in mode: "development").
|
|
|
|
* This devtool is neither made for production nor for readable output files.
|
|
|
|
* It uses "eval()" calls to create a separate source file in the browser devtools.
|
|
|
|
* If you are trying to read the output file, select a different devtool (https://webpack.js.org/configuration/devtool/)
|
|
|
|
* or disable the default devtool with "devtool: false".
|
|
|
|
* If you are looking for production-ready output files, see mode: "production" (https://webpack.js.org/configuration/mode/).
|
|
|
|
*/
|
|
|
|
/******/ (() => { // webpackBootstrap
|
|
|
|
/******/ "use strict";
|
|
|
|
/******/ var __webpack_modules__ = ({
|
|
|
|
|
|
|
|
/***/ "./src/discover/ext.isekai.discover.js":
|
|
|
|
/*!*********************************************!*\
|
|
|
|
!*** ./src/discover/ext.isekai.discover.js ***!
|
|
|
|
\*********************************************/
|
|
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
|
|
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _moduleRegister__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../moduleRegister */ \"./src/moduleRegister.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\n\nvar DiscoverWidget = /*#__PURE__*/function () {\n function DiscoverWidget(dom) {\n _classCallCheck(this, DiscoverWidget);\n this.baseDom = dom;\n this.pageUrl = null;\n this.api = new mw.Api();\n this.initDom();\n this.refreshPage();\n }\n _createClass(DiscoverWidget, [{\n key: \"initDom\",\n value: function initDom() {\n this.reloadButton = new OO.ui.ButtonWidget({\n icon: 'reload',\n label: mw.message('isekai-discover-change-btn').parse()\n });\n this.reloadButton.on('click', this.refreshPage.bind(this));\n this.readMoreButton = new OO.ui.ButtonWidget({\n icon: 'ellipsis',\n label: mw.message('isekai-discover-readmore-btn').parse(),\n flags: ['primary', 'progressive']\n });\n this.readMoreButton.on('click', this.showMore.bind(this));\n this.loadingBar = new OO.ui.ProgressBarWidget({\n progress: false\n });\n this.baseDom.find('.card-body .loading .spinner').append(this.loadingBar.$element);\n this.buttonGroup = new OO.ui.ButtonGroupWidget({\n items: [this.reloadButton, this.readMoreButton]\n });\n this.baseDom.find('.card-header .card-header-buttons').append(this.buttonGroup.$element);\n this.loading = this.baseDom.find('.card-body .loading');\n this.title = this.baseDom.find('.card-body .card-title');\n this.contentContainer = this.baseDom.find('.card-body .card-content');\n }\n }, {\n key: \"showMore\",\n value: function showMore() {\n if (this.pageUrl) {\n //页面存在就跳转\n window.open(this.pageUrl);\n }\n }\n }, {\n key: \"refreshPage\",\n value: function refreshPage() {\n var _this = this;\n this.pageUrl = null;\n this.clearContent();\n this.showLoading();\n this.getRandomPage().then(function (title) {\n _this.loadPage(title);\n });\n }\n }, {\n key: \"setTitle\",\n value: function setTitle(title) {\n this.title.text(title);\n }\n }, {\n key: \"showLoading\",\n value: function showLoading() {\n this.loading.show();\n this.contentContainer.hide();\n }\n }, {\n key: \"hideLoading\",\n value: function hideLoading() {
|
|
|
|
|
|
|
|
/***/ }),
|
|
|
|
|
|
|
|
/***/ "./src/moduleRegister.js":
|
|
|
|
/*!*******************************!*\
|
|
|
|
!*** ./src/moduleRegister.js ***!
|
|
|
|
\*******************************/
|
|
|
|
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
|
|
|
|
|
|
|
|
eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"registerModule\": () => (/* binding */ registerModule)\n/* harmony export */ });\nfunction registerModule(namespace, func) {\n var nsList = namespace.split('.');\n if (!('isekai' in window)) {\n window.isekai = {};\n }\n var obj = window.isekai;\n for (var i = 0; i < nsList.length - 1; i++) {\n var ns = nsList[i];\n if (!(ns in obj)) {\n obj[ns] = {};\n }\n obj = obj[ns];\n }\n obj[nsList[i]] = func;\n}\n\n//# sourceURL=webpack://isekai-widgets/./src/moduleRegister.js?");
|
|
|
|
|
|
|
|
/***/ })
|
|
|
|
|
|
|
|
/******/ });
|
|
|
|
/************************************************************************/
|
|
|
|
/******/ // The module cache
|
|
|
|
/******/ var __webpack_module_cache__ = {};
|
|
|
|
/******/
|
|
|
|
/******/ // The require function
|
|
|
|
/******/ function __webpack_require__(moduleId) {
|
|
|
|
/******/ // Check if module is in cache
|
|
|
|
/******/ var cachedModule = __webpack_module_cache__[moduleId];
|
|
|
|
/******/ if (cachedModule !== undefined) {
|
|
|
|
/******/ return cachedModule.exports;
|
|
|
|
/******/ }
|
|
|
|
/******/ // Create a new module (and put it into the cache)
|
|
|
|
/******/ var module = __webpack_module_cache__[moduleId] = {
|
|
|
|
/******/ // no module.id needed
|
|
|
|
/******/ // no module.loaded needed
|
|
|
|
/******/ exports: {}
|
|
|
|
/******/ };
|
|
|
|
/******/
|
|
|
|
/******/ // Execute the module function
|
|
|
|
/******/ __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
|
|
|
|
/******/
|
|
|
|
/******/ // Return the exports of the module
|
|
|
|
/******/ return module.exports;
|
|
|
|
/******/ }
|
|
|
|
/******/
|
|
|
|
/************************************************************************/
|
|
|
|
/******/ /* webpack/runtime/define property getters */
|
|
|
|
/******/ (() => {
|
|
|
|
/******/ // define getter functions for harmony exports
|
|
|
|
/******/ __webpack_require__.d = (exports, definition) => {
|
|
|
|
/******/ for(var key in definition) {
|
|
|
|
/******/ if(__webpack_require__.o(definition, key) && !__webpack_require__.o(exports, key)) {
|
|
|
|
/******/ Object.defineProperty(exports, key, { enumerable: true, get: definition[key] });
|
|
|
|
/******/ }
|
|
|
|
/******/ }
|
|
|
|
/******/ };
|
|
|
|
/******/ })();
|
|
|
|
/******/
|
|
|
|
/******/ /* webpack/runtime/hasOwnProperty shorthand */
|
|
|
|
/******/ (() => {
|
|
|
|
/******/ __webpack_require__.o = (obj, prop) => (Object.prototype.hasOwnProperty.call(obj, prop))
|
|
|
|
/******/ })();
|
|
|
|
/******/
|
|
|
|
/******/ /* webpack/runtime/make namespace object */
|
|
|
|
/******/ (() => {
|
|
|
|
/******/ // define __esModule on exports
|
|
|
|
/******/ __webpack_require__.r = (exports) => {
|
|
|
|
/******/ if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
|
|
|
|
/******/ Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
|
|
/******/ }
|
|
|
|
/******/ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
|
/******/ };
|
|
|
|
/******/ })();
|
|
|
|
/******/
|
|
|
|
/************************************************************************/
|
|
|
|
/******/
|
|
|
|
/******/ // startup
|
|
|
|
/******/ // Load entry module and return exports
|
|
|
|
/******/ // This entry module can't be inlined because the eval devtool is used.
|
|
|
|
/******/ var __webpack_exports__ = __webpack_require__("./src/discover/ext.isekai.discover.js");
|
|
|
|
/******/
|
|
|
|
/******/ })()
|
|
|
|
;
|