mirror of
https://github.com/zombieFox/nightTab.git
synced 2024-12-27 00:59:00 +01:00
[refactor] improve background module
This commit is contained in:
parent
f1f8939f27
commit
eba414733d
@ -2,6 +2,16 @@ var background = (function() {
|
||||
|
||||
var mod = {};
|
||||
|
||||
mod.import = function() {
|
||||
// get files from input
|
||||
var fileList = helper.e(".control-background-image-file").files;
|
||||
// if file was added
|
||||
if (fileList.length > 0) {
|
||||
// validate the file
|
||||
_validateImageFile(fileList);
|
||||
};
|
||||
};
|
||||
|
||||
mod.clear = {
|
||||
file: function() {
|
||||
helper.setObject({
|
||||
@ -159,16 +169,6 @@ var background = (function() {
|
||||
}
|
||||
};
|
||||
|
||||
var importData = function() {
|
||||
// get files from input
|
||||
var fileList = helper.e(".control-background-image-file").files;
|
||||
// if file was added
|
||||
if (fileList.length > 0) {
|
||||
// validate the file
|
||||
_validateImageFile(fileList);
|
||||
};
|
||||
};
|
||||
|
||||
var _validateImageFile = function(fileList) {
|
||||
// make new file reader
|
||||
var reader = new FileReader();
|
||||
@ -212,9 +212,8 @@ var background = (function() {
|
||||
return {
|
||||
init: init,
|
||||
mod: mod,
|
||||
bind: bind,
|
||||
render: render,
|
||||
importData: importData
|
||||
bind: bind
|
||||
};
|
||||
|
||||
})();
|
||||
|
@ -1,6 +1,6 @@
|
||||
var version = (function() {
|
||||
|
||||
var current = "3.45.0";
|
||||
var current = "3.46.0";
|
||||
|
||||
var compare = function(a, b) {
|
||||
var pa = a.split(".");
|
||||
|
@ -2,7 +2,7 @@
|
||||
"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.",
|
||||
"version": "3.45.0",
|
||||
"version": "3.46.0",
|
||||
"manifest_version": 2,
|
||||
"chrome_url_overrides": {
|
||||
"newtab": "index.html"
|
||||
|
Loading…
Reference in New Issue
Block a user