From 9ac34790085762c1c5e94e2120fbf2e3c938e94e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=96=9F=E9=85=8C=20=E9=B5=AC=E5=85=84?= Date: Tue, 2 Apr 2019 00:52:14 +0800 Subject: [PATCH] Moved SiteFiles.files to SFObjects --- botanjs/src/Astro/Blog/AstroEdit/SiteLibrary.js | 7 +++---- botanjs/src/Astro/Blog/Components/Album.js | 5 +++-- botanjs/src/Astro/Blog/Components/Entry/Block.js | 5 +++-- botanjs/src/Astro/Blog/Components/SiteFile.js | 9 +++++---- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/botanjs/src/Astro/Blog/AstroEdit/SiteLibrary.js b/botanjs/src/Astro/Blog/AstroEdit/SiteLibrary.js index 62dd35d..f37e34d 100644 --- a/botanjs/src/Astro/Blog/AstroEdit/SiteLibrary.js +++ b/botanjs/src/Astro/Blog/AstroEdit/SiteLibrary.js @@ -29,10 +29,9 @@ var postData = __import( "System.Net.postData" ); var prettyDate = __import( "Astro.utils.Date.pretty" ); - var SiteLibrary = function ( basePath, processorGet, processorSet ) { - var - - view_index = [] + var SiteLibrary = function ( basePath, processorGet, processorSet ) + { + var view_index = [] , currentView , inCollection = 0 , indexingItem diff --git a/botanjs/src/Astro/Blog/Components/Album.js b/botanjs/src/Astro/Blog/Components/Album.js index 0d151e9..7e1f5fc 100644 --- a/botanjs/src/Astro/Blog/Components/Album.js +++ b/botanjs/src/Astro/Blog/Components/Album.js @@ -86,9 +86,10 @@ config = Conf.get( "SiteFile" ); if( config ) { - for( var i in config.files ) + var SFOs = Conf.get( "SFObjects" ); + for( var i in SFOs ) { - var f = config.files[i]; + var f = SFOs[i]; new Album( f[0], f[1] ); } } diff --git a/botanjs/src/Astro/Blog/Components/Entry/Block.js b/botanjs/src/Astro/Blog/Components/Entry/Block.js index fc79eb0..69b07f6 100644 --- a/botanjs/src/Astro/Blog/Components/Entry/Block.js +++ b/botanjs/src/Astro/Blog/Components/Entry/Block.js @@ -61,9 +61,10 @@ throw new Error( obj ); }; - for( var i in config.files ) + var SFOs = Conf.get( "SFObjects" ); + for( var i in SFOs ) { - var f = config.files[i]; + var f = SFOs[i]; var id = f[0]; if( id == bId ) { diff --git a/botanjs/src/Astro/Blog/Components/SiteFile.js b/botanjs/src/Astro/Blog/Components/SiteFile.js index ab1563b..5b8a06e 100644 --- a/botanjs/src/Astro/Blog/Components/SiteFile.js +++ b/botanjs/src/Astro/Blog/Components/SiteFile.js @@ -45,8 +45,8 @@ /** @type {_AstJson_.SiteFile} */ var finfo = JSON.parse( obj ).file; - switch( finfo.type ) { - + switch( finfo.type ) + { case "image": var node = Dand.wrap('img'); var k = new IKey( "src", null ); @@ -151,9 +151,10 @@ config = Conf.get( "SiteFile" ); if( config ) { - for( var i in config.files ) + var SFOs = Conf.get( "SFObjects" ); + for( var i in SFOs ) { - var f = config.files[i]; + var f = SFOs[i]; new SiteFile( f[0], f[1] ); } }