-
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.
Merge pull request #822 from ckeditor/t/817
save support in source mode
- Loading branch information
Showing
6 changed files
with
56 additions
and
19 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,9 @@ | ||
<form> | ||
<textarea id="editor1">editor</textarea> | ||
</form> | ||
|
||
<script> | ||
CKEDITOR.replace( 'editor1', { | ||
startupMode: 'source' | ||
} ); | ||
</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-ui: collapsed | ||
@bender-tags: 817, 4.7.3, bug | ||
@bender-ckeditor-plugins: wysiwygarea, save, sourcearea, toolbar | ||
|
||
**Procedure:** | ||
|
||
1. Check if "Save" button is enabled. | ||
2. Switch to WYSIWYG mode. | ||
3. Check if "Save" button is enabled. | ||
|
||
**Expected result:** | ||
|
||
* "Save" button should be enabled in both modes. |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
<form id="form"> | ||
<textarea id="editor">editor</textarea> | ||
<form id="form1"> | ||
<textarea id="editor1">editor</textarea> | ||
</form> | ||
|
||
<form id="form2"> | ||
<textarea id="editor2">editor</textarea> | ||
</form> |
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 |
---|---|---|
@@ -1,26 +1,35 @@ | ||
/* bender-tags: editor */ | ||
/* bender-ckeditor-plugins: toolbar,save,wysiwygarea */ | ||
/* bender-ckeditor-plugins: toolbar,save,wysiwygarea,sourcearea */ | ||
|
||
bender.test( { | ||
'test save event': function() { | ||
var editor = CKEDITOR.replace( 'editor' ), | ||
count = 0; | ||
function saveTest( editor ) { | ||
var count = 0; | ||
|
||
editor.on( 'instanceReady', function() { | ||
editor.execCommand( 'save' ); | ||
editor.on( 'instanceReady', function() { | ||
editor.execCommand( 'save' ); | ||
|
||
setTimeout( function() { | ||
resume( function() { | ||
assert.areSame( 1, count, 'save was fired once' ); | ||
} ); | ||
setTimeout( function() { | ||
resume( function() { | ||
assert.areSame( 1, count, 'save was fired once' ); | ||
} ); | ||
} ); | ||
} ); | ||
|
||
editor.on( 'save', function() { | ||
count++; | ||
return false; | ||
} ); | ||
editor.on( 'save', function() { | ||
count++; | ||
return false; | ||
} ); | ||
|
||
wait(); | ||
} | ||
|
||
bender.test( { | ||
'test save event in WYSIWYG mode': function() { | ||
var editor = CKEDITOR.replace( 'editor1' ); | ||
saveTest( editor ); | ||
}, | ||
|
||
wait(); | ||
'test save event in source mode': function() { | ||
var editor = CKEDITOR.replace( 'editor2' , { startupMode: 'source' } ); | ||
saveTest( editor ); | ||
} | ||
} ); |