r64474 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64473‎ | r64474 | r64475 >
Date:05:15, 1 April 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Fixed images in Storyboard tag
Modified paths:
  • /trunk/extensions/Storyboard/api/ApiQueryStories.php (modified) (history)
  • /trunk/extensions/Storyboard/tags/Storyboard/storyboard.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Storyboard/tags/Storyboard/storyboard.js
@@ -83,15 +83,16 @@
8484 ) //TODO
8585 .appendTo( $header );
8686
87 - $storyBody.append( $( "<div />" ).addClass( "story-text" )
88 - .text( story["*"] )
89 - .prepend( $( "<img />" )
90 - // TODO: replace by wgScriptPath + path/to/scropped/img
91 - .attr( "src", "http://upload.wikimedia.org/wikipedia/mediawiki/9/99/SemanticMaps.png" )
92 - .addClass( "story-image" )
93 - )
94 - );
 87+ var textAndImg = $( "<div />" ).addClass( "story-text" ).text( story["*"] );
9588
 89+ if ( story.imageurl ) {
 90+ textAndImg.prepend(
 91+ $( "<img />" ).attr( "src", story.imageurl ).addClass( "story-image" )
 92+ );
 93+ }
 94+
 95+ $storyBody.append( textAndImg );
 96+
9697 // TODO: add delete button that hides the story from the storyboard (=unpublish+hide?)
9798
9899 $storyboard.append( $storyBody );
Index: trunk/extensions/Storyboard/api/ApiQueryStories.php
@@ -49,7 +49,9 @@
5050 $this->addTables( 'storyboard' );
5151 $this->addFields( array(
5252 'story_id',
 53+ 'story_author_id',
5354 'story_author_name',
 55+ 'story_author_image',
5456 'story_title',
5557 'story_text',
5658 'story_created'
@@ -91,6 +93,7 @@
9294 'author' => $story->story_author_name,
9395 'title' => $story->story_title,
9496 'created' => wfTimestamp( TS_ISO_8601, $story->story_created ),
 97+ 'imageurl' => $story->story_author_image
9598 );
9699 ApiResult::setContent( $res, ( is_null( $story->story_text ) ? '' : $story->story_text ) );
97100 $this->getResult()->addValue( array( 'query', $this->getModuleName() ), null, $res );

Status & tagging log