-
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.
- Loading branch information
Mateusz Samsel
committed
Jun 30, 2017
1 parent
82cbcda
commit df8a63b
Showing
3 changed files
with
149 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,121 @@ | ||
/* bender-tags: editor */ | ||
/* bender-ckeditor-plugins: colordialog,wysiwygarea */ | ||
|
||
( function() { | ||
'use strict'; | ||
|
||
bender.editor = {}; | ||
|
||
var test = { | ||
'test colordialog add hash to colors 6 digits': function() { | ||
var editor = this.editor; | ||
|
||
editor.once( 'dialogShow', function( evt ) { | ||
var dialog = evt.data; | ||
dialog.setValueOf( 'picker', 'selectedColor', '123456' ); | ||
dialog.getButton( 'ok' ).click(); | ||
|
||
} ); | ||
|
||
editor.getColorFromDialog( function( color ) { | ||
resume( function() { | ||
assert.areSame( '#123456', color ); | ||
} ); | ||
} ); | ||
wait(); | ||
}, | ||
|
||
'test colordialog add hash to colors 3 digits': function() { | ||
var editor = this.editor; | ||
|
||
editor.once( 'dialogShow', function( evt ) { | ||
var dialog = evt.data; | ||
dialog.setValueOf( 'picker', 'selectedColor', 'FDE' ); | ||
dialog.getButton( 'ok' ).click(); | ||
|
||
} ); | ||
|
||
editor.getColorFromDialog( function( color ) { | ||
resume( function() { | ||
assert.areSame( '#FDE', color ); | ||
} ); | ||
} ); | ||
wait(); | ||
}, | ||
|
||
'test colordialog does not add hash 1 digit': function() { | ||
var editor = this.editor; | ||
|
||
editor.once( 'dialogShow', function( evt ) { | ||
var dialog = evt.data; | ||
dialog.setValueOf( 'picker', 'selectedColor', '3' ); | ||
dialog.getButton( 'ok' ).click(); | ||
|
||
} ); | ||
|
||
editor.getColorFromDialog( function( color ) { | ||
resume( function() { | ||
assert.areSame( '3', color ); | ||
} ); | ||
} ); | ||
wait(); | ||
}, | ||
|
||
'test colordialog does not add hash color name': function() { | ||
var editor = this.editor; | ||
|
||
editor.once( 'dialogShow', function( evt ) { | ||
var dialog = evt.data; | ||
dialog.setValueOf( 'picker', 'selectedColor', 'red' ); | ||
dialog.getButton( 'ok' ).click(); | ||
|
||
} ); | ||
|
||
editor.getColorFromDialog( function( color ) { | ||
resume( function() { | ||
assert.areSame( 'red', color ); | ||
} ); | ||
} ); | ||
wait(); | ||
}, | ||
|
||
'test colordialog does not add hash rgb': function() { | ||
var editor = this.editor; | ||
|
||
editor.once( 'dialogShow', function( evt ) { | ||
var dialog = evt.data; | ||
dialog.setValueOf( 'picker', 'selectedColor', 'rgb(10, 20, 30)' ); | ||
dialog.getButton( 'ok' ).click(); | ||
|
||
} ); | ||
|
||
editor.getColorFromDialog( function( color ) { | ||
resume( function() { | ||
assert.areSame( 'rgb(10, 20, 30)', color ); | ||
} ); | ||
} ); | ||
wait(); | ||
}, | ||
|
||
'test colordialog does not add hash empty value': function() { | ||
var editor = this.editor; | ||
|
||
editor.once( 'dialogShow', function( evt ) { | ||
var dialog = evt.data; | ||
dialog.setValueOf( 'picker', 'selectedColor', '' ); | ||
dialog.getButton( 'ok' ).click(); | ||
|
||
} ); | ||
|
||
editor.getColorFromDialog( function( color ) { | ||
resume( function() { | ||
assert.areSame( '', color ); | ||
} ); | ||
} ); | ||
wait(); | ||
} | ||
}; | ||
|
||
bender.test( test ); | ||
|
||
} )(); |
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,15 @@ | ||
<textarea id='editor1'> | ||
<table border="1" cellspacing="1" cellpadding="1"> | ||
<tr> | ||
<td>Cell 1</td><td>Cell 2</td> | ||
</tr> | ||
</table> | ||
</textarea> | ||
|
||
<script> | ||
if ( bender.tools.env.mobile ) { | ||
bender.ignore(); | ||
} else { | ||
CKEDITOR.replace( 'editor1' ); | ||
} | ||
</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,13 @@ | ||
@bender-tags: tc, feature, colordialog, 565, 4.8.0 | ||
@bender-ui: collapsed | ||
@bender-ckeditor-plugins: table,tabletools,colordialog,toolbar,wysiwygarea,sourcearea,contextmenu | ||
|
||
1. Right click into table cell. | ||
1. Select `Cell -> Cell Properties`. | ||
1. Choose background color. | ||
1. Type color in hexadecimal 6-digit format **without** leading `#`. E.g. (`ABC123`). | ||
1. Confirm it. | ||
1. Inseted color should contain additional `#` at the beginning. | ||
1. Repeat above steps for color with hexadecimal 3-digits format. E.g. (`FFF`). | ||
|
||
Note: You can also check some wrong situations. |