MediaWiki:Editor.js

De la Wikivoyage

Notă: După publicare, trebuie să treceți peste memoria cache a navigatorului pentru a putea vedea modificările:

  • Firefox / Safari: Țineți apăsat pe Shift în timp ce faceți clic pe Reîncărcare ori apăsați Ctrl-F5 sau Ctrl-R (⌘-R pe un sistem Mac);
  • Google Chrome: Apăsați Ctrl-Shift-R (⌘-Shift-R pe un sistem Mac);
  • Internet Explorer / Edge: Țineți apăsat pe Ctrl în timp ce faceți clic pe Reîmprosptare sau apăsați Ctrl-F5;
  • Opera: Apăsați Ctrl-F5.
// Add listing buttons in edit toolbar
var customizeToolbar = function() {
$( function() {
             if ( typeof $.fn.wikiEditor != 'undefined' ) {
                   $( '#wpTextbox1' ).wikiEditor( 'removeFromToolbar', {
                          'section': 'main',
                          'group': 'insert',
                          'tool': 'reference'
                   });
             }
        });
 
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        'section': 'main',
        'groups': {
                'listings': {
                        'label': 'Locații' // or use labelMsg for a localized label, see above
                }
        }
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        'section': 'main',
        'group': 'listings',
        'tools': {
                'Listings': {
                        label: 'Locuri de vizitat', // or use labelMsg for a localized label, see above
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/b/b7/Italian_traffic_signs_-_icona_museo.svg',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: '* {{de vizitat\n| nume=',
                                        post: ' | alt= | url= | email=\n| adresă= | lat= | long= | indicații=\n| telefon= | mobil= | telgratis= | fax=\n| orar= | preț=\n| conținut=\n}}' // text to be inserted
                                }
                        }
                }
        }
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        'section': 'main',
        'group': 'listings',
        'tools': {
                'Listings': {
                        label: 'Lucruri de făcut', // or use labelMsg for a localized label, see above
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/3/30/Pictograms-nps-bicycle_trail-2.svg',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: '* {{de făcut\n| nume=',
                                        post: ' | alt= | url= | email=\n| adresă= | lat= | long= | indicații=\n| telefon= | mobil= | telgratis= | fax=\n| orar= | preț=\n| conținut=\n}}' // text to be inserted
                                }
                        }
                }
        }
} );
/*$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        'section': 'main',
        'group': 'listings',
        'tools': {
                'Listings': {
                        label: 'Buy listing', // or use labelMsg for a localized label, see above
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/a/a1/Italian_traffic_signs_-_icona_supermercato.svg',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: '* {{buy\n| nume=',
                                        post: ' | alt= | url= | email=\n| adresă= | lat= | long= | indicații=\n| telefon= | mobil= | telgratis= | fax=\n| orar= | preț=\n| conținut=\n}}' // text to be inserted
                                }
                        }
                }
        }
} );*/
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        'section': 'main',
        'group': 'listings',
        'tools': {
                'Listings': {
                        label: 'Locație unde se mănâncă', // or use labelMsg for a localized label, see above
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/2/2c/Italian_traffic_signs_-_icona_ristorante.svg',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: '* {{restaurant\n| nume=',
                                        post: ' | alt= | url= | email=\n| adresă= | lat= | long= | indicații=\n| telefon= | mobil= | telgratis= | fax=\n| orar= | preț=\n| conținut=\n}}' // text to be inserted
                                }
                        }
                }
        }
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        'section': 'main',
        'group': 'listings',
        'tools': {
                'Listings': {
                        label: 'Locație unde se bea', // or use labelMsg for a localized label, see above
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/a/a5/Verre_cocktail.svg',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: '* {{bar\n| nume=',
                                        post: ' | alt= | url= | email=\n| adresă= | lat= | long= | indicații=\n| telefon= | mobil= | telgratis= | fax=\n| orar= | preț=\n| conținut=\n}}' // text to be inserted
                                }
                        }
                }
        }
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        'section': 'main',
        'group': 'listings',
        'tools': {
                'Listings': {
                        label: 'Cazare', // or use labelMsg for a localized label, see above
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/2/25/Pictograms-nps-lodging.svg',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: '* {{cazare\n| nume=',
                                        post: ' | alt= | url= | email=\n| adresă= | lat= | long= | indicații=\n| telefon= | mobil= | telgratis= | fax=\n| preț= | checkin= | checkout=\n| conținut=\n}}' // text to be inserted
                                }
                        }
                }
        }
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
        'section': 'main',
        'group': 'listings',
        'tools': {
                'Listings': {
                        label: 'Alte locații', // or use labelMsg for a localized label, see above
                        type: 'button',
                        icon: '//upload.wikimedia.org/wikipedia/commons/7/7e/Italian_traffic_signs_-_icona_informazioni.svg',
                        action: {
                                type: 'encapsulate',
                                options: {
                                        pre: '* {{intrare\n| nume=',
                                        post: ' | alt= | url= | email=\n| adresă= | lat= | long= | indicații=\n| telefon= | mobil= | telgratis= | fax=\n| orar= | preț=\n| conținut=\n}}' // text to be inserted
                                }
                        }
                }
        }
} );
};
 
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar . . . */
if ( $.inArray( mw.config.get( 'wgAction' ), ['edit', 'submit'] ) !== -1 ) {
        mw.loader.using( 'user.options', function () {
                if ( mw.user.options.get('usebetatoolbar') ) {
                        mw.loader.using( 'ext.wikiEditor', function () {
                                $(document).ready( customizeToolbar );
                        } );
                }
        } );
}
 
/* Hide normal page title and move location of geo map symbol when a page has a pagebanner */
$(".topbanner").closest(".mw-body").children(".firstHeading").hide();
$(".topbanner").closest("#mw-content-text").children("#geoCoord").css({top:0});