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(
|
||||
"DOMContentLoaded",
|
||||
function () {
|
||||
new Base();
|
||||
},
|
||||
false
|
||||
'DOMContentLoaded',
|
||||
function () {
|
||||
new Base();
|
||||
},
|
||||
false
|
||||
);
|
||||
|
@ -1,78 +1,79 @@
|
||||
export default class SettingsActions {
|
||||
//--------------------------
|
||||
// constructor
|
||||
//--------------------------
|
||||
constructor() {}
|
||||
//--------------------------
|
||||
// methods
|
||||
//--------------------------
|
||||
getInfo() {
|
||||
let handle = document.getElementById("settings-handle").value;
|
||||
let email = document.getElementById("settings-email").value;
|
||||
let url = document.getElementById("settings-url").value;
|
||||
let title = document.getElementById("settings-title").value;
|
||||
let desc = document.getElementById("settings-desc").value;
|
||||
//let privacy = document.getElementById('privacy-toggle').getAttribute('data-private');
|
||||
let render = document
|
||||
.getElementById("render-toggle")
|
||||
.getAttribute("data-render");
|
||||
let background = document.getElementById("background").src;
|
||||
let selected = "";
|
||||
let selects = document.querySelectorAll(".theme-select");
|
||||
let smtpDomain = document.getElementById("smtp-domain").value;
|
||||
let smtpEmail = document.getElementById("smtp-email").value;
|
||||
let smtpPass = document.getElementById("smtp-pass").value;
|
||||
let mgDomain = document.getElementById("mg-domain").value;
|
||||
let mgKey = document.getElementById("mg-key").value;
|
||||
let mailActive = "";
|
||||
let mailOptions = document.querySelectorAll(".mail-option");
|
||||
let apiStatus = document
|
||||
.getElementById("api-access-toggle")
|
||||
.getAttribute("data-enabled");
|
||||
let dynamicRenderStatus = document
|
||||
.getElementById("dynamic-render-toggle")
|
||||
.getAttribute("data-enabled");
|
||||
var i, count;
|
||||
for (i = 0, count = selects.length; i < count; i++) {
|
||||
if (selects[i].getAttribute("data-enabled") == "true")
|
||||
selected = selects[i].id;
|
||||
}
|
||||
//--------------------------
|
||||
// constructor
|
||||
//--------------------------
|
||||
constructor() {}
|
||||
//--------------------------
|
||||
// methods
|
||||
//--------------------------
|
||||
getInfo() {
|
||||
let handle = document.getElementById('settings-handle').value;
|
||||
let email = document.getElementById('settings-email').value;
|
||||
let url = document.getElementById('settings-url').value;
|
||||
let title = document.getElementById('settings-title').value;
|
||||
let desc = document.getElementById('settings-desc').value;
|
||||
//let privacy = document.getElementById('privacy-toggle').getAttribute('data-private');
|
||||
let render = document.getElementById('render-toggle').getAttribute('data-render');
|
||||
let background = document
|
||||
.querySelector('[role="background"]')
|
||||
.style.backgroundImage.slice(4, -1)
|
||||
.replace(/"/g, '');
|
||||
let selected = '';
|
||||
let selects = document.querySelectorAll('.theme-select');
|
||||
let smtpDomain = document.getElementById('smtp-domain').value;
|
||||
let smtpEmail = document.getElementById('smtp-email').value;
|
||||
let smtpPass = document.getElementById('smtp-pass').value;
|
||||
let mgDomain = document.getElementById('mg-domain').value;
|
||||
let mgKey = document.getElementById('mg-key').value;
|
||||
let mailActive = '';
|
||||
let mailOptions = document.querySelectorAll('.mail-option');
|
||||
let apiStatus = document
|
||||
.getElementById('api-access-toggle')
|
||||
.getAttribute('data-enabled');
|
||||
let dynamicRenderStatus = document
|
||||
.getElementById('dynamic-render-toggle')
|
||||
.getAttribute('data-enabled');
|
||||
var i, count;
|
||||
for (i = 0, count = selects.length; i < count; i++) {
|
||||
if (selects[i].getAttribute('data-enabled') == 'true')
|
||||
selected = selects[i].id;
|
||||
}
|
||||
|
||||
for (i = 0, count = mailOptions.length; i < count; i++) {
|
||||
if (mailOptions[i].getAttribute("data-enabled") == "true")
|
||||
mailActive = mailOptions[i].id;
|
||||
}
|
||||
let settingsData = {
|
||||
global: {
|
||||
base_url: url,
|
||||
title: title,
|
||||
descriptions: desc,
|
||||
background: background,
|
||||
private: false,
|
||||
renderOnSave: render,
|
||||
theme: selected,
|
||||
externalAPI: apiStatus,
|
||||
dynamicRender: dynamicRenderStatus
|
||||
},
|
||||
member: { handle: handle, email: email },
|
||||
email: {
|
||||
active: mailActive,
|
||||
smtp: {
|
||||
domain: smtpDomain,
|
||||
email: smtpEmail,
|
||||
password: smtpPass
|
||||
},
|
||||
mailgun: {
|
||||
domain: mgDomain,
|
||||
key: mgKey
|
||||
}
|
||||
}
|
||||
};
|
||||
return new Promise(function (resolve) {
|
||||
resolve(settingsData);
|
||||
});
|
||||
}
|
||||
//--------------------------
|
||||
// event handlers
|
||||
//--------------------------
|
||||
for (i = 0, count = mailOptions.length; i < count; i++) {
|
||||
if (mailOptions[i].getAttribute('data-enabled') == 'true')
|
||||
mailActive = mailOptions[i].id;
|
||||
}
|
||||
let settingsData = {
|
||||
global: {
|
||||
base_url: url,
|
||||
title: title,
|
||||
descriptions: desc,
|
||||
background: background,
|
||||
private: false,
|
||||
renderOnSave: render,
|
||||
theme: selected,
|
||||
externalAPI: apiStatus,
|
||||
dynamicRender: dynamicRenderStatus
|
||||
},
|
||||
member: { handle: handle, email: email },
|
||||
email: {
|
||||
active: mailActive,
|
||||
smtp: {
|
||||
domain: smtpDomain,
|
||||
email: smtpEmail,
|
||||
password: smtpPass
|
||||
},
|
||||
mailgun: {
|
||||
domain: mgDomain,
|
||||
key: mgKey
|
||||
}
|
||||
}
|
||||
};
|
||||
return new Promise(function (resolve) {
|
||||
resolve(settingsData);
|
||||
});
|
||||
}
|
||||
//--------------------------
|
||||
// event handlers
|
||||
//--------------------------
|
||||
}
|
||||
|
Loading…
Reference in New Issue