copy.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. module('plugins.copy');
  2. //需要点击授权弹出框,暂时去除
  3. //test('检查IE下复制命令是否执行正常', function () {
  4. //
  5. // if (browser.ie) {
  6. // var editor = te.obj[0];
  7. // editor.setContent('<p>hello</p>');
  8. // editor.focus();
  9. //
  10. // editor.execCommand('selectall');
  11. // editor.execCommand('copy');
  12. // editor.body.innerHTML = '';
  13. // editor.execCommand('selectall');
  14. // editor.body.document.execCommand('paste');
  15. //
  16. // equal(utils.trim(window.clipboardData.getData('text')), 'hello', '检查粘贴板内容,IE下成功复制内容');
  17. // setTimeout(function(){
  18. // equal(editor.getContent(), '<p>hello</p>', '检查原生粘贴命令,IE下成功复制内容');
  19. // start();
  20. // },100);
  21. //
  22. // stop();
  23. // }
  24. //
  25. //});
  26. test('检查非IE下是否正常加载zeroclipboard粘贴板插件', function () {
  27. te.dom[0].parentNode.removeChild(te.dom[0]);
  28. var sc = document.createElement("script");
  29. sc.id="sc";
  30. sc.type = "text/plain";
  31. sc.style.height = "100px";
  32. document.body.appendChild(sc);
  33. var me = UE.getEditor('sc',{'autoFloatEnabled':true,'topOffset':60,'autoHeightEnabled':true,'scaleEnabled':false});
  34. me.ready(function(){
  35. setTimeout(function(){
  36. if (!browser.ie) {
  37. ok(window.ZeroClipboard, '是否正常加载zeroclipboard粘贴板插件');
  38. }
  39. setTimeout(function () {
  40. UE.delEditor('sc');
  41. document.getElementById('sc')&&document.getElementById('sc').parentNode.removeChild(document.getElementById('sc'));
  42. start();
  43. }, 500);
  44. }, 300);
  45. });
  46. stop();
  47. });