Skip to content

Commit

Permalink
Style changes, changed default padding to 5px
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayquaza01 committed Jun 29, 2018
1 parent 7b637c3 commit 626013d
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 37 deletions.
22 changes: 4 additions & 18 deletions extension/notes.css
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ textarea {
color: inherit;
resize: none;
height: 100%;
width: 100%;
}

table {
Expand All @@ -27,7 +28,7 @@ table {
border-bottom: none;
}

#buttons, #overlay, #confirmDelete {
#buttons, #overlay, #confirmDelete, #tabstrip {
background-color: inherit;
color: inherit;
font-family: sans-serif;
Expand Down Expand Up @@ -73,7 +74,6 @@ table {

#buttons > .mdi {
padding-left: 5px;
/* padding-right: 5px; */
}

#buttons > .mdi:first-child {
Expand All @@ -88,19 +88,6 @@ table {
flex-grow: 1;
}

/* .left { */
/* float: left; */
/* overflow-x: hidden; */
/* text-align: left; */
/* width: 66%; */
/* } */

/* .right { */
/* float: right; */
/* text-align: right; */
/* width: 33%; */
/* } */

.mdi:hover {
cursor: pointer;
}
Expand Down Expand Up @@ -172,18 +159,17 @@ table {

select {
border: none;
/* background-color: #EEEEEE; */
}

/* https://stackoverflow.com/questions/90178/make-a-div-fill-the-height-of-the-remaining-screen-space */
.box {
display: flex;
flex-flow: column;
height: 100vh;
height: 100%;
}

.box .row.header {
flex: 0 1 auto;
flex: 0 1 20px;
}

.box .row.content {
Expand Down
29 changes: 12 additions & 17 deletions extension/notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ async function loadGeneralNotes() {
var res = await browser.storage.local.get("general_notes");
textarea.value = res.general_notes[tabstrip.dataset.activeTab] || "";
back.innerText = "General Notes";
back.title = "General Notes";
textarea.addEventListener("input", saveGeneralNotes);
}

Expand All @@ -86,11 +87,12 @@ async function siteNoteSetup(site) {
}
textarea.value = text;
back.innerText = site;
back.title = site;
textarea.addEventListener("input", saveSiteNotes);
}

function removeNoteFromList(name) {
var deleteButton = noteList.querySelector("span[data-delete-site='" + name + "']");
var deleteButton = noteList.querySelector(`span[data-delete-site=${name}]`);
deleteButton.parentNode.parentNode.removeChild(deleteButton.parentNode);
}

Expand Down Expand Up @@ -134,40 +136,31 @@ async function loadSiteNotes(manualClick = false, mode = "") {
var tabs = await browser.tabs.query({active: true, currentWindow: true});
if (!tabs[0].incognito || manualClick || (res.options.private_browsing && tabs[0].incognito)) {
var url = tabs[0].url;
var site = await siteParser(url, mode);
var site = await siteParser(url, mode || res.options.default_display);
if (site === "general_notes") {
loadGeneralNotes();
} else {
siteNoteSetup(site);
toggle.value = mode || res.options.default_display;
}
} else {
loadGeneralNotes();
}
}

function changeNoteMode() {
async function changeNoteMode() {
var tabs = await browser.tabs.query({active: true, currentWindow: true});
switch (this.value) {
case "url":
loadSiteNotes(true, "url");
break;
case "domain":
loadSiteNotes(true, "domain");
// back.dataset[tabs[0].id] = await siteParser(tabs[0].url, this.value);
loadSiteNotes(true, this.value);
break;
case "general_notes":
// back.dataset[tabs[0].id] = "General Notes";
loadGeneralNotes();
break;
}
// switch (this.className) {
// case "mdi mdi-web":
// loadSiteNotes(true, "url");
// break;
// case "mdi mdi-domain":
// loadSiteNotes(true);
// break;
// case "mdi mdi-note":
// loadGeneralNotes();
// break;
// }
}

async function setTheme(mode) {
Expand All @@ -189,6 +182,7 @@ async function setTheme(mode) {
confirmDelete.style.backgroundColor = bg_color;
document.body.style.color = font_color;
search.style.color = font_color;
toggle.style.color = font_color;
}

async function changeTheme() {
Expand All @@ -214,6 +208,7 @@ function addNoteToList(site) {
cont.className = "container";
var name = document.createElement("span");
name.innerText = site;
name.title = site;
name.className = "name";
var del = document.createElement("span");
del.dataset.deleteSite = site;
Expand Down
2 changes: 1 addition & 1 deletion extension/options.html
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@
</div>
<div class="center">
<button id="upload">Upload to Sync</button>
<button id="download">Download from Sync</button>
<button id="download">Download from Sync</button> (Please export notes and options before downloading from sync, just in case.)
</div>
<script src="options.js"></script>
</body>
Expand Down
2 changes: 1 addition & 1 deletion extension/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ function setOpts() {
res.options.bullet_types = res.options.hasOwnProperty("bullet_types") ? res.options.bullet_types : ["*", "-", "+"];
res.options.get_params = res.options.hasOwnProperty("get_params") ? res.options.get_params : ["q", "v"];
res.options.tabnos = res.options.hasOwnProperty("tabnos") ? res.options.tabnos : 1;
res.options.padding = res.options.hasOwnProperty("padding") ? res.options.padding : 0;
res.options.padding = res.options.hasOwnProperty("padding") ? res.options.padding : 5;
res.site_notes = res.hasOwnProperty("site_notes") ? res.site_notes : {};
if (!Array.isArray(res.general_notes)) {
res.general_notes = [res.general_notes];
Expand Down

0 comments on commit 626013d

Please sign in to comment.