OSDN Git Service

version 0.5.47, fix scope leek.
authoritozyun <itozyun@user.sourceforge.jp>
Wed, 6 Feb 2013 14:44:15 +0000 (23:44 +0900)
committeritozyun <itozyun@user.sourceforge.jp>
Wed, 6 Feb 2013 14:44:15 +0000 (23:44 +0900)
0.5.x/javascripts/libs.js
0.5.x/javascripts/peta-apps.js
0.5.x/javascripts/peta-common.js
0.5.x/javascripts/system.js

index aee98fe..507033b 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * pettanR libs.js\r
- *   version 0.5.44\r
+ *   version 0.5.47\r
  * \r
  * \r
  * Type\r
@@ -593,7 +593,8 @@ var getFunctionName = function( f ){
                        getElementsByClassName: function( _elm, _className, opt_tagName ){\r
                                var _all       = !opt_tagName || opt_tagName === '*',\r
                                        _livenodes = _all === true ? ( _elm.all || _elm.getElementsByTagName( '*' )) : _elm.getElementsByTagName( opt_tagName ),\r
-                                       _nodes     = Util.copyArray( _livenodes );\r
+                                       _nodes     = Util.copyArray( _livenodes),\r
+                    _node;\r
                                for( var j = 0; j < _nodes.length; ){\r
                                        _node = _nodes[ j ];\r
                                        if( _node.nodeType !== 1 || Util.hasClassName( _node, _className ) === false ){\r
@@ -812,7 +813,7 @@ var CSS = ( function( window, documwnt, undefined ){
        })();\r
 \r
        var COLOR = ( function(){\r
-               var ret = {}, v, name,\r
+               var ret = {}, v, name, i,\r
                        list = [\r
                                '0', 'BLACK',\r
                                'FF0000', 'RED',\r
@@ -1314,7 +1315,8 @@ var CSS = ( function( window, documwnt, undefined ){
                                right  = this.get( name + 'Right' ),\r
                                bottom = this.get( name + 'Bottom' ),\r
                                left   = this.get( name + 'Left' ),\r
-                               ret    = new PropertyGroupClass( name, top, right, bottom, left );\r
+                               ret    = new PropertyGroupClass( name, top, right, bottom, left),\r
+                all;\r
                        if( ret.isValid() === true ) return ret;\r
                        ret.clear();\r
                        all    = this.style[ name ].split( '(' )[ 1 ].split( ')' )[ 0 ].split( CLIP_SEPARATOR );\r
@@ -1346,7 +1348,7 @@ var CSS = ( function( window, documwnt, undefined ){
                                bottom = this.get( name + 'Bottom' + widthOrColor ),\r
                                left   = this.get( name + 'Left' + widthOrColor ),\r
                                ret    = new FrexiblePropertyClass( name, top, right, bottom, left ),\r
-                               all, x, v, u, i;\r
+                               all, x, v, u, i, l;\r
                        \r
                        if( ret.isValid() === true ) return ret;\r
                        ret.clear();\r
@@ -1627,7 +1629,7 @@ var Position = {
                        minus   = Position.isMinusBodyBorder,\r
                        body    = document.body,\r
                        element = forElement,\r
-                       parent;\r
+                       parent, border;\r
                do {\r
                        valueT += element.offsetTop || 0;\r
                        valueL += element.offsetLeft || 0;\r
index 0b1a931..1d822e6 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * pettanR peta.apps.js
- *   version 0.5.44
+ *   version 0.5.47
  *   
  * author:
  *   itozyun
                        this.viewerApplicationList = function( file ){
                                var data = FileAPI.getFileData( file ),
                                        type = data !== null ? data.type : null;
+                               if( data === FILE_DATA_MY_ORIGINAL_PICTURES_ROOT ) return [ PremiumSatge ];
                                switch( type ){
                                        case FILE_TYPE.COMIC :
                                        case FILE_TYPE.PANEL :
                                                break;
                                        case FILE_TYPE.ARTIST :
                                                return [ PremiumSatge ];
-                                       default :
-                                               if( data === FILE_DATA_MY_ORIGINAL_PICTURES_ROOT ){
-                                                       return [ PremiumSatge ];
-                                               };                                              
+                                       default :                                               
                                };
                                return [];
                        };
@@ -853,9 +851,9 @@ var PremiumSatge = gOS.registerApplication( function(){
        var ImageGroupIconClass = function( index, data ){
                var elmIconWrap     = elmIconOrigin.cloneNode( true ),
                        elmIconTitle    = Util.getElementsByClassName( elmIconWrap, 'image-group-item-title' )[ 0 ],
-                       originalPicture = data.original_picture,
+                       originalPicture = data.original_picture || data,
                        SRC             = [ BASE_PATH, data.id, '.', data.ext ].join( ''),
-                       LOW_SRC         = originalPicture.filesize && originalPicture.filesize > LIMIT_FILESIZE ? [ THUMB_PATH, data.id, '.', originalPicture.ext ].join( '') : null,
+                       LOW_SRC         = originalPicture.filesize && originalPicture.filesize > LIMIT_FILESIZE ? [ THUMB_PATH, data.id, '.', data.ext ].join( '' ) : null,
                        reversibleImage = null,
                        timer           = null,
                        onEnterFlag     = false,
@@ -1390,7 +1388,7 @@ var Editor = gOS.registerApplication( function(){
                var ELM_ITEM_CLASSNAME = 'menubar-item',
                        currentMenu        = null,
                        elmBar, elmBox,
-                       nodeBar, nodeBox,
+                       nodeBar, nodeBox, layerBox,
                        barH, menuW;
        /** -----------------------------------------
         *  PrivateOptionDataClass
@@ -1583,7 +1581,7 @@ var Editor = gOS.registerApplication( function(){
                };
                MenuClass.prototype = {
                        show: function(){
-                               data = MenuPrivateDataClass.get( this );
+                               var data = MenuPrivateDataClass.get( this );
                                if( data.visible === true ) return;
                                
                                data.elm.className = ELM_ITEM_CLASSNAME + '-focus';
@@ -1988,7 +1986,7 @@ var Editor = gOS.registerApplication( function(){
                        },
                        firstOpen : function(){
                                var win       = this.window,
-                                       elmHead   = this.elmHead = Util.getElementsByClassName( this.elm, 'window-header' )[ 0 ];
+                                       elmHead   = this.elmHead = Util.getElementsByClassName( this.elm, 'window-header' )[ 0 ],
                                        elmBody   = this.elmBody = Util.getElementsByClassName( this.elm, 'window-body' )[ 0 ],
                                        elmClose  = Util.getElementsByClassName( this.elm, 'window-close-button' )[ 0 ],
                                        elmFoot   = Util.getElementsByClassName( this.elm, 'window-footer' )[ 0 ],
@@ -2949,7 +2947,8 @@ var Editor = gOS.registerApplication( function(){
                                { x:    1, w:   -1, y:  0, h:    1}, //bottom-left
                                { x:    0, w:    1, y:  0, h:    1}  //bottom-right
                        ],
-                       startX, startY, startW, startH, startFilpV, startFilpH, startAspect,
+                       startX, startY, startW, startH,
+            flipV, flipH, startFilpV, startFilpH, startAspect,
                        baseX, baseY, baseW, baseH,
                        currentX, currentY, currentW, currentH,
                        offsetX, offsetY,
@@ -3453,9 +3452,10 @@ var Editor = gOS.registerApplication( function(){
                        pushoutH        = 0,
                        pushout         = false,
                        currentType     = -1,
+            currentElement  = null,
                        visible         = false,
                        node            = null,
-                       ui, inputX, inputY, inputZ, inputA, inputW, inputH, inputAspectRatio,
+                       ui, inputX, inputY, inputZ, inputA, inputW, inputH, inputPercentW, inputPercentH, inputAspectRatio,
                        buttonBack, buttonForward, buttonDel, buttonEdit, butonChange;
                        
                function layerBack(){
@@ -3488,7 +3488,7 @@ var Editor = gOS.registerApplication( function(){
                };
                function change(){
                        if( currentElement === null ) return;
-                       PremiumSatge.boot( currentElement.artistID, currentElement.resourcePicture, currentElement );
+                       PremiumSatge.boot( currentElement.artistID, currentElement.realPicture, currentElement );
                };
 
                return {
@@ -3685,8 +3685,6 @@ var Editor = gOS.registerApplication( function(){
                this.flipV    = data.height < 0 ? -1 : 1;
                this.flipH    = data.width  < 0 ? -1 : 1;
                this.rPicture = data.picture;
-               //this.oPicture = this.rPicture.original_picture;
-               //this.artistID = this.oPicture.artist.id || -1;
                
                var self = this;
                function animeComplete(){
@@ -3712,7 +3710,7 @@ var Editor = gOS.registerApplication( function(){
                                this.flipV = updateV === true ? -this.flipV : this.flipV;
                                this.reversibleImage.resize( this.flipH * this.w, this.flipV * this.h );
                        },
-                       resourcePicture : function( _rPicture ){
+                       realPicture : function( _rPicture ){
                                if( _rPicture && _rPicture !== this.rPicture ){
                                        HISTORY_CONTROL.saveState( this._updateResourcePicture, this.rPicture, _rPicture, this );
                                        this._updateResourcePicture( _rPicture );
@@ -3757,7 +3755,7 @@ var Editor = gOS.registerApplication( function(){
                                this.actualH = this.oPicture.height;
                                
                                var _reversibleImage = pettanr.image.createReversibleImage( 
-                                               [ pettanr.CONST.RESOURCE_PICTURE_PATH, this.rPicture.id, '.', this.rPicture.ext ].join( '' ),
+                                               [ pettanr.CONST.PICTURE_PATH, this.rPicture.id, '.', this.rPicture.ext ].join( '' ),
                                                this.flipH * this.w, this.flipV * this.h
                                        );
                                if( this.reversibleImage !== null ){
@@ -4071,7 +4069,7 @@ var Editor = gOS.registerApplication( function(){
                                var _panelElement;
                                if( isPanelPictureData !== true ){
                                        _panelElement = new ImageElementClass( {
-                                               picture : data,
+                                               picture : data.picture,
                                                x       : Math.floor( panelW / 2 - data.width / 2 ),
                                                y       : Math.floor( panelH / 2 - data.height / 2 ),
                                                z       : -1,
@@ -5041,7 +5039,7 @@ var Model = ( function(){
                function getPanelElementByTiming(){
                        var i, l = panelElementArray.length;
                        while( timing < l * 2 ){
-                               for( i=0; i<l; ++i ){
+                               for( i = 0; i < l; ++i ){
                                        if( timing === panelElementArray[ i ].timing ){
                                                // console.log( timing + ' , ' + panelElementArray[ i ].timing );
                                                ++timing;
@@ -5053,9 +5051,10 @@ var Model = ( function(){
                        return null;
                };
                function panelElementToHtml( _panelElement, isAbsoluteUrl, isXHTML ){
-                       var url;
+                       var rPic, url;
                        if( _panelElement.type === 0 ){
-                               url = [ pettanr.CONST.RESOURCE_PICTURE_PATH, _panelElement.resourcePicture().id, '.', _panelElement.resourcePicture().ext ].join( '' );
+                               rPic = _panelElement.realPicture();
+                               url  = [ pettanr.CONST.RESOURCE_PICTURE_PATH, rPic.id, '.', rPic.ext ].join( '' );
                                return [
                                        '<img ',
                                                'src="',        isAbsoluteUrl !== true ? url : Util.getAbsolutePath( url ), '" ',
@@ -5094,12 +5093,13 @@ var Model = ( function(){
                        };
                };
                function getImageJsonGET( _imageElement ){
-                       var cr = pettanr.LINE_FEED_CODE_TEXTAREA;
+                       var cr = pettanr.LINE_FEED_CODE_TEXTAREA,
+                               rPic = _imageElement.realPicture();
                        return [
                                '{', cr,
                                        '"resource_picture": {', cr,
-                                               '"id": ',              _imageElement.resourcePicture().id, ',', cr,
-                                               '"ext": ',             '"',_imageElement.resourcePicture().ext, '"', cr,
+                                               '"id": ',              rPic.id, ',', cr,
+                                               '"ext": ',             '"', rPic.ext, '"', cr,
                                        '},', cr,
                                        '"x": ',                   _imageElement.x, ',', cr,
                                        '"y": ',                   _imageElement.y, ',', cr,
@@ -5114,7 +5114,7 @@ var Model = ( function(){
                        var cr = pettanr.LINE_FEED_CODE_TEXTAREA;
                        return [
                                '{', cr,
-                                       '"picture_id": ', _imageElement.resourcePicture().id, ',', cr,
+                                       '"picture_id": ', _imageElement.realPicture().id, ',', cr,
                                        '"x": ',          _imageElement.x, ',', cr,
                                        '"y": ',          _imageElement.y, ',', cr,
                                        '"z": ',          _imageElement.z + 1, ',', cr,
@@ -5386,7 +5386,7 @@ var OutputConsole = gOS.registerApplication( function(){
        this.onClose = function(){
                elmOutputArea.value = '';
                model.destroy();
-               elmOutputArea = comboboxFormat = inputOption = buttonSubmit = buttonClose = panelElementArray = instance = model = null;
+               elmOutputArea = comboboxFormat = inputOption = buttonSubmit = buttonClose = panelElementArray = model = null;
        };
 }, true, false, 'Output Console', 'outputConsole', null, '#2D89F0' );
 
index ca18abd..8b49c55 100644 (file)
@@ -1,6 +1,6 @@
 /*\r
  * pettanR peta.common.js\r
- *   version 0.5.45\r
+ *   version 0.5.47\r
  * \r
  *   author:\r
  *     itozyun\r
@@ -96,6 +96,7 @@ pettanr.CONST = ( function(){
                NS_PETTANR_COMIC              : 'pettanr-comic',\r
                THUMBNAIL_PATH                : SERVER_SUPPORT === false ? RELATIVE + 'resource_pictures\/thumbnail\/' : PETTANR_ROOT_PATH + 'resource_pictures\/',\r
                RESOURCE_PICTURE_PATH         : SERVER_SUPPORT === false ? RELATIVE + 'resource_pictures\/' : PETTANR_ROOT_PATH + 'resource_pictures\/full\/',\r
+               ORIGINAL_PICTURE_PATH         : SERVER_SUPPORT === false ? RELATIVE + 'resource_pictures\/' : PETTANR_ROOT_PATH + 'original_pictures\/',\r
                PICTURE_PATH                  : SERVER_SUPPORT === false ? RELATIVE + 'pictures\/' : PETTANR_ROOT_PATH + 'pictures\/',\r
                SYSTEM_PICTURE_PATH           : ( SERVER_SUPPORT === false ? RELATIVE : PETTANR_ROOT_PATH ) + 'system_pictures\/',\r
                CREATE_COMIC_JS               : SERVER_SUPPORT === false ? 'js\/create_new_comic.js' : PETTANR_ROOT_PATH + 'comics\/new.js',\r
@@ -645,10 +646,10 @@ pettanr.bind = ( function(){
         */\r
        var ResizeAgentClass = function( onResizeFunction, opt_elmCheck){\r
                var     _globalLock = 0,\r
-                       _size = { w: 0, h: 0 };\r
+                       _size = { w: 0, h: 0 },\r
                        _ie = !!document.all,\r
                        _quirks = (document.compatMode || "") !== "CSS1Compat",\r
-                       _ieroot = _quirks ? "body" : "documentElement";\r
+                       _ieroot = _quirks ? "body" : "documentElement",\r
                        _root = opt_elmCheck ? opt_elmCheck : ( _ie ? document[_ieroot] : window);\r
 \r
                function getInnerSize(){\r
@@ -739,7 +740,7 @@ pettanr.bind = ( function(){
                                cssText  = [],\r
                                elements = json.elements,\r
                                realPic,\r
-                               p, i, l;\r
+                               p, i, l, data;\r
                        this.elmTarget.appendChild( elmPanel );\r
                        \r
                        if( this.noClassname === true ){\r
index 2e84906..cfddd58 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * pettanR system.js
- *   version 0.5.45
+ *   version 0.5.47
  *
  * gadgetOS
  *   author:
@@ -135,8 +135,7 @@ var Class = ( function(){
                dataUser           = null,
                traits             = null,
                f                  = true,
-               c                  = Util.copyArray,
-               a; /* arguments */
+               copyArray          = Util.copyArray;
        
        function getClass( instance ){
                var cList    = CLASS_LIST,
@@ -186,7 +185,7 @@ var Class = ( function(){
         * http://d.hatena.ne.jp/m-hiyama/20051018/1129605002
         */
        function inherits( /* displayName, classSetting, opt_PrivateClass, props */ ){
-               var args        = c( arguments ),
+               var args        = copyArray( arguments ),
                        params      = [],
                        Super       = this,
                        superDef    = getClassDef( Super ),
@@ -307,7 +306,7 @@ var Class = ( function(){
 
        /* privateDataclass をもつクラスに追加されるメソッド */
        function newPrivateData( /* instance, args */ ){
-               var args         = c( arguments ),
+               var args         = copyArray( arguments ),
                        user         = args.shift(),
                        def          = getClassDef( user ),
                        privateClass = def.privateClass,
@@ -361,7 +360,7 @@ var Class = ( function(){
                        userDef.userList.push( dataUser );
                } else {
                        def.live && def.live.push( instance );
-                       args = c( arguments );
+                       args = copyArray( arguments );
                };
                def[ CONSTRUCTOR ] && def[ CONSTRUCTOR ].apply( instance, args );
                return instance;
@@ -374,7 +373,7 @@ var Class = ( function(){
                SUPER_ACCESS : 8,
                PRIVATE_DATA : 16,
                create : function( /* displayName, classSetting, opt_PrivateClass, props */ ){
-                       var args        = c( arguments ),
+                       var args        = copyArray( arguments ),
                                displayName = args[ 0 ],
                                classSetting,
                                opt_pool, opt_abstract, opt_final, opt_private,
@@ -417,7 +416,7 @@ var Class = ( function(){
                                classDef[ CONSTRUCTOR ] = props[ CONSTRUCTOR ];
                        };
                        
-                       klass = function(){ a = arguments; if( f ) return C.apply( a.callee, c( a ) )};
+                       klass = function(){ var a = arguments; if( f ) return C.apply( a.callee, a )};
                        klass.prototype = override( override( traits || {}, props, true ), CommonProps, false );
                        
                        if( opt_abstract === true ){
@@ -3134,7 +3133,8 @@ var Application = ( function(){
 
 var ReadyEvent = ( function(){
        var ticketReady,
-               ticketLoad;
+               ticketLoad,
+        timer;
 
        function webkitDetect(){
                var state = document.readyState;
@@ -3387,7 +3387,7 @@ var ResizeEvent = ( function(){
                                TMP.onWheel   = function( e ){
                                        e = e || window.event;
                                        var cancel = true,
-                                               f = TMP.wheelLegacy;
+                                               f = TMP.wheelLegacy, i;
                                        if( f ) cancel = f.call( this, e );
                                        
                                        for( i = TMP.wheelHandlerList.length; i; ){
@@ -3932,7 +3932,7 @@ var StyleSheet = ( function(){
        
        function checkTimer(){
                var l = TICKET_LIST.length,
-                       n = 0;
+                       n = 0, t;
                for( var i = 0; i < l; ++i ){
                        t = TICKET_LIST[ i ];
                        ++t.time;
@@ -3988,6 +3988,7 @@ var StyleSheet = ( function(){
                },
                unload: function( _apiuser, _url ){
                        _url = _url ? Util.getAbsolutePath( _url ) : null;
+            var t;
                        for( var i = 0; i < TICKET_LIST.length; ){
                                t = TICKET_LIST[ i ];
                                if( t.destroy( _apiuser, _url ) === true ){
@@ -5161,6 +5162,7 @@ var UIForm = ( function(){
        var CLASSNAME_FORM      = 'uiform-invisible';
        var CLASSNAME_FILE_WRAP = 'ui-fileinput-wrapper';
        var FormItemData = function(){};
+    var windowW, windowH;
        FormItemData.prototype = {
                formData : null,
                uiItem   : null,
@@ -5593,7 +5595,7 @@ var Finder = ( function(){
                        };
                },
                draw : function( folder ){
-                       _w = this.nodeRoot.width();
+                       var _w = this.nodeRoot.width();
                        this.folder = folder;
                        var data     = this,
                                iconList = data.iconList,
@@ -5746,7 +5748,7 @@ var Finder = ( function(){
                                elmName    = Util.getElementsByClassName( elm, 'finder-detail-filename' )[ 0 ],
                                elmDesc    = Util.getElementsByClassName( elm, 'finder-detail-summary' )[ 0 ],
                                tmpButtons = Util.copyArray( this.appButtons ),
-                               apps, app, elmContainer;
+                               apps, app, elmContainer, button;
                        if( thumb.image ){
                                elmThumb.className = 'has-thumbnail';
                                elmThumb.style.backgroundImage = [ 'url(', thumb.image, ')' ].join( '' );
@@ -7024,7 +7026,8 @@ var XBrowserStyle = ( function(){
                                        right  = this.get( name + 'Right' ),
                                        bottom = this.get( name + 'Bottom' ),
                                        left   = this.get( name + 'Left' ),
-                                       ret    = new PropertyGroup( name, top, right, bottom, left );
+                                       ret    = new PropertyGroup( name, top, right, bottom, left),
+                    all;
                                if( ret.isValid() === true ) return ret;
                                ret.kill();
                                all    = this.style[ name ].split( '(' )[ 1 ].split( ')' )[ 0 ].split( CLIP_SEPARATOR );
@@ -7746,7 +7749,7 @@ var XDocument = ( function( window, document ){
                                        parent  = this.__parent,
                                        size, data, w, h;
                                
-                               if( content || ( style && style.hasStyle === true ) ){
+                               if( content || ( style && style.hasPaint === true ) ){
                                        if( !this.elmWrap ){
                                                this.elmWrap = DOM.createDiv();
                                                parent.addDisplayElement( this );
@@ -7779,7 +7782,7 @@ var XDocument = ( function( window, document ){
                                        parent.removeDisplayElement( this );
                                };
                        },
-                       preSizing : function( boxX, boxY, boxW, boxH, contentX, contentY, contentW, contentH ){
+                       preSizing : function(){
                                var parent   = nodeData.__parent,
                                        allowW   = parent.contentWidth,
                                        allowH   = parent.contentHeight,