Skip to content

Commit

Permalink
Merge pull request fex-team#2239 from fex-team/dev-1.4.3
Browse files Browse the repository at this point in the history
Dev 1.4.3
  • Loading branch information
Phinome committed Jan 22, 2016
2 parents b7aca53 + 18601e8 commit 1f82eb6
Show file tree
Hide file tree
Showing 4 changed files with 65 additions and 0 deletions.
2 changes: 2 additions & 0 deletions _test/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
///import core/localstorage;
///import plugins/defaultfilter;
///import plugins/inserthtml;
///import plugins/insertfile;
///import plugins/autotypeset;
///import plugins/background;
///import plugins/image;
Expand Down Expand Up @@ -59,6 +60,7 @@
///import plugins/autolink;
///import plugins/autoheight;
///import plugins/autofloat;
///import plugins/autosubmit;
///import plugins/video;
///import plugins/table.core;
///import plugins/table.cmds;
Expand Down
41 changes: 41 additions & 0 deletions _test/plugins/autosubmit.js
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();
});

8 changes: 8 additions & 0 deletions _test/plugins/defaultfilter.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ module( 'plugins.defaultfilter' );
//test('',function(){
// stop();
//});
test( 'p标签禁止嵌套', function () {
var editor = te.obj[0];
editor.setContent( '<p align ="center" ><p>123</p><p>456</p></p><dl><dd></dd></dl>' );
var br = ua.browser.ie?'&nbsp;':'<br>';
console.log(editor.getContent());
var html = '<p style=\"text-align:center;\">'+br+'</p><p>123</p><p>456</p><ul class=" list-paddingleft-2"><li><p>'+br+'</p></li></ul>';
ua.checkSameHtml(editor.body.innerHTML,html, 'p标签禁止嵌套');
} );
test( '对代码的行号不处理', function () {
var editor = te.obj[0];
editor.setContent( '<td class="gutter"><div class="line number1 index0 alt2">1</div><div class="line number2 index1 alt1">2</div></td>');
Expand Down
14 changes: 14 additions & 0 deletions _test/plugins/insertcode.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,20 @@ test('trace 3395:插入代码为空时,清空编辑器', function () {
ua.keydown(editor.body, {'keyCode':8});
br = ua.browser.ie ? '' : '<br>';
ua.checkSameHtml(editor.body.innerHTML, '<p>' + br + '</p>', '检查编辑器清空');

if(!ua.browser.ie){
editor.setContent('<pre class="brush:html;toolbar:false"></pre>');
editor.fireEvent('delkeydown',{});
ua.checkSameHtml(editor.body.innerHTML, '<p>' + br + '</p>', '检查编辑器清空');
}
editor.setContent('<pre class="brush:html;toolbar:false"></pre>');
ua.keydown(editor.body, {'keyCode':40});

if(ua.browser.ie==8||ua.browser.ie==11)
br = '<br>'
if(ua.browser.ie==8)return;
ua.checkSameHtml(editor.body.innerHTML,'<pre class="brush:html;toolbar:false">'+br+'</pre>','方向键处理');

});

test('trace 3396:多次切换源码,不会产生空行', function () {
Expand Down

0 comments on commit 1f82eb6

Please sign in to comment.