Bruger:HP/common.js

Spring til navigation Spring til søgning

Bemærk: Efter at have gemt er du måske nødt til at tømme din browsers cache for at kunne se ændringerne.

  • Firefox / Safari: Hold Shift nede og klik på Reload, eller tryk enten Ctrl-F5 eller Ctrl-R (⌘-R på en Mac).
  • Google Chrome: Tryk Ctrl-Shift-R (⌘-Shift-R på en Mac).
  • Internet Explorer / Edge: Hold Ctrl nede og klik på Refresh, eller tryk på Ctrl-F5.
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files
/* Se også [[MediaWiki:Common.js]] */
/* aktiveres i Localsettings.php med $wgAllowUserJs  = true; */

var customizeToolbar = function () {

$(function() {
    $( '#wpTextbox1' ).on( 'wikiEditor-toolbar-buildSection-characters', function (event, section) {
        section.pages.symbols.characters.push('\u02be', '\u02bf');
    });
});


$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
	'section': 'characters',
	'pages': {
		'nyttig': {
			'layout': 'characters',
			'label': 'Symbolsk',
			'characters': [ '„“', '»«', '«»', '№', '⅓', '⅔', '¼', '¾', '⅛', '⅜', '⅝', '⅞', '’‘', '”', 'm²', 'm³', '°', '²', '³', '‰', '–', '—', '…', '≈', '×', '·', '•', '□', '☹', '†', '✝', '✠' ]
		}
	}
} );


};

/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar … */
if ( [ 'edit', 'submit' ].indexOf( mw.config.get( 'wgAction' ) ) !== -1 ) {
	mw.loader.using( 'user.options' ).then( function () {
		// This can be the string "0" if the user disabled the preference ([[phab:T54542#555387]])
		if ( mw.user.options.get( 'usebetatoolbar' ) == 1 ) {
			$.when(
				mw.loader.using( 'ext.wikiEditor' ), $.ready
			).then( customizeToolbar );
		}
	} );
}