User:Jayprakash12345/SWT-Tasks

From mediawiki.org

Warm-up task[edit]

Write a UserScript to show which skin is using by the user after their username in the top navigation link. Like "Username (You are using skinname skin)"

Hints:-

  • Use jQuery ready wrapper so that code run only after web content is loaded.
  • Inspect the username to get an element ID.
  • Use .append() to add skin text at the end of the element.
  • Figure out which variable should use to get skin from https://www.mediawiki.org/wiki/Manual:Interface/JavaScript.

Task 1[edit]

Write a UserScript to make page title in red if the page is not editable by the user.

Hints:-

  • Use jQuery ready wrapper so that code runs only after web content is loaded.
  • Inspect the page title to get an element ID.
  • Use .css() to change the color of element.
  • Use wgIsProbablyEditable to check if the page is editable or not, it returns true or false. So use if statement. See https://www.w3schools.com/js/js_if_else.asp

Task 2[edit]

Write a UserScript to create a permanent link to the current pages's revision.

Hints:-