Reponsive: Part 1 - Settings
Started cleaning up responsive styles for the site starting with the Settings section. Still needs some tweaking but the structure for that section is in so it's just a matter of police. Some changes need to be made to the main nav as reduced viewport throws off the alignment.toggle-buttons-#109
parent
97278e3a90
commit
bfb0873f5f
@ -1,9 +1,9 @@
|
|||||||
import Base from "./Base";
|
import Base from './Base';
|
||||||
|
|
||||||
document.addEventListener(
|
document.addEventListener(
|
||||||
"DOMContentLoaded",
|
'DOMContentLoaded',
|
||||||
function () {
|
function () {
|
||||||
new Base();
|
new Base();
|
||||||
},
|
},
|
||||||
false
|
false
|
||||||
);
|
);
|
||||||
|
@ -1,78 +1,79 @@
|
|||||||
export default class SettingsActions {
|
export default class SettingsActions {
|
||||||
//--------------------------
|
//--------------------------
|
||||||
// constructor
|
// constructor
|
||||||
//--------------------------
|
//--------------------------
|
||||||
constructor() {}
|
constructor() {}
|
||||||
//--------------------------
|
//--------------------------
|
||||||
// methods
|
// methods
|
||||||
//--------------------------
|
//--------------------------
|
||||||
getInfo() {
|
getInfo() {
|
||||||
let handle = document.getElementById("settings-handle").value;
|
let handle = document.getElementById('settings-handle').value;
|
||||||
let email = document.getElementById("settings-email").value;
|
let email = document.getElementById('settings-email').value;
|
||||||
let url = document.getElementById("settings-url").value;
|
let url = document.getElementById('settings-url').value;
|
||||||
let title = document.getElementById("settings-title").value;
|
let title = document.getElementById('settings-title').value;
|
||||||
let desc = document.getElementById("settings-desc").value;
|
let desc = document.getElementById('settings-desc').value;
|
||||||
//let privacy = document.getElementById('privacy-toggle').getAttribute('data-private');
|
//let privacy = document.getElementById('privacy-toggle').getAttribute('data-private');
|
||||||
let render = document
|
let render = document.getElementById('render-toggle').getAttribute('data-render');
|
||||||
.getElementById("render-toggle")
|
let background = document
|
||||||
.getAttribute("data-render");
|
.querySelector('[role="background"]')
|
||||||
let background = document.getElementById("background").src;
|
.style.backgroundImage.slice(4, -1)
|
||||||
let selected = "";
|
.replace(/"/g, '');
|
||||||
let selects = document.querySelectorAll(".theme-select");
|
let selected = '';
|
||||||
let smtpDomain = document.getElementById("smtp-domain").value;
|
let selects = document.querySelectorAll('.theme-select');
|
||||||
let smtpEmail = document.getElementById("smtp-email").value;
|
let smtpDomain = document.getElementById('smtp-domain').value;
|
||||||
let smtpPass = document.getElementById("smtp-pass").value;
|
let smtpEmail = document.getElementById('smtp-email').value;
|
||||||
let mgDomain = document.getElementById("mg-domain").value;
|
let smtpPass = document.getElementById('smtp-pass').value;
|
||||||
let mgKey = document.getElementById("mg-key").value;
|
let mgDomain = document.getElementById('mg-domain').value;
|
||||||
let mailActive = "";
|
let mgKey = document.getElementById('mg-key').value;
|
||||||
let mailOptions = document.querySelectorAll(".mail-option");
|
let mailActive = '';
|
||||||
let apiStatus = document
|
let mailOptions = document.querySelectorAll('.mail-option');
|
||||||
.getElementById("api-access-toggle")
|
let apiStatus = document
|
||||||
.getAttribute("data-enabled");
|
.getElementById('api-access-toggle')
|
||||||
let dynamicRenderStatus = document
|
.getAttribute('data-enabled');
|
||||||
.getElementById("dynamic-render-toggle")
|
let dynamicRenderStatus = document
|
||||||
.getAttribute("data-enabled");
|
.getElementById('dynamic-render-toggle')
|
||||||
var i, count;
|
.getAttribute('data-enabled');
|
||||||
for (i = 0, count = selects.length; i < count; i++) {
|
var i, count;
|
||||||
if (selects[i].getAttribute("data-enabled") == "true")
|
for (i = 0, count = selects.length; i < count; i++) {
|
||||||
selected = selects[i].id;
|
if (selects[i].getAttribute('data-enabled') == 'true')
|
||||||
}
|
selected = selects[i].id;
|
||||||
|
}
|
||||||
|
|
||||||
for (i = 0, count = mailOptions.length; i < count; i++) {
|
for (i = 0, count = mailOptions.length; i < count; i++) {
|
||||||
if (mailOptions[i].getAttribute("data-enabled") == "true")
|
if (mailOptions[i].getAttribute('data-enabled') == 'true')
|
||||||
mailActive = mailOptions[i].id;
|
mailActive = mailOptions[i].id;
|
||||||
}
|
}
|
||||||
let settingsData = {
|
let settingsData = {
|
||||||
global: {
|
global: {
|
||||||
base_url: url,
|
base_url: url,
|
||||||
title: title,
|
title: title,
|
||||||
descriptions: desc,
|
descriptions: desc,
|
||||||
background: background,
|
background: background,
|
||||||
private: false,
|
private: false,
|
||||||
renderOnSave: render,
|
renderOnSave: render,
|
||||||
theme: selected,
|
theme: selected,
|
||||||
externalAPI: apiStatus,
|
externalAPI: apiStatus,
|
||||||
dynamicRender: dynamicRenderStatus
|
dynamicRender: dynamicRenderStatus
|
||||||
},
|
},
|
||||||
member: { handle: handle, email: email },
|
member: { handle: handle, email: email },
|
||||||
email: {
|
email: {
|
||||||
active: mailActive,
|
active: mailActive,
|
||||||
smtp: {
|
smtp: {
|
||||||
domain: smtpDomain,
|
domain: smtpDomain,
|
||||||
email: smtpEmail,
|
email: smtpEmail,
|
||||||
password: smtpPass
|
password: smtpPass
|
||||||
},
|
},
|
||||||
mailgun: {
|
mailgun: {
|
||||||
domain: mgDomain,
|
domain: mgDomain,
|
||||||
key: mgKey
|
key: mgKey
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
return new Promise(function (resolve) {
|
return new Promise(function (resolve) {
|
||||||
resolve(settingsData);
|
resolve(settingsData);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
//--------------------------
|
//--------------------------
|
||||||
// event handlers
|
// event handlers
|
||||||
//--------------------------
|
//--------------------------
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue