Ero sivun ”Järjestelmäviesti:Common.js” versioiden välillä

ApoWikistä
p (test)
(lisäpainikkeet wikieditoriin (lainaus, rp, etc.))
 
(7 välissä olevaa versiota 2 käyttäjän tekeminä ei näytetä)
Rivi 1: Rivi 1:
/* Any JavaScript here will be loaded for all users on every page load. */
var customizeToolbar = function() {
/** Extra toolbar options ******************************************************
$('#wpTextbox1').wikiEditor('addToToolbar', {
  *
section: 'advanced',
  *  Description: Includes a raw wiki page as javascript or CSS,  
group: 'format',
  *              used for including user made modules.
tools: {
  *  Imported from: http://en.wikipedia.org/w/index.php?title=MediaWiki:Common.js
"strikethrough": {
  *  This is a modified copy of a script by wikipedia User:MarkS for extra features added by User:Voice of All.
label: 'Strike',
  *  This is based on the original code on Wikipedia:Tools/Editing tools
type: 'button',
  *  To disable this script, add <code>mwCustomEditButtons = [];<code> to [[Special:Mypage/monobook.js]]
icon: '//upload.wikimedia.org/wikipedia/commons/3/30/Btn_toolbar_rayer.png',
  */
action: {
if (wgAction == "edit" || wgAction == "submit") { // skriptit muokkaussivuille
type: 'encapsulate',
    importScript("Järjestelmäviesti:Edittools.js")
options: {
}
pre: "<s>",
post: "</s>"
}
}
}
}
});


if (mwCustomEditButtons) {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'advanced',
group: 'format',
tools: {
"comment": {
label: 'Comment',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/3/37/Btn_toolbar_commentaire.png',
action: {
type: 'encapsulate',
options: {
pre: "<!-- ",
post: " -->"
}
}
}
}
} );


/*
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'advanced',
group: 'format',
tools: {
"math": {
label: 'Math',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/2/2e/Button_math.png',
action: {
type: 'encapsulate',
options: {
pre: "<math>",
post: "</math>"
}
}
}
}
} );


  mwCustomEditButtons[mwCustomEditButtons.length] = {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
    "imageFile": "http://www.appropedia.fi/images/c/c8/Button_redirect.png",
section: 'advanced',
    "speedTip": "Uudelleenohjaus",
group: 'format',
    "tagOpen": "#REDIRECT [[",
tools: {
    "tagClose": "]]",
"citation": {
    "sampleText": "Artikkeli, johon uudelleenohjataan"};
label: 'Insert block of quoted text',
type: 'button',
  mwCustomEditButtons[mwCustomEditButtons.length] = {
icon: '//upload.wikimedia.org/wikipedia/commons/f/fd/Button_blockquote.png',
    "imageFile": "http://www.appropedia.fi/images/c/c9/Button_strike.png",
action: {
    "speedTip": "Yliviivaus",
type: 'encapsulate',
    "tagOpen": "<s>",
options: {
    "tagClose": "</s>",
pre: "{\{lainaus\|",
    "sampleText": ""};
post: "\}\}"
}
  mwCustomEditButtons[mwCustomEditButtons.length] = {
}
    "imageFile": "http://www.appropedia.fi/images/1/13/Button_enter.png",
}
    "speedTip": "Rivinvaihto",
}
    "tagOpen": "<br />",
} );
    "tagClose": "",
    "sampleText": ""};
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://www.appropedia.fi/images/8/80/Button_upper_letter.png",
    "speedTip": "Yläindeksi",
    "tagOpen": "<sup>",
    "tagClose": "</sup>",
    "sampleText": ""};
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://www.appropedia.fi/images/7/70/Button_lower_letter.png",
    "speedTip": "Alaindeksi",
    "tagOpen": "<sub>",
    "tagClose": "</sub>",
    "sampleText": ""};
 
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://www.appropedia.fi/images/3/34/Button_hide_comment.png",
    "speedTip": "Lähdekoodiin piilotettu kommentti",
    "tagOpen": "<!-- ",
    "tagClose": " -->",
    "sampleText": ""};
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://www.appropedia.fi/images/1/12/Button_gallery.png",
    "speedTip": "Kuvagalleria",
    "tagOpen": "\n<gallery>\n",
    "tagClose": "\n</gallery>",
    "sampleText": "Image:Esimerkki1.jpg|Esimerkki1\nImage:Esimerkki2.jpg|Esimerkki2"};
  mwCustomEditButtons[mwCustomEditButtons.length] = {
    "imageFile": "http://www.appropedia.fi/images/f/fd/Button_blockquote.png",
    "speedTip": "Insert block of quoted text",
    "tagOpen": "\{\{sitaatti\|",
    "tagClose": "\}\}",
    "sampleText": "Lorem ipsum dolor sit amet."};


  mwCustomEditButtons[mwCustomEditButtons.length] = {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
    "imageFile": "http://www.appropedia.fi/images/6/60/Button_insert_table.png",
section: 'advanced',
    "speedTip": "Taulukko",
group: 'format',
    "tagOpen": '{| class="wikitable"\n|-\n',
tools: {
    "tagClose": "\n|}",
"refname": {
    "sampleText": "! header 1\n! header 2\n! header 3\n|-\n| row 1, cell 1\n| row 1, cell 2\n| row 1, cell 3\n|-\n| row 2, cell 1\n| row 2, cell 2\n| row 2, cell 3"};
label: 'Viittaus, johon viitataan useasti',
type: 'button',
icon: '//upload.wikimedia.org/wikipedia/commons/c/c4/Button_ref.png',
action: {
type: 'encapsulate',
options: {
pre: "<ref name=\"\"></ref>",
post: "<ref name=\"\" />"
}
}
}
}
} );


  mwCustomEditButtons[mwCustomEditButtons.length] = {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
    "imageFile": "http://www.appropedia.fi/images/c/c4/Button_ref.png",
section: 'advanced',
    "speedTip": "Viittaus, johon viitataan useasti",
group: 'format',
    "tagOpen": "<ref name=\"\"></ref>",
tools: {
    "tagClose": "<ref name=\"\" />",
"nviiva": {
    "sampleText": ""};
label: 'Lisää n-viivan (ajatusviiva)',
type: 'button',
icon: 'https://apowiki.fi/images/9/97/N-viiva.png',
action: {
type: 'encapsulate',
options: {
pre: "",
post: ""
}
}
}
}
} );


*/
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
section: 'advanced',
group: 'format',
tools: {
"rplinkitys": {
label: 'Lisää raamatunpaikkalinkin',
type: 'button',
icon: 'https://apowiki.fi/images/c/cf/Rp.png',
action: {
type: 'encapsulate',
options: {
pre: "\{\{rp\|",
post: "\}\}"
}
}
}
}
} );


  mwCustomEditButtons[mwCustomEditButtons.length] = {
};
    "imageFile": "http://www.apologetiikkawiki.fi/wiki/images/a/a3/Ref-tägi.png",
    "speedTip": "Yksittäinen viittaus",
/* Check if view is in edit mode and that the required modules are available. Then, customize the toolbar . . . */
    "tagOpen": "<ref>",
if ( $.inArray( mw.config.get( 'wgAction' ), [ 'edit', 'submit' ] ) !== -1 ) {
    "tagClose": "</ref>",
mw.loader.using( 'user.options', function () {
    "sampleText": ""};
// This can be the string "0" if the user disabled the preference ([[bugzilla:52542#c3]])
 
if ( mw.user.options.get( 'usebetatoolbar' ) == 1 && mw.user.options.get( 'showtoolbar' ) == 1 ) {
  mwCustomEditButtons[mwCustomEditButtons.length] = {
$.when(
    "imageFile": "http://www.apologetiikkawiki.fi/wiki/images/9/97/N-viiva.png",
mw.loader.using( 'ext.wikiEditor.toolbar' ),
    "speedTip": "Lisää n-viivan",
$.ready
    "tagOpen": "–",
).then( customizeToolbar );
    "tagClose": "",
}
    "sampleText": ""};
} );
 
}
  mwCustomEditButtons[mwCustomEditButtons.length] = {
// Add the customizations to LiquidThreads' edit toolbar, if available
    "imageFile": "http://www.apologetiikkawiki.fi/wiki/images/c/cf/Rp.png",
mw.hook( 'ext.lqt.textareaCreated' ).add( customizeToolbar );
    "speedTip": "Lisää raamatunpaikkalinkin",
    "tagOpen": "\{\{rp\|",
    "tagClose": "\}\}",
    "sampleText": "1. Moos. 1:1"};
}

Nykyinen versio 9. kesäkuuta 2017 kello 13.29

var customizeToolbar = function() {
$('#wpTextbox1').wikiEditor('addToToolbar', {
	section: 'advanced',
	group: 'format',
	tools: {
		"strikethrough": {
			label: 'Strike',
			type: 'button',
			icon: '//upload.wikimedia.org/wikipedia/commons/3/30/Btn_toolbar_rayer.png',
			action: {
				type: 'encapsulate',
				options: {
					pre: "<s>",
					post: "</s>"
				}
			}
		}
	}
});

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
	section: 'advanced',
	group: 'format',
	tools: {
		"comment": {
			label: 'Comment',
			type: 'button',
			icon: '//upload.wikimedia.org/wikipedia/commons/3/37/Btn_toolbar_commentaire.png',
			action: {
				type: 'encapsulate',
				options: {
					pre: "<!-- ",
					post: " -->"
				}
			}
		}
	}
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
	section: 'advanced',
	group: 'format',
	tools: {
		"math": {
			label: 'Math',
			type: 'button',
			icon: '//upload.wikimedia.org/wikipedia/commons/2/2e/Button_math.png',
			action: {
				type: 'encapsulate',
				options: {
					pre: "<math>",
					post: "</math>"
				}
			}
		}
	}
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
	section: 'advanced',
	group: 'format',
	tools: {
		"citation": {
			label: 'Insert block of quoted text',
			type: 'button',
			icon: '//upload.wikimedia.org/wikipedia/commons/f/fd/Button_blockquote.png',
			action: {
				type: 'encapsulate',
				options: {
					pre: "{\{lainaus\|",
					post: "\}\}"
				}
			}
		}
	}
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
	section: 'advanced',
	group: 'format',
	tools: {
		"refname": {
			label: 'Viittaus, johon viitataan useasti',
			type: 'button',
			icon: '//upload.wikimedia.org/wikipedia/commons/c/c4/Button_ref.png',
			action: {
				type: 'encapsulate',
				options: {
					pre: "<ref name=\"\"></ref>",
					post: "<ref name=\"\" />"
				}
			}
		}
	}
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
	section: 'advanced',
	group: 'format',
	tools: {
		"nviiva": {
			label: 'Lisää n-viivan (ajatusviiva)',
			type: 'button',
			icon: 'https://apowiki.fi/images/9/97/N-viiva.png',
			action: {
				type: 'encapsulate',
				options: {
					pre: "–",
					post: ""
				}
			}
		}
	}
} );

$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
	section: 'advanced',
	group: 'format',
	tools: {
		"rplinkitys": {
			label: 'Lisää raamatunpaikkalinkin',
			type: 'button',
			icon: 'https://apowiki.fi/images/c/cf/Rp.png',
			action: {
				type: 'encapsulate',
				options: {
					pre: "\{\{rp\|",
					post: "\}\}"
				}
			}
		}
	}
} );

};
 
/* 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 () {
		// This can be the string "0" if the user disabled the preference ([[bugzilla:52542#c3]])
		if ( mw.user.options.get( 'usebetatoolbar' ) == 1 && mw.user.options.get( 'showtoolbar' ) == 1 ) {
			$.when(
				mw.loader.using( 'ext.wikiEditor.toolbar' ),
				$.ready
			).then( customizeToolbar );
		}
	} );
}
// Add the customizations to LiquidThreads' edit toolbar, if available
mw.hook( 'ext.lqt.textareaCreated' ).add( customizeToolbar );