r66094 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66093‎ | r66094 | r66095 >
Date:11:24, 9 May 2010
Author:jeroendedauw
Status:deferred
Tags:
Comment:
Fixed display of image in story review and storyboard tag
Modified paths:
  • /trunk/extensions/Storyboard/api/ApiQueryStories.php (modified) (history)
  • /trunk/extensions/Storyboard/specials/StoryReview/StoryReview_body.php (modified) (history)
  • /trunk/extensions/Storyboard/storyboard.js (modified) (history)
  • /trunk/extensions/Storyboard/tags/Storyboard/storyboard.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Storyboard/tags/Storyboard/storyboard.js
@@ -100,9 +100,9 @@
101101
102102 var textAndImg = $( "<div />" ).addClass( "story-text" ).text( story["*"] );
103103
104 - if ( story.imageurl ) {
 104+ if ( story.imageurl && story.imagehidden == "0" ) {
105105 textAndImg.prepend(
106 - $( "<img />" ).attr( "src", story.imageurl ).addClass( "story-image" )
 106+ $( "<img />" ).attr( {"src": story.imageurl, "title": story.title, "alt": story.title } ).addClass( "story-image" )
107107 );
108108 }
109109
Index: trunk/extensions/Storyboard/specials/StoryReview/StoryReview_body.php
@@ -8,9 +8,7 @@
99 *
1010 * @author Jeroen De Dauw
1111 *
12 - * TODO: implement eternal load (or paging) stuff for each list
1312 * TODO: fix layout
14 - * TODO: ajax load tab contents?
1513 */
1614
1715 if ( !defined( 'MEDIAWIKI' ) ) {
Index: trunk/extensions/Storyboard/storyboard.js
@@ -181,8 +181,17 @@
182182 var textAndImg = jQuery( "<div />" ).addClass( "story-text" ).text( story["*"] );
183183
184184 if ( story.imageurl ) {
 185+ var imgAttr = {
 186+ "src": story.imageurl,
 187+ "id": "story_image_" + story.id,
 188+ "title": story.title,
 189+ "alt": story.title
 190+ };
 191+ if ( story.imagehidden == "1" ) {
 192+ imgAttr.style = "display:none;";
 193+ }
185194 textAndImg.prepend(
186 - jQuery( "<img />" ).attr( "src", story.imageurl ).addClass( "story-image" )
 195+ jQuery( "<img />" ).attr( imgAttr ).addClass( "story-image" )
187196 );
188197 }
189198
@@ -203,6 +212,7 @@
204213 );
205214
206215 // TODO: add review controls
 216+
207217 $storyBody.append(
208218 jQuery( "<div />" ).append( jQuery( "<button />" ).text( "edit" ).attr( "onclick", "window.location='" + story.modifyurl + "'" ) )
209219 );
Index: trunk/extensions/Storyboard/api/ApiQueryStories.php
@@ -55,6 +55,7 @@
5656 'story_author_id',
5757 'story_author_name',
5858 'story_author_image',
 59+ 'story_image_hidden',
5960 'story_author_location',
6061 'story_title',
6162 'story_text',
@@ -132,6 +133,7 @@
133134 'modificationdate' => $wgLang->date( $story->story_modified ),
134135 'location' => $story->story_author_location,
135136 'imageurl' => $story->story_author_image,
 137+ 'imagehidden' => $story->story_image_hidden,
136138 'permalink' => SpecialPage::getTitleFor( 'story', $story->story_title )->getFullURL()
137139 );
138140

Status & tagging log