MediaWiki:Gadget-LiveRC 1x.js/InserisciTemplate.js: differenze tra le versioni
Contenuto cancellato Contenuto aggiunto
-intoken deprecato |
Semplificazioni varie |
||
Riga 625:
// ####################################################################################################################
/**
*/
function lrcRunInsertTemplate( data ) {
var TagSelect = document.getElementById( 'LiveTagReason' )
▲ var TemplateList = Custom_lstMyTemplate;
if ( !Object.keys( TemplateList ).length ) {
TemplateList = lstMyTemplate;
Riga 654:
LiveRC_AddHook( "AfterPreviewArticle", lrcRunInsertTemplate );
/**
*/
getLiveTagFunctions.InserisciTemplateExtension = function( page, option ) {
lrcDisableLink( "LiveTagReason" );
Riga 665 ⟶ 666:
}
var message = TemplateList[ option.value ];
new mw.Api().get( {
format: 'json',
Riga 682:
function InserisciTemplate_PostTagPage( res, page, message ) {
var resPage = Object.values( res.query.pages )[0];
for ( var prEntry in resPage.protection ) {
if ( prEntry.type == "edit" && mw.config.get( 'wgUserGroups' ).indexOf( prEntry.level ) == -1 ) {
LiveRC_alert( "<b>" + lrcMakeText( "PROTECTEDPAGE" ).split( "$1" ).join( page ) + "</b>" );▼
}
}
▲ LiveRC_alert( "<b>" + lrcMakeText( "PROTECTEDPAGE" ).split( "$1" ).join( page ) + "</b>" );
▲ var tpl = InserisciTemplate_showDialog( message, page );
}
/**
*/
function InserisciTemplate_showDialog( data, page ) {
var $dialog, $fieldset;
Riga 705 ⟶ 699:
$dialog = $( '#gtb-dialog' ).html( lrcMakeText( "IT_InsertTemplate1" ) );
$( '<a>' )
.attr( 'href', mw.
.attr( 'target', '_blank' )
.attr( 'tabindex', '-1' )
Riga 777 ⟶ 771:
}
/**
*/
function InserisciTemplate_dumpTemplate( template, params ) {
var templateParams = LiveRC_FormatTemplateParams( params || {} );
Riga 799 ⟶ 794:
}
/**
*/
function InserisciTemplate_postTemplate( data, text, page ) {
lrcDisableLink( "LiveTagReason" );
Riga 813 ⟶ 809:
};
if ( data.where == 'bottom' ) {
} else { // top or default = top
}
Riga 828 ⟶ 821:
new mw.Api().postWithEditToken( EditParam )
.done( function () {
LiveRC_alert( "<b>" + page + " : " + lrcMakeText( "TAG_DONE" ) + "</b> <small>(" +
} );
}
Riga 835 ⟶ 828:
/**
*/
function InserisciTemplate_CreateConfigPanel() {
var InserisciTemplateUl = LiveRC_ManageParams_CreateNewListMenu( "InserisciTemplateLegend", LiveRC_ManageParams_CreateActionButtons() );
Riga 900 ⟶ 894:
return;
}
}
Riga 911 ⟶ 905:
Title.innerHTML = "{{" + Template.template + "}} ";
Title.target = "_blank";
Title.href =
Title.title =
Title.onclick = function() {
liveArticle(
return false;
};
Riga 1 109 ⟶ 1 103:
}
Select_type.onchange = function() {
};
LI_Param.appendChild( Select_type );
Riga 1 162 ⟶ 1 156:
}
function
var NewType = Select.value;
var Li = Select.parentNode;
Riga 1 286 ⟶ 1 280:
}
/**
*/
function InserisciTemplate_CheckConfigPanel() {
var ITConfigPanel = document.getElementById( 'LiveRC_OptionsContent_InserisciTemplateLegend' );
Riga 1 422 ⟶ 1 417:
}
/
lrcTexts.IT_InsertTemplate1 = "Inserisce il template {{";
Riga 1 436 ⟶ 1 429:
lrcTexts.IT_AddOption = "Aggiungi una nuova opzione";
lrcParamDesc.DescIT_InsertTemplate1 = "[InserisciTemplate] Inserisci la parte 1 della frase del template";
lrcParamDesc.DescIT_InsertTemplate2 = "[InserisciTemplate] Inserisci la parte 2 della frase del template";
Riga 1 453 ⟶ 1 444:
// Hide/Show tabs panel item
addParamMenuTab( "InserisciTemplateLegend", true );
|