Skip to content

Commit bf58d25

Browse files
committed
[feature] allow hex value for background colour
1 parent 7818228 commit bf58d25

File tree

6 files changed

+29
-9
lines changed

6 files changed

+29
-9
lines changed

‎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": "3.75.2",
3+
"version": "3.76.0",
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/index.html‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1051,7 +1051,10 @@ <h1 class="menu-item-header-text">Colour</h1>
10511051
</div>
10521052
<divclass="form-indent">
10531053
<divclass="input-wrap">
1054-
<inputid="control-background-color-custom-current" class="control-background-color-custom-current mb-0" type="color" tabindex="1">
1054+
<divclass="form-group mb-0">
1055+
<inputid="control-background-color-custom-current-picker" class="form-group-item-half control-background-color-custom-current-picker mb-0" type="color" value="#000000" tabindex="1">
1056+
<inputid="control-background-color-custom-current-hex" class="form-group-item-half control-background-color-custom-current-hex mb-0" type="text" placeholder="Hex code" value="#000000" tabindex="1" maxlength="7">
1057+
</div>
10551058
</div>
10561059
<pclass="control-background-color-theme-helper form-helper small">Take care as some colours may make the Clock, Date and other text unreadable.</p>
10571060
</div>

‎src/js/background.js‎

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,13 @@ var background = (function(){
115115

116116
render.input={
117117
clear: function(){
118-
varinput=helper.e(".control-background-image-file");
119-
input.value="";
118+
helper.e(".control-background-image-file").value="";
119+
},
120+
picker: function(){
121+
helper.e(".control-background-color-custom-current-picker").value=helper.rgbToHex(state.get().background.color.custom);
122+
},
123+
hex: function(){
124+
helper.e(".control-background-color-custom-current-hex").value=helper.rgbToHex(state.get().background.color.custom);
120125
}
121126
};
122127

‎src/js/control.js‎

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2137,11 +2137,21 @@ var control = (function(){
21372137
render.class();
21382138
}
21392139
},{
2140-
element: helper.e(".control-background-color-custom-current"),
2140+
element: helper.e(".control-background-color-custom-current-picker"),
21412141
path: "background.color.custom",
21422142
type: "color",
21432143
func: function(){
21442144
background.render.color();
2145+
background.render.input.hex();
2146+
}
2147+
},{
2148+
element: helper.e(".control-background-color-custom-current-hex"),
2149+
path: "background.color.custom",
2150+
type: "text",
2151+
valueMod: ["hexTextString"],
2152+
func: function(){
2153+
background.render.color();
2154+
background.render.input.picker();
21452155
}
21462156
},{
21472157
element: helper.e(".control-background-image-show"),
@@ -3071,10 +3081,12 @@ var control = (function(){
30713081
_disable.element(".control-background-image-url-helper",true);
30723082
};
30733083
if(state.get().background.color.by=="theme"){
3074-
_disable.input(".control-background-color-custom-current",true);
3084+
_disable.input(".control-background-color-custom-current-picker",true);
3085+
_disable.input(".control-background-color-custom-current-hex",true);
30753086
_disable.element(".control-background-color-theme-helper",true);
30763087
}elseif(state.get().background.color.by=="custom"){
3077-
_disable.input(".control-background-color-custom-current",false);
3088+
_disable.input(".control-background-color-custom-current-picker",false);
3089+
_disable.input(".control-background-color-custom-current-hex",false);
30783090
_disable.element(".control-background-color-theme-helper",false);
30793091
};
30803092
};

‎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="3.75.2";
3+
varcurrent="3.76.0";
44

55
varcompare=function(a,b){
66
varpa=a.split(".");

‎src/manifest.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "nightTab",
33
"short_name": "nightTab",
44
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
5-
"version": "3.75.2",
5+
"version": "3.76.0",
66
"manifest_version": 2,
77
"chrome_url_overrides":{
88
"newtab": "index.html"

0 commit comments

Comments
(0)