forked from fex-team/ueditor
-
Notifications
You must be signed in to change notification settings - Fork 0
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 fex-team#2239 from fex-team/dev-1.4.3
Dev 1.4.3
- Loading branch information
Showing
4 changed files
with
65 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
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,41 @@ | ||
/** | ||
* Created by wangrui10 on 14-6-4. | ||
*/ | ||
module('plugins.autosubmit'); | ||
|
||
test("自动提交",function(){ | ||
var form = document.body.appendChild(document.createElement('form')); | ||
form.id = 'formid'; | ||
form.action = './'; | ||
form.method = "post"; | ||
form.target = '_blank'; | ||
|
||
var text = document.createElement('input'); | ||
text.type = 'text'; | ||
form.appendChild(text); | ||
|
||
var btn = document.createElement('input'); | ||
btn.type = 'submit'; | ||
form.appendChild(btn); | ||
|
||
var div = form.appendChild(document.createElement('div')); | ||
div.id = 'ue'; | ||
var editor = UE.getEditor('ue'); | ||
editor.ready(function(){ | ||
editor.body.innerHTML='123123'; | ||
editor.focus(); | ||
editor.execCommand('autosubmit'); | ||
|
||
form = domUtils.findParentByTagName(this.iframe,"form", false); | ||
|
||
setTimeout(function(){ | ||
equal(editor.textarea.value,'123123','检查editor中准备同步的内容'); | ||
var d = $('#'+form.id).context.forms.formid[2].value; | ||
equal(d,'123123','editor中的内容同步到textarea中'); | ||
start(); | ||
},100); | ||
|
||
}); | ||
stop(); | ||
}); | ||
|
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