|
|
|
@ -8368,7 +8368,7 @@ function () {
|
|
|
|
|
};
|
|
|
|
|
return new Promise(function (resolve, reject) {
|
|
|
|
|
self.dataUtils.request('/api/settings/sync', DataEvent.SETTINGS_UPDATED, _DataUtils.REQUEST_TYPE_POST, _DataUtils.CONTENT_TYPE_JSON, settingsData).then(function (response) {
|
|
|
|
|
console.log("RESPONSE", response);
|
|
|
|
|
//console.log("RESPONSE", response)
|
|
|
|
|
resolve(response);
|
|
|
|
|
}).catch(function (err) {
|
|
|
|
|
reject(err);
|
|
|
|
@ -8427,14 +8427,18 @@ function () {
|
|
|
|
|
_createClass(SettingsIndex, [{
|
|
|
|
|
key: "start",
|
|
|
|
|
value: function start() {
|
|
|
|
|
var self = this;
|
|
|
|
|
var _this = this;
|
|
|
|
|
|
|
|
|
|
var self = this; //handle save button
|
|
|
|
|
|
|
|
|
|
document.getElementById('save-toggle').addEventListener('click', function (f) {
|
|
|
|
|
return new _SettingsActions.default().save().then(function (response) {
|
|
|
|
|
console.log(response);
|
|
|
|
|
}).catch(function (err) {
|
|
|
|
|
console.log(err);
|
|
|
|
|
});
|
|
|
|
|
});
|
|
|
|
|
}); //handle set up image uploads
|
|
|
|
|
|
|
|
|
|
document.getElementById('avatar').addEventListener('click', function (e) {
|
|
|
|
|
document.getElementById('avatar-upload').click();
|
|
|
|
|
});
|
|
|
|
@ -8446,11 +8450,48 @@ function () {
|
|
|
|
|
}, false);
|
|
|
|
|
document.getElementById('background-upload').addEventListener('change', function (e) {
|
|
|
|
|
self.handleImageUpload(e.target.id, e.target.files);
|
|
|
|
|
}, false);
|
|
|
|
|
}, false); //handle privacy toggle
|
|
|
|
|
|
|
|
|
|
document.getElementById("privacy-toggle").addEventListener("click", function (e) {
|
|
|
|
|
return _this.togglePrivacy(e);
|
|
|
|
|
}); //handle theme toggle
|
|
|
|
|
|
|
|
|
|
var themeBtns = document.querySelectorAll('.theme-select');
|
|
|
|
|
|
|
|
|
|
for (var i = 0, length = themeBtns.length; i < length; i++) {
|
|
|
|
|
themeBtns[i].addEventListener('click', function (e) {
|
|
|
|
|
return _this.handleThemes(e);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
} //--------------------------
|
|
|
|
|
// event handlers
|
|
|
|
|
//--------------------------
|
|
|
|
|
|
|
|
|
|
}, {
|
|
|
|
|
key: "togglePrivacy",
|
|
|
|
|
value: function togglePrivacy(e) {
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
|
|
|
|
|
if (e.target.getAttribute('data-private') == "false") {
|
|
|
|
|
e.target.setAttribute('data-private', 'true');
|
|
|
|
|
e.target.innerHTML = "SITE IS PUBLIC";
|
|
|
|
|
} else {
|
|
|
|
|
e.target.setAttribute('data-private', 'false');
|
|
|
|
|
e.target.innerHTML = "SITE IS PRIVATE";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "handleThemes",
|
|
|
|
|
value: function handleThemes(e) {
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
e.preventDefault();
|
|
|
|
|
var themes = document.querySelectorAll('.theme-select');
|
|
|
|
|
|
|
|
|
|
for (var i = 0, length = themes.length; i < length; i++) {
|
|
|
|
|
e.target.id == themes[i].id ? themes[i].setAttribute('data-enabled', 'true') : themes[i].setAttribute('data-enabled', 'false');
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}, {
|
|
|
|
|
key: "handleImageUpload",
|
|
|
|
|
value: function handleImageUpload(type, files) {
|
|
|
|
|