User:Assassas77/common.js

From Wikisource
Jump to navigation Jump to search
Note: After saving, changes may not occur immediately. Click here to learn how to bypass your browser's cache.
  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (Cmd-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (Cmd-Shift-R on a Mac)
  • Internet Explorer: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Clear the cache in Tools → Preferences

For details and instructions about other browsers, see Wikipedia:Bypass your cache.

// <syntaxhighlight lang="javascript">
var customizeToolbar = function () {
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
	'sections': {
		'chaozhou': {
			'type': 'booklet',
			'label': 'Swatow'
		},
		'synopt': {
			'type': 'booklet',
			'label': 'Synoptical'
		},
		'artofwar': {
			'type': 'booklet',
			'label': 'Art Of War'
		},
		'ainu': {
			'type': 'booklet',
			'label': 'Ainu'
		},
		'manchu': {
			'type': 'booklet',
			'label': 'Manchu'
		},
		'sikh': {
			'type': 'booklet',
			'label': 'Sikh'
		}
	}
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
	'section': 'chaozhou',
	'pages': {
		'emoticons': {
			'layout': 'characters',
			'label': 'Characters',
			'characters': ['⿰','⿱','⿲','⿳','⿴','⿵','⿶','⿷','⿸','⿹','⿺','⿻','{{suspect|}}','{{SIC|}}','{{sinogram|}}',
			'<section end="" />\n<section begin="" />\n=== * ===','<noinclude>{{multicol-break}}</noinclude>','<br/>','\n* {{swatow entry|}}\n*',
			'{{swatow gap}}','́', '̀', '̂', '̆', '̄', 'ⁿ','̤','{{hi|}}','̃','̚','ʰ','̌','͘','̍','̩']
		},
	},
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
	'section': 'synopt',
	'pages': {
		'emoticons': {
			'layout': 'characters',
			'label': 'Header and footer',
			'characters': ['{|{{ts|ma}}','|-\n|}','{{c|{{sm|Continued—}}}}\n{|{{ts|ma}}','|-\n|}\n{{right|{{sm|[Continued—}}}}']
		},
		'emoticons2': {
			'layout': 'characters',
			'label': 'Layout',
			'characters': ['{{nop}}\n','|-\n|{{Synopt entry|1|一}} {{WG|a|0}}\n','|-\n|colspan="2"|{{rule|7em}}\n','|\n|-\n|\n','<includeonly>|-\n|colspan="2"|{{rule|7em}}</includeonly>\n{{nop}}']
		},
		'emoticons3': {
			'layout': 'characters',
			'label': 'Entry',
			'characters': ['ĭ', 'ŭ', 'ê', 'ü','{{Synopt character|一}} {{WG|a|0}}','{{Synopt see|0}}','{{Synopt character|','{{WG|','}}',]
		},
	},
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
	'section': 'artofwar',
	'pages': {
		'emoticons': {
			'layout': 'characters',
			'label': 'Main text',
			'characters': ['{{art-of-war translation table|}}<br/>\n','{{RunningHeader|center=}}','## chinese ##\n<nowiki/>\n#<li value="">{{art-of-war chinese|}}</li>\n','#{{art-of-war chinese|}}\n','\n## translation ##\n','\n## previous ##\n','{{art-of-war chinese small|}}','{{fine|}}','“','”']
		},
		'emoticons2': {
			'layout': 'characters',
			'label': 'Proofreading',
			'characters': ['’','‘','ĭ', 'ŭ', 'ê', 'ü','“','”','—','—','—','{{rh||}}','{{rule}}\n{{smallrefs}}','{{art-of-war chinese|}}','{{font-size-x/s|89%}}','{{font-size-x/e}}','<ref></ref>']
		}
	},
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
	'section': 'ainu',
	'pages': {
		'emoticons': {
			'layout': 'characters',
			'label': 'Proofreading',
			'characters': ['{{multicol|line=1px solid black}}','<noinclude>{{multicol-break}}</noinclude>','{{multicol-end}}','<includeonly>}}</includeonly>','{{rh||— 4 —}}',
			'{{custom rule|sp|20|d|4|do|7|d|4|sp|20}}','{{rule|5em}}','{{rule}}\n<references/>']
		},
		'emoticons2': {
			'layout': 'characters',
			'label': 'Transclude & Proofreading',
			'characters': ['<pages index="An Ainu-English-Japanese dictionary (including a grammar of the Ainu language).djvu" from=19 to=20/>','{{rule}}\n<references/>']
		}
	},
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
	'section': 'manchu',
	'pages': {
		'emoticons': {
			'layout': 'characters',
			'label': 'Proofreading',
			'characters': ['—','š','ž','ʽ','{{rule}}','{{larger|{{c|I. PHONOLOGY.}}}}\n\n','{{Ordered list |list_style_type=lower-alpha','|','}}']
		}
	},
} );
$( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
	'section': 'sikh',
	'pages': {
		'emoticons': {
			'layout': 'characters',
			'label': 'Proofreading',
			'characters': ['{{fine block/s}}','‘','’',"''",'’','-','—','<ref></ref>','{{rule|5em}}','{{c|{{sc|Chapter}} II}}',
			'Ā','ā','Ē','ē','Ī','ī','Ō','ō','Ū','ū','<br/>','{{fine block/e}}','{{smallrefs}}']
		}
	},
} );
};


/* 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' ).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 );
		}
	} );
}
// </syntaxhighlight>?
mw.loader.load('//wikisource.org/w/index.php?title=MediaWiki:GoogleOCR.js&action=raw&ctype=text/javascript');
mw.loader.load('//wikisource.org/w/index.php?title=User:Putnik/TesseractOCR.js&action=raw&ctype=text/javascript');
mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript');