OSDN Git Service

merge v06sheet
[pettanr/pettanr.git] / app / helpers / application_helper.rb
1 module ApplicationHelper
2   def full_url filename
3     request.protocol + request.host_with_port + filename
4   end
5   
6   def t_m(label)
7     l = label.split('.')
8     if l.size > 2
9       label
10     else
11       if l.size == 1
12         label.constantize.model_name.human
13       else
14         l.first.constantize.human_attribute_name(l.last)
15       end
16     end
17   end
18   
19   def t_select_items(items)
20     items.map {|i| [t(i[0]), i[1]] }
21   end
22   
23   def t_selected_item(name, index)
24     t(MagicNumber[name][index][0])
25   end
26   
27   def icon_tag name, opt = {}
28     title = opt[:object] ? (name.to_s + ' ID:' + opt[:object].id.to_s) : name
29     size = opt[:size] ? opt[:size].to_i : 35
30     tag :img, :src => asset_path(name.to_s.underscore + '.gif'), :width => size, :height => size, :alt => name.to_s + ' Icon', :title => title
31   end
32   
33   def author_icon opt = {}
34     icon_tag :Author, opt
35   end
36   
37   def artist_icon opt = {}
38     icon_tag :Artist, opt
39   end
40   
41   def scroll_icon opt = {}
42     icon_tag :Scroll, opt
43   end
44   
45   def scroll_panel_icon opt = {}
46     icon_tag :ScrollPanel, opt
47   end
48   
49   def comic_icon opt = {}
50     icon_tag :Comic, opt
51   end
52   
53   def story_icon opt = {}
54     icon_tag :Story, opt
55   end
56   
57   def story_sheet_icon opt = {}
58     icon_tag :StorySheet, opt
59   end
60   
61   def sheet_icon opt = {}
62     icon_tag :Sheet, opt
63   end
64   
65   def sheet_panel_icon opt = {}
66     icon_tag :Sheet, opt
67   end
68   
69   def panel_icon opt = {}
70     icon_tag :Panel, opt
71   end
72   
73   def panel_editor_javascript_include_tags
74     WritingFormat.enable_list().map {|wf|
75 #      javascript_include_tag wf.engine_name
76       javascript_include_tag wf.engine_name + "/application"
77     }.join("\n") + 
78     SpeechBalloonTemplate.enable_list().map {|sbt|
79       stylesheet_link_tag sbt.engine_name + "/application"
80     }.join("\n") + 
81     SpeechBalloonTemplate.enable_list().map {|sbt|
82       javascript_include_tag sbt.engine_name + "/application"
83     }.join("\n")
84   end
85   
86   def configurations
87     JSON.parse(<<HD
88 {
89     "models": {
90         "Panel": "panel",
91         "panel": {
92             "class_name": "Panel",
93             "table_name": "panels",
94             "attributes": {
95                 "id": {
96                     "type": "number",
97                     "primary_key": 1,
98                     "rules": {
99                         "number": true
100                     }
101                 },
102                 "width": {
103                     "type": "number",
104                     "rules": {
105                         "required": true,
106                         "number": true,
107                         "min": 1
108                     }
109                 },
110                 "height": {
111                     "type": "number",
112                     "rules": {
113                         "required": true,
114                         "number": true,
115                         "min": 1
116                     }
117                 },
118                 "border": {
119                     "type": "number",
120                     "rules": {
121                         "required": true,
122                         "number": true,
123                         "min": 0
124                     }
125                 },
126                 "caption": {
127                     "type": "text",
128                     "rules": {
129                     }
130                 },
131                 "publish": {
132                     "type": "number",
133                     "rules": {
134                         "required": true,
135                         "number": true
136                     }
137                 },
138                 "author_id": {
139                     "type": "number",
140                     "rules": {
141                         "required": true,
142                         "number": true
143                     }
144                 },
145                 "created_at": {
146                     "type": "datetime"
147                 },
148                 "updated_at": {
149                     "type": "datetime"
150                 }
151             }
152         },
153         "PanelPicture": "panel_picture",
154         "panel_picture": {
155             "class_name": "PanelPicture",
156             "table_name": "panel_pictures",
157             "attributes": {
158                 "id": {
159                     "type": "number",
160                     "primary_key": 1,
161                     "rules": {
162                         "number": true
163                     }
164                 },
165                 "panel_id": {
166                     "type": "number",
167                     "rules": {
168                         "number": true
169                     }
170                 },
171                 "picture_id": {
172                     "type": "number",
173                     "rules": {
174                         "required": true,
175                         "number": true
176                     }
177                 },
178                 "caption": {
179                     "type": "text",
180                     "rules": {}
181                 },
182                 "x": {
183                     "type": "number",
184                     "rules": {
185                         "required": true,
186                         "number": true
187                     }
188                 },
189                 "y": {
190                     "type": "number",
191                     "rules": {
192                         "required": true,
193                         "number": true
194                     }
195                 },
196                 "width": {
197                     "type": "number",
198                     "rules": {
199                         "required": true,
200                         "number": true
201                     }
202                 },
203                 "height": {
204                     "type": "number",
205                     "rules": {
206                         "required": true,
207                         "number": true
208                     }
209                 },
210                 "link": {
211                     "type": "text",
212                     "rules": {
213                         "url": true
214                     }
215                 },
216                 "z": {
217                     "type": "number",
218                     "rules": {
219                         "required": true,
220                         "number": true,
221                         "min": 1
222                     }
223                 },
224                 "t": {
225                     "type": "number",
226                     "rules": {
227                         "required": true,
228                         "number": true,
229                         "min": 0
230                     }
231                 },
232                 "created_at": {
233                     "type": "datetime"
234                 },
235                 "updated_at": {
236                     "type": "datetime"
237                 }
238             }
239         },
240         "SpeechBalloon": "speech_balloon",
241         "speech_balloon": {
242             "class_name": "SpeechBalloon",
243             "table_name": "speech_balloons",
244             "extend": "classname",
245             "attributes": {
246                 "id": {
247                     "type": "number",
248                     "primary_key": 1,
249                     "rules": {
250                         "number": true
251                     }
252                 },
253                 "panel_id": {
254                     "type": "number",
255                     "rules": {
256                         "number": true
257                     }
258                 },
259                 "speech_balloon_template_id": {
260                     "type": "number",
261                     "rules": {
262                         "required": true,
263                         "number": true
264                     }
265                 },
266                 "classname": {
267                     "type": "text",
268                     "rules": {
269                         "required": true
270                     }
271                 },
272                 "z": {
273                     "type": "number",
274                     "rules": {
275                         "required": true,
276                         "number": true,
277                         "min": 1
278                     }
279                 },
280                 "t": {
281                     "type": "number",
282                     "rules": {
283                         "required": true,
284                         "number": true,
285                         "min": 0
286                     }
287                 },
288                 "settings": {
289                     "type": "text",
290                     "rules": {}
291                 },
292                 "caption": {
293                     "type": "text",
294                     "rules": {}
295                 },
296                 "created_at": {
297                     "type": "datetime"
298                 },
299                 "updated_at": {
300                     "type": "datetime"
301                 }
302             }
303         },
304         "Balloon": "balloon",
305         "balloon": {
306             "class_name": "Balloon",
307             "table_name": "balloons",
308             "attributes": {
309                 "id": {
310                     "type": "number",
311                     "primary_key": 1,
312                     "rules": {
313                         "number": true
314                     }
315                 },
316                 "speech_balloon_id": {
317                     "type": "number",
318                     "rules": {
319                         "number": true
320                     }
321                 },
322                 "system_picture_id": {
323                     "type": "number",
324                     "rules": {
325                         "required": true,
326                         "number": true
327                     }
328                 },
329                 "x": {
330                     "type": "number",
331                     "rules": {
332                         "required": true,
333                         "number": true
334                     }
335                 },
336                 "y": {
337                     "type": "number",
338                     "rules": {
339                         "required": true,
340                         "number": true
341                     }
342                 },
343                 "width": {
344                     "type": "number",
345                     "rules": {
346                         "required": true,
347                         "number": true,
348                         "min": 1
349                     }
350                 },
351                 "height": {
352                     "type": "number",
353                     "rules": {
354                         "required": true,
355                         "number": true,
356                         "min": 1
357                     }
358                 },
359                 "r": {
360                     "type": "number",
361                     "rules": {
362                         "required": true,
363                         "number": true
364                     }
365                 },
366                 "settings": {
367                     "type": "text",
368                     "rules": {}
369                 },
370                 "created_at": {
371                     "type": "datetime"
372                 },
373                 "updated_at": {
374                     "type": "datetime"
375                 }
376             }
377         },
378         "Speech": "speech",
379         "speech": {
380             "class_name": "Speech",
381             "table_name": "speeches",
382             "attributes": {
383                 "id": {
384                     "type": "number",
385                     "primary_key": 1,
386                     "rules": {
387                         "number": true
388                     }
389                 },
390                 "speech_balloon_id": {
391                     "type": "number",
392                     "rules": {
393                         "number": true
394                     }
395                 },
396                 "writing_format_id": {
397                     "type": "number",
398                     "rules": {
399                         "required": true,
400                         "number": true
401                     }
402                 },
403                 "content": {
404                     "type": "text",
405                     "rules": {}
406                 },
407                 "font_size": {
408                     "type": "float",
409                     "rules": {
410                         "required": true,
411                         "number": true,
412                         "min": 0
413                     }
414                 },
415                 "text_align": {
416                     "type": "number",
417                     "rules": {
418                         "required": true,
419                         "number": true,
420                         "range": [
421                             0,
422                             3
423                         ]
424                     }
425                 },
426                 "fore_color": {
427                     "type": "number",
428                     "rules": {
429                         "required": true,
430                         "number": true,
431                         "range": [
432                             0,
433                             16777215
434                         ]
435                     }
436                 },
437                 "x": {
438                     "type": "number",
439                     "rules": {
440                         "required": true,
441                         "number": true
442                     }
443                 },
444                 "y": {
445                     "type": "number",
446                     "rules": {
447                         "required": true,
448                         "number": true
449                     }
450                 },
451                 "width": {
452                     "type": "number",
453                     "rules": {
454                         "required": true,
455                         "number": true,
456                         "min": 1
457                     }
458                 },
459                 "height": {
460                     "type": "number",
461                     "rules": {
462                         "required": true,
463                         "number": true,
464                         "min": 1
465                     }
466                 },
467                 "quotes": {
468                     "type": "text",
469                     "rules": {}
470                 },
471                 "settings": {
472                     "type": "text",
473                     "rules": {}
474                 },
475                 "created_at": {
476                     "type": "datetime"
477                 },
478                 "updated_at": {
479                     "type": "datetime"
480                 }
481             }
482         },
483         "GroundPicture": "ground_picture",
484         "ground_picture": {
485             "class_name": "GroundPicture",
486             "table_name": "ground_pictures",
487             "attributes": {
488                 "id": {
489                     "type": "number",
490                     "primary_key": 1,
491                     "rules": {
492                         "number": true
493                     }
494                 },
495                 "panel_id": {
496                     "type": "number",
497                     "rules": {
498                         "number": true
499                     }
500                 },
501                 "picture_id": {
502                     "type": "number",
503                     "rules": {
504                         "required": true,
505                         "number": true
506                     }
507                 },
508                 "caption": {
509                     "type": "text",
510                     "rules": {}
511                 },
512                 "repeat": {
513                     "type": "number",
514                     "rules": {
515                         "required": true,
516                         "number": true,
517                         "range": [
518                             0,
519                             3
520                         ]
521                     }
522                 },
523                 "x": {
524                     "type": "number",
525                     "rules": {
526                         "required": true,
527                         "number": true
528                     }
529                 },
530                 "y": {
531                     "type": "number",
532                     "rules": {
533                         "required": true,
534                         "number": true
535                     }
536                 },
537                 "z": {
538                     "type": "number",
539                     "rules": {
540                         "required": true,
541                         "number": true,
542                         "min": 1
543                     }
544                 },
545                 "t": {
546                     "type": "number",
547                     "rules": {
548                         "required": true,
549                         "number": true,
550                         "min": 0
551                     }
552                 },
553                 "created_at": {
554                     "type": "datetime"
555                 },
556                 "updated_at": {
557                     "type": "datetime"
558                 }
559             }
560         },
561         "GroundColor": "ground_color",
562         "ground_color": {
563             "class_name": "GroundColor",
564             "table_name": "ground_colors",
565             "attributes": {
566                 "id": {
567                     "type": "number",
568                     "primary_key": 1,
569                     "rules": {
570                         "number": true
571                     }
572                 },
573                 "panel_id": {
574                     "type": "number",
575                     "rules": {
576                         "number": true
577                     }
578                 },
579                 "caption": {
580                     "type": "text",
581                     "rules": {}
582                 },
583                 "code": {
584                     "type": "number",
585                     "rules": {
586                         "required": true,
587                         "number": true,
588                         "range": [
589                             0,
590                             16777215
591                         ]
592                     }
593                 },
594                 "z": {
595                     "type": "number",
596                     "rules": {
597                         "required": true,
598                         "number": true,
599                         "min": 1
600                     }
601                 },
602                 "t": {
603                     "type": "number",
604                     "rules": {
605                         "required": true,
606                         "number": true,
607                         "min": 0
608                     }
609                 },
610                 "created_at": {
611                     "type": "datetime"
612                 },
613                 "updated_at": {
614                     "type": "datetime"
615                 }
616             }
617         },
618         "WritingFormat": "writing_format",
619         "writing_format": {
620             "class_name": "WritingFormat",
621             "table_name": "writing_formats",
622             "attributes": {
623                 "id": {
624                     "type": "number",
625                     "primary_key": 1,
626                     "rules": {
627                         "number": true
628                     }
629                 },
630                 "name": {
631                     "type": "text",
632                     "rules": {
633                         "required": true
634                     }
635                 },
636                 "classname": {
637                     "type": "text",
638                     "rules": {
639                         "required": true
640                     }
641                 },
642                 "caption": {
643                     "type": "text",
644                     "rules": {
645                         "required": true
646                     }
647                 },
648                 "system_picture_id": {
649                     "type": "number",
650                     "rules": {
651                         "required": true,
652                         "number": true
653                     }
654                 },
655                 "settings": {
656                     "type": "text",
657                     "rules": {
658                         "required": true
659                     }
660                 },
661                 "created_at": {
662                     "type": "datetime"
663                 },
664                 "updated_at": {
665                     "type": "datetime"
666                 }
667             }
668         }
669     },
670     "elements": [
671         {
672             "name": "panel_picture",
673             "path_name": "panel_pictures",
674             "parts": []
675         },
676         {
677             "name": "speech_balloon",
678             "path_name": "circle_speech_balloon/speech_balloons",
679             "parts": [
680                 "balloon",
681                 "speech"
682             ]
683         },
684         {
685             "name": "ground_picture",
686             "path_name": "ground_pictures",
687             "parts": []
688         },
689         {
690             "name": "ground_color",
691             "path_name": "ground_colors",
692             "parts": []
693         }
694     ],
695     "forms": {
696         "Panel": "panel",
697         "panel": {
698             "attributes": {
699                 "caption": {
700                     "column": "caption",
701                     "type": "text",
702                     "label": {},
703                     "options": {
704                         "row_break": true
705                     }
706                 },
707                 "width": {
708                     "column": "width",
709                     "type": "number",
710                     "label": {},
711                     "options": {
712                         "size": 5
713                     }
714                 },
715                 "height": {
716                     "column": "height",
717                     "type": "number",
718                     "label": {},
719                     "options": {
720                         "size": 5,
721                         "row_break": true
722                     }
723                 },
724                 "border": {
725                     "column": "border",
726                     "type": "number",
727                     "label": {},
728                     "options": {
729                         "size": 5
730                     }
731                 },
732                 "publish": {
733                     "column": "publish",
734                     "type": "select",
735                     "label": {},
736                     "options": {
737                         "source": "magic_number",
738                         "key": "comic_visible_items",
739                         "size": 5,
740                         "row_break": true
741                     }
742                 },
743                 "id": {
744                     "column": "id",
745                     "type": "hidden",
746                     "label": {
747                         "type": "hidden"
748                     },
749                     "options": {}
750                 },
751                 "author_id": {
752                     "column": "author_id",
753                     "type": "hidden",
754                     "label": {
755                         "type": "hidden"
756                     },
757                     "options": {}
758                 }
759             },
760             "fields": [
761                 "caption",
762                 "width",
763                 "height",
764                 "border",
765                 "publish",
766                 "id",
767                 "author_id"
768             ]
769         },
770         "PanelPicture": "panel_picture",
771         "panel_picture": {
772             "attributes": {
773                 "caption": {
774                     "column": "caption",
775                     "type": "text",
776                     "label": {},
777                     "options": {
778                         "row_break": true
779                     }
780                 },
781                 "x": {
782                     "column": "x",
783                     "type": "number",
784                     "label": {},
785                     "options": {
786                         "size": 5
787                     }
788                 },
789                 "y": {
790                     "column": "y",
791                     "type": "number",
792                     "label": {},
793                     "options": {
794                         "size": 5,
795                         "row_break": true
796                     }
797                 },
798                 "width": {
799                     "column": "width",
800                     "type": "number",
801                     "label": {},
802                     "options": {
803                         "size": 5,
804                         "row_break": true
805                     },
806                     "helpers": {
807                         "size": {
808                             "path": "panels/size_helper",
809                             "options": {
810                                 "class": "panel_picture_width_tool"
811                             }
812                         }
813                     }
814                 },
815                 "height": {
816                     "column": "height",
817                     "type": "number",
818                     "label": {},
819                     "options": {
820                         "size": 5,
821                         "row_break": true
822                     },
823                     "helpers": {
824                         "size": {
825                             "path": "panels/size_helper",
826                             "options": {
827                                 "class": "panel_picture_height_tool"
828                             }
829                         }
830                     }
831                 },
832                 "link": {
833                     "column": "link",
834                     "type": "text",
835                     "label": {},
836                     "options": {
837                         "row_break": true
838                     }
839                 },
840                 "id": {
841                     "column": "id",
842                     "type": "hidden",
843                     "label": {
844                         "type": "hidden"
845                     },
846                     "options": {}
847                 },
848                 "panel_id": {
849                     "column": "panel_id",
850                     "type": "hidden",
851                     "label": {
852                         "type": "hidden"
853                     },
854                     "options": {}
855                 },
856                 "picture_id": {
857                     "column": "picture_id",
858                     "type": "hidden",
859                     "label": {
860                         "type": "hidden"
861                     },
862                     "options": {}
863                 },
864                 "z": {
865                     "column": "z",
866                     "type": "hidden",
867                     "label": {
868                         "type": "hidden"
869                     },
870                     "options": {}
871                 },
872                 "t": {
873                     "column": "t",
874                     "type": "hidden",
875                     "label": {
876                         "type": "hidden"
877                     },
878                     "options": {}
879                 }
880             },
881             "fields": [
882                 "caption",
883                 "x",
884                 "y",
885                 "width",
886                 "height",
887                 "link",
888                 "id",
889                 "panel_id",
890                 "picture_id",
891                 "z",
892                 "t"
893             ]
894         },
895         "speech_balloon": {
896             "attributes": {
897                 "speech_balloon.id": {
898                     "column": "id",
899                     "type": "hidden",
900                     "label": {
901                         "type": "hidden"
902                     },
903                     "options": {}
904                 },
905                 "speech_balloon.panel_id": {
906                     "column": "panel_id",
907                     "type": "hidden",
908                     "label": {
909                         "type": "hidden"
910                     },
911                     "options": {}
912                 },
913                 "speech_balloon.speech_balloon_template_id": {
914                     "column": "speech_balloon_template_id",
915                     "type": "hidden",
916                     "label": {
917                         "type": "hidden"
918                     },
919                     "options": {}
920                 },
921                 "speech_balloon.caption": {
922                     "column": "caption",
923                     "type": "text",
924                     "label": {},
925                     "options": {
926                         "row_break": true
927                     }
928                 },
929                 "speech_balloon.z": {
930                     "column": "z",
931                     "type": "hidden",
932                     "label": {
933                         "type": "hidden"
934                     },
935                     "options": {}
936                 },
937                 "speech_balloon.t": {
938                     "column": "t",
939                     "type": "hidden",
940                     "label": {
941                         "type": "hidden"
942                     },
943                     "options": {}
944                 },
945                 "speech_balloon.classname": {
946                     "column": "classname",
947                     "type": "hidden",
948                     "label": {
949                         "type": "hidden"
950                     },
951                     "options": {}
952                 },
953                 "speech_balloon.settings": {
954                     "column": "settings",
955                     "type": "hidden",
956                     "label": {
957                         "type": "hidden"
958                     },
959                     "options": {}
960                 },
961                 "balloon.id": {
962                     "model": "balloon",
963                     "part": "balloon",
964                     "column": "id",
965                     "type": "hidden",
966                     "label": {
967                         "type": "hidden"
968                     },
969                     "options": {}
970                 },
971                 "balloon.speech_balloon_id": {
972                     "model": "balloon",
973                     "part": "balloon",
974                     "column": "speech_balloon_id",
975                     "type": "hidden",
976                     "label": {
977                         "type": "hidden"
978                     },
979                     "options": {}
980                 },
981                 "balloon.system_picture_id": {
982                     "model": "balloon",
983                     "part": "balloon",
984                     "column": "system_picture_id",
985                     "type": "hidden",
986                     "label": {
987                         "type": "hidden"
988                     },
989                     "options": {}
990                 },
991                 "balloon.r": {
992                     "model": "balloon",
993                     "part": "balloon",
994                     "column": "r",
995                     "type": "number",
996                     "label": {},
997                     "options": {
998                         "size": 5,
999                         "row_break": true
1000                     },
1001                     "helpers": {
1002                         "tail_angle": {
1003                             "path": "panels/tail_angle_helper",
1004                             "options": {}
1005                         }
1006                     }
1007                 },
1008                 "balloon.x": {
1009                     "model": "balloon",
1010                     "part": "balloon",
1011                     "column": "x",
1012                     "type": "number",
1013                     "label": {},
1014                     "options": {
1015                         "size": 5
1016                     }
1017                 },
1018                 "balloon.y": {
1019                     "model": "balloon",
1020                     "part": "balloon",
1021                     "column": "y",
1022                     "type": "number",
1023                     "label": {},
1024                     "options": {
1025                         "size": 5,
1026                         "row_break": true
1027                     }
1028                 },
1029                 "balloon.width": {
1030                     "model": "balloon",
1031                     "part": "balloon",
1032                     "column": "width",
1033                     "type": "number",
1034                     "label": {},
1035                     "options": {
1036                         "size": 5
1037                     }
1038                 },
1039                 "balloon.height": {
1040                     "model": "balloon",
1041                     "part": "balloon",
1042                     "column": "height",
1043                     "type": "number",
1044                     "label": {},
1045                     "options": {
1046                         "size": 5,
1047                         "row_break": true
1048                     }
1049                 },
1050                 "balloon.settings": {
1051                     "model": "balloon",
1052                     "part": "balloon",
1053                     "column": "settings",
1054                     "type": "hidden",
1055                     "label": {
1056                         "type": "hidden"
1057                     },
1058                     "options": {}
1059                 },
1060                 "speech.id": {
1061                     "model": "speech",
1062                     "part": "speech",
1063                     "column": "id",
1064                     "type": "hidden",
1065                     "label": {
1066                         "type": "hidden"
1067                     },
1068                     "options": {}
1069                 },
1070                 "speech.speech_balloon_id": {
1071                     "model": "speech",
1072                     "part": "speech",
1073                     "column": "speech_balloon_id",
1074                     "type": "hidden",
1075                     "label": {
1076                         "type": "hidden"
1077                     },
1078                     "options": {}
1079                 },
1080                 "speech.x": {
1081                     "model": "speech",
1082                     "part": "speech",
1083                     "column": "x",
1084                     "type": "hidden",
1085                     "label": {
1086                         "type": "hidden"
1087                     },
1088                     "options": {}
1089                 },
1090                 "speech.y": {
1091                     "model": "speech",
1092                     "part": "speech",
1093                     "column": "y",
1094                     "type": "hidden",
1095                     "label": {
1096                         "type": "hidden"
1097                     },
1098                     "options": {}
1099                 },
1100                 "speech.width": {
1101                     "model": "speech",
1102                     "part": "speech",
1103                     "column": "width",
1104                     "type": "hidden",
1105                     "label": {
1106                         "type": "hidden"
1107                     },
1108                     "options": {}
1109                 },
1110                 "speech.height": {
1111                     "model": "speech",
1112                     "part": "speech",
1113                     "column": "height",
1114                     "type": "hidden",
1115                     "label": {
1116                         "type": "hidden"
1117                     },
1118                     "options": {}
1119                 },
1120                 "speech.writing_format_id": {
1121                     "model": "speech",
1122                     "part": "speech",
1123                     "column": "writing_format_id",
1124                     "type": "select",
1125                     "label": {},
1126                     "options": {
1127                         "source": "model",
1128                         "model": "writing_format",
1129                         "method": "enable_list",
1130                         "caption": "caption"
1131                     }
1132                 },
1133                 "speech.font_size": {
1134                     "model": "speech",
1135                     "part": "speech",
1136                     "column": "font_size",
1137                     "type": "select",
1138                     "label": {},
1139                     "options": {
1140                         "source": "magic_number",
1141                         "key": "speech_font_size_items",
1142                         "row_break": true
1143                     }
1144                 },
1145                 "speech.text_align": {
1146                     "model": "speech",
1147                     "part": "speech",
1148                     "column": "text_align",
1149                     "type": "select",
1150                     "label": {},
1151                     "options": {
1152                         "source": "magic_number",
1153                         "key": "speech_text_align_items"
1154                     }
1155                 },
1156                 "speech.quotes": {
1157                     "model": "speech",
1158                     "part": "speech",
1159                     "column": "quotes",
1160                     "type": "text",
1161                     "label": {},
1162                     "options": {
1163                         "size": 5
1164                     }
1165                 },
1166                 "speech.content": {
1167                     "model": "speech",
1168                     "part": "speech",
1169                     "column": "content",
1170                     "type": "text_area",
1171                     "label": {
1172                         "row_break": true
1173                     },
1174                     "options": {
1175                         "size": "45x5"
1176                     }
1177                 },
1178                 "speech.fore_color": {
1179                     "model": "speech",
1180                     "part": "speech",
1181                     "column": "fore_color",
1182                     "type": "hidden",
1183                     "label": {
1184                         "row_break": true
1185                     },
1186                     "options": {},
1187                     "helpers": {
1188                         "color": {
1189                             "path": "panels/color_helper",
1190                             "options": {},
1191                             "wrapper": "speech-fore_color-wrap"
1192                         }
1193                     }
1194                 },
1195                 "speech.settings": {
1196                     "model": "speech",
1197                     "part": "speech",
1198                     "column": "settings",
1199                     "type": "hidden",
1200                     "label": {
1201                         "type": "hidden"
1202                     },
1203                     "options": {}
1204                 }
1205             }
1206         },
1207         "CircleSpeechBalloon": "circle_speech_balloon",
1208         "circle_speech_balloon": {
1209             "base": "speech_balloon",
1210             "attributes": {},
1211             "fields": [
1212                 "speech_balloon.caption",
1213                 "balloon.r",
1214                 "balloon.x",
1215                 "balloon.y",
1216                 "balloon.width",
1217                 "balloon.height",
1218                 "balloon.id",
1219                 "balloon.speech_balloon_id",
1220                 "balloon.system_picture_id",
1221                 "balloon.settings",
1222                 "speech.writing_format_id",
1223                 "speech.font_size",
1224                 "speech.text_align",
1225                 "speech.quotes",
1226                 "speech.content",
1227                 "speech.fore_color",
1228                 "speech.id",
1229                 "speech.speech_balloon_id",
1230                 "speech.x",
1231                 "speech.y",
1232                 "speech.width",
1233                 "speech.height",
1234                 "speech.settings",
1235                 "speech_balloon.id",
1236                 "speech_balloon.panel_id",
1237                 "speech_balloon.speech_balloon_template_id",
1238                 "speech_balloon.classname",
1239                 "speech_balloon.z",
1240                 "speech_balloon.t",
1241                 "speech_balloon.settings"
1242             ]
1243         },
1244         "PlainSpeechBalloon": "plain_speech_balloon",
1245         "plain_speech_balloon": {
1246             "base": "speech_balloon",
1247             "attributes": {
1248                 "balloon.r": {
1249                     "model": "balloon",
1250                     "part": "balloon",
1251                     "column": "r",
1252                     "type": "hidden",
1253                     "label": {
1254                         "type": "hidden"
1255                     },
1256                     "options": {}
1257                 }
1258             },
1259             "fields": [
1260                 "speech_balloon.caption",
1261                 "balloon.r",
1262                 "balloon.x",
1263                 "balloon.y",
1264                 "balloon.width",
1265                 "balloon.height",
1266                 "balloon.id",
1267                 "balloon.speech_balloon_id",
1268                 "balloon.system_picture_id",
1269                 "balloon.settings",
1270                 "speech.writing_format_id",
1271                 "speech.font_size",
1272                 "speech.text_align",
1273                 "speech.quotes",
1274                 "speech.content",
1275                 "speech.fore_color",
1276                 "speech.id",
1277                 "speech.speech_balloon_id",
1278                 "speech.x",
1279                 "speech.y",
1280                 "speech.width",
1281                 "speech.height",
1282                 "speech.settings",
1283                 "speech_balloon.id",
1284                 "speech_balloon.panel_id",
1285                 "speech_balloon.speech_balloon_template_id",
1286                 "speech_balloon.classname",
1287                 "speech_balloon.z",
1288                 "speech_balloon.t",
1289                 "speech_balloon.settings"
1290             ]
1291         },
1292         "SquareSpeechBalloon": "square_speech_balloon",
1293         "square_speech_balloon": {
1294             "base": "speech_balloon",
1295             "attributes": {
1296                 "balloon.r": {
1297                     "model": "balloon",
1298                     "part": "balloon",
1299                     "column": "r",
1300                     "type": "hidden",
1301                     "label": {
1302                         "type": "hidden"
1303                     },
1304                     "options": {}
1305                 }
1306             },
1307             "fields": [
1308                 "speech_balloon.caption",
1309                 "balloon.r",
1310                 "balloon.x",
1311                 "balloon.y",
1312                 "balloon.width",
1313                 "balloon.height",
1314                 "balloon.id",
1315                 "balloon.speech_balloon_id",
1316                 "balloon.system_picture_id",
1317                 "balloon.settings",
1318                 "speech.writing_format_id",
1319                 "speech.font_size",
1320                 "speech.text_align",
1321                 "speech.quotes",
1322                 "speech.content",
1323                 "speech.fore_color",
1324                 "speech.id",
1325                 "speech.speech_balloon_id",
1326                 "speech.x",
1327                 "speech.y",
1328                 "speech.width",
1329                 "speech.height",
1330                 "speech.settings",
1331                 "speech_balloon.id",
1332                 "speech_balloon.panel_id",
1333                 "speech_balloon.speech_balloon_template_id",
1334                 "speech_balloon.classname",
1335                 "speech_balloon.z",
1336                 "speech_balloon.t",
1337                 "speech_balloon.settings"
1338             ]
1339         },
1340         "GroundPicture": "ground_picture",
1341         "ground_picture": {
1342             "attributes": {
1343                 "id": {
1344                     "column": "id",
1345                     "type": "hidden",
1346                     "label": {
1347                         "type": "hidden"
1348                     },
1349                     "options": {}
1350                 },
1351                 "panel_id": {
1352                     "column": "panel_id",
1353                     "type": "hidden",
1354                     "label": {
1355                         "type": "hidden"
1356                     },
1357                     "options": {}
1358                 },
1359                 "picture_id": {
1360                     "column": "picture_id",
1361                     "type": "hidden",
1362                     "label": {
1363                         "type": "hidden"
1364                     },
1365                     "options": {}
1366                 },
1367                 "caption": {
1368                     "column": "caption",
1369                     "type": "text",
1370                     "label": {},
1371                     "options": {
1372                         "row_break": true
1373                     }
1374                 },
1375                 "repeat": {
1376                     "column": "repeat",
1377                     "type": "select",
1378                     "label": {},
1379                     "options": {
1380                         "source": "magic_number",
1381                         "key": "ground_picture_repeat_items",
1382                         "row_break": true
1383                     }
1384                 },
1385                 "x": {
1386                     "column": "x",
1387                     "type": "number",
1388                     "label": {},
1389                     "options": {
1390                         "size": 5
1391                     }
1392                 },
1393                 "y": {
1394                     "column": "y",
1395                     "type": "number",
1396                     "label": {},
1397                     "options": {
1398                         "size": 5,
1399                         "row_break": true
1400                     }
1401                 },
1402                 "z": {
1403                     "column": "z",
1404                     "type": "hidden",
1405                     "label": {
1406                         "type": "hidden"
1407                     },
1408                     "options": {}
1409                 },
1410                 "t": {
1411                     "column": "t",
1412                     "type": "hidden",
1413                     "label": {
1414                         "type": "hidden"
1415                     },
1416                     "options": {}
1417                 }
1418             },
1419             "fields": [
1420                 "caption",
1421                 "repeat",
1422                 "x",
1423                 "y",
1424                 "z",
1425                 "t",
1426                 "id",
1427                 "panel_id",
1428                 "picture_id"
1429             ]
1430         },
1431         "GroundColor": "ground_color",
1432         "ground_color": {
1433             "attributes": {
1434                 "id": {
1435                     "column": "id",
1436                     "type": "hidden",
1437                     "label": {
1438                         "type": "hidden"
1439                     },
1440                     "options": {}
1441                 },
1442                 "panel_id": {
1443                     "column": "panel_id",
1444                     "type": "hidden",
1445                     "label": {
1446                         "type": "hidden"
1447                     },
1448                     "options": {}
1449                 },
1450                 "caption": {
1451                     "column": "caption",
1452                     "type": "text",
1453                     "label": {},
1454                     "options": {
1455                         "row_break": true
1456                     }
1457                 },
1458                 "code": {
1459                     "column": "code",
1460                     "type": "hidden",
1461                     "label": {
1462                         "row_break": true
1463                     },
1464                     "options": {
1465                         "row_break": true
1466                     },
1467                     "helpers": {
1468                         "color": {
1469                             "path": "panels/color_helper",
1470                             "options": {},
1471                             "wrapper": "ground_color-code-wrap"
1472                         }
1473                     }
1474                 },
1475                 "z": {
1476                     "column": "z",
1477                     "type": "hidden",
1478                     "label": {
1479                         "type": "hidden"
1480                     },
1481                     "options": {}
1482                 },
1483                 "t": {
1484                     "column": "t",
1485                     "type": "hidden",
1486                     "label": {
1487                         "type": "hidden"
1488                     },
1489                     "options": {}
1490                 }
1491             },
1492             "fields": [
1493                 "id",
1494                 "panel_id",
1495                 "caption",
1496                 "code",
1497                 "z",
1498                 "t"
1499             ]
1500         }
1501     },
1502     "locales": {
1503         "ja": {}
1504     }
1505 }
1506 HD
1507 )
1508   end
1509 end