X-Git-Url: http://git.osdn.net/view?p=pettanr%2Fpettanr.git;a=blobdiff_plain;f=app%2Fassets%2Fjavascripts%2Fmodels%2Fspeech.js.coffee;h=20945522c692841bddcbd059e41c2418ad55a1d8;hp=bf3fb395b7be2b0978626d6c6d6a009b42a08b10;hb=d7c8065be895b67dc453b0e11ad0f259f1ca6706;hpb=10d7d403b74c06dcbf42a132b9712c3817547284 diff --git a/app/assets/javascripts/models/speech.js.coffee b/app/assets/javascripts/models/speech.js.coffee index bf3fb395..20945522 100644 --- a/app/assets/javascripts/models/speech.js.coffee +++ b/app/assets/javascripts/models/speech.js.coffee @@ -1,70 +1,49 @@ -class SpeechBalloon extends Element - @single: () -> +class Pettanr.Speech extends Peta.Element + + @singular: () -> 'Speech' @plural: () -> 'Speeches' - @colum_structures: -> - {} - defaults: { - x: 11 + id: null, + x: 0, + y: 0, + width: 100, + height: 100 } - initialize: () -> - confirm("Welcome to this world") + @trace_routes: () -> + { + speech_balloon: 'speech_balloon', + symbol: ['speech_balloon', 'speech_balloon_template', 'system_picture'] + } + + pick: () -> + # + speech_balloon_template = @templates.speech_balloon_template + writing_format = @templates.writing_format + { + speech_balloon_template_id: speech_balloon_template.get('id'), + speech_balloon_template_module_name: speech_balloon_template.get('module_name'), + writing_format_id: writing_format.get('id'), + writing_format_module_name: writing_format.get('module_name'), + } + + @text_align_texts: () -> + ['left', 'left', 'right', 'center'] + + text_align_text: () -> + Pettanr.Speech.text_align_texts()[@get('text_align')] - @test: () -> - confirm( @single()) - confirm( @plural() ) - confirm( @class_name() ) - confirm( @element_name() ) - confirm( @table_name() ) - confirm( @path_name() ) - confirm( @colum_structures() ) - - has_picture: () -> - true + scenario: () -> + @boosts('read') + @render(@escape('content')) - has_part: () -> - false + plain_scenario: () -> + @escape('content') - extend_column: () -> - null + 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