Extension:Jade/Secondary integrations

Jade has a main page that can be accessed here "Jade:Diff/123456" where "123456" is an edit id.

However, Jade can also be accessed on native MediaWiki pages ( i.e Secondary Integration Pages ) like Special:Recentchanges, Special:Diff, Undo and Rollback pages as explained below;

Special:Recentchanges
Jade data can be used to filter results in Special:Recentchanges. This is achieved through the use of Link Tables that are updated via hooks:


 * DatabaseSchemaHooks
 * LoadExtensionSchemaUpdates
 * Fired when MediaWiki is updated to allow Jade extension to update the database. We add a link table to the db and set a couple of indexes on each table.
 * Tables: jade_diff_label, jade_revision_label
 * LinkTableHooks
 * PageContentInsertComplete
 * Occurs after a new article is created. Updates link tables after a new entity page is inserted.
 * ArticleDeleteComplete
 * Removes link when an entity page is deleted.
 * ArticleUndelete
 * Restores link when an entity page is undeleted.
 * LinkSummaryHooks
 * PageContentSaveComplete
 * Occurs after the save page request has been processed. This mostly updates the ‘summary’ data in the link tables.
 * Summary data is the “preferred” proposal data

Recent Changes Filters
The Jade filters seen in the image on the right were integrated using ChangesListSpecialPageStructuredFiltersHooks.

These Jade RCfilters can be accessed on the Special:Recentchanges, Special:Watchlist and Related Changes pages.

When selected the Jade RCfilters do the following;
 * 1) Productive/Good-faith: Shows edits that are productive and were published with good intentions. This is achieved by returning edits that exist in both the recentchanges table and the jade_diff_label table that have jadedl_damaging=0 and jadedl_goodfaith=1 in the jade_diff_label table.
 * 2) Damaging/Good-faith: Shows edits  that are unproductive but it appears as though they were published with good intentions. This is achieved by returning edits that exist in both the recentchanges table and the jade_diff_label table that have jadedl_damaging=1 and jadedl_goodfaith=1 in the jade_diff_label table.
 * 3) Damaging/Bad-faith: Shows edits that are vandalism. They are unproductive and appear to have been published with bad intentions. This is achieved by returning edits that exist in both the recentchanges table and the jade_diff_label table that have jadedl_damaging=1 and jadedl_goodfaith=0 in the jade_diff_label table.
 * 4) Un-labeled: Shows edits that don't have a Jade label. This is achieved by returning edits that exist in the recentchanges table but not the jade_diff_label table.

Special:Diff
Jade elements are integrated before showing the article content below a diff on the MediaWiki Special:Diff page using ArticleContentOnDiffHooks.

Undo Page
Jade elements are integrated before showing the article edit form below a diff on the MediaWiki undo page ( i.e action=edit&undo ) using EditPageGetDiffContentHooks.

Rollback Page
Jade elements are integrated above the diff on the MediaWiki rollback page ( i.e action=rollback ) using RollbackCompleteHooks.