OSDN Git Service

version0.4.36, speach -> speech, fixed around outputConsole.
authoritozyun <itozyun@gmail.com>
Thu, 31 May 2012 23:33:18 +0000 (08:33 +0900)
committeritozyun <itozyun@gmail.com>
Thu, 31 May 2012 23:33:18 +0000 (08:33 +0900)
0.4.x/javascripts/common.js
0.4.x/javascripts/system.js
0.4.x/javascripts/work.js
0.4.x/json/comics_1.json
0.4.x/test/dynamic-comic-html.html

index 5f475e0..f0d4659 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * pettanR common.js\r
- *   version 0.4.35\r
+ *   version 0.4.36\r
  * \r
  * author: itozyun\r
  */\r
@@ -108,7 +108,7 @@ var pettanr = ( function(){
                IS_DEBUG = Type.isBoolean( URL_PARAMS.debug ) ? URL_PARAMS.debug : IS_LOCAL === true,\r
                jqWindow , jqDocument , jqBody;\r
        return {\r
-               version: '0.4.35',\r
+               version: '0.4.36',\r
                init: function(){\r
                        jqWindow   = $( window );\r
                        jqDocument = $( document );\r
@@ -2350,7 +2350,7 @@ pettanr.bind = ( function(){
                                _cssText = [],\r
                                _comicElements = json.panel_elements || [],\r
                                _comicElement, _elmImg, _rImg, _rPic,\r
-                               _balloon, _elmBalloonWrap, _elmText, _text, _speachesAttributes, _key;\r
+                               _balloon, _elmBalloonWrap, _elmText, _text, _speechesAttributes, _key;\r
                        if( noClassnameMode === true ){\r
                                \r
                        } else {\r
@@ -2408,10 +2408,10 @@ pettanr.bind = ( function(){
                                        _elmText.appendChild( document.createElement( 'span' ) );\r
                                        \r
                                        _text = '';\r
-                                       _speachesAttributes = _comicElement.speaches_attributes;\r
-                                       if( _speachesAttributes ){\r
-                                               for( _key in _speachesAttributes ){\r
-                                                       _text += _speachesAttributes[ _key ] && _speachesAttributes[ _key ].content ? _speachesAttributes[ _key ].content : '';\r
+                                       _speechesAttributes = _comicElement.speeches_attributes;\r
+                                       if( _speechesAttributes ){\r
+                                               for( _key in _speechesAttributes ){\r
+                                                       _text += _speechesAttributes[ _key ] && _speechesAttributes[ _key ].content ? _speechesAttributes[ _key ].content : '';\r
                                                }\r
                                        }\r
                                        _elmText.firstChild.appendChild( document.createTextNode( _text ));\r
index 1b3ae38..6864c03 100644 (file)
@@ -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 );
index b7e7b17..8267f56 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * pettanR work.js\r
- *   version 0.4.35\r
+ *   version 0.4.36\r
  *   \r
  * author:\r
  *   itozyun\r
@@ -2258,7 +2258,7 @@ pettanr.editor = pettanr.view.registerApplication( function(){
                //this.w = w;\r
                //this.h = h;                                   \r
                this.z = data.z;\r
-               this.timing = data.t;\r
+               this.timing = data.t || PANEL_ELEMENT_ARRAY.length + 1;\r
                this.keepSize = false;\r
                this.init = function(){\r
                        updateResourcePicture( data.resource_picture );\r
@@ -2342,7 +2342,7 @@ pettanr.editor = pettanr.view.registerApplication( function(){
                        elmText = JQ_WRAPPER.find( 'td,.speach-inner' ).get( 0 ),\r
                        type     = data.balloon_template_id,\r
                        text     = ( function(){\r
-                               var _speachs = data.speaches_attributes;\r
+                               var _speachs = data.speeches_attributes;\r
                                for( var k in _speachs ){\r
                                        return _speachs[ k ].content || '';\r
                                }\r
@@ -2381,7 +2381,7 @@ pettanr.editor = pettanr.view.registerApplication( function(){
                //this.w = w;\r
                //this.h = h;\r
                this.z = data.z;\r
-               this.timing = data.t;\r
+               this.timing = data.t || PANEL_ELEMENT_ARRAY.length + 1;\r
                this.init = function(){\r
                        updateText();\r
                        instance.resize( data.x, data.y, data.width, data.height, data.tail );\r
@@ -2670,7 +2670,7 @@ pettanr.editor = pettanr.view.registerApplication( function(){
                                                x:               Math.floor( panelW / 2 - data.width / 2 ),\r
                                                y:               Math.floor( panelH / 2 - data.height / 2 ),\r
                                                z:               -1,\r
-                                               t:               PANEL_ELEMENT_ARRAY.length,\r
+                                               t:               PANEL_ELEMENT_ARRAY.length + 1,\r
                                                width:           1,\r
                                                height:          1\r
                                        });\r
@@ -2694,10 +2694,10 @@ pettanr.editor = pettanr.view.registerApplication( function(){
                                                x:                                      Math.floor( panelW /2 - 100 +Math.random() *10 ),\r
                                                y:                  Math.floor( panelH /2 - 100 +Math.random() *10 ),\r
                                                z:                  -1,\r
-                                               t:                  PANEL_ELEMENT_ARRAY.length,\r
+                                               t:                  PANEL_ELEMENT_ARRAY.length + 1,\r
                                                width:              200,\r
                                                height:             200,\r
-                                               speaches_attributes: {\r
+                                               speeches_attributes: {\r
                                                        text1: {\r
                                                                content:    'Hello'\r
                                                        }\r
@@ -3571,9 +3571,9 @@ pettanr.outputConsole = pettanr.view.registerApplication( function(){
        }\r
 \r
        function getPanelElementByTiming(){\r
-               var l = panelElementArray.length;\r
+               var i, l = panelElementArray.length;\r
                while( timing < l * 2){\r
-                       for(var i=0; i<l; ++i){\r
+                       for( i=0; i<l; ++i ){\r
                                if( timing === panelElementArray[ i ].timing ){\r
                                        ++timing;\r
                                        return panelElementArray[ i ];\r
@@ -3734,7 +3734,7 @@ pettanr.outputConsole = pettanr.view.registerApplication( function(){
                                        '"x": ',                0, ',', cr,\r
                                        '"y": ',                0, ',', cr,\r
                                        '"z": ',                0, ',', cr,\r
-                                       panelTimming !== -1 ? ( '"t": ' + panelTimming + ',' + cr ) : '',\r
+                                       '"t": ',                                panelTimming, ',', cr,\r
                                    '"width": ',            panelW, ',', cr,\r
                                    '"height": ',           panelH, ',', cr,\r
                                    '"panel_pictures_attributes": {', cr,\r
@@ -3776,7 +3776,7 @@ pettanr.outputConsole = pettanr.view.registerApplication( function(){
                                        '"t": ',                   timing, ',', cr,\r
                                        '"width": ',               _textElement.w, ',', cr,\r
                                        '"height": ',              _textElement.h, ',', cr,\r
-                                       '"speaches_attributes": {', cr,\r
+                                       '"speeches_attributes": {', cr,\r
                                                '"newf', timing, '": {', cr,\r
                                                '"content": "', _textElement.text(), '",', cr,\r
                                                        '"x": ',        _textElement.x, ',', cr,\r
index 67edcbe..af48c2d 100644 (file)
@@ -46,7 +46,7 @@
                            "t":2,\r
                            "width":200,\r
                            "height":151,\r
-                           "speaches_attributes":{\r
+                           "speeches_attributes":{\r
                                "newf2":{\r
                                    "content":"Hello, world!",\r
                                    "x":-34,\r
                            "t":3,\r
                            "width":156,\r
                            "height":128,\r
-                           "speaches_attributes":{\r
+                           "speeches_attributes":{\r
                                "newf3":{\r
                                    "content":"今我ら鏡もて見る如く観る所朧なり",\r
                                    "x":158,\r
index 7e55918..87602fd 100644 (file)
@@ -70,7 +70,7 @@
                        "z":                    1,\r
                        "width":                200,\r
                        "height":               160,\r
-                       "speaches_attributes":  {\r
+                       "speeches_attributes":  {\r
                                "newf1":        {\r
                                        "content":      "Hello",\r
                                        "x":            -29,\r