OSDN Git Service

Version 0.6.121, iScroll5 is working on iPhone touch 1G, update X.Audio.
[pettanr/clientJs.git] / 0.4.x / javascripts / common.js
index 5f475e0..c757ff2 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * pettanR common.js\r
- *   version 0.4.35\r
+ *   version 0.4.37\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
@@ -231,15 +231,15 @@ pettanr.util = ( function(){
                }\r
        }\r
        return {\r
-               extend: function( baseInstance, extend){\r
-                       for( var key in extend){\r
-                               if( typeof baseInstance[ key] === 'undefined'){\r
-                                       baseInstance[ key] = extend[ key];\r
+               extend: function( baseInstance, extend ){\r
+                       for( var key in extend ){\r
+                               if( Type.isUndefined( baseInstance[ key ] ) === true ){\r
+                                       baseInstance[ key ] = extend[ key ];\r
                                } else\r
-                               if( typeof baseInstance[ key] === typeof extend[ key]){\r
-                                       baseInstance[ key] = extend[ key];\r
+                               if( typeof baseInstance[ key ] === typeof extend[ key ] ){\r
+                                       baseInstance[ key ] = extend[ key ];\r
                                } else {\r
-                                       alert( 'extend error');\r
+                                       alert( 'extend error' );\r
                                }\r
                        }\r
                        return baseInstance;\r
@@ -267,31 +267,31 @@ pettanr.util = ( function(){
                                _elm.style.behavior = '';\r
                        }\r
                },\r
-               getElementSize: function( _elm){\r
-                       if( !_elm){\r
+               getElementSize: function( _elm ){\r
+                       if( Type.isHTMLElement( _elm ) === false ){\r
                                return {\r
                                        width:  0,\r
                                        height: 0\r
-                               }\r
-                       }\r
-                       var     parentElm = _elm.parentNode,\r
-                               prevElm = _elm.previousSibling,\r
-                               nextElm = _elm.nextSibling,\r
+                               };\r
+                       };\r
+                       var     parentElm   = _elm.parentNode,\r
+                               prevElm     = _elm.previousSibling,\r
+                               nextElm     = _elm.nextSibling,\r
                                displayNone = _elm.style.display === 'none';\r
-                       if( displayNone === true) _elm.style.display = '';\r
-                       ELM_SIZE_GETTER.appendChild( _elm);\r
+                       if( displayNone === true ) _elm.style.display = '';\r
+                       ELM_SIZE_GETTER.appendChild( _elm );\r
                        var ret = {\r
                                width:          _elm.offsetWidth,\r
                                height:         _elm.offsetHeight\r
                        }\r
-                       if( displayNone === true) _elm.style.display = 'none';\r
-                       if( nextElm){\r
-                               parentElm.insertBefore( _elm, nextElm);\r
+                       if( displayNone === true ) _elm.style.display = 'none';\r
+                       if( nextElm ){\r
+                               parentElm.insertBefore( _elm, nextElm );\r
                        } else          \r
-                       if( prevElm && prevElm.nextSibling){\r
-                               parentElm.insertBefore( _elm, prevElm.nextSibling);\r
+                       if( prevElm && prevElm.nextSibling ){\r
+                               parentElm.insertBefore( _elm, prevElm.nextSibling );\r
                        } else {\r
-                               parentElm && parentElm.appendChild( _elm);\r
+                               parentElm && parentElm.appendChild( _elm );\r
                        }                       \r
                        return ret;\r
                },\r
@@ -736,11 +736,11 @@ pettanr.view = ( function(){
                        if( this.MIN_WIDTH > _w || this.MIN_HEIGHT > _h ){\r
                                if( Type.isHTMLElement( this.rootElement ) === true ){\r
                                        // 小さすぎる!、と表示\r
-                               }\r
+                               };\r
                                return;\r
-                       }\r
+                       };\r
                        this.onPaneResize( _w, _h );\r
-               }\r
+               };\r
                this.MIN_WIDTH = 240;\r
                this.MIN_HEIGHT = 240;\r
        }\r
@@ -752,6 +752,9 @@ pettanr.view = ( function(){
                this.rootElement = null;\r
                this.parentElement = null;\r
                this.nextSibling = null;\r
+               this.getUID = function(){\r
+                       return pettanr.util.getIndex( APPLICATION_LIST, instance );\r
+               }\r
                this.open = function( _w, _h /*, _option */ ){\r
                        instance = this;\r
                        if( this.MIN_WIDTH > _w || this.MIN_HEIGHT > _h ){\r
@@ -765,22 +768,22 @@ pettanr.view = ( function(){
                        } else {\r
                                this.onOpen( _w, _h );\r
                        }\r
-               }\r
+               };\r
                this.close = function(){\r
                        if( this.onClose() === false ){\r
                                return false;\r
                        }\r
-               }\r
+               };\r
                this.onOpen = function( _w, _h /*, _option */ ){\r
                        // overrride\r
                };\r
                this.onClose = function(){\r
                        // overrride\r
                        return true;\r
-               } // false の場合、close の拒否 \r
-               this.addEventListener = function(){\r
-                       \r
-               }\r
+               }; // false の場合、close の拒否 \r
+               this.addMouseEventListener = function( _element, _eventType, _handler ){\r
+                        MouseEventManager.add( instance, _element, _eventType, _handler );\r
+               };\r
        }\r
        AbstractApplication.prototype = new AbstractBasicPane();\r
        \r
@@ -2087,10 +2090,10 @@ pettanr.image = ( function(){
                                destroy();\r
                        }\r
                        function destroy(){\r
-                               finish = true;\r
+                               finish  = true;\r
                                img.src = img.onload = img.onabort = img.onerror = '';\r
-                               img = void 0\r
-                               size = onLoadCallback = onErrorCallback = timer = null;\r
+                               img     = void 0;\r
+                               size    = onLoadCallback = onErrorCallback = timer = null;\r
                        }\r
                        this.stop = function(){\r
                                timer !== null && window.clearTimeout( timer );\r
@@ -2350,7 +2353,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 +2411,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