Index: trunk/extensions/Collection/Collection.php |
— | — | @@ -320,6 +320,12 @@ |
321 | 321 | $json = new Services_JSON(); |
322 | 322 | $result = array(); |
323 | 323 | $imagePath = "$wgScriptPath/extensions/Collection/images"; |
| 324 | + $t = Title::newFromText( $title ); |
| 325 | + if ( $t->isRedirect() ) { |
| 326 | + $a = new Article( $t, 0 ); |
| 327 | + $t = $a->followRedirect(); |
| 328 | + $title = $t->getPrefixedText(); |
| 329 | + } |
324 | 330 | if ( CollectionSession::findArticle( $title ) == - 1 ) { |
325 | 331 | $result['action'] = 'add'; |
326 | 332 | $result['text'] = wfMsg( 'coll-add_linked_article' ); |
— | — | @@ -329,6 +335,7 @@ |
330 | 336 | $result['text'] = wfMsg( 'coll-remove_linked_article' ); |
331 | 337 | $result['img'] = "$imagePath/silk-remove.png"; |
332 | 338 | } |
| 339 | + $result['title'] = $title; |
333 | 340 | $r = new AjaxResponse( $json->encode( $result ) ); |
334 | 341 | $r->setContentType( 'application/json' ); |
335 | 342 | return $r; |
Index: trunk/extensions/Collection/js/bookcreator.js |
— | — | @@ -106,7 +106,7 @@ |
107 | 107 | .text('\u00a0' + result.text) |
108 | 108 | .prepend(img) |
109 | 109 | .unbind('click') |
110 | | - .click(function(e) { addremove_article(result.action, title); }); |
| 110 | + .click(function(e) { addremove_article(result.action, result.title); }); |
111 | 111 | popup_div |
112 | 112 | .css({left: mouse_pos.x + 2 + 'px', |
113 | 113 | top: mouse_pos.y + 2 + 'px'}) |