/*
* pettanR peta.apps.js
- * version 0.5.7
+ * version 0.5.8
*
* author:
* itozyun
if( l === 0) return;
for( var i=0; i<l; ++i ){
buildFileData( _json[ i], _data);
- }
+ };
} else
if( _json.id ){
buildFileData( _json, _data );
- }
+ };
_file.dispatchEvent( FileAPI.createFileEvent( Const.FILE.EVENT.GET_SEQENTIAL_FILES, _file, 'children', null) );
- }
+ };
function onErrorJson( _file ){
var _data = FileAPI.getFileData( _file);
if( _data !== null){
_data.state = Const.FILE.STATE.ERROR;
- }
- }
+ };
+ };
function buildFileData( _data, _parent ){
var _array, i, l;
// Panel
_rule = _license[ BASIC_LICENSES[ i]];
if( typeof _rule === 'number' && _rule === 1 ){
_bits += _Math_pow( 2, i );
- }
- }
+ };
+ };
_data.license = _bits;
- }
+ };
} else {
alert( 'error' );
- }
+ };
_data.driver = Driver;
};
};
return _data;
- }
+ };
function addChildData( _parent, _child ){
if( Type.isArray( _parent.children ) === false){
_parent.children = [];
_type = _data !== null ? _data.type : null;
if( _type === FILE_TYPE.PICTURE ){
return { image: [ pettanr.CONST.RESOURCE_PICTURE_PATH, 'thumbnail/', _data.id, '.', _data.ext ].join( '' )};
- }
+ };
if( _data === FILE_DATA_COMICS_ROOT ){
return { className: 'file-type-cabinet' };
- }
+ };
if( _type === FILE_TYPE.COMIC ){
return { className: 'file-type-comic' };
- }
+ };
if( _type === FILE_TYPE.PANEL ){
return { className: 'file-type-panel' };
- }
+ };
if( _type === FILE_TYPE.AUTHOR ){
return { className: 'file-type-author' };
- }
+ };
if( _type === FILE_TYPE.ARTIST ){
return { className: 'file-type-artist' };
- }
+ };
if( _type === FILE_TYPE.FOLDER){
return { className: 'file-type-folder' };
- }
+ };
return { className: 'file-type-broken' };
};
this.getSummary = function( _file ){
_type = _data !== null ? _data.type : null;
if( _type === FILE_TYPE.PICTURE ){
return [ _data.width, 'x', _data.height, ', filesize:', _data.filesize, ', lisence:', _data.license ].join( '' );
- }
+ };
if( _data === FILE_DATA_COMICS_ROOT ){
return 'cabinet file';
- }
+ };
if( _type === FILE_TYPE.COMIC ){
return 'comic file, id:' + _data.id;
- }
+ };
if( _type === FILE_TYPE.PANEL ){
return [ _data.width, 'x', _data.height ].join( '' );
- }
+ };
if( _type === FILE_TYPE.AUTHOR ){
return 'author file, id:' + _data.id;
- }
+ };
if( _type === FILE_TYPE.ARTIST ){
return [ 'id:', _data.id, ' Email:', _data.email || 'empty' , ', HP:', _data.homepage_url || 'empty' ].join( '' );
- }
+ };
if( _type === FILE_TYPE.FOLDER ){
return 'pettanR folder';
- }
+ };
return 'pettanR unknown file';
};
this.read = function( _file ){
return ret;
}
if( _type === FILE_TYPE.PANEL ){
- }
+ };
if( _type === FILE_TYPE.PANEL_PICTURE ){
- }
+ };
if( _type === FILE_TYPE.BALLOON ){
- }
+ };
if( _type === FILE_TYPE.PICTURE ){
- }
+ };
};
this.write = function( _file, _newData, _onUpdate ){
var _data = FileAPI.getFileData( _file ),
_type = _data !== null ? _data.type : null;
if( _type === FILE_TYPE.COMIC ){
- }
+ };
if( _type === FILE_TYPE.PANEL ){
- }
+ };
if( _type === FILE_TYPE.PANEL_PICTURE ){
- }
+ };
if( _type === FILE_TYPE.BALLOON ){
- }
+ };
if( _type === FILE_TYPE.PICTURE ){
- }
+ };
};
this.viewerApplicationList = function( _file ){
var _data = FileAPI.getFileData( _file ),
_type = _data !== null ? _data.type : null;
if( _type === FILE_TYPE.PANEL ){
return [ Reader ];
- }
+ };
if( _type === FILE_TYPE.COMIC ){
return [ Reader ];
- }
+ };
if( _data === FILE_DATA_MY_PICTURES_ROOT ){
return [ PremiumSatge ];
- }
+ };
if( _type === FILE_TYPE.ARTIST ){
return [ PremiumSatge ];
- }
+ };
return [];
};
this.editorApplicationList = function( _file ){
});
},
update: function( currentElement ){
-
- if( currentLock === true && currentElement === null) return;
-
+ if( currentLock === true && currentElement === null ) return;
+
var _elementType = currentElement === null ? -1 : currentElement.type,
x = currentElement !== null ? currentElement.x : 0,
y = currentElement !== null ? currentElement.y : 0,
a = _elementType === PANEL_ELEMENT_TYPE_TEXT ? Math.floor( currentElement.angle() ) : 0,
w = currentElement !== null ? currentElement.w : 0,
h = currentElement !== null ? currentElement.h : 0,
- actualW = _elementType === PANEL_ELEMENT_TYPE_IMAGE ? currentElement.actualW() : 1,
- actualH = _elementType === PANEL_ELEMENT_TYPE_IMAGE ? currentElement.actualH() : 1,
- wPercent = _elementType === PANEL_ELEMENT_TYPE_IMAGE ? Math.floor( w / actualW *100 ) : 0,
- hPercent = _elementType === PANEL_ELEMENT_TYPE_IMAGE ? Math.floor( h / actualH *100 ) : 0,
+ actualW = _elementType === PANEL_ELEMENT_TYPE_IMAGE ? currentElement.actualW() : 1,
+ actualH = _elementType === PANEL_ELEMENT_TYPE_IMAGE ? currentElement.actualH() : 1,
+ wPercent = _elementType === PANEL_ELEMENT_TYPE_IMAGE ? Math.floor( w / actualW *100 ) : 0,
+ hPercent = _elementType === PANEL_ELEMENT_TYPE_IMAGE ? Math.floor( h / actualH *100 ) : 0,
keepAspect = currentElement !== null && currentElement.keepAspect === true;
if( currentElementType !== _elementType ){