User:Gryllida/common.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
![]() | The accompanying .css page for this skin is at User:Gryllida/common.css. |
/*//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}));