Skip to content

Commit 6d581dd

Browse files
committed
[bug] fix link name null value
1 parent 6affe55 commit 6d581dd

File tree

11 files changed

+38
-33
lines changed

11 files changed

+38
-33
lines changed

‎package-lock.json‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nightTab",
3-
"version": "5.36.0",
3+
"version": "5.37.1",
44
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
55
"main": "index.js",
66
"scripts":{

‎src/css/base.css‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
::selection{
22
background-color:rgb(var(--theme-accent));
3-
color:rgb(var(--theme-white));
3+
color:hsl(var(--theme-accent-accessible-color));
44
}
55

66
html{

‎src/js/clock.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,10 @@ var clock = (function(){
112112
};
113113
if(state.get.current().header.clock.separator.show){
114114
varseparatorCharacter;
115-
if(state.get.current().header.clock.separator.text.trim().replace(/\s\s+/g," ")!=""){
115+
if(typeofstate.get.current().header.clock.separator.text=="string"&&state.get.current().header.clock.separator.text!=""){
116116
separatorCharacter=state.get.current().header.clock.separator.text.trim().replace(/\s\s+/g," ");
117-
}else{
117+
};
118+
if(separatorCharacter==""||separatorCharacter==" "||separatorCharacter==undefined){
118119
separatorCharacter=":";
119120
};
120121
varparts=clock.querySelectorAll("span");

‎src/js/date.js‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,10 +129,11 @@ var date = (function(){
129129
};
130130
if(state.get.current().header.date.separator.show){
131131
varseparatorCharacter;
132-
if(state.get.current().header.date.separator.text.trim().replace(/\s\s+/g," ")!=""){
133-
separatorCharacter=state.get.current().header.date.separator.text.trim().replace(/\s\s+/g," ");
134-
}else{
135-
separatorCharacter="/";
132+
if(typeofstate.get.current().header.date.separator.text=="string"&&state.get.current().header.date.separator.text!=""){
133+
separatorCharacter=state.get.current().header.date.separator.text.trim().replace(/\s\s+/g," ");
134+
};
135+
if(separatorCharacter==""||separatorCharacter==" "||separatorCharacter==undefined){
136+
separatorCharacter="/";
136137
};
137138
varparts=date.querySelectorAll("span");
138139
if(parts.length>1){

‎src/js/header.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ var header = (function(){
373373
varheaderSearchBody=helper.node("div|class:search-wrapper");
374374
varform=helper.node("form|class:search,action,method:get");
375375
varsearchInput;
376-
if(state.get.current().header.search.engine.custom.queryName!=""){
376+
if(typeofstate.get.current().header.search.engine.custom.queryName=="string"&&state.get.current().header.search.engine.custom.queryName!=""){
377377
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");
378378
}else{
379379
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");

‎src/js/layout.js‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ var layout = (function(){
2424

2525
render.title=function(){
2626
vartitle=helper.e("title");
27-
if(state.get.current().layout.title.trim().replace(/\s\s+/g," ")!=""){
28-
title.textContent=state.get.current().layout.title;
27+
if(typeofstate.get.current().layout.title=="string"&&state.get.current().layout.title!=""){
28+
title.textContent=state.get.current().layout.title.trim().replace(/\s\s+/g," ");
2929
}else{
3030
title.textContent="New tab";
3131
};

‎src/js/link.js‎

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,12 @@ var link = (function(){
1818
};
1919

2020
stagedGroup.init=function(){
21-
stagedGroup.group.items=[];
21+
stagedGroup.position.origin=0;
22+
stagedGroup.position.destination=0;
23+
stagedGroup.group.name.text="";
2224
stagedGroup.group.name.show=true;
2325
stagedGroup.group.openAll.show=true;
26+
stagedGroup.group.items=[];
2427
};
2528

2629
stagedGroup.reset=function(){
@@ -66,7 +69,6 @@ var link = (function(){
6669
},
6770
name: null,
6871
url: null,
69-
timeStamp: null,
7072
accent: {
7173
by: null,
7274
hsl: {
@@ -94,6 +96,7 @@ var link = (function(){
9496
}
9597
},
9698
image: null,
99+
timeStamp: null,
97100
searchMatch: null
98101
}
99102
};
@@ -104,10 +107,17 @@ var link = (function(){
104107
stagedLink.position.destination.group=0;
105108
stagedLink.position.destination.item=0;
106109
stagedLink.position.group.new=false;
107-
stagedLink.position.group.name.show=false;
108-
stagedLink.position.group.openAll.show=false;
110+
stagedLink.position.group.name.show=true;
111+
stagedLink.position.group.name.text="";
112+
stagedLink.position.group.openAll.show=true;
109113
stagedLink.link.visual.display="letter";
114+
stagedLink.link.visual.letter="";
115+
stagedLink.link.visual.image="";
116+
stagedLink.link.visual.icon.name="";
117+
stagedLink.link.visual.icon.prefix="";
118+
stagedLink.link.visual.icon.label="";
110119
stagedLink.link.name="";
120+
stagedLink.link.url="";
111121
stagedLink.link.accent.by="theme";
112122
stagedLink.link.accent.hsl.h=0;
113123
stagedLink.link.accent.hsl.s=0;
@@ -132,7 +142,9 @@ var link = (function(){
132142
stagedLink.position.destination.group=null;
133143
stagedLink.position.destination.item=null;
134144
stagedLink.position.group.new=null;
145+
stagedLink.position.group.name.show=null;
135146
stagedLink.position.group.name.text=null;
147+
stagedLink.position.group.openAll.show=null;
136148
stagedLink.link.visual.display=null;
137149
stagedLink.link.visual.letter=null;
138150
stagedLink.link.visual.image=null;
@@ -141,7 +153,6 @@ var link = (function(){
141153
stagedLink.link.visual.icon.label=null;
142154
stagedLink.link.name=null;
143155
stagedLink.link.url=null;
144-
stagedLink.link.timeStamp=null;
145156
stagedLink.link.accent.by=null;
146157
stagedLink.link.accent.hsl.h=null;
147158
stagedLink.link.accent.hsl.s=null;
@@ -157,6 +168,7 @@ var link = (function(){
157168
stagedLink.link.color.rgb.g=null;
158169
stagedLink.link.color.rgb.b=null;
159170
stagedLink.link.image=null;
171+
stagedLink.link.timeStamp=null;
160172
stagedLink.link.searchMatch=null;
161173
};
162174

@@ -904,7 +916,7 @@ var link = (function(){
904916
value: "link-item"
905917
}]
906918
};
907-
if(stagedLink.link.accent.by=="custom"||stagedLink.link.color.by=="custom"||(stagedLink.link.image!=null&&stagedLink.link.image!="")){
919+
if(stagedLink.link.accent.by=="custom"||stagedLink.link.color.by=="custom"||(stagedLink.link.image!=null&&typeofstagedLink.link.image=="string"&&stagedLink.link.image!="")){
908920
linkItemOptions.attr.push({
909921
key: "style",
910922
value: ""
@@ -985,9 +997,9 @@ var link = (function(){
985997
}]
986998
});
987999
};
988-
varnameText=stagedLink.link.name.trim();
989-
if(nameText==null){
990-
nameText="";
1000+
varnameText="";
1001+
if(typeofstagedLink.link.name=="string"&&stagedLink.link.name!=""){
1002+
nameText=stagedLink.link.name.trim().replace(/\s\s+/g," ");
9911003
};
9921004
varlinkDisplayName=helper.node("p:"+nameText+"|class:link-display-name");
9931005

‎src/js/update.js‎

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ var update = (function(){
967967
};
968968
returndata;
969969
},
970-
"5.32.0": function(data){
970+
"5.37.1": function(data){
971971
data.bookmarks.forEach(function(arrayItem,index){
972972
arrayItem.items.forEach(function(arrayItem,index){
973973
arrayItem.accent.color.rgb={
@@ -994,9 +994,6 @@ var update = (function(){
994994
deletearrayItem.accent.color.b;
995995
});
996996
});
997-
returndata;
998-
},
999-
"5.33.0": function(data){
1000997
data.bookmarks.forEach(function(arrayItem,index){
1001998
arrayItem.items.forEach(function(arrayItem,index){
1002999
arrayItem.visual={
@@ -1077,13 +1074,7 @@ var update = (function(){
10771074
s: 0,
10781075
l: 0
10791076
};
1080-
returndata;
1081-
},
1082-
"5.34.0": function(data){
10831077
data.state.header.search.engine.custom.queryName="";
1084-
returndata;
1085-
},
1086-
"5.35.0": function(data){
10871078
data.state.link.item.display.visual.shadow={
10881079
size: 0
10891080
};

‎src/js/version.js‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
varversion=(function(){
22

3-
varcurrent="5.36.0";
3+
varcurrent="5.37.1";
44

55
varname="Zonked Tarsier";
66

0 commit comments

Comments
(0)