-
Notifications
You must be signed in to change notification settings - Fork 2.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
save support in source mode #822
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
66bcf2a
save support in source mode
wojtekw92 56bfd68
review fixes
wojtekw92 80040fe
typo fix (indentation)
wojtekw92 6abb82a
review fixes
wojtekw92 bc938ec
Add manual test.
Comandeer 2c0fd8a
Update changelog [ci skip].
Comandeer File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 ); | ||
} | ||
} ); |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if
afterCommandExec
could be used here instead ofsetTimeout
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unfortunately no, save plugin doesn't fire
afterCommandExec