OSDN Git Service

client is version0.4.32, updated add image.
[pettanr/clientJs.git] / 0.4.x / javascripts / system.js
index 23913d2..6162a6f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  * pettanR system.js
- *   version 0.4.29
+ *   version 0.4.32
  *   
  * author:
  *   itozyun
@@ -974,7 +974,7 @@ pettanr.finder = ( function(){
                }
        }
        
-       var FinderClass = function( ELM_CONTAINER, tree, header, footer ){
+       var FinderClass = function( ELM_CONTAINER, tree, header, footer, onSelect, viewerOption, editorOption ){
                var ICON_ARRAY = [],
                        BREAD_ARRAY = [],
                        elmContainer = ELM_ORIGIN_CONTAINER.cloneNode( true ),
@@ -1059,24 +1059,26 @@ pettanr.finder = ( function(){
                                if( _file !== null && ( _file.getChildFileLength() !== -1 || _file.getType() === pettanr.file.FILE_TYPE.FOLDER)){
                                        tree.down( i );
                                        draw( w, h );
+                               } else {
+                                       Type.isFunction( onSelect ) === true && onSelect( _file  );
                                }
                        }
                }
-               function onEditor( _file, _app ){
-                       _app.boot( _file );
+               function onEditor( _file, _app, editorOption ){
+                       _app.boot( _file, editorOption );
                }
                function onViwer( _file, _app ){
-                       _app.bootInOverlay( _file );
+                       _app.bootInOverlay( _file, viewerOption );
                }
                function onAction( _file ){
 
                }
-               this.rootElement = elmContainer;
+               this.rootElement   = elmContainer;
                this.parentElement = ELM_CONTAINER;
-               this.displayName = 'finder';
-               this.ID = 'finder';
-               this.MIN_WIDTH = 240;
-               this.MIN_HEIGHT = 240;
+               this.displayName   = 'finder';
+               this.ID            = 'finder';
+               this.MIN_WIDTH     = 240;
+               this.MIN_HEIGHT    = 240;
                this.init = function(){
                        //$( elmLocation).click( onHeadClick);
                        //$( elmContainer).click( onBodyClick);
@@ -1127,10 +1129,10 @@ pettanr.finder = ( function(){
                init: function(){
                        
                },
-               createFinder: function( _applicationReference, _elmTarget, _tree, _header, _footer ){
+               createFinder: function( _applicationReference, _elmTarget, _tree, _header, _footer, _onSelect, _viewerOption, _editorOption ){
                        if( pettanr.view.isApplicationReference( _applicationReference ) === false ) return;
                        
-                       var _finder = new FinderClass( _elmTarget, _tree, _header, _footer );
+                       var _finder = new FinderClass( _elmTarget, _tree, _header, _footer, _onSelect, _viewerOption, _editorOption );
                        FINDER_ARRAY.push( _finder );
                        return _finder;
                },
@@ -1153,14 +1155,14 @@ pettanr.finder = ( function(){
 
 
 pettanr.driver = ( function(){
-       var MyAuthorID = 'current_author' in window ? current_author.id : ( pettanr.DEBUG ? 1 : -1 ),
-               MyArtistID = 'current_artist' in window ? current_artist.id : ( pettanr.DEBUG ? 1 : -1 ),
+       var MyAuthorID = 'current_author' in window ? current_author.id : ( pettanr.CONST.SERVER_SUPPORT === false ? 1 : -1 ),
+               MyArtistID = 'current_artist' in window ? current_artist.id : ( pettanr.CONST.SERVER_SUPPORT === false ? 1 : -1 ),
                Driver = {
                        getSeqentialFiles: function( _file){
                                var _data = FileAPI.getFileData( _file),
                                        _json = _data !== null ? _data.json : null;
                                if( _json === true && _data.type === pettanr.driver.FILE_TYPE.COMIC ){
-                                       if( pettanr.LOCAL === true ){
+                                       if( pettanr.CONST.SERVER_SUPPORT === false ){
                                                _json = [ 'json\/comics_', _data.id, '.json' ].join( '' );
                                        } else {
                                                _json = [ pettanr.CONST.PETTANR_ROOT_PATH, 'comics\/', _data.id, '.json\/play\/' ].join( '' );
@@ -1558,7 +1560,15 @@ pettanr.driver = ( function(){
                        return pettanr.file.createTree( FILE_DATA_SERVICE_ROOT ); //FILE_DATA_COMICS_ROOT);
                },
                createPictureTree: function(){
-                       return pettanr.file.createTree( FILE_DATA_PICTURE_ROOT );
+                       var _tree  = pettanr.file.createTree( FILE_DATA_PICTURE_ROOT );
+                               _root  = _tree.getRootFile();
+                               _myPic = _root.getChildFileByIndex( 0 );
+                               _pic   = _root.getChildFileByIndex( 1 );
+                       _myPic.getSeqentialFiles();
+                       _pic.getSeqentialFiles();
+                       _myPic.destroy();
+                       _pic.destroy();
+                       return _tree;
                },
                createArtistTree: function(){
                        return pettanr.file.createTree( FILE_DATA_ARTIST_ROOT );
@@ -1778,7 +1788,7 @@ pettanr.premiumSatge = pettanr.view.registerApplication( function(){
 
        elmButton.onclick = clickOK;
        
-       var BASE_PATH = pettanr.LOCAL === true ? 'resource_pictures\/' : pettanr.CONST.RESOURCE_PICTURE_PATH,
+       var BASE_PATH = pettanr.CONST.RESOURCE_PICTURE_PATH,
                THUMB_PATH = BASE_PATH, // + 'thumbnail/',
                LIMIT_FILESIZE = 1024 * 10; // 10KB