From 186ea27db81a86f346dff1e7d649e6f34d9bacd0 Mon Sep 17 00:00:00 2001 From: cyber-dream Date: Wed, 19 Jul 2023 04:35:17 +0300 Subject: [PATCH] Trys with mobile wde --- apps/sunboard/sunboard.go | 35 +++++++ front/src/wde/sunboard/sunboard-mobile.js | 56 ++++++++++- front/src/wde/wde-mobile.js | 20 +++- front/webpack.config.cjs | 6 ++ main.go | 3 + res/dev-fs/dist/mobile.js | 114 ++++++++++++++++++++++ res/dev-fs/dist/mobile_style.css | 49 ++++++++++ res/dev-fs/dist/mobile_style.js | 45 +++++++++ templates/base/mobile-desktop.html | 11 ++- templates/sunboard/sunboard.html | 6 ++ 10 files changed, 335 insertions(+), 10 deletions(-) create mode 100644 apps/sunboard/sunboard.go create mode 100644 res/dev-fs/dist/mobile.js create mode 100644 res/dev-fs/dist/mobile_style.css create mode 100644 res/dev-fs/dist/mobile_style.js create mode 100644 templates/sunboard/sunboard.html diff --git a/apps/sunboard/sunboard.go b/apps/sunboard/sunboard.go new file mode 100644 index 0000000..ade7b99 --- /dev/null +++ b/apps/sunboard/sunboard.go @@ -0,0 +1,35 @@ +package sunboard + +import ( + "net/http" + "personalwebsite/webfilesystem" + + "github.com/gin-gonic/gin" +) + +type SunboardApp struct { + fs *webfilesystem.WebFileSystem + appID string +} + +func NewSunboardApp(webFs *webfilesystem.WebFileSystem) *SunboardApp { + newApp := SunboardApp{ + fs: webFs, + appID: "Sunboard", + } + return &newApp +} + +func (a *SunboardApp) GetAppID() string { + return a.appID +} + +func (a *SunboardApp) PublicRoutes(route *gin.RouterGroup) { +} + +func (a *SunboardApp) PrivateRoutes(router *gin.RouterGroup) { + + router.POST("render", func(ctx *gin.Context) { + ctx.HTML(http.StatusOK, "sunboard/sunboard.html", gin.H{}) + }) +} diff --git a/front/src/wde/sunboard/sunboard-mobile.js b/front/src/wde/sunboard/sunboard-mobile.js index 18a34e0..0a43488 100644 --- a/front/src/wde/sunboard/sunboard-mobile.js +++ b/front/src/wde/sunboard/sunboard-mobile.js @@ -1,7 +1,59 @@ +import MobileWebDesktopEnvironment from "../wde-mobile.js" + export default class MobileDesktop{ /**@type {Element} */ #icons - constructor(){ - this.#icons = document.body.querySelector("") + /** @type {MobileWebDesktopEnvironment} */ + #wde + constructor(wde){ + this.#wde = wde + this.load() + } + + async load(){ + this.createMainDivs() + } + + async createMainDivs(){ + let sunboardNode = document.body.querySelector("#mobile-sunboard") + if (sunboardNode == null){ + // this.#wde.Alert("Desktop node not found") + return + } + + const params = new URLSearchParams({ + // path: args[0] //FIXME + path: "/" + }) + const response = await fetch(`/app/Sunboard/render?` + params, + { + method: "POST", + // body: JSON.stringify(runContext) + }) + if (response.status != 200){ + console.log(response.status) + // this.#wde.Alert("Error in render desktop") //TODO + return + } + const html = await response.text() + sunboardNode.innerHTML = html + + console.log(this.#wde.FileView) + + let iconsNode = document.body.querySelector("#icons") + + this.fileView = new this.#wde.FileView( + iconsNode, + (event) =>{}, + (event) => { }, + (event, draggedElem) => {}, + () => { } + ) + // this.RenderDir(args[0]) + return + } + + async createFileView(){ + } } \ No newline at end of file diff --git a/front/src/wde/wde-mobile.js b/front/src/wde/wde-mobile.js index 5aaa9e0..1d42c15 100644 --- a/front/src/wde/wde-mobile.js +++ b/front/src/wde/wde-mobile.js @@ -1,10 +1,22 @@ -// import MobileDecorat from "../Decorat/mobile-decorat" - +import MobileDecorat from "./decorat/mobile-decorat.js" +import MobileSunboard from "./sunboard/sunboard-mobile.js" +import WDEFileView from "./widgets/file-view/file-view.js" export default class MobileWebDesktopEnvironment{ /** @type {MobileDecorat} */ - #decorat + Decorat + /** @type {WDEFileView} */ + FileView + /** @type {MobileSunboard} */ + #sunBoard constructor(){ document.body.style.setProperty('--zoom', 3) - // this.#decorat = new MobileDecorat() + this.Decorat = new MobileDecorat() + this.FileView = WDEFileView + this.#sunBoard = new MobileSunboard(this) + this.#sunBoard + } + + loadWDE(){ + } } \ No newline at end of file diff --git a/front/webpack.config.cjs b/front/webpack.config.cjs index 65b4342..051a90e 100644 --- a/front/webpack.config.cjs +++ b/front/webpack.config.cjs @@ -19,6 +19,12 @@ const config = { desktop_style: [ "./src/desktop.less", ], + mobile: [ + './src/wde/wde-mobile.js', + ], + mobile_style: [ + "./src/mobile.less", + ], finder : [ './src/apps/finder/finder.js', ], diff --git a/main.go b/main.go index f1030b6..fcd9efd 100644 --- a/main.go +++ b/main.go @@ -12,6 +12,7 @@ import ( "personalwebsite/apps/blogviewer" "personalwebsite/apps/finder" imgviewer "personalwebsite/apps/img-viewer" + "personalwebsite/apps/sunboard" "personalwebsite/routes" "personalwebsite/wde" "personalwebsite/webfilesystem" @@ -72,11 +73,13 @@ func main() { imgViewerApp := imgviewer.NewImgViewerApp(webfs) blogViewerApp := blogviewer.NewBlogViewerApp(webfs) blogWriterApp := blogwriter.NewBlogWriterApp(webfs) + sunBoardApp := sunboard.NewSunboardApp(webfs) appsStorage.Apps["personal-properties"] = persPropsApp appsStorage.Apps["finder"] = finderApp appsStorage.Apps["img-viewer"] = imgViewerApp appsStorage.Apps[blogViewerApp.GetAppID()] = blogViewerApp appsStorage.Apps["BlogWriter"] = blogWriterApp + appsStorage.Apps["Sunboard"] = sunBoardApp go routes.PublicRoutes(publicPort, webfs, webde, appsStorage) routes.PrivateRoutes(privatePort, webfs, webde, appsStorage) diff --git a/res/dev-fs/dist/mobile.js b/res/dev-fs/dist/mobile.js new file mode 100644 index 0000000..9a913ab --- /dev/null +++ b/res/dev-fs/dist/mobile.js @@ -0,0 +1,114 @@ +/* + * 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/). + */ +/******/ var __webpack_modules__ = ({ + +/***/ "./src/wde/decorat/mobile-decorat.js": +/*!*******************************************!*\ + !*** ./src/wde/decorat/mobile-decorat.js ***! + \*******************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ MobileDecorat)\n/* harmony export */ });\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, 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 _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nvar MobileDecorat = /*#__PURE__*/_createClass(function MobileDecorat() {\n _classCallCheck(this, MobileDecorat);\n});\n\n\n//# sourceURL=webpack://my-webpack-project/./src/wde/decorat/mobile-decorat.js?"); + +/***/ }), + +/***/ "./src/wde/sunboard/sunboard-mobile.js": +/*!*********************************************!*\ + !*** ./src/wde/sunboard/sunboard-mobile.js ***! + \*********************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ MobileDesktop)\n/* harmony export */ });\n/* harmony import */ var _wde_mobile_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../wde-mobile.js */ \"./src/wde/wde-mobile.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 _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, \"_invoke\", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, \"throw\" === context.method) { if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel; context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, \"catch\": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\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, 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 _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\nfunction _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"get\"); return _classApplyDescriptorGet(receiver, descriptor); }\nfunction _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\n\nvar _icons = /*#__PURE__*/new WeakMap();\nvar _wde = /*#__PURE__*/new WeakMap();\nvar MobileDesktop = /*#__PURE__*/function () {\n /**@type {Element} */\n\n /** @type {MobileWebDesktopEnvironment} */\n\n function MobileDesktop(wde) {\n _classCallCheck(this, MobileDesktop);\n _classPrivateFieldInitSpec(this, _icons, {\n writable: true,\n value: void 0\n });\n _classPrivateFieldInitSpec(this, _wde, {\n writable: true,\n value: void 0\n });\n _classPrivateFieldSet(this, _wde, wde);\n this.load();\n }\n _createClass(MobileDesktop, [{\n key: \"load\",\n value: function () {\n var _load = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n this.createMainDivs();\n case 1:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n function load() {\n return _load.apply(this, arguments);\n }\n return load;\n }()\n }, {\n key: \"createMainDivs\",\n value: function () {\n var _createMainDivs = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var sunboardNode, params, response, html, iconsNode;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n sunboardNode = document.body.querySelector(\"#mobile-sunboard\");\n if (!(sunboardNode == null)) {\n _context2.next = 3;\n break;\n }\n return _context2.abrupt(\"return\");\n case 3:\n params = new URLSearchParams({\n // path: args[0] //FIXME\n path: \"/\"\n });\n _context2.next = 6;\n return fetch(\"/app/Sunboard/render?\" + params, {\n method: \"POST\"\n // body: JSON.stringify(runContext)\n });\n case 6:\n response = _context2.sent;\n if (!(response.status != 200)) {\n _context2.next = 10;\n break;\n }\n console.log(response.status);\n // this.#wde.Alert(\"Error in render desktop\") //TODO\n return _context2.abrupt(\"return\");\n case 10:\n _context2.next = 12;\n return response.text();\n case 12:\n html = _context2.sent;\n sunboardNode.innerHTML = html;\n console.log(_classPrivateFieldGet(this, _wde).FileView);\n iconsNode = document.body.querySelector(\"#icons\");\n this.fileView = new (_classPrivateFieldGet(this, _wde).FileView)(iconsNode, function (event) {}, function (event) {}, function (event, draggedElem) {}, function () {});\n // this.RenderDir(args[0])\n return _context2.abrupt(\"return\");\n case 18:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n function createMainDivs() {\n return _createMainDivs.apply(this, arguments);\n }\n return createMainDivs;\n }()\n }, {\n key: \"createFileView\",\n value: function () {\n var _createFileView = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n function createFileView() {\n return _createFileView.apply(this, arguments);\n }\n return createFileView;\n }()\n }]);\n return MobileDesktop;\n}();\n\n\n//# sourceURL=webpack://my-webpack-project/./src/wde/sunboard/sunboard-mobile.js?"); + +/***/ }), + +/***/ "./src/wde/wde-mobile.js": +/*!*******************************!*\ + !*** ./src/wde/wde-mobile.js ***! + \*******************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ MobileWebDesktopEnvironment)\n/* harmony export */ });\n/* harmony import */ var _decorat_mobile_decorat_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./decorat/mobile-decorat.js */ \"./src/wde/decorat/mobile-decorat.js\");\n/* harmony import */ var _sunboard_sunboard_mobile_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./sunboard/sunboard-mobile.js */ \"./src/wde/sunboard/sunboard-mobile.js\");\n/* harmony import */ var _widgets_file_view_file_view_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./widgets/file-view/file-view.js */ \"./src/wde/widgets/file-view/file-view.js\");\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, 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 _classPrivateFieldInitSpec(obj, privateMap, value) { _checkPrivateRedeclaration(obj, privateMap); privateMap.set(obj, value); }\nfunction _checkPrivateRedeclaration(obj, privateCollection) { if (privateCollection.has(obj)) { throw new TypeError(\"Cannot initialize the same private elements twice on an object\"); } }\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _classPrivateFieldGet(receiver, privateMap) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"get\"); return _classApplyDescriptorGet(receiver, descriptor); }\nfunction _classApplyDescriptorGet(receiver, descriptor) { if (descriptor.get) { return descriptor.get.call(receiver); } return descriptor.value; }\nfunction _classPrivateFieldSet(receiver, privateMap, value) { var descriptor = _classExtractFieldDescriptor(receiver, privateMap, \"set\"); _classApplyDescriptorSet(receiver, descriptor, value); return value; }\nfunction _classExtractFieldDescriptor(receiver, privateMap, action) { if (!privateMap.has(receiver)) { throw new TypeError(\"attempted to \" + action + \" private field on non-instance\"); } return privateMap.get(receiver); }\nfunction _classApplyDescriptorSet(receiver, descriptor, value) { if (descriptor.set) { descriptor.set.call(receiver, value); } else { if (!descriptor.writable) { throw new TypeError(\"attempted to set read only private field\"); } descriptor.value = value; } }\n\n\n\nvar _sunBoard = /*#__PURE__*/new WeakMap();\nvar MobileWebDesktopEnvironment = /*#__PURE__*/function () {\n /** @type {MobileDecorat} */\n\n /** @type {WDEFileView} */\n\n /** @type {MobileSunboard} */\n\n function MobileWebDesktopEnvironment() {\n _classCallCheck(this, MobileWebDesktopEnvironment);\n _defineProperty(this, \"Decorat\", void 0);\n _defineProperty(this, \"FileView\", void 0);\n _classPrivateFieldInitSpec(this, _sunBoard, {\n writable: true,\n value: void 0\n });\n document.body.style.setProperty('--zoom', 3);\n this.Decorat = new _decorat_mobile_decorat_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n this.FileView = _widgets_file_view_file_view_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\n _classPrivateFieldSet(this, _sunBoard, new _sunboard_sunboard_mobile_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"](this));\n _classPrivateFieldGet(this, _sunBoard);\n }\n _createClass(MobileWebDesktopEnvironment, [{\n key: \"loadWDE\",\n value: function loadWDE() {}\n }]);\n return MobileWebDesktopEnvironment;\n}();\n\n\n//# sourceURL=webpack://my-webpack-project/./src/wde/wde-mobile.js?"); + +/***/ }), + +/***/ "./src/wde/widgets/file-view/file-view.js": +/*!************************************************!*\ + !*** ./src/wde/widgets/file-view/file-view.js ***! + \************************************************/ +/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"default\": () => (/* binding */ WDEFileView)\n/* harmony export */ });\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 _regeneratorRuntime() { \"use strict\"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = \"function\" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || \"@@iterator\", asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\", toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, \"\"); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, \"_invoke\", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: \"normal\", arg: fn.call(obj, arg) }; } catch (err) { return { type: \"throw\", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { [\"next\", \"throw\", \"return\"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if (\"throw\" !== record.type) { var result = record.arg, value = result.value; return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke(\"next\", value, resolve, reject); }, function (err) { invoke(\"throw\", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke(\"throw\", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, \"_invoke\", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = \"suspendedStart\"; return function (method, arg) { if (\"executing\" === state) throw new Error(\"Generator is already running\"); if (\"completed\" === state) { if (\"throw\" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) { if (\"suspendedStart\" === state) throw state = \"completed\", context.arg; context.dispatchException(context.arg); } else \"return\" === context.method && context.abrupt(\"return\", context.arg); state = \"executing\"; var record = tryCatch(innerFn, self, context); if (\"normal\" === record.type) { if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var method = delegate.iterator[context.method]; if (undefined === method) { if (context.delegate = null, \"throw\" === context.method) { if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel; context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\"); } return ContinueSentinel; } var record = tryCatch(method, delegate.iterator, context.arg); if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = \"normal\", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: \"root\" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if (\"function\" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) { if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; } return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) { var ctor = \"function\" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, \"toString\", function () { return \"[object Generator]\"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) { keys.push(key); } return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) { \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); } }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if (\"throw\" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if (\"root\" === entry.tryLoc) return handle(\"end\"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, \"catchLoc\"), hasFinally = hasOwn.call(entry, \"finallyLoc\"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error(\"try statement without catch or finally\"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if (\"throw\" === record.type) throw record.arg; return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, \"catch\": function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if (\"throw\" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }\nfunction asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }\nfunction _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err); } _next(undefined); }); }; }\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, 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 _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nvar WDEFileView = /*#__PURE__*/function () {\n /**\n * @param {HTMLElement} fileViewElem\n * @param {Function} doubleClickCallback\n * @param {Function} rightClickCallback\n * @param {Function} updateFileViewCallback\n */\n function WDEFileView(fileViewElem, doubleClickCallback, rightClickCallback, fileUploadCallback, updateFileViewCallback) {\n var _this = this;\n _classCallCheck(this, WDEFileView);\n _defineProperty(this, \"path\", \"\");\n _defineProperty(this, \"parentElem\", undefined);\n _defineProperty(this, \"selected\", []);\n //TODO check all params\n this.parentElem = fileViewElem;\n fileViewElem.addEventListener('click', function (event) {\n if (event.target.classList[0] == 'FileTileView') {\n _this.DeselectAll();\n return;\n }\n if (event.detail === 1) {\n _this.DeselectAll();\n _this.Select([event.target]);\n } else if (event.detail === 2) {\n doubleClickCallback(event);\n }\n });\n fileViewElem.addEventListener('contextmenu', function (event) {\n event.preventDefault();\n if (event.target.classList.contains(\"Tile\")) {\n _this.DeselectAll();\n _this.Select([event.target]);\n }\n _this.Select([event.target]);\n rightClickCallback(event);\n });\n if (fileUploadCallback !== undefined) {\n var counter = 0;\n var draggedElem = undefined;\n fileViewElem.addEventListener('dragstart', function (event) {\n // console.log(event.target)\n // console.log(this.path)\n // draggedElem = event.target\n event.dataTransfer.setData(\"fileName\", event.target.getAttribute(\"name\"));\n event.dataTransfer.setData(\"filePath\", _this.path + \"/\" + event.target.getAttribute(\"name\"));\n event.dataTransfer.setData(\"dropType\", \"move\");\n // console.log(updateFileViewCallback)\n // event.dataTransfer.setData(\"updateCallback\", updateFileViewCallback)\n // event.dataTransfer.setData(\"fileName\", )\n // console.log(draggedElem)\n });\n\n fileViewElem.addEventListener('dragenter', function (event) {\n event.preventDefault();\n counter++;\n fileViewElem.classList.add(\"DragDropBorder\");\n });\n fileViewElem.addEventListener('dragend', function (event) {\n // console.log(fileViewElem)\n event.preventDefault();\n counter--;\n if (counter === 0) {\n fileViewElem.classList.remove(\"DragDropBorder\");\n }\n // updateFileViewCallback()\n // draggedElem = undefined\n });\n\n fileViewElem.addEventListener('dragleave', function (event) {\n // console.log(fileViewElem)\n event.preventDefault();\n counter--;\n if (counter === 0) {\n fileViewElem.classList.remove(\"DragDropBorder\");\n }\n // draggedElem = undefined\n });\n\n fileViewElem.addEventListener('dragover', function (event) {\n event.preventDefault();\n });\n fileViewElem.addEventListener(\"drop\", function (event) {\n event.preventDefault();\n fileUploadCallback(event);\n fileViewElem.classList.remove(\"DragDropBorder\");\n // updateFileViewCallback()\n // this.OpenFolder(this.path)\n // draggedElem = undefined\n });\n }\n }\n\n /** \n * @param {[]Element} elements\n */\n _createClass(WDEFileView, [{\n key: \"Select\",\n value: function Select(elements) {\n var _this2 = this;\n elements.forEach(function (element) {\n _this2.selected.push(element);\n element.classList.add(\"Selected\");\n });\n }\n }, {\n key: \"DeselectAll\",\n value: function DeselectAll() {\n this.selected.forEach(function (element) {\n element.classList.remove(\"Selected\");\n });\n this.selected = [];\n }\n\n /** Get html of folder by path\n * @param {string} path\n */\n }, {\n key: \"OpenFolder\",\n value: function () {\n var _OpenFolder = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(path) {\n var params, response, html;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n this.path = path;\n params = new URLSearchParams({\n path: path\n });\n _context.next = 4;\n return fetch(\"/system/wde/widgets/file-tile-view?\" + params);\n case 4:\n response = _context.sent;\n if (!(response.status != 200)) {\n _context.next = 8;\n break;\n }\n //TODO Error text message\n WebDesktopEnvironment.Alert(\"TODO\");\n return _context.abrupt(\"return\");\n case 8:\n _context.next = 10;\n return response.text();\n case 10:\n html = _context.sent;\n this.parentElem.innerHTML = html;\n case 12:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n function OpenFolder(_x) {\n return _OpenFolder.apply(this, arguments);\n }\n return OpenFolder;\n }()\n }]);\n return WDEFileView;\n}();\n\n\n//# sourceURL=webpack://my-webpack-project/./src/wde/widgets/file-view/file-view.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 is referenced by other modules so it can't be inlined +/******/ var __webpack_exports__ = __webpack_require__("./src/wde/wde-mobile.js"); +/******/ var __webpack_exports__default = __webpack_exports__["default"]; +/******/ export { __webpack_exports__default as default }; +/******/ diff --git a/res/dev-fs/dist/mobile_style.css b/res/dev-fs/dist/mobile_style.css new file mode 100644 index 0000000..1bc992f --- /dev/null +++ b/res/dev-fs/dist/mobile_style.css @@ -0,0 +1,49 @@ +/*!**********************************************************************************************************!*\ + !*** css ./node_modules/css-loader/dist/cjs.js!./node_modules/less-loader/dist/cjs.js!./src/mobile.less ***! + \**********************************************************************************************************/ +.WdePrimitives.AdjectiveElement, +#down-bar { + border: 1px solid #555555; +} +#mobile-sunboard { + width: 100%; + height: 100%; + /* Auto layout */ + display: flex; + flex-direction: column; + align-items: flex-start; + justify-content: flex-start; +} +#icons { + width: 100%; + height: 100%; + background-color: #9999CC; +} +#down-bar { + width: 100%; + height: 150px; + background-color: #C0C0C0; +} +body { + zoom: var(--zoom); + position: absolute; + width: 100%; + height: 100%; + margin: 0px; + /* font: normal 14px Summer Pixel 22, "res/SummerPixel22Regular.ttf"; */ + -webkit-touch-callout: none; + /* iOS Safari */ + -webkit-user-select: none; + /* Safari */ + -khtml-user-select: none; + /* Konqueror HTML */ + -moz-user-select: none; + /* Old versions of Firefox */ + -ms-user-select: none; + /* Internet Explorer/Edge */ + user-select: none; + /* Non-prefixed version, currently + supported by Chrome, Edge, Opera and Firefox */ + touch-action: manipulation; +} + diff --git a/res/dev-fs/dist/mobile_style.js b/res/dev-fs/dist/mobile_style.js new file mode 100644 index 0000000..c2cd09d --- /dev/null +++ b/res/dev-fs/dist/mobile_style.js @@ -0,0 +1,45 @@ +/* + * 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/). + */ +/******/ var __webpack_modules__ = ({ + +/***/ "./src/mobile.less": +/*!*************************!*\ + !*** ./src/mobile.less ***! + \*************************/ +/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => { + +eval("__webpack_require__.r(__webpack_exports__);\n// extracted by mini-css-extract-plugin\n\n\n//# sourceURL=webpack://my-webpack-project/./src/mobile.less?"); + +/***/ }) + +/******/ }); +/************************************************************************/ +/******/ // The require scope +/******/ var __webpack_require__ = {}; +/******/ +/************************************************************************/ +/******/ /* 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_modules__["./src/mobile.less"](0, __webpack_exports__, __webpack_require__); +/******/ diff --git a/templates/base/mobile-desktop.html b/templates/base/mobile-desktop.html index fc1d9ed..7228ca9 100644 --- a/templates/base/mobile-desktop.html +++ b/templates/base/mobile-desktop.html @@ -2,13 +2,16 @@ Greg Brzezinski - - + + +
-
-
diff --git a/templates/sunboard/sunboard.html b/templates/sunboard/sunboard.html new file mode 100644 index 0000000..f5da345 --- /dev/null +++ b/templates/sunboard/sunboard.html @@ -0,0 +1,6 @@ +{{ define "sunboard/sunboard.html" }} +
+
+{{ end }} + +