Index: trunk/extensions/PageTriage/SpecialPageTriage.php |
— | — | @@ -173,16 +173,17 @@ |
174 | 174 | <div class="mwe-pt-control-section"> |
175 | 175 | <span class="mwe-pt-control-label"><b><%= gM( 'pagetriage-filter-show-heading' ) %></b></span> |
176 | 176 | <div class="mwe-pt-control-options"> |
177 | | - <input type="checkbox" /> <%= gM( 'pagetriage-filter-triaged-edits' ) %> <br/> |
178 | | - <input type="checkbox" /> <%= gM( 'pagetriage-filter-nominated-for-deletion' ) %> <br/> |
179 | | - <input type="checkbox" /> <%= gM( 'pagetriage-filter-bot-edits' ) %> <br/> |
180 | | - <input type="checkbox" /> <%= gM( 'pagetriage-filter-redirects' ) %> <br/> |
| 177 | + <input type="checkbox" id="mwe-pt-filter-triaged-edits" /> <%= gM( 'pagetriage-filter-triaged-edits' ) %> <br/> |
| 178 | + <input type="checkbox" id="mwe-pt-filter-nominated-for-deletion" /> <%= gM( 'pagetriage-filter-nominated-for-deletion' ) %> <br/> |
| 179 | + <input type="checkbox" id="mwe-pt-filter-bot-edits" /> <%= gM( 'pagetriage-filter-bot-edits' ) %> <br/> |
| 180 | + <input type="checkbox" id="mwe-pt-filter-redirects" /> <%= gM( 'pagetriage-filter-redirects' ) %> <br/> |
181 | 181 | </div> |
182 | 182 | </div> |
183 | 183 | <div class="mwe-pt-control-section"> |
184 | 184 | <span class="mwe-pt-control-label"><b><%= gM( 'pagetriage-filter-namespace-heading' ) %></b></span> |
185 | 185 | <div class="mwe-pt-control-options"> |
186 | 186 | <select id="mwe-pt-filter-namespace"> |
| 187 | + <option value=""><%= gM( 'pagetriage-filter-ns-all' ) %></option> |
187 | 188 | <% |
188 | 189 | var wgFormattedNamespaces = mw.config.get( 'wgFormattedNamespaces' ); |
189 | 190 | var nsOptions = ''; |
— | — | @@ -213,10 +214,10 @@ |
214 | 215 | <div class="mwe-pt-control-section"> |
215 | 216 | <span class="mwe-pt-control-label"><b><%= gM( 'pagetriage-filter-second-show-heading' ) %></b></span> |
216 | 217 | <div class="mwe-pt-control-options"> |
217 | | - <input type="checkbox" /> <%= gM( 'pagetriage-filter-no-categories' ) %> <br/> |
218 | | - <input type="checkbox" /> <%= gM( 'pagetriage-filter-orphan' ) %> <br/> |
219 | | - <input type="checkbox" /> <%= gM( 'pagetriage-filter-non-autoconfirmed' ) %> <br/> |
220 | | - <input type="checkbox" /> <%= gM( 'pagetriage-filter-blocked' ) %> <br/> |
| 218 | + <input type="checkbox" id="mwe-pt-filter-no-categories" /> <%= gM( 'pagetriage-filter-no-categories' ) %> <br/> |
| 219 | + <input type="checkbox" id="mwe-pt-filter-orphan" /> <%= gM( 'pagetriage-filter-orphan' ) %> <br/> |
| 220 | + <input type="checkbox" id="mwe-pt-filter-non-autoconfirmed" /> <%= gM( 'pagetriage-filter-non-autoconfirmed' ) %> <br/> |
| 221 | + <input type="checkbox" id="mwe-pt-filter-blocked" /> <%= gM( 'pagetriage-filter-blocked' ) %> <br/> |
221 | 222 | </div> |
222 | 223 | </div> |
223 | 224 | <div class="mwe-pt-control-buttons"> |
Index: trunk/extensions/PageTriage/modules/ext.pageTriage.views/ext.pageTriage.listControlNav.js |
— | — | @@ -56,7 +56,7 @@ |
57 | 57 | icons: { secondary:'ui-icon-triangle-1-e' } |
58 | 58 | } ); |
59 | 59 | $( ".mwe-pt-filter-set-button" ).click( function( e ) { |
60 | | - _this.filterSet(); |
| 60 | + _this.filterSync(); |
61 | 61 | _this.toggleFilterMenu(); |
62 | 62 | e.stopPropagation(); |
63 | 63 | } ); |
— | — | @@ -93,23 +93,96 @@ |
94 | 94 | $( '#mwe-pt-control-dropdown' ).css( 'visibility', 'hidden' ); |
95 | 95 | this.filterMenuVisible = 0; |
96 | 96 | } else { |
| 97 | + this.menuSync(); |
97 | 98 | $( '#mwe-pt-control-dropdown' ).css( 'visibility', 'visible' ); |
98 | 99 | $( '#mwe-pt-dropdown-arrow' ).html( '▾' ); |
99 | 100 | this.filterMenuVisible = 1; |
100 | 101 | } |
101 | 102 | }, |
102 | 103 | |
103 | | - filterSet: function() { |
104 | | - console.log('clicked'); |
105 | | - |
| 104 | + // sync the filters with the contents of the menu |
| 105 | + filterSync: function() { |
106 | 106 | // fetch the values from the menu |
107 | 107 | var apiParams = {}; |
108 | 108 | if( $('#mwe-pt-filter-namespace').val() ) { |
109 | 109 | apiParams['namespace'] = $('#mwe-pt-filter-namespace').val(); |
110 | 110 | } |
111 | 111 | |
112 | | - this.model.apiParams = apiParams; |
| 112 | + // these are conditionals because the keys shouldn't exist if the checkbox isn't checked. |
| 113 | + if( $('#mwe-pt-filter-triaged-edits').prop('checked') ) { |
| 114 | + apiParams['showtriaged'] = '1'; |
| 115 | + } |
| 116 | + |
| 117 | + /* |
| 118 | + if( $('#mwe-pt-filter-nominated-for-deletion').prop('checked') ) { |
| 119 | + apiParams[''] = '1'; |
| 120 | + } |
| 121 | + */ |
| 122 | + |
| 123 | + if( $('#mwe-pt-filter-bot-edits').prop('checked') ) { |
| 124 | + apiParams['showbots'] = '1'; |
| 125 | + } |
| 126 | + |
| 127 | + if( $('#mwe-pt-filter-redirects').prop('checked') ) { |
| 128 | + apiParams['showredirs'] = '1'; |
| 129 | + } |
| 130 | + |
| 131 | + /* |
| 132 | + api doesn't support these. |
| 133 | + if( $('#mwe-pt-filter-user').val() ) { |
| 134 | + apiParams[''] = $('#mwe-pt-filter-user').val(); |
| 135 | + } |
| 136 | + |
| 137 | + if( $('#mwe-pt-filter-tag').val() ) { |
| 138 | + apiParams[''] = $('#mwe-pt-filter-tag').val(); |
| 139 | + } |
| 140 | + */ |
| 141 | + |
| 142 | + if( $('#mwe-pt-filter-no-categories').prop('checked') ) { |
| 143 | + apiParams['no_category'] = '1'; |
| 144 | + } |
| 145 | + |
| 146 | + if( $('#mwe-pt-filter-orphan').prop('checked') ) { |
| 147 | + apiParams['no_inbound_links'] = '1'; |
| 148 | + } |
| 149 | + |
| 150 | + if( $('#mwe-pt-filter-non-autoconfirmed').prop('checked') ) { |
| 151 | + apiParams['non_autoconfirmed_users'] = '1'; |
| 152 | + } |
| 153 | + |
| 154 | + if( $('#mwe-pt-filter-blocked').prop('checked') ) { |
| 155 | + apiParams['blocked_users'] = '1'; |
| 156 | + } |
| 157 | + |
| 158 | + // persist the limit parameter |
| 159 | + apiParams['limit'] = this.model.getParam('limit'); |
| 160 | + |
| 161 | + this.model.setParams( apiParams ); |
113 | 162 | this.model.fetch(); |
| 163 | + this.render(); |
| 164 | + }, |
| 165 | + |
| 166 | + // sync the menu with the contents of the filters |
| 167 | + menuSync: function() { |
| 168 | + $( '#mwe-pt-filter-namespace' ).val( this.model.getParam( 'namespace' ) ); |
| 169 | + |
| 170 | + $( '#mwe-pt-filter-triaged-edits' ).prop( 'checked', this.model.getParam( 'showtriaged' )=="1"?true:false ); |
| 171 | + // api doesn't support this? |
| 172 | + //$( '#mwe-pt-filter-nominated-for-deletion' ).prop( 'checked', this.model.getParam('')=="1"?true:false ); |
| 173 | + $( '#mwe-pt-filter-bot-edits' ).prop( 'checked', this.model.getParam( 'showbots' )=="1"?true:false ); |
| 174 | + $( '#mwe-pt-filter-redirects' ).prop( 'checked', this.model.getParam( 'showredirs' )=="1"?true:false ); |
| 175 | + |
| 176 | + /* api doesn't support these |
| 177 | + $( '#mwe-pt-filter-user' ).val( this.model.getParam('') ); |
| 178 | + $( '#mwe-pt-filter-tag' ).val( this.model.getParam('') ); |
| 179 | + */ |
| 180 | + |
| 181 | + $( '#mwe-pt-filter-no-categories' ).prop( 'checked', this.model.getParam( 'no_category' )=="1"?true:false ); |
| 182 | + $( '#mwe-pt-filter-orphan' ).prop( 'checked', this.model.getParam( 'no_inbound_links' )=="1"?true:false ); |
| 183 | + $( '#mwe-pt-filter-non-autoconfirmed' ).prop( 'checked', this.model.getParam( 'non_autoconfirmed_users' )=="1"?true:false ); |
| 184 | + $( '#mwe-pt-filter-blocked' ).prop( 'checked', this.model.getParam( 'blocked_users' )=="1"?true:false ); |
| 185 | + |
| 186 | + |
114 | 187 | } |
115 | 188 | |
116 | 189 | } ); |
Index: trunk/extensions/PageTriage/modules/ext.pageTriage.models/ext.pageTriage.article.js |
— | — | @@ -44,6 +44,7 @@ |
45 | 45 | |
46 | 46 | apiParams: { |
47 | 47 | namespace: 0, |
| 48 | + limit: 50, |
48 | 49 | /* |
49 | 50 | showbots: null, |
50 | 51 | showredirs: null, |
— | — | @@ -78,11 +79,13 @@ |
79 | 80 | return response.pagetriagelist.pages; |
80 | 81 | }, |
81 | 82 | |
82 | | - setParams: function( apiParams ) { |
83 | | - console.log('setParams called with ' + apiParams); |
84 | | - |
| 83 | + setParams: function( apiParams ) { |
85 | 84 | this.apiParams = apiParams; |
86 | 85 | this.eventBus.trigger( "paramsSet", this.apiParams ); |
| 86 | + }, |
| 87 | + |
| 88 | + getParam: function( key ) { |
| 89 | + return this.apiParams[key]; |
87 | 90 | } |
88 | 91 | |
89 | 92 | } ); |
Index: trunk/extensions/PageTriage/api/ApiPageTriageList.php |
— | — | @@ -132,7 +132,7 @@ |
133 | 133 | ApiBase::PARAM_TYPE => 'boolean', |
134 | 134 | ), |
135 | 135 | 'limit' => array( |
136 | | - ApiBase::PARAM_MAX => '50', |
| 136 | + ApiBase::PARAM_MAX => '200', |
137 | 137 | ApiBase::PARAM_DFLT => '20', |
138 | 138 | ApiBase::PARAM_MIN => '10', |
139 | 139 | ApiBase::PARAM_TYPE => 'integer', |
Index: trunk/extensions/PageTriage/PageTriage.i18n.php |
— | — | @@ -54,6 +54,7 @@ |
55 | 55 | 'pagetriage-stats-less-than-a-day' => 'less than one day', |
56 | 56 | 'pagetriage-stats-top-triagers' => 'Top {{PLURAL:$1|triager|$1 triagers}}: $2', |
57 | 57 | 'pagetriage-filter-ns-article' => 'Article', |
| 58 | + 'pagetriage-filter-ns-all' => 'All', |
58 | 59 | ); |
59 | 60 | |
60 | 61 | /** |
— | — | @@ -99,5 +100,6 @@ |
100 | 101 | 'pagetriage-stats-untriaged-age' => 'Navigation text displaying triage stats, $1 and $2 are the ages of average and oldest articles respectively', |
101 | 102 | 'pagetriage-stats-less-than-a-day' => 'show this message if the article age is less than one day, part of variable $1 and $2 of {{msg-pagetriage|pagetriage-stats-untriaged-age}} ', |
102 | 103 | 'pagetriage-stats-top-triagers' => 'Text that shows top triagers, $1 is the total number, $2 shows the detail', |
103 | | - 'pagetriage-filter-ns-article' => 'The name of the main article namespace', |
| 104 | + 'pagetriage-filter-ns-article' => 'The name of the main article namespace, for the namespace filter select list', |
| 105 | + 'pagetriage-filter-ns-all' => 'For the namespace filter select list, text indicating that all namespaces will be selected', |
104 | 106 | ); |
Index: trunk/extensions/PageTriage/PageTriage.php |
— | — | @@ -242,6 +242,7 @@ |
243 | 243 | 'pagetriage-stats-top-triagers', |
244 | 244 | 'days', |
245 | 245 | 'pagetriage-filter-ns-article', |
| 246 | + 'pagetriage-filter-ns-all', |
246 | 247 | ) |
247 | 248 | ); |
248 | 249 | |