sidepanel: add notifications for state actions
This commit is contained in:
parent
fec4a30dd0
commit
f6420bfec7
4 changed files with 29 additions and 3 deletions
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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',
|
||||
|
|
|
|||
|
|
@ -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: 'Умный',
|
||||
|
|
|
|||
|
|
@ -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'),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue