-
Notifications
You must be signed in to change notification settings - Fork 4
/
bundle.js.map
1 lines (1 loc) · 11 KB
/
bundle.js.map
1
{"version":3,"sources":["internalization.js","logic.js","objects.js","structure.js"],"names":[],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACnCA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACpIA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;ACjBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","file":"bundle.js","sourcesContent":["var translations = {\n\t// English\n\t\"en-US\": {\n\t\tlocaleName: \"en-US\",\n\t\theaderTitle: \"Data master\",\n\t\tresetFilters: \"Reset filters\",\n\t\tchangeLocale: \"Change language:\",\n\t\tloadData: \"Load data\",\n\t\taddRow: \"Add row\",\n\t\tclearSelection: \"Clear selection\",\n\t\tdeleteRow: \"Delete row\",\n\t\tsaveData: \"Save data\",\n\t\ttitle: \"Title\",\n\t\tnoItemSelected: \"No item selected\",\n\t\tdataSaved: \"Data saved\",\n\t\treservedButton: \"Reserved botton\"\n\t},\n\n\t// Russian\n\t\"ru-RU\": {\n\t\tlocaleName: \"ru-RU\",\n\t\theaderTitle: \"Мастер данных\",\n\t\tresetFilters: \"Сбросить фильтры\",\n\t\tchangeLocale: \"Сменить язык:\",\n\t\tloadData: \"Загрузить данные\",\n\t\taddRow: \"Добавить ряд\",\n\t\tclearSelection: \"Снять выделение\",\n\t\tdeleteRow: \"Удалить ряд\",\n\t\tsaveData: \"Сохранить\",\n\t\ttitle: \"Название\",\n\t\tnoItemSelected: \"Нет выбранных рядов\",\n\t\tdataSaved: \"Данные сохранены\",\n\t\treservedButton: \"Зарезервировано...\"\n\t}\n};\n","var defaultLocale = \"en-US\";\n\n// object from translations.js\nvar localizator = translations[defaultLocale];\n\n/**\n * Get data from backend and fill datatable grid\n */\nfunction getData() {\n $$(\"dataFromBackend\").clearAll();\n $$(\"dataFromBackend\").load(\"http://localhost:3000/data\");\n\n // old backend on Apache/PHP:\n //$$(\"dataFromBackend\").load(\"http://localhost/data_master/data/data.php\");\n \n}\n\n/**\n * Add new row to datatable\n */\nfunction addRow() {\n $$(\"dataFromBackend\").add(\n {\n title: \"-----\",\n content: \"-----\",\n place: \"-----\"\n //date: \"-----\",\n //priority: \"-----\"\n }\n );\n}\n\n/**\n * Reset selection in datatable grid\n */\nfunction clearSelection() {\n $$(\"dataFromBackend\").unselectAll();\n}\n\n/**\n * Delete selected row\n */\nfunction deleteRow() {\n if (!$$(\"dataFromBackend\").getSelectedId()) {\n webix.alert(localizator.noItemSelected);\n return;\n }\n\n //removes the selected item\n $$(\"dataFromBackend\").remove($$(\"dataFromBackend\").getSelectedId());\n}\n\n/**\n * Save data to backend from datatable grid\n */\nfunction saveData() {\n var grid = $$(\"dataFromBackend\");\n var serializedData = grid.serialize();\n \n // The default Webix header definition is \"Content-type\": \"application/x-www-form-urlencoded\"\n // JSON data will not work in this case. Set \"Content-Type\": \"application/json\"\n webix.ajax().headers({\n \"Content-Type\": \"application/json\"\n }).post(\"http://localhost:3000/data\", {data: serializedData});\n\n // old backend on Apache/PHP:\n //webix.ajax().post(\"http://localhost/data_master/data/save.php\", {data: serializedData});\n\n webix.alert(localizator.dataSaved);\n \n}\n\n/**\n * Reset filters settings\n */\nfunction resetFilters() {\n $$(\"dataFromBackend\").getFilter(\"title\").value = null;\n $$(\"dataFromBackend\").getFilter(\"content\").value = null;\n $$(\"dataFromBackend\").getFilter(\"place\").value = null;\n $$(\"dataFromBackend\").getFilter(\"date\").value = null;\n $$(\"dataFromBackend\").getFilter(\"priority\").value = null;\n \n // reload grid\n $$(\"dataFromBackend\").clearAll();\n $$(\"dataFromBackend\").load(\"http://localhost:3000/data\"); \n\n // old backend on Apache/PHP:\n //$$(\"dataFromBackend\").load(\"http://localhost/data_master/data/data.php\"); \n}\n\n/**\n * Change translation to selected\n */\nfunction changeLocale(locale) {\n localizator = translations[locale];\n \n $$(\"headerContainer\").define(\"template\", localizator.headerTitle);\n $$(\"headerContainer\").refresh();\n\n $$(\"resetFiltersContainer\").define(\"value\", localizator.resetFilters);\n $$(\"resetFiltersContainer\").refresh();\n\n $$(\"changeLocale\").define(\"label\", localizator.changeLocale);\n $$(\"changeLocale\").refresh();\n\n $$(\"loadData\").define(\"value\", localizator.loadData);\n $$(\"loadData\").refresh();\n\n $$(\"addRow\").define(\"value\", localizator.addRow);\n $$(\"addRow\").refresh();\n\n $$(\"clearSelection\").define(\"value\", localizator.clearSelection);\n $$(\"clearSelection\").refresh();\n\n $$(\"deleteRow\").define(\"value\", localizator.deleteRow);\n $$(\"deleteRow\").refresh();\n\n $$(\"saveData\").define(\"value\", localizator.saveData);\n $$(\"saveData\").refresh();\n\n $$(\"reservedButton\").define(\"value\", localizator.reservedButton);\n $$(\"reservedButton\").refresh();\n\n webix.i18n.setLocale(locale);\n}\n\n/**\n * Function for reserved button\n */\nfunction reservedButton() {\n // your code...\n}\n","/**\n * Create object with type \"Button\"\n *\n * @constructor\n */\nfunction Button(id, value, type, width, onClickFunction) {\n\tthis.view = \"button\";\n\tthis.id = id;\n\tthis.value = value;\n\tthis.type = type;\n\tthis.width = width;\n\tthis.on = {\n\t\t\"onItemClick\": function(){ \n\t onClickFunction();\n\t }\n\t}\n}\n","/**\n * Create main layout\n */\nwebix.ui({\n\tview: \"layout\",\n\tid: \"page\",\n\trows:[\n\t\t{\n\t\t\tcols: [\n\t\t\t\t{\n\t\t\t\t\tview:\"icon\",\n\t\t\t\t\tid: \"headerIconContainer\",\n\t\t\t\t\ticon:\"calendar\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tview:\"template\",\n\t\t\t\t\tid: \"headerContainer\",\n\t\t\t\t\ttype:\"header\",\n\t\t\t\t\ttemplate:\"Data master\"\n\t\t\t },\n\t\t\t new Button(\"resetFiltersContainer\", \"Reset filters\", \"form\", 150, resetFilters),\n\t\t\t\t{\n\t\t\t\t\tid: \"divider\",\n\t\t\t\t\twidth: 20\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tview: \"combo\", \n\t\t\t\t id: \"changeLocale\",\n\t\t\t\t label: 'Change locale:',\n\t\t\t\t labelWidth: 130,\n\t\t\t\t width: 230,\n\t\t\t\t align: \"right\",\n\t\t\t\t value: \"en-US\",\n\t\t\t\t options: [\n\t\t\t\t \t\"ru-RU\",\n\t\t\t\t \t\"en-US\"\n\t\t\t\t ],\n\t\t\t\t on: {\n\t\t\t\t \"onChange\": function(newv, oldv) { \n\t\t\t\t \tchangeLocale(newv);\n\t\t\t\t }\n\t\t\t\t }\n\t\t\t\t}\n\t\t\t]\n\t\t},\n\t {\n\t \tview: \"datatable\",\n\t \tid: \"dataFromBackend\",\n\t\tcolumns: [\n\t\t\t{\n\t\t\t\tid: \"title\",\n\t\t\t\theader: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: \"<b>Title</b>\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tcontent: \"textFilter\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\teditor: \"text\",\n\t\t\t\tfillspace: 2\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"content\",\n\t\t\t\theader: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: \"<b>Content</b>\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tcontent: \"textFilter\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\teditor: \"popup\",\n\t\t\t\tfillspace: 8\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"place\",\n\t\t\t\theader: [\n\t\t\t\t\t{\n\t\t\t\t\t\ttext: \"<b>Place</b>\"\n\t\t\t\t\t},\n\t\t\t\t\t{\n\t\t\t\t\t\tcontent: \"textFilter\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\teditor: \"text\",\n\t\t\t\tfillspace: 2\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"date\",\n\t\t\t\theader: [\n\t\t\t\t\t\"<b>Date</b>\",\n\t\t\t\t\t{\n\t\t\t\t\t\tcontent: \"dateFilter\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\teditor: \"date\",\n\t\t\t\tmap: \"(date)#date#\",\n\t\t\t\tformat: webix.Date.dateToStr(\"%d.%m.%Y\"),\n\t\t\t\tfillspace: 2\n\t\t\t},\n\t\t\t{\n\t\t\t\tid: \"priority\",\n\t\t\t\theader: [\n\t\t\t\t\t\"<b>Priority</b>\",\n\t\t\t\t\t{\n\t\t\t\t\t\tcontent: \"selectFilter\"\n\t\t\t\t\t}\n\t\t\t\t],\n\t\t\t\teditor: \"select\",\n\t\t\t\toptions: [1, 2, 3, 4, 5],\n\t\t\t\tfillspace: 1\n\t\t\t}\n\t\t],\n\t\teditable: true,\n\t\tselect: \"row\",\n\t\tmultiselect: true,\n\t // initial data load\n\t //data: webix.ajax().post(\"http://localhost/electron_with_backend/data/data.php\")\n\t data: webix.ajax().get(\"http://localhost:3000/data\")\n\t //data: initialLoad()\n\t },\n\t \t{\n\t \t\tview: \"layout\",\n\t \t\tid: \"buttonContainer\",\n\t \t\theight: 50,\n\t \t\tcols: [\n\t\t\t \t// Webix ui.button structure example:\n\t\t\t \t/*{\n\t\t\t\t \tview: \"button\", \n\t\t\t\t id: \"loadData\", \n\t\t\t\t value: \"Load data\", \n\t\t\t\t type: \"form\", \n\t\t\t\t width: 150,\n\t\t\t\t on: {\n\t\t\t\t\t \"onItemClick\": function(id, e, trg){ \n\t\t\t\t\t getData();\n\t\t\t\t\t }\n\t\t\t\t\t}\n\t\t\t\t},*/\n\t\t \t\tnew Button(\"loadData\", \"Load data\", \"form\", 150, getData),\n\t\t \t\tnew Button(\"addRow\", \"Add row\", \"form\", 150, addRow),\n\t\t \t\tnew Button(\"clearSelection\", \"Clear selection\", \"form\", 150, clearSelection),\n\t\t \t\tnew Button(\"deleteRow\", \"Delete row\", \"form\", 150, deleteRow),\n\t\t \t\tnew Button(\"saveData\", \"Save data\", \"form\", 150, saveData),\n\t\t \t\tnew Button(\"reservedButton\", \"Reserved button\", \"form\", 150, reservedButton),\n\t\t\t\t{}\n\t\t\t]\n\t \t}\n\t]\n});\n\n$$(\"buttonContainer\").define(\"css\", \"buttonContainerClass\");\n$$(\"resetFiltersContainer\").define(\"css\", \"resetFiltersContainerClass\");\n$$(\"headerIconContainer\").define(\"css\", \"headerIconContainerClass\");\n$$(\"headerContainer\").define(\"css\", \"headerContainerClass\");\n$$(\"changeLocale\").define(\"css\", \"changeLocaleClass\");\n$$(\"divider\").define(\"css\", \"dividerClass\");\n"]}