|
|
1行目: |
1行目: |
− | // Check that the toolbar is available
| |
− | if ( typeof $ != 'undefined' && typeof $.fn.wikiEditor != 'undefined' ) {
| |
− | // Execute on load
| |
− | $( function() {
| |
− | $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
| |
− | section: 'advanced',
| |
− | group: 'format',
| |
− | tools: {
| |
− | buttonId: {
| |
− | label: 'source code',
| |
− | type: 'button',
| |
− | icon: '//mcmodding.jp/modding/extensions/WikiEditor/modules/images/toolbar/code-java.png',
| |
− | action: {
| |
− | type: 'encapsulate',
| |
− | options: {
| |
− | pre: '<source lang="java">',
| |
− | peri: 'Insert code here',
| |
− | post: '</source>'
| |
− | }
| |
− | }
| |
− | }
| |
− | }
| |
− | } );
| |
− | $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
| |
− | section: 'advanced',
| |
− | group: 'format',
| |
− | tools: {
| |
− | buttonId: {
| |
− | label: 'html',
| |
− | type: 'button',
| |
− | icon: '//mcmodding.jp/modding/extensions/WikiEditor/modules/images/toolbar/code-html.png',
| |
− | action: {
| |
− | type: 'encapsulate',
| |
− | options: {
| |
− | pre: '<html>',
| |
− | peri: 'Insert html here',
| |
− | post: '</html>'
| |
− | }
| |
− | }
| |
− | }
| |
− | }
| |
− | } );
| |
− | $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
| |
− | section: 'advanced',
| |
− | group: 'format',
| |
− | tools: {
| |
− | buttonId: {
| |
− | label: 'red',
| |
− | type: 'button',
| |
− | icon: '//mcmodding.jp/modding/extensions/WikiEditor/modules/images/toolbar/color-red.png',
| |
− | action: {
| |
− | type: 'encapsulate',
| |
− | options: {
| |
− | pre: '<span style="color: red">',
| |
− | peri: 'Insert text',
| |
− | post: '</span>'
| |
− | }
| |
− | }
| |
− | }
| |
− | }
| |
− | } );
| |
− | $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
| |
− | section: 'advanced',
| |
− | group: 'format',
| |
− | tools: {
| |
− | buttonId: {
| |
− | label: 'blue',
| |
− | type: 'button',
| |
− | icon: '//mcmodding.jp/modding/extensions/WikiEditor/modules/images/toolbar/color-blue.png',
| |
− | action: {
| |
− | type: 'encapsulate',
| |
− | options: {
| |
− | pre: '<span style="color: blue">',
| |
− | peri: 'Insert text',
| |
− | post: '</span>'
| |
− | }
| |
− | }
| |
− | }
| |
− | }
| |
− | } );
| |
− | $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
| |
− | section: 'advanced',
| |
− | group: 'format',
| |
− | tools: {
| |
− | buttonId: {
| |
− | label: 'del',
| |
− | type: 'button',
| |
− | icon: '//mcmodding.jp/modding/extensions/WikiEditor/modules/images/toolbar/delete.png',
| |
− | action: {
| |
− | type: 'encapsulate',
| |
− | options: {
| |
− | pre: '<s>',
| |
− | peri: 'Insert here',
| |
− | post: '</s>'
| |
− | }
| |
− | }
| |
− | }
| |
− | }
| |
− | } );
| |
− | $( '#wpTextbox1' ).wikiEditor( 'addToToolbar', {
| |
− | section: 'advanced',
| |
− | group: 'format',
| |
− | tools: {
| |
− | buttonId: {
| |
− | label: 'notoc',
| |
− | type: 'button',
| |
− | icon: '//mcmodding.jp/modding/extensions/WikiEditor/modules/images/toolbar/notoc.png',
| |
− | action: {
| |
− | type: 'encapsulate',
| |
− | options: {
| |
− | pre: '__NOTOC__',
| |
− | }
| |
− | }
| |
− | }
| |
− | }
| |
− | } );
| |
| | | |
− | });
| |
− | }
| |