浏览代码

small code style changes

Robert Autenrieth 8 年前
父节点
当前提交
ee9c0b9bfb
共有 3 个文件被更改,包括 15 次插入18 次删除
  1. 4
    4
      generator/js/cards.js
  2. 1
    1
      generator/js/output.js
  3. 10
    13
      generator/js/ui.js

+ 4
- 4
generator/js/cards.js 查看文件

15
         card_size: "25x35",
15
         card_size: "25x35",
16
         card_count: null,
16
         card_count: null,
17
         icon_inline: true
17
         icon_inline: true
18
-    }
18
+    };
19
 }
19
 }
20
 
20
 
21
 function card_default_data() {
21
 function card_default_data() {
24
         title: "New card",
24
         title: "New card",
25
         contents: [],
25
         contents: [],
26
         tags: []
26
         tags: []
27
-    }
27
+    };
28
 }
28
 }
29
 
29
 
30
 function card_init(card) {
30
 function card_init(card) {
329
 }
329
 }
330
 
330
 
331
 function card_generate_back(data, options) {
331
 function card_generate_back(data, options) {
332
-    var color = card_data_color_back(data, options)
332
+    var color = card_data_color_back(data, options);
333
     var style_color = card_generate_color_style(color, options);
333
     var style_color = card_generate_color_style(color, options);
334
 	var url = data.background_image;
334
 	var url = data.background_image;
335
 	var background_style = "";
335
 	var background_style = "";
336
 	if (url)
336
 	if (url)
337
 	{
337
 	{
338
-		background_style = 'style = "background-image: url("' + url + '"); background-size: contain; background-position: center; background-repeat: no-repeat;"'
338
+		background_style = 'style = "background-image: url("' + url + '"); background-size: contain; background-position: center; background-repeat: no-repeat;"';
339
 	}
339
 	}
340
 	else 
340
 	else 
341
 	{
341
 	{

+ 1
- 1
generator/js/output.js 查看文件

19
     document.body.appendChild(div);
19
     document.body.appendChild(div);
20
 }
20
 }
21
 
21
 
22
-window.addEventListener("message", receiveMessage, false);
22
+window.addEventListener("message", receiveMessage, false);

+ 10
- 13
generator/js/ui.js 查看文件

54
 
54
 
55
     // Send the generated HTML to the new window
55
     // Send the generated HTML to the new window
56
     // Use a delay to give the new window time to set up a message listener
56
     // Use a delay to give the new window time to set up a message listener
57
-    setTimeout(function () { tab.postMessage(card_html, '*') }, 500);
57
+    setTimeout(function () { tab.postMessage(card_html, '*'); }, 500);
58
 }
58
 }
59
 
59
 
60
 function ui_load_sample() {
60
 function ui_load_sample() {
190
         $("#card-count").val(1);
190
         $("#card-count").val(1);
191
         $("#card-icon").val("");
191
         $("#card-icon").val("");
192
         $("#card-icon-back").val("");
192
         $("#card-icon-back").val("");
193
-		$("#card-background").val("")
193
+		$("#card-background").val("");
194
         $("#card-contents").val("");
194
         $("#card-contents").val("");
195
         $("#card-tags").val("");
195
         $("#card-tags").val("");
196
         $("#card-color").val("").change();
196
         $("#card-color").val("").change();
207
         var back = card_generate_back(card, card_options);
207
         var back = card_generate_back(card, card_options);
208
         $('#preview-container').html(front + "\n" + back);
208
         $('#preview-container').html(front + "\n" + back);
209
     }
209
     }
210
-    local_store_save()
210
+    local_store_save();
211
 }
211
 }
212
 
212
 
213
 function ui_open_help() {
213
 function ui_open_help() {
351
 }
351
 }
352
 
352
 
353
 function ui_change_card_contents_keyup () {
353
 function ui_change_card_contents_keyup () {
354
-    clearTimeout(ui_change_card_contents_keyup.timeout)
354
+    clearTimeout(ui_change_card_contents_keyup.timeout);
355
     ui_change_card_contents_keyup.timeout = setTimeout(function () {
355
     ui_change_card_contents_keyup.timeout = setTimeout(function () {
356
-        $('#card-contents').trigger('change')
357
-    }, 200)
356
+        $('#card-contents').trigger('change');
357
+    }, 200);
358
 }
358
 }
359
-ui_change_card_contents_keyup.timeout = null
359
+ui_change_card_contents_keyup.timeout = null;
360
 
360
 
361
 function ui_change_card_tags() {
361
 function ui_change_card_tags() {
362
     var value = $(this).val();
362
     var value = $(this).val();
469
     local_store_load();
469
     local_store_load();
470
     ui_setup_color_selector();
470
     ui_setup_color_selector();
471
     $('.icon-list').typeahead({
471
     $('.icon-list').typeahead({
472
-        source:icon_names,
472
+        source: icon_names,
473
         items: 'all',
473
         items: 'all',
474
         render: function (items) {
474
         render: function (items) {
475
           var that = this;
475
           var that = this;
477
           items = $(items).map(function (i, item) {
477
           items = $(items).map(function (i, item) {
478
             i = $(that.options.item).data('value', item);
478
             i = $(that.options.item).data('value', item);
479
             i.find('a').html(that.highlighter(item));
479
             i.find('a').html(that.highlighter(item));
480
-            var classname = 'icon-' + item.split(' ').join('-').toLowerCase()
481
-            i.find('a').append('<span class="' + classname + '"></span>')
480
+            var classname = 'icon-' + item.split(' ').join('-').toLowerCase();
481
+            i.find('a').append('<span class="' + classname + '"></span>');
482
             return i[0];
482
             return i[0];
483
           });
483
           });
484
 
484
 
540
 
540
 
541
     ui_update_card_list();
541
     ui_update_card_list();
542
 });
542
 });
543
-
544
-
545
-

正在加载...
取消
保存