mirror of
https://github.com/skishore/makemeahanzi.git
synced 2025-11-03 05:48:23 +08:00
Add backup and restore controls
This commit is contained in:
8
client/reload.js → client/controls.js
vendored
8
client/reload.js → client/controls.js
vendored
@ -2,7 +2,13 @@ var BATCH_SIZE = 64;
|
|||||||
var CODEPOINTS = [0x4e00, 0x9fff];
|
var CODEPOINTS = [0x4e00, 0x9fff];
|
||||||
var FONT_LOADED_PROGRESS = 0.1;
|
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() {
|
'click #reload-button': function() {
|
||||||
Session.set('progress.value', 0);
|
Session.set('progress.value', 0);
|
||||||
opentype.load('external/gkai00mp.ttf', function(err, font) {
|
opentype.load('external/gkai00mp.ttf', function(err, font) {
|
||||||
@ -69,11 +69,10 @@ var bindings = {
|
|||||||
var glyph = Session.get('glyph.data');
|
var glyph = Session.get('glyph.data');
|
||||||
glyph.manual.verified = false;
|
glyph.manual.verified = false;
|
||||||
Session.set('glyph.data', glyph);
|
Session.set('glyph.data', glyph);
|
||||||
change_glyph('save_glyph', glyph);
|
|
||||||
} else {
|
} else {
|
||||||
var glyph = Session.get('glyph.data');
|
var glyph = Session.get('glyph.data');
|
||||||
delete glyph.manual;
|
delete glyph.manual;
|
||||||
change_glyph('save_glyph', glyph);
|
Session.set('glyph.data', glyph);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
'a': function() {
|
'a': function() {
|
||||||
|
|||||||
@ -14,9 +14,6 @@
|
|||||||
<div class="navbar-header">
|
<div class="navbar-header">
|
||||||
<div class="navbar-brand">zh-Hans character decomposition</div>
|
<div class="navbar-brand">zh-Hans character decomposition</div>
|
||||||
</div>
|
</div>
|
||||||
<ul class="nav navbar navbar-nav navbar-right">
|
|
||||||
<button id="reload-button" class="btn btn-danger">Reload</button>
|
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@ -47,6 +44,11 @@
|
|||||||
<button id="s-button" class="btn btn-success">S: {{s_button_name}}</button>
|
<button id="s-button" class="btn btn-success">S: {{s_button_name}}</button>
|
||||||
<button id="d-button" class="btn btn-info">D: Next</button>
|
<button id="d-button" class="btn btn-info">D: Next</button>
|
||||||
</div>
|
</div>
|
||||||
|
<div id="right-controls" class="btn-group" role="group">
|
||||||
|
<button id="backup-button" class="btn btn-success">Backup</button>
|
||||||
|
<button id="restore-button" class="btn btn-info">Restore</button>
|
||||||
|
<button id="reload-button" class="btn btn-danger">Reload</button>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template name="glyph">
|
<template name="glyph">
|
||||||
|
|||||||
@ -12,29 +12,29 @@
|
|||||||
padding: 6px 12px !important;
|
padding: 6px 12px !important;
|
||||||
}
|
}
|
||||||
|
|
||||||
#reload-button {
|
|
||||||
position: absolute;
|
|
||||||
right: 12px;
|
|
||||||
top: 50%;
|
|
||||||
transform: translateY(-50%);
|
|
||||||
}
|
|
||||||
|
|
||||||
#progress .progress {
|
#progress .progress {
|
||||||
height: 18px;
|
height: 18px;
|
||||||
margin-bottom: 0;
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#controls {
|
#controls, #right-controls {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 72px;
|
top: 72px;
|
||||||
left: 12px;
|
|
||||||
z-index: 1;
|
z-index: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
#controls .btn {
|
#controls .btn, #right-controls .btn {
|
||||||
width: 100px;
|
width: 100px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#controls {
|
||||||
|
left: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#right-controls {
|
||||||
|
right: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
#glyph {
|
#glyph {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 60px;
|
top: 60px;
|
||||||
|
|||||||
Reference in New Issue
Block a user