This repository has been archived by the owner on Jun 17, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbundle.js.map
1 lines (1 loc) · 140 KB
/
bundle.js.map
1
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./node_modules/tslib/tslib.es6.js","webpack:///external \"$\"","webpack:///external \"Promise\"","webpack:///./src/deeds/index.js","webpack:///./src/page-utils/hide-all.ts","webpack:///external \"preact\"","webpack:///./src/cookies.ts","webpack:///./src/utils/syncify.ts","webpack:///./src/slug.ts","webpack:///external \"preactLocalize\"","webpack:///./src/utils/unsafe.ts","webpack:///./src/bundle.ts","webpack:///./src/account-options.ts","webpack:///./src/login/index.ts","webpack:///./src/login/begin-reset-password.ts","webpack:///./src/deeds/deeds-function.ts","webpack:///./src/deeds/basic-request.ts","webpack:///./src/login/confirm-register.ts","webpack:///./src/login/reset-password.ts","webpack:///./src/login/login.ts","webpack:///./src/login/register.ts","webpack:///./src/markdown/index.ts","webpack:///./src/markdown/collapsible.tsx","webpack:///./src/markdown/tabview.ts","webpack:///./src/page-utils/index.ts","webpack:///./src/page-utils/edit.ts","webpack:///./src/page-utils/tags.ts","webpack:///./src/dialog.ts","webpack:///./src/page-utils/history.tsx","webpack:///./src/history/index.tsx","webpack:///./src/widgets/pager.tsx","webpack:///./src/history/revision.ts","webpack:///./src/history/flags.ts","webpack:///./src/page-utils/page-source.ts","webpack:///./src/page-utils/parent.ts","webpack:///./src/page-utils/rating.ts","webpack:///(webpack)/buildin/global.js","webpack:///./src/page-utils/rename.ts","webpack:///./src/user/user-module.tsx","webpack:///./src/modal.tsx","webpack:///./src/user/info.ts"],"names":["installedModules","__webpack_require__","moduleId","exports","module","i","l","modules","call","m","c","d","name","getter","o","Object","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","prototype","hasOwnProperty","p","s","extendStatics","b","setPrototypeOf","__proto__","Array","__extends","__","this","constructor","__assign","assign","arguments","length","apply","__rest","e","indexOf","getOwnPropertySymbols","propertyIsEnumerable","__decorate","decorators","target","desc","getOwnPropertyDescriptor","Reflect","decorate","__param","paramIndex","decorator","__metadata","metadataKey","metadataValue","metadata","__awaiter","thisArg","_arguments","P","generator","Promise","resolve","reject","fulfilled","step","next","rejected","result","done","then","__generator","body","f","y","g","_","label","sent","trys","ops","verb","iterator","v","op","TypeError","pop","push","__exportStar","__values","__read","ar","error","__spread","concat","__spreadArrays","il","k","a","j","jl","__await","__asyncGenerator","asyncIterator","q","resume","fulfill","settle","shift","__asyncDelegator","__asyncValues","__makeTemplateObject","cooked","raw","__importStar","mod","default","__importDefault","$","createDeedsFunction","deedsFunctions","deedsFunction","utilityBlockSelector","map","utilityBlockId","join","utilityBlocks","addClass","preact","Date","toGMTString","toUTCString","expireDays","expiry","setDate","getDate","escape","cookie","document","offset","end","unescape","substring","alreadyExpiredDate","func","catch","err","window","pageslug","preactLocalize","isCompromised","continueIfCompromised","sanitizeProperty","propName","input","converter","constraint","x","val","Error","console","UnsafeObject","passThruNumber","passThruString","passThruNString","stringToDate","log","setupUserTrigger","accountButton","css","off","hover","click","BluebirdPromise","email","beginResetPassword","empty","removeClass","em","code","confirmResetPassword","setCookie","location","href","text","message","summary","method","methodClass","requestType","singularVerb","pluralVerb","reqBody","parameter","args","makeDeedsRequest","reqInformation","request","taskDescription","taskDescriptionPlural","uri","sentObject","params","pagename","ajax","data","dataType","res","errorMessage","errType","noConfEmail","enterCodeBegin","enterCodeEnd","crBlock","getCookie","html","crMessage","confirmRegistration","deleteCookie","newPassword","cNewPassword","resetPassword","login","authSession","cookiePreserveTime","emailRegex","username","cEmail","password","cPassword","isError","add","test","register","CollapsibleLink","props","class","onClick","state","show","contentOpacity","opacityShader","setState","prevState","setTimeout","componentDidUpdate","prevProps","setInner","ref","innerHTML","contents","elem","appendChild","changeState","render","blockStyle","opacity","stateChanger","folded","link","closelink","openlink","topHeader","linkLocation","bottomHeader","style","children","Component","Collapsible","each","jThis","attr","parseInt","from","tabviewFromSelector","selector","root","hasClass","parent","selectors","find","tabs","switchTab","tabView","tab","tabContent","index","obj","localizedIndex","promiseWrapper","nonIntrusiveDialog","setupRatingTrigger","className","rating","ratePage","setupEditLockTrigger","beginEditPage","openHistoryBlock","openParentBlock","openPageSourceBlock","openRatingBlock","openRenameBlock","openTagBlock","cancelEditPage","savePage","submitTags","clearTags","submitParents","renamePage","editlockTimeout","keyTimer","currentlyTyping","setTimeoutNotification","secondsLeft","setEditLock","editLockSeconds","getSource","source","src","refresh","title","comment","setSource","reload","cancelEditLock","clearTimeout","stopInterval","resetEditLockSync","resetEditLock","keyup","keydown","tagBlock","tagEntry","getTags","tags","tagString","split","setTags","alert","hBlock","HistoryWidget","revisionsPerPageOptions","CompareSelectionRadio","rkAsString","revKey","type","id","isTo","RevisionRow","revision","editedOn","revId","flag","getMonth","getDay","getFullYear","ongoingRequest","revisions","page","revisionsPerPage","totalPages","doingInitLoading","loadRevisions","getHistory","Revision","deserialize","componentDidMount","componentWillUnmount","cancel","switchPage","changeRevisionsPerPage","options","selectedIndex","IntlProvider","definition","rppOptions","rpp","selected","revisionList","onChange","Pager","startPage","onPageSwitch","PagerButtonType","PagerButton","innerText","buttonType","Num","Next","currentPage","doPageSwitch","pageNum","selectedPages","prevButton","filter","Previous","nextButton","mainButtons","pageDest","user","rev","Flag","SourceChanged","undefined","flagFromString","Flags","getRevision","getRendered","getRenderedRevision","revert","revertToRevision","NewPage","TitleChanged","TagsChanged","Rename","utilityBlock","sourceBlock","first","inputBox","parentBlock","getParent","parents","parentText","setParent","vote","ratingText","getRatingModule","ratingModule","ratingBlock","global","Function","renameBlock","renameBox","newSlug","avatarHoverBlock","storedUserInfo","getUserInfoById","extended","userid","UserInformation","userInfo","ExtendedUserInformation","appendTo","promise","hoverBlock","pfpUrl","hoverer","pos","left","position","top","UTableRow","Modal","buttons","alt","padding","realname","gender","website","joinedSite","ModalButton","ocMethod","parentModal","destroy","jWindow","windowStyle","width","height","documentElement","scrollTop","mbd","inn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uI,EAAa,QACb,EAAA3H,iBAEFoR,EAAShS,iBACP,cACAuI,EAAI,eACJ,EAAA5H,gBAEFqR,EAAShS,iBACP,aACAuI,EAAI,eACJ,EAAA1H,cAEFmR,EAAShS,iBACP,OACAuI,EAAU,KACV,EAAA3H,iBAEFoR,EAAShS,iBACP,mBACAuI,EAAI,oBACJ,EAAA5H,gBAGKqR,IA9CLA,EAASlS,eAAgB,EAClBkS,IA+Cb,EApFA,CAA6CD,GAAhC,EAAAE","file":"bundle.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 12);\n","/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation. All rights reserved.\r\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\r\nthis file except in compliance with the License. You may obtain a copy of the\r\nLicense at http://www.apache.org/licenses/LICENSE-2.0\r\n\r\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\r\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\r\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\r\nMERCHANTABLITY OR NON-INFRINGEMENT.\r\n\r\nSee the Apache Version 2.0 License for specific language governing permissions\r\nand limitations under the License.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator], i = 0;\r\n if (m) return m.call(o);\r\n return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n","module.exports = $;","module.exports = Promise;","/*\n * deeds/index.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n/*\n An explanation for this file.\n\nIn the past versions of scipnet, each DEEDS request had its own file. Look back in the Git history to see this\nin action. There were two problems with this system:\n\n 1). It took up too much space. The bundle that resulted from this system was about 220KB in size. Half of this\n was JQuery, which I've already put a lot of effort into minimizing. 25% of this was DEEDS files. Although\n one of the goals for this project is to ensure type consistency, having half of the program code be dedicated\n just to that seems a little impractical to me.\n 2). It was inefficient. Although Browserify is efficient enough, having to load seperate instances of the JQuery\n and Bluebird modules for each request type will most likely slow down older systems.\n\nTo counteract this, there were two possible options.\n\n 1). Put every DEEDS request into one file. This would be the fastest option, but it would result in a large,\n hard-to-edit file that would somewhat ameliorate, but not entirely solve, the size issue.\n 2). Summarize every DEEDS request type via a JSON file (in this directory as \"requests.json\") and create\n functions at runtime based off of them.\n\nI have chosen to use Option 2, since in most modern browsers the creation of these functions will not incur a\nnoticeable loss in runtime performance. In the \"bin\" directory in the git root, there is a file called\n\"generate-deeds-typings.py\" which will read requests.json and generate a type bindings file to ensure type\nsafety. \n\n*/\n\n/* eslint no-undef: 0 */\n\nexports.__esModule = true;\n\nconst { createDeedsFunction } = require(\"./deeds-function\");\nconst deedsFunctions = require(\"./requests.json\");\n\nlet deedsFunction;\nfor (let i = 0; i < deedsFunctions.length; i++) {\n deedsFunction = deedsFunctions[i];\n exports[deedsFunction.name] = createDeedsFunction(deedsFunction);\n}\n","/*\n * hide-all.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// exports a function that closes out all other utility blocks\nimport * as $ from \"jquery\";\n\nconst utilityBlockIds = [\n \"utility-rating-module\",\n \"utility-edit-block\",\n \"utility-tags-block\",\n \"utility-history-block\",\n \"utility-pagesrc-block\",\n \"utility-parent-block\",\n \"utility-rename-block\"\n];\n\n// construct a selector to select all of the utilities\nconst utilityBlockSelector = $.map(utilityBlockIds, (utilityBlockId: string): string => {\n return `#${utilityBlockId}`;\n}).join(\", \");\nconst utilityBlocks = $(utilityBlockSelector);\n\nexport default function closeUtilities() { \n utilityBlocks.addClass(\"vanished\");\n}\n","module.exports = preact;","/*\n * cookies.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// a quick framework for getting, setting, and deleting cookies\nimport { Nullable } from \"./utils\";\n\n// TODO: encode() and decode() might become obsolete in future ECMA's, replace w/ something else?\n\n// toGMTString may not exist on Date types in the future, we can fix this\n// using ts-ignore to get around Typescript thinking it does not exist\n// @ts-ignore\nif (!Date.prototype.toGMTString) {\n // @ts-ignore\n Date.prototype.toGMTString = Date.prototype.toUTCString;\n}\n\n// set a cookie\nexport function setCookie(name: string, value: string, expireDays: number) {\n const expiry = new Date();\n expiry.setDate(expiry.getDate() + expireDays);\n\n const escapedValue = escape(value);\n // @ts-ignore\n const cookie = `${name}=${value}; expires=${expiry.toGMTString()}`;\n document.cookie = cookie;\n}\n\n// get a cookie\nexport function getCookie(name: string): Nullable<string> {\n if (document.cookie.length > 0) {\n // find position of cookie in total cookies\n let offset = document.cookie.indexOf(`${name}=`);\n if (offset === -1) {\n return null;\n }\n\n // to find the value, add the length of the name + 1 for the = sign\n offset += name.length + 1;\n \n // find the end of the value\n let end = document.cookie.indexOf(\";\", offset);\n if (end === -1) {\n // set end to the end of the document\n end = document.cookie.length;\n }\n\n return unescape(document.cookie.substring(offset, end));\n }\n return null;\n}\n\n// @ts-ignore\nconst alreadyExpiredDate = new Date(0).toGMTString();\n\n// delete a cookie\nexport function deleteCookie(name: string) {\n // the method used here is to set the cookie to expire instantly\n if (document.cookie.indexOf(`${name}=`) !== -1) {\n document.cookie = `${name}=; expires=${alreadyExpiredDate}`;\n }\n}\n","/*\n * utils/syncify.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// there are many instances where an async function needs to be called in a sync way,\n// e.g. a click handler. These handlers usually don't care what happens after the promise\n// is resolved. This function wraps an async function into a non-async wrapper\nimport * as BluebirdPromise from \"bluebird\";\n\nexport default function syncify(func: () => Promise<void>): () => void {\n return () => {\n func().then(() => { }).catch((err: Error) => { throw err; });\n };\n}\n","/*\n * slug.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// a simple function to retrieve the slug\nexport default function getSlug() {\n return (<any>window).pageslug;\n}\n","module.exports = preactLocalize;","/*\n * utils/unsafe.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// potentially compromised object- e.g. bad data may be put into it\nimport { Nullable } from \"./index\";\n\nexport class UnsafeObject {\n public isCompromised: boolean;\n protected continueIfCompromised: boolean;\n\n constructor() {\n this.isCompromised = false;\n this.continueIfCompromised = false;\n }\n\n protected sanitizeProperty<TIn, TOut>(\n propName: string,\n input: TIn,\n converter: (input: TIn) => TOut = x => <TOut>(<any>x),\n constraint: (input: TOut) => boolean = x => true\n ) {\n if (!this.continueIfCompromised && this.isCompromised) {\n return;\n }\n\n // attempt to get a property\n try {\n const val = converter(input);\n if (!constraint(val)) {\n throw new Error(`Value ${val} does not meet constraints`);\n }\n\n (<any>this)[propName] = val;\n } catch (err) {\n console.error(`An error occurred during deserialization: ${err}`);\n this.isCompromised = true;\n }\n }\n}\n\n// some converters to simplify the class\nexport const passThruNumber = (x: number): number => x;\nexport const passThruString = (x: string): string => x;\nexport const passThruNString = (x: Nullable<string>): Nullable<string> => x === \"\" ? null : x;\nexport const stringToDate = (x: string): Date => new Date(x);\n","/*!\n * bundle.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport * as $ from \"jquery\";\n\nimport setupAccountOptions from \"./account-options\";\nimport setupAuth from \"./login\";\nimport setupMarkdown from \"./markdown\";\nimport setupPageUtils from \"./page-utils\";\n\nimport { setupUserTrigger } from \"./user/user-module\";\n\n// document onload\n$(() => {\n console.log(\"Initialize SCIPNET onload scripts...\");\n setupAccountOptions();\n setupMarkdown();\n setupAuth();\n setupPageUtils();\n setupUserTrigger();\n});\n","/*\n * account-options.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// assigns trigger to the account options button\nimport * as $ from \"jquery\";\nimport * as BluebirdPromise from \"bluebird\";\n\nexport default function setupAccountOptions() {\n const accountButton = $(\"#account-topbutton\");\n if (accountButton.length) {\n const accountOptions = $(\"#account-options\");\n \n let currentlyDisplaying = false;\n\n const showAccountOptions = () => {\n accountOptions.css(\"display\", \"block\");\n currentlyDisplaying = true;\n accountButton.off(\"click\");\n };\n \n // hide options when no longer hovering\n // TODO: mobile support\n accountOptions.hover(() => {}, () => {\n if (currentlyDisplaying) {\n accountOptions.css(\"display\", \"none\");\n currentlyDisplaying = false;\n accountButton.click(showAccountOptions);\n }\n });\n accountButton.click(showAccountOptions);\n }\n}\n","/*\n * login/index.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// this function will simply run all of the other functions within this folder\nimport loadBeginResetPassword from \"./begin-reset-password\";\nimport setupConfirmRegistration from \"./confirm-register\";\nimport setupResetPassword from \"./reset-password\";\nimport setupLogin from \"./login\";\nimport setupRegistration from \"./register\";\n\nexport default function setupAuth() {\n if (loadBeginResetPassword()) return;\n if (setupResetPassword()) return;\n if (setupConfirmRegistration()) return;\n if (setupLogin()) return;\n if (setupRegistration()) return;\n}\n","/*\n * login/begin-reset-password.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport * as $ from \"jquery\";\nimport * as BluebirdPromise from \"bluebird\";\n\nimport { beginResetPassword, confirmResetPassword } from \"./../deeds\";\nimport { setCookie } from \"./../cookies\";\n\nimport syncify from \"./../utils/syncify\";\n\nexport default function loadBeginResetPassword(): boolean {\n const beginResetPasswordBlock = $(\"#begin-reset-password\");\n if (beginResetPasswordBlock.length) {\n const codeInputMsg = \"We sent you a code via the email address you input. Please check your email.\";\n\n // load inputs\n const emailInput = $(\"#email\"); \n const codeInput = $(\"#code\");\n const resetPasswordMsg = $(\"#reset-password-msg\");\n const submitButton = $(\"#submit-button\");\n\n const errorMessage = $(\"#error-message\");\n\n submitButton.click(syncify(async (): BluebirdPromise<void> => {\n const email = <string>emailInput.val();\n\n try {\n await beginResetPassword(email);\n\n // if this was successful, hide the email input and show the code input\n errorMessage.empty();\n emailInput.addClass(\"vanished\");\n codeInput.removeClass(\"vanished\");\n \n submitButton.off(\"click\");\n ((em: string) => { submitButton.click(syncify(async (): BluebirdPromise<void> => {\n const code = <string>codeInput.val();\n\n try {\n await confirmResetPassword(code, em);\n\n // successful, set email cookie and move on\n setCookie(\"reset-password-email\", em, 7);\n window.location.href = \"/reset-password\";\n } catch(err) {\n errorMessage.text(err.message);\n }\n })); })(email);\n } catch (err) {\n errorMessage.text(err.message);\n }\n }));\n\n return true;\n }\n\n return false;\n}\n","/*\n * deeds/deeds-function.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// hot-create functions based off of requests.json\nimport { \n DeedsMethodClass, \n DeedsRequestType,\n DeedsSuccessResult, \n makeDeedsRequest \n} from \"./basic-request\";\n\nimport * as BluebirdPromise from \"bluebird\";\n\nexport interface DeedsParameter {\n \"name\": string;\n \"type\": string;\n \"param-name\"?: string;\n}\n\nexport interface DeedsFunctionSummary {\n name: string;\n method: string;\n \"method-class\": DeedsMethodClass;\n \"request-type\": DeedsRequestType;\n \"singular-verb\": string;\n \"plural-verb\": string; \n body: Array<DeedsParameter>;\n}\n\nexport function createDeedsFunction(summary: DeedsFunctionSummary): Function {\n // pre load function with needed variables\n return (function(\n method: string,\n methodClass: DeedsMethodClass,\n requestType: DeedsRequestType,\n singularVerb: string,\n pluralVerb: string,\n body: Array<DeedsParameter>\n ) {\n return async (...args: Array<any>): BluebirdPromise<DeedsSuccessResult> => {\n let reqBody: { [key: string]: string } = {};\n let i = 0;\n for (const parameter of body) {\n reqBody[parameter.name] = args[i];\n i++;\n }\n \n return await makeDeedsRequest({\n reqInformation: { method, methodClass, requestType },\n body: reqBody\n }, singularVerb, pluralVerb);\n };\n })(\n summary.method, \n summary[\"method-class\"], \n summary[\"request-type\"],\n summary[\"singular-verb\"],\n summary[\"plural-verb\"],\n summary.body\n );\n}\n","/*\n * deeds/basic-request.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// this file contains definitions for functions and classes used to make basic requests to the DEEDS function\nimport * as $ from \"jquery\";\nimport * as path from \"path\";\nimport * as BluebirdPromise from \"bluebird\";\n\nimport getSlug from \"./../slug\";\nimport { Nullable } from \"./../utils\";\nimport { UserInfo } from \"./../user/info\";\n\nexport type DeedsRequestType = \"GET\" | \"POST\" | \"PUT\" | \"DELETE\";\n\nexport type DeedsDataTypeSingular = string | number | boolean | UserInfo | null;\nexport type DeedsArrayDataType = Array<DeedsDataTypeSingular>;\nexport type DeedsDictDataType = { [key: string]: DeedsDataTypeSingular | DeedsArrayDataType };\nexport type DeedsDataType = DeedsDataTypeSingular | DeedsArrayDataType | DeedsDictDataType;\n\nexport type DeedsBody = { [key: string]: DeedsDataType };\nexport type DeedsMethodClass = \"auth\" | \"page\" | \"user\";\n\nexport interface DeedsRequestClass {\n method: string;\n methodClass: DeedsMethodClass;\n requestType: DeedsRequestType;\n}\n\nexport interface DeedsRequest {\n reqInformation: DeedsRequestClass;\n body: DeedsBody;\n}\n\nexport interface DeedsErrorResult {\n \"err-type\": string;\n error: string;\n}\n\nexport interface DeedsSuccessResult {\n result: DeedsBody; \n}\n\nexport type DeedsResult = DeedsErrorResult | DeedsSuccessResult;\n\nexport async function makeDeedsRequest(\n request: DeedsRequest,\n taskDescription: string,\n taskDescriptionPlural: string\n): BluebirdPromise<DeedsSuccessResult> { \n const uri = `/sys/${request.reqInformation.methodClass}/${request.reqInformation.method}`;\n\n let sentObject = {\n params: request.body,\n pagename: <Nullable<string>>null\n };\n \n // set additional needed parameters\n if (request.reqInformation.methodClass === \"page\") { \n sentObject.pagename = getSlug();\n }\n\n // send AJAX request\n let res;\n try {\n res = await $.ajax(uri, {\n data: sentObject,\n dataType: \"JSON\",\n method: request.reqInformation.requestType \n });\n } catch(err) {\n let errorMessage = err;\n if (errorMessage.message) {\n errorMessage = errorMessage.message;\n }\n throw new Error(`An AJAX error occured: ${errorMessage}`);\n }\n \n if ((<DeedsErrorResult>res).error) {\n // tell what kind of error we have\n const error = (<DeedsErrorResult>res).error;\n const errType = (<DeedsErrorResult>res)[\"err-type\"];\n if (errType === \"not-logged-in\") {\n throw new Error(`Must be logged in in order to ${taskDescriptionPlural}`);\n } else if (errType === \"internal-error\") {\n throw new Error(\"An internal error occurred. Please contact a system administrator.\");\n } else {\n throw new Error(`An error occurred while attempting to ${taskDescription}: ${error}`);\n }\n } else {\n return <DeedsSuccessResult>res;\n }\n}\n","/*\n * login/confirm-register.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// setup the form to confirm registration\nimport * as $ from \"jquery\";\nimport * as BluebirdPromise from \"bluebird\";\n\nimport { confirmRegistration } from \"./../deeds\";\nimport { deleteCookie, getCookie } from \"./../cookies\";\nimport syncify from \"./../utils/syncify\";\n\nconst noConfEmail = \n `<p>\n An error occurred while attempting to retrieve a confirmation email. <a href=\"/\">Return to the home page</a>.\n </p>`;\n\nconst enterCodeBegin = \"Please enter the code recieved by the email address \";\nconst enterCodeEnd = \" into to finish registering your account.\";\n\nexport default function loadConfirmRegistration(): boolean {\n const crBlock = $(\"#confirm-register-form\");\n if (crBlock.length) {\n // check to see if there is a registration attempt cookie\n const email = getCookie(\"registration-attempt-email\");\n if (!email) {\n crBlock.html(noConfEmail);\n return; \n }\n\n const crMessage = $(\"#confirm-register-message\");\n const crInputBox = $(\"#register-code-box\");\n\n const errorMessage = $(\"#error-message\");\n \n crMessage.text([enterCodeBegin, email, enterCodeEnd].join(\"\"));\n\n $(\"#submit-button\").click(syncify(async (): BluebirdPromise<void> => {\n try {\n await confirmRegistration(<string>crInputBox.val(), email);\n\n // we're logged in\n deleteCookie(\"registration-attempt-email\");\n window.location.href = \"/sys/login\";\n } catch (err) {\n errorMessage.text(err.message); \n }\n }));\n\n return true;\n }\n\n return false;\n}\n","/*\n * login/reset-password.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport * as $ from \"jquery\";\nimport * as BluebirdPromise from \"bluebird\";\n\nimport { deleteCookie, getCookie } from \"./../cookies\";\nimport { resetPassword } from \"./../deeds\";\n\nimport syncify from \"./../utils/syncify\";\n\n// form to finish the password reset process\nexport default function setupResetPassword(): boolean {\n const resetPasswordBlock = $(\"#reset-password\");\n if (resetPasswordBlock.length) {\n const newPasswordInput = $(\"#new-password\");\n const cNewPasswordInput = $(\"#confirm-new-password\");\n\n const email = getCookie(\"reset-password-email\");\n \n const errorMessage = $(\"#error-message\");\n\n $(\"#submit-button\").click(syncify(async (): BluebirdPromise<void> => {\n const newPassword = <string>newPasswordInput.val();\n const cNewPassword = <string>cNewPasswordInput.val();\n\n if (newPassword !== cNewPassword) {\n errorMessage.text(\"Passwords do not match\");\n return;\n }\n\n try {\n await resetPassword(email, newPassword);\n deleteCookie(\"reset-password-email\");\n window.location.href = \"/login\";\n } catch (err) {\n errorMessage.text(err.message);\n }\n }));\n\n return true;\n }\n\n return false;\n}\n","/*\n * login/login.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// setup for the login form\nimport * as $ from \"jquery\";\nimport * as BluebirdPromise from \"bluebird\";\n\nimport { login } from \"./../deeds\";\nimport { setCookie } from \"./../cookies\";\n\nimport syncify from \"./../utils/syncify\";\n\nexport default function setupLogin(): boolean {\n const loginBlock = $(\"#login-form\");\n if (loginBlock.length) {\n const usernameInput = $(\"#username\");\n const passwordInput = $(\"#password\");\n const rememberMe = $(\"#remember-me\");\n \n const errorMessage = $(\"#error-message\");\n\n $(\"#submit-button\").click(syncify(async (): BluebirdPromise<void> => {\n try {\n const { result } = await login(<string>usernameInput.val(), <string>passwordInput.val());\n const authSession = <string>result[\"auth-session\"];\n const cookiePreserveTime = <number>result[\"cookie-preserve-time\"];\n\n setCookie(\"auth-session\", authSession, cookiePreserveTime);\n\n // reload to main page\n window.location.href = \"/\";\n } catch (err) {\n // deeds/basic-request already formats the errors for us\n errorMessage.text(err.message);\n }\n }));\n\n return true;\n }\n\n return false;\n}\n","/*\n * login/register.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// setup the registration form\nimport * as $ from \"jquery\";\nimport * as BluebirdPromise from \"bluebird\";\n\nimport { register } from \"./../deeds\";\nimport { setCookie } from \"./../cookies\";\n\nimport syncify from \"./../utils/syncify\";\n\n// email regex\nconst emailRegex = /^(([^<>()\\[\\]\\\\.,;:\\s@\"]+(\\.[^<>()\\[\\]\\\\.,;:\\s@\"]+)*)|(\".+\"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z\\-0-9]+\\.)+[a-zA-Z]{2,}))$/; // eslint-disable-line no-useless-escape\n\nexport default function setupRegistration(): boolean {\n const registerBlock = $(\"#register-form\");\n if (registerBlock.length) {\n const usernameInput = $(\"#username\");\n const emailInput = $(\"#email\");\n const cEmailInput = $(\"#confirm-email\");\n const passwordInput = $(\"#password\");\n const cPasswordInput = $(\"#confirm-password\");\n\n const inputs = [usernameInput, emailInput, cEmailInput, passwordInput, cPasswordInput];\n\n const emailError = $(\"#email-error\");\n const passwordError = $(\"#password-error\");\n\n const errorMessage = $(\"#error-message\");\n\n // reset new elements (e.g. error border)\n const resetElements = function() {\n for (const input of inputs) {\n input.css(\"border-color\", \"black\");\n }\n\n emailError.empty();\n errorMessage.empty();\n passwordError.empty(); \n };\n\n $(\"#submit-button\").click(syncify(async (): BluebirdPromise<void> => {\n resetElements();\n\n const username = <string>usernameInput.val();\n const email = <string>emailInput.val();\n const cEmail = <string>cEmailInput.val();\n const password = <string>passwordInput.val();\n const cPassword = <string>cPasswordInput.val(); \n\n let isError = false;\n\n // check for confirmations\n if (email !== cEmail) {\n isError = true;\n $().add(emailInput).add(cEmailInput).css(\"border-color\", \"red\");\n emailError.text(\"Emails do not match\");\n }\n\n if (password !== cPassword) {\n isError = true;\n $().add(passwordInput).add(cPasswordInput).css(\"border-color\", \"red\");\n passwordError.text(\"Passwords do not match\");\n }\n\n // make sure the email is proper\n if (!isError && !emailRegex.test(email)) {\n isError = true;\n $().add(email).add(cEmail).css(\"border-color\", \"red\");\n emailError.text(\"Email is not a valid email address\");\n }\n\n if (isError) {\n return;\n }\n\n try {\n await register(username, email, password);\n \n setCookie(\"registration-attempt-email\", email, 7);\n\n // go to confirmation page\n window.location.href = \"/sys/confirm-register\";\n } catch (err) {\n errorMessage.text(err.message);\n }\n }));\n\n return true;\n }\n\n return false;\n}\n","/*\n * index.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport collapsibleSetup from \"./collapsible\";\nimport tabviewSetup from \"./tabview\";\n\nexport default function markdownSetup() {\n collapsibleSetup();\n tabviewSetup();\n}\n","/*\n * collapsible.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// code to make collapsibles work\nimport * as $ from \"jquery\";\nimport * as BluebirdPromise from \"bluebird\";\n\nimport { h, render, Component } from \"preact\";\n\nexport interface CollapsibleProps {\n openlink: string;\n closelink: string;\n linkLocation: number;\n contents: Element[];\n}\n\nexport interface CollapsibleState {\n show: boolean;\n contentOpacity: number;\n}\n\nconst openTime = 500;\nconst interval = 5;\nconst opacityIncrement = 1 / (openTime / interval);\n\nexport interface CollapsibleLinkProps {\n text: string;\n onClick: () => void;\n}\n\n// the link of a collapsible\nfunction CollapsibleLink(props: CollapsibleLinkProps) {\n return (\n <a class=\"collapsible-block-link\" onClick={props.onClick}>{props.text}</a>\n );\n}\n\nexport class Collapsible extends Component<CollapsibleProps, CollapsibleState> {\n constructor(props: CollapsibleProps) {\n super(props);\n console.log(this.props);\n\n this.state = {\n show: false,\n contentOpacity: 0\n };\n }\n\n // slowly make the collapsible more clear\n opacityShader() {\n if (this.state.contentOpacity >= 1) {\n return;\n }\n\n this.setState((prevState: CollapsibleState): CollapsibleState => {\n return Object.assign({}, prevState, { contentOpacity: prevState.contentOpacity + opacityIncrement });\n }, () => {\n setTimeout(this.opacityShader.bind(this), interval);\n });\n }\n\n componentDidUpdate(prevProps: CollapsibleProps, prevState: CollapsibleState) {\n if (prevState.show !== this.state.show && this.state.show) {\n setTimeout(this.opacityShader.bind(this), interval);\n }\n }\n\n setInner(ref: HTMLElement | null) {\n if (ref) {\n ref.innerHTML = \"\";\n if (this.props.contents.length > 0) {\n for (const elem of this.props.contents) {\n ref.appendChild(elem);\n }\n }\n }\n }\n\n changeState() {\n console.log(\"Changing state\");\n this.setState(s => Object.assign({}, s, { show: !s.show, contentOpacity: 0 }));\n }\n\n render() {\n const blockStyle = {\n opacity: this.state.contentOpacity\n };\n\n const stateChanger = this.changeState.bind(this);\n const folded = this.state.show ? \"unfolded\" : \"folded\";\n\n const link = <CollapsibleLink text={this.state.show ? this.props.closelink : this.props.openlink}\n onClick={stateChanger} />;\n const topHeader = this.props.linkLocation & 1\n ? link\n : <span></span>;\n const bottomHeader = this.props.linkLocation & 2 && this.state.show\n ? link\n : <span></span>;\n \n\n return (\n <div class=\"collapsible-block\">\n <div class={`collapsible-block-${folded}`}>\n <div class={`collapsible-block-${folded}-link`}>\n { this.state.show ? link : topHeader }\n </div>\n <div style={blockStyle} class={ this.state.show ? \"\" : \"vanished\" } ref={this.setInner.bind(this)}>\n { this.props.children }\n </div>\n <div class={`collapsible-block-${folded}-link`}>\n { this.state.show ? <span></span> : bottomHeader }\n </div>\n </div>\n </div>\n );\n }\n}\n\nexport default function collapsibleSetup() {\n const collapsibles = $(\".ftml--collapsible\");\n\n collapsibles.each(function(this: HTMLElement) {\n const jThis = $(this);\n const openlink = jThis.attr(\"data-openlink\");\n const closelink = jThis.attr(\"data-closelink\");\n const linkLocation = parseInt(jThis.attr(\"data-link-location\"), 10);\n const contents = Array.from(this.children); \n\n this.innerHTML = \"\";\n\n render(<Collapsible openlink={openlink} closelink={closelink} linkLocation={linkLocation} contents={contents}></Collapsible>, this);\n });\n}\n","/*\n * tabview.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport * as $ from \"jquery\";\n\n// \"JQuery\" can act as an array for html elements\ninterface TabView {\n selectors: JQuery;\n tabs: JQuery; \n}\n\nfunction tabviewFromSelector(selector: HTMLElement): TabView {\n let root = $(selector);\n while (!root.hasClass(\"tabview\")) {\n root = root.parent(); // TODO: exit condition\n }\n\n return {\n selectors: root.find(\".tab-selector\"),\n tabs: root.find(\".tab-content\")\n };\n}\n\nfunction switchTab(tabView: TabView, tab: number) {\n tabView.selectors.removeClass(\"active\");\n tabView.selectors.find(\"a\").attr(\"title\", \"\");\n\n const tabContent = $(tabView.selectors[tab]);\n tabContent.addClass(\"active\");\n tabContent.find(\"a\").attr(\"title\", \"Active\");\n \n tabView.tabs.css(\"display\", \"none\"); \n $(tabView.tabs[tab]).css(\"display\", \"block\");\n}\n\nexport default function tabviewSetup() {\n $(\".tabview\").each(function(this: HTMLElement) {\n $(this).find(\".tab-selector\").each(function(index: number, obj: HTMLElement) {\n let localizedIndex = index;\n $(obj).find(\"a\").click(function(this: HTMLElement) {\n switchTab(tabviewFromSelector(this), localizedIndex);\n });\n });\n\n switchTab(tabviewFromSelector(this), 0);\n }); \n}\n","/*\n * page-utils/index.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// set up triggers relating to page utilities\nimport * as $ from \"jquery\";\nimport * as BluebirdPromise from \"bluebird\";\n\nimport closeUtilities from \"./hide-all\";\n\nimport { beginEditPage, cancelEditPage, savePage, setupEditLockTrigger } from \"./edit\";\nimport { clearTags, openTagBlock, submitTags } from \"./tags\";\nimport { nonIntrusiveDialog } from \"./../dialog\";\nimport { openHistoryBlock } from \"./history\";\nimport { openPageSourceBlock } from \"./page-source\";\nimport { openParentBlock, submitParents } from \"./parent\";\nimport { openRatingBlock, ratePage } from \"./rating\";\nimport { openRenameBlock, renamePage } from \"./rename\";\n\n// wrap promises related to page utils\n// NOTE: not using syncify to take advantage of nonIntrusiveDialog function\nfunction promiseWrapper(func: () => BluebirdPromise<void>): () => void {\n return function() {\n func().then(() => {}).catch((err: Error) => {\n nonIntrusiveDialog(\"Error\", err.message);\n });\n };\n}\n\n// setup rating trigger\nfunction setupRatingTrigger(className: string, rating: number) {\n $(\".page-rate-widget-box\")\n .find(`.${className}`)\n .find(\"a\")\n .click(promiseWrapper(async (): BluebirdPromise<void> => {\n await ratePage(rating);\n }));\n}\n\n// setup triggers for page utilities\nexport default function setupPageUtils() {\n setupRatingTrigger(\"rateup\", 1);\n setupRatingTrigger(\"ratedown\", -1);\n setupRatingTrigger(\"cancel\", 0);\n\n setupEditLockTrigger();\n\n // add triggers to utility links\n $(\"#utility-edit-link\").click(promiseWrapper(beginEditPage));\n $(\"#utility-history-link\").click(promiseWrapper(openHistoryBlock));\n $(\"#utility-parent-link\").click(promiseWrapper(openParentBlock));\n $(\"#utility-pagesrc-link\").click(promiseWrapper(openPageSourceBlock));\n $(\"#utility-rating-link\").click(openRatingBlock);\n $(\"#utility-rename-link\").click(openRenameBlock);\n $(\"#utility-tags-link\").click(promiseWrapper(openTagBlock));\n\n // add triggers to editor\n $(\"#edit-cancel-button\").click(promiseWrapper(cancelEditPage));\n $(\"#edit-sac-button\").click(promiseWrapper(async (): BluebirdPromise<void> => {\n await savePage(false);\n }));\n $(\"#edit-save-button\").click(promiseWrapper(async (): BluebirdPromise<void> => {\n await savePage(true);\n }));\n\n // add triggers to tagger\n $(\"#tags-submit-button\").click(promiseWrapper(submitTags));\n $(\"#tags-clear-button\").click(clearTags);\n $(\"#tags-cancel-button\").click(closeUtilities);\n\n // add triggers to parent editor\n $(\"#parent-submit-button\").click(promiseWrapper(submitParents));\n $(\"#parent-cancel-button\").click(closeUtilities);\n\n // add triggers to renamer\n $(\"#rename-submit-button\").click(promiseWrapper(renamePage));\n $(\"#rename-cancel-button\").click(closeUtilities);\n}\n","/*\n * edit.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// functions for editing the page\nimport * as $ from \"jquery\";\nimport * as BluebirdPromise from \"bluebird\";\n\nimport closeUtilities from \"./hide-all\";\n\nimport { cancelEditLock, getSource, setSource, setEditLock } from \"./../deeds\";\n\nlet currentlyTyping = false;\nlet editlockTimeout: ReturnType<typeof setTimeout>;\n\n// set timeout notification\nfunction setTimeoutNotification(secondsLeft: number) {\n $(\"#edit-editlock-notification\")\n .html(`<b>Your edit lock will expire in ${secondsLeft} seconds.</b>`);\n\n if (secondsLeft > 0 && !currentlyTyping) {\n editlockTimeout = setTimeout(() => {\n setTimeoutNotification(secondsLeft - 1);\n }, 1000);\n }\n}\n\nexport async function beginEditPage(): BluebirdPromise<void> {\n closeUtilities();\n\n // first, set up an edit lock\n const editLockSeconds = (await setEditLock()).result[\"edit-lock-seconds\"];\n\n // then, get the current page's source\n const source = (await getSource()).result.src;\n \n // open up the part of the page with the editor and fill in the source \n $(\"#edit-source-box\").val(<string>source);\n setTimeoutNotification(<number>editLockSeconds);\n $(\"#utility-edit-block\").removeClass(\"vanished\");\n}\n\nexport async function savePage(refresh: boolean): BluebirdPromise<void> {\n const src = <string>$(\"#edit-source-box\").val();\n const title = <string>$(\"#edit-title-box\").val();\n const comment = <string>$(\"#edit-comment-box\").val();\n\n await setSource(src, title, comment);\n\n if (refresh) {\n window.location.reload();\n }\n}\n\nexport async function cancelEditPage(): BluebirdPromise<void> {\n await cancelEditLock();\n\n clearTimeout(editlockTimeout);\n closeUtilities();\n}\n\nlet keyTimer: ReturnType<typeof setTimeout>;\nconst stopInterval = 200;\n\n// reset the edit lock\nasync function resetEditLock(): BluebirdPromise<void> {\n const elSeconds = (await setEditLock()).result[\"edit-lock-seconds\"];\n setTimeoutNotification(<number>elSeconds);\n}\n\nfunction resetEditLockSync() {\n resetEditLock().then(() => { }).catch((err: Error) => { throw err; });\n}\n\n// setup to reset editlock after user has not typed for some time\nexport function setupEditLockTrigger() {\n $(\"#edit-source-box\").keyup(() => {\n clearTimeout(keyTimer);\n keyTimer = setTimeout(resetEditLockSync, stopInterval);\n }).keydown(() => {\n clearTimeout(keyTimer);\n });\n}\n","/*\n * tags.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// functions for tagging the page\nimport * as $ from \"jquery\";\nimport * as BluebirdPromise from \"bluebird\";\n\nimport closeUtilities from \"./hide-all\";\nimport { getTags, setTags } from \"./../deeds\";\n\n// store the tag blocks here for speed purposes\nconst tagBlock = $(\"#utility-tags-block\");\nconst tagEntry = $(\"#tags-box\");\n\nexport async function openTagBlock(): BluebirdPromise<void> {\n closeUtilities();\n\n const tags = (await getTags()).result.tags;\n const tagString = (<string[]>tags).join(\" \");\n tagEntry.val(tagString);\n tagBlock.removeClass(\"vanished\");\n}\n\nexport async function submitTags(): BluebirdPromise<void> {\n const tags = (<string>tagEntry.val()).split(\" \");\n await setTags(tags);\n \n // TODO: decide whether or not to reload page\n window.location.reload();\n}\n\nexport function clearTags() {\n tagEntry.val(\"\");\n}\n","/*\n * dialog.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// intrusive and non-intrusive dialogs\nexport function nonIntrusiveDialog(title: string, message: string) {\n // TODO: dialog system\n alert(`${title}: ${message}`);\n}\n","/*\n * page-utils/history.tsx\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport * as BluebirdPromise from \"bluebird\";\nimport * as $ from \"jquery\";\n\nimport { h, render } from \"preact\";\nimport { HistoryWidget } from \"./../history\";\n\nimport closeUtilities from \"./hide-all\";\n\nconst hBlock = $(\"#utility-history-block\");\n\nexport async function openHistoryBlock(): BluebirdPromise<void> {\n closeUtilities();\n render(<HistoryWidget />, hBlock.get(0));\n hBlock.removeClass(\"vanished\");\n}\n","/*\n * history/index.tsx\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// contains methods for geting and converting page history, as well as a widget\nimport * as $ from \"jquery\";\nimport * as BluebirdPromise from \"bluebird\";\nimport * as definition from \"../../locales/en.json\";\n\nimport { DeedsSuccessResult } from \"./../deeds/basic-request\";\nimport { getHistory } from \"./../deeds\";\nimport { h, Component } from \"preact\";\nimport { IntlProvider, Text as IntlText } from \"preact-i18n\";\nimport { Nullable } from \"./../utils\";\nimport { Pager } from \"./../widgets/pager\";\nimport { Revision } from \"./revision\";\n\nconst revisionsPerPageOptions = [\n 10,\n 20,\n 50,\n 100,\n 200\n];\n\n// a radio button in a row in a revision table\ninterface CompareSelectionRadioProps {\n revKey: number;\n isTo: boolean;\n}\n\nfunction CompareSelectionRadio(props: CompareSelectionRadioProps) {\n // make sure we only do the string concat operation once\n const rkAsString = `${props.revKey}`;\n\n return (\n <input type=\"radio\" id={rkAsString} value={rkAsString}\n name={props.isTo ? \"to\" : \"from\"} />\n );\n}\n\n// represents a row in the history table\ninterface RevisionRowProps {\n revision: Revision;\n}\n\nfunction RevisionRow(props: RevisionRowProps) {\n const revKey = props.revision.revKey;\n const editedOn = props.revision.editedOn;\n\n // TODO: action switch buttons\n // TODO: standardize date\n return (\n <tr id={`revision-${revKey}`}>\n <td>{props.revision.revId}</td>\n <td>\n <CompareSelectionRadio revKey={revKey} isTo={false} />\n <CompareSelectionRadio revKey={revKey} isTo={true} />\n </td>\n <td>{props.revision.flag}</td>\n <td></td>\n <td>{`${editedOn.getMonth()} ${editedOn.getDay()} ${editedOn.getFullYear()}`}</td>\n <td>{props.revision.comment}</td>\n </tr>\n );\n}\n\nexport interface HistoryWidgetState {\n revisions: Array<Revision>;\n page: number;\n revisionsPerPage: number;\n totalPages: number;\n\n doingInitLoading: boolean;\n}\n\nexport class HistoryWidget extends Component<{}, HistoryWidgetState> {\n ongoingRequest: Nullable<BluebirdPromise<void>>;\n\n constructor(props: {}) { \n super(props);\n\n this.ongoingRequest = null;\n\n this.state = {\n revisions: [],\n page: 0,\n revisionsPerPage: 20,\n totalPages: 0,\n \n doingInitLoading: true\n };\n }\n\n // load new revisions\n private loadRevisions() {\n this.ongoingRequest = getHistory(this.state.page, this.state.revisionsPerPage)\n .then((res: DeedsSuccessResult) => {\n const { result } = res;\n\n this.ongoingRequest = null;\n this.setState((prevState: HistoryWidgetState): HistoryWidgetState => {\n const revisions = (result.revisions as Array<any>).map(Revision.deserialize);\n return Object.assign({}, prevState, { \n doingInitLoading: false,\n revisions,\n totalPages: result.totalPages as number\n });\n });\n });\n }\n \n // run when component has mounted\n componentDidMount() {\n this.loadRevisions();\n }\n\n // if there's an ongoing request when the component is unmounted, cancel it\n componentWillUnmount() {\n if (this.ongoingRequest) {\n this.ongoingRequest.cancel();\n }\n }\n\n componentDidUpdate(prevProps: {}, prevState: HistoryWidgetState) {\n // only load new revisions if the state's page/revisions per page was updated\n if (this.state.page !== prevState.page ||\n this.state.revisionsPerPage !== prevState.revisionsPerPage) {\n this.loadRevisions();\n }\n }\n\n // needs to be async because the pager only takes async functions\n async switchPage(page: number): Promise<void> {\n return new Promise((resolve: () => void) => {\n this.setState((prevState: HistoryWidgetState): HistoryWidgetState => {\n return Object.assign({}, prevState, { page });\n }, resolve);\n });\n }\n\n // change the number of revisions per page\n changeRevisionsPerPage(e: Event) {\n const selector = e.target as HTMLSelectElement;\n this.setState((prevState: HistoryWidgetState): HistoryWidgetState => {\n return Object.assign({}, prevState, { revisionsPerPage: selector.options[selector.selectedIndex].value });\n });\n }\n\n render() {\n const pageSwitchFunction = async (p: number): Promise<void> => await this.switchPage(p);\n\n // if we're still loading, just display a simple loading block\n if (this.state.doingInitLoading) {\n return (\n <IntlProvider definition={definition}>\n <p style=\"text-align: center\"><IntlText id=\"history.load\">Loading...</IntlText></p>\n </IntlProvider>\n );\n }\n\n const rppOptions = revisionsPerPageOptions.map((rpp: number) => {\n const selected = this.state.revisionsPerPage === rpp;\n return <option value={rpp} selected={selected}>{rpp}</option>;\n });\n\n const revisionList = this.state.revisions.map((revision: Revision) => {\n return <RevisionRow revision={revision} />;\n });\n\n return (\n <IntlProvider definition={definition}>\n <form id=\"utility-history-block\">\n <table class=\"form\">\n <tbody>\n <tr>\n <td><IntlText id=\"rpp\">Revisions per page:</IntlText></td>\n <td>\n <select onChange={(e: Event) => this.changeRevisionsPerPage(e)}>\n {rppOptions}\n </select>\n </td>\n </tr>\n </tbody>\n </table>\n <div id=\"buttons\">\n <input id=\"update-button\"\n class=\"btn btn-default btn-sm\"\n type=\"button\"\n value=\"Update List\" \n onClick={this.loadRevisions.bind(this)} />\n <input id=\"compare-button\"\n class=\"btn btn-default btn-sm\"\n type=\"button\"\n value=\"Compare versions\" />\n </div>\n <div id=\"revision-list\">\n <Pager totalPages={this.state.totalPages} \n startPage={this.state.page} \n onPageSwitch={pageSwitchFunction} \n />\n <table class=\"page-history\">\n <tbody>\n <tr>\n <td><IntlText id=\"history.rev\">rev.</IntlText></td>\n <td> </td>\n <td><IntlText id=\"history.flags\">flags</IntlText></td>\n <td><IntlText id=\"history.ations\">actions</IntlText></td>\n <td><IntlText id=\"history.by\">by</IntlText></td>\n <td><IntlText id=\"history.date\">date</IntlText></td>\n <td><IntlText id=\"history.comments\">comments</IntlText></td>\n </tr>\n {revisionList}\n </tbody>\n </table>\n </div>\n </form>\n </IntlProvider>\n );\n }\n}\n","/*\n * widgets/pager.tsx\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n **/\n\nimport * as $ from \"jquery\";\nimport * as BluebirdPromise from \"bluebird\";\nimport * as definition from \"../../locales/en.json\";\n\nimport { h, Component } from \"preact\";\nimport { IntlProvider, Text as IntlText } from \"preact-i18n\";\n\nexport type PageSwitchFunction = (page: number) => Promise<void>;\n\nexport interface PagerProps {\n onPageSwitch: PageSwitchFunction;\n totalPages: number;\n startPage: number;\n};\n\nexport interface PagerState {\n currentPage: number;\n};\n\nenum PagerButtonType {\n Next,\n Previous,\n Num\n}\n\n// a button within a pager\ninterface PagerButtonProps {\n onClick: () => void;\n selected: boolean;\n text: string;\n buttonType: PagerButtonType;\n}\n\nfunction PagerButton(props: PagerButtonProps) {\n if (props.selected) {\n return <span class=\"current\" onClick={props.onClick}>{props.text}</span>;\n } else {\n let innerText;\n if (props.buttonType === PagerButtonType.Num) {\n innerText = props.text;\n } else {\n const label = props.buttonType === PagerButtonType.Next ? \"next\" : \"previous\";\n innerText = <IntlText id={`pager/${label}`}>{props.text}</IntlText>;\n }\n return <span class=\"target\"> onClick={props.onClick}<a>{innerText}</a></span>;\n }\n}\n\n// pager for switching between pages\nexport class Pager extends Component<PagerProps, PagerState> {\n constructor(props: PagerProps) {\n super(props);\n \n this.state = {\n currentPage: this.props.startPage\n }\n }\n\n // default properties\n static get defaultProps(): PagerProps {\n return {\n onPageSwitch: Promise.resolve,\n totalPages: 1,\n startPage: 0\n }\n }\n\n doPageSwitch(page: number) {\n this.props.onPageSwitch(page).then(() => {\n this.setState((state: PagerState): PagerState => {\n return { currentPage: page };\n });\n });\n }\n\n render() {\n // configurable constants\n const numPagesFromCurrent = 2;\n const numAtBeginning = 2;\n const numAtEnd = 0;\n \n const pageNum = this.state.currentPage;\n\n let selectedPages = [];\n for (let i = 0; i <= numPagesFromCurrent; i++) {\n selectedPages.push(pageNum + i);\n if (i !== 0) {\n selectedPages.push(pageNum - i);\n }\n }\n selectedPages = selectedPages.filter((x: number): boolean => x >= 0 && x < this.props.totalPages); \n\n // create the buttons that enable page-switching\n const prevButton = selectedPages[0] !== pageNum\n ? <PagerButton text=\"« previous\" \n buttonType={PagerButtonType.Previous} \n selected={false} \n onClick={() => this.doPageSwitch(pageNum - 1)}/>\n : \"\";\n\n const nextButton = selectedPages[selectedPages.length - 1] !== pageNum\n ? <PagerButton text=\"next »\" \n buttonType={PagerButtonType.Next}\n selected={false} \n onClick={() => this.doPageSwitch(pageNum + 1)}/>\n : \"\";\n\n const mainButtons = selectedPages.map((pageDest: number) => \n <PagerButton text={`${pageDest}`}\n buttonType={PagerButtonType.Num}\n selected={pageDest === pageNum}\n onClick={() => this.doPageSwitch(pageDest)}\n />\n );\n\n return (\n <IntlProvider definition={definition}>\n <div class=\"pager\">\n <span class=\"pager-no\">{pageNum}</span>\n {prevButton}\n {mainButtons}\n {nextButton}\n </div>\n </IntlProvider>\n );\n }\n}\n","/*\n * revision.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// defines a revision object\n// for more information, see https://github.com/Nu-SCPTheme/scipnet/blob/master/src/deeds/README.md#get-syspagehistory\n\nimport * as BluebirdPromise from \"bluebird\";\n\nimport { flagFromString, Flag, Flags } from \"./flags\";\nimport { passThruNumber, stringToDate, UnsafeObject } from \"./../utils/unsafe\";\n\nimport { getRenderedRevision, getRevision, revertToRevision } from \"./../deeds\";\n\nexport class Revision extends UnsafeObject {\n constructor(\n public revKey: number, // primary key to revision object in database\n public revId: number, // the number of the revision (e.g. 2 for the 2nd revision after the original)\n public flag: Flag,\n public user: string, // username module in HTML defining the user\n public editedOn: Date,\n public comment: string\n ) { \n super();\n this.continueIfCompromised = false;\n }\n\n // deserialize this object from another one\n static deserialize(obj: any): Revision {\n const rev = new Revision(-1,-1,Flag.SourceChanged,\"\",new Date(),\"\");\n\n rev.sanitizeProperty<number, number>(\n \"revKey\", \n obj[\"rev-key\"] || obj.revKey, \n passThruNumber, \n (x: number): boolean => x > 0\n );\n rev.sanitizeProperty<number, number>(\n \"revId\", \n obj[\"rev-id\"] === undefined ? obj.revId : obj[\"rev-id\"],\n passThruNumber,\n (x: number): boolean => (x >= 0)\n );\n rev.sanitizeProperty<string, Flag>(\n \"flag\", \n obj.flag, \n flagFromString, \n (x: Flag): boolean => Flags.indexOf(x) !== -1\n );\n rev.sanitizeProperty<string, Date>(\n \"editedOn\", \n obj[\"edited-on\"] || obj.editedOn,\n stringToDate\n );\n rev.sanitizeProperty<string, string>(\"comment\", obj.comment);\n\n return rev;\n }\n \n // get the source of a revision\n async getSource(): BluebirdPromise<string> {\n if (this.isCompromised) return \"\";\n\n const res = await getRevision(this.revKey);\n return <string> (res.result || {}).src || \"\";\n }\n\n // get the rendered source of the revision\n async getRendered(): BluebirdPromise<string> {\n if (this.isCompromised) return \"\";\n \n const res = await getRenderedRevision(this.revKey);\n return <string> (res.result || {}).src || \"\";\n }\n\n // revert to this revision\n async revert(): BluebirdPromise<void> {\n if (this.isCompromised) return;\n\n await revertToRevision(this.revKey);\n }\n}\n","/*\n * flags.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nexport enum Flag {\n NewPage = \"N\",\n SourceChanged = \"S\",\n TitleChanged = \"T\",\n TagsChanged = \"A\",\n Rename = \"R\"\n}\n\n// convert a string representation of a flag to a flag\nexport function flagFromString(s: string): Flag {\n switch (s) {\n case \"N\": return Flag.NewPage;\n case \"S\": return Flag.SourceChanged;\n case \"T\": return Flag.TitleChanged;\n case \"A\": return Flag.TagsChanged;\n case \"R\": return Flag.Rename;\n default: throw new Error(`Invalid flag: ${s}`);\n }\n}\n\nexport const Flags = [Flag.NewPage, Flag.SourceChanged, Flag.TitleChanged, Flag.TagsChanged, Flag.Rename];\n","/*\n * page-source.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// gets the page source\nimport * as $ from \"jquery\";\nimport * as BluebirdPromise from \"bluebird\";\n\nimport closeUtilities from \"./hide-all\";\nimport { getSource } from \"./../deeds\";\n\n// store blocks here for speed\nconst utilityBlock = $(\"#utility-pagesrc-block\");\nconst sourceBlock = $(\".page-source\").first();\n\n// loads the page source and opens the page source block\nexport async function openPageSourceBlock(): BluebirdPromise<void> {\n closeUtilities();\n\n const { result } = await getSource();\n sourceBlock.text(<string>result.src);\n utilityBlock.removeClass(\"vanished\");\n}\n","/*\n * page-utils/parent.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// set a page's parent\nimport * as $ from \"jquery\";\nimport * as BluebirdPromise from \"bluebird\";\n\nimport closeUtilities from \"./hide-all\";\nimport { getParent, setParent } from \"./../deeds\";\n\nconst inputBox = $(\"#parent-box\");\nconst parentBlock = $(\"#utility-parent-block\");\n\nexport async function openParentBlock(): BluebirdPromise<void> {\n closeUtilities();\n\n const { result } = await getParent();\n const { parents } = result;\n const parentText = (<Array<string>>parents).join(\" \");\n\n inputBox.val(parentText); \n parentBlock.removeClass(\"vanished\");\n}\n\nexport async function submitParents(): BluebirdPromise<void> {\n const parents = (<string>inputBox.val()).split(\" \");\n await setParent(parents);\n\n window.location.reload();\n}\n","/*\n * rating.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// functions that have to do with ratings\nimport * as $ from \"jquery\";\nimport * as BluebirdPromise from \"bluebird\";\n\nimport closeUtilities from \"./hide-all\";\n\nimport { getRatingModule, vote } from \"./../deeds\";\n\nexport async function ratePage(rating: number): BluebirdPromise<void> {\n console.log(`Calling ratePage with rating ${rating}`);\n\n if (rating > 1 || rating < -1) {\n throw new Error(\"Invalid rating value\");\n }\n\n const res = (await vote(rating)).result;\n\n let ratingText = `${res.rating}`;\n if (res.rating > 0) {\n ratingText = `+${ratingText}`;\n }\n\n $(\".rating\").html(`rating: ${ratingText}`);\n}\n\n// opens the rating module block\nexport async function openRatingBlock(): BluebirdPromise<void> {\n closeUtilities();\n\n // get the source for the rating module\n const { result } = await getRatingModule();\n const ratingModule = <string> result[\"rating-module\"];\n\n const ratingBlock = $(\"#utility-rating-module\");\n ratingBlock.removeClass(\"vanished\");\n ratingBlock.html(ratingModule); \n}\n\n// put ratePage into the global namespace for testing\ndeclare var global: any;\nif (global) {\n global.ratePage = ratePage;\n}\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","/*\n * page-utils/rename.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\nimport * as $ from \"jquery\";\nimport * as BluebirdPromise from \"bluebird\";\n\nimport closeUtilities from \"./hide-all\";\nimport getSlug from \"./../slug\";\n\nimport { renamePage as rename } from \"./../deeds\";\n\nconst renameBlock = $(\"#utility-rename-block\");\nconst renameBox = $(\"#rename-box\");\n\nexport function openRenameBlock() {\n closeUtilities();\n\n renameBox.val(getSlug());\n renameBlock.removeClass(\"vanished\");\n}\n\nexport async function renamePage(): BluebirdPromise<void> {\n let newSlug = <string>renameBox.val();\n\n await rename(newSlug);\n window.location.href = `/${newSlug}`;\n}\n","/*\n * user/user-module.tsx\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// set up for user modules\nimport * as $ from \"jquery\";\nimport * as BluebirdPromise from \"bluebird\";\n\nimport { getUserInfoById as uiById, getUserInfoByUsername as uiByName } from \"./../deeds\";\nimport { h, render } from \"preact\";\nimport { Modal, ModalButtonDef } from \"./../modal\";\nimport { Nullable } from \"./../utils\";\nimport { UserInfo, UserInformation, ExtendedUserInformation } from \"./info\";\n\nimport syncify from \"./../utils/syncify\";\n\n// the \"window\" var will have a variable with the necessary JSON in it\nconst { storedUserInfo } = window as any;\n\n// load user information by id\nexport async function getUserInfoById(id: number, extended: boolean): BluebirdPromise<UserInformation> {\n if (!extended) {\n for (const userInfo of storedUserInfo) {\n if (userInfo.userid === id) {\n return UserInformation.deserialize(userInfo);\n } \n }\n }\n\n // manually load via ajax\n const userInfo = (await uiById(extended, id)).result[\"user-info\"] as UserInfo;\n if (extended) {\n return ExtendedUserInformation.deserialize(userInfo);\n }\n return UserInformation.deserialize(userInfo);\n}\n\n// load user information by username\nexport async function getUserInfoByUsername(name: string, extended: boolean): BluebirdPromise<UserInformation> {\n if (!extended) {\n for (const userInfo of storedUserInfo) {\n if (userInfo.username === name) {\n return UserInformation.deserialize(userInfo);\n } \n }\n }\n\n // manually load via ajax\n const userInfo = (await uiByName(extended, name)).result[\"user-info\"] as UserInfo;\n if (extended) {\n return ExtendedUserInformation.deserialize(userInfo);\n }\n return UserInformation.deserialize(userInfo);\n}\n\nlet avatarHoverBlock: JQuery;\n\n// setup triggers on a user module\n// TODO: a lot of this could be converted to React, but I'm not sure how...\nexport function setupUserTrigger() {\n $(\".printuser:not(.trigger-setup)\")\n .hover(function(this: HTMLElement) {\n const jThis = $(this);\n if (!jThis.hasClass(\"avatar-hover\")) {\n return;\n }\n\n // create a hover container is there isn't one\n if (!avatarHoverBlock) {\n avatarHoverBlock = $(\"<div id=\\\"avatar-hover-container\\\"></div>\").appendTo(document.body);\n }\n\n // create a hover element for this one\n const userid = jThis.attr(\"id\");\n const hoverBlock = $(`#avatar-hover-container #avatar-${userid}`);\n\n // if the hoverblock does not exist, make a function that makes it exist\n let promise;\n if (!hoverBlock.length) {\n promise = (async (id: number): BluebirdPromise<JQuery> => {\n const userInfo = await getUserInfoById(id, false);\n if (userInfo.isCompromised) {\n throw new Error(\"UserInfo is compromised\");\n }\n\n const pfpUrl = userInfo[\"profile-picture-url\"];\n const username = userInfo.username;\n\n return $(`<a href=\"/sys/user-info/${username}\" id=\"avatar-${id}\" class=\"avatar-hover vanished\" style=\"position: absolute; display: none;\">\n <div>\n <img src=\"${pfpUrl}\" alt=\"\" />\n </div>\n </a>`).appendTo(avatarHoverBlock);\n })(parseInt(userid, 10));\n } else {\n promise = BluebirdPromise.resolve<JQuery>(hoverBlock);\n }\n\n // spawn the hoverer\n promise.then((hoverer: JQuery) => {\n hoverer.removeClass(\"vanished\")\n // you can pass an object into the CSS function\n .css(((item: JQuery): { [key: string]: string} => { \n const pos = item.find(\"img\").position();\n return {\n left: `${pos.left}px`,\n \"top\": `${pos.top}px`\n };\n })(jThis));\n }).catch((err: Error) => { }); // just absorb any errors\n }, function(this: HTMLElement) {\n const jThis = $(this);\n if (!jThis.hasClass(\"avatar-hover\")) {\n return;\n } \n\n $(`#avatar-hover-container #avatar-${jThis.attr(\"id\")}`).addClass(\"vanished\");\n }).click(function(this: HTMLElement) {\n getUserInfoById(parseInt($(this).attr(\"id\"), 10), true).then((userInfo: UserInformation) => {\n const user = userInfo as ExtendedUserInformation;\n\n // generate a modal\n const pfpImgStyle = {\n \"float\": \"left\",\n padding: \"2px 8px\", \n \"background-color\": \"#FFF\"\n };\n\n // minor component to render a table's row\n function UTableRow(props: { name: string, value: string | null }) {\n if (props.value) {\n return (\n <tr><td><b>{props.name}</b></td><td>${props.value}</td></tr>\n );\n } else {\n return (<span></span>);\n }\n }\n\n // render the modal\n render((\n <Modal title=\"User info\" buttons={ [ { text: \"Close window\", click: \"close\" } ] }>\n <div>\n <img src={user[\"profile-picture-url\"]} alt=\"\" style={pfpImgStyle}></img>\n <h1>{user.username}</h1>\n <table>\n <UTableRow name=\"Real name\" value={user.realname} />\n <UTableRow name=\"Gender\" value={user.gender} />\n <UTableRow name=\"From\" value={user[\"from\"]} />\n <UTableRow name=\"Website\" value={user.website} />\n {\n (() => {\n if (user[\"joined-site\"]) {\n return <UTableRow name=\"User since:\" value={user.joinedSite.toUTCString()} />;\n } else {\n return <span></span>;\n }\n })()\n }\n <UTableRow name=\"Role on this site:\" value={user[\"role-description\"]} />\n </table>\n </div>\n </Modal>\n ), document.body);\n });\n }).addClass(\".trigger-setup\");\n}\n","/*\n * modal.tsx\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// creates and maintains a modal element\n\nimport * as $ from \"jquery\";\nimport { h, Component, VNode } from \"preact\";\n\nfunction getScrollTop(): number {\n // from https://stackoverflow.com/a/28488360\n return document.documentElement.scrollTop || document.body.scrollTop;\n}\n\nexport type ModalButtonClick = () => void;\n\n// closable - temp interface used to keep sequencing together\ninterface Closable {\n destroy: () => void;\n}\n\ninterface ModalButtonProps {\n text: string;\n click: ModalButtonClick | \"close\";\n parentModal: Closable;\n}\n\nfunction ModalButton(props: ModalButtonProps) {\n const ocMethod = props.click === \"close\" \n ? props.parentModal.destroy.bind(props.parentModal) \n : props.click as ModalButtonClick;\n\n return (\n <a class=\"btn btn-danger\" onClick={ocMethod}>\n {props.text}\n </a>\n );\n}\n\n// interface to define a modal button without using JSX\nexport interface ModalButtonDef {\n text: string;\n click: ModalButtonClick | \"close\";\n}\n\nexport interface ModalProps {\n title: string;\n buttons: Array<ModalButtonDef>;\n}\n\n// store the window in a jquery constant to reduce execution time\nconst jWindow = $(window);\n\n// manages the modal\nexport class Modal extends Component<ModalProps, {}> implements Closable {\n innerRef: HTMLElement | null;\n\n constructor(props: ModalProps) {\n super(props);\n }\n\n render() {\n const hCenter = jWindow.width() / 2;\n const vCenter = (jWindow.height() / 2) + getScrollTop();\n\n const windowStyle = {\n left: `${hCenter}px`,\n \"top\": `${vCenter}px`\n };\n\n const buttons = this.props.buttons.map((mbd: ModalButtonDef) =>\n <ModalButton text={mbd.text} click={mbd.click} parentModal={this} />\n );\n\n return (\n <span ref={(r: HTMLElement | null) => this.innerRef = r}>\n <div class=\"modal-shader\"></div>\n <div id=\"modal-container\">\n <div id=\"modal-window\" style={windowStyle}>\n <div class=\"modal-title\">{this.props.title}</div>\n <div class=\"modal-content\">{this.props.children}</div>\n <div class=\"modal-buttons\">\n {buttons}\n </div>\n </div>\n </div>\n </span>\n );\n }\n\n destroy() {\n $(this.innerRef).remove();\n }\n}\n","/*\n * user/info.ts\n *\n * scipnet - Frontend scripts for mekhane\n * Copyright (C) 2019 not_a_seagull\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU Affero General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU Affero General Public License for more details.\n *\n * You should have received a copy of the GNU Affero General Public License\n * along with this program. If not, see <http://www.gnu.org/licenses/>.\n */\n\n// defines the user's information\nimport { Nullable } from \"./../utils\";\nimport { \n passThruNumber, \n passThruString, \n passThruNString, \n\tstringToDate,\n\tUnsafeObject\n} from \"./../utils/unsafe\";\n\nexport interface UserInfo {\n userid: number;\n username: string;\n \"profile-picture-url\": Nullable<string>;\n\n // extended properties\n \"current-role\"?: number;\n realname?: Nullable<string>;\n gender?: Nullable<string>;\n website?: Nullable<string>;\n \"joined-site\"?: string;\n \"from\"?: Nullable<string>;\n \"role-description\"?: string;\n}\n\n// url regex\nconst urlRegex = /((([A-Za-z]{3,9}:(?:\\/\\/)?)(?:[\\-;:&=\\+\\$,\\w]+@)?[A-Za-z0-9\\.\\-]+|(?:www\\.|[\\-;:&=\\+\\$,\\w]+@)[A-Za-z0-9\\.\\-]+)((?:\\/[\\+~%\\/\\.\\w\\-_]*)?\\??(?:[\\-\\+=&;%@\\.\\w_]*)#?(?:[\\.\\!\\/\\\\\\w]*))?)/; // eslint-disable-line no-useless-escape\n\n// an instantiated version of these structs\nexport class UserInformation extends UnsafeObject implements UserInfo {\n \"profile-picture-url\": Nullable<string>\n\n constructor(\n public userid: number,\n public username: string,\n profilePictureUrl: Nullable<string>\n ) {\n super();\n this[\"profile-picture-url\"] = profilePictureUrl;\n }\n\n static deserialize(obj: UserInfo): UserInformation {\n const userInfo = new UserInformation(-1,\"\",null);\n\n userInfo.sanitizeProperty<number, number>(\n \"userid\",\n userInfo.userid,\n passThruNumber, \n (x: number): boolean => x > 0\n );\n userInfo.sanitizeProperty<string, string>(\n \"username\",\n userInfo.username,\n passThruString, \n (x: string): boolean => x.length > 0\n );\n userInfo.sanitizeProperty<Nullable<string>, Nullable<string>>(\n \"profile-picture-url\",\n userInfo[\"profile-picture-url\"],\n passThruNString \n );\n\n return userInfo; \n }\n}\n\nexport class ExtendedUserInformation extends UserInformation implements UserInfo {\n \"current-role\": number;\n \"joined-site\": string;\n \"from\": string;\n \"role-description\": string; \n\n constructor(\n userid: number,\n username: string,\n profilePictureUrl: string,\n currentRole: number,\n public realname: Nullable<string>,\n public gender: Nullable<string>,\n public website: Nullable<string>,\n public joinedSite: Date,\n placeFrom: Nullable<string>,\n roleDescription: string\n ) {\n super(userid, username, profilePictureUrl);\n this[\"current-role\"] = currentRole;\n this[\"joined-site\"] = joinedSite.toUTCString();\n this[\"from\"] = placeFrom;\n this[\"role-description\"] = roleDescription;\n }\n\n static deserialize(obj: UserInfo): ExtendedUserInformation {\n const rUserInfo = UserInformation.deserialize(obj);\n const userInfo = new ExtendedUserInformation(rUserInfo.userid,rUserInfo.username,rUserInfo[\"profile-picture-url\"],-1,null,null,null,new Date(0),null,\"\");\n\n if (rUserInfo.isCompromised || !rUserInfo[\"profile-picture-url\"]) {\n userInfo.isCompromised = true;\n return userInfo;\n }\n\n if (!obj[\"current-role\"]) {\n // object is not an extended date\n userInfo.isCompromised = true;\n return userInfo;\n }\n\n userInfo.sanitizeProperty<number, number>(\n \"current-role\",\n obj[\"current-role\"],\n passThruNumber, \n (x: number): boolean => x > 0\n );\n userInfo.sanitizeProperty<Nullable<string>, Nullable<string>>(\n \"realname\",\n obj[\"realname\"],\n passThruNString \n );\n userInfo.sanitizeProperty<Nullable<string>, Nullable<string>>(\n \"gender\",\n obj[\"gender\"],\n passThruNString\n );\n userInfo.sanitizeProperty<Nullable<string>, Nullable<string>>(\n \"website\",\n obj[\"website\"],\n passThruNString,\n );\n userInfo.sanitizeProperty<string, string>(\n \"joined-site\",\n obj[\"joined-site\"], \n passThruString\n );\n userInfo.sanitizeProperty<string, Date>(\n \"joinedSite\",\n obj[\"joined-site\"],\n stringToDate\n );\n userInfo.sanitizeProperty<Nullable<string>, Nullable<string>>(\n \"from\",\n obj[\"from\"],\n passThruNString\n );\n userInfo.sanitizeProperty<string, string>(\n \"role-description\",\n obj[\"role-description\"],\n passThruString\n );\n \n return userInfo;\n }\n}\n"],"sourceRoot":""}