Bahaipedia
Bahaipedia
Menu
About Bahaipedia
Ask a question
General help
Random page
Recent changes
In other projects
Tools
What links here
Related changes
User contributions
Logs
View user groups
Upload file
Special pages
Printable version
Permanent link
Page information
User page
Discussion
View source
View history
Talk
Contributions
Create account
Log in
Navigation
About Bahaipedia
Ask a question
General help
Random page
Recent changes
In other projects
Learn more
Core topics
Bahá’í Faith
Central Figures
Teachings
Practices
Tools
What links here
Related changes
User contributions
Logs
View user groups
Upload file
Special pages
Printable version
Permanent link
Page information
Translations

User:SuperGinza87/common.js

From Bahaipedia
< User:SuperGinza87
Jump to:navigation, search

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
// Change recent changes link

function ChangeRecentChangesLink( ) {
	try {
		var rcLinkNode = document.getElementById( 'n-recentchanges' )
						     .getElementsByTagName( 'a' )[0];
		rcLinkNode.setAttribute( 'href', 'https://bahaipedia.org/Special:RecentChanges?limit=500&days=30&enhanced=1&urlversion=2' );
		var rcFlexLinkNode = document.getElementsByClassName( 'sidebar-wrapper' )[0].getElementsByClassName( 'n-recentchanges' )[0];
		rcFlexLinkNode.setAttribute( 'href', 'https://bahaipedia.org/Special:RecentChanges?limit=500&days=30&enhanced=1&urlversion=2' );
		console.log('✔️ Recent changes modified')
	} catch(e) {
		// let's just ignore what's happened
		console.log(e)
		return;
	}
}

// Add dashboard link

function AddDashboardLink( ) {
	try {
		console.log('AddDashboardLink called')
						   
		var node_cham = document.getElementsByClassName( 'p-personal-tools' )[0];
		var node_cham_df = document.getElementsByClassName( 'p-personal-tools' )[0]
								.getElementsByTagName( 'div' )[0];

		var aNode2 = document.createElement( 'a' );
		var divNode = document.createElement( 'div' );

		aNode2.appendChild( document.createTextNode( 'Dashboard' ) );
		aNode2.setAttribute( 'href', 'https://bahaipedia.org/User:Dragfyre/Dashboard' );
		divNode.appendChild( aNode2 );
		divNode.className = 'mw-list-item';
		divNode = node_cham.insertBefore( divNode, node_cham_df );

		var node = document.getElementById( 'p-personal' )
						   .getElementsByTagName( 'ul' )[0];
		var prefnode = document.getElementById( 'pt-preferences' );

		var aNode = document.createElement( 'a' );
		var liNode = document.createElement( 'li' );

		aNode.appendChild( document.createTextNode( 'Dashboard' ) );
		aNode.setAttribute( 'href', 'https://bahaipedia.org/User:Dragfyre/Dashboard' );
		liNode.appendChild( aNode );
		liNode.className = 'plainlinks';
		liNode = node.insertBefore( liNode, prefnode );
		console.log('✔️ Dashboard link added')
	} catch(e) {
		// let's just ignore what's happened
		console.log(e)
		return;
	}
}

function CustomChanges() {
	// adds [[Special:CategoryTree|Special:CategoryTree]] to toolbox
	console.log('CustomChanges called')
	AddDashboardLink();
	ChangeRecentChangesLink();
}

jQuery.ready( CustomChanges() );
Retrieved from "https://bahaipedia.org/index.php?title=User:SuperGinza87/common.js&oldid=141633"
This page was last edited on 11 April 2025, at 22:10.
Text is available under the Creative Commons Attribution-NonCommercial-ShareAlike 3.0 License.
Privacy policy
About Bahaipedia
Disclaimers
Powered by MediaWiki