Nightsilver (talk | contribs) m (Nightsilver moved page MediaWiki:Wikia.js to MediaWiki:Common.js without leaving a redirect) |
No edit summary |
||
Line 69: | Line 69: | ||
} |
} |
||
+ | /* Standard edit summaries |
||
− | /*////////////////////////////////////////////////////////////////// |
||
+ | * jQuery version of Sikon's fillEditSummaries |
||
− | // THE BELOW CODE ADDS CUSTOM BUTTONS TO THE JAVASCRIPT EDIT TOOLBAR |
||
+ | * @author Grunny - taken from Wookieepedia */ |
||
− | //////////////////////////////////////////////////////////////////*/ |
||
+ | function fillEditSummaries() { |
||
− | |||
+ | if ( !$( '#wpSummaryLabel' ).length ) { |
||
− | if (mwCustomEditButtons) { |
||
+ | return; |
||
− | mwCustomEditButtons[mwCustomEditButtons.length] = { |
||
+ | } |
||
− | "imageFile": "https://images.wikia.nocookie.net/youngjustice/images/d/dc/Image_Button.png", |
||
+ | $.get( mw.config.get( 'wgScript' ), { title: 'Template:Stdsummaries', action: 'raw', ctype: 'text/plain' } ).done( function( data ) { |
||
− | "speedTip": "Insert filebox template", |
||
+ | var $summaryOptionsList, |
||
− | "tagOpen": "\{\{Filebox\r| description = ", |
||
+ | $summaryLabel = $( '#wpSummaryLabel' ), |
||
− | "tagClose": "\r| episode = \r| film = \r| show = \r| source = \r| origin = \r| license = screenshot\r\}\}", |
||
+ | lines = data.split( '\n' ), |
||
− | "sampleText": "" |
||
+ | $wrapper = $( '<div>').addClass( 'edit-widemode-hide' ).text( 'Standard summaries: ' ); |
||
− | }; |
||
+ | $summaryOptionsList = $( '<select />' ).attr( 'id', 'stdEditSummaries' ).change( function() { |
||
− | |||
+ | var editSummary = $( this ).val(); |
||
− | mwCustomEditButtons[mwCustomEditButtons.length] = { |
||
+ | if ( editSummary !== '' ) { |
||
− | "imageFile": "https://images.wikia.nocookie.net/youngjustice/images/1/1d/Copyrights_needed_Button.png", |
||
+ | $( '#wpSummary' ).val( editSummary ); |
||
− | "speedTip": "Uncredited image tag", |
||
+ | } |
||
− | "tagOpen": "\{\{subst:ukn|", |
||
⚫ | |||
− | "tagClose": "}}", |
||
− | + | for ( var i = 0; i < lines.length; i++ ) { |
|
+ | var editSummaryText = ( lines[i].indexOf( '-- ' ) === 0 ) ? lines[i].substring(3) : ''; |
||
− | }; |
||
+ | $summaryOptionsList.append( $( '<option>' ).val( editSummaryText ).text( lines[i] ) ); |
||
− | |||
+ | } |
||
− | mwCustomEditButtons[mwCustomEditButtons.length] = { |
||
+ | $summaryLabel.prepend( $wrapper.append( $summaryOptionsList ) ); |
||
− | "imageFile": "https://images.wikia.nocookie.net/youngjustice/images/c/ce/Ep_ref_Button.png", |
||
+ | } ); |
||
− | "speedTip": "Episode/issue reference tag", |
||
− | "tagOpen": "<ref name=\"\">{{ep ref|", |
||
− | "tagClose": "|number}}</ref>", |
||
− | "sampleText": "series" |
||
− | }; |
||
} |
} |
||
+ | $(fillEditSummaries); |
||
− | |||
− | /* Adds icons to page header bottom border |
||
− | * by: [[User:The 888th Avatar]], adapted to new header by [[User:Thailog]] |
||
− | */ |
||
− | |||
− | $(function() { |
||
− | if ($('.wds-community-header').length) { |
||
− | $('#PageHeader').prepend( |
||
− | $('#icons').attr('style', 'position: absolute; right: 0px;') |
||
− | ); |
||
− | } else { |
||
− | $('.WikiaPageHeader').append($('#icons')); |
||
− | $('#icons').css({ |
||
− | 'position': 'absolute', |
||
− | 'right': '0', |
||
− | 'bottom': '-2em' |
||
− | }).show(); |
||
− | } |
||
⚫ |
Revision as of 09:49, 5 June 2021
/* To replace the now dead "welcome bot" */
window.AutoCreateUserPagesConfig = {
content: {
2: '{{sub'+'st:New user}}',
3: false
},
summary: 'Script: Creating user profile'
};
$(function STemplateUI() {
$(".ogg_player .image").remove();
});
/* Auto-refreshing recent changes */
ajaxPages = ["Special:RecentChanges","Special:Watchlist","Special:Log","Special:Contributions"];
AjaxRCRefreshText = 'Auto-refresh';
AjaxRCRefreshHoverText = 'Automatically refresh the page';
importScriptPage('MediaWiki:AjaxRC/code.js', 'dev');
/* Admin highlights */
highlight = {
sysop: '#0148c2'
};
/** Archive edit tab disabling *************************************
* Disables the edit tab on old forum topic pages to stop new people bumping old topics.
* Page can still be edited by going via the edit tab on the history etc, or by
* typing the edit address manually.
* By [[User:Spang|Spang]]
* Monaco support by [[User:Uberfuzzy|Uberfuzzy]]
* Oasis support by [[User:Uberfuzzy|Uberfuzzy]]
*/
if (wgNamespaceNumber == 110) {
addOnloadHook(disableOldForumEdit);
}
function disableOldForumEdit() {
if (typeof(enableOldForumEdit) != 'undefined' && enableOldForumEdit) {
return;
}
if (!document.getElementById('old-forum-warning')) {
return;
}
if (skin == 'oasis') {
$('#WikiaPageHeader .wikia-menu-button a:first').html('Archived').removeAttr('href');
return;
}
if (!document.getElementById('ca-edit')) {
return;
}
var editLink = null;
if (skin == 'monobook') {
editLink = document.getElementById('ca-edit').firstChild;
} else {
return;
}
editLink.removeAttribute('href', 0);
editLink.removeAttribute('title', 0);
editLink.style.color = 'gray';
editLink.innerHTML = 'Archived';
$('span.editsection-upper').remove();
}
/* Standard edit summaries
* jQuery version of Sikon's fillEditSummaries
* @author Grunny - taken from Wookieepedia */
function fillEditSummaries() {
if ( !$( '#wpSummaryLabel' ).length ) {
return;
}
$.get( mw.config.get( 'wgScript' ), { title: 'Template:Stdsummaries', action: 'raw', ctype: 'text/plain' } ).done( function( data ) {
var $summaryOptionsList,
$summaryLabel = $( '#wpSummaryLabel' ),
lines = data.split( '\n' ),
$wrapper = $( '<div>').addClass( 'edit-widemode-hide' ).text( 'Standard summaries: ' );
$summaryOptionsList = $( '<select />' ).attr( 'id', 'stdEditSummaries' ).change( function() {
var editSummary = $( this ).val();
if ( editSummary !== '' ) {
$( '#wpSummary' ).val( editSummary );
}
} );
for ( var i = 0; i < lines.length; i++ ) {
var editSummaryText = ( lines[i].indexOf( '-- ' ) === 0 ) ? lines[i].substring(3) : '';
$summaryOptionsList.append( $( '<option>' ).val( editSummaryText ).text( lines[i] ) );
}
$summaryLabel.prepend( $wrapper.append( $summaryOptionsList ) );
} );
}
$(fillEditSummaries);