User:It's moon/common.js

From Just Solve the File Format Problem
< User:It's moon(Difference between revisions)
Jump to: navigation, search
m (Fix attempt)
(Is this even loading?)
 
(One intermediate revision by one user not shown)
Line 1: Line 1:
−
// Automatically submit Special:Captcha
+
const numWords = $( '#mw-content-text > div' ).text().split( ' ' ).length;
−
$(function () {
+
const headerWords = $( 'h1' ).text().split( ' ' ).length;
−
  if (location.href.includes("action=submit")) {
+
const totalWords = numWords + headerWords;
−
    setTimeout(function () {
+
const timeInMinutes = totalWords / 200;
−
      if ($("#wpCaptchaWord").length) {
+
const header = $( 'h1' ).text();
−
        $("#wpCaptchaWord").val("herpderp");
+
$( 'h1' ).text( header + ' (it will take you ' + timeInMinutes + ' minutes to read this page)' );
−
        $("#wpSave").click();
+
−
      }
+
−
    }, 300);
+
−
  }
+
−
});
+

Latest revision as of 05:02, 23 May 2025

const numWords = $( '#mw-content-text > div' ).text().split( ' ' ).length;
const headerWords = $( 'h1' ).text().split( ' ' ).length;
const totalWords = numWords + headerWords;
const timeInMinutes = totalWords / 200;
const header = $( 'h1' ).text();
$( 'h1' ).text( header + ' (it will take you ' + timeInMinutes + ' minutes to read this page)' );
Personal tools
Namespaces

Variants
Actions
Navigation
Toolbox