sidepanel: add notifications for state actions

This commit is contained in:
jean-emmanuel 2019-01-04 12:26:27 +01:00
parent ad6eeee08b
commit 9c11ae07fa
4 changed files with 29 additions and 3 deletions

View file

@ -54,6 +54,9 @@ module.exports = {
state_import: 'Import',
state_export: 'Export',
state_uploaderror: 'Failed to upload state file.',
state_storesuccess: 'State saved',
state_recallsuccess: 'State recalled',
state_sendsuccess: 'State sent',
// traversing
traversing_on: 'On',

View file

@ -54,6 +54,9 @@ module.exports = {
state_import: 'Importer',
state_export: 'Exporter',
state_uploaderror: 'Échec à l\'envoi du fichier d\'état.',
state_storesuccess: 'État de l\'interface sauvegardé',
state_recallsuccess: 'État de l\'interface restauré',
state_sendsuccess: 'État de de l\'interface envoyé',
// traversing
traversing_on: 'On',

View file

@ -54,7 +54,10 @@ module.exports = { // @https://github.com/suhr
state_import: 'Импорт',
state_export: 'Экспорт',
state_uploaderror: 'Не удалось загрузить файл состояния.',
state_storesuccess: 'State saved',
state_recallsuccess: 'State recalled',
state_sendsuccess: 'State sent',
// traversing
traversing_on: 'Вкл',
traversing_smart: 'Умный',

View file

@ -3,6 +3,7 @@ var state = require('../managers/state'),
editor = require('../editor/'),
{icon} = require('./utils'),
fullscreen = require('./fullscreen'),
notifications = require('./notifications'),
{enableTraversingGestures, disableTraversingGestures} = require('../events/drag'),
locales = require('../locales'),
html = require('nanohtml'),
@ -29,16 +30,32 @@ var sidepanelData = [
action:()=>{
state.quickSave()
DOM.get('.quickload')[0].classList.remove('disabled')
notifications.add({
icon: 'sliders-h',
message: locales('state_storesuccess')
})
}
},
{
title: locales('state_recall'),
action:state.quickLoad.bind(state),
action: ()=>{
state.quickLoad()
notifications.add({
icon: 'sliders-h',
message: locales('state_recallsuccess')
})
},
class:'disabled quickload'
},
{
title: locales('state_send'),
action:state.send.bind(state)
action: ()=>{
state.send()
notifications.add({
icon: 'sliders-h',
message: locales('state_sendsuccess')
})
}
},
{
title: locales('state_import'),