X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=app%2Fassets%2Fjavascripts%2Fmodels%2Fspeech_balloon.js.coffee;h=6fb8af1e17f0710211d2204862fff43b62a54ede;hb=e05f18d1db38e531e7bca45d4ba8db71b082402f;hp=4a282025d8dd4393b3430626ddd02b0b51117742;hpb=10d7d403b74c06dcbf42a132b9712c3817547284;p=pettanr%2Fpettanr.git diff --git a/app/assets/javascripts/models/speech_balloon.js.coffee b/app/assets/javascripts/models/speech_balloon.js.coffee index 4a282025..6fb8af1e 100644 --- a/app/assets/javascripts/models/speech_balloon.js.coffee +++ b/app/assets/javascripts/models/speech_balloon.js.coffee @@ -1,70 +1,55 @@ -class SpeechBalloon extends Element - @single: () -> +class Pettanr.SpeechBalloon extends Peta.Element + + @singular: () -> 'SpeechBalloon' @plural: () -> 'SpeechBalloons' - @colum_structures: -> - {} - defaults: { - x: 11 + id: null, + z: null, + t: null } - initialize: () -> - confirm("Welcome to this world") + @pick_item_name: () -> + 'speech_balloon_template' + + @traceable_item_names: () -> + ['speech', 'balloon'] + + pick: () -> + # + speech_balloon_template = @templates.speech_balloon_template + { + speech_balloon_template_id: speech_balloon_template.get('id'), + speech_balloon_template_module_name: speech_balloon_template.get('module_name') + } - @test: () -> - confirm( @single()) - confirm( @plural() ) - confirm( @class_name() ) - confirm( @element_name() ) - confirm( @table_name() ) - confirm( @path_name() ) - confirm( @colum_structures() ) - - has_picture: () -> - true + @trace_routes: () -> + { + symbol: ['speech_balloon_template', 'system_picture'], + } - has_part: () -> + @has_picture: () -> false - extend_column: () -> - null + filer_caption: (context, options) -> + @get_child('balloon', this, { + success: (balloon) => + @get_child('speech', this, { + success: (speech) => + plain_scenario = @plain_scenario() + balloon.plain_scenario() + speech.plain_scenario() + options.success.call(context, plain_scenario) + }) + }) + + plain_scenario: () -> + @escape('caption') + + element_face: () -> + new Pettanr.Views.SpeechBalloon.ElementFace({element: this}) + + initialize: (attr, options) -> + super(attr, options) - test: () -> - confirm( @has_picture() ) - confirm( @has_part() ) - confirm( @parts() ) - confirm( @has_helper('column_name') ) - confirm( @element_name() ) - confirm( @extend_column() ) - confirm( @extend_element_name() ) - confirm( @find_configurations(window.configurations,'v') ) - confirm( @new_index() ) - confirm( @set_new_index(3) ) - confirm( @set_new_panel('v') ) - confirm( @get_new_panel() ) - confirm( '@get_panel()' ) - confirm( @get_panel() ) - confirm( @tag_id('c') ) - confirm( @field_tag_id('f') ) - confirm( @tag_panel_id() ) - confirm( @tag_element_id() ) - confirm( @tag_element_type() ) - confirm( @tag_new_index() ) - confirm( @path_name() ) - confirm( @form_template() ) - confirm( @scenario_template() ) - confirm( @element_face_template() ) - confirm( @form_helper_template('colum_name') ) - confirm( @tag_attributes('column') ) - confirm( @field_tag_attributes('column', 0, {}) ) - confirm( @any_tag_attributes('name', {}) ) - confirm( @select_tag_attributes(true, 'column', 0) ) - confirm( @tag_attr('column', {}) ) - confirm( @field_tag_attr('column', 1, {}) ) - confirm( @any_tag_attr('name', {}) ) - -@PanelPicture = PanelPicture