From 8733b405fe2186d3bfa3c4489a86d804a15a860a Mon Sep 17 00:00:00 2001 From: Shaunak Kishore Date: Thu, 10 Sep 2015 23:12:43 -0400 Subject: [PATCH] Add backup and restore controls --- client/{reload.js => controls.js} | 8 +++++++- client/glyph.js | 3 +-- client/index.html | 8 +++++--- client/style.css | 20 ++++++++++---------- 4 files changed, 23 insertions(+), 16 deletions(-) rename client/{reload.js => controls.js} (92%) diff --git a/client/reload.js b/client/controls.js similarity index 92% rename from client/reload.js rename to client/controls.js index 92bd90e0..a0a9edb1 100644 --- a/client/reload.js +++ b/client/controls.js @@ -2,7 +2,13 @@ var BATCH_SIZE = 64; var CODEPOINTS = [0x4e00, 0x9fff]; var FONT_LOADED_PROGRESS = 0.1; -Template.navbar.events({ +Template.controls.events({ + 'click #backup-button': function() { + Meteor.call('backup'); + }, + 'click #restore-button': function() { + Meteor.call('restore'); + }, 'click #reload-button': function() { Session.set('progress.value', 0); opentype.load('external/gkai00mp.ttf', function(err, font) { diff --git a/client/glyph.js b/client/glyph.js index db8867d5..0b097140 100644 --- a/client/glyph.js +++ b/client/glyph.js @@ -69,11 +69,10 @@ var bindings = { var glyph = Session.get('glyph.data'); glyph.manual.verified = false; Session.set('glyph.data', glyph); - change_glyph('save_glyph', glyph); } else { var glyph = Session.get('glyph.data'); delete glyph.manual; - change_glyph('save_glyph', glyph); + Session.set('glyph.data', glyph); } }, 'a': function() { diff --git a/client/index.html b/client/index.html index d7858e6d..95b938d1 100644 --- a/client/index.html +++ b/client/index.html @@ -14,9 +14,6 @@ - @@ -47,6 +44,11 @@ +
+ + + +