From 0d4a780c015a71a5a9aff4effd6d5db1de879646 Mon Sep 17 00:00:00 2001 From: itozyun Date: Mon, 4 Feb 2013 23:23:58 +0900 Subject: [PATCH] Client is version 0.5.46, fixed picture.id --- app/assets/javascripts/peta-apps.js | 38 +- app/assets/javascripts/peta-common.js | 3 +- app/assets/javascripts/system.js | 761 ++++++++++++++++++++++------------ 3 files changed, 505 insertions(+), 297 deletions(-) diff --git a/app/assets/javascripts/peta-apps.js b/app/assets/javascripts/peta-apps.js index 0b1a9310..8065af19 100644 --- a/app/assets/javascripts/peta-apps.js +++ b/app/assets/javascripts/peta-apps.js @@ -1,6 +1,6 @@ /* * pettanR peta.apps.js - * version 0.5.44 + * version 0.5.46 * * author: * itozyun @@ -447,6 +447,7 @@ 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 : @@ -458,10 +459,7 @@ 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, @@ -3488,7 +3486,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 +3683,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 +3708,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 +3753,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 +4067,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 +5037,7 @@ var Model = ( function(){ function getPanelElementByTiming(){ var i, l = panelElementArray.length; while( timing < l * 2 ){ - for( i=0; i