|
|
|
@ -197,7 +197,7 @@ exports.default = _default;
|
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
|
|
|
value: true
|
|
|
|
|
});
|
|
|
|
|
exports.default = exports.AVATAR_UPLOADED = exports.SETTINGS_UPDATED = exports.LOCAL_DB_READY = exports.POSTS_SYNCED = exports.POST_DELETED = exports.POST_UPDATED = exports.POST_ADDED = exports.POST_ERROR = exports.FEATURE_IMAGE_ADDED = exports.POST_IMAGE_ADDED = exports.PROJECTS_SORTED = exports.PROJECT_ADDED = exports.PROJECT_UPDATED = exports.ARCHIVES_ENTRY_LOADED = exports.ARCHIVES_PAGE_LOADED = exports.ARCHIVES_JSON_LOADED = exports.HTML_LOADED = exports.SETTINGS_LOADED = exports.IMG_REQUEST_LAME = exports.IMG_REQUEST_GOOD = exports.REQUEST_LAME = exports.REQUEST_GOOD = void 0;
|
|
|
|
|
exports.default = exports.SITE_BACKGROUND_UPLOADED = exports.AVATAR_UPLOADED = exports.SETTINGS_UPDATED = exports.LOCAL_DB_READY = exports.POSTS_SYNCED = exports.POST_DELETED = exports.POST_UPDATED = exports.POST_ADDED = exports.POST_ERROR = exports.FEATURE_IMAGE_ADDED = exports.POST_IMAGE_ADDED = exports.PROJECTS_SORTED = exports.PROJECT_ADDED = exports.PROJECT_UPDATED = exports.ARCHIVES_ENTRY_LOADED = exports.ARCHIVES_PAGE_LOADED = exports.ARCHIVES_JSON_LOADED = exports.HTML_LOADED = exports.SETTINGS_LOADED = exports.IMG_REQUEST_LAME = exports.IMG_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"); } }
|
|
|
|
|
|
|
|
|
@ -245,6 +245,8 @@ var SETTINGS_UPDATED = 'settingsUpdated';
|
|
|
|
|
exports.SETTINGS_UPDATED = SETTINGS_UPDATED;
|
|
|
|
|
var AVATAR_UPLOADED = 'avatarUploaded';
|
|
|
|
|
exports.AVATAR_UPLOADED = AVATAR_UPLOADED;
|
|
|
|
|
var SITE_BACKGROUND_UPLOADED = 'siteBackgroundUploaded';
|
|
|
|
|
exports.SITE_BACKGROUND_UPLOADED = SITE_BACKGROUND_UPLOADED;
|
|
|
|
|
|
|
|
|
|
var DataEvent = function DataEvent() {
|
|
|
|
|
_classCallCheck(this, DataEvent);
|
|
|
|
@ -8346,6 +8348,7 @@ function () {
|
|
|
|
|
var title = document.getElementById('settings-title').value;
|
|
|
|
|
var desc = document.getElementById('settings-desc').innerHTML;
|
|
|
|
|
var privacy = document.getElementById('privacy-toggle').getAttribute('data-private');
|
|
|
|
|
var background = document.getElementById('background').src;
|
|
|
|
|
var selected = "";
|
|
|
|
|
var selects = document.querySelectorAll('.theme-select');
|
|
|
|
|
|
|
|
|
@ -8359,6 +8362,7 @@ function () {
|
|
|
|
|
url: url,
|
|
|
|
|
title: title,
|
|
|
|
|
descriptions: desc,
|
|
|
|
|
background: background,
|
|
|
|
|
private: privacy,
|
|
|
|
|
theme: selected
|
|
|
|
|
};
|
|
|
|
@ -8434,9 +8438,15 @@ function () {
|
|
|
|
|
document.getElementById('avatar').addEventListener('click', function (e) {
|
|
|
|
|
document.getElementById('avatar-upload').click();
|
|
|
|
|
});
|
|
|
|
|
document.getElementById('background').addEventListener('click', function (e) {
|
|
|
|
|
document.getElementById('background-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);
|
|
|
|
|
} //--------------------------
|
|
|
|
|
// event handlers
|
|
|
|
|
//--------------------------
|
|
|
|
@ -8447,8 +8457,7 @@ function () {
|
|
|
|
|
var url = "";
|
|
|
|
|
var eventType = "";
|
|
|
|
|
var self = this;
|
|
|
|
|
type == "avatar-upload" ? url = "/api/settings/add-avatar" : url = "/api/settings/add-feature-background"; //(type == "featured-image-upload") ? eventType = DataEvent.FEATURE_IMAGE_ADDED: eventType = DataEvent.POST_IMAGE_ADDED
|
|
|
|
|
|
|
|
|
|
type == "avatar-upload" ? url = "/api/settings/add-avatar" : url = "/api/settings/add-feature-background";
|
|
|
|
|
var imageData = new FormData();
|
|
|
|
|
|
|
|
|
|
for (var i = 0; i < files.length; i++) {
|
|
|
|
@ -8466,6 +8475,8 @@ function () {
|
|
|
|
|
|
|
|
|
|
if (r.message == DataEvent.AVATAR_UPLOADED) {
|
|
|
|
|
document.getElementById('avatar').src = r.url;
|
|
|
|
|
} else {
|
|
|
|
|
document.getElementById('background').src = r.url;
|
|
|
|
|
}
|
|
|
|
|
}).catch(function (err) {//console.log(err)
|
|
|
|
|
});
|
|
|
|
@ -8669,7 +8680,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 + ':' + "62875" + '/');
|
|
|
|
|
var ws = new WebSocket(protocol + '://' + hostname + ':' + "54297" + '/');
|
|
|
|
|
|
|
|
|
|
ws.onmessage = function (event) {
|
|
|
|
|
var data = JSON.parse(event.data);
|
|
|
|
|