v1.3.10
This commit is contained in:
@@ -54658,7 +54658,7 @@ if (false) {}
|
||||
* @returns
|
||||
*/function MuiThemeProvider(_ref){var children=_ref.children,options=_ref.options;var darkMode=useDarkMode();var theme=(0,react.useMemo)(function(){return (0,createTheme/* default */.Z)(_objectSpread2({palette:{mode:darkMode?THEME_DARK:THEME_LIGHT}},options));},[darkMode,options]);return/*#__PURE__*/(0,jsx_runtime.jsxs)(esm_ThemeProvider_ThemeProvider,{theme:theme,children:[/*#__PURE__*/(0,jsx_runtime.jsx)(CssBaseline_CssBaseline,{}),children]});}
|
||||
;// CONCATENATED MODULE: ./src/views/Options/index.js
|
||||
function Options(){var _useState=(0,react.useState)(false),_useState2=(0,slicedToArray/* default */.Z)(_useState,2),error=_useState2[0],setError=_useState2[1];var _useState3=(0,react.useState)(false),_useState4=(0,slicedToArray/* default */.Z)(_useState3,2),ready=_useState4[0],setReady=_useState4[1];(0,react.useEffect)(function(){if(!isGm){return;}asyncToGenerator_asyncToGenerator(/*#__PURE__*/regeneratorRuntime_regeneratorRuntime().mark(function _callee(){var i;return regeneratorRuntime_regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:i=0;case 1:_context.next=3;return sleep(1000);case 3:if(!window.GM){_context.next=6;break;}setReady(true);return _context.abrupt("break",11);case 6:if(!(++i>8)){_context.next=9;break;}setError(true);return _context.abrupt("break",11);case 9:_context.next=1;break;case 11:case"end":return _context.stop();}},_callee);}))();},[]);if(error){return/*#__PURE__*/(0,jsx_runtime.jsxs)("center",{children:[/*#__PURE__*/(0,jsx_runtime.jsxs)("h2",{children:["Please confirm whether to install or enable"," ",/*#__PURE__*/(0,jsx_runtime.jsx)("a",{href:"https://kiss-translator.rayjar.com/options",children:"KISS Translator"})," ","GreaseMonkey script?"]}),/*#__PURE__*/(0,jsx_runtime.jsxs)("h2",{children:["or ",/*#__PURE__*/(0,jsx_runtime.jsx)("a",{href:"https://github.com/fishjar/kiss-translator",children:"click here"})," for help"]})]});}if(isGm&&!ready){return/*#__PURE__*/(0,jsx_runtime.jsx)("center",{children:/*#__PURE__*/(0,jsx_runtime.jsx)("h2",{children:"loading..."})});}return/*#__PURE__*/(0,jsx_runtime.jsx)(StoragesProvider,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(MuiThemeProvider,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(HashRouter,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(Routes,{children:/*#__PURE__*/(0,jsx_runtime.jsxs)(Route,{path:"/",element:/*#__PURE__*/(0,jsx_runtime.jsx)(Layout,{}),children:[/*#__PURE__*/(0,jsx_runtime.jsx)(Route,{index:true,element:/*#__PURE__*/(0,jsx_runtime.jsx)(Settings,{})}),/*#__PURE__*/(0,jsx_runtime.jsx)(Route,{path:"rules",element:/*#__PURE__*/(0,jsx_runtime.jsx)(Rules,{})}),/*#__PURE__*/(0,jsx_runtime.jsx)(Route,{path:"sync",element:/*#__PURE__*/(0,jsx_runtime.jsx)(SyncSetting,{})}),/*#__PURE__*/(0,jsx_runtime.jsx)(Route,{path:"about",element:/*#__PURE__*/(0,jsx_runtime.jsx)(About,{})})]})})})})});}
|
||||
function Options(){var _useState=(0,react.useState)(false),_useState2=(0,slicedToArray/* default */.Z)(_useState,2),error=_useState2[0],setError=_useState2[1];var _useState3=(0,react.useState)(false),_useState4=(0,slicedToArray/* default */.Z)(_useState3,2),ready=_useState4[0],setReady=_useState4[1];(0,react.useEffect)(function(){if(!isGm){return;}asyncToGenerator_asyncToGenerator(/*#__PURE__*/regeneratorRuntime_regeneratorRuntime().mark(function _callee(){var i;return regeneratorRuntime_regeneratorRuntime().wrap(function _callee$(_context){while(1)switch(_context.prev=_context.next){case 0:i=0;case 1:if(!(window.APP_NAME==="KISS Translator")){_context.next=4;break;}setReady(true);return _context.abrupt("break",11);case 4:if(!(++i>8)){_context.next=7;break;}setError(true);return _context.abrupt("break",11);case 7:_context.next=9;return sleep(1000);case 9:_context.next=1;break;case 11:case"end":return _context.stop();}},_callee);}))();},[]);if(error){return/*#__PURE__*/(0,jsx_runtime.jsxs)("center",{children:[/*#__PURE__*/(0,jsx_runtime.jsxs)("h2",{children:["Please confirm whether to install or enable"," ",/*#__PURE__*/(0,jsx_runtime.jsx)("a",{href:"https://github.com/fishjar/kiss-translator",children:"KISS Translator"})," ","GreaseMonkey script?"]}),/*#__PURE__*/(0,jsx_runtime.jsxs)("h2",{children:[/*#__PURE__*/(0,jsx_runtime.jsx)("a",{href:"https://kiss-translator.rayjar.com/kiss-translator.user.js",children:"Click here"})," ","to install, or ",/*#__PURE__*/(0,jsx_runtime.jsx)("a",{href:"https://github.com/fishjar/kiss-translator",children:"click here"})," ","for help."]})]});}if(isGm&&!ready){return/*#__PURE__*/(0,jsx_runtime.jsx)("center",{children:/*#__PURE__*/(0,jsx_runtime.jsx)(CircularProgress_CircularProgress,{})});}return/*#__PURE__*/(0,jsx_runtime.jsx)(StoragesProvider,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(MuiThemeProvider,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(HashRouter,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(Routes,{children:/*#__PURE__*/(0,jsx_runtime.jsxs)(Route,{path:"/",element:/*#__PURE__*/(0,jsx_runtime.jsx)(Layout,{}),children:[/*#__PURE__*/(0,jsx_runtime.jsx)(Route,{index:true,element:/*#__PURE__*/(0,jsx_runtime.jsx)(Settings,{})}),/*#__PURE__*/(0,jsx_runtime.jsx)(Route,{path:"rules",element:/*#__PURE__*/(0,jsx_runtime.jsx)(Rules,{})}),/*#__PURE__*/(0,jsx_runtime.jsx)(Route,{path:"sync",element:/*#__PURE__*/(0,jsx_runtime.jsx)(SyncSetting,{})}),/*#__PURE__*/(0,jsx_runtime.jsx)(Route,{path:"about",element:/*#__PURE__*/(0,jsx_runtime.jsx)(About,{})})]})})})})});}
|
||||
;// CONCATENATED MODULE: ./src/options.js
|
||||
var options_root=client.createRoot(document.getElementById("root"));options_root.render(/*#__PURE__*/(0,jsx_runtime.jsx)(react.StrictMode,{children:/*#__PURE__*/(0,jsx_runtime.jsx)(Options,{})}));
|
||||
}();
|
||||
|
||||
Reference in New Issue
Block a user