Browse Source

修改样式

aaa 3 years ago
parent
commit
a47d4d4fec
1 changed files with 49 additions and 49 deletions
  1. 49 49
      src/components/tinymce/TinymceEditor.vue

+ 49 - 49
src/components/tinymce/TinymceEditor.vue

@@ -128,56 +128,56 @@ export default {
             });
             });
           }
           }
         },
         },
-        file_picker_callback: function(callback, value, meta, failure) {
-          //文件分类
-          var filetype =
-            ".pdf, .txt, .zip, .rar, .7z, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .mp3, .mp4";
-          //后端接收上传文件的地址
-          var upurl = "/demo/upfile.php";
-          //为不同插件指定文件类型及后端地址
-          switch (meta.filetype) {
-            case "image":
-              filetype = ".jpg, .jpeg, .png, .gif";
-              upurl = "upimg.php";
-              break;
-            case "media":
-              filetype = ".mp3, .mp4";
-              upurl = "upfile.php";
-              break;
-            case "file":
-            default:
-          }
-          //模拟出一个input用于添加本地文件
-          var input = document.createElement("input");
-          input.setAttribute("type", "file");
-          input.setAttribute("accept", filetype);
-          input.click();
-          input.onchange = function() {
-            var file = this.files[0];
+        // file_picker_callback: function(callback, value, meta, failure) {
+        //   //文件分类
+        //   var filetype =
+        //     ".pdf, .txt, .zip, .rar, .7z, .doc, .docx, .xls, .xlsx, .ppt, .pptx, .mp3, .mp4";
+        //   //后端接收上传文件的地址
+        //   var upurl = "/demo/upfile.php";
+        //   //为不同插件指定文件类型及后端地址
+        //   switch (meta.filetype) {
+        //     case "image":
+        //       filetype = ".jpg, .jpeg, .png, .gif";
+        //       upurl = "upimg.php";
+        //       break;
+        //     case "media":
+        //       filetype = ".mp3, .mp4";
+        //       upurl = "upfile.php";
+        //       break;
+        //     case "file":
+        //     default:
+        //   }
+        //   //模拟出一个input用于添加本地文件
+        //   var input = document.createElement("input");
+        //   input.setAttribute("type", "file");
+        //   input.setAttribute("accept", filetype);
+        //   input.click();
+        //   input.onchange = function() {
+        //     var file = this.files[0];
 
 
-            var xhr, formData;
-            console.log(file.name);
-            xhr = new XMLHttpRequest();
-            xhr.withCredentials = false;
-            xhr.open("POST", upurl);
-            xhr.onload = function() {
-              var json;
-              if (xhr.status != 200) {
-                failure("HTTP Error: " + xhr.status);
-                return;
-              }
-              json = JSON.parse(xhr.responseText);
-              if (!json || typeof json.location != "string") {
-                failure("Invalid JSON: " + xhr.responseText);
-                return;
-              }
-              callback(json.location);
-            };
-            formData = new FormData();
-            formData.append("file", file, file.name);
-            xhr.send(formData);
-          };
-        },
+        //     var xhr, formData;
+        //     console.log(file.name);
+        //     xhr = new XMLHttpRequest();
+        //     xhr.withCredentials = false;
+        //     xhr.open("POST", upurl);
+        //     xhr.onload = function() {
+        //       var json;
+        //       if (xhr.status != 200) {
+        //         failure("HTTP Error: " + xhr.status);
+        //         return;
+        //       }
+        //       json = JSON.parse(xhr.responseText);
+        //       if (!json || typeof json.location != "string") {
+        //         failure("Invalid JSON: " + xhr.responseText);
+        //         return;
+        //       }
+        //       callback(json.location);
+        //     };
+        //     formData = new FormData();
+        //     formData.append("file", file, file.name);
+        //     xhr.send(formData);
+        //   };
+        // },
         menu: {
         menu: {
           file: { title: "File", items: "newdocument" },
           file: { title: "File", items: "newdocument" },