[feature] firefox specific homepage instructions

This commit is contained in:
zombieFox 2020-06-11 08:07:38 +01:00
parent 819cdf7946
commit 6affe552a2
11 changed files with 56 additions and 5 deletions

2
package-lock.json generated
View File

@ -1,6 +1,6 @@
{ {
"name": "nightTab", "name": "nightTab",
"version": "5.35.0", "version": "5.36.0",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {

View File

@ -1,6 +1,6 @@
{ {
"name": "nightTab", "name": "nightTab",
"version": "5.35.0", "version": "5.36.0",
"description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.", "description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
"main": "index.js", "main": "index.js",
"scripts": { "scripts": {

View File

@ -175,3 +175,9 @@ table tbody tr th {
text-align: left; text-align: left;
box-sizing: border-box; box-sizing: border-box;
} }
code {
background-color: rgb(var(--theme-color-04));
padding: 0.2em 0.5em;
border-radius: var(--theme-radius);
}

View File

@ -10,7 +10,7 @@
@@include("./menu/content/header.html") @@include("./menu/content/header.html")
@@include("./menu/content/bookmarks.html") @@include("./menu/content/bookmarks.html")
@@include("./menu/content/groups.html") @@include("./menu/content/groups.html")
@@include("./menu/content/theme.html") @@include("./menu/content/theme.html")
@ -19,6 +19,8 @@
@@include("./menu/content/data.html") @@include("./menu/content/data.html")
@@include("./menu/content/firefox.html")
@@include("./menu/content/coffee.html") @@include("./menu/content/coffee.html")
@@include("./menu/content/nighttab.html") @@include("./menu/content/nighttab.html")

View File

@ -0,0 +1,5 @@
<div id="menu-content-firefox" class="menu-content menu-content-firefox">
@@include("./firefox/homepage.html")
</div>

View File

@ -0,0 +1,17 @@
<div id="menu-content-firefox-homepage" class="menu-content-item">
<div class="menu-item-header">
<h1 class="menu-item-header-text">Homepage</h1>
</div>
<div class="menu-item-form">
<p>Firefox does not allow addons to replace the "homepage". However there is a workaround:</p>
<div class="form-wrap">
<ol>
<li>Open a new Firefox window</li>
<li>Open Firefox <code>Preferences</code> and open a new tab (nightTab)</li>
<li>In Firefox preferences under <code>Home</code>, change <code>Homepage and new windows</code> to <code>Custom URLs...</code></li>
<li>Then click <code>Use Current Page</code></li>
</ol>
<p>nightTab will now appear as the homepage.</p>
</div>
</div>
</div>

View File

@ -86,6 +86,9 @@
<a href="#menu-content-data-clear" class="menu-nav-sub button button-small" tabindex="-1">Clear</a> <a href="#menu-content-data-clear" class="menu-nav-sub button button-small" tabindex="-1">Clear</a>
</div> </div>
</div> </div>
<div class="menu-nav-item menu-nav-item-firefox is-hidden">
<button class="control-menu-firefox menu-nav-tab button button-line" tabindex="-1">Firefox</button>
</div>
<div class="menu-nav-item"> <div class="menu-nav-item">
<button class="control-menu-coffee menu-nav-tab button button-line" tabindex="-1">Coffee</button> <button class="control-menu-coffee menu-nav-tab button button-line" tabindex="-1">Coffee</button>
</div> </div>

View File

@ -228,6 +228,13 @@ var control = (function() {
menu.nav("data"); menu.nav("data");
theme.render.custom.tabIndex(); theme.render.custom.tabIndex();
} }
}, {
element: ".control-menu-firefox",
type: "button",
func: function() {
menu.nav("firefox");
theme.render.custom.tabIndex();
}
}, { }, {
element: ".control-menu-coffee", element: ".control-menu-coffee",
type: "button", type: "button",

View File

@ -28,6 +28,7 @@ var menu = (function() {
background: false, background: false,
data: false, data: false,
coffee: false, coffee: false,
firefox: false,
nighttab: false nighttab: false
}, },
toggle: function(name) { toggle: function(name) {
@ -186,6 +187,15 @@ var menu = (function() {
helper.e(".menu").removeAttribute("style"); helper.e(".menu").removeAttribute("style");
}; };
render.firefoxSpecific = function() {
var firefoxBrowser = typeof InstallTrigger !== "undefined";
if (firefoxBrowser) {
helper.removeClass(helper.e(".menu-nav-item-firefox"), "is-hidden");
} else {
helper.addClass(helper.e(".menu-nav-item-firefox"), "is-hidden");
};
};
var nav = function(name) { var nav = function(name) {
mod.nav.toggle(name); mod.nav.toggle(name);
render.nav.active(); render.nav.active();
@ -252,6 +262,7 @@ var menu = (function() {
render.removeStyle(); render.removeStyle();
render.subnav.height(); render.subnav.height();
render.nav.active(); render.nav.active();
render.firefoxSpecific();
}; };
return { return {

View File

@ -1,6 +1,6 @@
var version = (function() { var version = (function() {
var current = "5.35.0"; var current = "5.36.0";
var name = "Zonked Tarsier"; var name = "Zonked Tarsier";

View File

@ -2,7 +2,7 @@
"name": "nightTab", "name": "nightTab",
"short_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.", "description": "A neutral new tab page accented with a chosen colour. Customise the layout, style, background and bookmarks in nightTab.",
"version": "5.35.0", "version": "5.36.0",
"manifest_version": 2, "manifest_version": 2,
"chrome_url_overrides": { "chrome_url_overrides": {
"newtab": "index.html" "newtab": "index.html"