diff --git a/package-lock.json b/package-lock.json index bccef9ca..72d435e7 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "nightTab", - "version": "5.36.0", + "version": "5.37.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index bb953a17..de911c12 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "nightTab", - "version": "5.36.0", + "version": "5.37.1", "description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.", "main": "index.js", "scripts": { diff --git a/src/css/base.css b/src/css/base.css index 9aeb7c2e..f8683d33 100755 --- a/src/css/base.css +++ b/src/css/base.css @@ -1,6 +1,6 @@ ::selection { background-color: rgb(var(--theme-accent)); - color: rgb(var(--theme-white)); + color: hsl(var(--theme-accent-accessible-color)); } html { diff --git a/src/js/clock.js b/src/js/clock.js index 021c4ee5..5b398ab5 100644 --- a/src/js/clock.js +++ b/src/js/clock.js @@ -112,9 +112,10 @@ var clock = (function() { }; if (state.get.current().header.clock.separator.show) { var separatorCharacter; - if (state.get.current().header.clock.separator.text.trim().replace(/\s\s+/g, " ") != "") { + if (typeof state.get.current().header.clock.separator.text == "string" && state.get.current().header.clock.separator.text != "") { separatorCharacter = state.get.current().header.clock.separator.text.trim().replace(/\s\s+/g, " "); - } else { + }; + if (separatorCharacter == "" || separatorCharacter == " " || separatorCharacter == undefined) { separatorCharacter = ":"; }; var parts = clock.querySelectorAll("span"); diff --git a/src/js/date.js b/src/js/date.js index 2332fa4d..9a4f4127 100644 --- a/src/js/date.js +++ b/src/js/date.js @@ -129,10 +129,11 @@ var date = (function() { }; if (state.get.current().header.date.separator.show) { var separatorCharacter; - if (state.get.current().header.date.separator.text.trim().replace(/\s\s+/g, " ") != "") { - separatorCharacter = state.get.current().header.date.separator.text.trim().replace(/\s\s+/g, " "); - } else { - separatorCharacter = "/"; + if (typeof state.get.current().header.date.separator.text == "string" && state.get.current().header.date.separator.text != "") { + separatorCharacter = state.get.current().header.date.separator.text.trim().replace(/\s\s+/g, " "); + }; + if (separatorCharacter == "" || separatorCharacter == " " || separatorCharacter == undefined) { + separatorCharacter = "/"; }; var parts = date.querySelectorAll("span"); if (parts.length > 1) { diff --git a/src/js/header.js b/src/js/header.js index 30b1354d..0c7b7832 100644 --- a/src/js/header.js +++ b/src/js/header.js @@ -373,7 +373,7 @@ var header = (function() { var headerSearchBody = helper.node("div|class:search-wrapper"); var form = helper.node("form|class:search,action,method:get"); var searchInput; - if (state.get.current().header.search.engine.custom.queryName != "") { + if (typeof state.get.current().header.search.engine.custom.queryName == "string" && state.get.current().header.search.engine.custom.queryName != "") { searchInput = helper.node("input|class:search-input,type:search,placeholder:Find or Search,name:" + state.get.current().header.search.engine.custom.queryName.trim() + ",autocomplete:off,autocorrect:off,autocapitalize:off,spellcheck:false,tabindex:1"); } else { searchInput = helper.node("input|class:search-input,type:search,placeholder:Find or Search,name:q,autocomplete:off,autocorrect:off,autocapitalize:off,spellcheck:false,tabindex:1"); diff --git a/src/js/layout.js b/src/js/layout.js index fed8d64d..ca6b6900 100644 --- a/src/js/layout.js +++ b/src/js/layout.js @@ -24,8 +24,8 @@ var layout = (function() { render.title = function() { var title = helper.e("title"); - if (state.get.current().layout.title.trim().replace(/\s\s+/g, " ") != "") { - title.textContent = state.get.current().layout.title; + if (typeof state.get.current().layout.title == "string" && state.get.current().layout.title != "") { + title.textContent = state.get.current().layout.title.trim().replace(/\s\s+/g, " "); } else { title.textContent = "New tab"; }; diff --git a/src/js/link.js b/src/js/link.js index 0fe8cdf6..a427cb57 100644 --- a/src/js/link.js +++ b/src/js/link.js @@ -18,9 +18,12 @@ var link = (function() { }; stagedGroup.init = function() { - stagedGroup.group.items = []; + stagedGroup.position.origin = 0; + stagedGroup.position.destination = 0; + stagedGroup.group.name.text = ""; stagedGroup.group.name.show = true; stagedGroup.group.openAll.show = true; + stagedGroup.group.items = []; }; stagedGroup.reset = function() { @@ -66,7 +69,6 @@ var link = (function() { }, name: null, url: null, - timeStamp: null, accent: { by: null, hsl: { @@ -94,6 +96,7 @@ var link = (function() { } }, image: null, + timeStamp: null, searchMatch: null } }; @@ -104,10 +107,17 @@ var link = (function() { stagedLink.position.destination.group = 0; stagedLink.position.destination.item = 0; stagedLink.position.group.new = false; - stagedLink.position.group.name.show = false; - stagedLink.position.group.openAll.show = false; + stagedLink.position.group.name.show = true; + stagedLink.position.group.name.text = ""; + stagedLink.position.group.openAll.show = true; stagedLink.link.visual.display = "letter"; + stagedLink.link.visual.letter = ""; + stagedLink.link.visual.image = ""; + stagedLink.link.visual.icon.name = ""; + stagedLink.link.visual.icon.prefix = ""; + stagedLink.link.visual.icon.label = ""; stagedLink.link.name = ""; + stagedLink.link.url = ""; stagedLink.link.accent.by = "theme"; stagedLink.link.accent.hsl.h = 0; stagedLink.link.accent.hsl.s = 0; @@ -132,7 +142,9 @@ var link = (function() { stagedLink.position.destination.group = null; stagedLink.position.destination.item = null; stagedLink.position.group.new = null; + stagedLink.position.group.name.show = null; stagedLink.position.group.name.text = null; + stagedLink.position.group.openAll.show = null; stagedLink.link.visual.display = null; stagedLink.link.visual.letter = null; stagedLink.link.visual.image = null; @@ -141,7 +153,6 @@ var link = (function() { stagedLink.link.visual.icon.label = null; stagedLink.link.name = null; stagedLink.link.url = null; - stagedLink.link.timeStamp = null; stagedLink.link.accent.by = null; stagedLink.link.accent.hsl.h = null; stagedLink.link.accent.hsl.s = null; @@ -157,6 +168,7 @@ var link = (function() { stagedLink.link.color.rgb.g = null; stagedLink.link.color.rgb.b = null; stagedLink.link.image = null; + stagedLink.link.timeStamp = null; stagedLink.link.searchMatch = null; }; @@ -904,7 +916,7 @@ var link = (function() { value: "link-item" }] }; - if (stagedLink.link.accent.by == "custom" || stagedLink.link.color.by == "custom" || (stagedLink.link.image != null && stagedLink.link.image != "")) { + if (stagedLink.link.accent.by == "custom" || stagedLink.link.color.by == "custom" || (stagedLink.link.image != null && typeof stagedLink.link.image == "string" && stagedLink.link.image != "")) { linkItemOptions.attr.push({ key: "style", value: "" @@ -985,9 +997,9 @@ var link = (function() { }] }); }; - var nameText = stagedLink.link.name.trim(); - if (nameText == null) { - nameText = ""; + var nameText = ""; + if (typeof stagedLink.link.name == "string" && stagedLink.link.name != "") { + nameText = stagedLink.link.name.trim().replace(/\s\s+/g, " "); }; var linkDisplayName = helper.node("p:" + nameText + "|class:link-display-name"); diff --git a/src/js/update.js b/src/js/update.js index 1ab72694..fb029776 100644 --- a/src/js/update.js +++ b/src/js/update.js @@ -967,7 +967,7 @@ var update = (function() { }; return data; }, - "5.32.0": function(data) { + "5.37.1": function(data) { data.bookmarks.forEach(function(arrayItem, index) { arrayItem.items.forEach(function(arrayItem, index) { arrayItem.accent.color.rgb = { @@ -994,9 +994,6 @@ var update = (function() { delete arrayItem.accent.color.b; }); }); - return data; - }, - "5.33.0": function(data) { data.bookmarks.forEach(function(arrayItem, index) { arrayItem.items.forEach(function(arrayItem, index) { arrayItem.visual = { @@ -1077,13 +1074,7 @@ var update = (function() { s: 0, l: 0 }; - return data; - }, - "5.34.0": function(data) { data.state.header.search.engine.custom.queryName = ""; - return data; - }, - "5.35.0": function(data) { data.state.link.item.display.visual.shadow = { size: 0 }; diff --git a/src/js/version.js b/src/js/version.js index 9184e994..d25efd97 100644 --- a/src/js/version.js +++ b/src/js/version.js @@ -1,6 +1,6 @@ var version = (function() { - var current = "5.36.0"; + var current = "5.37.1"; var name = "Zonked Tarsier"; diff --git a/src/manifest.json b/src/manifest.json index ce64b7ea..078fdb77 100644 --- a/src/manifest.json +++ b/src/manifest.json @@ -2,7 +2,7 @@ "name": "nightTab", "short_name": "nightTab", "description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.", - "version": "5.36.0", + "version": "5.37.1", "manifest_version": 2, "chrome_url_overrides": { "newtab": "index.html"