{"version":3,"sources":["webpack:///webpack/bootstrap 90cbae86df50abd9adfb","webpack:///./Scripts/TaskList.ts"],"names":[],"mappings":";;AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,aAAK;AACL;AACA;;AAEA;AACA;AACA;AACA,mCAA2B,0BAA0B,EAAE;AACvD,yCAAiC,eAAe;AAChD;AACA;AACA;;AAEA;AACA,8DAAsD,+DAA+D;;AAErH;AACA;;AAEA;AACA;;;;;;;;;;;;;;;;;;;AC7DA,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC;IACd,IAAI,QAAQ,EAAE,CAAC;AACnB,CAAC,CAAC,CAAC;AAEH;IAUI;QAAA,iBAEC;QAXO,gBAAW,GAAY,KAAK,CAAC;QAa7B,SAAI,GAAG;YACX,IAAI,KAAI,CAAC,WAAW,EAAE;gBAClB,OAAO;aACV;YAED,KAAI,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC;YACzB,KAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QAC5B,CAAC;QAEO,iBAAY,GAAG,UAAC,YAAY;YAChC,IAAI,IAAI,GAAG,KAAI,CAAC;YAEhB,mDAAmD;YACnD,+BAA+B;YAC/B,IAAI,CAAC,gBAAgB,GAAG,CAAC,CAAC,cAAc,CAAC,CAAC;YAE1C,IAAI,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,EAAE;gBAC1B,IAAI,UAAU,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;gBAC7D,IAAI,SAAS,GAAG,IAAI,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;gBAE3D,gCAAgC;gBAChC,IAAI,CAAC,gBAAgB,CAAC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C,iBAAiB,CAAC,CAAC,SAAS,EAAE,CAAC;iBAC3F,IAAI,CAAC;gBAEF,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;gBAErC,2BAA2B;gBAC3B,IAAI,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC;YAC5B,CAAC,CAAC;iBACD,IAAI,CAAC;gBACF,2BAA2B;gBAC3B,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAG,aAAa,CAAC;YACzC,CAAC,CAAC,CAAC;QACX,CAAC;QAEO,iBAAY,GAAG,UAAC,YAAY;YAChC,YAAY,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC;YAE3B,gFAAgF;YAChF,4FAA4F;YAC5F,8CAA8C;YAC9C,iCAAiC;QACrC,CAAC;QA7MG,IAAI,CAAC,IAAI,EAAE,CAAC;IAChB,CAAC;IA6ML,eAAC;AAAD,CAAC;AAzNY,4BAAQ","file":"taskList.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, {\n \t\t\t\tconfigurable: false,\n \t\t\t\tenumerable: true,\n \t\t\t\tget: getter\n \t\t\t});\n \t\t}\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 = \"/dist/\";\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 2);\n\n\n\n// WEBPACK FOOTER //\n// webpack/bootstrap 90cbae86df50abd9adfb","$(document).ready(function () {\n new TaskList();\n});\n\nexport class TaskList {\n private initialised: boolean = false;\n private _modal: JQuery;\n private _modalCreate: JQuery;\n\n private _taskListElement: JQuery;\n private _taskEditorElement: JQuery;\n private _taskListExpanderElement: JQuery;\n private _taskCreatorElement: JQuery;\n\n constructor() {\n this.init();\n }\n\n private init = () => {\n if (this.initialised) {\n return;\n }\n\n this.loadTaskList(false);\n this.initialised = true;\n }\n\n private loadTaskList = (showExpanded): void => {\n let self = this;\n\n // grab the DOM target element for the task listing\n // and read its data attributes\n self._taskListElement = $(\"#TasksTarget\");\n\n if (self._taskListElement[0]) {\n let recordType = self._taskListElement[0].dataset.recordType;\n let recordUID = self._taskListElement[0].dataset.recordUid;\n\n // load the listing partial view\n self._taskListElement.load(`/TaskPartial/RefreshTasksPartial/${recordType}/${recordUID}`, function () {\n\n // identify DOM targets within the listing partial view\n self.identifyDomElements();\n \n if (showExpanded === true) {\n // expand the collapsed task listing\n self._taskListExpanderElement.addClass(\"show\");\n }\n\n // all Edit buttons need to get a click handler to open modal\n $(\".edit-task\").on(\"click\", function () { \n\n // apparently $(this) is the identifier of the button that got clicked on, \n // which is given a 'taskid' data attribute in the partial view\n self.loadTaskEditor($(this)[0].dataset.taskid);\n });\n\n // the Add button opens the Create modal\n $(\"#createTaskLink\").on(\"click\", function () {\n self.loadTaskCreator($(this)[0].dataset.entitycode, $(this)[0].dataset.recordid);\n });\n });\n }\n }\n\n private identifyDomElements = (): void => {\n let self = this;\n\n self._modal = $('#TaskListModal').modal({ show: false });\n self._taskEditorElement = $('#TaskEditor');\n self._taskListExpanderElement = $('#TaskListExpandableContainer'); \n self._modalCreate = $('#TaskCreateModal').modal({ show: false });\n self._taskCreatorElement = $('#TaskCreator');\n }\n\n private loadTaskEditor = (taskId): void => {\n let self = this;\n\n // get the editing partial view and load it into the placeholder in the modal\n self._taskEditorElement.load(\"/TaskPartial/EditorPartial/\" + taskId, function () {\n\n self._modal.modal('show');\n\n // hook up the buttons inside the editing modal\n self.attachHandlersToEditorButtons();\n });\n }\n\n // Handler for click on Update button\n private onEditSubmit = (entityCode, taskid): void => {\n let self = this;\n\n // post back form data to UpdatePartial action on controller\n $.post(`/TaskPartial/UpdatePartial/${entityCode}/${taskid}`, $(\"#TaskEditForm\").serialize())\n .done(function (response) {\n\n // controller has saved without error...\n if (response === \"UpdateSuccess\") {\n\n self.dismissModal(self._modal);\n\n // refresh the task listing on edit success\n self.loadTaskList(true);\n }\n else {\n // if a concurrency error occurs, the controller returns the partial view plus an error message \n // and modified TimeStamp as 'response'... re-load this as the editor partial view\n self._taskEditorElement.html(response); \n\n //...and reattach its buttons\n self.attachHandlersToEditorButtons();\n }\n })\n .fail(function () {\n // other unexpected error in controller update\n window.location.href = \"/Oops/Error\";\n });\n }\n\n\n // Handler for click on Delete button\n private onEditDelete = (recordid, taskid): void => {\n let self = this;\n\n // post back form data to UpdatePartial action on controller\n $.get(`/TaskPartial/Delete/${recordid}/${taskid}`)\n .done(function() {\n\n // refresh listing and close modal\n self.loadTaskList(true);\n self.dismissModal(self._modal);\n })\n .fail(function () {\n // unexpected error in controller delete\n window.location.href = \"/Oops/Error\";\n });\n }\n\n private attachHandlersToEditorButtons = (): void => {\n let self = this;\n\n // attach handler to the (now present) Submit button\n $(\"#TaskEditSubmit\").on(\"click\", function () {\n self.onEditSubmit($(this)[0].dataset.entitycode, $(this)[0].dataset.taskid);\n });\n\n // attach handler to the Cancel button\n $(\"#TaskEditCancel\").on(\"click\", function () {\n self.loadTaskList(true);\n self.dismissModal(self._modal);\n });\n\n // attach handler to the Delete button\n $(\"#TaskEditDelete\").on(\"click\", function () {\n self.onEditDelete($(this)[0].dataset.recordid, $(this)[0].dataset.taskid);\n });\n }\n \n private loadTaskCreator = (entitycode, recordid): void => {\n let self = this;\n\n // get the create partial view and load it into the placeholder in the modal\n self._taskCreatorElement.load(`/TaskPartial/CreatePartial/${entitycode}/${recordid}`, function () {\n\n self._modalCreate.modal('show');\n\n // hook up the buttons inside the editing modal\n self.attachHandlersToCreateButtons();\n });\n }\n\n private attachHandlersToCreateButtons = (): void => {\n let self = this;\n\n // attach handler to the (now present) Create button\n $(\"#TaskCreateSubmit\").on(\"click\", function () {\n self.onCreateSubmit($(this)[0].dataset.entitycode, $(this)[0].dataset.recordid);\n });\n\n // attach handler to the Cancel button\n $(\"#TaskCreateCancel\").on(\"click\", function () {\n\n // reload the main tasks listing and preserve its expanded (or not) state\n if (self._taskListExpanderElement.hasClass(\"show\")) {\n self.loadTaskList(true);\n }\n else {\n self.loadTaskList(false);\n }\n\n self.dismissModal(self._modalCreate);\n });\n }\n\n // Handler for click on Update button\n private onCreateSubmit = (entityCode, recordid): void => {\n let self = this;\n\n // post back form data to CreatePartial action on controller\n $.post(`/TaskPartial/CreatePartial/${entityCode}/${recordid}`, $(\"#TaskCreateForm\").serialize())\n .done(function () {\n\n self.dismissModal(self._modalCreate);\n\n // refresh the task listing\n self.loadTaskList(true);\n })\n .fail(function () {\n // error in controller save\n window.location.href = \"/Oops/Error\";\n });\n }\n\n private dismissModal = (modalEmelent): void => {\n modalEmelent.modal('hide');\n\n /// These can fix the issue of grey backdrop remaining on modal close (crudely).\n /// But instead solved issue by removing modal placeholders from the TaskListing DOM element\n // $(document.body).removeClass(\"modal-open\");\n // $(\".modal-backdrop\").remove();\n }\n}\n\n\n// WEBPACK FOOTER //\n// ./Scripts/TaskList.ts"],"sourceRoot":""}