uploadimage.js 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. (function() {
  2. CKEDITOR.dialog.add("uploadimage",
  3. function(a) {
  4. return {
  5. title: "图片上传",
  6. minWidth: "660px",
  7. minHeight:"400px",
  8. contents: [{
  9. id: "tab1",
  10. label: "",
  11. title: "图片上传",
  12. expand: true,
  13. width: "420px",
  14. height: "300px",
  15. padding: 0,
  16. elements: [{
  17. id:"uploadimage",
  18. type: "html",
  19. style: "width:100%;height:100px",
  20. html: '<input type="file" name="" id="uploadImg" value="" placeholder="请选择文件"/>'
  21. },
  22. /*{
  23. id: "Upload",
  24. filebrowser: "uploadButton",
  25. html: '<div><input type="file" placeholder="请选择文件"/></div>'
  26. },*/
  27. ]
  28. }],
  29. onOk: function() {
  30. /*var ins = "a";
  31. var num = "window.imgs.length";
  32. if(window.duiqi == undefined || window.duiqi == null){
  33. window.duiqi = "none";
  34. }
  35. for(var i=0;i<num;i++){
  36. var imgHtml = "<p";
  37. if("center" == window.duiqi){
  38. imgHtml += " style=\"text-align:center\">";
  39. }else{
  40. imgHtml += ">";
  41. }
  42. imgHtml += "<img src=\"" + window.imgs[i].url + "\" ";
  43. if("none" != window.duiqi && "center" != window.duiqi){
  44. imgHtml += "style=\"float: " + window.duiqi + ";\"/>";
  45. }else{
  46. imgHtml += "/>";
  47. }
  48. imgHtml += "</p>";
  49. ins.insertHtml(imgHtml);
  50. }
  51. window.imgs = new Array();
  52. //点击确定按钮后的操作
  53. //a.insertHtml("编辑器追加内容"); */
  54. },
  55. onShow: function () {
  56. //document.getElementById("uploadimage").setAttribute("src","/image/image.html?v=' +new Date().getSeconds() + '");
  57. }
  58. }
  59. })
  60. })();