mirror of
https://bitbucket.org/vertlach/voteny.git
synced 2024-05-01 11:29:19 +03:00
Allow star rating to be used outside of the page which has the <vote type=1 /> tag
This ability was removed in version 2.4 (r108076) in favor of using the wgArticleId JS global, but doing so essentially broke things like the ImageRating extension, which rely on knowing a "remote" page's ID since wgArticleId is obviously 0 for special: pages. Change-Id: I644cbd57c11114758f229ca052c51328513e59a1
This commit is contained in:
parent
33f5015197
commit
8762715a91
4
Vote.js
4
Vote.js
|
@ -173,7 +173,7 @@ $( function() {
|
|||
var that = $( this );
|
||||
vote.clickVoteStars(
|
||||
that.data( 'vote-the-vote' ),
|
||||
mw.config.get( 'wgArticleId' ),
|
||||
$( this ).data( 'page-id' ),
|
||||
that.data( 'vote-id' ),
|
||||
that.data( 'vote-action' )
|
||||
);
|
||||
|
@ -196,7 +196,7 @@ $( function() {
|
|||
// Remove vote (rating stars)
|
||||
$( 'body' ).on( 'click', '.vote-remove-stars-link', function() {
|
||||
vote.unVoteStars(
|
||||
mw.config.get( 'wgArticleId' ),
|
||||
$( this ).data( 'page-id' ),
|
||||
$( this ).data( 'vote-id' )
|
||||
);
|
||||
} );
|
||||
|
|
|
@ -291,7 +291,7 @@ class VoteStars extends Vote {
|
|||
$output .= '<div class="rating-voted">' .
|
||||
wfMessage( 'voteny-gave-this', $already_voted )->parse() .
|
||||
" </div>
|
||||
<a href=\"javascript:void(0);\" class=\"vote-remove-stars-link\" data-vote-id=\"{$id}\">("
|
||||
<a href=\"javascript:void(0);\" class=\"vote-remove-stars-link\" data-page-id=\"{$this->PageID}\" data-vote-id=\"{$id}\">("
|
||||
. wfMessage( 'voteny-remove' )->plain() .
|
||||
')</a>';
|
||||
}
|
||||
|
@ -329,6 +329,7 @@ class VoteStars extends Vote {
|
|||
$action = 5;
|
||||
}
|
||||
$output .= "<img class=\"vote-rating-star\" data-vote-the-vote=\"{$x}\"" .
|
||||
" data-page-id=\"{$this->PageID}\"" .
|
||||
" data-vote-id=\"{$id}\" data-vote-action=\"{$action}\" data-vote-rating=\"{$rating}\"" .
|
||||
" data-vote-voted=\"{$voted}\" id=\"rating_{$id}_{$x}\"" .
|
||||
" src=\"{$wgExtensionAssetsPath}/VoteNY/images/star_";
|
||||
|
|
Loading…
Reference in a new issue