crobi 10 лет назад
Родитель
Сommit
e63bcedf44
3 измененных файлов: 18 добавлений и 3 удалений
  1. 7
    1
      generator/generate.html
  2. 10
    2
      generator/js/card.ts
  3. 1
    0
      generator/js/ui.ts

+ 7
- 1
generator/generate.html Просмотреть файл

@@ -237,7 +237,7 @@
237 237
                         </div>
238 238
                     </div>
239 239
                     <div class="form-group">
240
-                        <label for="card-title-size" class="col-sm-2 control-label">Title</label>
240
+                        <label for="card-title-size" class="col-sm-2 control-label">Title size</label>
241 241
                         <div class="col-sm-10">
242 242
                             <select class="form-control" id="card-title-size" data-property="title_size">
243 243
                                 <option value="" selected>default font</option>
@@ -251,6 +251,12 @@
251 251
                             </select>
252 252
                         </div>
253 253
                     </div>
254
+                    <div class="form-group">
255
+                        <label for="card-title-icon-text" class="col-sm-2 control-label">Icon text</label>
256
+                        <div class="col-sm-10">
257
+                            <input type="text" id="card-title-icon-text" class="form-control" placeholder="Icon text" data-property="title_icon_text">
258
+                        </div>
259
+                    </div>
254 260
                     <div class="form-group">
255 261
                         <label for="card-count" class="col-sm-2 control-label">Count</label>
256 262
                         <div class="col-sm-10">

+ 10
- 2
generator/js/card.ts Просмотреть файл

@@ -44,6 +44,7 @@ module RpgCards {
44 44
         count: number;
45 45
         title: string;
46 46
         title_size: string;
47
+        title_icon_text: string;
47 48
         color: string;
48 49
         color_front: string;
49 50
         color_back: string;
@@ -59,6 +60,7 @@ module RpgCards {
59 60
             this.count = 1;
60 61
             this.title = "New card";
61 62
             this.title_size = null;
63
+            this.title_icon_text = null;
62 64
             this.color = null;
63 65
             this.color_front = null;
64 66
             this.color_back = null;
@@ -75,6 +77,7 @@ module RpgCards {
75 77
             result.count = json.count || 1;
76 78
             result.title = json.title || "";
77 79
             result.title_size = json.title_size || null;
80
+            result.title_icon_text = json.title_icon_text || null;
78 81
             result.color = json.color || null;
79 82
             result.color_front = json.color_front || null;
80 83
             result.color_back = json.color_back || null;
@@ -91,6 +94,7 @@ module RpgCards {
91 94
                 count: this.count,
92 95
                 title: this.title,
93 96
                 title_size: this.title_size,
97
+                title_icon_text: this.title_icon_text,
94 98
                 color: this.color,
95 99
                 color_front: this.color_front,
96 100
                 color_back: this.color_back,
@@ -132,6 +136,9 @@ module RpgCards {
132 136
         public getTitleSize(options: Options): string {
133 137
             return this.title_size || options.default_title_size || "13";
134 138
         }
139
+        public getTitleIconText(options: Options): string {
140
+            return this.title_icon_text || "";
141
+        }
135 142
         public getColorFront(options: Options): string {
136 143
             return this.color_front || this.color || options.default_color || "black";
137 144
         }
@@ -347,12 +354,13 @@ module RpgCards {
347 354
 
348 355
         private  _title(card: Card, options: Options, ind: string, ind0: string): string {
349 356
             var title = card.getTitle(options);
350
-            var title_size = card.getTitleSize(options)
357
+            var title_size = card.getTitleSize(options);
358
+            var title_icon_text = card.getTitleIconText(options);
351 359
             var icon = card.getIconFront(options);
352 360
             var result = "";
353 361
             result += ind + '<card-title size="' + title_size + '">\n';
354 362
             result += ind + ind0 + '<h1>' + title + '</h1>\n';
355
-            result += ind + ind0 + '<h2>' + "" + '</h2>\n';
363
+            result += ind + ind0 + '<h2>' + title_icon_text + '</h2>\n';
356 364
             result += this._icon(icon, ind + ind0, ind0);
357 365
             result += ind + '</card-title>\n';
358 366
             return result;

+ 1
- 0
generator/js/ui.ts Просмотреть файл

@@ -494,6 +494,7 @@ module RpgCardsUI {
494 494
 
495 495
         $("#card-title").change(on_change_card_title);
496 496
         $("#card-title-size").change(on_change_card_property);
497
+        $("#card-title-icon-text").change(on_change_card_property);
497 498
         $("#card-icon").change(on_change_card_property);
498 499
         $("#card-count").change(on_change_card_property);
499 500
         $("#card-icon-back").change(on_change_card_property);

Загрузка…
Отмена
Сохранить