session: implement session converter; add some meta data
dev: handle hot reload data with localStorage
This commit is contained in:
parent
60812ed042
commit
0312959145
12 changed files with 243 additions and 127 deletions
|
|
@ -7,7 +7,6 @@ var path = require('path'),
|
|||
theme = require('./theme')
|
||||
|
||||
var widgetHashTable = {},
|
||||
sessionBackups = {},
|
||||
clipboard = {clipboard: null, idClipboard: null}
|
||||
|
||||
module.exports = {
|
||||
|
|
@ -20,23 +19,10 @@ module.exports = {
|
|||
|
||||
ipc.send('sessionList', recentSessions, clientId)
|
||||
ipc.send('clipboard', clipboard, clientId)
|
||||
|
||||
if (data.backupId && sessionBackups[data.backupId]) {
|
||||
ipc.send('loadBackup', sessionBackups[data.backupId])
|
||||
return
|
||||
}
|
||||
|
||||
if (settings.read('load')) return this.sessionOpen({path:settings.read('load')},clientId)
|
||||
|
||||
|
||||
if (settings.read('examples')) {
|
||||
var dir = path.resolve(__dirname + '/../examples')
|
||||
recentSessions = fs.readdirSync(dir)
|
||||
recentSessions = recentSessions.map(function(file){return dir + '/' + file})
|
||||
}
|
||||
|
||||
ipc.send('serverTargets', settings.read('send'), clientId)
|
||||
|
||||
if (settings.read('load') && !data.hotReload) return this.sessionOpen({path: settings.read('load')}, clientId)
|
||||
|
||||
},
|
||||
|
||||
sessionAddToHistory: function(data) {
|
||||
|
|
@ -386,18 +372,6 @@ module.exports = {
|
|||
|
||||
},
|
||||
|
||||
storeBackup: function(data, clientId) {
|
||||
|
||||
sessionBackups[data.backupId] = data
|
||||
|
||||
},
|
||||
|
||||
deleteBackup: function(data) {
|
||||
|
||||
delete sessionBackups[data]
|
||||
|
||||
},
|
||||
|
||||
reloadCss:function(){
|
||||
theme.load()
|
||||
ipc.send('reloadCss')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue