Page MenuHomePhabricator

Stop using onclick attributes and globally scoped functions
Open, LowPublic

Description

This be yuck
https://github.com/wikimedia/mediawiki-extensions-Translate/search?utf8=✓&q=onclick

onclick html attributes depend on globally scoped javascript functions, which we try to avoid using. Instead, we should be using JS resource loader modules, that find the right elements from the page ready and attach eventlisteners to those elements

Event Timeline

TheDJ created this task.Feb 25 2016, 10:31 PM
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptFeb 25 2016, 10:31 PM
Danny_B moved this task from Unsorted to Needs removal on the Technical-Debt board.
Nikerabbit triaged this task as Low priority.Apr 13 2016, 6:58 AM
Nikerabbit added a subscriber: Nikerabbit.

Most of these are in the deprecated TUX ui.

Restricted Application added a subscriber: TerraCodes. · View Herald TranscriptApr 20 2016, 11:58 AM

Hello, The bug represents to remove the onclick attributes?

@Dheerajmalisetty: The task summary says "Stop using onclick attributes". Hence I am not sure what exactly is unclear and made you ask. :)

@Aklapper : Do I need to comment the onclick attribute.

@Dheerajmalisetty: Why don't you just try it, make your changes locally, test if your changes fix this task, and then propose a patch in Gerrit?
Please see the first bullet point here: https://www.mediawiki.org/wiki/How_to_become_a_MediaWiki_hacker#Feedback,_questions_and_support

TheDJ updated the task description. (Show Details)Jan 21 2018, 4:29 PM
TheDJ added a comment.Jan 21 2018, 5:18 PM

@Dheerajmalisetty i slightly expanded the description of the ticket to further clarify what needs to be done.