File: buttonicon.html

package info (click to toggle)
ckeditor 4.16.0%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 258,804 kB
  • sloc: javascript: 239,590; sh: 184; makefile: 64; python: 37; php: 15; xml: 5
file content (26 lines) | stat: -rw-r--r-- 672 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
<div id="editor" contenteditable="true">
	Foo Bar
</div>

<script>
	CKEDITOR.replace( 'editor', {
		toolbar: [ [ 'bold', 'link', 'unlink' ], [ 'btn1', 'btn2', 'btn3' ] ],
		on: {
			pluginsLoaded: function( evt ) {
				evt.editor.ui.addButton( 'btn1', {
					icon: 'Link'
				} );
				// Absolute path.
				evt.editor.ui.addButton( 'btn2', {
					icon: '/apps/ckeditor/tests/_assets/sample_icon.png',
					iconHiDpi: '/apps/ckeditor/tests/_assets/sample_icon.hidpi.png'
				} );
				// Relative path.
				evt.editor.ui.addButton( 'btn3', {
					icon: 'tests/_assets/sample_icon.png',
					iconHiDpi: 'tests/_assets/sample_icon.hidpi.png'
				} );
			}
		}
	} );
</script>