From 41d7466d7c43494b821721d370bf694c25f52eba Mon Sep 17 00:00:00 2001 From: itozyun Date: Fri, 1 Jun 2012 08:32:40 +0900 Subject: [PATCH] speach -> speech, fixed around outputConsole. --- app/assets/stylesheets/work.css | 2 +- db/schema.rb | 35 ++++++++++++++++++----------------- public/assets/common.js | 14 +++++++------- public/assets/system.js | 4 ++-- public/assets/work.js | 22 +++++++++++----------- 5 files changed, 39 insertions(+), 38 deletions(-) diff --git a/app/assets/stylesheets/work.css b/app/assets/stylesheets/work.css index 23bab385..b2d21374 100644 --- a/app/assets/stylesheets/work.css +++ b/app/assets/stylesheets/work.css @@ -5,7 +5,7 @@ * * work.css * - * version 0.4.23 + * version 0.4.35 * */ html, body { diff --git a/db/schema.rb b/db/schema.rb index 7d8a12ff..937d0d37 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -60,7 +60,7 @@ ActiveRecord::Schema.define(:version => 20120424100555) do add_index "authors", ["user_id"], :name => "index_authors_on_user_id", :unique => true create_table "balloon_templates", :force => true do |t| - t.integer "speech_balloon_id", :null => false + t.integer "speach_balloon_id", :null => false t.integer "system_picture_id", :null => false t.integer "tail", :default => 1, :null => false t.integer "size", :default => 1, :null => false @@ -72,8 +72,8 @@ ActiveRecord::Schema.define(:version => 20120424100555) do t.datetime "updated_at" end - add_index "balloon_templates", ["speech_balloon_id", "tail", "size"], :name => "balloon_templates_idts", :unique => true - add_index "balloon_templates", ["speech_balloon_id"], :name => "index_balloon_templates_on_speech_balloon_id" + add_index "balloon_templates", ["speach_balloon_id", "tail", "size"], :name => "balloon_templates_idts", :unique => true + add_index "balloon_templates", ["speach_balloon_id"], :name => "index_balloon_templates_on_speach_balloon_id" create_table "balloons", :force => true do |t| t.integer "panel_id", :null => false @@ -141,6 +141,7 @@ ActiveRecord::Schema.define(:version => 20120424100555) do add_index "licenses", ["url"], :name => "index_licenses_on_url", :unique => true create_table "original_licenses", :force => true do |t| + t.integer "artist_id", :null => false t.integer "license_id", :null => false t.string "name", :null => false t.string "url", :null => false @@ -191,11 +192,11 @@ ActiveRecord::Schema.define(:version => 20120424100555) do t.integer "width", :default => 200, :null => false t.integer "height", :default => 80, :null => false t.integer "border", :default => 1, :null => false - t.integer "x" - t.integer "y" - t.integer "z" - t.integer "t", :null => false - t.integer "author_id", :null => false + t.integer "x", :null => false + t.integer "y", :null => false + t.integer "z", :null => false + t.integer "t", :default => 1, :null => false + t.integer "author_id" t.datetime "created_at" t.datetime "updated_at" end @@ -215,12 +216,12 @@ ActiveRecord::Schema.define(:version => 20120424100555) do t.datetime "updated_at" end - create_table "speech_balloon_templates", :force => true do |t| + create_table "speach_balloon_templates", :force => true do |t| t.datetime "created_at" t.datetime "updated_at" end - create_table "speech_balloons", :force => true do |t| + create_table "speach_balloons", :force => true do |t| t.string "name", :null => false t.integer "tail_count", :default => 1, :null => false t.integer "size_count", :default => 1, :null => false @@ -229,9 +230,9 @@ ActiveRecord::Schema.define(:version => 20120424100555) do t.datetime "updated_at" end - add_index "speech_balloons", ["t"], :name => "speech_balloons_t", :unique => true + add_index "speach_balloons", ["t"], :name => "speach_balloons_t", :unique => true - create_table "speech_templates", :force => true do |t| + create_table "speach_templates", :force => true do |t| t.integer "balloon_template_id", :null => false t.integer "x", :null => false t.integer "y", :null => false @@ -242,11 +243,11 @@ ActiveRecord::Schema.define(:version => 20120424100555) do t.datetime "updated_at" end - add_index "speech_templates", ["balloon_template_id", "t"], :name => "speech_templates_idt", :unique => true + add_index "speach_templates", ["balloon_template_id", "t"], :name => "speach_templates_idt", :unique => true - create_table "speeches", :force => true do |t| + create_table "speaches", :force => true do |t| t.integer "balloon_id", :null => false - t.integer "speech_template_id", :null => false + t.integer "speach_template_id", :null => false t.string "content" t.integer "x", :null => false t.integer "y", :null => false @@ -257,8 +258,8 @@ ActiveRecord::Schema.define(:version => 20120424100555) do t.datetime "updated_at" end - add_index "speeches", ["balloon_id", "t"], :name => "speeches_bt", :unique => true - add_index "speeches", ["balloon_id"], :name => "index_speeches_on_balloon_id" + add_index "speaches", ["balloon_id", "t"], :name => "speaches_bt", :unique => true + add_index "speaches", ["balloon_id"], :name => "index_speaches_on_balloon_id" create_table "system_pictures", :force => true do |t| t.string "ext", :null => false diff --git a/public/assets/common.js b/public/assets/common.js index 5f475e0e..f0d4659c 100644 --- a/public/assets/common.js +++ b/public/assets/common.js @@ -1,6 +1,6 @@ /* * pettanR common.js - * version 0.4.35 + * version 0.4.36 * * author: itozyun */ @@ -108,7 +108,7 @@ var pettanr = ( function(){ IS_DEBUG = Type.isBoolean( URL_PARAMS.debug ) ? URL_PARAMS.debug : IS_LOCAL === true, jqWindow , jqDocument , jqBody; return { - version: '0.4.35', + version: '0.4.36', init: function(){ jqWindow = $( window ); jqDocument = $( document ); @@ -2350,7 +2350,7 @@ pettanr.bind = ( function(){ _cssText = [], _comicElements = json.panel_elements || [], _comicElement, _elmImg, _rImg, _rPic, - _balloon, _elmBalloonWrap, _elmText, _text, _speachesAttributes, _key; + _balloon, _elmBalloonWrap, _elmText, _text, _speechesAttributes, _key; if( noClassnameMode === true ){ } else { @@ -2408,10 +2408,10 @@ pettanr.bind = ( function(){ _elmText.appendChild( document.createElement( 'span' ) ); _text = ''; - _speachesAttributes = _comicElement.speaches_attributes; - if( _speachesAttributes ){ - for( _key in _speachesAttributes ){ - _text += _speachesAttributes[ _key ] && _speachesAttributes[ _key ].content ? _speachesAttributes[ _key ].content : ''; + _speechesAttributes = _comicElement.speeches_attributes; + if( _speechesAttributes ){ + for( _key in _speechesAttributes ){ + _text += _speechesAttributes[ _key ] && _speechesAttributes[ _key ].content ? _speechesAttributes[ _key ].content : ''; } } _elmText.firstChild.appendChild( document.createTextNode( _text )); diff --git a/public/assets/system.js b/public/assets/system.js index 1b3ae388..6864c03d 100644 --- a/public/assets/system.js +++ b/public/assets/system.js @@ -1,6 +1,6 @@ /* * pettanR system.js - * version 0.4.35 + * version 0.4.36 * * author: * itozyun @@ -476,7 +476,7 @@ pettanr.file = ( function(){ if( typeof driver.read === 'function'){ data = driver.read( this ); } - return data || FileDriverBase.read( this ); + return FileDriverBase.read( data || this ); }, write: function( _newData, _onUpdateFunction ){ var driver = FILE_CONTROLER.getDriver( this ); diff --git a/public/assets/work.js b/public/assets/work.js index b7e7b176..8267f565 100644 --- a/public/assets/work.js +++ b/public/assets/work.js @@ -1,6 +1,6 @@ /* * pettanR work.js - * version 0.4.35 + * version 0.4.36 * * author: * itozyun @@ -2258,7 +2258,7 @@ pettanr.editor = pettanr.view.registerApplication( function(){ //this.w = w; //this.h = h; this.z = data.z; - this.timing = data.t; + this.timing = data.t || PANEL_ELEMENT_ARRAY.length + 1; this.keepSize = false; this.init = function(){ updateResourcePicture( data.resource_picture ); @@ -2342,7 +2342,7 @@ pettanr.editor = pettanr.view.registerApplication( function(){ elmText = JQ_WRAPPER.find( 'td,.speach-inner' ).get( 0 ), type = data.balloon_template_id, text = ( function(){ - var _speachs = data.speaches_attributes; + var _speachs = data.speeches_attributes; for( var k in _speachs ){ return _speachs[ k ].content || ''; } @@ -2381,7 +2381,7 @@ pettanr.editor = pettanr.view.registerApplication( function(){ //this.w = w; //this.h = h; this.z = data.z; - this.timing = data.t; + this.timing = data.t || PANEL_ELEMENT_ARRAY.length + 1; this.init = function(){ updateText(); instance.resize( data.x, data.y, data.width, data.height, data.tail ); @@ -2670,7 +2670,7 @@ pettanr.editor = pettanr.view.registerApplication( function(){ x: Math.floor( panelW / 2 - data.width / 2 ), y: Math.floor( panelH / 2 - data.height / 2 ), z: -1, - t: PANEL_ELEMENT_ARRAY.length, + t: PANEL_ELEMENT_ARRAY.length + 1, width: 1, height: 1 }); @@ -2694,10 +2694,10 @@ pettanr.editor = pettanr.view.registerApplication( function(){ x: Math.floor( panelW /2 - 100 +Math.random() *10 ), y: Math.floor( panelH /2 - 100 +Math.random() *10 ), z: -1, - t: PANEL_ELEMENT_ARRAY.length, + t: PANEL_ELEMENT_ARRAY.length + 1, width: 200, height: 200, - speaches_attributes: { + speeches_attributes: { text1: { content: 'Hello' } @@ -3571,9 +3571,9 @@ pettanr.outputConsole = pettanr.view.registerApplication( function(){ } function getPanelElementByTiming(){ - var l = panelElementArray.length; + var i, l = panelElementArray.length; while( timing < l * 2){ - for(var i=0; i