r114735 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r114734‎ | r114735 | r114736 >
Date:07:24, 5 April 2012
Author:kaldari
Status:deferred
Tags:
Comment:
making the more button work, fixing some context issues
Modified paths:
  • /trunk/extensions/PageTriage/SpecialPageTriage.php (modified) (history)
  • /trunk/extensions/PageTriage/api/ApiPageTriageList.php (modified) (history)
  • /trunk/extensions/PageTriage/modules/ext.pageTriage.models/ext.pageTriage.article.js (modified) (history)
  • /trunk/extensions/PageTriage/modules/ext.pageTriage.views/ext.pageTriage.listStatsNav.css (modified) (history)
  • /trunk/extensions/PageTriage/modules/ext.pageTriage.views/ext.pageTriage.listView.js (modified) (history)

Diff [purge]

Index: trunk/extensions/PageTriage/SpecialPageTriage.php
@@ -215,13 +215,6 @@
216216 <span class="mwe-pt-control-label-right"><b><%= gM( 'pagetriage-viewing' ) %></b> Sort Controls</span>
217217 </script>
218218
219 - <!-- load more link template -->
220 - <script type="text/template" id="listMoreLinkTemplate">
221 - <div id="mwe-pt-list-more">
222 - <a href="#" style="display: none;"> <%= gM( 'pagetriage-more' ) %> </a>
223 - </div>
224 - </script>
225 -
226219 <!-- bottom nav template -->
227220 <script type="text/template" id="listStatsNavTemplate">
228221 <div id="mwe-pt-top-triager">
Index: trunk/extensions/PageTriage/modules/ext.pageTriage.views/ext.pageTriage.listView.js
@@ -37,8 +37,24 @@
3838
3939 var controlNav = new mw.pageTriage.ListControlNav( { eventBus: this.eventBus, model: articles } );
4040 controlNav.render();
 41+
 42+ // create the more link
 43+ _this = this;
 44+ $( '#mwe-pt-list-view' ).after( $( '<div id="mwe-pt-list-more"></div>' )
 45+ .append( $( '<a></a>' ).msg( 'pagetriage-more' )
 46+ .click( function() {
 47+ _this.loadMore();
 48+ } )
 49+ )
 50+ );
4151 },
4252
 53+ loadMore: function() {
 54+ var lastArticle = articles.last(1);
 55+ articles.apiParams.offset = lastArticle[0].attributes.creation_date;
 56+ articles.fetch( {add: true} );
 57+ },
 58+
4359 // add stats data to the navigation
4460 addStats: function( stats ) {
4561 var statsNav = new mw.pageTriage.ListStatsNav( { eventBus: this.eventBus, model: stats } );
@@ -53,11 +69,10 @@
5470 this.position = 0;
5571 }
5672 article.set( 'position', this.position++ );
57 -
5873 // pass in the specific article instance
5974 var view = new mw.pageTriage.ListItem( { eventBus: this.eventBus, model: article } );
60 - this.$( "#mwe-pt-list-view" ).append( view.render().el );
61 - this.$( ".mwe-pt-list-triage-button" ).button({
 75+ $( "#mwe-pt-list-view" ).append( view.render().el );
 76+ $( ".mwe-pt-list-triage-button" ).button({
6277 label: mw.msg( 'pagetriage-triage' ),
6378 icons: { primary:'ui-icon-search' }
6479 });
@@ -66,7 +81,7 @@
6782 // add all the items in the articles collection
6883 addAll: function() {
6984 $("#mwe-pt-list-view").empty(); // remove the spinner before displaying.
70 - articles.each( this.addOne );
 85+ articles.forEach( this.addOne, this );
7186 this.eventBus.trigger( 'listAddAll' );
7287 }
7388
Index: trunk/extensions/PageTriage/modules/ext.pageTriage.views/ext.pageTriage.listStatsNav.css
@@ -1,5 +1,4 @@
22 #mwe-pt-list-stats-nav {
3 - border-top: none;
43 }
54
65 .stickyBottom #mwe-pt-list-stats-nav {
Index: trunk/extensions/PageTriage/modules/ext.pageTriage.models/ext.pageTriage.article.js
@@ -48,7 +48,7 @@
4949 apiParams: {
5050 namespace: 0,
5151 limit: 50,
52 - dir: 'oldestfirst',
 52+ dir: 'newestfirst',
5353 /*
5454 showbots: null,
5555 showredirs: null,
Index: trunk/extensions/PageTriage/api/ApiPageTriageList.php
@@ -148,7 +148,7 @@
149149 'limit' => array(
150150 ApiBase::PARAM_MAX => '200',
151151 ApiBase::PARAM_DFLT => '20',
152 - ApiBase::PARAM_MIN => '10',
 152+ ApiBase::PARAM_MIN => '1',
153153 ApiBase::PARAM_TYPE => 'integer',
154154 ),
155155 'offset' => array(

Status & tagging log