Utente:Jalo/monobook.js/test: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica
Nessun oggetto della modifica
Riga 3 060:
}
 
function init(a) {
var u = mw.usability;
$j(this)a.find( '[rel]' ).each( function() {
$j(this)a.text( u.getMsg( $j(this)a.attr( 'rel' ) ) );
});
// Set tabindexes on form fields
$j.wikiEditor.modules.dialogs.fn.setTabindexes( $j(this)a.find( 'input' ).not( '[tabindex]' ) );
// TODO: Find a cleaner way to share this function
$j(this).data( 'Ficus', function() {
var argomento = $j( '#wikieditor-toolbar-argomento' ).val();
var motivo = $j( '#wikieditor-toolbar-motivazione' ).val();
var $textarea = $j(this).data( 'context' ).$textarea;
var text = $textarea.textSelection( 'getContents' );
text = "{{A|"+motivo+"|"+argomento+"|{{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}|firma=~~~~}}\n"+text;
$textarea.val( text );
})
}
 
function open(a) {
$j(this)a.data( 'offset', 0 );
if ( !( $j(this)a.data( 'onetimeonlystuff' ) ) ) {
$j(this)a.data( 'onetimeonlystuff', true );
// Execute the action associated with the first button
// when the user presses Enter
$j(this)a.closest( '.ui-dialog' ).keypress( function( e ) {
if ( ( e.keyCode || e.which ) == 13 ) {
var button = $j(this)a.data( 'dialogaction' ) || $j(this)a.find( 'button:first' );
button.click();
e.preventDefault();
Riga 3 094 ⟶ 3 084:
// Make tabbing to a button and pressing
// Enter do what people expect
$j(this)a.closest( '.ui-dialog' ).find( 'button' ).focus( function() {
$j(this)a.closest( '.ui-dialog' ).data( 'dialogaction', thisa );
});
}
var dialog = $j(this)a.closest( '.ui-dialog' );
var that = thisa;
var context = $j(this)a.data( 'context' );
var textbox = typeof context.$iframe != 'undefined' ?
context.$iframe[0].contentWindow.document : context.$textarea;
Riga 3 118 ⟶ 3 108:
}
 
function close(a) {
var context = $j(this)a.data( 'context' );
var textbox = typeof context.$iframe != 'undefined' ?
context.$iframe[0].contentWindow.document : context.$textarea;
$j( textbox ).unbind( 'keypress.srdialog' );
$j(this)a.closest( '.ui-dialog' ).data( 'dialogaction', false );
}
 
Riga 4 110 ⟶ 4 100:
</fieldset>',
init: function() {
init($j(this));
$j(this).data( 'Ficus', function() {
var argomento = $j( '#wikieditor-toolbar-argomento' ).val();
Riga 4 134 ⟶ 4 124:
},
open: function() {
open($j(this));
},
close: function() {
close($j(this));
}
}