diff --git a/.DS_Store b/.DS_Store index 184fe33e45848f06514e42e7f79cd9167f7ce56a..e75ffaac435e1d04bb932e3d5b5e49dbeff3538b 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/client/currentProjects/currentProjects.js b/client/currentProjects/currentProjects.js index 047b1a0d44a847a0cbefad7d04e48536ba2e5a59..ca90dd16537c42a698f3690a071a8f901e1cd464 100644 --- a/client/currentProjects/currentProjects.js +++ b/client/currentProjects/currentProjects.js @@ -131,6 +131,7 @@ function getProjects(selectElement, listenersLoaded) { }); } function addEventListener(listenersLoaded, projectId, card) { + const currentStage = card.stage; if (!listenersLoaded) { $(document).on('click', '#' + projectId, function (event) { const element = event.target; @@ -144,7 +145,6 @@ function addEventListener(listenersLoaded, projectId, card) { } } else if (element.classList.contains('projectButton')) { - const currentStage = card.stage; if (currentStage === 'Agera') { loadProjectPageA(projectId); } diff --git a/client/currentProjects/currentProjects.ts b/client/currentProjects/currentProjects.ts index 725d4b89f8664ce99b475df70a73af6b0e6e4b12..e5cc1196e75cf837a777dd4958131c908ed9f4c1 100644 --- a/client/currentProjects/currentProjects.ts +++ b/client/currentProjects/currentProjects.ts @@ -144,6 +144,7 @@ async function getProjects (selectElement : Element, listenersLoaded:boolean) { } function addEventListener(listenersLoaded:boolean, projectId:string, card:projectCard) { + const currentStage = card.stage; if(!listenersLoaded) { $(document).on('click', '#'+projectId, function(event) { const element = event.target as HTMLElement; @@ -155,7 +156,6 @@ function addEventListener(listenersLoaded:boolean, projectId:string, card:projec card.closeMoreInfo(`expandedOngoingWorkCard`+projectId, `ongoingSeeDetailsButton`+projectId); } } else if (element.classList.contains('projectButton')){ - const currentStage = card.stage; if (currentStage === 'Agera') { loadProjectPageA(projectId); } else if (currentStage === 'Studera') { diff --git a/client/dist/currentProjects.bundle.js b/client/dist/currentProjects.bundle.js index 8a7f2ce4aab309755daf756aecce2573bfa763a1..7703060e86ec25d9eaf5bd736e79467c87749240 100644 --- a/client/dist/currentProjects.bundle.js +++ b/client/dist/currentProjects.bundle.js @@ -256,7 +256,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \***************************************************/ /***/ ((__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 */ loadPage: () => (/* binding */ loadPage)\n/* harmony export */ });\n/* harmony import */ var _Database_database_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Database/database.js */ \"./client/Database/database.js\");\n/* harmony import */ var _SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../SidebarAndHeader/pageHandler.js */ \"./client/SidebarAndHeader/pageHandler.js\");\n\n\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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\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); }\nvar __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\nvar projectCards = {};\nvar projectCard = /*#__PURE__*/function () {\n function projectCard(id, name, department, title, description, projectId, currentStage) {\n _classCallCheck(this, projectCard);\n this.name = name;\n this.department = department;\n this.title = title;\n this.description = description;\n this.id = id;\n this.projectId = projectId;\n this.stage = currentStage;\n }\n _createClass(projectCard, [{\n key: \"showMoreInfo\",\n value: function showMoreInfo(blockId, thisTextId) {\n var blockElement = document.getElementById(blockId);\n if (blockElement) {\n blockElement.style.display = \"flex\";\n }\n var textElement = document.getElementById(thisTextId);\n if (textElement) {\n textElement.innerText = '^ Stäng detaljer';\n }\n }\n }, {\n key: \"closeMoreInfo\",\n value: function closeMoreInfo(blockId, thisTextId) {\n var blockElement = document.getElementById(blockId);\n if (blockElement) {\n blockElement.style.display = \"none\";\n }\n var textElement = document.getElementById(thisTextId);\n if (textElement) {\n textElement.innerText = '> Mer information';\n }\n }\n }, {\n key: \"loadInitiatePage\",\n value: function loadInitiatePage() {\n alert('The initiate project page should now be loaded');\n }\n }, {\n key: \"generateHTML\",\n value: function generateHTML() {\n return \"<div class=\\\"totalExpandedOngoingWorkCard\\\">\\n <div style=\\\"cursor: pointer;\\\" class=\\\"flex-container ongoingCard\\\" id=\\\"\".concat(this.projectId, \"\\\">\\n <div class=\\\"ongoingCardImageContainer toSinglePage\\\">\\n <div class = \\\"flex-box ongoingCardImage toSinglePage\\\" id=\\\"pinkFaded\\\"></div>\\n </div>\\n <div class=\\\"div ongoingCardInfo toSinglePage\\\">\\n <p class=\\\"toSinglePage\\\" id=\\\"ongoingCardManager\\\">\").concat(this.name, \"</p>\\n <p class=\\\"toSinglePage\\\" id=\\\"ongoingCardDepartment\\\">\").concat(this.department, \"</p>\\n <p class=\\\"toSinglePage\\\" id=\\\"ongoingCardIdeaTitle\\\">\").concat(this.title, \"</p>\\n </div>\\n\\n <button data-project-id=\\\"\").concat(this.id, \"\\\" class=\\\"projectButton\\\" role=\\\"button\\\">G\\xE5 till projektsidan</button>\\n\\n <div class=\\\"statusText\\\">\\n Status: \").concat(this.stage, \"\\n </div>\\n <div class=\\\"container ongoingSeeCardDetails toSinglePage\\\">\\n <div class=\\\"ongoingSeeCardDetailsInner\\\">\\n <p id=\\\"ongoingSeeDetailsButton\").concat(this.projectId, \"\\\" class = \\\"moreInfoClass\\\">> Mer information</p>\\n </div>\\n </div>\\n </div> \\n <div class = \\\"expandedOngoingWorkCard\\\" id=\\\"expandedOngoingWorkCard\").concat(this.projectId, \"\\\" style=\\\"display: none;\\\">\\n <div class =\\\"expandedTextOngoingWorkCard\\\">\\n \").concat(this.description, \"\\n </div>\\n </div>\\n </div> \");\n }\n }]);\n return projectCard;\n}();\nfunction loadPage(listenersLoaded) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var container;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n container = document.querySelector('#container-fluid');\n if (container) {\n _context.next = 3;\n break;\n }\n return _context.abrupt(\"return\");\n case 3:\n // Stop if the container isn't found\n projectCards = {};\n fetch('currentProjects/currentProjects.html').then(function (response) {\n return response.text();\n }).then(function (data) {\n // Create a temporary container element to hold the loaded content\n var tempContainer = document.createElement('div');\n tempContainer.innerHTML = data;\n // Select the specific element with the class you want\n var specificElement = tempContainer.querySelector('.filterBar');\n if (specificElement) {\n // Insert the specific element into the target element\n container.insertBefore(specificElement, container.firstChild);\n }\n })[\"catch\"](function (error) {\n console.error('Failed to load the external HTML file:', error);\n });\n getProjects(container, listenersLoaded);\n case 6:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n}\nfunction getProjects(selectElement, listenersLoaded) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var _this = this;\n var data, id;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_0__.getImprovementWorks)({});\n case 2:\n data = _context3.sent;\n id = 0;\n data.forEach(function (project) {\n return __awaiter(_this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var title, department, name, description, i, card, cardHTML, div;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n title = project.name;\n _context2.next = 3;\n return (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_0__.getObjectById)('unit', project.unitId);\n case 3:\n department = _context2.sent;\n if (!department) {\n _context2.next = 21;\n break;\n }\n name = \"Projektledare\"; //Waiting for backend fix\n description = project.content;\n i = id;\n card = new projectCard(i, name, department.name, title, description, project.id, project.currentStage);\n projectCards[i] = card;\n cardHTML = card.generateHTML();\n addEventListener(listenersLoaded, project.id, card);\n div = document.createElement('div');\n div.className = 'projectCardCardDiv'; // Set the class name(s) here\n div.innerHTML = cardHTML;\n if (selectElement) {\n _context2.next = 17;\n break;\n }\n return _context2.abrupt(\"return\");\n case 17:\n selectElement.appendChild(div); // Stop if the container isn't found\n id++;\n _context2.next = 22;\n break;\n case 21:\n console.log(project.unitId + \" is not a unit\"); //Unit Ids on improvement work that do not exist \n case 22:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n });\n case 5:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n}\nfunction addEventListener(listenersLoaded, projectId, card) {\n if (!listenersLoaded) {\n $(document).on('click', '#' + projectId, function (event) {\n var element = event.target;\n if (element.classList.contains('moreInfoClass')) {\n var expandedDiv = document.getElementById('expandedOngoingWorkCard' + projectId);\n if (expandedDiv && expandedDiv.style.display === 'none') {\n card.showMoreInfo(\"expandedOngoingWorkCard\" + projectId, \"ongoingSeeDetailsButton\" + projectId);\n } else {\n card.closeMoreInfo(\"expandedOngoingWorkCard\" + projectId, \"ongoingSeeDetailsButton\" + projectId);\n }\n } else if (element.classList.contains('projectButton')) {\n var currentStage = card.stage;\n if (currentStage === 'Agera') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__.loadProjectPageA)(projectId);\n } else if (currentStage === 'Studera') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__.loadProjectPageS)(projectId);\n } else if (currentStage === 'Göra') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__.loadProjectPageG)(projectId);\n } else if (currentStage === 'Planera') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__.loadProjectPageP)(projectId);\n } else if (currentStage === 'Avslutat') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__.loadProjectPageP)(projectId);\n }\n }\n });\n }\n}\n\n//# sourceURL=webpack://c3/./client/currentProjects/currentProjects.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadPage: () => (/* binding */ loadPage)\n/* harmony export */ });\n/* harmony import */ var _Database_database_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Database/database.js */ \"./client/Database/database.js\");\n/* harmony import */ var _SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../SidebarAndHeader/pageHandler.js */ \"./client/SidebarAndHeader/pageHandler.js\");\n\n\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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\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); }\nvar __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\nvar projectCards = {};\nvar projectCard = /*#__PURE__*/function () {\n function projectCard(id, name, department, title, description, projectId, currentStage) {\n _classCallCheck(this, projectCard);\n this.name = name;\n this.department = department;\n this.title = title;\n this.description = description;\n this.id = id;\n this.projectId = projectId;\n this.stage = currentStage;\n }\n _createClass(projectCard, [{\n key: \"showMoreInfo\",\n value: function showMoreInfo(blockId, thisTextId) {\n var blockElement = document.getElementById(blockId);\n if (blockElement) {\n blockElement.style.display = \"flex\";\n }\n var textElement = document.getElementById(thisTextId);\n if (textElement) {\n textElement.innerText = '^ Stäng detaljer';\n }\n }\n }, {\n key: \"closeMoreInfo\",\n value: function closeMoreInfo(blockId, thisTextId) {\n var blockElement = document.getElementById(blockId);\n if (blockElement) {\n blockElement.style.display = \"none\";\n }\n var textElement = document.getElementById(thisTextId);\n if (textElement) {\n textElement.innerText = '> Mer information';\n }\n }\n }, {\n key: \"loadInitiatePage\",\n value: function loadInitiatePage() {\n alert('The initiate project page should now be loaded');\n }\n }, {\n key: \"generateHTML\",\n value: function generateHTML() {\n return \"<div class=\\\"totalExpandedOngoingWorkCard\\\">\\n <div style=\\\"cursor: pointer;\\\" class=\\\"flex-container ongoingCard\\\" id=\\\"\".concat(this.projectId, \"\\\">\\n <div class=\\\"ongoingCardImageContainer toSinglePage\\\">\\n <div class = \\\"flex-box ongoingCardImage toSinglePage\\\" id=\\\"pinkFaded\\\"></div>\\n </div>\\n <div class=\\\"div ongoingCardInfo toSinglePage\\\">\\n <p class=\\\"toSinglePage\\\" id=\\\"ongoingCardManager\\\">\").concat(this.name, \"</p>\\n <p class=\\\"toSinglePage\\\" id=\\\"ongoingCardDepartment\\\">\").concat(this.department, \"</p>\\n <p class=\\\"toSinglePage\\\" id=\\\"ongoingCardIdeaTitle\\\">\").concat(this.title, \"</p>\\n </div>\\n\\n <button data-project-id=\\\"\").concat(this.id, \"\\\" class=\\\"projectButton\\\" role=\\\"button\\\">G\\xE5 till projektsidan</button>\\n\\n <div class=\\\"statusText\\\">\\n Status: \").concat(this.stage, \"\\n </div>\\n <div class=\\\"container ongoingSeeCardDetails toSinglePage\\\">\\n <div class=\\\"ongoingSeeCardDetailsInner\\\">\\n <p id=\\\"ongoingSeeDetailsButton\").concat(this.projectId, \"\\\" class = \\\"moreInfoClass\\\">> Mer information</p>\\n </div>\\n </div>\\n </div> \\n <div class = \\\"expandedOngoingWorkCard\\\" id=\\\"expandedOngoingWorkCard\").concat(this.projectId, \"\\\" style=\\\"display: none;\\\">\\n <div class =\\\"expandedTextOngoingWorkCard\\\">\\n \").concat(this.description, \"\\n </div>\\n </div>\\n </div> \");\n }\n }]);\n return projectCard;\n}();\nfunction loadPage(listenersLoaded) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var container;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n container = document.querySelector('#container-fluid');\n if (container) {\n _context.next = 3;\n break;\n }\n return _context.abrupt(\"return\");\n case 3:\n // Stop if the container isn't found\n projectCards = {};\n fetch('currentProjects/currentProjects.html').then(function (response) {\n return response.text();\n }).then(function (data) {\n // Create a temporary container element to hold the loaded content\n var tempContainer = document.createElement('div');\n tempContainer.innerHTML = data;\n // Select the specific element with the class you want\n var specificElement = tempContainer.querySelector('.filterBar');\n if (specificElement) {\n // Insert the specific element into the target element\n container.insertBefore(specificElement, container.firstChild);\n }\n })[\"catch\"](function (error) {\n console.error('Failed to load the external HTML file:', error);\n });\n getProjects(container, listenersLoaded);\n case 6:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n}\nfunction getProjects(selectElement, listenersLoaded) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var _this = this;\n var data, id;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_0__.getImprovementWorks)({});\n case 2:\n data = _context3.sent;\n id = 0;\n data.forEach(function (project) {\n return __awaiter(_this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var title, department, name, description, i, card, cardHTML, div;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n title = project.name;\n _context2.next = 3;\n return (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_0__.getObjectById)('unit', project.unitId);\n case 3:\n department = _context2.sent;\n if (!department) {\n _context2.next = 21;\n break;\n }\n name = \"Projektledare\"; //Waiting for backend fix\n description = project.content;\n i = id;\n card = new projectCard(i, name, department.name, title, description, project.id, project.currentStage);\n projectCards[i] = card;\n cardHTML = card.generateHTML();\n addEventListener(listenersLoaded, project.id, card);\n div = document.createElement('div');\n div.className = 'projectCardCardDiv'; // Set the class name(s) here\n div.innerHTML = cardHTML;\n if (selectElement) {\n _context2.next = 17;\n break;\n }\n return _context2.abrupt(\"return\");\n case 17:\n selectElement.appendChild(div); // Stop if the container isn't found\n id++;\n _context2.next = 22;\n break;\n case 21:\n console.log(project.unitId + \" is not a unit\"); //Unit Ids on improvement work that do not exist \n case 22:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n });\n case 5:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n}\nfunction addEventListener(listenersLoaded, projectId, card) {\n var currentStage = card.stage;\n if (!listenersLoaded) {\n $(document).on('click', '#' + projectId, function (event) {\n var element = event.target;\n if (element.classList.contains('moreInfoClass')) {\n var expandedDiv = document.getElementById('expandedOngoingWorkCard' + projectId);\n if (expandedDiv && expandedDiv.style.display === 'none') {\n card.showMoreInfo(\"expandedOngoingWorkCard\" + projectId, \"ongoingSeeDetailsButton\" + projectId);\n } else {\n card.closeMoreInfo(\"expandedOngoingWorkCard\" + projectId, \"ongoingSeeDetailsButton\" + projectId);\n }\n } else if (element.classList.contains('projectButton')) {\n if (currentStage === 'Agera') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__.loadProjectPageA)(projectId);\n } else if (currentStage === 'Studera') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__.loadProjectPageS)(projectId);\n } else if (currentStage === 'Göra') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__.loadProjectPageG)(projectId);\n } else if (currentStage === 'Planera') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__.loadProjectPageP)(projectId);\n } else if (currentStage === 'Avslutat') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__.loadProjectPageP)(projectId);\n }\n }\n });\n }\n}\n\n//# sourceURL=webpack://c3/./client/currentProjects/currentProjects.js?"); /***/ }), @@ -316,7 +316,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \********************************************/ /***/ ((__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 */ loadPage: () => (/* binding */ loadPage)\n/* harmony export */ });\n/* harmony import */ var _SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../SidebarAndHeader/pageHandler.js */ \"./client/SidebarAndHeader/pageHandler.js\");\n/* harmony import */ var _Database_database_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Database/database.js */ \"./client/Database/database.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nvar __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\nfunction updateStage(stage, id) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", id, {\n currentStage: stage\n });\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n}\nfunction loadPage(projectId) {\n var container = document.querySelector('#container-fluid');\n var nextPageButton = document.getElementById('toCurrentProjects');\n if (!container) return; // Stop if the container isn't found\n updateStage(\"Agera\", projectId);\n fetch('projectPage/ProjectPageA.html').then(function (response) {\n return response.text();\n }).then(function (data) {\n // Create a temporary container element to hold the loaded content\n var tempContainer = document.createElement('div');\n tempContainer.innerHTML = data;\n // Select the specific element with the class you want\n var specificElement = tempContainer.querySelector('.wholePageA');\n if (specificElement) {\n // Insert the specific element into the target element\n container.insertBefore(specificElement, container.firstChild);\n initializeTooltips();\n }\n });\n container.addEventListener('click', function (event) {\n var target = event.target; // Type assertion\n if (target.id === 'toCurrentProjects') {\n updateStage(\"Avslutat\", projectId);\n finalize(projectId);\n } else if (target.id === 'toP') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageP)(projectId);\n } else if (target.id === 'toG') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageG)(projectId);\n } else if (target.id === 'toS') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageS)(projectId);\n } else if (target.id === \"saveEditBtnA\") {\n saveImprovementWorkEditA(projectId);\n }\n });\n function initializeTooltips() {\n // Use jQuery to select the elements and initialize the tooltip\n $('[data-toggle=\"tooltip\"]').tooltip({\n delay: {\n \"show\": 0,\n \"hide\": 100\n }\n });\n }\n loadImprovementWorkDataPageA(projectId);\n}\nfunction loadImprovementWorkDataPageA(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var improvementWork, title, a1, a2, a3, a4;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.getObjectById)('improvementWork', projectId);\n case 2:\n improvementWork = _context2.sent;\n title = document.getElementById(\"title\");\n a1 = document.getElementById(\"a1\");\n a2 = document.getElementById(\"a2\");\n a3 = document.getElementById(\"a3\");\n a4 = document.getElementById(\"a4\");\n title.textContent = improvementWork.name;\n a1.value = improvementWork.a1;\n a2.value = improvementWork.a2;\n a3.value = improvementWork.a3;\n a4.value = improvementWork.a4;\n case 13:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n}\nfunction finalize(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var user, userId;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n user = localStorage.getItem('user');\n if (user) {\n userId = JSON.parse(user)[0].id;\n }\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.finalizeImprovementWork)(userId, projectId);\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadCurrentProjects)();\n case 4:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n}\nfunction saveImprovementWorkEditA(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var a1, a2, a3, a4, update;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n a1 = document.getElementById(\"a1\");\n a2 = document.getElementById(\"a2\");\n a3 = document.getElementById(\"a3\");\n a4 = document.getElementById(\"a4\");\n update = {\n a1: a1.value,\n a2: a2.value,\n a3: a3.value,\n a4: a4.value\n };\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", projectId, update);\n case 6:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n}\n\n//# sourceURL=webpack://c3/./client/projectPage/projectPageA.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadPage: () => (/* binding */ loadPage)\n/* harmony export */ });\n/* harmony import */ var _SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../SidebarAndHeader/pageHandler.js */ \"./client/SidebarAndHeader/pageHandler.js\");\n/* harmony import */ var _Database_database_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Database/database.js */ \"./client/Database/database.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nvar __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\nfunction updateStage(stage, id) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", id, {\n currentStage: stage\n });\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n}\nfunction loadPage(projectId) {\n var container = document.querySelector('#container-fluid');\n var nextPageButton = document.getElementById('toCurrentProjects');\n if (!container) return; // Stop if the container isn't found\n updateStage(\"Agera\", projectId);\n fetch('projectPage/ProjectPageA.html').then(function (response) {\n return response.text();\n }).then(function (data) {\n // Create a temporary container element to hold the loaded content\n var tempContainer = document.createElement('div');\n tempContainer.innerHTML = data;\n // Select the specific element with the class you want\n var specificElement = tempContainer.querySelector('.wholePageA');\n if (specificElement) {\n // Insert the specific element into the target element\n container.insertBefore(specificElement, container.firstChild);\n initializeTooltips();\n }\n });\n container.addEventListener('click', function (event) {\n var target = event.target; // Type assertion\n if (target.id === 'toCurrentProjects') {\n updateStage(\"Avslutat\", projectId);\n finalize(projectId);\n } else if (target.id === 'nolansToP') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageP)(projectId);\n } else if (target.id === 'nolansToG') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageG)(projectId);\n } else if (target.id === 'nolansToS') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageS)(projectId);\n } else if (target.id === \"saveEditBtnA\") {\n saveImprovementWorkEditA(projectId);\n }\n });\n function initializeTooltips() {\n // Use jQuery to select the elements and initialize the tooltip\n $('[data-toggle=\"tooltip\"]').tooltip({\n delay: {\n \"show\": 0,\n \"hide\": 100\n }\n });\n }\n loadImprovementWorkDataPageA(projectId);\n}\nfunction loadImprovementWorkDataPageA(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var improvementWork, title, a1, a2, a3, a4;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.getObjectById)('improvementWork', projectId);\n case 2:\n improvementWork = _context2.sent;\n title = document.getElementById(\"title\");\n a1 = document.getElementById(\"a1\");\n a2 = document.getElementById(\"a2\");\n a3 = document.getElementById(\"a3\");\n a4 = document.getElementById(\"a4\");\n title.textContent = improvementWork.name;\n a1.value = improvementWork.a1;\n a2.value = improvementWork.a2;\n a3.value = improvementWork.a3;\n a4.value = improvementWork.a4;\n case 13:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n}\nfunction finalize(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var user, userId;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n user = localStorage.getItem('user');\n if (user) {\n userId = JSON.parse(user)[0].id;\n }\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.finalizeImprovementWork)(userId, projectId);\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadCurrentProjects)();\n case 4:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n}\nfunction saveImprovementWorkEditA(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var a1, a2, a3, a4, update;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n a1 = document.getElementById(\"a1\");\n a2 = document.getElementById(\"a2\");\n a3 = document.getElementById(\"a3\");\n a4 = document.getElementById(\"a4\");\n update = {\n a1: a1.value,\n a2: a2.value,\n a3: a3.value,\n a4: a4.value\n };\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", projectId, update);\n case 6:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n}\n\n//# sourceURL=webpack://c3/./client/projectPage/projectPageA.js?"); /***/ }), @@ -326,7 +326,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \********************************************/ /***/ ((__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 */ loadPage: () => (/* binding */ loadPage)\n/* harmony export */ });\n/* harmony import */ var _SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../SidebarAndHeader/pageHandler.js */ \"./client/SidebarAndHeader/pageHandler.js\");\n/* harmony import */ var _Database_database_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Database/database.js */ \"./client/Database/database.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nvar __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\nfunction updateStage(stage, id) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", id, {\n currentStage: stage\n });\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n}\nfunction loadPage(projectId) {\n var container = document.querySelector('#container-fluid');\n var nextPageButton = document.getElementById('toS');\n if (!container) return; // Stop if the container isn't found\n updateStage(\"Göra\", projectId);\n fetch('projectPage/ProjectPageG.html').then(function (response) {\n return response.text();\n }).then(function (data) {\n // Create a temporary container element to hold the loaded content\n var tempContainer = document.createElement('div');\n tempContainer.innerHTML = data;\n // Select the specific element with the class you want\n var specificElement = tempContainer.querySelector('.wholePageG');\n if (specificElement) {\n // Insert the specific element into the target element\n container.insertBefore(specificElement, container.firstChild);\n initializeTooltips();\n }\n })[\"catch\"](function (error) {\n console.error('Failed to load the external HTML file:', error);\n });\n container.addEventListener('click', function (event) {\n var target = event.target; // Type assertion\n if (target.id === 'toS') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageS)(projectId);\n } else if (target.id === 'toP') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageP)(projectId);\n } else if (target.id === \"saveEditBtnG\") {\n saveImprovementWorkEditG(projectId);\n }\n });\n loadImprovementWorkDataPageG(projectId);\n function initializeTooltips() {\n // Use jQuery to select the elements and initialize the tooltip\n $('[data-toggle=\"tooltip\"]').tooltip({\n delay: {\n \"show\": 0,\n \"hide\": 100\n }\n });\n }\n}\nfunction loadImprovementWorkDataPageG(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var improvementWork, title, g1, g2, g3, g4, g5;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.getObjectById)('improvementWork', projectId);\n case 2:\n improvementWork = _context2.sent;\n title = document.getElementById(\"title\");\n g1 = document.getElementById(\"g1\");\n g2 = document.getElementById(\"g2\");\n g3 = document.getElementById(\"g3\");\n g4 = document.getElementById(\"g4\");\n g5 = document.getElementById(\"g5\");\n title.textContent = improvementWork.name;\n g1.value = improvementWork.g1;\n g2.value = improvementWork.g2;\n g3.value = improvementWork.g3;\n g4.value = improvementWork.g4;\n g5.value = improvementWork.g5;\n case 15:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n}\nfunction saveImprovementWorkEditG(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var g1, g2, g3, g4, g5, update;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n g1 = document.getElementById(\"g1\");\n g2 = document.getElementById(\"g2\");\n g3 = document.getElementById(\"g3\");\n g4 = document.getElementById(\"g4\");\n g5 = document.getElementById(\"g5\");\n update = {\n g1: g1.value,\n g2: g2.value,\n g3: g3.value,\n g4: g4.value,\n g5: g5.value\n };\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", projectId, update);\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n}\n\n//# sourceURL=webpack://c3/./client/projectPage/projectPageG.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadPage: () => (/* binding */ loadPage)\n/* harmony export */ });\n/* harmony import */ var _SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../SidebarAndHeader/pageHandler.js */ \"./client/SidebarAndHeader/pageHandler.js\");\n/* harmony import */ var _Database_database_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Database/database.js */ \"./client/Database/database.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nvar __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\nfunction updateStage(stage, id) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", id, {\n currentStage: stage\n });\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n}\nfunction loadPage(projectId) {\n var container = document.querySelector('#container-fluid');\n var nextPageButton = document.getElementById('toS');\n if (!container) return; // Stop if the container isn't found\n updateStage(\"Göra\", projectId);\n fetch('projectPage/ProjectPageG.html').then(function (response) {\n return response.text();\n }).then(function (data) {\n // Create a temporary container element to hold the loaded content\n var tempContainer = document.createElement('div');\n tempContainer.innerHTML = data;\n // Select the specific element with the class you want\n var specificElement = tempContainer.querySelector('.wholePageG');\n if (specificElement) {\n // Insert the specific element into the target element\n container.insertBefore(specificElement, container.firstChild);\n initializeTooltips();\n }\n })[\"catch\"](function (error) {\n console.error('Failed to load the external HTML file:', error);\n });\n container.addEventListener('click', function (event) {\n var target = event.target; // Type assertion\n if (target.id === 'toS') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageS)(projectId);\n } else if (target.id === 'nolansToP') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageP)(projectId);\n } else if (target.id === \"saveEditBtnG\") {\n saveImprovementWorkEditG(projectId);\n }\n });\n loadImprovementWorkDataPageG(projectId);\n function initializeTooltips() {\n // Use jQuery to select the elements and initialize the tooltip\n $('[data-toggle=\"tooltip\"]').tooltip({\n delay: {\n \"show\": 0,\n \"hide\": 100\n }\n });\n }\n}\nfunction loadImprovementWorkDataPageG(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var improvementWork, title, g1, g2, g3, g4, g5;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.getObjectById)('improvementWork', projectId);\n case 2:\n improvementWork = _context2.sent;\n title = document.getElementById(\"title\");\n g1 = document.getElementById(\"g1\");\n g2 = document.getElementById(\"g2\");\n g3 = document.getElementById(\"g3\");\n g4 = document.getElementById(\"g4\");\n g5 = document.getElementById(\"g5\");\n title.textContent = improvementWork.name;\n g1.value = improvementWork.g1;\n g2.value = improvementWork.g2;\n g3.value = improvementWork.g3;\n g4.value = improvementWork.g4;\n g5.value = improvementWork.g5;\n case 15:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n}\nfunction saveImprovementWorkEditG(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var g1, g2, g3, g4, g5, update;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n g1 = document.getElementById(\"g1\");\n g2 = document.getElementById(\"g2\");\n g3 = document.getElementById(\"g3\");\n g4 = document.getElementById(\"g4\");\n g5 = document.getElementById(\"g5\");\n update = {\n g1: g1.value,\n g2: g2.value,\n g3: g3.value,\n g4: g4.value,\n g5: g5.value\n };\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", projectId, update);\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n}\n\n//# sourceURL=webpack://c3/./client/projectPage/projectPageG.js?"); /***/ }), @@ -346,7 +346,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \********************************************/ /***/ ((__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 */ loadPage: () => (/* binding */ loadPage)\n/* harmony export */ });\n/* harmony import */ var _SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../SidebarAndHeader/pageHandler.js */ \"./client/SidebarAndHeader/pageHandler.js\");\n/* harmony import */ var _Database_database_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Database/database.js */ \"./client/Database/database.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nvar __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\nfunction updateStage(stage, id) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", id, {\n currentStage: stage\n });\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n}\nfunction loadPage(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var container, nextPageButton, initializeTooltips;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n initializeTooltips = function _initializeTooltips() {\n // Use jQuery to select the elements and initialize the tooltip\n $('[data-toggle=\"tooltip\"]').tooltip({\n delay: {\n \"show\": 0,\n \"hide\": 100\n }\n });\n };\n container = document.querySelector('#container-fluid');\n nextPageButton = document.getElementById('toA');\n if (container) {\n _context2.next = 5;\n break;\n }\n return _context2.abrupt(\"return\");\n case 5:\n // Stop if the container isn't found\n updateStage(\"Studera\", projectId);\n fetch('projectPage/ProjectPageS.html').then(function (response) {\n return response.text();\n }).then(function (data) {\n // Create a temporary container element to hold the loaded content\n var tempContainer = document.createElement('div');\n tempContainer.innerHTML = data;\n // Select the specific element with the class you want\n var specificElement = tempContainer.querySelector('.wholePageS');\n if (specificElement) {\n // Insert the specific element into the target element\n container.insertBefore(specificElement, container.firstChild);\n initializeTooltips();\n }\n });\n container.addEventListener('click', function (event) {\n var target = event.target; // Type assertion\n if (target.id === 'toA') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageA)(projectId);\n } else if (target.id === 'toP') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageP)(projectId);\n } else if (target.id === 'toG') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageG)(projectId);\n } else if (target.id === \"saveEditBtnS\") {\n saveImprovementWorkEditS(projectId);\n }\n });\n loadImprovementWorkDataPageS(projectId);\n case 9:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n}\nfunction loadImprovementWorkDataPageS(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var improvementWork, title, s1, s2, s3;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.getObjectById)('improvementWork', projectId);\n case 2:\n improvementWork = _context3.sent;\n title = document.getElementById(\"title\");\n s1 = document.getElementById(\"s1\");\n s2 = document.getElementById(\"s2\");\n s3 = document.getElementById(\"s3\");\n title.textContent = improvementWork.name;\n s1.value = improvementWork.s1;\n s2.value = improvementWork.s2;\n s3.value = improvementWork.s3;\n case 11:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n}\nfunction saveImprovementWorkEditS(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var s1, s2, s3, update;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n s1 = document.getElementById(\"s1\");\n s2 = document.getElementById(\"s2\");\n s3 = document.getElementById(\"s3\");\n update = {\n s1: s1.value,\n s2: s2.value,\n s3: s3.value\n };\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", projectId, update);\n case 5:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n}\n\n//# sourceURL=webpack://c3/./client/projectPage/projectPageS.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadPage: () => (/* binding */ loadPage)\n/* harmony export */ });\n/* harmony import */ var _SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../SidebarAndHeader/pageHandler.js */ \"./client/SidebarAndHeader/pageHandler.js\");\n/* harmony import */ var _Database_database_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Database/database.js */ \"./client/Database/database.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nvar __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\nfunction updateStage(stage, id) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", id, {\n currentStage: stage\n });\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n}\nfunction loadPage(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var container, nextPageButton, initializeTooltips;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n initializeTooltips = function _initializeTooltips() {\n // Use jQuery to select the elements and initialize the tooltip\n $('[data-toggle=\"tooltip\"]').tooltip({\n delay: {\n \"show\": 0,\n \"hide\": 100\n }\n });\n };\n container = document.querySelector('#container-fluid');\n nextPageButton = document.getElementById('toA');\n if (container) {\n _context2.next = 5;\n break;\n }\n return _context2.abrupt(\"return\");\n case 5:\n // Stop if the container isn't found\n updateStage(\"Studera\", projectId);\n fetch('projectPage/ProjectPageS.html').then(function (response) {\n return response.text();\n }).then(function (data) {\n // Create a temporary container element to hold the loaded content\n var tempContainer = document.createElement('div');\n tempContainer.innerHTML = data;\n // Select the specific element with the class you want\n var specificElement = tempContainer.querySelector('.wholePageS');\n if (specificElement) {\n // Insert the specific element into the target element\n container.insertBefore(specificElement, container.firstChild);\n initializeTooltips();\n }\n });\n container.addEventListener('click', function (event) {\n var target = event.target; // Type assertion\n if (target.id === 'toA') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageA)(projectId);\n } else if (target.id === 'nolansToP') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageP)(projectId);\n } else if (target.id === 'nolansToG') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageG)(projectId);\n } else if (target.id === \"saveEditBtnS\") {\n saveImprovementWorkEditS(projectId);\n }\n });\n loadImprovementWorkDataPageS(projectId);\n case 9:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n}\nfunction loadImprovementWorkDataPageS(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var improvementWork, title, s1, s2, s3;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.getObjectById)('improvementWork', projectId);\n case 2:\n improvementWork = _context3.sent;\n title = document.getElementById(\"title\");\n s1 = document.getElementById(\"s1\");\n s2 = document.getElementById(\"s2\");\n s3 = document.getElementById(\"s3\");\n title.textContent = improvementWork.name;\n s1.value = improvementWork.s1;\n s2.value = improvementWork.s2;\n s3.value = improvementWork.s3;\n case 11:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n}\nfunction saveImprovementWorkEditS(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var s1, s2, s3, update;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n s1 = document.getElementById(\"s1\");\n s2 = document.getElementById(\"s2\");\n s3 = document.getElementById(\"s3\");\n update = {\n s1: s1.value,\n s2: s2.value,\n s3: s3.value\n };\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", projectId, update);\n case 5:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n}\n\n//# sourceURL=webpack://c3/./client/projectPage/projectPageS.js?"); /***/ }), diff --git a/client/dist/pageHandler.bundle.js b/client/dist/pageHandler.bundle.js index b699229cc351487342645e3997323e63cacd10e6..5d6c55b2a735d8e47115016ef9a98478a8e1f81e 100644 --- a/client/dist/pageHandler.bundle.js +++ b/client/dist/pageHandler.bundle.js @@ -256,7 +256,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \***************************************************/ /***/ ((__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 */ loadPage: () => (/* binding */ loadPage)\n/* harmony export */ });\n/* harmony import */ var _Database_database_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Database/database.js */ \"./client/Database/database.js\");\n/* harmony import */ var _SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../SidebarAndHeader/pageHandler.js */ \"./client/SidebarAndHeader/pageHandler.js\");\n\n\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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\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); }\nvar __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\nvar projectCards = {};\nvar projectCard = /*#__PURE__*/function () {\n function projectCard(id, name, department, title, description, projectId, currentStage) {\n _classCallCheck(this, projectCard);\n this.name = name;\n this.department = department;\n this.title = title;\n this.description = description;\n this.id = id;\n this.projectId = projectId;\n this.stage = currentStage;\n }\n _createClass(projectCard, [{\n key: \"showMoreInfo\",\n value: function showMoreInfo(blockId, thisTextId) {\n var blockElement = document.getElementById(blockId);\n if (blockElement) {\n blockElement.style.display = \"flex\";\n }\n var textElement = document.getElementById(thisTextId);\n if (textElement) {\n textElement.innerText = '^ Stäng detaljer';\n }\n }\n }, {\n key: \"closeMoreInfo\",\n value: function closeMoreInfo(blockId, thisTextId) {\n var blockElement = document.getElementById(blockId);\n if (blockElement) {\n blockElement.style.display = \"none\";\n }\n var textElement = document.getElementById(thisTextId);\n if (textElement) {\n textElement.innerText = '> Mer information';\n }\n }\n }, {\n key: \"loadInitiatePage\",\n value: function loadInitiatePage() {\n alert('The initiate project page should now be loaded');\n }\n }, {\n key: \"generateHTML\",\n value: function generateHTML() {\n return \"<div class=\\\"totalExpandedOngoingWorkCard\\\">\\n <div style=\\\"cursor: pointer;\\\" class=\\\"flex-container ongoingCard\\\" id=\\\"\".concat(this.projectId, \"\\\">\\n <div class=\\\"ongoingCardImageContainer toSinglePage\\\">\\n <div class = \\\"flex-box ongoingCardImage toSinglePage\\\" id=\\\"pinkFaded\\\"></div>\\n </div>\\n <div class=\\\"div ongoingCardInfo toSinglePage\\\">\\n <p class=\\\"toSinglePage\\\" id=\\\"ongoingCardManager\\\">\").concat(this.name, \"</p>\\n <p class=\\\"toSinglePage\\\" id=\\\"ongoingCardDepartment\\\">\").concat(this.department, \"</p>\\n <p class=\\\"toSinglePage\\\" id=\\\"ongoingCardIdeaTitle\\\">\").concat(this.title, \"</p>\\n </div>\\n\\n <button data-project-id=\\\"\").concat(this.id, \"\\\" class=\\\"projectButton\\\" role=\\\"button\\\">G\\xE5 till projektsidan</button>\\n\\n <div class=\\\"statusText\\\">\\n Status: \").concat(this.stage, \"\\n </div>\\n <div class=\\\"container ongoingSeeCardDetails toSinglePage\\\">\\n <div class=\\\"ongoingSeeCardDetailsInner\\\">\\n <p id=\\\"ongoingSeeDetailsButton\").concat(this.projectId, \"\\\" class = \\\"moreInfoClass\\\">> Mer information</p>\\n </div>\\n </div>\\n </div> \\n <div class = \\\"expandedOngoingWorkCard\\\" id=\\\"expandedOngoingWorkCard\").concat(this.projectId, \"\\\" style=\\\"display: none;\\\">\\n <div class =\\\"expandedTextOngoingWorkCard\\\">\\n \").concat(this.description, \"\\n </div>\\n </div>\\n </div> \");\n }\n }]);\n return projectCard;\n}();\nfunction loadPage(listenersLoaded) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var container;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n container = document.querySelector('#container-fluid');\n if (container) {\n _context.next = 3;\n break;\n }\n return _context.abrupt(\"return\");\n case 3:\n // Stop if the container isn't found\n projectCards = {};\n fetch('currentProjects/currentProjects.html').then(function (response) {\n return response.text();\n }).then(function (data) {\n // Create a temporary container element to hold the loaded content\n var tempContainer = document.createElement('div');\n tempContainer.innerHTML = data;\n // Select the specific element with the class you want\n var specificElement = tempContainer.querySelector('.filterBar');\n if (specificElement) {\n // Insert the specific element into the target element\n container.insertBefore(specificElement, container.firstChild);\n }\n })[\"catch\"](function (error) {\n console.error('Failed to load the external HTML file:', error);\n });\n getProjects(container, listenersLoaded);\n case 6:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n}\nfunction getProjects(selectElement, listenersLoaded) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var _this = this;\n var data, id;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_0__.getImprovementWorks)({});\n case 2:\n data = _context3.sent;\n id = 0;\n data.forEach(function (project) {\n return __awaiter(_this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var title, department, name, description, i, card, cardHTML, div;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n title = project.name;\n _context2.next = 3;\n return (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_0__.getObjectById)('unit', project.unitId);\n case 3:\n department = _context2.sent;\n if (!department) {\n _context2.next = 21;\n break;\n }\n name = \"Projektledare\"; //Waiting for backend fix\n description = project.content;\n i = id;\n card = new projectCard(i, name, department.name, title, description, project.id, project.currentStage);\n projectCards[i] = card;\n cardHTML = card.generateHTML();\n addEventListener(listenersLoaded, project.id, card);\n div = document.createElement('div');\n div.className = 'projectCardCardDiv'; // Set the class name(s) here\n div.innerHTML = cardHTML;\n if (selectElement) {\n _context2.next = 17;\n break;\n }\n return _context2.abrupt(\"return\");\n case 17:\n selectElement.appendChild(div); // Stop if the container isn't found\n id++;\n _context2.next = 22;\n break;\n case 21:\n console.log(project.unitId + \" is not a unit\"); //Unit Ids on improvement work that do not exist \n case 22:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n });\n case 5:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n}\nfunction addEventListener(listenersLoaded, projectId, card) {\n if (!listenersLoaded) {\n $(document).on('click', '#' + projectId, function (event) {\n var element = event.target;\n if (element.classList.contains('moreInfoClass')) {\n var expandedDiv = document.getElementById('expandedOngoingWorkCard' + projectId);\n if (expandedDiv && expandedDiv.style.display === 'none') {\n card.showMoreInfo(\"expandedOngoingWorkCard\" + projectId, \"ongoingSeeDetailsButton\" + projectId);\n } else {\n card.closeMoreInfo(\"expandedOngoingWorkCard\" + projectId, \"ongoingSeeDetailsButton\" + projectId);\n }\n } else if (element.classList.contains('projectButton')) {\n var currentStage = card.stage;\n if (currentStage === 'Agera') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__.loadProjectPageA)(projectId);\n } else if (currentStage === 'Studera') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__.loadProjectPageS)(projectId);\n } else if (currentStage === 'Göra') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__.loadProjectPageG)(projectId);\n } else if (currentStage === 'Planera') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__.loadProjectPageP)(projectId);\n } else if (currentStage === 'Avslutat') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__.loadProjectPageP)(projectId);\n }\n }\n });\n }\n}\n\n//# sourceURL=webpack://c3/./client/currentProjects/currentProjects.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadPage: () => (/* binding */ loadPage)\n/* harmony export */ });\n/* harmony import */ var _Database_database_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Database/database.js */ \"./client/Database/database.js\");\n/* harmony import */ var _SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../SidebarAndHeader/pageHandler.js */ \"./client/SidebarAndHeader/pageHandler.js\");\n\n\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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\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); }\nvar __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\nvar projectCards = {};\nvar projectCard = /*#__PURE__*/function () {\n function projectCard(id, name, department, title, description, projectId, currentStage) {\n _classCallCheck(this, projectCard);\n this.name = name;\n this.department = department;\n this.title = title;\n this.description = description;\n this.id = id;\n this.projectId = projectId;\n this.stage = currentStage;\n }\n _createClass(projectCard, [{\n key: \"showMoreInfo\",\n value: function showMoreInfo(blockId, thisTextId) {\n var blockElement = document.getElementById(blockId);\n if (blockElement) {\n blockElement.style.display = \"flex\";\n }\n var textElement = document.getElementById(thisTextId);\n if (textElement) {\n textElement.innerText = '^ Stäng detaljer';\n }\n }\n }, {\n key: \"closeMoreInfo\",\n value: function closeMoreInfo(blockId, thisTextId) {\n var blockElement = document.getElementById(blockId);\n if (blockElement) {\n blockElement.style.display = \"none\";\n }\n var textElement = document.getElementById(thisTextId);\n if (textElement) {\n textElement.innerText = '> Mer information';\n }\n }\n }, {\n key: \"loadInitiatePage\",\n value: function loadInitiatePage() {\n alert('The initiate project page should now be loaded');\n }\n }, {\n key: \"generateHTML\",\n value: function generateHTML() {\n return \"<div class=\\\"totalExpandedOngoingWorkCard\\\">\\n <div style=\\\"cursor: pointer;\\\" class=\\\"flex-container ongoingCard\\\" id=\\\"\".concat(this.projectId, \"\\\">\\n <div class=\\\"ongoingCardImageContainer toSinglePage\\\">\\n <div class = \\\"flex-box ongoingCardImage toSinglePage\\\" id=\\\"pinkFaded\\\"></div>\\n </div>\\n <div class=\\\"div ongoingCardInfo toSinglePage\\\">\\n <p class=\\\"toSinglePage\\\" id=\\\"ongoingCardManager\\\">\").concat(this.name, \"</p>\\n <p class=\\\"toSinglePage\\\" id=\\\"ongoingCardDepartment\\\">\").concat(this.department, \"</p>\\n <p class=\\\"toSinglePage\\\" id=\\\"ongoingCardIdeaTitle\\\">\").concat(this.title, \"</p>\\n </div>\\n\\n <button data-project-id=\\\"\").concat(this.id, \"\\\" class=\\\"projectButton\\\" role=\\\"button\\\">G\\xE5 till projektsidan</button>\\n\\n <div class=\\\"statusText\\\">\\n Status: \").concat(this.stage, \"\\n </div>\\n <div class=\\\"container ongoingSeeCardDetails toSinglePage\\\">\\n <div class=\\\"ongoingSeeCardDetailsInner\\\">\\n <p id=\\\"ongoingSeeDetailsButton\").concat(this.projectId, \"\\\" class = \\\"moreInfoClass\\\">> Mer information</p>\\n </div>\\n </div>\\n </div> \\n <div class = \\\"expandedOngoingWorkCard\\\" id=\\\"expandedOngoingWorkCard\").concat(this.projectId, \"\\\" style=\\\"display: none;\\\">\\n <div class =\\\"expandedTextOngoingWorkCard\\\">\\n \").concat(this.description, \"\\n </div>\\n </div>\\n </div> \");\n }\n }]);\n return projectCard;\n}();\nfunction loadPage(listenersLoaded) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n var container;\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n container = document.querySelector('#container-fluid');\n if (container) {\n _context.next = 3;\n break;\n }\n return _context.abrupt(\"return\");\n case 3:\n // Stop if the container isn't found\n projectCards = {};\n fetch('currentProjects/currentProjects.html').then(function (response) {\n return response.text();\n }).then(function (data) {\n // Create a temporary container element to hold the loaded content\n var tempContainer = document.createElement('div');\n tempContainer.innerHTML = data;\n // Select the specific element with the class you want\n var specificElement = tempContainer.querySelector('.filterBar');\n if (specificElement) {\n // Insert the specific element into the target element\n container.insertBefore(specificElement, container.firstChild);\n }\n })[\"catch\"](function (error) {\n console.error('Failed to load the external HTML file:', error);\n });\n getProjects(container, listenersLoaded);\n case 6:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n}\nfunction getProjects(selectElement, listenersLoaded) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var _this = this;\n var data, id;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_0__.getImprovementWorks)({});\n case 2:\n data = _context3.sent;\n id = 0;\n data.forEach(function (project) {\n return __awaiter(_this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var title, department, name, description, i, card, cardHTML, div;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n title = project.name;\n _context2.next = 3;\n return (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_0__.getObjectById)('unit', project.unitId);\n case 3:\n department = _context2.sent;\n if (!department) {\n _context2.next = 21;\n break;\n }\n name = \"Projektledare\"; //Waiting for backend fix\n description = project.content;\n i = id;\n card = new projectCard(i, name, department.name, title, description, project.id, project.currentStage);\n projectCards[i] = card;\n cardHTML = card.generateHTML();\n addEventListener(listenersLoaded, project.id, card);\n div = document.createElement('div');\n div.className = 'projectCardCardDiv'; // Set the class name(s) here\n div.innerHTML = cardHTML;\n if (selectElement) {\n _context2.next = 17;\n break;\n }\n return _context2.abrupt(\"return\");\n case 17:\n selectElement.appendChild(div); // Stop if the container isn't found\n id++;\n _context2.next = 22;\n break;\n case 21:\n console.log(project.unitId + \" is not a unit\"); //Unit Ids on improvement work that do not exist \n case 22:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n });\n case 5:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n}\nfunction addEventListener(listenersLoaded, projectId, card) {\n var currentStage = card.stage;\n if (!listenersLoaded) {\n $(document).on('click', '#' + projectId, function (event) {\n var element = event.target;\n if (element.classList.contains('moreInfoClass')) {\n var expandedDiv = document.getElementById('expandedOngoingWorkCard' + projectId);\n if (expandedDiv && expandedDiv.style.display === 'none') {\n card.showMoreInfo(\"expandedOngoingWorkCard\" + projectId, \"ongoingSeeDetailsButton\" + projectId);\n } else {\n card.closeMoreInfo(\"expandedOngoingWorkCard\" + projectId, \"ongoingSeeDetailsButton\" + projectId);\n }\n } else if (element.classList.contains('projectButton')) {\n if (currentStage === 'Agera') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__.loadProjectPageA)(projectId);\n } else if (currentStage === 'Studera') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__.loadProjectPageS)(projectId);\n } else if (currentStage === 'Göra') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__.loadProjectPageG)(projectId);\n } else if (currentStage === 'Planera') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__.loadProjectPageP)(projectId);\n } else if (currentStage === 'Avslutat') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_1__.loadProjectPageP)(projectId);\n }\n }\n });\n }\n}\n\n//# sourceURL=webpack://c3/./client/currentProjects/currentProjects.js?"); /***/ }), @@ -316,7 +316,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \********************************************/ /***/ ((__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 */ loadPage: () => (/* binding */ loadPage)\n/* harmony export */ });\n/* harmony import */ var _SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../SidebarAndHeader/pageHandler.js */ \"./client/SidebarAndHeader/pageHandler.js\");\n/* harmony import */ var _Database_database_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Database/database.js */ \"./client/Database/database.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nvar __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\nfunction updateStage(stage, id) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", id, {\n currentStage: stage\n });\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n}\nfunction loadPage(projectId) {\n var container = document.querySelector('#container-fluid');\n var nextPageButton = document.getElementById('toCurrentProjects');\n if (!container) return; // Stop if the container isn't found\n updateStage(\"Agera\", projectId);\n fetch('projectPage/ProjectPageA.html').then(function (response) {\n return response.text();\n }).then(function (data) {\n // Create a temporary container element to hold the loaded content\n var tempContainer = document.createElement('div');\n tempContainer.innerHTML = data;\n // Select the specific element with the class you want\n var specificElement = tempContainer.querySelector('.wholePageA');\n if (specificElement) {\n // Insert the specific element into the target element\n container.insertBefore(specificElement, container.firstChild);\n initializeTooltips();\n }\n });\n container.addEventListener('click', function (event) {\n var target = event.target; // Type assertion\n if (target.id === 'toCurrentProjects') {\n updateStage(\"Avslutat\", projectId);\n finalize(projectId);\n } else if (target.id === 'toP') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageP)(projectId);\n } else if (target.id === 'toG') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageG)(projectId);\n } else if (target.id === 'toS') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageS)(projectId);\n } else if (target.id === \"saveEditBtnA\") {\n saveImprovementWorkEditA(projectId);\n }\n });\n function initializeTooltips() {\n // Use jQuery to select the elements and initialize the tooltip\n $('[data-toggle=\"tooltip\"]').tooltip({\n delay: {\n \"show\": 0,\n \"hide\": 100\n }\n });\n }\n loadImprovementWorkDataPageA(projectId);\n}\nfunction loadImprovementWorkDataPageA(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var improvementWork, title, a1, a2, a3, a4;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.getObjectById)('improvementWork', projectId);\n case 2:\n improvementWork = _context2.sent;\n title = document.getElementById(\"title\");\n a1 = document.getElementById(\"a1\");\n a2 = document.getElementById(\"a2\");\n a3 = document.getElementById(\"a3\");\n a4 = document.getElementById(\"a4\");\n title.textContent = improvementWork.name;\n a1.value = improvementWork.a1;\n a2.value = improvementWork.a2;\n a3.value = improvementWork.a3;\n a4.value = improvementWork.a4;\n case 13:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n}\nfunction finalize(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var user, userId;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n user = localStorage.getItem('user');\n if (user) {\n userId = JSON.parse(user)[0].id;\n }\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.finalizeImprovementWork)(userId, projectId);\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadCurrentProjects)();\n case 4:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n}\nfunction saveImprovementWorkEditA(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var a1, a2, a3, a4, update;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n a1 = document.getElementById(\"a1\");\n a2 = document.getElementById(\"a2\");\n a3 = document.getElementById(\"a3\");\n a4 = document.getElementById(\"a4\");\n update = {\n a1: a1.value,\n a2: a2.value,\n a3: a3.value,\n a4: a4.value\n };\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", projectId, update);\n case 6:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n}\n\n//# sourceURL=webpack://c3/./client/projectPage/projectPageA.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadPage: () => (/* binding */ loadPage)\n/* harmony export */ });\n/* harmony import */ var _SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../SidebarAndHeader/pageHandler.js */ \"./client/SidebarAndHeader/pageHandler.js\");\n/* harmony import */ var _Database_database_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Database/database.js */ \"./client/Database/database.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nvar __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\n\nfunction updateStage(stage, id) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", id, {\n currentStage: stage\n });\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n}\nfunction loadPage(projectId) {\n var container = document.querySelector('#container-fluid');\n var nextPageButton = document.getElementById('toCurrentProjects');\n if (!container) return; // Stop if the container isn't found\n updateStage(\"Agera\", projectId);\n fetch('projectPage/ProjectPageA.html').then(function (response) {\n return response.text();\n }).then(function (data) {\n // Create a temporary container element to hold the loaded content\n var tempContainer = document.createElement('div');\n tempContainer.innerHTML = data;\n // Select the specific element with the class you want\n var specificElement = tempContainer.querySelector('.wholePageA');\n if (specificElement) {\n // Insert the specific element into the target element\n container.insertBefore(specificElement, container.firstChild);\n initializeTooltips();\n }\n });\n container.addEventListener('click', function (event) {\n var target = event.target; // Type assertion\n if (target.id === 'toCurrentProjects') {\n updateStage(\"Avslutat\", projectId);\n finalize(projectId);\n } else if (target.id === 'nolansToP') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageP)(projectId);\n } else if (target.id === 'nolansToG') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageG)(projectId);\n } else if (target.id === 'nolansToS') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageS)(projectId);\n } else if (target.id === \"saveEditBtnA\") {\n saveImprovementWorkEditA(projectId);\n }\n });\n function initializeTooltips() {\n // Use jQuery to select the elements and initialize the tooltip\n $('[data-toggle=\"tooltip\"]').tooltip({\n delay: {\n \"show\": 0,\n \"hide\": 100\n }\n });\n }\n loadImprovementWorkDataPageA(projectId);\n}\nfunction loadImprovementWorkDataPageA(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var improvementWork, title, a1, a2, a3, a4;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.getObjectById)('improvementWork', projectId);\n case 2:\n improvementWork = _context2.sent;\n title = document.getElementById(\"title\");\n a1 = document.getElementById(\"a1\");\n a2 = document.getElementById(\"a2\");\n a3 = document.getElementById(\"a3\");\n a4 = document.getElementById(\"a4\");\n title.textContent = improvementWork.name;\n a1.value = improvementWork.a1;\n a2.value = improvementWork.a2;\n a3.value = improvementWork.a3;\n a4.value = improvementWork.a4;\n case 13:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n}\nfunction finalize(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var user, userId;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n user = localStorage.getItem('user');\n if (user) {\n userId = JSON.parse(user)[0].id;\n }\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.finalizeImprovementWork)(userId, projectId);\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadCurrentProjects)();\n case 4:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n}\nfunction saveImprovementWorkEditA(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var a1, a2, a3, a4, update;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n a1 = document.getElementById(\"a1\");\n a2 = document.getElementById(\"a2\");\n a3 = document.getElementById(\"a3\");\n a4 = document.getElementById(\"a4\");\n update = {\n a1: a1.value,\n a2: a2.value,\n a3: a3.value,\n a4: a4.value\n };\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", projectId, update);\n case 6:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n}\n\n//# sourceURL=webpack://c3/./client/projectPage/projectPageA.js?"); /***/ }), @@ -326,7 +326,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \********************************************/ /***/ ((__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 */ loadPage: () => (/* binding */ loadPage)\n/* harmony export */ });\n/* harmony import */ var _SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../SidebarAndHeader/pageHandler.js */ \"./client/SidebarAndHeader/pageHandler.js\");\n/* harmony import */ var _Database_database_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Database/database.js */ \"./client/Database/database.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nvar __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\nfunction updateStage(stage, id) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", id, {\n currentStage: stage\n });\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n}\nfunction loadPage(projectId) {\n var container = document.querySelector('#container-fluid');\n var nextPageButton = document.getElementById('toS');\n if (!container) return; // Stop if the container isn't found\n updateStage(\"Göra\", projectId);\n fetch('projectPage/ProjectPageG.html').then(function (response) {\n return response.text();\n }).then(function (data) {\n // Create a temporary container element to hold the loaded content\n var tempContainer = document.createElement('div');\n tempContainer.innerHTML = data;\n // Select the specific element with the class you want\n var specificElement = tempContainer.querySelector('.wholePageG');\n if (specificElement) {\n // Insert the specific element into the target element\n container.insertBefore(specificElement, container.firstChild);\n initializeTooltips();\n }\n })[\"catch\"](function (error) {\n console.error('Failed to load the external HTML file:', error);\n });\n container.addEventListener('click', function (event) {\n var target = event.target; // Type assertion\n if (target.id === 'toS') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageS)(projectId);\n } else if (target.id === 'toP') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageP)(projectId);\n } else if (target.id === \"saveEditBtnG\") {\n saveImprovementWorkEditG(projectId);\n }\n });\n loadImprovementWorkDataPageG(projectId);\n function initializeTooltips() {\n // Use jQuery to select the elements and initialize the tooltip\n $('[data-toggle=\"tooltip\"]').tooltip({\n delay: {\n \"show\": 0,\n \"hide\": 100\n }\n });\n }\n}\nfunction loadImprovementWorkDataPageG(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var improvementWork, title, g1, g2, g3, g4, g5;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.getObjectById)('improvementWork', projectId);\n case 2:\n improvementWork = _context2.sent;\n title = document.getElementById(\"title\");\n g1 = document.getElementById(\"g1\");\n g2 = document.getElementById(\"g2\");\n g3 = document.getElementById(\"g3\");\n g4 = document.getElementById(\"g4\");\n g5 = document.getElementById(\"g5\");\n title.textContent = improvementWork.name;\n g1.value = improvementWork.g1;\n g2.value = improvementWork.g2;\n g3.value = improvementWork.g3;\n g4.value = improvementWork.g4;\n g5.value = improvementWork.g5;\n case 15:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n}\nfunction saveImprovementWorkEditG(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var g1, g2, g3, g4, g5, update;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n g1 = document.getElementById(\"g1\");\n g2 = document.getElementById(\"g2\");\n g3 = document.getElementById(\"g3\");\n g4 = document.getElementById(\"g4\");\n g5 = document.getElementById(\"g5\");\n update = {\n g1: g1.value,\n g2: g2.value,\n g3: g3.value,\n g4: g4.value,\n g5: g5.value\n };\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", projectId, update);\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n}\n\n//# sourceURL=webpack://c3/./client/projectPage/projectPageG.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadPage: () => (/* binding */ loadPage)\n/* harmony export */ });\n/* harmony import */ var _SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../SidebarAndHeader/pageHandler.js */ \"./client/SidebarAndHeader/pageHandler.js\");\n/* harmony import */ var _Database_database_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Database/database.js */ \"./client/Database/database.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nvar __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\nfunction updateStage(stage, id) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", id, {\n currentStage: stage\n });\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n}\nfunction loadPage(projectId) {\n var container = document.querySelector('#container-fluid');\n var nextPageButton = document.getElementById('toS');\n if (!container) return; // Stop if the container isn't found\n updateStage(\"Göra\", projectId);\n fetch('projectPage/ProjectPageG.html').then(function (response) {\n return response.text();\n }).then(function (data) {\n // Create a temporary container element to hold the loaded content\n var tempContainer = document.createElement('div');\n tempContainer.innerHTML = data;\n // Select the specific element with the class you want\n var specificElement = tempContainer.querySelector('.wholePageG');\n if (specificElement) {\n // Insert the specific element into the target element\n container.insertBefore(specificElement, container.firstChild);\n initializeTooltips();\n }\n })[\"catch\"](function (error) {\n console.error('Failed to load the external HTML file:', error);\n });\n container.addEventListener('click', function (event) {\n var target = event.target; // Type assertion\n if (target.id === 'toS') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageS)(projectId);\n } else if (target.id === 'nolansToP') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageP)(projectId);\n } else if (target.id === \"saveEditBtnG\") {\n saveImprovementWorkEditG(projectId);\n }\n });\n loadImprovementWorkDataPageG(projectId);\n function initializeTooltips() {\n // Use jQuery to select the elements and initialize the tooltip\n $('[data-toggle=\"tooltip\"]').tooltip({\n delay: {\n \"show\": 0,\n \"hide\": 100\n }\n });\n }\n}\nfunction loadImprovementWorkDataPageG(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var improvementWork, title, g1, g2, g3, g4, g5;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n _context2.next = 2;\n return (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.getObjectById)('improvementWork', projectId);\n case 2:\n improvementWork = _context2.sent;\n title = document.getElementById(\"title\");\n g1 = document.getElementById(\"g1\");\n g2 = document.getElementById(\"g2\");\n g3 = document.getElementById(\"g3\");\n g4 = document.getElementById(\"g4\");\n g5 = document.getElementById(\"g5\");\n title.textContent = improvementWork.name;\n g1.value = improvementWork.g1;\n g2.value = improvementWork.g2;\n g3.value = improvementWork.g3;\n g4.value = improvementWork.g4;\n g5.value = improvementWork.g5;\n case 15:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n}\nfunction saveImprovementWorkEditG(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var g1, g2, g3, g4, g5, update;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n g1 = document.getElementById(\"g1\");\n g2 = document.getElementById(\"g2\");\n g3 = document.getElementById(\"g3\");\n g4 = document.getElementById(\"g4\");\n g5 = document.getElementById(\"g5\");\n update = {\n g1: g1.value,\n g2: g2.value,\n g3: g3.value,\n g4: g4.value,\n g5: g5.value\n };\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", projectId, update);\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n}\n\n//# sourceURL=webpack://c3/./client/projectPage/projectPageG.js?"); /***/ }), @@ -346,7 +346,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpac \********************************************/ /***/ ((__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 */ loadPage: () => (/* binding */ loadPage)\n/* harmony export */ });\n/* harmony import */ var _SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../SidebarAndHeader/pageHandler.js */ \"./client/SidebarAndHeader/pageHandler.js\");\n/* harmony import */ var _Database_database_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Database/database.js */ \"./client/Database/database.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nvar __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\nfunction updateStage(stage, id) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", id, {\n currentStage: stage\n });\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n}\nfunction loadPage(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var container, nextPageButton, initializeTooltips;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n initializeTooltips = function _initializeTooltips() {\n // Use jQuery to select the elements and initialize the tooltip\n $('[data-toggle=\"tooltip\"]').tooltip({\n delay: {\n \"show\": 0,\n \"hide\": 100\n }\n });\n };\n container = document.querySelector('#container-fluid');\n nextPageButton = document.getElementById('toA');\n if (container) {\n _context2.next = 5;\n break;\n }\n return _context2.abrupt(\"return\");\n case 5:\n // Stop if the container isn't found\n updateStage(\"Studera\", projectId);\n fetch('projectPage/ProjectPageS.html').then(function (response) {\n return response.text();\n }).then(function (data) {\n // Create a temporary container element to hold the loaded content\n var tempContainer = document.createElement('div');\n tempContainer.innerHTML = data;\n // Select the specific element with the class you want\n var specificElement = tempContainer.querySelector('.wholePageS');\n if (specificElement) {\n // Insert the specific element into the target element\n container.insertBefore(specificElement, container.firstChild);\n initializeTooltips();\n }\n });\n container.addEventListener('click', function (event) {\n var target = event.target; // Type assertion\n if (target.id === 'toA') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageA)(projectId);\n } else if (target.id === 'toP') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageP)(projectId);\n } else if (target.id === 'toG') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageG)(projectId);\n } else if (target.id === \"saveEditBtnS\") {\n saveImprovementWorkEditS(projectId);\n }\n });\n loadImprovementWorkDataPageS(projectId);\n case 9:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n}\nfunction loadImprovementWorkDataPageS(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var improvementWork, title, s1, s2, s3;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.getObjectById)('improvementWork', projectId);\n case 2:\n improvementWork = _context3.sent;\n title = document.getElementById(\"title\");\n s1 = document.getElementById(\"s1\");\n s2 = document.getElementById(\"s2\");\n s3 = document.getElementById(\"s3\");\n title.textContent = improvementWork.name;\n s1.value = improvementWork.s1;\n s2.value = improvementWork.s2;\n s3.value = improvementWork.s3;\n case 11:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n}\nfunction saveImprovementWorkEditS(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var s1, s2, s3, update;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n s1 = document.getElementById(\"s1\");\n s2 = document.getElementById(\"s2\");\n s3 = document.getElementById(\"s3\");\n update = {\n s1: s1.value,\n s2: s2.value,\n s3: s3.value\n };\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", projectId, update);\n case 5:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n}\n\n//# sourceURL=webpack://c3/./client/projectPage/projectPageS.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ loadPage: () => (/* binding */ loadPage)\n/* harmony export */ });\n/* harmony import */ var _SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../SidebarAndHeader/pageHandler.js */ \"./client/SidebarAndHeader/pageHandler.js\");\n/* harmony import */ var _Database_database_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Database/database.js */ \"./client/Database/database.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\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 e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = \"function\" == typeof Symbol ? Symbol : {}, a = i.iterator || \"@@iterator\", c = i.asyncIterator || \"@@asyncIterator\", u = i.toStringTag || \"@@toStringTag\"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, \"\"); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, \"_invoke\", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: \"normal\", arg: t.call(e, r) }; } catch (t) { return { type: \"throw\", arg: t }; } } e.wrap = wrap; var h = \"suspendedStart\", l = \"suspendedYield\", f = \"executing\", s = \"completed\", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { [\"next\", \"throw\", \"return\"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if (\"throw\" !== c.type) { var u = c.arg, h = u.value; return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) { invoke(\"next\", t, i, a); }, function (t) { invoke(\"throw\", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke(\"throw\", t, i, a); }); } a(c.arg); } var r; o(this, \"_invoke\", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error(\"Generator is already running\"); if (o === s) { if (\"throw\" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else \"return\" === n.method && n.abrupt(\"return\", n.arg); o = f; var p = tryCatch(e, r, n); if (\"normal\" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y; var i = tryCatch(o, e.iterator, r.arg); if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = \"normal\", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: \"root\" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || \"\" === e) { var r = e[a]; if (r) return r.call(e); if (\"function\" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + \" is not iterable\"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, \"constructor\", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) { var e = \"function\" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () { return this; }), define(g, \"toString\", function () { return \"[object Generator]\"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if (\"throw\" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if (\"root\" === i.tryLoc) return handle(\"end\"); if (i.tryLoc <= this.prev) { var c = n.call(i, \"catchLoc\"), u = n.call(i, \"finallyLoc\"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error(\"try statement without catch or finally\"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) { var i = o; break; } } i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if (\"throw\" === t.type) throw t.arg; return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, \"catch\": function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if (\"throw\" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error(\"illegal catch attempt\"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, \"next\" === this.method && (this.arg = t), y; } }, e; }\nvar __awaiter = undefined && undefined.__awaiter || function (thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\n\n\nfunction updateStage(stage, id) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {\n return _regeneratorRuntime().wrap(function _callee$(_context) {\n while (1) switch (_context.prev = _context.next) {\n case 0:\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", id, {\n currentStage: stage\n });\n case 1:\n case \"end\":\n return _context.stop();\n }\n }, _callee);\n }));\n}\nfunction loadPage(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {\n var container, nextPageButton, initializeTooltips;\n return _regeneratorRuntime().wrap(function _callee2$(_context2) {\n while (1) switch (_context2.prev = _context2.next) {\n case 0:\n initializeTooltips = function _initializeTooltips() {\n // Use jQuery to select the elements and initialize the tooltip\n $('[data-toggle=\"tooltip\"]').tooltip({\n delay: {\n \"show\": 0,\n \"hide\": 100\n }\n });\n };\n container = document.querySelector('#container-fluid');\n nextPageButton = document.getElementById('toA');\n if (container) {\n _context2.next = 5;\n break;\n }\n return _context2.abrupt(\"return\");\n case 5:\n // Stop if the container isn't found\n updateStage(\"Studera\", projectId);\n fetch('projectPage/ProjectPageS.html').then(function (response) {\n return response.text();\n }).then(function (data) {\n // Create a temporary container element to hold the loaded content\n var tempContainer = document.createElement('div');\n tempContainer.innerHTML = data;\n // Select the specific element with the class you want\n var specificElement = tempContainer.querySelector('.wholePageS');\n if (specificElement) {\n // Insert the specific element into the target element\n container.insertBefore(specificElement, container.firstChild);\n initializeTooltips();\n }\n });\n container.addEventListener('click', function (event) {\n var target = event.target; // Type assertion\n if (target.id === 'toA') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageA)(projectId);\n } else if (target.id === 'nolansToP') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageP)(projectId);\n } else if (target.id === 'nolansToG') {\n (0,_SidebarAndHeader_pageHandler_js__WEBPACK_IMPORTED_MODULE_0__.loadProjectPageG)(projectId);\n } else if (target.id === \"saveEditBtnS\") {\n saveImprovementWorkEditS(projectId);\n }\n });\n loadImprovementWorkDataPageS(projectId);\n case 9:\n case \"end\":\n return _context2.stop();\n }\n }, _callee2);\n }));\n}\nfunction loadImprovementWorkDataPageS(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {\n var improvementWork, title, s1, s2, s3;\n return _regeneratorRuntime().wrap(function _callee3$(_context3) {\n while (1) switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.getObjectById)('improvementWork', projectId);\n case 2:\n improvementWork = _context3.sent;\n title = document.getElementById(\"title\");\n s1 = document.getElementById(\"s1\");\n s2 = document.getElementById(\"s2\");\n s3 = document.getElementById(\"s3\");\n title.textContent = improvementWork.name;\n s1.value = improvementWork.s1;\n s2.value = improvementWork.s2;\n s3.value = improvementWork.s3;\n case 11:\n case \"end\":\n return _context3.stop();\n }\n }, _callee3);\n }));\n}\nfunction saveImprovementWorkEditS(projectId) {\n return __awaiter(this, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {\n var s1, s2, s3, update;\n return _regeneratorRuntime().wrap(function _callee4$(_context4) {\n while (1) switch (_context4.prev = _context4.next) {\n case 0:\n s1 = document.getElementById(\"s1\");\n s2 = document.getElementById(\"s2\");\n s3 = document.getElementById(\"s3\");\n update = {\n s1: s1.value,\n s2: s2.value,\n s3: s3.value\n };\n (0,_Database_database_js__WEBPACK_IMPORTED_MODULE_1__.updateInstance)(\"improvementWork\", projectId, update);\n case 5:\n case \"end\":\n return _context4.stop();\n }\n }, _callee4);\n }));\n}\n\n//# sourceURL=webpack://c3/./client/projectPage/projectPageS.js?"); /***/ }), diff --git a/client/projectPage/projectPageA.html b/client/projectPage/projectPageA.html index d4abd2ddd362d861354649911dfbffd42b53f183..41d1748bc82085a98591fd4eb413e2827813581c 100644 --- a/client/projectPage/projectPageA.html +++ b/client/projectPage/projectPageA.html @@ -69,10 +69,10 @@ <div id="NolansModel" style="margin:3%; width: 30%;"> <div class="wrap"> - <div class="quart" id="toP">1. Planera </div> - <div class="quart" id="toG">2. Göra</div> + <div class="quart" id="nolansToP">1. Planera </div> + <div class="quart" id="nolansToG">2. Göra</div> <div class="quart">4. Agera</div> - <div class="quart" id="toS">3. Studera</div> + <div class="quart" id="nolansToS">3. Studera</div> <div class="center">PGSA</div> </div> <article class="infoText"> diff --git a/client/projectPage/projectPageA.js b/client/projectPage/projectPageA.js index d3c2df3075fc2ae4de211bbf5270b3d3d617ec99..9f4851d19bfe61f78eaaa609dcbb2d76f7e82ad8 100644 --- a/client/projectPage/projectPageA.js +++ b/client/projectPage/projectPageA.js @@ -41,13 +41,13 @@ export function loadPage(projectId) { updateStage("Avslutat", projectId); finalize(projectId); } - else if (target.id === 'toP') { + else if (target.id === 'nolansToP') { loadProjectPageP(projectId); } - else if (target.id === 'toG') { + else if (target.id === 'nolansToG') { loadProjectPageG(projectId); } - else if (target.id === 'toS') { + else if (target.id === 'nolansToS') { loadProjectPageS(projectId); } else if (target.id === "saveEditBtnA") { diff --git a/client/projectPage/projectPageA.ts b/client/projectPage/projectPageA.ts index 219f54336eebaa22ac4f840f876c8035e1075429..fc526133ce2353bf9b137ffd47b7721c0e77614e 100644 --- a/client/projectPage/projectPageA.ts +++ b/client/projectPage/projectPageA.ts @@ -40,13 +40,13 @@ export function loadPage (projectId : string) { if (target.id === 'toCurrentProjects') { updateStage("Avslutat", projectId); finalize(projectId); - }else if(target.id === 'toP'){ + } else if(target.id === 'nolansToP'){ loadProjectPageP(projectId); - }else if(target.id === 'toG'){ + } else if(target.id === 'nolansToG'){ loadProjectPageG(projectId); - }else if(target.id === 'toS'){ + } else if(target.id === 'nolansToS'){ loadProjectPageS(projectId); - }else if(target.id === "saveEditBtnA") { + } else if(target.id === "saveEditBtnA") { saveImprovementWorkEditA(projectId); } }); diff --git a/client/projectPage/projectPageG.html b/client/projectPage/projectPageG.html index 1effbd052d46b6bcf5d89abaab57602481050476..648ececc293569da62763f3dc4a35fefdf930d47 100644 --- a/client/projectPage/projectPageG.html +++ b/client/projectPage/projectPageG.html @@ -76,7 +76,7 @@ <div id="NolansModel" style="margin:3%; width: 30%;"> <div class="wrap"> - <div class="quart" id="toP">1. Planera</div> + <div class="quart" id="nolansToP">1. Planera</div> <div class="quart">2. Göra</div> <div class="center">PGSA</div> </div> diff --git a/client/projectPage/projectPageG.js b/client/projectPage/projectPageG.js index babd3885ec92365b6e673dd796fc38bec67a1cfb..6d4a3f0f9e1f0ace44dc4bcaf3851550355eb228 100644 --- a/client/projectPage/projectPageG.js +++ b/client/projectPage/projectPageG.js @@ -42,7 +42,7 @@ export function loadPage(projectId) { if (target.id === 'toS') { loadProjectPageS(projectId); } - else if (target.id === 'toP') { + else if (target.id === 'nolansToP') { loadProjectPageP(projectId); } else if (target.id === "saveEditBtnG") { diff --git a/client/projectPage/projectPageG.ts b/client/projectPage/projectPageG.ts index a3fbf6d8dd540cc3f21668243d2feb48899ca8e7..98d05654ef0e1add2b00aa96649fcb501ae05149 100644 --- a/client/projectPage/projectPageG.ts +++ b/client/projectPage/projectPageG.ts @@ -41,7 +41,7 @@ export function loadPage (projectId : string) { const target = event.target as HTMLElement; // Type assertion if (target.id === 'toS') { loadProjectPageS(projectId); - }else if(target.id === 'toP'){ + }else if(target.id === 'nolansToP'){ loadProjectPageP(projectId); } else if(target.id === "saveEditBtnG") { saveImprovementWorkEditG(projectId); diff --git a/client/projectPage/projectPageS.html b/client/projectPage/projectPageS.html index 8031dc986f34eb349832c81988f13458f81888c9..f374a448ad4b02d944c327a99a14ebd725c20242 100644 --- a/client/projectPage/projectPageS.html +++ b/client/projectPage/projectPageS.html @@ -62,8 +62,8 @@ <div id="NolansModel" style="margin:3%; width: 30%;"> <div class="wrap"> - <div class="quart" id="toP">1. Planera</div> - <div class="quart" id="toG">2. Göra</div> + <div class="quart" id="nolansToP">1. Planera</div> + <div class="quart" id="nolansToG">2. Göra</div> <div></div> <div class="quart">3. Studera</div> <div class="center">PGSA</div> diff --git a/client/projectPage/projectPageS.js b/client/projectPage/projectPageS.js index 2ccf607a6f2ba90c16f415e097ff057c98771978..59e10dbdc1cc02aa965dd4f059a3b97a992a4327 100644 --- a/client/projectPage/projectPageS.js +++ b/client/projectPage/projectPageS.js @@ -40,10 +40,10 @@ export function loadPage(projectId) { if (target.id === 'toA') { loadProjectPageA(projectId); } - else if (target.id === 'toP') { + else if (target.id === 'nolansToP') { loadProjectPageP(projectId); } - else if (target.id === 'toG') { + else if (target.id === 'nolansToG') { loadProjectPageG(projectId); } else if (target.id === "saveEditBtnS") { diff --git a/client/projectPage/projectPageS.ts b/client/projectPage/projectPageS.ts index efa6edac804dbe3d78f7b0383cfe78762c36ca8a..acfdd179d10528d233c539fa277626ccda682809 100644 --- a/client/projectPage/projectPageS.ts +++ b/client/projectPage/projectPageS.ts @@ -38,9 +38,9 @@ export async function loadPage (projectId : string) { if (target.id === 'toA') { loadProjectPageA(projectId); - }else if(target.id === 'toP'){ + }else if(target.id === 'nolansToP'){ loadProjectPageP(projectId); - }else if(target.id === 'toG'){ + }else if(target.id === 'nolansToG'){ loadProjectPageG(projectId); } else if(target.id === "saveEditBtnS") { saveImprovementWorkEditS(projectId);