OSDN Git Service

Version 0.5.45.
[pettanr/clientJs.git] / 0.4.x / javascripts / common.js
index 3a2e2ff..c757ff2 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * pettanR common.js\r
- *   version 0.4.33\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.33',\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
@@ -965,11 +968,11 @@ pettanr.view = ( function(){
 \r
 pettanr.overlay = ( function(){\r
        var SHADOW_OPACITY = 0.5,\r
-               ELM_CONTAINER = document.getElementById( 'overlay-container' ),\r
-               jqConteiner, jqShadow, jqCloseButton,// jqBody, \r
+               ELM_CONTAINER  = document.getElementById( 'overlay-container' ),\r
                currentOverlay = null,\r
-               bootParams = null,\r
-               visible = false,\r
+               bootParams     = null,\r
+               visible        = false,\r
+               jqConteiner, jqShadow, jqCloseButton,// jqBody, \r
                windowW, windowH;\r
 \r
        function asyncResize(){\r
@@ -978,7 +981,7 @@ pettanr.overlay = ( function(){
        function onCloseClick( e){\r
                pettanr.overlay.hide();\r
                e.preventDefault();\r
-               return false;           \r
+               return false;\r
        }\r
        function onFadeInComplete(){\r
 \r
@@ -992,8 +995,8 @@ pettanr.overlay = ( function(){
        return {\r
                init: function(){\r
                        //jqBody = pettanr.jqBody();\r
-                       jqConteiner = $( '#overlay-container');\r
-                       jqShadow = $( '#overlay-shadow');\r
+                       jqConteiner   = $( '#overlay-container');\r
+                       jqShadow      = $( '#overlay-shadow');\r
                        jqCloseButton = $( '#overlay-close-button').click( onCloseClick );\r
                        \r
                        pettanr.key.addKeyDownEvent( pettanr.view.OVERLAY, 27, false, false, pettanr.overlay.hide ); // 27.esc\r
@@ -1005,6 +1008,7 @@ pettanr.overlay = ( function(){
                        if( pettanr.view.isApplicationInstance( _overlay ) === false ) return;\r
                        \r
                        document.body.style.overflow = 'hidden';\r
+                       document.body.appendChild( ELM_CONTAINER ); // ie6-8 で必要、なんで、、、?\r
                        \r
                        this.visible = visible = true;\r
                        this.currentID = _overlay.ID;\r
@@ -1822,7 +1826,7 @@ pettanr.balloon = ( function() {
                })(),\r
                vectorEnabled = ELM_BALLOON_ORIGIN !== null &&\r
                                                pettanr.URL_PARAMS.vector !== false &&\r
-                                               !( IS_VML === true && pettanr.ua.VML === false )\r
+                                               !( IS_VML === true && pettanr.ua.VML === false );\r
 \r
        var cos        = Math.cos,\r
                sin        = Math.sin,\r
@@ -1846,16 +1850,7 @@ pettanr.balloon = ( function() {
                        instance = this,\r
                        l = ',';\r
                \r
-               function draw( _a, _w, _h ){\r
-                       a  = isFinit( _a ) === true ? _a : a;\r
-                       w  = isFinit( _w ) === true ? _w - PADDING_TOP * 2 : w;\r
-                       h  = isFinit( _h ) === true ? _h - PADDING_LEFT * 2 : h;\r
-\r
-                       if( vectorEnabled === false){\r
-                               balloonElm.setAttribute( 'src', pettanr.balloon.getBalloonUrl( w, h, _a ));\r
-                               return;\r
-                       }\r
-                       \r
+               function draw( _a ){\r
                        var rx      = w / 2,\r
                                ry      = h / 2,\r
                                tailRad = _a * DEG_TO_RAD,\r
@@ -1894,10 +1889,6 @@ pettanr.balloon = ( function() {
                        if( IS_VML === true ){\r
                                var _tailX = tailX *10,\r
                                        _tailY = tailY *10,\r
-                                       __startX = startX *10,\r
-                                       __startY = startY *10,\r
-                                       __endX = endX *10,\r
-                                       __endY = endY *10,\r
                                        __w = w *10,\r
                                        __h = h *10;\r
                                \r
@@ -1906,8 +1897,8 @@ pettanr.balloon = ( function() {
                                shape.coordsize = [ __w, __h ].join( l );\r
                                shape.path = [\r
                                        ' ar ', 0, l, 0, l, __w, l, __h, l,\r
-                                       round( __endX ), l, round( __endY ), l,\r
-                                       round( __startX ), l, round( __startY ),\r
+                                       round( endX * 10 ), l, round( endY * 10 ), l,\r
+                                       round( startX * 10 ), l, round( startY * 10 ),\r
                                        ' l ', round( _tailX ), l, round( _tailY ),\r
                                        ' x e'\r
                                ].join( '');\r
@@ -1927,14 +1918,28 @@ pettanr.balloon = ( function() {
                                ].join( ' '));\r
                        }\r
                }\r
-\r
-               draw( a, w, h );\r
                \r
                this.elm = balloonElm;\r
-               this.resize = draw;\r
+               this.resize = function ( _a, _w, _h ){\r
+                       w  = isFinit( _w ) === true ? _w - PADDING_TOP * 2 : w;\r
+                       h  = isFinit( _h ) === true ? _h - PADDING_LEFT * 2 : h;\r
+                       // ie6 でリサイズが反応しない対策\r
+                       if( vectorEnabled === false && pettanr.ua.isIE === true && pettanr.ua.ieVersion < 7 ){\r
+                               var parent = balloonElm.parentNode;\r
+                               parent.removeChild( balloonElm );\r
+                               parent.insertBefore( balloonElm, parent.firstChild );\r
+                       }\r
+                       instance.angle( _a );\r
+               };\r
                this.angle = function( _a ){\r
-                       _a !== undefined && _a !== a &&\r
-                               vectorEnabled === false ? pettanr.balloon.getBalloonUrl( w, h, _a ) : draw( _a );\r
+                       if( isFinit( _a ) === true ){\r
+                               a = _a;\r
+                               if( vectorEnabled === false ){\r
+                                       balloonElm.src = pettanr.balloon.getBalloonUrl( w, h, _a );\r
+                               } else {\r
+                                       draw( _a );\r
+                               }\r
+                       }\r
                        return a;\r
                }\r
                this.type = function( _type ){\r
@@ -1945,6 +1950,8 @@ pettanr.balloon = ( function() {
                        balloonElm.parentNode && balloonElm.parentNode.removeChild( balloonElm );\r
                        balloonElm = path = shape = instance = null;\r
                }\r
+               \r
+               instance.resize( a, w, h );\r
        };\r
        \r
        IS_VML === false && vectorEnabled === true && ( function(){\r
@@ -1968,6 +1975,7 @@ pettanr.balloon = ( function() {
                        return [\r
                                pettanr.CONST.SYSTEM_PICTURE_PATH, '_w',\r
                                _a < 360 - d / 2 ? floor( _a / d ) : 0,\r
+                               _w <= 400 || _h <= 400 ? '_b1' : '',\r
                                '.gif' ].join( '' );\r
            },\r
                TYPE_NONE:                              0,\r
@@ -2082,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
@@ -2285,6 +2293,9 @@ pettanr.bind = ( function(){
                        var ret = document.createElement( 'div');\r
                        ret.style.cssText = 'width: auto;height: 0;padding: 0;margin: 0;display: block;visibility: hidden;float: none;position: static;';\r
                        return ret;\r
+               })(),\r
+               ELM_TITLE_ORIGN = ( function(){\r
+                       \r
                })();\r
 \r
        /*\r
@@ -2311,7 +2322,7 @@ pettanr.bind = ( function(){
                                var size = getInnerSize();\r
                                if (_size.w !== size.w || _size.h !== size.h) { // resized\r
                                        _size = size; // update\r
-                                       onResizeFunction( _size);\r
+                                       onResizeFunction( _size );\r
                                }\r
                                setTimeout( unlock, 0); // delay unlock\r
                        }\r
@@ -2324,151 +2335,175 @@ pettanr.bind = ( function(){
        }\r
        \r
        \r
-       var ElementBuilder = ( function(){\r
-               var ELM_TITLE_ORIGN = ( function(){\r
-                               \r
-                       })(),\r
-                       ELM_TEXT_ORIGN = ( function(){\r
-                               var _table = document.createElement( 'table'),\r
-                                       _tr = document.createElement( 'tr');\r
-                               _table.appendChild( _tr);\r
-                               _tr.appendChild( document.createElement( 'td'));\r
-                               _table.cellspacing = '0';\r
-                               return _table;\r
-                       })();\r
+       var ElementBuilderClass = function( elmTarget, noClassnameMode ){\r
+               var RIMG_ARRAY     = [],\r
+                       BALLOON_ARRAY  = [];\r
                \r
                function buildComicElement(){\r
                        \r
                }\r
                \r
-               function buildPanelElement( elmTarget, json, noClassnameMode){\r
-                       var _elmPanel = document.createElement( 'div'),\r
+               function buildPanelElement( json, zoom ){\r
+                       var _elmPanel = document.createElement( 'div' ),\r
                                _style = {\r
-                                               "border-width":         typeof json.border === 'number' ? json.border + 'px' : 0,\r
+                                               'border-width':         typeof json.border === 'number' ? json.border + 'px' : 0,\r
                                                width:                          json.width + 'px',\r
                                                height:                         json.height + 'px'\r
                                },\r
                                _cssText = [],\r
                                _comicElements = json.panel_elements || [],\r
-                               _comicElement, _elmImgWrap, _rImg, _rPic, _balloon, _elmBalloonWrap, _elmText;\r
-                       if( noClassnameMode === true){\r
+                               _comicElement, _elmImg, _rImg, _rPic,\r
+                               _balloon, _elmBalloonWrap, _elmText, _text, _speechesAttributes, _key;\r
+                       if( noClassnameMode === true ){\r
                                \r
                        } else {\r
                                _elmPanel.className = NAMESPACE_CLASSNAME + 'panel';\r
                        }\r
-                       for( var _key in _style){\r
-                               _cssText.push( _key + ':' + _style[ _key]);\r
+                       for( var _key in _style ){\r
+                               _cssText.push( _key + ':' + _style[ _key ] );\r
                        }\r
                        _elmPanel.style.cssText = _cssText.join( ';');\r
-                       elmTarget.appendChild( _elmPanel);\r
+                       elmTarget.appendChild( _elmPanel );\r
                        \r
-                       for( var i=0, l=_comicElements.length; i<l; ++i){\r
-                               _comicElement = _comicElements[ i];\r
+                       for( var i=0, l=_comicElements.length; i<l; ++i ){\r
+                               _comicElement = _comicElements[ i ];\r
                                _rPic = _comicElement.resource_picture;\r
                                if( _rPic ){\r
                                        _rImg = pettanr.image.createReversibleImage(\r
                                                        [ RESOURCE_PICTURE_PATH, _rPic.id, '.', _rPic.ext ].join( ''),\r
                                                        _comicElement.width, _comicElement.height\r
                                                );\r
-                                       _elmImgWrap = document.createElement( 'div');\r
-                                       _elmPanel.appendChild( _elmImgWrap);\r
-                                       _elmImgWrap.appendChild( _rImg.elm);\r
-                                       _elmImgWrap.className = NAMESPACE_CLASSNAME + 'image';\r
-                                       _elmImgWrap.style.cssText = [\r
-                                               'width:',  Math.abs( _comicElement.width ), 'px;',\r
-                                               'height:', Math.abs( _comicElement.height ), 'px;',\r
+                                       _elmImg = _rImg.elm;\r
+                                       _elmPanel.appendChild( _elmImg );\r
+                                       _elmImg.className = NAMESPACE_CLASSNAME + 'image';\r
+                                       _elmImg.style.cssText = [\r
                                                'left:',   _comicElement.x, 'px;',\r
                                                'top:',    _comicElement.y, 'px;',\r
                                                'z-index:',_comicElement.z, ';'\r
-                                       ].join( '');\r
+                                       ].join( '');                                    \r
+                                       if( _elmImg.tagName === 'img' ){\r
+                                               _elmImg.width        = Math.abs( _comicElement.width );\r
+                                               _elmImg.height       = Math.abs( _comicElement.height );\r
+                                       } else {\r
+                                               _elmImg.style.width  = Math.abs( _comicElement.width ) + 'px';\r
+                                               _elmImg.style.height = Math.abs( _comicElement.height ) + 'px';\r
+                                       }\r
+                                       \r
+                                       RIMG_ARRAY.push( _rImg );\r
                                } else {\r
                                        _elmBalloonWrap = document.createElement( 'div' );\r
                                        _elmPanel.appendChild( _elmBalloonWrap );\r
                                        _elmBalloonWrap.className = NAMESPACE_CLASSNAME + 'balloon';\r
                                        _elmBalloonWrap.style.cssText = [\r
-                                               'width:', _comicElement.width, 'px;',\r
-                                               'height:', _comicElement.height, 'px;',\r
-                                               'left:', _comicElement.x, 'px;',\r
-                                               'top:', _comicElement.y, 'px;',\r
+                                               'width:',   _comicElement.width, 'px;',\r
+                                               'height:',  _comicElement.height, 'px;',\r
+                                               'left:',    _comicElement.x, 'px;',\r
+                                               'top:',     _comicElement.y, 'px;',\r
                                                'z-index:', _comicElement.z, ';'\r
                                        ].join( '');\r
 \r
                                        _balloon = pettanr.balloon.createBalloon( _comicElement.width, _comicElement.height, _comicElement.tail );\r
-                                       _elmBalloonWrap.appendChild( _balloon.elm);\r
+                                       _elmBalloonWrap.appendChild( _balloon.elm );\r
+                                       \r
+                                       _elmText = document.createElement( 'p' );\r
+                                       _elmBalloonWrap.appendChild( _elmText );\r
                                        \r
-                                       _elmText = ELM_TEXT_ORIGN.cloneNode( true);\r
-                                       _elmBalloonWrap.appendChild( _elmText);\r
-                                       _elmText.className = NAMESPACE_CLASSNAME + 'speach';\r
-                                       _elmText.getElementsByTagName( 'td')[ 0].appendChild( document.createTextNode( 'hello'));\r
+                                       _elmText.appendChild( document.createElement( 'span' ) );\r
+                                       \r
+                                       _text = '';\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
+                                       BALLOON_ARRAY.push( _balloon );\r
                                }\r
                        }\r
                }\r
                \r
-               return {\r
-                       build: function( elmTarget, json, zoom, noClassnameMode){\r
-                               // clean elmTarget\r
-                               pettanr.util.removeAllChildren( elmTarget);\r
-                               \r
-                               // json is Comic ? Panel ?\r
-                               if( json.panels){\r
-                                       // comic\r
-                                       \r
-                               } else\r
-                               if( json.panel_elements){\r
-                                       // panel\r
-                                       buildPanelElement( elmTarget, json, noClassnameMode);\r
-                               } else {\r
-                                       // invalid json\r
+               function clean(){\r
+                       // clean elmTarget\r
+                       while( RIMG_ARRAY.length > 0 ){\r
+                               RIMG_ARRAY.shift().destroy();\r
+                       }\r
+                       while( BALLOON_ARRAY.length > 0 ){\r
+                               BALLOON_ARRAY.shift().destroy();\r
+                       }\r
+                       pettanr.util.removeAllChildren( elmTarget );            \r
+               }\r
+               \r
+               this.build = function( json, zoom ){\r
+                       clean();\r
+                       \r
+                       // json is Comic ? Panel ?\r
+                       var panels = json.panels;\r
+                       if( Type.isArray( panels ) === true ){\r
+                               // comic\r
+                               for( var i=0, l=panels.length; i<l; ++i ){\r
+                                       buildPanelElement( panels[ i ], zoom );\r
                                }\r
+                       } else\r
+                       if( json.panel_elements ){\r
+                               // panel\r
+                               buildPanelElement( json, zoom );\r
+                       } else {\r
+                               // invalid json\r
                        }\r
                }\r
-       })();\r
+               this.zoom = function(){\r
+                       \r
+               }\r
+               this.destroy = function(){\r
+                       clean();\r
+               }\r
+       };\r
        \r
-       var BindWorkerClass = function( elmTarget, json, zoomSelfEnabled, noClassnameMode){\r
-               typeof json === 'object' && build( elmTarget, json);\r
-               \r
-               var elmDetectW = ELM_DETECT_WIDTH.cloneNode( false)\r
+       var BindWorkerClass = function( elmTarget, json, zoomSelfEnabled, noClassnameMode ){\r
+               var builder    = new ElementBuilderClass( elmTarget, noClassnameMode );\r
+               var elmDetectW = ELM_DETECT_WIDTH.cloneNode( false );\r
+               var resizer    = null;\r
                \r
                if( zoomSelfEnabled === true){\r
-                       elmTarget.parentNode.insertBefore( elmDetectW, elmTarget);\r
-                       new ResizeAgentClass( onResize, elmDetectW);\r
+                       elmTarget.parentNode.insertBefore( elmDetectW, elmTarget );\r
+                       resizer = new ResizeAgentClass( onResize, elmDetectW );\r
                }\r
                function onResize(){\r
                        \r
                }\r
-               json && ElementBuilder.build( elmTarget, json, zoomSelfEnabled, noClassnameMode);\r
+               json && typeof json === 'object' && builder.build( json );\r
                \r
-               return {\r
-                       init: function(){\r
+               this.init = function(){\r
                                \r
-                       },\r
-                       zoom: function(){\r
-                               \r
-                       },\r
-                       json: function( _json){\r
-                               json = _json;\r
-                               ElementBuilder.build( elmTarget, _json, zoomSelfEnabled, noClassnameMode);\r
-                       },\r
-                       targetElement: function(){\r
-                               \r
-                       },\r
-                       layput: function(){\r
+               }\r
+               this.zoom = function(){\r
+                       builder.zoom();\r
+               }\r
+               this.json = function( _json ){\r
+                       json = _json;\r
+                       builder.build( _json );\r
+               }\r
+               this.targetElement = function(){\r
                                \r
-                       },\r
-                       destroy: function(){\r
+               }\r
+               this.layout = function(){\r
                                \r
-                       }\r
+               }\r
+               this.destroy = function(){\r
+                       builder.destroy();\r
+                       elmTarget = json = builder = null;\r
                }\r
        }\r
        \r
        return {\r
-               createBindWorker: function( elmTarget, opt_COMICJSONorPANELJSON, opt_zoomSelfEnabled, opt_noClassnameMode){\r
+               createBindWorker: function( elmTarget, opt_COMICJSONorPANELJSON, opt_zoomSelfEnabled, opt_noClassnameMode ){\r
                        var ret = new BindWorkerClass( elmTarget, opt_COMICJSONorPANELJSON, !!opt_zoomSelfEnabled, !!opt_noClassnameMode);\r
-                       BIND_WORKER_ARRAY.push( ret);\r
+                       BIND_WORKER_ARRAY.push( ret );\r
                        return ret;\r
                },\r
-               isBindWorkerInstance: function( _bindWorker){\r
-                       \r
+               isBindWorkerInstance: function( _bindWorker ){\r
+                       return _bindWorker instanceof BindWorkerClass;\r
                }\r
        }\r
 })();\r