r63551 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63550‎ | r63551 | r63552 >
Date:13:47, 10 March 2010
Author:jojo
Status:ok (Comments)
Tags:
Comment:
changed link text, added icon
Modified paths:
  • /trunk/extensions/Collection/Collection.hooks.php (modified) (history)
  • /trunk/extensions/Collection/Collection.php (modified) (history)
  • /trunk/extensions/Collection/CollectionCore.i18n.php (modified) (history)
  • /trunk/extensions/Collection/js/bookcreator.js (modified) (history)

Diff [purge]

Index: trunk/extensions/Collection/Collection.php
@@ -280,15 +280,20 @@
281281 $wgAjaxExportList[] = 'wfAjaxCollectionClear';
282282
283283 function wfAjaxCollectionGetPopupData( $title ) {
 284+ global $wgScriptPath;
 285+
284286 wfLoadExtensionMessages( 'CollectionCore' );
285287 $json = new Services_JSON();
286288 $result = array();
 289+ $imagePath = "$wgScriptPath/extensions/Collection/images";
287290 if ( CollectionSession::findArticle( $title ) == -1 ) {
288291 $result['action'] = 'add';
289 - $result['text'] = wfMsg( 'coll-add_linked_article', $title );
 292+ $result['text'] = wfMsg( 'coll-add_linked_article' );
 293+ $result['img'] = "$imagePath/silk-add.png";
290294 } else {
291295 $result['action'] = 'remove';
292 - $result['text'] = wfMsg( 'coll-remove_linked_article', $title );
 296+ $result['text'] = wfMsg( 'coll-remove_linked_article' );
 297+ $result['img'] = "$imagePath/silk-remove.png";
293298 }
294299 $r = new AjaxResponse( $json->encode( $result ) );
295300 $r->setContentType( 'application/json' );
Index: trunk/extensions/Collection/Collection.hooks.php
@@ -292,6 +292,7 @@
293293 background-color: #fea;
294294 z-index: 9999;
295295 display: inline;
 296+ font-size: 10pt;
296297 }
297298 EOS
298299 , false
Index: trunk/extensions/Collection/CollectionCore.i18n.php
@@ -36,8 +36,8 @@
3737 'coll-disable' => 'disable',
3838 'coll-book_creator_disable' => 'Disable book creator',
3939 'coll-book_creator_disable_tooltip' => 'Stop using the book creator',
40 - 'coll-add_linked_article' => 'Add page $1 to your book',
41 - 'coll-remove_linked_article' => 'Remove page $1 from your book',
 40+ 'coll-add_linked_article' => 'Add linked wiki page to your book',
 41+ 'coll-remove_linked_article' => 'Remove linked wiki page from your book',
4242 'coll-add_category' => 'Add this category to your book',
4343 'coll-add_category_tooltip' => 'Add all wiki pages in this category to your book',
4444 'coll-add_this_page' => 'Add this page to your book',
Index: trunk/extensions/Collection/js/bookcreator.js
@@ -84,6 +84,7 @@
8585 visible = true;
8686 addremove_link
8787 .text(result.text)
 88+ .prepend('<img src="' + result.img + '" alt="">&nbsp;')
8889 .unbind('click')
8990 .click(function(e) { addremove_article(result.action, title); });
9091 popup_div

Comments

#Comment by Tim Starling (talk | contribs)   19:24, 10 March 2010

I think you should encode result.img properly here,

#Comment by Jbeigel (talk | contribs)   11:18, 11 March 2010

Yes, that should be fixed in r63592. Thanks!

Status & tagging log