File: iframe.js

package info (click to toggle)
ckeditor 4.11.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 93,632 kB
  • sloc: sh: 184; makefile: 59; python: 37; php: 15; xml: 5
file content (43 lines) | stat: -rw-r--r-- 1,481 bytes parent folder | download
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* bender-tags: editor */
/* bender-ckeditor-plugins: iframe,dialogadvtab,toolbar */

bender.editor = {
	config: {
		autoParagraph: false
	}
};

bender.test( {
	'test create iframe': function() {
		var bot = this.editorBot;
		bot.dialog( 'iframe', function( dialog ) {
			dialog.setValueOf( 'info', 'src', 'http://ckeditor.com' );
			dialog.setValueOf( 'info', 'width', '100%' );
			dialog.setValueOf( 'info', 'height', '500' );
			dialog.setValueOf( 'advanced', 'advStyles', 'height:100px; width:100px;' );

			dialog.getButton( 'ok' ).click();

			assert.areEqual( '<iframe frameborder="0" height="500" scrolling="no" src="http://ckeditor.com" ' +
				'style="height:100px;width:100px;" width="100%"></iframe>', bot.getData( true ) );
		} );
	},

	'test update iframe': function() {
		var bot = this.editorBot, editor = this.editor;

		bot.setHtmlWithSelection( editor.dataProcessor.toHtml( '[<iframe frameborder="0" scrolling="no" src="http://ckeditor.com" width="100%"></iframe>]' ) );

		bot.dialog( 'iframe', function( dialog ) {
			assert.areSame( 'http://ckeditor.com', dialog.getValueOf( 'info', 'src' ) );
			assert.areSame( '100%', dialog.getValueOf( 'info', 'width' ) );

			dialog.setValueOf( 'info', 'src', 'http://cksource.com' );
			dialog.setValueOf( 'info', 'width', '400' );

			dialog.getButton( 'ok' ).click();

			assert.areEqual( '<iframe frameborder="0" scrolling="no" src="http://cksource.com" width="400"></iframe>', bot.getData( true ) );
		} );
	}
} );