MediaWiki:Gadget-Prosesize.js: Difference between revisions

Content deleted Content added
ce
use revisionid for prosesize API
Line 137:
// Use prosesize API to get a more accurate prose size account
// The calculations below are left in for the highlighting
prosePromise = $.getJSON( 'https://prosesize.toolforge.org/api/en.wikipedia.org/' + mw.config.get( 'wgPageName' ) );
+ mw.config.get( 'wgPageName' ) + '?revision=' + mw.config.get( 'wgRevisionId' ) );
 
// Calculate prose size and size of reference markers ([1] etc)
Line 157 ⟶ 158:
// Add the relevant outputs once we have fetched the prose size.
prosePromise.then( function( data ) {
if ( mw.config.get( 'wgIsArticle' ) && mw.config.get( 'wgCurRevisionId' ) === mw.config.get( 'wgRevisionId' ) ) {
// Tool doesn't work on previews
// Tool only works when viewing current version of page, not on old revisions or on edit page
proseSize = data.prose_size;
wordCount = data.word_count;