forked from Botanical/BotanJS
SiteFile can now have original size
This commit is contained in:
@@ -32,37 +32,35 @@
|
||||
}
|
||||
this.id = id;
|
||||
this.hash = hash;
|
||||
this.type = IDOMElement( stage ).getDAttribute( "type" );
|
||||
this.type = IDOMElement( stage ).getDAttribute( "type" );
|
||||
|
||||
if(!( this.type == "default" || this.type == null )) return this;
|
||||
if( stage.getAttribute( "noauto" ) != null ) return this;
|
||||
|
||||
var applyStructure = function( obj )
|
||||
{
|
||||
// remove loading bubbles
|
||||
while( stage.hasChildNodes() ) stage.removeChild(stage.firstChild);
|
||||
|
||||
/** @type {_AstJson_.SiteFile} */
|
||||
var finfo = JSON.parse( obj ).file;
|
||||
|
||||
switch( finfo.type )
|
||||
{
|
||||
case "image":
|
||||
var node = Dand.wrap('img');
|
||||
var k = new IKey( "src", null );
|
||||
var node = Dand.tag( "img", false, stage )[0];
|
||||
|
||||
switch( IDOMElement(stage).getDAttribute('size') )
|
||||
{
|
||||
case "small":
|
||||
k.keyValue = config.path.image.small + hash + '.jpg';
|
||||
node.src = config.path.image.small + hash + '.jpg';
|
||||
break;
|
||||
case "medium":
|
||||
k.keyValue = config.path.image.medium + hash + '.jpg';
|
||||
node.src = config.path.image.medium + hash + '.jpg';
|
||||
break;
|
||||
case "original":
|
||||
node.src = config.path.image.original + hash + '.jpg';
|
||||
break;
|
||||
default: // large
|
||||
k.keyValue = config.path.image.large + hash + '.jpg';
|
||||
node.src = config.path.image.large + hash + '.jpg';
|
||||
}
|
||||
IDOMElement( node ).setAttribute( k );
|
||||
|
||||
stage.appendChild(Dand.wrapne(
|
||||
'a', node
|
||||
@@ -125,9 +123,7 @@
|
||||
// date
|
||||
form.appendChild( Dand.wrapne( 'sup', Dand.wrape( 'Date: ' + getSMStamp( new Date( finfo.date_created ) ) ) ) );
|
||||
|
||||
|
||||
stage.appendChild(form);
|
||||
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user