-
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.
Show current color in the Color Dialog (#2934)
Show current color in the Color Dialog
- Loading branch information
Showing
9 changed files
with
197 additions
and
51 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
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,40 @@ | ||
/* exported assertColor, openDialogManually */ | ||
|
||
function assertColor( editor, inputColor, outputColor ) { | ||
editor.once( 'dialogShow', function( evt ) { | ||
var dialog = evt.data; | ||
dialog.setValueOf( 'picker', 'selectedColor', inputColor ); | ||
dialog.getButton( 'ok' ).click(); | ||
} ); | ||
|
||
editor.getColorFromDialog( function( color ) { | ||
resume( function() { | ||
assert.areSame( outputColor, color ); | ||
} ); | ||
} ); | ||
wait(); | ||
} | ||
|
||
function openDialogManually( editor, expectedColor, html, button ) { | ||
var toolbarButton = editor.ui.get( button ); | ||
bender.tools.setHtmlWithSelection( editor, html ); | ||
editor.once( 'dialogShow', function( evt ) { | ||
resume( function() { | ||
var dialog = evt.data, | ||
selectedColor = dialog.getValueOf( 'picker', 'selectedColor' ); | ||
dialog.getButton( 'ok' ).click(); | ||
assert.areSame( expectedColor, selectedColor ); | ||
} ); | ||
} ); | ||
|
||
toolbarButton.click( editor ); | ||
openColorDialog( toolbarButton ); | ||
} | ||
|
||
function openColorDialog( button ) { | ||
setTimeout( function() { | ||
button._.panel.getBlock( button._.id ).element.findOne( '.cke_colormore' ).$.click(); | ||
}, 0 ); | ||
wait(); | ||
} | ||
|
Oops, something went wrong.