From 6ad852ac1d4f26aa752a8cbf042a98f9442c23ab Mon Sep 17 00:00:00 2001 From: yasushiito Date: Sun, 1 Sep 2013 19:10:38 +0900 Subject: [PATCH] t#31957:helperize --- app/assets/javascripts/application.js | 2 + app/assets/javascripts/helpers/balloon_r.js.coffee | 116 +++ app/assets/javascripts/helpers/color.js.coffee | 78 ++ .../javascripts/helpers/picture_size.js.coffee | 86 ++ app/assets/javascripts/panels.js.coffee | 965 +++++++++------------ app/assets/javascripts/pettanr_editor.js.coffee | 9 + .../javascripts/speech_balloon_templates.js.coffee | 43 + app/assets/javascripts/writing_formats.js.coffee | 2 +- app/assets/stylesheets/test.css.scss | 10 +- app/helpers/application_helper.rb | 6 + app/views/ground_colors/_form.html.erb | 6 +- app/views/panels/_color_helper.html.erb | 26 +- app/views/panels/_form.html.erb | 19 +- app/views/panels/_tail_angle_helper.html.erb | 2 +- 14 files changed, 791 insertions(+), 579 deletions(-) create mode 100644 app/assets/javascripts/helpers/balloon_r.js.coffee create mode 100644 app/assets/javascripts/helpers/color.js.coffee create mode 100644 app/assets/javascripts/helpers/picture_size.js.coffee create mode 100644 app/assets/javascripts/speech_balloon_templates.js.coffee diff --git a/app/assets/javascripts/application.js b/app/assets/javascripts/application.js index 02486b17..26e94c06 100644 --- a/app/assets/javascripts/application.js +++ b/app/assets/javascripts/application.js @@ -10,5 +10,7 @@ //= require textchange //= require pettanr_editor //= require writing_formats +//= require_directory ./helpers +//= require speech_balloon_templates //= require panels // require_tree . diff --git a/app/assets/javascripts/helpers/balloon_r.js.coffee b/app/assets/javascripts/helpers/balloon_r.js.coffee new file mode 100644 index 00000000..9d26dae9 --- /dev/null +++ b/app/assets/javascripts/helpers/balloon_r.js.coffee @@ -0,0 +1,116 @@ +class PettanrBalloonRHelper + confirm_confirm_confirm = () -> + confirm( ) + @WritingFormat = window.PettanrWritingFormat + + @speech_balloon_tag_id = (element_part) -> + window.PettanrEditor.element_tag_id(element_part) + + @speech_balloon_template_id = (element_part) -> + trace = PettanrBalloonRHelper.speech_balloon_tag_id(element_part) + parseInt($(trace + 'speech_balloon_template_id').val()) + + @template_class = (element_part) -> + id = PettanrBalloonRHelper.speech_balloon_template_id(element_part) + engine_name = window.PettanrSpeechBalloonTemplate.speech_balloon_templates[id] + window.PettanrSpeechBalloonTemplate.scripts[engine_name] + + @settings = (element_part) -> + id = PettanrBalloonRHelper.speech_balloon_template_id(element_part) + window.PettanrSpeechBalloonTemplate.settings(id) + + @r_step = (element_part) -> + settings = PettanrBalloonRHelper.settings(element_part) + settings['speech_balloon']['r_step'] + + @system_picture_id = (element_part, idx) -> + settings = PettanrBalloonRHelper.settings(element_part) + settings[idx]['balloon']['system_picture_id'] + + # balloon r helper + + @balloon_next_index = (input_r, r_step, d) -> + v = parseInt(input_r.val()) + r_step * d + tr = v % 360 + tr = 360 + tr if tr < 0 + offset = r_step / 2.0 + idx = Math.floor(((tr + offset) % 360) / r_step) + if idx == 0 + ir = 0 + else + if v < 0 + ir = Math.floor(idx * r_step) - 360 + else + ir = Math.floor(idx * r_step) + input_r.val(ir) + idx + @balloon_index = (input_r, r_step) -> + v = parseInt(input_r.val()) + tr = v % 360 + tr = 360 + tr if tr < 0 + offset = r_step / 2.0 + idx = Math.floor(((tr + offset) % 360) / r_step) + idx + @refresh_balloon = (balloon_trace, idx) -> + bln = $(balloon_trace) + sp_id = PettanrBalloonRHelper.system_picture_id(bln, idx) + fn = '/system_pictures/' + String(sp_id) + '.png' + ofn = bln.attr('src') + if fn == ofn + else + if bln.attr('src') + bln.attr('src', fn) + $(balloon_trace + 'system_picture_id').val(sp_id) + + @add_helper = (wrapper) -> + editor = window.PettanrEditor + + wrapper.map -> + $(@).css('display', 'block') + + trace = editor.element_part_tag_id(wrapper) + $(trace + 'r').spinner { + spin: ( event, ui ) -> + balloon_trace = editor.element_part_tag_id($(@)) + r_step = PettanrBalloonRHelper.r_step($(@)) + input_r = $(balloon_trace + 'r') + idx = PettanrBalloonRHelper.balloon_index(input_r, r_step) + PettanrBalloonRHelper.refresh_balloon(balloon_trace, idx) + } + + $('.r-down', wrapper).map -> + $(@).click -> + wrapper = $(@).parent() + balloon_trace = editor.element_part_tag_id($(wrapper)) + r_step = PettanrBalloonRHelper.r_step(wrapper) + input_r = $(balloon_trace + 'r') + idx = PettanrBalloonRHelper.balloon_next_index(input_r, r_step, -1) + PettanrBalloonRHelper.refresh_balloon(balloon_trace, idx) + false + $('.r-up', wrapper).map -> + $(@).click -> + wrapper = $(@).parent() + balloon_trace = editor.element_part_tag_id($(wrapper)) + r_step = PettanrBalloonRHelper.r_step(wrapper) + input_r = $(balloon_trace + 'r') + idx = PettanrBalloonRHelper.balloon_next_index(input_r, r_step, 1) + PettanrBalloonRHelper.refresh_balloon(balloon_trace, idx) + false + $('.r-reset', wrapper).map -> + $(@).click -> + wrapper = $(@).parent() + balloon_trace = editor.element_part_tag_id($(wrapper)) + input_r = $(balloon_trace + 'r') + input_r.val(0) + PettanrBalloonRHelper.refresh_balloon(balloon_trace, 0) + false + + # sync view + $(trace + 'r').focusout -> + balloon_trace = editor.element_part_tag_id($(@)) + r_step = PettanrBalloonRHelper.r_step($(@)) + input_r = $(balloon_trace + 'r') + idx = PettanrBalloonRHelper.balloon_index(input_r, r_step) + PettanrBalloonRHelper.refresh_balloon(balloon_trace, idx) + +@PettanrBalloonRHelper = PettanrBalloonRHelper diff --git a/app/assets/javascripts/helpers/color.js.coffee b/app/assets/javascripts/helpers/color.js.coffee new file mode 100644 index 00000000..ec038dba --- /dev/null +++ b/app/assets/javascripts/helpers/color.js.coffee @@ -0,0 +1,78 @@ +class PettanrColorHelper + confirm_confirm_confirm = () -> + confirm( ) + @WritingFormat = window.PettanrWritingFormat + + @color_slider_change = (trace) -> + red = $(trace + 'code_red').slider('value') + green = $(trace + 'code_green').slider('value') + blue = $(trace + 'code_blue').slider('value') + code = (red << 16) + (green << 8) + (blue) + phex = "000000" + code.toString(16) + hex = code.toString(16) + h = phex.substring(phex.length - 6) + $(trace + 'code_swatch').css('background-color', '#' + h) + $(trace + 'code_hex').html('HEX: #' + h) + $(trace + 'code_rgb').html('RGB: (' + red + ',' + green + ',' +blue + ')') + v = '#' + h + if $(trace).attr('element_type') == 'ground_color' + $(trace + 'code').val(code) + $(trace).css('background-color', v) + else + $(trace + 'fore_color').val(code) + $(trace).css('color', v) + + @add_helper = (wrapper, column) -> + editor = window.PettanrEditor + wrapper.map -> + $(@).css('display', 'block') + + $('.colorpicker', wrapper).map -> + if editor.is_element_part($(@)) + code_picker_trace = editor.element_part_tag_id($(@)) + else + code_picker_trace = editor.element_tag_id($(@)) + code = parseInt($(code_picker_trace + column).val()) + red = (code >> 16) & 0xFF + green = (code >> 8) & 0xFF + blue = code & 0xFF + $(code_picker_trace + 'code_red').slider { + orientation: 'horizontal', + range: 'min', + max: 255, + value: red, + change: ( event, ui ) -> + if editor.is_element_part($(@).parent()) + trace = editor.element_part_tag_id($(@).parent()) + else + trace = editor.element_tag_id($(@).parent()) + PettanrColorHelper.color_slider_change(trace) + } + $(code_picker_trace + 'code_green').slider { + orientation: 'horizontal', + range: 'min', + max: 255, + value: green, + change: ( event, ui ) -> + if editor.is_element_part($(@).parent()) + trace = editor.element_part_tag_id($(@).parent()) + else + trace = editor.element_tag_id($(@).parent()) + PettanrColorHelper.color_slider_change(trace) + } + $(code_picker_trace + 'code_blue').slider { + orientation: 'horizontal', + range: 'min', + max: 255, + value: blue, + change: ( event, ui ) -> + if editor.is_element_part($(@).parent()) + trace = editor.element_part_tag_id($(@).parent()) + else + trace = editor.element_tag_id($(@).parent()) + PettanrColorHelper.color_slider_change(trace) + } + PettanrColorHelper.color_slider_change(code_picker_trace) + + +@PettanrColorHelper = PettanrColorHelper diff --git a/app/assets/javascripts/helpers/picture_size.js.coffee b/app/assets/javascripts/helpers/picture_size.js.coffee new file mode 100644 index 00000000..ba7b7648 --- /dev/null +++ b/app/assets/javascripts/helpers/picture_size.js.coffee @@ -0,0 +1,86 @@ +class PettanrPictureSizeHelper + confirm_confirm_confirm = () -> + confirm( ) + @WritingFormat = window.PettanrWritingFormat + + @refresh_picture = (e, w, h) -> + if w and h + sd = '' + if h < 0 + sd += 'v' + if w < 0 + sd += 'h' + if sd.length > 0 + sd += '/' + pid = parseInt(e.attr('picture_id')).toString() + ext = e.attr('ext') + src = '/pictures/' + sd + pid + '.' + ext + e.attr('src', src) + + @add_helper = () -> + editor = window.PettanrEditor + $('.panel_picture_width_tool').map -> + $(@).html('') + $('.panel_picture_height_tool').map -> + $(@).html('') + + $('.wreverse').click -> + d = $(@).parent() + trace = editor.element_tag_id(d) + f = $(trace + 'width') + w = -f.val() + f.val(w) + f = $(trace + 'height') + h = f.val() + PettanrPictureSizeHelper.refresh_picture($(trace + 'img'), w, h) + + $('.wdouble').click -> + d = $(@).parent() + trace = editor.element_tag_id(d) + f = $(trace + 'width') + w = f.val() * 2 + f.val(w) + $(trace + 'img').width(Math.abs(w)) + $(trace + 'img').parent().width(Math.abs(w)) + + $('.whalf').click -> + d = $(@).parent() + trace = editor.element_tag_id(d) + f = $(trace + 'width') + w = Math.floor(f.val() / 2) + f.val(w) + $(trace + 'img').width(Math.abs(w)) + $(trace + 'img').parent().width(Math.abs(w)) + + + $('.hreverse').click -> + d = $(@).parent() + trace = editor.element_tag_id(d) + f = $(trace + 'height') + h = -f.val() + f.val(h) + f = $(trace + 'width') + w = f.val() + PettanrPictureSizeHelper.refresh_picture($(trace + 'img'), w, h) + + $('.hdouble').click -> + d = $(@).parent() + trace = editor.element_tag_id(d) + f = $(trace + 'height') + h = f.val() * 2 + f.val(h) + $(trace + 'img').height(Math.abs(h)) + $(trace + 'img').parent().height(Math.abs(h)) + + $('.hhalf').click -> + d = $(@).parent() + trace = editor.element_tag_id(d) + f = $(trace + 'height') + h = Math.floor(f.val() / 2) + f.val(h) + $(trace + 'img').height(Math.abs(h)) + $(trace + 'img').parent().height(Math.abs(h)) + + + +@PettanrPictureSizeHelper = PettanrPictureSizeHelper diff --git a/app/assets/javascripts/panels.js.coffee b/app/assets/javascripts/panels.js.coffee index 43ae19d4..b32283ff 100644 --- a/app/assets/javascripts/panels.js.coffee +++ b/app/assets/javascripts/panels.js.coffee @@ -4,574 +4,443 @@ $ -> editor = window.PettanrEditor WritingFormat = window.PettanrWritingFormat WritingFormat.load($('#writing_formats')) + SpeechBalloonTemplate = window.PettanrSpeechBalloonTemplate + SpeechBalloonTemplate.load($('#speech_balloon_templates')) + for n, v of SpeechBalloonTemplate.scripts + v.onLoad() + v.add_helper( n, '' ) + PictureSizeHelper = window.PettanrPictureSizeHelper + ColorHelper = window.PettanrColorHelper $('.panel-editor').map -> if $(@).attr('current') and parseInt($(@).attr('current')) > 0 editor.pettanr_current_panel_id = parseInt($(@).attr('panel_id')) - $('#tabs').tabs() - $('#elements-tabs').tabs() - $('#new-element-tabs').tabs() - $('#new-speech_balloon-tabs').tabs() - $('#elements-tabs').addClass( "ui-tabs-vertical ui-helper-clearfix" ) - $("#elements-tabs li").removeClass("ui-corner-top") - $("#elements-tabs li").addClass("ui-corner-left") - $("#elements-tabs li").map -> - $(@).mouseover -> - switch $(@).attr('element_type') - when 'speech_balloon' - trace = editor.element_tag_id($(@)) - t = $('img', $(trace)) - when 'panel_picture' - trace = editor.element_tag_id($(@)) + 'img' - t = $(trace) - else - t = null - if t - $('.ui-resizable-handle', t.parent()).map -> - $(@).css('display', 'block') - $(@).mouseout -> - switch $(@).attr('element_type') - when 'speech_balloon' - trace = editor.element_tag_id($(@)) - t = $('img', $(trace)) - when 'panel_picture' - trace = editor.element_tag_id($(@)) + 'img' - t = $(trace) - else - t = null - if t - $('.ui-resizable-handle', t.parent()).map -> - $(@).css('display', 'none') - - #destroy button - $('.ui-icon-destroy').map -> - $(@).button { - icons: { - primary: 'ui-icon-close', - secondary: null - }, - text: false - } - $(@).click -> - if confirm('destroy ?') - trace = editor.element_tag_id($(@)) - $(trace + '_destroy').val('true') - panel_trace = editor.panel_tag_id($(@)) - update_t(panel_trace + 'tsort') - update_z(panel_trace + 'zsort') - # sync - $(trace + 'element_tab').css('display', 'none') - $(trace + 'tab_panel').css('display', 'none') - $(trace + 'zsort').css('display', 'none') - $(trace + 'tsort').css('display', 'none') + if editor.is_editting() + $('#tabs').tabs() + $('#elements-tabs').tabs() + $('#new-element-tabs').tabs() + $('#new-speech_balloon-tabs').tabs() + $('#elements-tabs').addClass( "ui-tabs-vertical ui-helper-clearfix" ) + $("#elements-tabs li").removeClass("ui-corner-top") + $("#elements-tabs li").addClass("ui-corner-left") + $("#elements-tabs li").map -> + $(@).mouseover -> switch $(@).attr('element_type') + when 'speech_balloon' + trace = editor.element_tag_id($(@)) + t = $('img', $(trace)) when 'panel_picture' - trace = trace + 'div' - $(trace).css('display', 'none') - - - $('#pettanr-panel-submit').focusin -> - editor.refresh_attribute($('#pettanr-panel-json')) - - # panel - $('.pettanr-comic-panel').map -> - if editor.is_editable($(@)) + trace = editor.element_tag_id($(@)) + 'img' + t = $(trace) + else + t = null + if t + $('.ui-resizable-handle', t.parent()).map -> + $(@).css('display', 'block') + $(@).mouseout -> + switch $(@).attr('element_type') + when 'speech_balloon' + trace = editor.element_tag_id($(@)) + t = $('img', $(trace)) + when 'panel_picture' + trace = editor.element_tag_id($(@)) + 'img' + t = $(trace) + else + t = null + if t + $('.ui-resizable-handle', t.parent()).map -> + $(@).css('display', 'none') + + #destroy button + $('.ui-icon-destroy').map -> + $(@).button { + icons: { + primary: 'ui-icon-close', + secondary: null + }, + text: false + } + $(@).click -> + if confirm('destroy ?') + trace = editor.element_tag_id($(@)) + $(trace + '_destroy').val('true') + panel_trace = editor.panel_tag_id($(@)) + update_t(panel_trace + 'tsort') + update_z(panel_trace + 'zsort') + # sync + $(trace + 'element_tab').css('display', 'none') + $(trace + 'tab_panel').css('display', 'none') + $(trace + 'zsort').css('display', 'none') + $(trace + 'tsort').css('display', 'none') + switch $(@).attr('element_type') + when 'panel_picture' + trace = trace + 'div' + $(trace).css('display', 'none') + + + $('#pettanr-panel-submit').focusin -> + editor.refresh_attribute($('#pettanr-panel-json')) + + # panel + $('.pettanr-comic-panel').map -> + if editor.is_editable($(@)) + $(@).resizable { + stop: ( event, ui ) -> + trace = editor.panel_tag_id($(@)) + w = parseInt($(@).width()) + h = parseInt($(@).height()) + $(trace + 'width').val(w) + $(trace + 'height').val(h) + $('.pettanr-comic-ground-picture').map -> + $(@).width(w) + $(@).height(h) + $('.pettanr-comic-ground-color').map -> + $(@).width(w) + $(@).height(h) + , autoHide: true + } + + # sync view + $('input').map -> + if $(@).attr('element_type') + else + if $(@).attr('panel_id') + $(@).focusout -> + switch $(@).attr('column') + when 'width' + trace = editor.panel_tag_id($(@)) + $(trace).width(parseInt( $(@).val())) + when 'height' + trace = editor.panel_tag_id($(@)) + $(trace).height(parseInt( $(@).val())) + when 'border' + trace = editor.panel_tag_id($(@)) + $(trace).css('border-width', parseInt($(@).val()).toString() + 'px') + + # panel picture + PictureSizeHelper.add_helper() + + $('.pettanr-panel-picture-wrapper').map -> + $(@).draggable { + stop: ( event, ui ) -> + trace = editor.element_tag_id($(@)) + img = $(trace + 'img') + left = img.parent().position().left + $(@).position().left + top = img.parent().position().top + $(@).position().top + $(trace + 'x').val(parseInt(left)) + $(trace + 'y').val(parseInt(top)) + } + + $('.panel-picture').map -> $(@).resizable { stop: ( event, ui ) -> - trace = editor.panel_tag_id($(@)) - w = parseInt($(@).width()) - h = parseInt($(@).height()) + resize_div = $(@) + panel_picture_div = resize_div.parent() + trace = editor.element_tag_id(panel_picture_div) + + resize_div.css('top', '0px') + resize_div.css('left', '0px') + if ui.originalPosition.top != ui.position.top + t = panel_picture_div.position().top + ui.position.top + $(trace + 'y').val(Math.floor(t)) + panel_picture_div.css('top', t.toString() + 'px') + if ui.originalPosition.left != ui.position.left + l = panel_picture_div.position().left + ui.position.left + $(trace + 'x').val(Math.floor(l)) + panel_picture_div.css('left', l.toString() + 'px') + w = if $(trace + 'width').val() < 0 + -ui.size.width + else + ui.size.width + h = if $(trace + 'height').val() < 0 + -ui.size.height + else + ui.size.height $(trace + 'width').val(w) $(trace + 'height').val(h) - $('.pettanr-comic-ground-picture').map -> - $(@).width(w) - $(@).height(h) - $('.pettanr-comic-ground-color').map -> - $(@).width(w) - $(@).height(h) - , autoHide: true + resize: ( event, ui ) -> + resize_div = $(@) + panel_picture_div = resize_div.parent() + trace = editor.element_tag_id(panel_picture_div) + handles: 'all', + autoHide: true } - - # sync view - $('input').map -> - if $(@).attr('element_type') - else - if $(@).attr('panel_id') + + # sync view + $('input').map -> + if editor.element_is('panel_picture', $(@)) $(@).focusout -> switch $(@).attr('column') + when 'x' + trace = editor.element_tag_id($(@)) + 'div' + v = parseInt($(@).val()).toString() + 'px' + $(trace).css('left', v) + when 'y' + trace = editor.element_tag_id($(@)) + 'div' + v = parseInt($(@).val()).toString() + 'px' + $(trace).css('top', v) when 'width' - trace = editor.panel_tag_id($(@)) - $(trace).width(parseInt( $(@).val())) + trace = editor.element_tag_id($(@)) + 'img' + w = parseInt($(@).val()) + $(trace).width(Math.abs(w)) + $(trace).parent().width(Math.abs(w)) + h = parseInt($(editor.element_tag_id($(@)) + 'height').val()) when 'height' - trace = editor.panel_tag_id($(@)) - $(trace).height(parseInt( $(@).val())) - when 'border' - trace = editor.panel_tag_id($(@)) - $(trace).css('border-width', parseInt($(@).val()).toString() + 'px') - - # panel picture - $('.pettanr-panel-picture-wrapper').map -> - $(@).draggable { - stop: ( event, ui ) -> - trace = editor.element_tag_id($(@)) - img = $(trace + 'img') - left = img.parent().position().left + $(@).position().left - top = img.parent().position().top + $(@).position().top - $(trace + 'x').val(parseInt(left)) - $(trace + 'y').val(parseInt(top)) - } - - $('.panel-picture').map -> - $(@).resizable { - stop: ( event, ui ) -> - resize_div = $(@) - panel_picture_div = resize_div.parent() - trace = editor.element_tag_id(panel_picture_div) - - resize_div.css('top', '0px') - resize_div.css('left', '0px') - if ui.originalPosition.top != ui.position.top - t = panel_picture_div.position().top + ui.position.top - $(trace + 'y').val(Math.floor(t)) - panel_picture_div.css('top', t.toString() + 'px') - if ui.originalPosition.left != ui.position.left - l = panel_picture_div.position().left + ui.position.left - $(trace + 'x').val(Math.floor(l)) - panel_picture_div.css('left', l.toString() + 'px') - w = if $(trace + 'width').val() < 0 - -ui.size.width - else - ui.size.width - h = if $(trace + 'height').val() < 0 - -ui.size.height - else - ui.size.height - $(trace + 'width').val(w) - $(trace + 'height').val(h) - resize: ( event, ui ) -> - resize_div = $(@) - panel_picture_div = resize_div.parent() - trace = editor.element_tag_id(panel_picture_div) - handles: 'all', - autoHide: true - } - - refresh_picture = (e, w, h) -> - if w and h - sd = '' - if h < 0 - sd += 'v' - if w < 0 - sd += 'h' - if sd.length > 0 - sd += '/' - pid = parseInt(e.attr('picture_id')).toString() - ext = e.attr('ext') - src = '/pictures/' + sd + pid + '.' + ext - e.attr('src', src) - - # sync view - $('input').map -> - if editor.element_is('panel_picture', $(@)) - $(@).focusout -> - switch $(@).attr('column') - when 'x' - trace = editor.element_tag_id($(@)) + 'div' - v = parseInt($(@).val()).toString() + 'px' - $(trace).css('left', v) - when 'y' - trace = editor.element_tag_id($(@)) + 'div' - v = parseInt($(@).val()).toString() + 'px' - $(trace).css('top', v) - when 'width' - trace = editor.element_tag_id($(@)) + 'img' - w = parseInt($(@).val()) - $(trace).width(Math.abs(w)) - $(trace).parent().width(Math.abs(w)) - h = parseInt($(editor.element_tag_id($(@)) + 'height').val()) - when 'height' - trace = editor.element_tag_id($(@)) + 'img' - h = parseInt($(@).val()) - $(trace).height(Math.abs(h)) - $(trace).parent().height(Math.abs(h)) - w = parseInt($(editor.element_tag_id($(@)) + 'width').val()) - else - refresh_picture($(trace), w, h) - else - - # speech_balloons - $('.pettanr-comic-balloon' ).map -> - $(@).draggable { - stop: ( event, ui ) -> - balloon = $('.pettanr-balloon', $(@)) - trace = editor.element_part_tag_id(balloon) - left = $(@).position().left - top = $(@).position().top - $(trace + 'x').val(parseInt(left)) - $(trace + 'y').val(parseInt(top)) - } - - $('.pettanr-balloon' ).map -> - $(@).resizable { - stop: ( event, ui ) -> - resize_div = $(@) - speech_balloon_div = resize_div.parent() - balloon = $('.pettanr-balloon', $(@)) - trace = editor.element_tag_id(speech_balloon_div) - trace_balloon = editor.element_part_tag_id(balloon) - - resize_div.css('top', '0px') - resize_div.css('left', '0px') - w = ui.size.width - h = ui.size.height - if ui.originalPosition.top != ui.position.top - t = speech_balloon_div.position().top + ui.position.top - $(trace_balloon + 'y').val(Math.floor(t)) - speech_balloon_div.css('top', t.toString() + 'px') - speech_balloon_div.css('height', h + 'px') - if ui.originalPosition.left != ui.position.left - l = speech_balloon_div.position().left + ui.position.left - $(trace_balloon + 'x').val(Math.floor(l)) - speech_balloon_div.css('left', l.toString() + 'px') - speech_balloon_div.css('width', w + 'px') - $(trace_balloon + 'width').val(w) - $(trace_balloon + 'height').val(h) - speech_balloon_div.css('width', w.toString() + 'px') - speech_balloon_div.css('height', h.toString() + 'px') - resize: ( event, ui ) -> - resize_div = $(@) - speech_balloon_div = resize_div.parent() - balloon = $('.pettanr-balloon', $(@)) - trace = editor.element_tag_id(speech_balloon_div) - trace_balloon = editor.element_part_tag_id(balloon) - handles: 'all', - autoHide: true - } - - $('.pettanr-comic-speech-inner' ).map -> - $(@).mouseover -> - outer = $(@).parent() - sb = outer.parent() - trace = editor.element_tag_id(sb) - img = $('.pettanr-balloon', $(trace)) - $('.ui-resizable-handle', img.parent()).map -> - $(@).css('display', 'block') - $(@).mouseout -> - outer = $(@).parent() - sb = outer.parent() - trace = editor.element_tag_id(sb) - img = $('.pettanr-balloon', $(trace)) - $('.ui-resizable-handle', img.parent()).map -> - $(@).css('display', 'none') - - - # sync view - $('input').map -> - if editor.element_is('speech_balloon', $(@)) - $(@).focusout -> - switch $(@).attr('column') - when 'x' - trace = editor.element_tag_id($(@)) - v = parseInt($(@).val()).toString() + 'px' - $(trace).css('left', v) - when 'y' - trace = editor.element_tag_id($(@)) - v = parseInt($(@).val()).toString() + 'px' - $(trace).css('top', v) - when 'width' - trace = editor.element_tag_id($(@)) - v = parseInt($(@).val()) - $(trace).width(Math.abs(v)) - img = $('.pettanr-balloon', $(trace)) - img.parent().width(v) - img.width(v) - when 'height' - trace = editor.element_tag_id($(@)) - v = parseInt($(@).val()) - $(trace).height(Math.abs(v)) - img = $('.pettanr-balloon', $(trace)) - img.parent().height(v) - img.height(v) - else - else - $('textarea').map -> - if editor.element_is('speech_balloon', $(@)) - $(@).focusout -> + trace = editor.element_tag_id($(@)) + 'img' + h = parseInt($(@).val()) + $(trace).height(Math.abs(h)) + $(trace).parent().height(Math.abs(h)) + w = parseInt($(editor.element_tag_id($(@)) + 'width').val()) + else + PictureSizeHelper.refresh_picture($(trace), w, h) + else + + # speech_balloons + ColorHelper.add_helper($('.speech-fore_color-wrap'), 'fore_color') + + $('.pettanr-comic-balloon' ).map -> + $(@).draggable { + stop: ( event, ui ) -> + balloon = $('.pettanr-balloon', $(@)) + trace = editor.element_part_tag_id(balloon) + left = $(@).position().left + top = $(@).position().top + $(trace + 'x').val(parseInt(left)) + $(trace + 'y').val(parseInt(top)) + } + + $('.pettanr-balloon' ).map -> + $(@).resizable { + stop: ( event, ui ) -> + resize_div = $(@) + speech_balloon_div = resize_div.parent() + balloon = $('.pettanr-balloon', $(@)) + trace = editor.element_tag_id(speech_balloon_div) + trace_balloon = editor.element_part_tag_id(balloon) + + resize_div.css('top', '0px') + resize_div.css('left', '0px') + w = ui.size.width + h = ui.size.height + if ui.originalPosition.top != ui.position.top + t = speech_balloon_div.position().top + ui.position.top + $(trace_balloon + 'y').val(Math.floor(t)) + speech_balloon_div.css('top', t.toString() + 'px') + speech_balloon_div.css('height', h + 'px') + if ui.originalPosition.left != ui.position.left + l = speech_balloon_div.position().left + ui.position.left + $(trace_balloon + 'x').val(Math.floor(l)) + speech_balloon_div.css('left', l.toString() + 'px') + speech_balloon_div.css('width', w + 'px') + $(trace_balloon + 'width').val(w) + $(trace_balloon + 'height').val(h) + speech_balloon_div.css('width', w.toString() + 'px') + speech_balloon_div.css('height', h.toString() + 'px') + resize: ( event, ui ) -> + resize_div = $(@) + speech_balloon_div = resize_div.parent() + balloon = $('.pettanr-balloon', $(@)) + trace = editor.element_tag_id(speech_balloon_div) + trace_balloon = editor.element_part_tag_id(balloon) + handles: 'all', + autoHide: true + } + + $('.pettanr-comic-speech-inner' ).map -> + $(@).mouseover -> + outer = $(@).parent() + sb = outer.parent() + trace = editor.element_tag_id(sb) + img = $('.pettanr-balloon', $(trace)) + $('.ui-resizable-handle', img.parent()).map -> + $(@).css('display', 'block') + $(@).mouseout -> + outer = $(@).parent() + sb = outer.parent() + trace = editor.element_tag_id(sb) + img = $('.pettanr-balloon', $(trace)) + $('.ui-resizable-handle', img.parent()).map -> + $(@).css('display', 'none') + + + # sync view + $('input').map -> + if editor.element_is('speech_balloon', $(@)) + $(@).focusout -> + switch $(@).attr('column') + when 'x' + trace = editor.element_tag_id($(@)) + v = parseInt($(@).val()).toString() + 'px' + $(trace).css('left', v) + when 'y' + trace = editor.element_tag_id($(@)) + v = parseInt($(@).val()).toString() + 'px' + $(trace).css('top', v) + when 'width' + trace = editor.element_tag_id($(@)) + v = parseInt($(@).val()) + $(trace).width(Math.abs(v)) + img = $('.pettanr-balloon', $(trace)) + img.parent().width(v) + img.width(v) + when 'height' + trace = editor.element_tag_id($(@)) + v = parseInt($(@).val()) + $(trace).height(Math.abs(v)) + img = $('.pettanr-balloon', $(trace)) + img.parent().height(v) + img.height(v) + else + else + $('textarea').map -> + if editor.element_is('speech_balloon', $(@)) + $(@).focusout -> + switch $(@).attr('column') + when 'content' + trace = editor.element_part_tag_id($(@)) + wf_sel = $(trace + 'writing_format_id') + wf_id = parseInt(wf_sel.val()) + v = WritingFormat.render(wf_id, $(@).val()) + $(trace).html(v) + $('textarea').map -> + if editor.element_is('speech_balloon', $(@)) switch $(@).attr('column') when 'content' - trace = editor.element_part_tag_id($(@)) - wf_sel = $(trace + 'writing_format_id') - wf_id = parseInt(wf_sel.val()) - v = WritingFormat.render(wf_id, $(@).val()) - $(trace).html(v) - $('textarea').map -> - if editor.element_is('speech_balloon', $(@)) - switch $(@).attr('column') - when 'content' - $(@).bind('textchange', (event, previousText) -> - trace = editor.element_part_tag_id($(@)) - wf_sel = $(trace + 'writing_format_id') - wf_id = parseInt(wf_sel.val()) - v = WritingFormat.render(wf_id, $(@).val()) - $(trace).html(v) - ) - $('select').map -> - if editor.element_is('speech_balloon', $(@)) - $(@).change -> - switch $(@).attr('column') - when 'font_size' - trace = editor.element_part_tag_id($(@)) - $(trace).css('font-size', $(@).val() + 'em') - when 'text_align' - trace = editor.element_part_tag_id($(@)) - v = parseInt($(@).val()) - $(trace).css('text-align', text_align_texts[v]) - else - $('input').map -> - if editor.element_is('speech_balloon', $(@)) - if $(@).attr('column') == 'fore_color' - $(@).hide() + $(@).bind('textchange', (event, previousText) -> + trace = editor.element_part_tag_id($(@)) + wf_sel = $(trace + 'writing_format_id') + wf_id = parseInt(wf_sel.val()) + v = WritingFormat.render(wf_id, $(@).val()) + $(trace).html(v) + ) + $('select').map -> + if editor.element_is('speech_balloon', $(@)) + $(@).change -> + switch $(@).attr('column') + when 'font_size' + trace = editor.element_part_tag_id($(@)) + $(trace).css('font-size', $(@).val() + 'em') + when 'text_align' + trace = editor.element_part_tag_id($(@)) + v = parseInt($(@).val()) + $(trace).css('text-align', text_align_texts[v]) + else + $('input').map -> + if editor.element_is('speech_balloon', $(@)) + if $(@).attr('column') == 'fore_color' + $(@).hide() - - # ground-picture - # sync view - $('input').map -> - if editor.element_is('ground_picture', $(@)) - $(@).focusout -> - switch $(@).attr('column') - when 'x', 'y' - trace = editor.element_tag_id($(@)) - x = parseInt($(trace + 'x').val()).toString() + 'px' - y = parseInt($(trace + 'y').val()).toString() + 'px' - $(trace).css('background-position', x + ' ' + y) - $('select').map -> - if editor.element_is('ground_picture', $(@)) - $(@).change -> - switch $(@).attr('column') - when 'repeat' - trace = editor.element_tag_id($(@)) - v = parseInt($(@).val()) - $(trace).css('background-repeat', repeat_texts[v]) - else - - - # ground_color - # sync view - $('input').map -> - if editor.element_is('ground_color', $(@)) - if $(@).attr('column') == 'code' - $(@).hide() + + # ground-picture + # sync view + $('input').map -> + if editor.element_is('ground_picture', $(@)) + $(@).focusout -> + switch $(@).attr('column') + when 'x', 'y' + trace = editor.element_tag_id($(@)) + x = parseInt($(trace + 'x').val()).toString() + 'px' + y = parseInt($(trace + 'y').val()).toString() + 'px' + $(trace).css('background-position', x + ' ' + y) + $('select').map -> + if editor.element_is('ground_picture', $(@)) + $(@).change -> + switch $(@).attr('column') + when 'repeat' + trace = editor.element_tag_id($(@)) + v = parseInt($(@).val()) + $(trace).css('background-repeat', repeat_texts[v]) + else + + + # ground_color + ColorHelper.add_helper($('.ground_color-code-wrap'), 'code') + + # sync view + $('input').map -> + if editor.element_is('ground_color', $(@)) + if $(@).attr('column') == 'code' + $(@).hide() - color_slider_change = (trace) -> - red = $(trace + 'code_red').slider('value') - green = $(trace + 'code_green').slider('value') - blue = $(trace + 'code_blue').slider('value') - code = (red << 16) + (green << 8) + (blue) - phex = "000000" + code.toString(16) - hex = code.toString(16) - h = phex.substring(phex.length - 6) - $(trace + 'code_swatch').css('background-color', '#' + h) - $(trace + 'code_hex').html('HEX: #' + h) - $(trace + 'code_rgb').html('RGB: (' + red + ',' + green + ',' +blue + ')') - v = '#' + h - if $(trace).attr('element_type') == 'ground_color' - $(trace + 'code').val(code) - $(trace).css('background-color', v) - else - $(trace + 'fore_color').val(code) - $(trace).css('color', v) - - $('.colorpicker').map -> - if editor.is_element_part($(@)) - code_picker_trace = editor.element_part_tag_id($(@)) - code = parseInt($(code_picker_trace + 'fore_color').val()) - else - code_picker_trace = editor.element_tag_id($(@)) - code = parseInt($(code_picker_trace + 'code').val()) - red = (code >> 16) & 0xFF - green = (code >> 8) & 0xFF - blue = code & 0xFF - $(code_picker_trace + 'code_red').slider { - orientation: 'horizontal', - range: 'min', - max: 255, - value: red, - change: ( event, ui ) -> - if editor.is_element_part($(@).parent()) - trace = editor.element_part_tag_id($(@).parent()) - else - trace = editor.element_tag_id($(@).parent()) - color_slider_change(trace) - } - $(code_picker_trace + 'code_green').slider { - orientation: 'horizontal', - range: 'min', - max: 255, - value: green, - change: ( event, ui ) -> - if editor.is_element_part($(@).parent()) - trace = editor.element_part_tag_id($(@).parent()) + update_t = (ultrace) -> + t = 0 + $(ultrace + ' li').map -> + trace = editor.element_tag_id($(@)) + if $(trace + '_destroy').val().length < 1 + $(trace + 't').val(t) + t++ else - trace = editor.element_tag_id($(@).parent()) - color_slider_change(trace) - } - $(code_picker_trace + 'code_blue').slider { - orientation: 'horizontal', - range: 'min', - max: 255, - value: blue, - change: ( event, ui ) -> - if editor.is_element_part($(@).parent()) - trace = editor.element_part_tag_id($(@).parent()) + + $('.tsort').map -> + $(@).sortable { + update: ( event, ui ) -> + trace = editor.panel_tag_id($(@)) + update_t(trace + 'tsort') + } + $('.t-sort li').map -> + $(@).disableSelection() + + update_z = (ultrace) -> + z = 1 + $(ultrace + ' li').map -> + trace = editor.element_tag_id($(@)) + # update panel + if $(trace + '_destroy').val().length < 1 + $(trace + 'z').val(z) + switch $(@).attr('element_type') + when 'panel_picture' + trace = trace + 'div' + $(trace).css('zIndex', z) + z++ else - trace = editor.element_tag_id($(@).parent()) - color_slider_change(trace) - } - color_slider_change(code_picker_trace) - $('.colorpicker-wrap').map -> - $(@).css('display', 'block') - - update_t = (ultrace) -> - t = 0 - $(ultrace + ' li').map -> - trace = editor.element_tag_id($(@)) - if $(trace + '_destroy').val().length < 1 - $(trace + 't').val(t) - t++ - else - - $('.tsort').map -> - $(@).sortable { - update: ( event, ui ) -> - trace = editor.panel_tag_id($(@)) - update_t(trace + 'tsort') - } - $('.t-sort li').map -> - $(@).disableSelection() - - update_z = (ultrace) -> - z = 1 - $(ultrace + ' li').map -> - trace = editor.element_tag_id($(@)) - # update panel - if $(trace + '_destroy').val().length < 1 - $(trace + 'z').val(z) - switch $(@).attr('element_type') - when 'panel_picture' - trace = trace + 'div' - $(trace).css('zIndex', z) - z++ - else - - $('.zsort').map -> - $(@).sortable { - update: ( event, ui ) -> - trace = editor.panel_tag_id($(@)) - update_z(trace + 'zsort') - } - $('.z-sort li').map -> - $(@).disableSelection() - - $('.panel_picture_width_tool').map -> - $(@).html('') - - $('.wreverse').click -> - d = $(@).parent() - trace = editor.element_tag_id(d) - f = $(trace + 'width') - w = -f.val() - f.val(w) - f = $(trace + 'height') - h = f.val() - refresh_picture($(trace + 'img'), w, h) - - $('.wdouble').click -> - d = $(@).parent() - trace = editor.element_tag_id(d) - f = $(trace + 'width') - w = f.val() * 2 - f.val(w) - $(trace + 'img').width(Math.abs(w)) - $(trace + 'img').parent().width(Math.abs(w)) - - $('.whalf').click -> - d = $(@).parent() - trace = editor.element_tag_id(d) - f = $(trace + 'width') - w = Math.floor(f.val() / 2) - f.val(w) - $(trace + 'img').width(Math.abs(w)) - $(trace + 'img').parent().width(Math.abs(w)) - - $('.panel_picture_height_tool').map -> - $(@).html('') - - $('.hreverse').click -> - d = $(@).parent() - trace = editor.element_tag_id(d) - f = $(trace + 'height') - h = -f.val() - f.val(h) - f = $(trace + 'width') - w = f.val() - refresh_picture($(trace + 'img'), w, h) - - $('.hdouble').click -> - d = $(@).parent() - trace = editor.element_tag_id(d) - f = $(trace + 'height') - h = f.val() * 2 - f.val(h) - $(trace + 'img').height(Math.abs(h)) - $(trace + 'img').parent().height(Math.abs(h)) - - $('.hhalf').click -> - d = $(@).parent() - trace = editor.element_tag_id(d) - f = $(trace + 'height') - h = Math.floor(f.val() / 2) - f.val(h) - $(trace + 'img').height(Math.abs(h)) - $(trace + 'img').parent().height(Math.abs(h)) - - # all - # disable form actions - # hide submit buttons - $('.edit_panel_picture' ).map -> - $(@).submit -> - false - $('.edit_speech_balloon' ).map -> - $(@).submit -> - false - $('.edit_ground_picture' ).map -> - $(@).submit -> - false - $('.edit_ground_color' ).map -> - $(@).submit -> - false - - $('.edit_panel' ).map -> - if $(@).attr('jqform') - else + + $('.zsort').map -> + $(@).sortable { + update: ( event, ui ) -> + trace = editor.panel_tag_id($(@)) + update_z(trace + 'zsort') + } + $('.z-sort li').map -> + $(@).disableSelection() + + # all + # disable form actions + # hide submit buttons + $('.edit_panel_picture' ).map -> $(@).submit -> false - - $('.submit' ).map -> - $(@).hide() - - # disable form z t - $('input').map -> - if editor.is_element($(@)) - switch $(@).attr('column') - when 'z' , 't' - $(@).hide() - $(@).parent().hide() #label - - # add button on new form - $('.submit-new-form').map -> - $(@).html('') - - $('.new-element').map -> - $(@).click -> - false - + $('.edit_speech_balloon' ).map -> + $(@).submit -> + false + $('.edit_ground_picture' ).map -> + $(@).submit -> + false + $('.edit_ground_color' ).map -> + $(@).submit -> + false + + $('.edit_panel' ).map -> + if $(@).attr('jqform') + else + $(@).submit -> + false + + $('.submit' ).map -> + $(@).hide() + + # disable form z t + $('input').map -> + if editor.is_element($(@)) + switch $(@).attr('column') + when 'z' , 't' + $(@).hide() + $(@).parent().hide() #label + + # add button on new form + $('.submit-new-form').map -> + $(@).html('') + + $('.new-element').map -> + $(@).click -> + false + diff --git a/app/assets/javascripts/pettanr_editor.js.coffee b/app/assets/javascripts/pettanr_editor.js.coffee index 836d49bf..24aef1f5 100644 --- a/app/assets/javascripts/pettanr_editor.js.coffee +++ b/app/assets/javascripts/pettanr_editor.js.coffee @@ -4,6 +4,9 @@ class PettanrEditor @new_element_index = {} @new_element_index[PettanrEditor.pettanr_current_panel_id] = 0 + @current_panel = () -> + $('#panel' + PettanrEditor.pettanr_current_panel_id.toString()) + @set_tree_value = (keys, last_attr, value) -> key = keys.shift() if keys.length <= 0 @@ -14,6 +17,12 @@ class PettanrEditor @repeat_texts = ['repeat', 'repeat-x', 'repeat-y', 'no-repeat'] + @is_editting = () -> + trace = '#panel' + PettanrEditor.pettanr_current_panel_id.toString() + 'wrapper' + if $(trace) and $(trace).attr('editable') + return true + else + return false @is_editable = (p) -> if p.parent().attr('editable') return true diff --git a/app/assets/javascripts/speech_balloon_templates.js.coffee b/app/assets/javascripts/speech_balloon_templates.js.coffee new file mode 100644 index 00000000..05c8809e --- /dev/null +++ b/app/assets/javascripts/speech_balloon_templates.js.coffee @@ -0,0 +1,43 @@ +class PettanrSpeechBalloonTemplate + #keys: speech_balloon_template_id + #values: engine_name + @speech_balloon_templates = {} + + #keys engine_name :ex. 'circle_speech_balloon' + #values: SpeechBalloon class :ex.PettanrCircleSpeechBalloon + @scripts = {} + + #keys engine_name :ex. 'circle_speech_balloon' + #values: speech_balloon_template_id + @engine_names = {} + + @load = (div) -> + $('div', div).map -> + id = parseInt($(@).attr('speech_balloon_template_id')) + engine_name = $(@).attr('engine_name') + settings = JSON.parse($(@).attr('settings')) + PettanrSpeechBalloonTemplate.speech_balloon_templates[id] = { + engine_name: engine_name, + settings: settings + } + PettanrSpeechBalloonTemplate.engine_names[engine_name] = id + + @row = (speech_balloon_template_id) -> + PettanrSpeechBalloonTemplate.speech_balloon_templates[speech_balloon_template_id] + + @engine_name = (speech_balloon_template_id) -> + row = PettanrSpeechBalloonTemplate.row(speech_balloon_template_id) + row.engine_name + + @settings = (speech_balloon_template_id) -> + row = PettanrSpeechBalloonTemplate.row(speech_balloon_template_id) + row.settings + + @id = (engine_name) -> + PettanrSpeechBalloonTemplate.engine_names[engine_name] + + @add_helper = (speech_balloon_template_id, opt) -> + engine_name = PettanrSpeechBalloonTemplate.engine_name + PettanrSpeechBalloonTemplate.scripts[engine_name].add_helper(opt) + +@PettanrSpeechBalloonTemplate = PettanrSpeechBalloonTemplate diff --git a/app/assets/javascripts/writing_formats.js.coffee b/app/assets/javascripts/writing_formats.js.coffee index a4a3fa7c..67a41634 100644 --- a/app/assets/javascripts/writing_formats.js.coffee +++ b/app/assets/javascripts/writing_formats.js.coffee @@ -9,7 +9,7 @@ class PettanrWritingFormat PettanrWritingFormat.writing_formats[id] = engine_name @render = (writing_format, content) -> - engine_name = PettanrWritingFormat.writing_formats[1] + engine_name = PettanrWritingFormat.writing_formats[writing_format] PettanrWritingFormat.renderers[engine_name].render(content) diff --git a/app/assets/stylesheets/test.css.scss b/app/assets/stylesheets/test.css.scss index bd7f0e0c..efff5fe1 100644 --- a/app/assets/stylesheets/test.css.scss +++ b/app/assets/stylesheets/test.css.scss @@ -132,7 +132,15 @@ font-family : monospace; height : 9px; right : -5px; top : -5px; -}.colorpicker-wrap { +} +.ground_color-code-wrap { + border: 1px solid #d0d0d0; + border-radius: 10px; + padding: 10px 5px; + background: #fafafa; + display: none; +} +.speech-fore_color-wrap { border: 1px solid #d0d0d0; border-radius: 10px; padding: 10px 5px; diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 061bad0d..f53da6f9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -54,6 +54,12 @@ module ApplicationHelper WritingFormat.list().map {|wf| # javascript_include_tag wf.engine_name javascript_include_tag wf.engine_name + "/application" + }.join("\n") + + SpeechBalloonTemplate.enable_list().map {|sbt| + stylesheet_link_tag sbt.engine_name + "/application" + }.join("\n") + + SpeechBalloonTemplate.enable_list().map {|sbt| + javascript_include_tag sbt.engine_name + "/application" }.join("\n") end diff --git a/app/views/ground_colors/_form.html.erb b/app/views/ground_colors/_form.html.erb index 55f51a24..a42714d4 100644 --- a/app/views/ground_colors/_form.html.erb +++ b/app/views/ground_colors/_form.html.erb @@ -9,8 +9,10 @@ <%= f.label :code %> <%= f.text_field :code, elm.field_tag_attributes(:code, no_attr, :size => 8) %> <% if elm.has_helper?(:code) %> - <%= render elm.form_helper_template(:code), :elm => elm, :no_attr => no_attr %> - <% end %> +
+ <%= render elm.form_helper_template(:code), :elm => elm, :no_attr => no_attr %> +
+ <% end %>
<%= f.label :z %> diff --git a/app/views/panels/_color_helper.html.erb b/app/views/panels/_color_helper.html.erb index a2ecf68f..2cff8db4 100644 --- a/app/views/panels/_color_helper.html.erb +++ b/app/views/panels/_color_helper.html.erb @@ -1,15 +1,13 @@ -
-
> -
-
-
-
-
-
-
-
-
-
-
-
+
> +
+
+
+
+
+
+
+
+
+
+
diff --git a/app/views/panels/_form.html.erb b/app/views/panels/_form.html.erb index 10310a80..06370c0e 100644 --- a/app/views/panels/_form.html.erb +++ b/app/views/panels/_form.html.erb @@ -149,17 +149,6 @@ <% i += 1 %> <% end %>
- - <% SpeechBalloonTemplate.enable_list().each do |sbt| %> - <%= stylesheet_link_tag sbt.engine_name + "/application" %> - <%= javascript_include_tag sbt.engine_name + "/application" %> - <% end %>
<%= form_for(@panel, :html => {:jqform => 'pettanr-panel-form'}) do |f| %> @@ -172,7 +161,13 @@ <% end %>
<% WritingFormat.list().each do |wf| %> -
+
+
+ <% end %> +
+
+ <% SpeechBalloonTemplate.enable_list().each do |sbt| %> +
<% end %>
diff --git a/app/views/panels/_tail_angle_helper.html.erb b/app/views/panels/_tail_angle_helper.html.erb index be9300c7..81a6cbc2 100644 --- a/app/views/panels/_tail_angle_helper.html.erb +++ b/app/views/panels/_tail_angle_helper.html.erb @@ -1,4 +1,4 @@ -