From 0439e5b3fe4424d05920009f9e1a53217d63eef1 Mon Sep 17 00:00:00 2001 From: Alexander Yakovlev Date: Wed, 18 Jan 2017 16:13:57 +0700 Subject: [PATCH] Forked, renamed, butchered and applied. --- ApiIUT.php | 102 ++++++++++ ApiVoteNY.php | 143 -------------- IUT.css | 1 + IUT.js | 101 ++++++++++ IUTClass.php | 194 ++++++++++++++++++ IUTHooks.php | 117 +++++++++++ SpecialTopRatings.php | 194 ------------------ Vote.css | 63 ------ Vote.js | 200 ------------------- VoteClass.php | 367 ----------------------------------- VoteHooks.php | 223 --------------------- VoteNY.alias.php | 15 -- VoteNY.i18n.magic.php | 11 -- extension.json | 57 ++---- i18n/ast.json | 28 --- i18n/bg.json | 8 - i18n/ca.json | 18 -- i18n/ce.json | 8 - i18n/de-formal.json | 8 - i18n/de.json | 20 -- i18n/diq.json | 15 -- i18n/dsb.json | 18 -- i18n/dty.json | 8 - i18n/en-gb.json | 18 -- i18n/en.json | 26 +-- i18n/es.json | 19 -- i18n/fa.json | 20 -- i18n/fi.json | 17 -- i18n/fr.json | 31 --- i18n/frp.json | 15 -- i18n/gl.json | 29 --- i18n/he.json | 20 -- i18n/hsb.json | 18 -- i18n/id.json | 8 - i18n/it.json | 19 -- i18n/ja.json | 19 -- i18n/ka.json | 9 - i18n/ko.json | 20 -- i18n/ksh.json | 18 -- i18n/lb.json | 15 -- i18n/mk.json | 28 --- i18n/ms.json | 18 -- i18n/nap.json | 18 -- i18n/nl.json | 19 -- i18n/pl.json | 15 -- i18n/pms.json | 19 -- i18n/ps.json | 8 - i18n/pt-br.json | 10 - i18n/qqq.json | 25 +-- i18n/ro.json | 10 - i18n/roa-tara.json | 18 -- i18n/ru.json | 19 -- i18n/si.json | 17 -- i18n/sr-ec.json | 8 - i18n/sr-el.json | 8 - i18n/sv.json | 18 -- i18n/ta.json | 9 - i18n/tl.json | 19 -- i18n/uk.json | 29 --- i18n/yue.json | 9 - i18n/zh-hans.json | 31 --- i18n/zh-hant.json | 19 -- images/star_half.gif | Bin 637 -> 0 bytes images/star_off.gif | Bin 631 -> 0 bytes images/star_on.gif | Bin 627 -> 0 bytes images/star_voted.gif | Bin 612 -> 0 bytes vote.mysql => iusethis.mysql | 11 +- vote.postgres | 21 -- 68 files changed, 546 insertions(+), 2100 deletions(-) create mode 100644 ApiIUT.php delete mode 100644 ApiVoteNY.php create mode 100644 IUT.css create mode 100644 IUT.js create mode 100644 IUTClass.php create mode 100644 IUTHooks.php delete mode 100644 SpecialTopRatings.php delete mode 100644 Vote.css delete mode 100644 Vote.js delete mode 100644 VoteClass.php delete mode 100644 VoteHooks.php delete mode 100644 VoteNY.alias.php delete mode 100644 VoteNY.i18n.magic.php delete mode 100644 i18n/ast.json delete mode 100644 i18n/bg.json delete mode 100644 i18n/ca.json delete mode 100644 i18n/ce.json delete mode 100644 i18n/de-formal.json delete mode 100644 i18n/de.json delete mode 100644 i18n/diq.json delete mode 100644 i18n/dsb.json delete mode 100644 i18n/dty.json delete mode 100644 i18n/en-gb.json delete mode 100644 i18n/es.json delete mode 100644 i18n/fa.json delete mode 100644 i18n/fi.json delete mode 100644 i18n/fr.json delete mode 100644 i18n/frp.json delete mode 100644 i18n/gl.json delete mode 100644 i18n/he.json delete mode 100644 i18n/hsb.json delete mode 100644 i18n/id.json delete mode 100644 i18n/it.json delete mode 100644 i18n/ja.json delete mode 100644 i18n/ka.json delete mode 100644 i18n/ko.json delete mode 100644 i18n/ksh.json delete mode 100644 i18n/lb.json delete mode 100644 i18n/mk.json delete mode 100644 i18n/ms.json delete mode 100644 i18n/nap.json delete mode 100644 i18n/nl.json delete mode 100644 i18n/pl.json delete mode 100644 i18n/pms.json delete mode 100644 i18n/ps.json delete mode 100644 i18n/pt-br.json delete mode 100644 i18n/ro.json delete mode 100644 i18n/roa-tara.json delete mode 100644 i18n/ru.json delete mode 100644 i18n/si.json delete mode 100644 i18n/sr-ec.json delete mode 100644 i18n/sr-el.json delete mode 100644 i18n/sv.json delete mode 100644 i18n/ta.json delete mode 100644 i18n/tl.json delete mode 100644 i18n/uk.json delete mode 100644 i18n/yue.json delete mode 100644 i18n/zh-hans.json delete mode 100644 i18n/zh-hant.json delete mode 100644 images/star_half.gif delete mode 100644 images/star_off.gif delete mode 100644 images/star_on.gif delete mode 100644 images/star_voted.gif rename vote.mysql => iusethis.mysql (62%) delete mode 100644 vote.postgres diff --git a/ApiIUT.php b/ApiIUT.php new file mode 100644 index 0000000..1ca1d1c --- /dev/null +++ b/ApiIUT.php @@ -0,0 +1,102 @@ +getUser(); + + // Get the request parameters + $params = $this->extractRequestParams(); + + $action = $params['what']; + + // If the "what" param isn't present, we don't know what to do! + if ( !$action || $action === null ) { + $this->dieUsageMsg( 'missingparam' ); + } + + // Need to have sufficient user rights to proceed... + if ( !$user->isAllowed( 'iusethis' ) ) { + $this->dieUsageMsg( 'badaccess-group0' ); + } + + // Ensure that the page ID is present and that it really is numeric + $pageId = $params['pageId']; + + if ( !$pageId || $pageId === null || !is_numeric( $pageId ) ) { + $this->dieUsageMsg( array( 'missingparam', 'pageId' ) ); + } + + $this->vote = new Vote( $pageId ); + + switch ( $action ) { + case 'delete': + $this->vote->delete(); + $output = $this->vote->count( 1 ); + break; + case 'vote': + case 'iusethis': + default: + $this->vote->insert(); + $output = $this->vote->count( 1 ); + break; + } + + // Top level + $this->getResult()->addValue( null, $this->getModuleName(), + array( 'result' => $output ) + ); + + return true; + } + + public function needsToken() { + return 'csrf'; + } + + public function isWriteMode() { + return true; + } + + /** + * @return array + */ + public function getAllowedParams() { + return array( + 'what' => array( + ApiBase::PARAM_TYPE => 'string', + ApiBase::PARAM_REQUIRED => true + ), + 'pageId' => array( + ApiBase::PARAM_TYPE => 'integer', + ApiBase::PARAM_REQUIRED => true + ), + 'type' => array( + ApiBase::PARAM_TYPE => 'string', + ) + ); + } + + /** + * @see ApiBase::getExamplesMessages() + */ + protected function getExamplesMessages() { + return array( + 'action=voteny&what=vote&pageId=666' => 'apihelp-voteny-example-1', + 'action=voteny&what=delete&pageId=666' => 'apihelp-voteny-example-2', + 'action=voteny&what=vote&type=stars&pageId=666' => 'apihelp-voteny-example-3', + 'action=voteny&what=delete&type=stars&pageId=666' => 'apihelp-voteny-example-4', + 'action=voteny&what=multi&type=stars&pageId=666' => 'apihelp-voteny-example-5' + ); + } +} diff --git a/ApiVoteNY.php b/ApiVoteNY.php deleted file mode 100644 index 90d5e00..0000000 --- a/ApiVoteNY.php +++ /dev/null @@ -1,143 +0,0 @@ -getUser(); - - // Get the request parameters - $params = $this->extractRequestParams(); - - $action = $params['what']; - - // If the "what" param isn't present, we don't know what to do! - if ( !$action || $action === null ) { - $this->dieUsageMsg( 'missingparam' ); - } - - // Need to have sufficient user rights to proceed... - if ( !$user->isAllowed( 'voteny' ) ) { - $this->dieUsageMsg( 'badaccess-group0' ); - } - - // Ensure that the page ID is present and that it really is numeric - $pageId = $params['pageId']; - - if ( !$pageId || $pageId === null || !is_numeric( $pageId ) ) { - $this->dieUsageMsg( array( 'missingparam', 'pageId' ) ); - } - - // Vote value is needed for actual vote actions, i.e. everything but "delete" - $voteValue = $params['voteValue']; - - if ( !( $voteValue || $voteValue === null ) && $action !== 'delete' ) { - $this->dieUsageMsg( array( 'missingparam', 'voteValue' ) ); - } - - // Set the private class member variable and do something... - if ( isset( $params['type'] ) && $params['type'] && $params['type'] == 'stars' ) { - $this->vote = new VoteStars( $pageId ); - - switch ( $action ) { - case 'delete': - $this->vote->delete(); - $output = $this->vote->display(); - break; - case 'multi': - if ( $this->vote->UserAlreadyVoted() ) { - $this->vote->delete(); - } - $this->vote->insert( $voteValue ); - $output = $this->vote->displayScore(); - break; - case 'vote': - default: - if ( $this->vote->UserAlreadyVoted() ) { - $this->vote->delete(); - } - $this->vote->insert( $voteValue ); - $output = $this->vote->display( $voteValue ); - break; - } - } else { - $this->vote = new Vote( $pageId ); - - switch ( $action ) { - case 'delete': - $this->vote->delete(); - $output = $this->vote->count( 1 ); - break; - case 'vote': - default: - $this->vote->insert( $voteValue ); - $output = $this->vote->count( 1 ); - break; - } - } - - // Top level - $this->getResult()->addValue( null, $this->getModuleName(), - array( 'result' => $output ) - ); - - return true; - } - - public function needsToken() { - return 'csrf'; - } - - public function isWriteMode() { - return true; - } - - /** - * @return array - */ - public function getAllowedParams() { - return array( - 'what' => array( - ApiBase::PARAM_TYPE => 'string', - ApiBase::PARAM_REQUIRED => true - ), - 'pageId' => array( - ApiBase::PARAM_TYPE => 'integer', - ApiBase::PARAM_REQUIRED => true - ), - 'voteValue' => array( - ApiBase::PARAM_TYPE => 'integer', - ), - 'type' => array( - ApiBase::PARAM_TYPE => 'string', - ) - ); - } - - /** - * @see ApiBase::getExamplesMessages() - */ - protected function getExamplesMessages() { - return array( - 'action=voteny&what=vote&pageId=666' => 'apihelp-voteny-example-1', - 'action=voteny&what=delete&pageId=666' => 'apihelp-voteny-example-2', - 'action=voteny&what=vote&type=stars&pageId=666&voteValue=3' => 'apihelp-voteny-example-3', - 'action=voteny&what=delete&type=stars&pageId=666' => 'apihelp-voteny-example-4', - 'action=voteny&what=multi&type=stars&pageId=666&voteValue=4' => 'apihelp-voteny-example-5' - ); - } -} diff --git a/IUT.css b/IUT.css new file mode 100644 index 0000000..42e7c36 --- /dev/null +++ b/IUT.css @@ -0,0 +1 @@ +/* CSS for IUseThis extension */ diff --git a/IUT.js b/IUT.js new file mode 100644 index 0000000..b4d71d8 --- /dev/null +++ b/IUT.js @@ -0,0 +1,101 @@ +/** + * JavaScript functions for Vote extension. + * + * TODO: Should refactor this into a jQuery widget. + * The widget should get a PageID in its constructor so it can work on any page + * for any page and with multiple instances per page. + * + * @constructor + * + * @author Jack Phoenix + * @author Daniel A. R. Werner < daniel.a.r.werner@gmail.com > + */ +var IUT = function IUT() { + this.clearRatingTimer = null; + this.voted_new = []; + this.id = 0; + this.last_id = 0; + this.imagePath = mw.config.get( 'wgExtensionAssetsPath' ) + '/VoteNY/images/'; + + /** + * Called when voting through the green square voting box + * + * @param TheVote + * @param PageID Integer: internal ID number of the current article + */ + this.clickVote = function( TheVote, PageID ) { + ( new mw.Api() ).postWithToken( 'edit', { + action: 'iusethis', + format: 'json', + what: 'vote', + pageId: PageID, + voteValue: TheVote + } ).done( function( data ) { + $( '#PollVotes' ).html( data.iusethis.result ); + $( '#Answer' ).html( + '' + + mediaWiki.msg( 'iusethis-unvote-link' ) + '' + ); + } ); + }; + + /** + * Called when removing your vote through the green square voting box + * + * @param PageID Integer: internal ID number of the current article + */ + this.unVote = function( PageID ) { + ( new mw.Api() ).postWithToken( 'edit', { + action: 'voteny', + format: 'json', + what: 'delete', + pageId: PageID + } ).done( function( data ) { + $( '#PollVotes' ).html( data.iusethis.result ); + $( '#Answer' ).html( + '' + + mediaWiki.msg( 'iusethis-link' ) + '' + ); + } ); + }; + + this.startClearRating = function( id, rating, voted ) { + var voteNY = this; + this.clearRatingTimer = setTimeout( function() { + voteNY.clearRating( id, 0, rating, voted ); + }, 200 ); + }; + + this.clearRating = function( id, num, prev_rating, voted ) { + if ( this.voted_new[id] ) { + voted = this.voted_new[id]; + } + }; + + this.updateRating = function( id, num, prev_rating ) { + if ( this.clearRatingTimer && this.last_id == id ) { + clearTimeout( this.clearRatingTimer ); + } + this.clearRating( id, num, prev_rating ); + for ( var x = 1; x <= num; x++ ) { + $( '#rating_' + id + '_' + x ).attr( 'src', this.imagePath + 'star_voted.gif' ); + } + this.last_id = id; + }; +}; + +// TODO: Make event handlers part of a widget as described in the VoteNY's TODO and reduce this +// code to instantiating such a widget for the current wiki page if required. +$( function() { + var vote = new IUT(); + + // Green voting box's link + $( '.vote-action' ).on( 'click', '> a', function( event ) { + if ( $( this ).hasClass( 'vote-unvote-link' ) ) { + vote.unVote( mw.config.get( 'wgArticleId' ) ); + } else { + vote.clickVote( 1, mw.config.get( 'wgArticleId' ) ); + } + } ); + +} ); diff --git a/IUTClass.php b/IUTClass.php new file mode 100644 index 0000000..7e287ab --- /dev/null +++ b/IUTClass.php @@ -0,0 +1,194 @@ +PageID = $pageID; + $this->Username = $wgUser->getName(); + $this->Userid = $wgUser->getID(); + } + + /** + * Counts all votes, fetching the data from memcached if available + * or from the database if memcached isn't available + * + * @return int Amount of votes + */ + function count() { + global $wgMemc; + + $key = wfMemcKey( 'vote', 'count', $this->PageID ); + $data = $wgMemc->get( $key ); + + // Try cache + if ( $data ) { + wfDebug( "Loading vote count for page {$this->PageID} from cache\n" ); + $vote_count = $data; + } else { + $dbr = wfGetDB( DB_SLAVE ); + $vote_count = 0; + $res = $dbr->select( + 'IUseThis', + 'COUNT(*) AS votecount', + array( 'vote_page_id' => $this->PageID ), + __METHOD__ + ); + $row = $dbr->fetchObject( $res ); + if ( $row ) { + $vote_count = $row->votecount; + } + $wgMemc->set( $key, $vote_count ); + } + + return $vote_count; + } + + /** + * Clear caches - memcached, parser cache and Squid cache + */ + function clearCache() { + global $wgUser, $wgMemc; + + // Kill internal cache + $wgMemc->delete( wfMemcKey( 'iusethis', 'count', $this->PageID ) ); + $wgMemc->delete( wfMemcKey( 'iusethis', 'avg', $this->PageID ) ); + + // Purge squid + $pageTitle = Title::newFromID( $this->PageID ); + if ( is_object( $pageTitle ) ) { + $pageTitle->invalidateCache(); + $pageTitle->purgeSquid(); + + // Kill parser cache + $article = new Article( $pageTitle, /* oldid */0 ); + $parserCache = ParserCache::singleton(); + $parserKey = $parserCache->getKey( $article, $wgUser ); + $wgMemc->delete( $parserKey ); + } + } + + /** + * Delete the user's vote from the database, purges normal caches. + */ + function delete() { + $dbw = wfGetDB( DB_MASTER ); + $dbw->delete( + 'IUseThis', + array( + 'vote_page_id' => $this->PageID, + 'username' => $this->Username + ), + __METHOD__ + ); + + $this->clearCache(); + } + + /** + * Inserts a new vote into the IUseThis database table + */ + function insert() { + global $wgRequest; + $dbw = wfGetDB( DB_MASTER ); + wfSuppressWarnings(); // E_STRICT whining + $voteDate = date( 'Y-m-d H:i:s' ); + wfRestoreWarnings(); + if ( $this->UserAlreadyVoted() == false ) { + $dbw->insert( + 'IUseThis', + array( + 'username' => $this->Username, + 'vote_user_id' => $this->Userid, + 'vote_page_id' => $this->PageID, + 'vote_date' => $voteDate, + 'vote_ip' => $wgRequest->getIP(), + ), + __METHOD__ + ); + + $this->clearCache(); + } + } + + /** + * Checks if a user has already voted + * + * @return bool|int False if s/he hasn't, otherwise returns the + * value of 'vote_value' column from Vote DB table + */ + function UserAlreadyVoted() { + $dbr = wfGetDB( DB_SLAVE ); + $s = $dbr->selectRow( + 'IUseThis', + array( + 'vote_page_id' => $this->PageID, + 'username' => $this->Username + ), + __METHOD__ + ); + if ( $s === false ) { + return false; + } + return true; + } + + /** + * Displays the green voting box + * + * @return string HTML output + */ + function display() { + global $wgUser; + + $voted = $this->UserAlreadyVoted(); + + $make_vote_box_clickable = ''; + if ( $voted == false ) { + $make_vote_box_clickable = ' vote-clickable'; + } + + $output = "
"; + $output .= '' . $this->count() . ' people use this joke '; + $output .= ''; + + if ( !$wgUser->isAllowed( 'iusethis' ) ) { + // @todo FIXME: this is horrible. If we don't have enough + // permissions to vote, we should tell the end-user /that/, + // not require them to log in! + $login = SpecialPage::getTitleFor( 'Userlogin' ); + $output .= '' . + "I use this" . ''; + } else { + if ( !wfReadOnly() ) { + if ( $voted == false ) { + $output .= '' . + "I use this" . ''; + } else { + $output .= '' . + "I don't use this" . ''; + } + } + } + $output .= ''; + $output .= '
'; + + return $output; + } +} diff --git a/IUTHooks.php b/IUTHooks.php new file mode 100644 index 0000000..f551c8a --- /dev/null +++ b/IUTHooks.php @@ -0,0 +1,117 @@ + parser hook. + * + * @param Parser $parser + * @return bool + */ + public static function registerParserHook( &$parser ) { + $parser->setHook( 'iusethis', array( 'IUTHooks', 'renderVote' ) ); + return true; + } + + /** + * Callback function for registerParserHook. + * + * @param string $input User-supplied input, unused + * @param array $args User-supplied arguments + * @param Parser $parser Instance of Parser, unused + * @return string HTML + */ + public static function renderVote( $input, $args, $parser ) { + global $wgOut, $wgUser; + + // Disable parser cache (sadly we have to do this, because the caching is + // messing stuff up; we want to show an up-to-date rating instead of old + // or totally wrong rating, i.e. another page's rating...) + $parser->disableCache(); + + // Add CSS & JS + // In order for us to do this *here* instead of having to do this in + // registerParserHook(), we must've disabled parser cache + $parser->getOutput()->addModuleStyles( 'ext.IUseThis.styles' ); + if ( $wgUser->isAllowed( 'iusethis' ) ) { + $parser->getOutput()->addModules( 'ext.IUseThis.scripts' ); + } + + $output = null; + $title = $wgOut->getTitle(); + if ( $title ) { + $articleID = $title->getArticleID(); + $vote = new Vote( $articleID ); + + $output = $vote->display(); + } + + return $output; + } + + /** + * For the Renameuser extension. + * + * @param RenameuserSQL $renameUserSQL + * @return bool + */ + public static function onUserRename( $renameUserSQL ) { + $renameUserSQL->tables['IUseThis'] = array( 'username', 'vote_user_id' ); + return true; + } + + /** + * Main function to get the number of votes for a specific page + * + * @param Title $title Page to get votes for + * @return int Number of votes for the given page + */ + public static function getNumberOfVotesPage( Title $title ) { + global $wgMemc; + + $id = $title->getArticleID(); + + $key = wfMemcKey( 'iusethis', 'magic-word-page', $id ); + $data = $wgMemc->get( $key ); + + if ( $data ) { + return $data; + } else { + $dbr = wfGetDB( DB_SLAVE ); + + $voteCount = (int)$dbr->selectField( + 'IUseThis', + 'COUNT(*) AS count', + array( 'vote_page_id' => $id ), + __METHOD__ + ); + + $wgMemc->set( $key, $voteCount, 3600 ); + + return $voteCount; + } + } + + /** + * Creates the necessary database table when the user runs + * maintenance/update.php. + * + * @param DatabaseUpdater $updater + * @return bool + */ + public static function addTable( $updater ) { + $dbt = $updater->getDB()->getType(); + $file = __DIR__ . "/iusethis.$dbt"; + if ( file_exists( $file ) ) { + $updater->addExtensionUpdate( array( 'addTable', 'IUseThis', $file, true ) ); + } else { + throw new MWException( "IUseThis does not support $dbt." ); + } + return true; + } +} diff --git a/SpecialTopRatings.php b/SpecialTopRatings.php deleted file mode 100644 index 7a5b7b1..0000000 --- a/SpecialTopRatings.php +++ /dev/null @@ -1,194 +0,0 @@ -setHeaders(); - - $out = $this->getOutput(); - $user = $this->getUser(); - - $categoryName = $namespace = ''; - - // Parse the parameters passed to the special page - // Make sure that the limit parameter passed to the special page is - // an integer and that it's less than 100 (performance!) - if ( isset( $par ) && is_numeric( $par ) && $par < 100 ) { - $limit = intval( $par ); - } elseif ( isset( $par ) && !is_numeric( $par ) ) { - // $par is a string...assume that we can explode() it - $exploded = explode( '/', $par ); - $categoryName = $exploded[0]; - $namespace = ( isset( $exploded[1] ) ? intval( $exploded[1] ) : $namespace ); - $limit = ( isset( $exploded[2] ) ? intval( $exploded[2] ) : 50 ); - } else { - $limit = 50; - } - - // Add CSS - $out->addModuleStyles( 'ext.voteNY.styles' ); - /* scroll down some lines to see why I'm not including JS here anymore - if ( $user->isAllowed( 'voteny' ) ) { - $out->addModules( 'ext.voteNY.scripts' ); - } - */ - - $ratings = array(); - $output = ''; - - $dbr = wfGetDB( DB_SLAVE ); - $tables = $where = $joinConds = array(); - $whatToSelect = array( 'DISTINCT vote_page_id', 'SUM(vote_value) AS vote_value_sum' ); - - // By default we have no category and no namespace - $tables = array( 'Vote' ); - $where = array( 'vote_page_id <> 0' ); - - // isset(), because 0 is a totally valid NS - if ( !empty( $categoryName ) && isset( $namespace ) ) { - $tables = array( 'Vote', 'page', 'categorylinks' ); - $where = array( - 'vote_page_id <> 0', - 'cl_to' => str_replace( ' ', '_', $categoryName ), - 'page_namespace' => $namespace - ); - $joinConds = array( - 'categorylinks' => array( 'INNER JOIN', 'cl_from = page_id' ), - 'page' => array( 'INNER JOIN', 'page_id = vote_page_id' ) - ); - } - - // Perform the SQL query with the given conditions; the basic idea is - // that we get $limit (however, 100 or less) unique page IDs from the - // Vote table. The GROUP BY is to make SUM(vote_value) give the SUM of - // all vote_values for a page. If a category and a namespace have been - // given, we also do an INNER JOIN with page and categorylinks table - // to get the correct data. - $res = $dbr->select( - $tables, - $whatToSelect, - $where, - __METHOD__, - array( 'GROUP BY' => 'vote_page_id', 'LIMIT' => intval( $limit ) ), - $joinConds - ); - - foreach ( $res as $row ) { - // Add the results to the $ratings array - // For example: $ratings[1] = 11 = page with the page ID 1 has 11 - // votes - $ratings[$row->vote_page_id] = (int)$row->vote_value_sum; - } - - // If we have some ratings, start building HTML output - if ( !empty( $ratings ) ) { - /* XXX dirrrrrrty hack! because when we include this page, the JS - * is not included, but we want things to work still - * Actually, this is way harder than what it looks like. - * The JS uses wgArticleId but when directly viewing Special:TopRatings, - * wgArticleId is zero, because special pages aren't articles. - * As for including the special page, then wgArticleId would likely - * point at the ID of the page that includes {{Special:TopRatings}}, - * which would be stupid and wrong. - * Besides, shouldn't you check out the images/pages that you're gonna - * vote for? Yeah, that's what I thought, too. - if ( $this->including() && $user->isAllowed( 'voteny' ) ) { - global $wgExtensionAssetsPath; - $output .= ''; - } - */ - - // yes, array_keys() is needed - foreach ( array_keys( $ratings ) as $discardThis => $pageId ) { - $titleObj = Title::newFromId( $pageId ); - if ( !( $titleObj instanceof Title ) ) { - continue; - } - - $vote = new VoteStars( $pageId ); - $output .= '
' . - Linker::link( - $titleObj, - $titleObj->getPrefixedText() // prefixed, so that the namespace shows! - ) . $this->msg( 'word-separator' )->escaped() . // i18n overkill? ya betcha... - $this->msg( 'parentheses', $ratings[$pageId] )->escaped() . - '
'; - - $id = mt_rand(); // AFAIK these IDs are and originally were totally random... - $output .= "
" . - $vote->displayStars( - $id, - self::getAverageRatingForPage( $pageId ), - false - ) . '
'; - $output .= "
" . - $vote->displayScore() . - '
'; - } - } else { - // Nothing? Well, display an informative error message rather than - // a blank page or somesuch. - $output .= $this->msg( 'topratings-no-pages' )->escaped(); - } - - // Output everything! - $out->addHTML( $output ); - } - - /** - * Static version of Vote::getAverageVote(). - * - * @param $pageId Integer: ID of the page for which we want to get the avg. - * rating - * @return Integer: average vote for the given page (ID) - */ - public static function getAverageRatingForPage( $pageId ) { - global $wgMemc; - - $key = wfMemcKey( 'vote', 'avg', $pageId ); - $data = $wgMemc->get( $key ); - $voteAvg = 0; - - if ( $data ) { - wfDebug( "Loading vote avg for page {$pageId} from cache (TopRatings)\n" ); - $voteAvg = $data; - } else { - $dbr = wfGetDB( DB_SLAVE ); - $voteAvg = (int)$dbr->selectField( - 'Vote', - 'AVG(vote_value) AS VoteAvg', - array( 'vote_page_id' => $pageId ), - __METHOD__ - ); - $wgMemc->set( $key, $voteAvg ); - } - - return $voteAvg; - } -} diff --git a/Vote.css b/Vote.css deleted file mode 100644 index 802b9c3..0000000 --- a/Vote.css +++ /dev/null @@ -1,63 +0,0 @@ -/* CSS for Vote extension */ -.vote-box { - background-color: #68BD46; - height: 30px; - padding: 13px 0px 0px; - text-align: center; - width: 43px; -} - -.vote-number { - color: #FFF; - font-size: 16px; - font-weight: bold; -} - -.vote-action { - text-align: center; - width: 43px; -} - -.vote-action a { - font-weight: bold; - font-size: 11px; - text-decoration: none; -} - -.rating-score { - background-color: #68BD46; - color: #FFF; - float: left; - font-size: 14px; - font-weight: bold; - padding: 1px 8px 0px; - margin: 1px 7px 0px 0px; - text-align: center; -} - -.ratings-top { - position: absolute; - top: 37px !important; - right: 0px !important; - width: 100%; -} - -.rating-section img { - vertical-align: text-bottom; -} - -.rating-voted { - color: #666666; - line-height: 10px; - font-size: 9px; - position: absolute; - right: 0px; -} - -/* Styling for the (n votes) after rating box/stars */ -.rating-total { - color: #666; - font-weight: bold; - font-size: 11px; - margin: 3px 0px 0px 0px; -} \ No newline at end of file diff --git a/Vote.js b/Vote.js deleted file mode 100644 index 6875294..0000000 --- a/Vote.js +++ /dev/null @@ -1,200 +0,0 @@ -/** - * JavaScript functions for Vote extension. - * - * TODO: Should refactor this into a jQuery widget. - * The widget should get a PageID in its constructor so it can work on any page - * for any page and with multiple instances per page. - * - * @constructor - * - * @author Jack Phoenix - * @author Daniel A. R. Werner < daniel.a.r.werner@gmail.com > - */ -var VoteNY = function VoteNY() { - this.MaxRating = 5; - this.clearRatingTimer = null; - this.voted_new = []; - this.id = 0; - this.last_id = 0; - this.imagePath = mw.config.get( 'wgExtensionAssetsPath' ) + '/VoteNY/images/'; - - /** - * Called when voting through the green square voting box - * - * @param TheVote - * @param PageID Integer: internal ID number of the current article - */ - this.clickVote = function( TheVote, PageID ) { - ( new mw.Api() ).postWithToken( 'edit', { - action: 'voteny', - format: 'json', - what: 'vote', - pageId: PageID, - voteValue: TheVote - } ).done( function( data ) { - $( '#PollVotes' ).html( data.voteny.result ); - $( '#Answer' ).html( - '' + - mediaWiki.msg( 'voteny-unvote-link' ) + '' - ); - } ); - }; - - /** - * Called when removing your vote through the green square voting box - * - * @param PageID Integer: internal ID number of the current article - */ - this.unVote = function( PageID ) { - ( new mw.Api() ).postWithToken( 'edit', { - action: 'voteny', - format: 'json', - what: 'delete', - pageId: PageID - } ).done( function( data ) { - $( '#PollVotes' ).html( data.voteny.result ); - $( '#Answer' ).html( - '' + - mediaWiki.msg( 'voteny-link' ) + '' - ); - } ); - }; - - /** - * Called when adding a vote after a user has clicked the yellow voting stars - * - * @param PageID Integer: internal ID number of the current article - * @param id Integer: ID of the current rating star - * @param action Integer: controls which AJAX function will be called - */ - this.clickVoteStars = function( TheVote, PageID, id, action ) { - this.voted_new[id] = TheVote; - var actionName; - if ( action == 3 ) { - actionName = 'stars'; // all other values but 'multi' are ignored anyway - } - if ( action == 5 ) { - actionName = 'multi'; - } - - ( new mw.Api() ).postWithToken( 'edit', { - action: 'voteny', - type: 'stars', - what: actionName, - voteValue: TheVote, - pageId: PageID - } ).done( function( data ) { - $( '#rating_' + id ).html( data.voteny.result ); - } ); - }; - - /** - * Called when removing your vote through the yellow voting stars - * - * @param PageID Integer: internal ID number of the current article - * @param id Integer: ID of the current rating star - */ - this.unVoteStars = function( PageID, id ) { - ( new mw.Api() ).postWithToken( 'edit', { - action: 'voteny', - what: 'delete', - type: 'stars', - pageId: PageID - } ).done( function( data ) { - $( '#rating_' + id ).html( data.voteny.result ); - } ); - }; - - this.startClearRating = function( id, rating, voted ) { - var voteNY = this; - this.clearRatingTimer = setTimeout( function() { - voteNY.clearRating( id, 0, rating, voted ); - }, 200 ); - }; - - this.clearRating = function( id, num, prev_rating, voted ) { - if ( this.voted_new[id] ) { - voted = this.voted_new[id]; - } - - for ( var x = 1; x <= this.MaxRating; x++ ) { - var star_on, old_rating; - if ( voted ) { - star_on = 'voted'; - old_rating = voted; - } else { - star_on = 'on'; - old_rating = prev_rating; - } - var ratingElement = $( '#rating_' + id + '_' + x ); - if ( !num && old_rating >= x ) { - ratingElement.attr( 'src', this.imagePath + 'star_' + star_on + '.gif' ); - } else { - ratingElement.attr( 'src', this.imagePath + 'star_off.gif' ); - } - } - }; - - this.updateRating = function( id, num, prev_rating ) { - if ( this.clearRatingTimer && this.last_id == id ) { - clearTimeout( this.clearRatingTimer ); - } - this.clearRating( id, num, prev_rating ); - for ( var x = 1; x <= num; x++ ) { - $( '#rating_' + id + '_' + x ).attr( 'src', this.imagePath + 'star_voted.gif' ); - } - this.last_id = id; - }; -}; - -// TODO: Make event handlers part of a widget as described in the VoteNY's TODO and reduce this -// code to instantiating such a widget for the current wiki page if required. -$( function() { - var vote = new VoteNY(); - - // Green voting box's link - $( '.vote-action' ).on( 'click', '> a', function( event ) { - if ( $( this ).hasClass( 'vote-unvote-link' ) ) { - vote.unVote( mw.config.get( 'wgArticleId' ) ); - } else { - vote.clickVote( 1, mw.config.get( 'wgArticleId' ) ); - } - } ); - - // Rating stars - // Note: this uses $( 'body' ).on( 'actionName', 'selector' - // instead of $( 'selector' ).actionName so that the hover effects work - // correctly even *after* you've voted (say, if you wanted to change your - // vote with the star ratings without reloading the page). - $( 'body' ).on( 'click', '.vote-rating-star', function() { - var that = $( this ); - vote.clickVoteStars( - that.data( 'vote-the-vote' ), - $( this ).data( 'page-id' ), - that.data( 'vote-id' ), - that.data( 'vote-action' ) - ); - } ).on( 'mouseover', '.vote-rating-star', function() { - var that = $( this ); - vote.updateRating( - that.data( 'vote-id' ), - that.data( 'vote-the-vote' ), - that.data( 'vote-rating' ) - ); - } ).on( 'mouseout', '.vote-rating-star', function() { - var that = $( this ); - vote.startClearRating( - that.data( 'vote-id' ), - that.data( 'vote-rating' ), - that.data( 'vote-voted' ) - ); - } ); - - // Remove vote (rating stars) - $( 'body' ).on( 'click', '.vote-remove-stars-link', function() { - vote.unVoteStars( - $( this ).data( 'page-id' ), - $( this ).data( 'vote-id' ) - ); - } ); -} ); \ No newline at end of file diff --git a/VoteClass.php b/VoteClass.php deleted file mode 100644 index 1b44378..0000000 --- a/VoteClass.php +++ /dev/null @@ -1,367 +0,0 @@ -PageID = $pageID; - $this->Username = $wgUser->getName(); - $this->Userid = $wgUser->getID(); - } - - /** - * Counts all votes, fetching the data from memcached if available - * or from the database if memcached isn't available - * - * @return int Amount of votes - */ - function count() { - global $wgMemc; - - $key = wfMemcKey( 'vote', 'count', $this->PageID ); - $data = $wgMemc->get( $key ); - - // Try cache - if ( $data ) { - wfDebug( "Loading vote count for page {$this->PageID} from cache\n" ); - $vote_count = $data; - } else { - $dbr = wfGetDB( DB_SLAVE ); - $vote_count = 0; - $res = $dbr->select( - 'Vote', - 'COUNT(*) AS votecount', - array( 'vote_page_id' => $this->PageID ), - __METHOD__ - ); - $row = $dbr->fetchObject( $res ); - if ( $row ) { - $vote_count = $row->votecount; - } - $wgMemc->set( $key, $vote_count ); - } - - return $vote_count; - } - - /** - * Gets the average score of all votes - * - * @return int Formatted average number of votes (something like 3.50) - */ - function getAverageVote() { - global $wgMemc; - $key = wfMemcKey( 'vote', 'avg', $this->PageID ); - $data = $wgMemc->get( $key ); - - $voteAvg = 0; - if ( $data ) { - wfDebug( "Loading vote avg for page {$this->PageID} from cache\n" ); - $voteAvg = $data; - } else { - $dbr = wfGetDB( DB_SLAVE ); - $res = $dbr->select( - 'Vote', - 'AVG(vote_value) AS voteavg', - array( 'vote_page_id' => $this->PageID ), - __METHOD__ - ); - $row = $dbr->fetchObject( $res ); - if ( $row ) { - $voteAvg = $row->voteavg; - } - $wgMemc->set( $key, $voteAvg ); - } - - return number_format( $voteAvg, 2 ); - } - - /** - * Clear caches - memcached, parser cache and Squid cache - */ - function clearCache() { - global $wgUser, $wgMemc; - - // Kill internal cache - $wgMemc->delete( wfMemcKey( 'vote', 'count', $this->PageID ) ); - $wgMemc->delete( wfMemcKey( 'vote', 'avg', $this->PageID ) ); - - // Purge squid - $pageTitle = Title::newFromID( $this->PageID ); - if ( is_object( $pageTitle ) ) { - $pageTitle->invalidateCache(); - $pageTitle->purgeSquid(); - - // Kill parser cache - $article = new Article( $pageTitle, /* oldid */0 ); - $parserCache = ParserCache::singleton(); - $parserKey = $parserCache->getKey( $article, $wgUser ); - $wgMemc->delete( $parserKey ); - } - } - - /** - * Delete the user's vote from the database, purges normal caches and - * updates SocialProfile's statistics, if SocialProfile is active. - */ - function delete() { - $dbw = wfGetDB( DB_MASTER ); - $dbw->delete( - 'Vote', - array( - 'vote_page_id' => $this->PageID, - 'username' => $this->Username - ), - __METHOD__ - ); - - $this->clearCache(); - - // Update social statistics if SocialProfile extension is enabled - if ( class_exists( 'UserStatsTrack' ) ) { - $stats = new UserStatsTrack( $this->Userid, $this->Username ); - $stats->decStatField( 'vote' ); - } - } - - /** - * Inserts a new vote into the Vote database table - * - * @param int $voteValue - */ - function insert( $voteValue ) { - global $wgRequest; - $dbw = wfGetDB( DB_MASTER ); - wfSuppressWarnings(); // E_STRICT whining - $voteDate = date( 'Y-m-d H:i:s' ); - wfRestoreWarnings(); - if ( $this->UserAlreadyVoted() == false ) { - $dbw->insert( - 'Vote', - array( - 'username' => $this->Username, - 'vote_user_id' => $this->Userid, - 'vote_page_id' => $this->PageID, - 'vote_value' => $voteValue, - 'vote_date' => $voteDate, - 'vote_ip' => $wgRequest->getIP(), - ), - __METHOD__ - ); - - $this->clearCache(); - - // Update social statistics if SocialProfile extension is enabled - if ( class_exists( 'UserStatsTrack' ) ) { - $stats = new UserStatsTrack( $this->Userid, $this->Username ); - $stats->incStatField( 'vote' ); - } - } - } - - /** - * Checks if a user has already voted - * - * @return bool|int False if s/he hasn't, otherwise returns the - * value of 'vote_value' column from Vote DB table - */ - function UserAlreadyVoted() { - $dbr = wfGetDB( DB_SLAVE ); - $s = $dbr->selectRow( - 'Vote', - array( 'vote_value' ), - array( - 'vote_page_id' => $this->PageID, - 'username' => $this->Username - ), - __METHOD__ - ); - if ( $s === false ) { - return false; - } else { - return $s->vote_value; - } - } - - /** - * Displays the green voting box - * - * @return string HTML output - */ - function display() { - global $wgUser; - - $voted = $this->UserAlreadyVoted(); - - $make_vote_box_clickable = ''; - if ( $voted == false ) { - $make_vote_box_clickable = ' vote-clickable'; - } - - $output = "
"; - $output .= '' . $this->count() . ''; - $output .= '
'; - $output .= '
'; - - if ( !$wgUser->isAllowed( 'voteny' ) ) { - // @todo FIXME: this is horrible. If we don't have enough - // permissions to vote, we should tell the end-user /that/, - // not require them to log in! - $login = SpecialPage::getTitleFor( 'Userlogin' ); - $output .= '' . - wfMessage( 'voteny-link' )->plain() . ''; - } else { - if ( !wfReadOnly() ) { - if ( $voted == false ) { - $output .= '' . - wfMessage( 'voteny-link' )->plain() . ''; - } else { - $output .= '' . - wfMessage( 'voteny-unvote-link' )->plain() . ''; - } - } - } - $output .= '
'; - - return $output; - } -} - -/** - * Class for generating star rating stars. - */ -class VoteStars extends Vote { - - public $maxRating = 5; - - /** - * Displays voting stars - * - * @param bool $voted Has the user already voted? False by default - * @return string HTML output - */ - function display( $voted = false ) { - global $wgUser; - - $overall_rating = $this->getAverageVote(); - - if ( $voted ) { - $display_stars_rating = $voted; - } else { - $display_stars_rating = $this->getAverageVote(); - } - - $id = ''; - - // Should probably be $this->PageID or something? - // 'cause we define $id just above as an empty string...duh - $output = '
'; - $output .= '
'; - $output .= '
' . $overall_rating . '
'; - $output .= '
'; - $output .= '
'; - $output .= $this->displayStars( $id, $display_stars_rating, $voted ); - $count = $this->count(); - if ( isset( $count ) ) { - $output .= ' (' . - wfMessage( 'voteny-votes', $count )->parse() . ')'; - } - $already_voted = $this->UserAlreadyVoted(); - if ( $already_voted && $wgUser->isLoggedIn() ) { - $output .= '
' . - wfMessage( 'voteny-gave-this', $already_voted )->parse() . - "
- PageID}\" data-vote-id=\"{$id}\">(" - . wfMessage( 'voteny-remove' )->plain() . - ')'; - } - $output .= '
-
-
'; - - $output .= '
'; - return $output; - } - - /** - * Displays the actual star images, depending on the state of the user's mouse - * - * @param int $id ID of the rating (div) element - * @param int $rating Average rating - * @param int $voted - * @return string Generated tag - */ - function displayStars( $id, $rating, $voted ) { - global $wgExtensionAssetsPath; - - if ( !$rating ) { - $rating = 0; - } - if ( !$voted ) { - $voted = 0; - } - $output = ''; - - for ( $x = 1; $x <= $this->maxRating; $x++ ) { - if ( !$id ) { - $action = 3; - } else { - $action = 5; - } - $output .= "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_"; - switch ( true ) { - case $rating >= $x: - if ( $voted ) { - $output .= 'voted'; - } else { - $output .= 'on'; - } - break; - case ( $rating > 0 && $rating < $x && $rating > ( $x - 1 ) ): - $output .= 'half'; - break; - case ( $rating < $x ): - $output .= 'off'; - break; - } - - $output .= '.gif" alt="" />'; - } - - return $output; - } - - /** - * Displays the average score for the current page - * and the total amount of votes. - * - * @return string - */ - function displayScore() { - $count = $this->count(); - return wfMessage( 'voteny-community-score', '' . $this->getAverageVote() . '' ) - ->numParams( $count )->text() . - ' (' . wfMessage( 'voteny-ratings' )->numParams( $count )->parse() . ')'; - } - -} diff --git a/VoteHooks.php b/VoteHooks.php deleted file mode 100644 index e423c84..0000000 --- a/VoteHooks.php +++ /dev/null @@ -1,223 +0,0 @@ - parser hook. - * - * @param Parser $parser - * @return bool - */ - public static function registerParserHook( &$parser ) { - $parser->setHook( 'vote', array( 'VoteHooks', 'renderVote' ) ); - return true; - } - - /** - * Callback function for registerParserHook. - * - * @param string $input User-supplied input, unused - * @param array $args User-supplied arguments - * @param Parser $parser Instance of Parser, unused - * @return string HTML - */ - public static function renderVote( $input, $args, $parser ) { - global $wgOut, $wgUser; - - // Disable parser cache (sadly we have to do this, because the caching is - // messing stuff up; we want to show an up-to-date rating instead of old - // or totally wrong rating, i.e. another page's rating...) - $parser->disableCache(); - - // Add CSS & JS - // In order for us to do this *here* instead of having to do this in - // registerParserHook(), we must've disabled parser cache - $parser->getOutput()->addModuleStyles( 'ext.voteNY.styles' ); - if ( $wgUser->isAllowed( 'voteny' ) ) { - $parser->getOutput()->addModules( 'ext.voteNY.scripts' ); - } - - // Define variable - 0 means that we'll get that green voting box by default - $type = 0; - - // Determine what kind of a voting gadget the user wants: a box or pretty stars? - if ( preg_match( "/^\s*type\s*=\s*(.*)/mi", $input, $matches ) ) { - $type = htmlspecialchars( $matches[1] ); - } elseif ( !empty( $args['type'] ) ) { - $type = intval( $args['type'] ); - } - - $output = null; - $title = $wgOut->getTitle(); - if ( $title ) { - $articleID = $title->getArticleID(); - switch( $type ) { - case 0: - $vote = new Vote( $articleID ); - break; - case 1: - $vote = new VoteStars( $articleID ); - break; - default: - $vote = new Vote( $articleID ); - } - - $output = $vote->display(); - } - - return $output; - } - - /** - * For the Renameuser extension. - * - * @param RenameuserSQL $renameUserSQL - * @return bool - */ - public static function onUserRename( $renameUserSQL ) { - $renameUserSQL->tables['Vote'] = array( 'username', 'vote_user_id' ); - return true; - } - - /** - * Assign a value to {{NUMBEROFVOTES}}. First we try memcached and if that - * fails, we fetch it directly from the database and cache it for 24 hours. - * - * @param Parser $parser - * @param $cache - * @param string $magicWordId Magic word ID - * @param int $ret Return value (number of votes) - * @return bool - */ - public static function assignValueToMagicWord( &$parser, &$cache, &$magicWordId, &$ret ) { - global $wgMemc; - - if ( $magicWordId == 'NUMBEROFVOTES' ) { - $key = wfMemcKey( 'vote', 'magic-word' ); - $data = $wgMemc->get( $key ); - if ( $data != '' ) { - // We have it in cache? Oh goody, let's just use the cached value! - wfDebugLog( - 'VoteNY', - 'Got the amount of votes from memcached' - ); - // return value - $ret = $data; - } else { - // Not cached → have to fetch it from the database - $dbr = wfGetDB( DB_SLAVE ); - $voteCount = (int)$dbr->selectField( - 'Vote', - 'COUNT(*) AS count', - array(), - __METHOD__ - ); - wfDebugLog( 'VoteNY', 'Got the amount of votes from DB' ); - // Store the count in cache... - // (86400 = seconds in a day) - $wgMemc->set( $key, $voteCount, 86400 ); - // ...and return the value to the user - $ret = $voteCount; - } - } elseif ( $magicWordId == 'NUMBEROFVOTESPAGE' ) { - $ret = VoteHooks::getNumberOfVotesPage( $parser->getTitle() ); - } - - return true; - } - - /** - * Main function to get the number of votes for a specific page - * - * @param Title $title Page to get votes for - * @return int Number of votes for the given page - */ - public static function getNumberOfVotesPage( Title $title ) { - global $wgMemc; - - $id = $title->getArticleID(); - - $key = wfMemcKey( 'vote', 'magic-word-page', $id ); - $data = $wgMemc->get( $key ); - - if ( $data ) { - return $data; - } else { - $dbr = wfGetDB( DB_SLAVE ); - - $voteCount = (int)$dbr->selectField( - 'Vote', - 'COUNT(*) AS count', - array( 'vote_page_id' => $id ), - __METHOD__ - ); - - $wgMemc->set( $key, $voteCount, 3600 ); - - return $voteCount; - } - } - - /** - * Hook for parser function {{NUMBEROFVOTESPAGE:}} - * - * @param Parser $parser - * @param string $pagename Page name - * @return int Amount of votes for the given page - */ - public static function getNumberOfVotesPageParser( $parser, $pagename ) { - $title = Title::newFromText( $pagename ); - - if ( !$title instanceof Title ) { - $title = $parser->getTitle(); - } - - return VoteHooks::getNumberOfVotesPage( $title ); - } - - /** - * Register the magic word ID for {{NUMBEROFVOTES}} and {{NUMBEROFVOTESPAGE}} - * - * @param array $variableIds Array of pre-existing variable IDs - * @return bool - */ - public static function registerVariableId( &$variableIds ) { - $variableIds[] = 'NUMBEROFVOTES'; - $variableIds[] = 'NUMBEROFVOTESPAGE'; - return true; - } - - /** - * Hook to setup parser function {{NUMBEROFVOTESPAGE:}} - * - * @param Parser $parser - * @return bool - */ - public static function setupNumberOfVotesPageParser( &$parser ) { - $parser->setFunctionHook( 'NUMBEROFVOTESPAGE', 'VoteHooks::getNumberOfVotesPageParser', Parser::SFH_NO_HASH ); - return true; - } - - /** - * Creates the necessary database table when the user runs - * maintenance/update.php. - * - * @param DatabaseUpdater $updater - * @return bool - */ - public static function addTable( $updater ) { - $dbt = $updater->getDB()->getType(); - $file = __DIR__ . "/vote.$dbt"; - if ( file_exists( $file ) ) { - $updater->addExtensionUpdate( array( 'addTable', 'Vote', $file, true ) ); - } else { - throw new MWException( "VoteNY does not support $dbt." ); - } - return true; - } -} diff --git a/VoteNY.alias.php b/VoteNY.alias.php deleted file mode 100644 index 8c2d7d3..0000000 --- a/VoteNY.alias.php +++ /dev/null @@ -1,15 +0,0 @@ - array( 'TopRatings' ), -); \ No newline at end of file diff --git a/VoteNY.i18n.magic.php b/VoteNY.i18n.magic.php deleted file mode 100644 index 62676ec..0000000 --- a/VoteNY.i18n.magic.php +++ /dev/null @@ -1,11 +0,0 @@ - array( 0, 'NUMBEROFVOTES' ), - 'NUMBEROFVOTESPAGE' => array( 0, 'NUMBEROFVOTESPAGE' ), -); diff --git a/extension.json b/extension.json index 82ed752..5429d7a 100644 --- a/extension.json +++ b/extension.json @@ -1,83 +1,62 @@ { - "name": "VoteNY", - "version": "2.8", + "name": "IUseThis", + "version": "1.0", "author": [ + "Alexander Yakovlev", "Aaron Wright", "David Pean", "Jack Phoenix" ], "license-name": "GPL-2.0+", - "url": "https://www.mediawiki.org/wiki/Extension:VoteNY", - "descriptionmsg": "voteny-desc", "type": "parserhook", - "SpecialPages": { - "TopRatings": "SpecialTopRatings" + "APIModules": { + "iusethis": "ApiIUT" }, "MessagesDirs": { - "VoteNY": [ + "IUseThis": [ "i18n" ] }, - "APIModules": { - "voteny": "ApiVoteNY" - }, - "ExtensionMessagesFiles": { - "VoteNYAlias": "VoteNY.alias.php", - "VoteNYMagic": "VoteNY.i18n.magic.php" - }, "AutoloadClasses": { - "ApiVoteNY": "ApiVoteNY.php", - "Vote": "VoteClass.php", - "VoteStars": "VoteClass.php", - "SpecialTopRatings": "SpecialTopRatings.php", - "VoteHooks": "VoteHooks.php" + "ApiIUT": "ApiIUT.php", + "IUT": "IUTClass.php", + "IUTHooks": "IUTHooks.php" }, "Hooks": { "ParserFirstCallInit": [ - "VoteHooks::registerParserHook", - "VoteHooks::setupNumberOfVotesPageParser" + "IUTHooks::registerParserHook" ], "RenameUserSQL": [ - "VoteHooks::onUserRename" - ], - "ParserGetVariableValueSwitch": [ - "VoteHooks::assignValueToMagicWord" - ], - "MagicWordwgVariableIDs": [ - "VoteHooks::registerVariableId" + "IUTHooks::onUserRename" ], "LoadExtensionSchemaUpdates": [ - "VoteHooks::addTable" + "IUTHooks::addTable" ] }, "ResourceFileModulePaths": { "localBasePath": "", - "remoteExtPath": "VoteNY" + "remoteExtPath": "IUT" }, "ResourceModules": { "ext.voteNY.scripts": { - "scripts": "Vote.js", - "messages": [ - "voteny-link", - "voteny-unvote-link" - ], + "scripts": "IUT.js", "dependencies": [ "mediawiki.api" ], "position": "bottom" }, "ext.voteNY.styles": { - "styles": "Vote.css", + "styles": "IUT.css", "position": "top" } }, "AvailableRights": [ - "voteny" + "iusethis" ], "GroupPermissions": { "*": { - "voteny": false + "iusethis": false }, "user": { - "voteny": true + "iusethis": true } }, "manifest_version": 1 diff --git a/i18n/ast.json b/i18n/ast.json deleted file mode 100644 index 310fc93..0000000 --- a/i18n/ast.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Xuacu" - ] - }, - "apihelp-voteny-description": "Módulu API VoteNY", - "apihelp-voteny-param-what": "Aición a facer; los valores válidos son 'vote' (cuadru de votu verde), 'multi' (estrelles de votación) o 'delete' (desaniciar un votu dau anteriormente)", - "apihelp-voteny-param-pageId": "ID de páxina de la páxina onde ta/tan el cuadru de votu o estrelles", - "apihelp-voteny-param-voteValue": "Valor numbéricu del votu ente 1 y 5", - "apihelp-voteny-param-type": "Configuralo como 'stars' pa llamar a les estrelles de votación (clas VoteStars PHP), d'otra manera úsase'l cuadru de votu verde (clas Vote PHP)", - "apihelp-voteny-example-1": "Unviar un votu a la páxina que tien el númberu d'ID 666", - "apihelp-voteny-example-2": "Desaniciar el votu de la páxina que tien el númberu d'ID 666", - "apihelp-voteny-example-3": "Unviar un votu (3 estrelles de 5) a la páxina que tien el númberu d'ID 666", - "apihelp-voteny-example-4": "Desaniciar el votu de la páxina que tien el númberu d'ID 666 qu'usa la puntuación d'estrelles", - "apihelp-voteny-example-5": "Unviar un votu (4 estrelles de 5) a la páxina que tien el númberu d'ID 666, desaniciando'l votu anterior si lu hai", - "voteny-desc": "Votación basada en JavaScript cola etiqueta <vote>", - "voteny-link": "Votar", - "voteny-unvote-link": "retirar el votu", - "voteny-community-score": "{{PLURAL:$2|puntuación|puntuaciones}} de la comunidá: $1", - "voteny-ratings": "{{PLURAL:$1|una valoración|$1 valoraciones}}", - "voteny-remove": "desaniciar", - "voteny-gave-this": "dio-y a esto un $1", - "voteny-votes": "{{PLURAL:$1|un votu|$1 votos}}", - "topratings": "Páxines meyor calificaes", - "topratings-no-pages": "Nun hai páxines meyor calificaes", - "right-voteny": "Votar páxines" -} diff --git a/i18n/bg.json b/i18n/bg.json deleted file mode 100644 index 6214e2b..0000000 --- a/i18n/bg.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "@metadata": { - "authors": [ - "පසිඳු කාවින්ද" - ] - }, - "voteny-remove": "премахване" -} diff --git a/i18n/ca.json b/i18n/ca.json deleted file mode 100644 index 9b6aa4b..0000000 --- a/i18n/ca.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Toniher" - ] - }, - "voteny-desc": "Votació basada en JavaScript amb l'etiqueta <vote>", - "voteny-link": "Vota", - "voteny-unvote-link": "anul·la el vot", - "voteny-community-score": "puntuació comunitària: $1", - "voteny-ratings": "{{PLURAL:$1|una valoració|$1 valoracions}}", - "voteny-remove": "anul·la", - "voteny-gave-this": "vau donar-li un $1", - "voteny-votes": "{{PLURAL:$1|un vot|$1 vots}}", - "topratings": "Pàgines més valorades", - "topratings-no-pages": "No hi ha cap pàgina valorada.", - "right-voteny": "Pàgines de votació" -} diff --git a/i18n/ce.json b/i18n/ce.json deleted file mode 100644 index 0111237..0000000 --- a/i18n/ce.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Умар" - ] - }, - "voteny-unvote-link": "юхадаккха харжар" -} diff --git a/i18n/de-formal.json b/i18n/de-formal.json deleted file mode 100644 index 41f3ea4..0000000 --- a/i18n/de-formal.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Kghbln" - ] - }, - "voteny-gave-this": "Sie haben eine $1 vergeben." -} diff --git a/i18n/de.json b/i18n/de.json deleted file mode 100644 index 8d720d1..0000000 --- a/i18n/de.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Kghbln", - "Metalhead64", - "Purodha" - ] - }, - "voteny-desc": "Ergänzt das Tag <vote> zum Durchführen JavaScript-gestützter Abstimmungen", - "voteny-link": "Abstimmen", - "voteny-unvote-link": "Stimme zurücknehmen", - "voteny-community-score": "{{PLURAL:$2|Punktestand|Punktestände}} der Gemeinschaft: $1", - "voteny-ratings": "{{PLURAL:$1|eine Bewertung|$1 Bewertungen}}", - "voteny-remove": "entfernen", - "voteny-gave-this": "Du hast eine $1 vergeben.", - "voteny-votes": "{{PLURAL:$1|eine Stimme|$1 Stimmen}}", - "topratings": "Höchstbewertete Seiten", - "topratings-no-pages": "Es sind keine höchstbewerteten Seiten vorhanden.", - "right-voteny": "Abstimmen über Seiten" -} diff --git a/i18n/diq.json b/i18n/diq.json deleted file mode 100644 index 0850db4..0000000 --- a/i18n/diq.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Erdemaslancan", - "Mirzali" - ] - }, - "voteny-link": "Rey", - "voteny-unvote-link": "rey mede", - "voteny-community-score": "Puwanê şêlıki: $1", - "voteny-ratings": "{{PLURAL:$1|yew nırğnayış|$1 nırğnayışi}}", - "voteny-remove": "wedare", - "voteny-votes": "{{PLURAL:$1|yew rey|$1 reyi}}", - "right-voteny": "Pelê reydayışi" -} diff --git a/i18n/dsb.json b/i18n/dsb.json deleted file mode 100644 index f80fcc1..0000000 --- a/i18n/dsb.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Michawiki" - ] - }, - "voteny-desc": "Wótgłosowanje z toflicku <vote> na zakłaźe JavaScripta", - "voteny-link": "Wótgłosowaś", - "voteny-unvote-link": "Wótgłosowanje anulěrowaś", - "voteny-community-score": "Licba głosow zgromaźeństwa: $1", - "voteny-ratings": "{{PLURAL:$1|jadno pógódnośenje|$1 pógódnośeni|$1 pógódnośenja|$1 pógódnośenjow}}", - "voteny-remove": "wótpóraś", - "voteny-gave-this": "sy toś tomu $1 dał", - "voteny-votes": "{{PLURAL:$1|jaden głos|$1 głosa|$1 głose|$1 głosow}}", - "topratings": "Nejwuše pógódnośone boki", - "topratings-no-pages": "Žedne nejwuše pógódnośone boki.", - "right-voteny": "Wótgłosowańske boki" -} diff --git a/i18n/dty.json b/i18n/dty.json deleted file mode 100644 index 5c1be59..0000000 --- a/i18n/dty.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Nirajan pant" - ] - }, - "apihelp-voteny-param-pageId": "पन्नाआ पन्ना ID जाँ मतदान बगस/तारा छ/छन" -} diff --git a/i18n/en-gb.json b/i18n/en-gb.json deleted file mode 100644 index 6bbd47f..0000000 --- a/i18n/en-gb.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Chase me ladies, I'm the Cavalry" - ] - }, - "voteny-desc": "JavaScript-based voting with the <vote> tag", - "voteny-link": "Vote", - "voteny-unvote-link": "unvote", - "voteny-community-score": "community score: $1", - "voteny-ratings": "{{PLURAL:$1|one rating|$1 ratings}}", - "voteny-remove": "remove", - "voteny-gave-this": "you gave this a $1", - "voteny-votes": "{{PLURAL:$1|one vote|$1 votes}}", - "topratings": "Top rated pages", - "topratings-no-pages": "No top rated pages.", - "right-voteny": "Vote pages" -} diff --git a/i18n/en.json b/i18n/en.json index 7f9110f..9e24783 100644 --- a/i18n/en.json +++ b/i18n/en.json @@ -1,29 +1,13 @@ { "@metadata": { "authors": [ + "Alexander Yakovlev ", "Aaron Wright ", "David Pean " ] }, - "apihelp-voteny-description": "VoteNY API module", - "apihelp-voteny-param-what": "Action to take; valid values are 'vote' (green voting box), 'multi' (voting stars) or 'delete' (delete a previously given vote)", - "apihelp-voteny-param-pageId": "Page ID of the page where the voting box/stars is/are", - "apihelp-voteny-param-voteValue": "Numerical vote value between 1 and 5", - "apihelp-voteny-param-type": "Set this to 'stars' to call the voting stars (VoteStars PHP class), otherwise the green vote box (Vote PHP class) is used", - "apihelp-voteny-example-1": "Cast a vote for the page which has the ID number 666", - "apihelp-voteny-example-2": "Delete your vote from the page which has the ID number 666", - "apihelp-voteny-example-3": "Cast a vote (3 stars out of 5) for the page which has the ID number 666", - "apihelp-voteny-example-4": "Delete your vote from the page which has the ID number 666 which is using the star rating", - "apihelp-voteny-example-5": "Cast a vote (4 stars out of 5) for the page which has the ID number 666, deleting your previous vote, if any", - "voteny-desc": "JavaScript-based voting with the <vote> tag", - "voteny-link": "Vote", - "voteny-unvote-link": "unvote", - "voteny-community-score": "community {{PLURAL:$2|score|scores}}: $1", - "voteny-ratings": "{{PLURAL:$1|one rating|$1 ratings}}", - "voteny-remove": "remove", - "voteny-gave-this": "you gave this a $1", - "voteny-votes": "{{PLURAL:$1|one vote|$1 votes}}", - "topratings": "Top rated pages", - "topratings-no-pages": "No top rated pages.", - "right-voteny": "Vote pages" + "iusethis-link": "I use this", + "iusethis-unvote-link": "I don't use this", + "iusethis-remove": "remove", + "right-iusethis": "Vote for 'I use this'" } diff --git a/i18n/es.json b/i18n/es.json deleted file mode 100644 index ea92d1f..0000000 --- a/i18n/es.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Armando-Martin", - "Matiia" - ] - }, - "voteny-desc": "Votación basada en JavaScript con la etiqueta <vote>", - "voteny-link": "Votar", - "voteny-unvote-link": "Eliminar voto", - "voteny-community-score": "{{PLURAL:$2|puntuación|puntuaciones}} de la comunidad: $1", - "voteny-ratings": "{{PLURAL:$1|una valoración|$1 valoraciones}}", - "voteny-remove": "eliminar", - "voteny-gave-this": "le diste a esto un $1", - "voteny-votes": "{{PLURAL:$1|un voto|$1 votos}}", - "topratings": "Páginas más valoradas", - "topratings-no-pages": "No hay páginas mejor valoradas", - "right-voteny": "Páginas de votación" -} diff --git a/i18n/fa.json b/i18n/fa.json deleted file mode 100644 index 9f69d31..0000000 --- a/i18n/fa.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Ebraminio", - "Mjbmr", - "Omidh" - ] - }, - "voteny-desc": "سامانه‌ای بر اساس جاوااسکریپت برای رای‌گیری با تگ <vote>", - "voteny-link": "رأی دهی", - "voteny-unvote-link": "حذف رأی", - "voteny-community-score": "امتیاز کلی: $1", - "voteny-ratings": "{{PLURAL:$1|یک امتیاز|$1 امتیاز}}", - "voteny-remove": "حذف", - "voteny-gave-this": "شما $1 امتیاز دادید", - "voteny-votes": "{{PLURAL:$1|یک رای|$1 رای}}", - "topratings": "صفحات دارای امتیاز بالا", - "topratings-no-pages": "صفحه‌هایی با امتیاز بالا وجود ندارند.", - "right-voteny": "صفحه‌های رأی" -} diff --git a/i18n/fi.json b/i18n/fi.json deleted file mode 100644 index a61090a..0000000 --- a/i18n/fi.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Jack Phoenix ", - "Nike" - ] - }, - "voteny-link": "Äänestä", - "voteny-unvote-link": "poista ääni", - "voteny-community-score": "yhteisön antama pistemäärä: $1", - "voteny-ratings": "{{PLURAL:$1|yksi arvostelu|$1 arvostelua}}", - "voteny-remove": "poista", - "voteny-gave-this": "annoit {{PLURAL:$1|yhden tähden|$1 tähteä}}", - "voteny-votes": "{{PLURAL:$1|yksi ääni|$1 ääntä}}", - "topratings": "Huippusivut", - "topratings-no-pages": "Ei huippusivuja." -} diff --git a/i18n/fr.json b/i18n/fr.json deleted file mode 100644 index 74b815b..0000000 --- a/i18n/fr.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Crochet.david", - "Jack Phoenix ", - "Tititou36", - "Gomoko" - ] - }, - "apihelp-voteny-description": "Module d’API VoteNY", - "apihelp-voteny-param-what": "Action à entreprendre ; les valeurs valides sont 'vote' (case de vote verte), 'multi' (étoiles de vote) ou 'delete' (supprime un vote déjà donné)", - "apihelp-voteny-param-pageId": "ID de la page où se situe la case de vote/les étoiles", - "apihelp-voteny-param-voteValue": "Valeur numérique du vote entre 1 et 5", - "apihelp-voteny-param-type": "Mettre cela à 'stars' pour appeler les étoiles de vote (classe PHP VoteStars), sinon la case de vote verte (classe PHP Vote) est utilisée", - "apihelp-voteny-example-1": "Mettre un vote pour la page qui a le numéro d’ID 666", - "apihelp-voteny-example-2": "Supprimer votre vote de la page qui a le numéro d’ID 666", - "apihelp-voteny-example-3": "Mettre un vote (3 étoiles sur 5) pour la page qui a le numéro d’ID 666", - "apihelp-voteny-example-4": "Supprimer votre vote de la page qui a le numéro d’ID 666 en utilisant la notation par étoiles", - "apihelp-voteny-example-5": "Mettre un vote (4 étoiles sur 5) pour la page de numéro d’ID 666, en supprimant votre vote précédent s’il y en avait un", - "voteny-desc": "Système de vote en JavaScript avec la balise <vote>", - "voteny-link": "Voter", - "voteny-unvote-link": "supprimer vote", - "voteny-community-score": "{{PLURAL:$2|note|notes}} de la communauté : $1", - "voteny-ratings": "{{PLURAL:$1|une note|$1 notes}}", - "voteny-remove": "supprimer", - "voteny-gave-this": "Vous avez noté $1", - "voteny-votes": "{{PLURAL:$1|un vote|$1 votes}}", - "topratings": "Pages les mieux notées", - "topratings-no-pages": "Aucune page notée.", - "right-voteny": "Pages de vote" -} diff --git a/i18n/frp.json b/i18n/frp.json deleted file mode 100644 index 1bf78a6..0000000 --- a/i18n/frp.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "@metadata": { - "authors": [ - "ChrisPtDe" - ] - }, - "voteny-link": "Votar", - "voteny-unvote-link": "enlevar lo voto", - "voteny-community-score": "mârca de la comunôtât : $1", - "voteny-ratings": "{{PLURAL:$1|yona èstimacion|$1 èstimacions}}", - "voteny-remove": "enlevar", - "voteny-gave-this": "vos éd balyê $1", - "voteny-votes": "{{PLURAL:$1|yon voto|$1 votos}}", - "right-voteny": "Votar des pâges" -} diff --git a/i18n/gl.json b/i18n/gl.json deleted file mode 100644 index 0264175..0000000 --- a/i18n/gl.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Toliño", - "Elisardojm" - ] - }, - "apihelp-voteny-description": "Módulo de API VoteNY", - "apihelp-voteny-param-what": "Acción a realizar; os valores válidos son 'vote' (caixa de voto verde), 'multi' (estrelas de voto) ou 'delete' (borrar un voto dado previamente).", - "apihelp-voteny-param-pageId": "Identificador da páxina onde está/n a caixa de voto/estrelas", - "apihelp-voteny-param-voteValue": "Valor numérico de voto entre 1 e 5", - "apihelp-voteny-param-type": "Fixa isto a 'stars' para chamar ás estrelas de voto (VoteStars PHP class), noutro caso usarase a caixa de voto verde (Vote PHP class)", - "apihelp-voteny-example-1": "Votar pola páxina que ten o número de identificación 666", - "apihelp-voteny-example-2": "Borrar o seu voto da páxina que ten o número de identificación 666", - "apihelp-voteny-example-3": "Votar (3 estrelas sobre 5) para a páxina que ten o número de identificación 666", - "apihelp-voteny-example-4": "Borrar o seu voto da páxina que ten o número de identificación 666 que está usando a notación por estrelas", - "apihelp-voteny-example-5": "Votar (4 estrelas sobre 5) para a páxina que ten o número de identificación 666, borrando o seu voto previo, se existe", - "voteny-desc": "Sistema de votación en JavaScript coa etiqueta <vote>", - "voteny-link": "Votar", - "voteny-unvote-link": "retirar o voto", - "voteny-community-score": "{{PLURAL:$2|puntuación|puntuacións}} da comunidade: $1", - "voteny-ratings": "{{PLURAL:$1|unha valoración|$1 valoracións}}", - "voteny-remove": "eliminar", - "voteny-gave-this": "vostede deu un $1", - "voteny-votes": "{{PLURAL:$1|un voto|$1 votos}}", - "topratings": "Páxinas mellor valoradas", - "topratings-no-pages": "Non hai ningunha páxina valorada.", - "right-voteny": "Votar páxinas" -} diff --git a/i18n/he.json b/i18n/he.json deleted file mode 100644 index b9ee918..0000000 --- a/i18n/he.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Yona b", - "חיים", - "Guycn2" - ] - }, - "voteny-desc": "הצבעה מבוססת JavaScript עם התג <vote>", - "voteny-link": "הצבעה", - "voteny-unvote-link": "הסר הצבעה", - "voteny-community-score": "ציון הקהילה: $1", - "voteny-ratings": "{{PLURAL:$1|מדרג אחד|$1 מדרגים}}", - "voteny-remove": "הסרה", - "voteny-gave-this": "נתת לזה $1", - "voteny-votes": "{{PLURAL:$1|הצבעה אחת|$1 הצבעות}}", - "topratings": "דפים המדורגים ביותר", - "topratings-no-pages": "דפים שדורגו הכי פחות פעמים.", - "right-voteny": "הצבעה על דפים" -} diff --git a/i18n/hsb.json b/i18n/hsb.json deleted file mode 100644 index 4908f3e..0000000 --- a/i18n/hsb.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Michawiki" - ] - }, - "voteny-desc": "Wothłosowanje z tafličku <vote> na zakładźe JavaScripta", - "voteny-link": "Wothłosować", - "voteny-unvote-link": "Wothłosowanje anulować", - "voteny-community-score": "Ličba hłosow zhromadźenstwa: $1", - "voteny-ratings": "{{PLURAL:$1|jedne pohódnoćenje|$1 pohódnoćeni|$1 pohódnoćenja|$1 pohódnoćenjow}}", - "voteny-remove": "wotstronić", - "voteny-gave-this": "sy tutomu $1 dał", - "voteny-votes": "{{PLURAL:$1|jedyn hłós|$1 hłosaj|$1 hłosy|$1 hłosow}}", - "topratings": "Najwyše pohódnoćene strony", - "topratings-no-pages": "Žane najwyše pohódnoćene strony.", - "right-voteny": "Wothłosowanske strony" -} diff --git a/i18n/id.json b/i18n/id.json deleted file mode 100644 index 4b0d1ed..0000000 --- a/i18n/id.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "@metadata": { - "authors": [ - "පසිඳු කාවින්ද" - ] - }, - "voteny-remove": "hapus" -} diff --git a/i18n/it.json b/i18n/it.json deleted file mode 100644 index 4f40f3e..0000000 --- a/i18n/it.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Beta16", - "Darth Kule" - ] - }, - "voteny-desc": "Sistema di voto basato su JavaScript con il tag <vote>", - "voteny-link": "Vota", - "voteny-unvote-link": "rimuovi voto", - "voteny-community-score": "{{PLURAL:$2|punteggio|punteggi}} della comunità: $1", - "voteny-ratings": "{{PLURAL:$1|un giudizio|$1 giudizi}}", - "voteny-remove": "rimuovi", - "voteny-gave-this": "hai dato $1", - "voteny-votes": "{{PLURAL:$1|un voto|$1 voti}}", - "topratings": "Pagine migliori", - "topratings-no-pages": "Nessuna pagina migliore.", - "right-voteny": "Vota le pagine" -} diff --git a/i18n/ja.json b/i18n/ja.json deleted file mode 100644 index 10b8cc2..0000000 --- a/i18n/ja.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Shirayuki", - "Otokoume" - ] - }, - "voteny-desc": "<vote> タグを使用した、JavaScript ベースの投票", - "voteny-link": "投票", - "voteny-unvote-link": "投票取り消し", - "voteny-community-score": "コミュニティでの{{PLURAL:$2|得点}}: $1", - "voteny-ratings": "{{PLURAL:$1|$1 件の評価}}", - "voteny-remove": "除去", - "voteny-gave-this": "あなたはこれを $1 と評価しました", - "voteny-votes": "{{PLURAL:$1|$1 票}}", - "topratings": "評価が高いページ", - "topratings-no-pages": "評価が高いページはありません。", - "right-voteny": "ページに投票" -} diff --git a/i18n/ka.json b/i18n/ka.json deleted file mode 100644 index 4ed6221..0000000 --- a/i18n/ka.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "@metadata": { - "authors": [ - "David1010" - ] - }, - "voteny-link": "ხმის მიცემა", - "voteny-remove": "წაშლა" -} diff --git a/i18n/ko.json b/i18n/ko.json deleted file mode 100644 index 512cf4a..0000000 --- a/i18n/ko.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "@metadata": { - "authors": [ - "아라", - "Ykhwong" - ] - }, - "apihelp-voteny-description": "VoteNY API 모듈", - "voteny-desc": "<vote> 태그로 자바스크립트 기반 투포", - "voteny-link": "투표", - "voteny-unvote-link": "투표 취소", - "voteny-community-score": "공동체 {{PLURAL:$2|점수}}: $1", - "voteny-ratings": "{{PLURAL:$1|평가 한 개|평가 $1개}}", - "voteny-remove": "제거", - "voteny-gave-this": "이것을 $1(으)로 주었습니다", - "voteny-votes": "{{PLURAL:$1|한 표|$1표}}", - "topratings": "평가가 높은 문서", - "topratings-no-pages": "평가가 높은 문서가 없습니다.", - "right-voteny": "문서 투표" -} diff --git a/i18n/ksh.json b/i18n/ksh.json deleted file mode 100644 index 2942b9f..0000000 --- a/i18n/ksh.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Purodha" - ] - }, - "voteny-desc": "Afschtemmonge met JavaSkrep övver dä Befähl <vote>.", - "voteny-link": "Afschtemme", - "voteny-unvote-link": "Schtemm zerökträke", - "voteny-community-score": "Jemeinschafflejje Pünkscher: $1", - "voteny-ratings": "{{PLURAL:$1|Ein Bewertong|$1 Bewertonge|Kein Bewertonge}}", - "voteny-remove": "fott nämme", - "voteny-gave-this": "Do häs en $1 verjovve.", - "voteny-votes": "{{PLURAL:$1|Ein Schtemm|$1 Schtemme|Kein Schtemme}}", - "topratings": "Sigge met de hühste Bewertonge", - "topratings-no-pages": "Kein Sigge met hühste Bewertonge jefonge.", - "right-voteny": "Övver Siige afschtemme" -} diff --git a/i18n/lb.json b/i18n/lb.json deleted file mode 100644 index 7a85f6a..0000000 --- a/i18n/lb.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Robby" - ] - }, - "apihelp-voteny-param-voteValue": "Numeresche Wäert fir d'Ofstëmmung tëscht 1 a 5", - "apihelp-voteny-example-2": "Läscht Är Stëmm vun der Säit mat der ID-Nummer 666", - "voteny-link": "Ofstëmmen", - "voteny-unvote-link": "Stëmm zréckzéien", - "voteny-remove": "ewechhuelen", - "voteny-gave-this": "Dir hutt eng $1 ofginn", - "voteny-votes": "({{PLURAL:$1|eng Stëmm|$1 Stëmmen}})", - "right-voteny": "Ofstëmmen iwwer Säiten" -} diff --git a/i18n/mk.json b/i18n/mk.json deleted file mode 100644 index 439e81c..0000000 --- a/i18n/mk.json +++ /dev/null @@ -1,28 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Bjankuloski06" - ] - }, - "apihelp-voteny-description": "Приложнички модул VoteNY", - "apihelp-voteny-param-what": "Дејството што ќе се преземе; се прифаќаат вредностите „vote“ (зелено гласачка кутија), „multi“ (гласачки ѕвездички) или „delete“ (бришење на претходно даден глас)", - "apihelp-voteny-param-pageId": "Назнака на страницата кајшто се наоѓа(ат) гласачката кутија/ѕвездички", - "apihelp-voteny-param-voteValue": "Бројчена вредност на гласот меѓу 1 и 5", - "apihelp-voteny-param-type": "Укажете „stars“ за да се повикаат гласачките ѕвездички (PHP-класа VoteStars); во спротивно ќе се користи зелената гласачка кутија (PHP-класа Vote)", - "apihelp-voteny-example-1": "Дај глас за страница со број 666", - "apihelp-voteny-example-2": "Избришете го вашиот глас од страницата со број 666", - "apihelp-voteny-example-3": "Дајте глас (3 од 5 ѕвездички) за страницата со назнака 666", - "apihelp-voteny-example-4": "Избриеште го гласот од страница со назнака 666 која користи оценување со ѕвездички", - "apihelp-voteny-example-5": "Дајте глас (4 од 5 ѕвездички) за страницата со број 666, бришејќи го претходниот глас, ако го има", - "voteny-desc": "Гласање на основа на JavaScript со ознаката <vote>", - "voteny-link": "Гласај", - "voteny-unvote-link": "повлечи глас", - "voteny-community-score": "{{PLURAL:$2|оценка|оценки}} од заедницата: $1", - "voteny-ratings": "{{PLURAL:$1|една оценка|$1 оценки}}", - "voteny-remove": "отстрани", - "voteny-gave-this": "страницава ја оценивте со $1", - "voteny-votes": "{{PLURAL:$1|еден глас|$1 гласа}}", - "topratings": "Водечки страници", - "topratings-no-pages": "Нема водечки страници.", - "right-voteny": "Гласање за страници" -} diff --git a/i18n/ms.json b/i18n/ms.json deleted file mode 100644 index 64b9a2f..0000000 --- a/i18n/ms.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Anakmalaysia" - ] - }, - "voteny-desc": "Pengundian berasaskan JavaScript dengan teg <vote>", - "voteny-link": "Undi", - "voteny-unvote-link": "tarik balik undi", - "voteny-community-score": "markah komuniti: $1", - "voteny-ratings": "$1 penilaian", - "voteny-remove": "buang", - "voteny-gave-this": "anda memberi yang ini $1", - "voteny-votes": "$1 undian", - "topratings": "Halaman undian tertinggi", - "topratings-no-pages": "Tiada halaman undian tertinggi.", - "right-voteny": "Mengundi halaman" -} diff --git a/i18n/nap.json b/i18n/nap.json deleted file mode 100644 index f506924..0000000 --- a/i18n/nap.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "@metadata": { - "authors": [ - "C.R." - ] - }, - "voteny-desc": "Sistema 'e voto basato ncopp'a JavaScript c' 'o tag <vote>", - "voteny-link": "Vota", - "voteny-unvote-link": "leva voto", - "voteny-community-score": "punteggio d' 'a communità: $1", - "voteny-ratings": "{{PLURAL:$1|nu judizio|$1 ghiudizie}}", - "voteny-remove": "leva", - "voteny-gave-this": "hè dato $1", - "voteny-votes": "{{PLURAL:$1|nu voto|$1 vote}}", - "topratings": "Paggene cchiù mmeglio vutate", - "topratings-no-pages": "Nun ce sta paggena mmeglio.", - "right-voteny": "Vota 'e paggene" -} diff --git a/i18n/nl.json b/i18n/nl.json deleted file mode 100644 index 538c5bd..0000000 --- a/i18n/nl.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Mitchel Corstjens", - "Siebrand" - ] - }, - "voteny-desc": "Op JavaScript gebaseerde peilingen met het label <vote>", - "voteny-link": "Stemmen", - "voteny-unvote-link": "stem intrekken", - "voteny-community-score": "gemeenschapsscore: $1", - "voteny-ratings": "{{PLURAL:$1|één waardering|$1 waarderingen}}", - "voteny-remove": "verwijderen", - "voteny-gave-this": "u heeft een $1 gegeven", - "voteny-votes": "{{PLURAL:$1|één stem|$1 stemmen}}", - "topratings": "Meest gewaardeerde pagina's", - "topratings-no-pages": "Er zijn nog geen meest gewaardeerde pagina's.", - "right-voteny": "Op pagina's stemmen" -} diff --git a/i18n/pl.json b/i18n/pl.json deleted file mode 100644 index 11acf9a..0000000 --- a/i18n/pl.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Chrumps" - ] - }, - "apihelp-voteny-description": "Moduł API VoteNY", - "voteny-link": "Głosuj", - "voteny-unvote-link": "Anuluj", - "voteny-community-score": "Wynik wśród społeczności: $1", - "voteny-ratings": "{{PLURAL:$1|1 głos|$1 głosy|$1 głosów}}", - "voteny-remove": "usuń", - "voteny-gave-this": "Oceniłeś to na $1", - "voteny-votes": "{{PLURAL:$1|1 głos|$1 głosy|$1 głosów}}" -} diff --git a/i18n/pms.json b/i18n/pms.json deleted file mode 100644 index 24f369b..0000000 --- a/i18n/pms.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Borichèt", - "Dragonòt" - ] - }, - "voteny-desc": "Votassion basà dzor JavaScript con la tichëtta <vote>", - "voteny-link": "Voté", - "voteny-unvote-link": "scancelé vot", - "voteny-community-score": "Pontegi dla comunità: $1", - "voteny-ratings": "{{PLURAL:$1|na valutassion|$1 valutassion}}", - "voteny-remove": "gava", - "voteny-gave-this": "It l'has daje un $1", - "voteny-votes": "{{PLURAL:$1|un vot|$1 vot}}", - "topratings": "Le pàgine valutà mej", - "topratings-no-pages": "Gnun-e pàgine valutà.", - "right-voteny": "Pàgine ëd vot" -} diff --git a/i18n/ps.json b/i18n/ps.json deleted file mode 100644 index 4a1e9c0..0000000 --- a/i18n/ps.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Ahmed-Najib-Biabani-Ibrahimkhel" - ] - }, - "right-voteny": "د رايې مخونه" -} diff --git a/i18n/pt-br.json b/i18n/pt-br.json deleted file mode 100644 index 5b2669a..0000000 --- a/i18n/pt-br.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Luckas" - ] - }, - "voteny-link": "Votar", - "voteny-remove": "remover", - "voteny-votes": "{{PLURAL:$1|um voto|$1 votos}}" -} diff --git a/i18n/qqq.json b/i18n/qqq.json index b1ee70d..ec9e5da 100644 --- a/i18n/qqq.json +++ b/i18n/qqq.json @@ -9,25 +9,8 @@ "Umherirrender" ] }, - "apihelp-voteny-description": "{{doc-apihelp-description|voteny}}", - "apihelp-voteny-param-what": "{{doc-apihelp-param|voteny|what}}", - "apihelp-voteny-param-pageId": "{{doc-apihelp-param|voteny|pageId}}", - "apihelp-voteny-param-voteValue": "{{doc-apihelp-param|voteny|voteValue}}", - "apihelp-voteny-param-type": "{{doc-apihelp-param|voteny|type}}", - "apihelp-voteny-example-1": "{{doc-apihelp-example|voteny}}", - "apihelp-voteny-example-2": "{{doc-apihelp-example|voteny}}", - "apihelp-voteny-example-3": "{{doc-apihelp-example|voteny}}", - "apihelp-voteny-example-4": "{{doc-apihelp-example|voteny}}", - "apihelp-voteny-example-5": "{{doc-apihelp-example|voteny}}", - "voteny-desc": "{{desc|name=Vote NY|url=https://www.mediawiki.org/wiki/Extension:VoteNY}}", - "voteny-link": "Link title\n{{Identical|Vote}}", - "voteny-unvote-link": "Displayed to the user after their vote has been successfully added; they can click on this link to remove their vote.\n{{Identical|Unvote}}", - "voteny-community-score": "Community score is the average of votes a page has been given.\n\nParameters:\n* $1 - the actual score in numbers (i.e. 4.5 or 3)\n* $2 - score count for PLURAL support", - "voteny-ratings": "Parameters:\n* $1 - the number of ratings, if said number is greater than 1\n{{Identical|Rating}}", - "voteny-remove": "Link title, clicking on this link removes your vote. Refer to the [[mw:File:VoteNY.png|image]] for details.\n{{Identical|Remove}}", - "voteny-gave-this": "Followed by the action link text {{msg-mw|Voteny-remove}}.\n\nParameter:\n* $1 - a number, the vote the user gave to the page.\n\nRefer to the [[mw:File:VoteNY.png|image]] for details.", - "voteny-votes": "Parameters:\n* $1 - number of votes\n{{Identical|Vote}}", - "topratings": "{{doc-special|TopRatings}}", - "topratings-no-pages": "Displayed on Special:TopRatings if there are no top rated pages, i.e. if no pages have been rated on the wiki at all.", - "right-voteny": "{{doc-right|voteny}}\nRight to place a vote on pages with the extension." + "iusethis-link": "Link title\n{{Identical|I use this}}", + "iusethis-unvote-link": "Displayed to the user after their vote has been successfully added; they can click on this link to remove their vote.\n{{Identical|I don't use this}}", + "iusethis-remove": "Link title, clicking on this link removes your vote. Refer to the [[mw:File:VoteNY.png|image]] for details.\n{{Identical|Remove}}", + "right-iusethis": "{{doc-right|iusethis}}\nRight to place a vote on pages with the extension." } diff --git a/i18n/ro.json b/i18n/ro.json deleted file mode 100644 index 7510f49..0000000 --- a/i18n/ro.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Minisarm", - "Stelistcristi" - ] - }, - "voteny-link": "Votați", - "voteny-remove": "elimină" -} diff --git a/i18n/roa-tara.json b/i18n/roa-tara.json deleted file mode 100644 index b16176f..0000000 --- a/i18n/roa-tara.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Joetaras" - ] - }, - "voteny-desc": "Votazione ca se base sus a JavaScript cu 'u tag <vote>", - "voteny-link": "Vote", - "voteny-unvote-link": "no vutà", - "voteny-community-score": "pundegge d'a comunitate: $1", - "voteny-ratings": "{{PLURAL:$1|'na valutazione|$1 valutaziune}}", - "voteny-remove": "live", - "voteny-gave-this": "Tu è date quiste $1", - "voteny-votes": "{{PLURAL:$1|'nu vote|$1 vote}}", - "topratings": "Pàggene cchiù vutate", - "topratings-no-pages": "Pàggene ca no stonne 'ngape a le vote.", - "right-voteny": "Vote le vôsce" -} diff --git a/i18n/ru.json b/i18n/ru.json deleted file mode 100644 index e443e1e..0000000 --- a/i18n/ru.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Kaganer", - "Okras" - ] - }, - "voteny-desc": "Голосование на основе JavaScript с использованием тега <vote>", - "voteny-link": "Голосовать", - "voteny-unvote-link": "отменить выбор", - "voteny-community-score": "{{PLURAL:$2|оценка|оценки}} сообщества: $1", - "voteny-ratings": "{{PLURAL:$1|$1 балл|$1 балла|$1 баллов}}", - "voteny-remove": "отменить", - "voteny-gave-this": "Вы поставили $1", - "voteny-votes": "{{PLURAL:$1|$1 голос|$1 голоса|$1 голосов}}", - "topratings": "Самые популярные страницы", - "topratings-no-pages": "Нет популярных страниц.", - "right-voteny": "Страницы голосований" -} diff --git a/i18n/si.json b/i18n/si.json deleted file mode 100644 index 39e797d..0000000 --- a/i18n/si.json +++ /dev/null @@ -1,17 +0,0 @@ -{ - "@metadata": { - "authors": [ - "පසිඳු කාවින්ද" - ] - }, - "voteny-link": "ඡන්දය දෙන්න", - "voteny-unvote-link": "මනාපය ලබා නොදෙන්න", - "voteny-community-score": "ප්‍රජා ලකුණ: $1", - "voteny-ratings": "{{PLURAL:$1|තරාතිරමක්|තරාතිරම් $1 ක්}}", - "voteny-remove": "ඉවත් කරන්න", - "voteny-gave-this": "ඔබ මෙයට $1 දී ඇත", - "voteny-votes": "{{PLURAL:$1|මනාපයක්|මනාප $1 ක්}}", - "topratings": "ඉහළ ශ්‍රේණිගත පිටු", - "topratings-no-pages": "ඉහළ ශ්‍රේණිගත පිටු නොමැත.", - "right-voteny": "මනාප පිටු" -} diff --git a/i18n/sr-ec.json b/i18n/sr-ec.json deleted file mode 100644 index df0ff87..0000000 --- a/i18n/sr-ec.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Milicevic01" - ] - }, - "right-voteny": "гласање за странице" -} diff --git a/i18n/sr-el.json b/i18n/sr-el.json deleted file mode 100644 index 3a57fca..0000000 --- a/i18n/sr-el.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Milicevic01" - ] - }, - "right-voteny": "glasanje za stranice" -} diff --git a/i18n/sv.json b/i18n/sv.json deleted file mode 100644 index 077f756..0000000 --- a/i18n/sv.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "@metadata": { - "authors": [ - "WikiPhoenix" - ] - }, - "voteny-desc": "JavaScript-baserad omröstning med taggen <vote>", - "voteny-link": "Rösta", - "voteny-unvote-link": "ta bort röst", - "voteny-community-score": "{{PLURAL:$2|gemenskapspoäng}}: $1", - "voteny-ratings": "{{PLURAL:$1|ett betyg|$1 betyg}}", - "voteny-remove": "ta bort", - "voteny-gave-this": "du gav detta $1", - "voteny-votes": "{{PLURAL:$1|en röst|$1 röster}}", - "topratings": "Topplistade sidor", - "topratings-no-pages": "Inga topplistade sidor.", - "right-voteny": "Omröstningssidor" -} diff --git a/i18n/ta.json b/i18n/ta.json deleted file mode 100644 index 9388f74..0000000 --- a/i18n/ta.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "@metadata": { - "authors": [ - "மதனாஹரன்" - ] - }, - "voteny-link": "வாக்களி", - "voteny-remove": "நீக்கு" -} diff --git a/i18n/tl.json b/i18n/tl.json deleted file mode 100644 index 0e5fb9f..0000000 --- a/i18n/tl.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "@metadata": { - "authors": [ - "AnakngAraw", - "TheSleepyhollow02" - ] - }, - "voteny-desc": "Botohan na nakabatay sa JavaScript na mayroong tatak na <bumoto>", - "voteny-link": "Bumoto", - "voteny-unvote-link": "huwag bumoto", - "voteny-community-score": "puntos ng pamayanan: $1", - "voteny-ratings": "{{PLURAL:$1|isang pag-aantas|$1 mga pag-aantas}}", - "voteny-remove": "tanggalin", - "voteny-gave-this": "binigyan mo ito ng isang $1", - "voteny-votes": "{{PLURAL:$1| isang boto| $1 mga boto}}", - "topratings": "Mga pahinang nangunguna sa pag-aantas", - "topratings-no-pages": "Walang mga pahinang nangunguna sa pag-aantas.", - "right-voteny": "Iboto ang mga pahina" -} diff --git a/i18n/uk.json b/i18n/uk.json deleted file mode 100644 index ddba9ef..0000000 --- a/i18n/uk.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Base", - "Piramidion" - ] - }, - "apihelp-voteny-description": "Модуль API VoteNY", - "apihelp-voteny-param-what": "Дія, яку виконати; дійсними значеннями є 'vote' (зелене поле для голосування), 'multi' (зірочки голосування) або 'delete' (вилучити попередній голос)", - "apihelp-voteny-param-pageId": "Ідентифікатор сторінки, на якій розміщені поле/зірочки голосування", - "apihelp-voteny-param-voteValue": "Числове значення голосування між 1 і 5", - "apihelp-voteny-param-type": "Встановіть це значення як 'stars', щоб викликати зірочки голосування (PHP-клас VoteStars), в іншому випадку буде використано зелене поле голосування (PHP-клас Vote)", - "apihelp-voteny-example-1": "Проголосувати для сторінки з ідентифікатором 666", - "apihelp-voteny-example-2": "Вилучити Ваш голос зі сторінки з ідентифікатором 666", - "apihelp-voteny-example-3": "Проголосувати (3 зірки з 5) для сторінки з ідентифікатором 666", - "apihelp-voteny-example-4": "Вилучити голосування зі сторінки з ідентифікатором 666, яка використовує рейтинг у зірочках", - "apihelp-voteny-example-5": "Проголосувати (4 зірки з 5) для сторінки з ідентифікатором 666, вилучивши Ваш попередній голос, якщо такий був", - "voteny-desc": "Голосування на основі JavaScript із теґом <vote>", - "voteny-link": "Голосувати", - "voteny-unvote-link": "скасувати голос", - "voteny-community-score": "{{PLURAL:$2|середня оцінка|середні оцінки}}: $1", - "voteny-ratings": "{{PLURAL:$1|один голос|$1 голоси|$1 голосів}}", - "voteny-remove": "вилучити", - "voteny-gave-this": "Ви оцінили це як $1", - "voteny-votes": "{{PLURAL:$1|один голос|$1 голоси|$1 голосів}}", - "topratings": "Сторінки із найвищим оцінками", - "topratings-no-pages": "Сторінки із не найвищими оцінками.", - "right-voteny": "Голосувати за сторінки" -} diff --git a/i18n/yue.json b/i18n/yue.json deleted file mode 100644 index a641227..0000000 --- a/i18n/yue.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Obonggi" - ] - }, - "apihelp-voteny-param-voteValue": "投票值喺1到5之間", - "apihelp-voteny-example-4": "刪除你喺頁面上嘅投票,嗰個投票含有ID號碼666使用咗評星等級。" -} diff --git a/i18n/zh-hans.json b/i18n/zh-hans.json deleted file mode 100644 index baeeb8c..0000000 --- a/i18n/zh-hans.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Shirayuki", - "Yfdyh000", - "Liuxinyu970226", - "Hanyanbo98" - ] - }, - "apihelp-voteny-description": "VoteNY API模块", - "apihelp-voteny-param-what": "要进行的操作;有效值为“vote”(绿色投票框)、“multi”(投票星标)或“delete”(删除之前投出的投票)", - "apihelp-voteny-param-pageId": "投票框/星标所在页面的页面ID", - "apihelp-voteny-param-voteValue": "数字投票值(1~5之间)", - "apihelp-voteny-param-type": "将此设置为“stars”来调用投票星标(投票星标PHP类),否则会使用绿色投票框(投票框PHP类)", - "apihelp-voteny-example-1": "为ID为666的页面投出一票", - "apihelp-voteny-example-2": "删除您为ID为666的页面投出的票", - "apihelp-voteny-example-3": "为ID为666的页面投出一票(5颗星中的3颗)", - "apihelp-voteny-example-4": "删除您为ID为666的页面(使用星级)投出的票", - "apihelp-voteny-example-5": "为ID为666的页面投出一票(5颗星中的4颗),并删除您之前的投票(如果有)", - "voteny-desc": "基于JavaScript的投票与<vote>标签", - "voteny-link": "投票", - "voteny-unvote-link": "消票", - "voteny-community-score": "社区{{PLURAL:$2|分数}}:$1", - "voteny-ratings": "{{PLURAL:$1|$1人评分}}", - "voteny-remove": "删除", - "voteny-gave-this": "您给了$1分", - "voteny-votes": "{{PLURAL:$1|$1票}}", - "topratings": "最受好评的页面", - "topratings-no-pages": "没有最受好评的页面。", - "right-voteny": "投票页面" -} diff --git a/i18n/zh-hant.json b/i18n/zh-hant.json deleted file mode 100644 index 1ac7e6c..0000000 --- a/i18n/zh-hant.json +++ /dev/null @@ -1,19 +0,0 @@ -{ - "@metadata": { - "authors": [ - "Justincheng12345", - "Shirayuki" - ] - }, - "voteny-desc": "基於JavaScript的投票與<vote>標記", - "voteny-link": "投票", - "voteny-unvote-link": "取消投票", - "voteny-community-score": "社羣積分:$1", - "voteny-ratings": "{{PLURAL:$1|$1個評級}}", - "voteny-remove": "移除", - "voteny-gave-this": "你給了$1分", - "voteny-votes": "{{PLURAL:$1|$1票}}", - "topratings": "最受好評的頁面", - "topratings-no-pages": "沒有最受好評的頁面。", - "right-voteny": "投票頁面" -} diff --git a/images/star_half.gif b/images/star_half.gif deleted file mode 100644 index c24340716a9fe0a0484d3dc26a3f525dd8b66567..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 637 zcmZ?wbhEHb6k-r!coxm@^Z&;0|L1=B^5yIQ_J3{6it5-K|+VuH<(X(gI zwr$(?=FOWeTeiG<_3G{0w;%p{y?pud&!0c<-o4wtefzFmyKdgR`Q*uy2M-=RfByW} zuU~)v{ylc=*sWW)Zr{Fr<;s;GKYm=ic=61cGvB{|-@JMAfddCVefsqFzuNu#_jm8! z{q^hDpFe-@-@pI&@82Ijd^mmj^x3m#pFVwh>C&Y=`)6FccJ1VanjJfK+PynQ>|Lshtm-^z#c87I$69tja{Ijv?cU$!r7g5Sk> zMJ2*oSR4hIoB|vISXh~~1rE*#T9DYtE#SQ5K_K_wV0Ln>Ias_;B;)&G+uz+qP}nix)3;?%cU&&z?JX?)?1u z^ZWPjSFc{Zc=6({UAy-0-+$=Pp<~C6&6zXj#*G`dZ{Pm>`SYt+uYUddwPnke-@kuf zxpL+D_3PWWZ-4OM!MAVU)~s2xY}vBcuV3H1dGpATBbP2+I)424ty{P5-@pI(@#8aR z&Kx~@bocJvXV0G9xN+mGS+kx#eY$-4^0#l_&Ye5=&!0b!9zFW;BFf&Ld-m=TQ`6*U z6lk(H^FDd%^hqae79TNIVXv##uCqB9T<~FGR`YoH=%K8P9*1Hx51;GXcdkkjHd=-Z z%~pbLzka)E3aN?;C@K^#S#VI9*WrSPi9#a-Bad4^#R^4tb{96jIXgBgb@1@G_;vi4 z!0@<{SwY3(#)So}Ol)>$DozU*IyR|(6SI*JXpmN9;1anZ&7yE*VnY)XBZD;nx<3Pi diff --git a/images/star_on.gif b/images/star_on.gif deleted file mode 100644 index 813cee88b36de198bd2c27f7fed9b7611beabfd1..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 627 zcmb8s=}VJw0KoB|I*&|j&C;MKH7hGEk4#Mrk99bNtgJ{gG9nW@MlZq_MY^q0DH;gs zn?i~TO0eyjJ9T>mo$e{a+1%lpJ93*WcV9j``h|Z&-}j$a-!pZm%gS3xfCMa5z~yr7 zaKGJdx7loLHd`nZE-o&*-R=lfp(q-OL>vx>%jI%9okpY4=ktZbVXM{Z@pwXTIvS1Q zIBqZ)*4Nk9U9r zogSAAAqe94`#EDHc-Slw4+#VUE)UUawc`_`nw6Vl+%F=L$QORQY?zhJKi024l1imI zTfN@;T&+HPqR^_>>wn1E9@yf9r7lRpAg3GqbXt~*yj0`2&*2iUjoSly{u>Xr+o_mwJj*0oKWX|d1eCZnjDk+Y*1CHHU5DM~r3$gCm6WF$YqyWclw$0w62%ZLpP HnV{kyM3-DL diff --git a/images/star_voted.gif b/images/star_voted.gif deleted file mode 100644 index dbbc91bdf3871c2ea17bb3cf14609fa861cecd25..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 612 zcmZ?wbhEHb6k-r!c*Xz%|NsBrzHRgIqX&L}dAf7!n%|E${&{)i!G(NWj{{DEww~IZ`kG9>|QGa1m&Hp=df8UySVSCr3 z6Vv}c*?43_*XKJM4{n@%`^579uaEwFb#(uRY5Outb$G|k>sPjK-Mnk(j?J4ke);m{^XJc>K7IQ5@#BXNAKt%z|L)zpw{PFR zdGqGgt5?sTKY#Y@*~5nqA3S()|Ni~kw{PFNb?fHMn^&)1y>jKsrAwDCUc7kr?AcSN zPMth?^4PIs2M!$AzkmPk-Me?~+O>1%&K)~;Y~Q|p+qP|6w{G3CWy|Kxn>TIRv~lA` zV7P(9k0L_xCkrD3Lnea`$P`eVFt8tN$ZTqE4rpob$V?6k?(7V)<4beyYjJg8;b!ig z+7!-dYHAVNpPZg|$j%h$@7CG~x9ctlp TcMOqo*m3P;fS^+&1A{dHj}Jg< diff --git a/vote.mysql b/iusethis.mysql similarity index 62% rename from vote.mysql rename to iusethis.mysql index de0dea1..277477c 100644 --- a/vote.mysql +++ b/iusethis.mysql @@ -1,4 +1,4 @@ -CREATE TABLE /*_*/Vote ( +CREATE TABLE /*_*/IUseThis ( -- Internal ID to identify between different vote tags on different pages `vote_id` int(11) NOT NULL auto_increment PRIMARY KEY, -- Username (if any) of the person who voted @@ -7,15 +7,12 @@ CREATE TABLE /*_*/Vote ( `vote_user_id` int(11) NOT NULL default '0', -- ID of the page where the vote tag is in `vote_page_id` int(11) NOT NULL default '0', - -- Value of the vote (ranging from 1 to 5) - `vote_value` char(1) character set latin1 collate latin1_bin NOT NULL default '', -- Timestamp when the vote was cast `vote_date` datetime NOT NULL default '0000-00-00 00:00:00', -- IP address of the user who voted `vote_ip` varchar(45) NOT NULL default '' ) /*$wgDBTableOptions*/; -CREATE INDEX vote_page_id_index ON /*_*/Vote (vote_page_id); -CREATE INDEX valueidx ON /*_*/Vote (vote_value); -CREATE INDEX usernameidx ON /*_*/Vote (username); -CREATE INDEX vote_date ON /*_*/Vote (vote_date); \ No newline at end of file +CREATE INDEX vote_page_id_index ON /*_*/IUseThis (vote_page_id); +CREATE INDEX usernameidx ON /*_*/IUseThis (username); +CREATE INDEX vote_date ON /*_*/IUseThis (vote_date); diff --git a/vote.postgres b/vote.postgres deleted file mode 100644 index 81f397f..0000000 --- a/vote.postgres +++ /dev/null @@ -1,21 +0,0 @@ -CREATE TABLE "Vote" ( - -- Internal ID to identify between different vote tags on different pages - vote_id SERIAL NOT NULL PRIMARY KEY, - -- Username (if any) of the person who voted - username varchar(255) NOT NULL default '0', - -- User ID of the person who voted - vote_user_id integer NOT NULL default '0', - -- ID of the page where the vote tag is in - vote_page_id integer NOT NULL default '0', - -- Value of the vote (ranging from 1 to 5) - vote_value integer NOT NULL, - -- Timestamp when the vote was cast - vote_date timestamp without time zone NOT NULL, - -- IP address of the user who voted - vote_ip varchar(45) NOT NULL default '' -) /*$wgDBTableOptions*/; - -CREATE INDEX vote_page_id_index ON "Vote" (vote_page_id); -CREATE INDEX valueidx ON "Vote" (vote_value); -CREATE INDEX usernameidx ON "Vote" (username); -CREATE INDEX vote_date ON "Vote" (vote_date);