Commit fb73e6ee authored by yPhil's avatar yPhil

Lib: JS files cleanup: npm standard: prefs.js

parent 24fed02d
......@@ -33,6 +33,9 @@
"standard": {
"globals": [
"$",
"Blob",
"localStorage",
"FileReader",
"Dialog",
"Feed",
"Prefs",
......
$('<div id="menu">').appendTo($('body')).load('/static/templates/menu.html', function () {
var $slider = $(this),
$handle = $slider.find('.handle'),
$fileImportButton = $('button#fileImport').button(),
$fileImportInput = $('input#fileImport').button(),
$fileExport = $('#saveTabs').button(),
$donate = $('#donate').button().tooltip(),
$profile = $('#profile').button().tooltip()
var $slider = $(this)
var $handle = $slider.find('.handle')
var $fileImportButton = $('button#fileImport').button()
var $fileImportInput = $('input#fileImport').button()
var $fileExport = $('#saveTabs').button()
var $donate = $('#donate')
var $profile = $('#profile').button().tooltip()
$donate.button().tooltip()
$handle.click(function () {
$slider.toggleClass('expanded')
......@@ -91,13 +93,10 @@ $('<div id="menu">').appendTo($('body')).load('/static/templates/menu.html', fun
// File select
$fileImportInput.change(function (evt) {
var JsonObj = null
var files = evt.target.files
var f = files[0]
var reader = new FileReader()
var $notifyArea = $slider.find('#mobNotify > p')
if (f.type.match(/application\/json/)) {
console.log('JSON!')
} else {
......@@ -116,7 +115,7 @@ $('<div id="menu">').appendTo($('body')).load('/static/templates/menu.html', fun
)
)
} else {
var isValid = false
isValid = false
}
return isValid
}
......
......@@ -43,9 +43,11 @@ var Prefs = (function () {
var a = document.createElement('a')
document.body.appendChild(a)
a.style = 'display: none'
var json = JSON.stringify(data, null, 2),
blob = new Blob([json], {type: 'application/json'}),
url = window.URL.createObjectURL(blob)
var json = JSON.stringify(data, null, 2)
var blob = new Blob([json], {type: 'application/json'})
var url = window.URL.createObjectURL(blob)
a.href = url
a.download = fileName
a.click()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment