|
|
|
@ -123,7 +123,7 @@ parcelRequire = (function (modules, cache, entry, globalName) {
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
exports.default = exports.SEND_MAIL = exports.API_INIT_LAME = exports.API_INIT_GOOD = exports.API_INIT = exports.API_RENDER_PAGES = exports.API_IMAGES_UPLOAD = exports.API_SETTINGS_WRITE = exports.API_PAGE_DELETE = exports.API_PAGE_CREATE = exports.API_PAGE_WRITE = exports.UPLOAD_PROGRESS = exports.SITE_BACKGROUND_UPLOADED = exports.AVATAR_UPLOADED = exports.MENU_UPDATED = exports.MENU_DELETE_ITEM = exports.MENU_ADD_ITEM = exports.SETTINGS_NOT_UPDATED = exports.SETTINGS_UPDATED = exports.TAG_PAGES_NOT_RENDERED = exports.TAG_PAGES_RENDERED = exports.PAGES_NOT_RENDERED = exports.PAGES_RENDERED = exports.PAGE_DELETED = exports.PAGE_UPDATED = exports.PAGE_ADDED = exports.PAGE_ERROR = exports.FEATURE_IMAGE_ADDED = exports.POST_IMAGE_ADDED = exports.SETTINGS_LOADED = exports.IMG_REQUEST_LAME = exports.IMG_REQUEST_GOOD = exports.API_REQUEST_LAME = exports.API_REQUEST_GOOD = exports.REQUEST_LAME = exports.REQUEST_GOOD = void 0;
|
|
|
|
|
exports.default = exports.SEND_MAIL = exports.API_INIT_LAME = exports.API_INIT_GOOD = exports.API_INIT = exports.API_RENDER_PAGES = exports.API_IMAGES_UPLOAD = exports.API_BACKUP_RESTORE = exports.API_BACKUP_DOWNLOAD = exports.API_BACKUP_CREATE = exports.API_SETTINGS_WRITE = exports.API_PAGE_DELETE = exports.API_PAGE_CREATE = exports.API_PAGE_WRITE = exports.UPLOAD_PROGRESS = exports.SITE_BACKGROUND_UPLOADED = exports.AVATAR_UPLOADED = exports.MENU_UPDATED = exports.MENU_DELETE_ITEM = exports.MENU_ADD_ITEM = exports.SETTINGS_NOT_UPDATED = exports.SETTINGS_UPDATED = exports.TAG_PAGES_NOT_RENDERED = exports.TAG_PAGES_RENDERED = exports.PAGES_NOT_RENDERED = exports.PAGES_RENDERED = exports.PAGE_DELETED = exports.PAGE_UPDATED = exports.PAGE_ADDED = exports.PAGE_ERROR = exports.FEATURE_IMAGE_ADDED = exports.POST_IMAGE_ADDED = exports.SETTINGS_LOADED = exports.IMG_REQUEST_LAME = exports.IMG_REQUEST_GOOD = exports.API_REQUEST_LAME = exports.API_REQUEST_GOOD = exports.REQUEST_LAME = exports.REQUEST_GOOD = void 0;
|
|
|
|
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
|
|
|
@ -185,6 +185,12 @@ var API_PAGE_DELETE = 'erasingPage';
|
|
|
|
|
exports.API_PAGE_DELETE = API_PAGE_DELETE;
|
|
|
|
|
var API_SETTINGS_WRITE = 'savingSettings';
|
|
|
|
|
exports.API_SETTINGS_WRITE = API_SETTINGS_WRITE;
|
|
|
|
|
var API_BACKUP_CREATE = 'createBackup';
|
|
|
|
|
exports.API_BACKUP_CREATE = API_BACKUP_CREATE;
|
|
|
|
|
var API_BACKUP_DOWNLOAD = 'downloadBackup';
|
|
|
|
|
exports.API_BACKUP_DOWNLOAD = API_BACKUP_DOWNLOAD;
|
|
|
|
|
var API_BACKUP_RESTORE = 'downloadBackup';
|
|
|
|
|
exports.API_BACKUP_RESTORE = API_BACKUP_RESTORE;
|
|
|
|
|
var API_IMAGES_UPLOAD = 'uploadProfileImages';
|
|
|
|
|
exports.API_IMAGES_UPLOAD = API_IMAGES_UPLOAD;
|
|
|
|
|
var API_RENDER_PAGES = 'renderPages';
|
|
|
|
@ -368,130 +374,13 @@ var APIUtils = /*#__PURE__*/function () {
|
|
|
|
|
}();
|
|
|
|
|
|
|
|
|
|
exports.default = APIUtils;
|
|
|
|
|
},{"../com/events/DataEvent":"events/DataEvent.js"}],"utils/DataUtils.js":[function(require,module,exports) {
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
exports.default = void 0;
|
|
|
|
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
|
|
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
|
|
|
|
|
|
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
|
|
|
|
|
|
|
var DataUtils = /*#__PURE__*/function () {
|
|
|
|
|
//--------------------------
|
|
|
|
|
// constructor
|
|
|
|
|
//--------------------------
|
|
|
|
|
function DataUtils() {
|
|
|
|
|
_classCallCheck(this, DataUtils);
|
|
|
|
|
} //--------------------------
|
|
|
|
|
// methods
|
|
|
|
|
//--------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_createClass(DataUtils, [{
|
|
|
|
|
key: "imgLoad",
|
|
|
|
|
value: function imgLoad(url) {
|
|
|
|
|
'use strict'; // Create new promise with the Promise() constructor;
|
|
|
|
|
// This has as its argument a function with two parameters, resolve and reject
|
|
|
|
|
|
|
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
|
|
// Standard XHR to load an image
|
|
|
|
|
var request = new XMLHttpRequest();
|
|
|
|
|
request.open('GET', url);
|
|
|
|
|
request.responseType = 'blob'; // When the request loads, check whether it was successful
|
|
|
|
|
|
|
|
|
|
request.onload = function () {
|
|
|
|
|
if (request.status === 200) {
|
|
|
|
|
// If successful, resolve the promise by passing back the request response
|
|
|
|
|
resolve(request.response);
|
|
|
|
|
} else {
|
|
|
|
|
// If it fails, reject the promise with a error message
|
|
|
|
|
reject(new Error("Image didn't load successfully; error code:" + request.statusText));
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
request.onerror = function () {
|
|
|
|
|
// Also deal with the case when the entire request fails to begin with
|
|
|
|
|
// This is probably a network error, so reject the promise with an appropriate message
|
|
|
|
|
reject(new Error('There was a network error.'));
|
|
|
|
|
}; // Send the request
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
request.send();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "loadImage",
|
|
|
|
|
value: function loadImage(src) {
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
var self = this;
|
|
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
|
|
// Get a reference to the body element, and create a new image object
|
|
|
|
|
var myImage = new Image();
|
|
|
|
|
myImage.crossOrigin = ''; // or "anonymous"
|
|
|
|
|
// Call the function with the URL we want to load, but then chain the
|
|
|
|
|
// promise then() method on to the end of it. This contains two callbacks
|
|
|
|
|
|
|
|
|
|
self.imgLoad(src).then(function (response) {
|
|
|
|
|
// The first runs when the promise resolves, with the request.reponse specified within the resolve() method.
|
|
|
|
|
var imageURL = window.URL.createObjectURL(response);
|
|
|
|
|
resolve(imageURL); //$('background-content').setStyle('background-image', 'url('+imageURL+')') //myImage.src = imageURL;
|
|
|
|
|
//console.log(imageURL);
|
|
|
|
|
//body.appendChild(myImage);
|
|
|
|
|
// The second runs when the promise is rejected, and logs the Error specified with the reject() method.
|
|
|
|
|
}, function (Error) {
|
|
|
|
|
reject(Error);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* Create a function to convert the serialize and convert the form data to JSON
|
|
|
|
|
* @param : $('#form_example');
|
|
|
|
|
* @return a JSON Stringify
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
key: "formDataToJSON",
|
|
|
|
|
value: function formDataToJSON(form) {
|
|
|
|
|
var object = {};
|
|
|
|
|
var formData = new FormData(form);
|
|
|
|
|
formData.forEach(function (value, key) {
|
|
|
|
|
if (!object.hasOwnProperty(key)) {
|
|
|
|
|
object[key] = value;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!Array.isArray(object[key])) {
|
|
|
|
|
object[key] = [object[key]];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object[key].push(value);
|
|
|
|
|
}); //let json = JSON.stringify(object);
|
|
|
|
|
|
|
|
|
|
return object;
|
|
|
|
|
} //--------------------------
|
|
|
|
|
// event handlers
|
|
|
|
|
//--------------------------
|
|
|
|
|
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return DataUtils;
|
|
|
|
|
}();
|
|
|
|
|
|
|
|
|
|
exports.default = DataUtils;
|
|
|
|
|
},{}],"../libraries/FipamoAdminAPI.js":[function(require,module,exports) {
|
|
|
|
|
},{"../com/events/DataEvent":"events/DataEvent.js"}],"../libraries/FipamoAdminAPI.js":[function(require,module,exports) {
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
exports.default = exports.API_SEND_MAIL = exports.API_NAV_SYNC = exports.API_PUBLISH_PAGES = exports.API_UPLOAD_BACKGROUND = exports.API_UPLOAD_AVATAR = exports.API_SETTINGS_SYNC = exports.API_IMAGE_UPLOAD = exports.API_DELETE_PAGE = exports.API_EDIT_PAGE = exports.API_NEW_PAGE = exports.API_GET_NAV = exports.API_STATUS = exports.CONTENT_TYPE_FORM = exports.CONTENT_TYPE_JSON = exports.TASK_PAGE_DELETE = exports.TASK_PAGE_EDIT = exports.TASK_PAGE_CREATE = exports.REQUEST_TYPE_DELETE = exports.REQUEST_TYPE_PUT = exports.REQUEST_TYPE_GET = exports.REQUEST_TYPE_POST = void 0;
|
|
|
|
|
exports.default = exports.API_SEND_MAIL = exports.API_INIT_RESTORE_BACKUP = exports.API_RESTORE_BACKUP = exports.API_DOWNLOAD_BACKUP = exports.API_CREATE_BACKUP = exports.API_NAV_SYNC = exports.API_PUBLISH_PAGES = exports.API_UPLOAD_BACKGROUND = exports.API_UPLOAD_AVATAR = exports.API_SETTINGS_SYNC = exports.API_IMAGE_UPLOAD = exports.API_DELETE_PAGE = exports.API_EDIT_PAGE = exports.API_NEW_PAGE = exports.API_GET_NAV = exports.API_STATUS = exports.CONTENT_TYPE_FORM = exports.CONTENT_TYPE_JSON = exports.TASK_PAGE_DELETE = exports.TASK_PAGE_EDIT = exports.TASK_PAGE_CREATE = exports.REQUEST_TYPE_DELETE = exports.REQUEST_TYPE_PUT = exports.REQUEST_TYPE_GET = exports.REQUEST_TYPE_POST = void 0;
|
|
|
|
|
|
|
|
|
|
var DataEvent = _interopRequireWildcard(require("../com/events/DataEvent"));
|
|
|
|
|
|
|
|
|
@ -545,6 +434,14 @@ var API_PUBLISH_PAGES = '/api/v1/settings/publish-pages';
|
|
|
|
|
exports.API_PUBLISH_PAGES = API_PUBLISH_PAGES;
|
|
|
|
|
var API_NAV_SYNC = '/api/v1/settings/nav-sync';
|
|
|
|
|
exports.API_NAV_SYNC = API_NAV_SYNC;
|
|
|
|
|
var API_CREATE_BACKUP = '/api/v1/backup/create';
|
|
|
|
|
exports.API_CREATE_BACKUP = API_CREATE_BACKUP;
|
|
|
|
|
var API_DOWNLOAD_BACKUP = '/api/v1/backup/download';
|
|
|
|
|
exports.API_DOWNLOAD_BACKUP = API_DOWNLOAD_BACKUP;
|
|
|
|
|
var API_RESTORE_BACKUP = '/api/v1/backup/restore';
|
|
|
|
|
exports.API_RESTORE_BACKUP = API_RESTORE_BACKUP;
|
|
|
|
|
var API_INIT_RESTORE_BACKUP = '/api/v1/backup/init-restore';
|
|
|
|
|
exports.API_INIT_RESTORE_BACKUP = API_INIT_RESTORE_BACKUP;
|
|
|
|
|
var API_SEND_MAIL = '/api/v1/mailer';
|
|
|
|
|
exports.API_SEND_MAIL = API_SEND_MAIL;
|
|
|
|
|
|
|
|
|
@ -708,6 +605,67 @@ var APIUtils = /*#__PURE__*/function () {
|
|
|
|
|
reject(err);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "handleBackup",
|
|
|
|
|
value: function handleBackup(id, files) {
|
|
|
|
|
var _this8 = this;
|
|
|
|
|
|
|
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
|
|
var url, event, method, type, data;
|
|
|
|
|
|
|
|
|
|
if (id === 'create-backup') {
|
|
|
|
|
url = API_CREATE_BACKUP;
|
|
|
|
|
event = DataEvent.API_BACKUP_CREATE;
|
|
|
|
|
method = REQUEST_TYPE_POST;
|
|
|
|
|
type = CONTENT_TYPE_JSON;
|
|
|
|
|
data = {
|
|
|
|
|
task: 'create_backup'
|
|
|
|
|
};
|
|
|
|
|
} else {
|
|
|
|
|
url = API_RESTORE_BACKUP;
|
|
|
|
|
event = DataEvent.API_BACKUP_RESTORE;
|
|
|
|
|
method = REQUEST_TYPE_POST;
|
|
|
|
|
type = CONTENT_TYPE_FORM;
|
|
|
|
|
data = new FormData();
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < files.length; i++) {
|
|
|
|
|
var file = files[i]; // Check the file type.
|
|
|
|
|
|
|
|
|
|
if (!file.type.match('application.zip')) {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
data.append('backup_upload', file, file.name);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_this8._request(url, event, method, type, data).then(function (result) {
|
|
|
|
|
resolve(result);
|
|
|
|
|
}).catch(function (err) {
|
|
|
|
|
reject(err);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "handleInitRestore",
|
|
|
|
|
value: function handleInitRestore(form) {
|
|
|
|
|
var _this9 = this;
|
|
|
|
|
|
|
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
|
|
var url, event, method, type, data;
|
|
|
|
|
url = API_INIT_RESTORE_BACKUP;
|
|
|
|
|
event = DataEvent.API_BACKUP_RESTORE;
|
|
|
|
|
method = REQUEST_TYPE_POST;
|
|
|
|
|
type = CONTENT_TYPE_FORM;
|
|
|
|
|
data = new FormData(form);
|
|
|
|
|
|
|
|
|
|
_this9._request(url, event, method, type, data).then(function (result) {
|
|
|
|
|
resolve(result);
|
|
|
|
|
}).catch(function (err) {
|
|
|
|
|
reject(err);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
} //--------------------------
|
|
|
|
|
// private
|
|
|
|
|
//--------------------------
|
|
|
|
@ -735,7 +693,7 @@ var APIUtils = /*#__PURE__*/function () {
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
if (requestType == REQUEST_TYPE_PUT || requestType == REQUEST_TYPE_POST) {
|
|
|
|
|
if (eventType === DataEvent.API_PAGE_WRITE || eventType === DataEvent.API_IMAGES_UPLOAD || eventType === DataEvent.API_SETTINGS_WRITE || eventType === DataEvent.API_PAGE_DELETE || eventType === DataEvent.API_RENDER_PAGES) request.setRequestHeader('x-access-token', self.token);
|
|
|
|
|
if (eventType === DataEvent.API_PAGE_WRITE || eventType === DataEvent.API_IMAGES_UPLOAD || eventType === DataEvent.API_SETTINGS_WRITE || eventType === DataEvent.API_PAGE_DELETE || eventType === DataEvent.API_RENDER_PAGES || eventType === DataEvent.API_BACKUP_CREATE || eventType === DataEvent.API_BACKUP_RESTORE) request.setRequestHeader('x-access-token', self.token);
|
|
|
|
|
|
|
|
|
|
switch (contentType) {
|
|
|
|
|
case CONTENT_TYPE_JSON:
|
|
|
|
@ -766,7 +724,124 @@ var APIUtils = /*#__PURE__*/function () {
|
|
|
|
|
}();
|
|
|
|
|
|
|
|
|
|
exports.default = APIUtils;
|
|
|
|
|
},{"../com/events/DataEvent":"events/DataEvent.js"}],"utils/StringUtils.js":[function(require,module,exports) {
|
|
|
|
|
},{"../com/events/DataEvent":"events/DataEvent.js"}],"utils/DataUtils.js":[function(require,module,exports) {
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
exports.default = void 0;
|
|
|
|
|
|
|
|
|
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
|
|
|
|
|
|
|
|
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
|
|
|
|
|
|
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
|
|
|
|
|
|
|
var DataUtils = /*#__PURE__*/function () {
|
|
|
|
|
//--------------------------
|
|
|
|
|
// constructor
|
|
|
|
|
//--------------------------
|
|
|
|
|
function DataUtils() {
|
|
|
|
|
_classCallCheck(this, DataUtils);
|
|
|
|
|
} //--------------------------
|
|
|
|
|
// methods
|
|
|
|
|
//--------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_createClass(DataUtils, [{
|
|
|
|
|
key: "imgLoad",
|
|
|
|
|
value: function imgLoad(url) {
|
|
|
|
|
'use strict'; // Create new promise with the Promise() constructor;
|
|
|
|
|
// This has as its argument a function with two parameters, resolve and reject
|
|
|
|
|
|
|
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
|
|
// Standard XHR to load an image
|
|
|
|
|
var request = new XMLHttpRequest();
|
|
|
|
|
request.open('GET', url);
|
|
|
|
|
request.responseType = 'blob'; // When the request loads, check whether it was successful
|
|
|
|
|
|
|
|
|
|
request.onload = function () {
|
|
|
|
|
if (request.status === 200) {
|
|
|
|
|
// If successful, resolve the promise by passing back the request response
|
|
|
|
|
resolve(request.response);
|
|
|
|
|
} else {
|
|
|
|
|
// If it fails, reject the promise with a error message
|
|
|
|
|
reject(new Error("Image didn't load successfully; error code:" + request.statusText));
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
request.onerror = function () {
|
|
|
|
|
// Also deal with the case when the entire request fails to begin with
|
|
|
|
|
// This is probably a network error, so reject the promise with an appropriate message
|
|
|
|
|
reject(new Error('There was a network error.'));
|
|
|
|
|
}; // Send the request
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
request.send();
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "loadImage",
|
|
|
|
|
value: function loadImage(src) {
|
|
|
|
|
'use strict';
|
|
|
|
|
|
|
|
|
|
var self = this;
|
|
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
|
|
// Get a reference to the body element, and create a new image object
|
|
|
|
|
var myImage = new Image();
|
|
|
|
|
myImage.crossOrigin = ''; // or "anonymous"
|
|
|
|
|
// Call the function with the URL we want to load, but then chain the
|
|
|
|
|
// promise then() method on to the end of it. This contains two callbacks
|
|
|
|
|
|
|
|
|
|
self.imgLoad(src).then(function (response) {
|
|
|
|
|
// The first runs when the promise resolves, with the request.reponse specified within the resolve() method.
|
|
|
|
|
var imageURL = window.URL.createObjectURL(response);
|
|
|
|
|
resolve(imageURL); //$('background-content').setStyle('background-image', 'url('+imageURL+')') //myImage.src = imageURL;
|
|
|
|
|
//console.log(imageURL);
|
|
|
|
|
//body.appendChild(myImage);
|
|
|
|
|
// The second runs when the promise is rejected, and logs the Error specified with the reject() method.
|
|
|
|
|
}, function (Error) {
|
|
|
|
|
reject(Error);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
/**
|
|
|
|
|
* Create a function to convert the serialize and convert the form data to JSON
|
|
|
|
|
* @param : $('#form_example');
|
|
|
|
|
* @return a JSON Stringify
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
key: "formDataToJSON",
|
|
|
|
|
value: function formDataToJSON(form) {
|
|
|
|
|
var object = {};
|
|
|
|
|
var formData = new FormData(form);
|
|
|
|
|
formData.forEach(function (value, key) {
|
|
|
|
|
if (!object.hasOwnProperty(key)) {
|
|
|
|
|
object[key] = value;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!Array.isArray(object[key])) {
|
|
|
|
|
object[key] = [object[key]];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
object[key].push(value);
|
|
|
|
|
}); //let json = JSON.stringify(object);
|
|
|
|
|
|
|
|
|
|
return object;
|
|
|
|
|
} //--------------------------
|
|
|
|
|
// event handlers
|
|
|
|
|
//--------------------------
|
|
|
|
|
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return DataUtils;
|
|
|
|
|
}();
|
|
|
|
|
|
|
|
|
|
exports.default = DataUtils;
|
|
|
|
|
},{}],"utils/StringUtils.js":[function(require,module,exports) {
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
@ -4149,11 +4224,17 @@ var SettingsIndex = /*#__PURE__*/function () {
|
|
|
|
|
document.getElementById('background').addEventListener('click', function () {
|
|
|
|
|
document.getElementById('background-upload').click();
|
|
|
|
|
});
|
|
|
|
|
document.getElementById('restore-backup').addEventListener('click', function () {
|
|
|
|
|
document.getElementById('backup-upload').click();
|
|
|
|
|
});
|
|
|
|
|
document.getElementById('avatar-upload').addEventListener('change', function (e) {
|
|
|
|
|
self.handleImageUpload(e.target.id, e.target.files);
|
|
|
|
|
}, false);
|
|
|
|
|
document.getElementById('background-upload').addEventListener('change', function (e) {
|
|
|
|
|
self.handleImageUpload(e.target.id, e.target.files);
|
|
|
|
|
}, false);
|
|
|
|
|
document.getElementById('backup-upload').addEventListener('change', function (e) {
|
|
|
|
|
self.handleBackup(e);
|
|
|
|
|
}, false); //handle privacy toggle
|
|
|
|
|
//document
|
|
|
|
|
//.getElementById('privacy-toggle')
|
|
|
|
@ -4184,7 +4265,12 @@ var SettingsIndex = /*#__PURE__*/function () {
|
|
|
|
|
mailBtn[i].addEventListener('click', function (e) {
|
|
|
|
|
return _this.handleMailOptions(e);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} //handle backup
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
document.getElementById('create-backup').addEventListener('click', function (e) {
|
|
|
|
|
return _this.handleBackup(e);
|
|
|
|
|
});
|
|
|
|
|
} //--------------------------
|
|
|
|
|
// event handlers
|
|
|
|
|
//--------------------------
|
|
|
|
@ -4287,6 +4373,17 @@ var SettingsIndex = /*#__PURE__*/function () {
|
|
|
|
|
notify.alert(err, false);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "handleBackup",
|
|
|
|
|
value: function handleBackup(e) {
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
admin.handleBackup(e.target.id, e.target.files).then(function (r) {
|
|
|
|
|
notify.alert(r.message, true);
|
|
|
|
|
}).catch(function (err) {
|
|
|
|
|
notify.alert(err, false);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return SettingsIndex;
|
|
|
|
@ -8251,6 +8348,8 @@ exports.default = void 0;
|
|
|
|
|
|
|
|
|
|
var _FipamoAPI = _interopRequireDefault(require("../libraries/FipamoAPI"));
|
|
|
|
|
|
|
|
|
|
var _FipamoAdminAPI = _interopRequireDefault(require("../libraries/FipamoAdminAPI"));
|
|
|
|
|
|
|
|
|
|
var _DataUtils = _interopRequireDefault(require("./utils/DataUtils"));
|
|
|
|
|
|
|
|
|
|
var DataEvent = _interopRequireWildcard(require("./events/DataEvent"));
|
|
|
|
@ -8272,6 +8371,7 @@ function _defineProperties(target, props) { for (var i = 0; i < props.length; i+
|
|
|
|
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
|
|
|
|
|
|
|
|
var api = new _FipamoAPI.default();
|
|
|
|
|
var admin = new _FipamoAdminAPI.default();
|
|
|
|
|
var data = new _DataUtils.default();
|
|
|
|
|
var notify = new _Notifications.default();
|
|
|
|
|
|
|
|
|
@ -8294,6 +8394,14 @@ var Base = /*#__PURE__*/function () {
|
|
|
|
|
var _this = this;
|
|
|
|
|
|
|
|
|
|
if (document.getElementById('dash-form') || document.getElementById('dash-init')) {
|
|
|
|
|
var options = document.getElementsByClassName('init-option');
|
|
|
|
|
|
|
|
|
|
for (var index = 0; index < options.length; index++) {
|
|
|
|
|
options[index].addEventListener('click', function (e) {
|
|
|
|
|
return _this.handleOptions(e);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (document.getElementById('dash-form')) {
|
|
|
|
|
document.getElementById('login-btn').addEventListener('click', function (e) {
|
|
|
|
|
return _this.handleLogin(e);
|
|
|
|
@ -8302,6 +8410,9 @@ var Base = /*#__PURE__*/function () {
|
|
|
|
|
document.getElementById('init-blog').addEventListener('click', function (e) {
|
|
|
|
|
return _this.handleSetup(e);
|
|
|
|
|
});
|
|
|
|
|
document.getElementById('blog-restore').addEventListener('click', function (e) {
|
|
|
|
|
return _this.handleRestore(e);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
new _DashManager.default();
|
|
|
|
@ -8348,13 +8459,51 @@ var Base = /*#__PURE__*/function () {
|
|
|
|
|
notify.alert(err, false);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "handleRestore",
|
|
|
|
|
value: function handleRestore(e) {
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
var form = document.getElementById('init-restore');
|
|
|
|
|
admin.handleInitRestore(form).then(function (response) {
|
|
|
|
|
if (response.type === DataEvent.REQUEST_LAME) {
|
|
|
|
|
notify.alert(response.message, false);
|
|
|
|
|
} else {
|
|
|
|
|
notify.alert(response.message, true);
|
|
|
|
|
setTimeout(function () {//window.location = '/@/dashboard';
|
|
|
|
|
}, 700);
|
|
|
|
|
}
|
|
|
|
|
}).catch(function (err) {
|
|
|
|
|
notify.alert(err, false);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "handleOptions",
|
|
|
|
|
value: function handleOptions(e) {
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
var init = document.getElementById('dash-init');
|
|
|
|
|
var restore = document.getElementById('dash-restore');
|
|
|
|
|
|
|
|
|
|
if (e.target.id === 'init-switch-restore') {
|
|
|
|
|
init.style.display = 'none';
|
|
|
|
|
init.style.visibility = 'hidden';
|
|
|
|
|
restore.style.display = 'block';
|
|
|
|
|
restore.style.visibility = 'visible';
|
|
|
|
|
} else {
|
|
|
|
|
init.style.display = 'block';
|
|
|
|
|
init.style.visibility = 'visible';
|
|
|
|
|
restore.style.display = 'none';
|
|
|
|
|
restore.style.visibility = 'hidden';
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}]);
|
|
|
|
|
|
|
|
|
|
return Base;
|
|
|
|
|
}();
|
|
|
|
|
|
|
|
|
|
exports.default = Base;
|
|
|
|
|
},{"../libraries/FipamoAPI":"../libraries/FipamoAPI.js","./utils/DataUtils":"utils/DataUtils.js","./events/DataEvent":"events/DataEvent.js","./controllers/DashManager":"controllers/DashManager.js","./ui/Notifications":"ui/Notifications.js"}],"Start.js":[function(require,module,exports) {
|
|
|
|
|
},{"../libraries/FipamoAPI":"../libraries/FipamoAPI.js","../libraries/FipamoAdminAPI":"../libraries/FipamoAdminAPI.js","./utils/DataUtils":"utils/DataUtils.js","./events/DataEvent":"events/DataEvent.js","./controllers/DashManager":"controllers/DashManager.js","./ui/Notifications":"ui/Notifications.js"}],"Start.js":[function(require,module,exports) {
|
|
|
|
|
"use strict";
|
|
|
|
|
|
|
|
|
|
var _Base = _interopRequireDefault(require("./Base"));
|
|
|
|
@ -8392,7 +8541,7 @@ var parent = module.bundle.parent;
|
|
|
|
|
if ((!parent || !parent.isParcelRequire) && typeof WebSocket !== 'undefined') {
|
|
|
|
|
var hostname = "" || location.hostname;
|
|
|
|
|
var protocol = location.protocol === 'https:' ? 'wss' : 'ws';
|
|
|
|
|
var ws = new WebSocket(protocol + '://' + hostname + ':' + "61846" + '/');
|
|
|
|
|
var ws = new WebSocket(protocol + '://' + hostname + ':' + "59699" + '/');
|
|
|
|
|
|
|
|
|
|
ws.onmessage = function (event) {
|
|
|
|
|
checkedAssets = {};
|
|
|
|
|