Skip to content

Commit df4ce23

Browse files
committed
[refactor] change new tab input to work like font inputs
1 parent 1ad0c33 commit df4ce23

File tree

8 files changed

+24
-8
lines changed

8 files changed

+24
-8
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.26.0",
3+
"version": "5.27.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/html/menu/content/layout/page.html‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ <h1 class="menu-item-header-text">Page</h1>
55
<divclass="menu-item-form">
66
<divclass="form-wrap">
77
<labelfor="control-layout-title">Title</label>
8-
<inputid="control-layout-title" class="control-layout-title" type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" placeholder="New Tab" tabindex="-1">
8+
<divclass="form-group form-group-block">
9+
<inputid="control-layout-title" class="control-layout-title" type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" placeholder="New Tab" tabindex="-1">
10+
<buttonclass="control-layout-title-default button button-line" tabindex="-1" title="Reset to default"><spanclass="icon-replay"></span></button>
11+
</div>
912
</div>
1013
<hr>
1114
<divclass="form-wrap">

‎src/js/control.js‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -725,6 +725,14 @@ var control = (function(){
725725
func: function(){
726726
layout.render.title();
727727
}
728+
},{
729+
element: ".control-layout-title-default",
730+
type: "button",
731+
func: function(){
732+
mod.default("layout.title");
733+
layout.render.title();
734+
render.update.control.menu();
735+
}
728736
},{
729737
element: ".control-layout-scrollpastend",
730738
path: "layout.scrollPastEnd",

‎src/js/layout.js‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,11 @@ var layout = (function(){
2424

2525
render.title=function(){
2626
vartitle=helper.e("title");
27-
title.textContent=state.get.current().layout.title;
27+
if(state.get.current().layout.title.trim().replace(/\s\s+/g," ")!=""){
28+
title.textContent=state.get.current().layout.title;
29+
}else{
30+
title.textContent="New tab";
31+
};
2832
};
2933

3034
varinit=function(){

‎src/js/state.js‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ var state = (function(){
255255
width: 80,
256256
scrollPastEnd: false,
257257
scrollbars: "auto",
258-
title: "New Tab"
258+
title: ""
259259
},
260260
theme: {
261261
accent: {
@@ -452,7 +452,8 @@ var state = (function(){
452452
padding: 4,
453453
gutter: 2,
454454
size: 1,
455-
width: 80
455+
width: 80,
456+
title: ""
456457
},
457458
theme: {
458459
accent: {

‎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.26.0";
3+
varcurrent="5.27.0";
44

55
varname="Zonked Tarsier";
66

‎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": "5.26.0",
5+
"version": "5.27.0",
66
"manifest_version": 2,
77
"chrome_url_overrides":{
88
"newtab": "index.html"

0 commit comments

Comments
(0)