Jump to content

User:Gryllida/common.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Gryllida (talk | contribs) at 13:07, 8 April 2025 (add button). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
/*//importScript( 'User:Equazcion/ScriptInstaller.js' ); // Backlink: [[User:Equazcion/ScriptInstaller.js]]
//importScript( 'User:Gryllida/js/ajaxSectionUpdateOnDoubleClick.js' ); // Backlink: [[User:Gryllida/js/ajaxSectionUpdateOnDoubleClick.js]] 
//importScript( 'User:Gryllida/js/truncateEditSummaryWithClickableEllipsisv2.js' ); // Backlink: [[User:Gryllida/js/truncateEditSummaryWithClickableEllipsisv2.js]] 
//importScript( 'User:APerson/req-helper.js' ); // Backlink: [[User:APerson/req-helper.js]]


//importScript( 'User:Gryllida/gadgets/rater.js' ); // Backlink: [[User:Gryllida/gadgets/rater.js]]

if(mw.config.get('wgNamespaceNumber')==118){
	var href='http://en.wikipedia.org/wiki/'+mw.config.get('wgPageName')+'?action=edit&editintro=User:Gryllida/draft-review/editintro';
	$('#ca-edit a').attr('href', href);
}


importScript( 'User:Equazcion/ScriptInstaller.js' ); // Backlink: [[User:Equazcion/ScriptInstaller.js]]
importScript('User:MusikAnimal/customWatchlists.js'); //Linkback: [[User:MusikAnimal/customWatchlists.js]] Added by Script installer
importScript('User:Equazcion/ReverseMarked.js'); //Linkback: [[User:Equazcion/ReverseMarked.js]] Added by Script installer
//importScript( 'User:Gryllida/js/draft-rater.js' ); //Linkback: [[User:Gryllida/js/draft-rater.js]] Added by Script installer

*/

// Check if we're editing a page.
if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) {
	// Add a hook handler.
	mw.hook( 'wikiEditor.toolbarReady' ).add( function ( $textarea ) {
		// Configure a new toolbar entry on the given $textarea jQuery object.
	
$textarea.wikiEditor( 'addToToolbar', {
		section: 'secondary',
		group: 'default',
		tools: {
			dothing: {
				type: 'element',
				element: function ( context ) {
					// Note that the `context` object contains various useful references.
					console.log( context );
					var button = new OO.ui.ButtonInputWidget( {
						label: 'Do a thing',
						icon: 'hieroglyph'
					} );
					button.connect( null, {
						click: function ( e ) {
							// Do whatever is required when the button is clicked.
							console.log( e );
							OO.ui.alert( 'A thing is done.' );
						}
					} );
					return button.$element;
				}
			}
		}
	} );


	} );
}



importScript('User:Enterprisey/draft-sorter.js'); //Linkback: [[User:Enterprisey/draft-sorter.js]] Added by Script installer
importScript('User:Evad37/rater.js'); // [[User:Evad37/rater]]
importScript('User:Gryllida/WikiEditorEmoticons.js'); //Linkback: [[User:Gryllida/WikiEditorEmoticons.js]] Added by Script installer
importScript('User:Gryllida/js/addInstantSaveToCodeEditor.js' ); // Backlink: [[User:Gryllida/js/addInstantSaveToCodeEditor.js]] 
importScript('User:Gryllida/js/draft-rater.js' ); //Linkback: [[User:Gryllida/js/draft-rater.js]] Added by Script installer
importScript('User:Gryllida/js/draft-review.js' ); // Backlink: [[User:Gryllida/js/draft-review.js]]

// Refill
mw.loader.load( "https://meta.wikimedia.org/w/index.php?title=User:Zhaofeng_Li/Reflinks.js&action=raw&ctype=text/javascript" );

var topStyle = 'width: 30px; height: 30px; opacity: 0.5; border-radius: 30px;';
topStyle = topStyle + 'background-color: #dddddd; position: fixed; bottom: 5px; right: 5px;';
topStyle = topStyle + 'margin:10px; align: center; padding:15px;font-size:15pt;';
topStyle = topStyle + 'cursor:pointer; color:black;';
topStyle = topStyle + 'background-image: url("/media/wikipedia/commons/thumb/9/9c/Black_Arrow_Up.svg/24px-Black_Arrow_Up.svg.png");';
topStyle = topStyle + 'background-repeat: no-repeat;';
topStyle = topStyle + 'background-position: center;';
$('body').append($('<a></a>', {href: '#top', style: topStyle}));