مدیاویکی:Gadget-WordCount.js: تفاوت میان نسخهها
بدون خلاصۀ ویرایش برچسب: واگردانی دستی |
بدون خلاصۀ ویرایش |
||
خط ۱: | خط ۱: | ||
//<nowiki> | //<nowiki> | ||
// This code is based on https://en.wikipedia.org/wiki/User:Dr_pda/prosesize.js | // This code is based on https://en.wikipedia.org/wiki/User:Dr_pda/prosesize.js | ||
خط ۶۹: | خط ۶۸: | ||
function isValidParagraphNode(node) { | function isValidParagraphNode(node) { | ||
if (node.parentNode.className | if (node.parentNode.className.indexOf("mw-parser-output") > -1 || | ||
node.parentNode.parentNode.className | node.parentNode.parentNode.className.indexOf("mw-parser-output") > -1 || | ||
node.parentNode.nodeName == "BLOCKQUOTE") { | node.parentNode.nodeName == "BLOCKQUOTE") { | ||
خط ۲۶۳: | خط ۲۶۲: | ||
mw.loader.using( ['mediawiki.util'], function () { | mw.loader.using( ['mediawiki.util'], function () { | ||
if($.inArray(mw.config.get('wgAction'), ['edit', 'view' , 'submit' , 'historysubmit' , 'purge']) !== -1) { | if($.inArray(mw.config.get('wgAction'), ['edit', 'view' , 'submit' , 'historysubmit' , 'purge']) !== -1) { | ||
$( mw.util.addPortletLink('p-tb', '#', ' | $( mw.util.addPortletLink('p-tb', '#', 'Word count', 't-word-count', 'Calculate word count') ) | ||
.click( toggleWordCount ); | .click( toggleWordCount ); | ||
} | } |