mirror of
https://github.com/zombieFox/nightTab.git
synced 2024-11-23 08:33:38 +01:00
[feature] adding control for page title
This commit is contained in:
parent
b6863345e6
commit
af58072273
@ -320,6 +320,10 @@
|
|||||||
<input id="control-layout-scroll-past-end" class="control-layout-scroll-past-end" type="checkbox" tabindex="1">
|
<input id="control-layout-scroll-past-end" class="control-layout-scroll-past-end" type="checkbox" tabindex="1">
|
||||||
<label for="control-layout-scroll-past-end"><span class="label-icon"></span>Scroll past end</label>
|
<label for="control-layout-scroll-past-end"><span class="label-icon"></span>Scroll past end</label>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="input-wrap">
|
||||||
|
<label for="control-layout-title">Title</label>
|
||||||
|
<input id="control-layout-title" class="control-layout-title" type="text" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false" placeholder="New Tab" tabindex="1">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="menu-item">
|
<div class="menu-item">
|
||||||
<h1 class="menu-header">Theme</h1>
|
<h1 class="menu-header">Theme</h1>
|
||||||
@ -410,6 +414,7 @@
|
|||||||
<script src="js/version.js"></script>
|
<script src="js/version.js"></script>
|
||||||
<script src="js/keyboard.js"></script>
|
<script src="js/keyboard.js"></script>
|
||||||
<script src="js/background.js"></script>
|
<script src="js/background.js"></script>
|
||||||
|
<script src="js/title.js"></script>
|
||||||
<script src="js/init.js"></script>
|
<script src="js/init.js"></script>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
|
@ -383,6 +383,13 @@ var control = (function() {
|
|||||||
func: function() {
|
func: function() {
|
||||||
render();
|
render();
|
||||||
}
|
}
|
||||||
|
}, {
|
||||||
|
element: helper.e(".control-layout-title"),
|
||||||
|
path: "layout.title",
|
||||||
|
type: "text",
|
||||||
|
func: function() {
|
||||||
|
title.render();
|
||||||
|
}
|
||||||
}, {
|
}, {
|
||||||
element: helper.e(".control-layout-theme-random-active"),
|
element: helper.e(".control-layout-theme-random-active"),
|
||||||
path: "layout.theme.random.active",
|
path: "layout.theme.random.active",
|
||||||
|
@ -51,3 +51,6 @@ background.init();
|
|||||||
// render search engine
|
// render search engine
|
||||||
// focus seach input
|
// focus seach input
|
||||||
search.init();
|
search.init();
|
||||||
|
|
||||||
|
// render page title
|
||||||
|
title.init();
|
||||||
|
@ -70,6 +70,7 @@ var state = (function() {
|
|||||||
layout: {
|
layout: {
|
||||||
width: "wide",
|
width: "wide",
|
||||||
scrollPastEnd: true,
|
scrollPastEnd: true,
|
||||||
|
title: "New Tab",
|
||||||
theme: {
|
theme: {
|
||||||
current: {
|
current: {
|
||||||
r: 0,
|
r: 0,
|
||||||
|
17
js/title.js
Normal file
17
js/title.js
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
var title = (function() {
|
||||||
|
|
||||||
|
var render = function() {
|
||||||
|
helper.e("title").textContent = state.get().layout.title;
|
||||||
|
};
|
||||||
|
|
||||||
|
var init = function() {
|
||||||
|
render();
|
||||||
|
};
|
||||||
|
|
||||||
|
// exposed methods
|
||||||
|
return {
|
||||||
|
render: render,
|
||||||
|
init: init
|
||||||
|
};
|
||||||
|
|
||||||
|
})();
|
10
js/update.js
10
js/update.js
@ -124,6 +124,12 @@ var update = (function() {
|
|||||||
return data;
|
return data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
var _update_280 = function(data) {
|
||||||
|
data.state.layout.title = "New Tab";
|
||||||
|
data.version = 2.80;
|
||||||
|
return data;
|
||||||
|
};
|
||||||
|
|
||||||
// var _update_300 = function(data) {
|
// var _update_300 = function(data) {
|
||||||
// data.version = 3.00;
|
// data.version = 3.00;
|
||||||
// return data;
|
// return data;
|
||||||
@ -158,6 +164,10 @@ var update = (function() {
|
|||||||
console.log("\trunning update", 2.70);
|
console.log("\trunning update", 2.70);
|
||||||
data = _update_270(data);
|
data = _update_270(data);
|
||||||
};
|
};
|
||||||
|
if (data.version < 2.80) {
|
||||||
|
console.log("\trunning update", 2.80);
|
||||||
|
data = _update_280(data);
|
||||||
|
};
|
||||||
// if (data.version < 3.00) {
|
// if (data.version < 3.00) {
|
||||||
// console.log("\t# running update", 3.00);
|
// console.log("\t# running update", 3.00);
|
||||||
// data = _update_300(data);
|
// data = _update_300(data);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
var version = (function() {
|
var version = (function() {
|
||||||
|
|
||||||
// version is normally bumped when the state needs changing or any new functionality is added
|
// version is normally bumped when the state needs changing or any new functionality is added
|
||||||
var current = "2.7.0";
|
var current = "2.8.0";
|
||||||
|
|
||||||
var get = function() {
|
var get = function() {
|
||||||
var number = current.split(".");
|
var number = current.split(".");
|
||||||
|
Loading…
Reference in New Issue
Block a user