|
@@ -192,7 +192,6 @@ function ui_update_selected_card() {
|
192
|
192
|
$("#card-color").val("").change();
|
193
|
193
|
}
|
194
|
194
|
|
195
|
|
- local_store_save();
|
196
|
195
|
ui_render_selected_card();
|
197
|
196
|
}
|
198
|
197
|
|
|
@@ -204,6 +203,7 @@ function ui_render_selected_card() {
|
204
|
203
|
var back = card_generate_back(card, card_options);
|
205
|
204
|
$('#preview-container').html(front + "\n" + back);
|
206
|
205
|
}
|
|
206
|
+ local_store_save()
|
207
|
207
|
}
|
208
|
208
|
|
209
|
209
|
function ui_open_help() {
|
|
@@ -346,6 +346,14 @@ function ui_change_card_contents() {
|
346
|
346
|
}
|
347
|
347
|
}
|
348
|
348
|
|
|
349
|
+function ui_change_card_contents_keyup () {
|
|
350
|
+ clearTimeout(ui_change_card_contents_keyup.timeout)
|
|
351
|
+ ui_change_card_contents_keyup.timeout = setTimeout(function () {
|
|
352
|
+ $('#card-contents').trigger('change')
|
|
353
|
+ }, 200)
|
|
354
|
+}
|
|
355
|
+ui_change_card_contents_keyup.timeout = null
|
|
356
|
+
|
349
|
357
|
function ui_change_card_tags() {
|
350
|
358
|
var value = $(this).val();
|
351
|
359
|
|
|
@@ -456,7 +464,27 @@ function local_store_load() {
|
456
|
464
|
$(document).ready(function () {
|
457
|
465
|
local_store_load();
|
458
|
466
|
ui_setup_color_selector();
|
459
|
|
- $('.icon-list').typeahead({source:icon_names});
|
|
467
|
+ $('.icon-list').typeahead({
|
|
468
|
+ source:icon_names,
|
|
469
|
+ items: 'all',
|
|
470
|
+ render: function (items) {
|
|
471
|
+ var that = this;
|
|
472
|
+
|
|
473
|
+ items = $(items).map(function (i, item) {
|
|
474
|
+ i = $(that.options.item).data('value', item);
|
|
475
|
+ i.find('a').html(that.highlighter(item));
|
|
476
|
+ var classname = 'icon-' + item.split(' ').join('-').toLowerCase()
|
|
477
|
+ i.find('a').append('<span class="' + classname + '"></span>')
|
|
478
|
+ return i[0];
|
|
479
|
+ });
|
|
480
|
+
|
|
481
|
+ if (this.autoSelect) {
|
|
482
|
+ items.first().addClass('active');
|
|
483
|
+ }
|
|
484
|
+ this.$menu.html(items);
|
|
485
|
+ return this;
|
|
486
|
+ }
|
|
487
|
+ });
|
460
|
488
|
|
461
|
489
|
$("#button-generate").click(ui_generate);
|
462
|
490
|
$("#button-load").click(function () { $("#file-load").click(); });
|
|
@@ -486,6 +514,9 @@ $(document).ready(function () {
|
486
|
514
|
$("#card-contents").change(ui_change_card_contents);
|
487
|
515
|
$("#card-tags").change(ui_change_card_tags);
|
488
|
516
|
|
|
517
|
+ $("#card-contents").keyup(ui_change_card_contents_keyup);
|
|
518
|
+
|
|
519
|
+
|
489
|
520
|
$("#page-size").change(ui_change_option);
|
490
|
521
|
$("#page-rows").change(ui_change_option);
|
491
|
522
|
$("#page-columns").change(ui_change_option);
|