-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Embed plugin provider url is now empty by default.
- Loading branch information
Showing
5 changed files
with
98 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<p>Test URLs</p> | ||
|
||
<ul> | ||
<li>https://www.youtube.com/watch?v=GUl9_5kK9ts</li> | ||
<li>https://twitter.com/cksource/status/719823128889790464</li> | ||
</ul> | ||
|
||
<textarea id="editor1" cols="10" rows="10"> | ||
<p>Foo bar</p> | ||
</textarea> | ||
<script> | ||
( function() { | ||
CKEDITOR.replace( 'editor1', { | ||
extraPlugins: 'wysiwygarea,sourcearea,htmlwriter,entities,toolbar,elementspath,undo,clipboard,format,basicstyles,embed,preview', | ||
embed_provider: '//ckeditor.iframe.ly/api/oembed?url={url}&callback={callback}', | ||
height: 500 | ||
} ); | ||
} )(); | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
@bender-tags: 4.7.0, tc, 13793, config | ||
@bender-ui: collapsed | ||
|
||
1. Open dev console. | ||
1. Copy any of the links below "Test URLs". | ||
1. Click on "Insert Media Embed" button. | ||
1. Paste URL. | ||
1. Click OK. | ||
|
||
## Expected | ||
|
||
Content gets embedded into the editor. | ||
|
||
## Unexpected | ||
|
||
`embed-no-provider-url` error displayed in the dev console. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/* bender-tags: embed */ | ||
/* bender-ckeditor-plugins: embed,toolbar */ | ||
|
||
( function() { | ||
'use strict'; | ||
|
||
bender.test( { | ||
|
||
setUp: function() { | ||
this.errorSpy = sinon.spy( CKEDITOR, 'error' ); | ||
}, | ||
|
||
tearDown: function() { | ||
this.errorSpy && this.errorSpy.restore(); | ||
}, | ||
|
||
'test default embed_provider empty and error thrown': function() { | ||
var spy = this.errorSpy; | ||
|
||
bender.editorBot.create( { | ||
name: 'editor1' | ||
}, function( bot ) { | ||
assert.isTrue( spy.calledWith( 'embed-no-provider-url' ) ); | ||
assert.areSame( '', bot.editor.widgets.registered.embed.providerUrl.source ); | ||
} ); | ||
}, | ||
|
||
'test custom embed_provider used when set and no error thrown': function() { | ||
var spy = this.errorSpy; | ||
|
||
bender.editorBot.create( { | ||
name: 'editor2', | ||
config: { | ||
embed_provider: 'testurl?url{url}&callback={callback}' | ||
} | ||
}, function( bot ) { | ||
assert.isTrue( spy.notCalled ); | ||
assert.areSame( 'testurl?url{url}&callback={callback}', bot.editor.widgets.registered.embed.providerUrl.source ); | ||
} ); | ||
} | ||
} ); | ||
} )(); |