yaniswang / xhEditor

xhEditor是一个基于jQuery开发的简单迷你并且高效的在线可视化HTML编辑器。
http://xheditor.com/
GNU Lesser General Public License v3.0
244 stars 79 forks source link

上传回调函数的参数只有文件地址信息,扩展性太局限了。 #1

Closed chekun closed 11 years ago

chekun commented 11 years ago

老大你好: 非常喜欢xheditor,有个问题就是,目前上传回调函数的参数只有文件地址信息,扩展性太局限了。我改了个暂时使用一下(https://github.com/chekun/xheditor/blob/master/xheditor-zh-cn.js), 希望老大速度出个正式版,感谢。

yaniswang commented 11 years ago

还没有试过用github做多人协作开发,你把改动的代码重新提交回来吧,我看看你改动了哪些代码。

yaniswang commented 11 years ago

目前我们的回调参数里不仅仅只有URL,可以通过后端进行无限扩展的。 可以看一下DEMO08最后一个例子:http://dev.xheditor.com/source/demos/demo08.html 这个DEMO中就回传了以下信息:

[id: "1"
localname: "2.jpg"
url: "upload/day_120927/201209272046307043.jpg"]

还可以无限扩展,只需要在upload.php中加入更多信息。

chekun commented 11 years ago

嗯,我又仔细看了一下,你提供了2种返回格式

{"err":"","msg":"200906030521128703.gif"} {"err":"","msg":{"url":"200906030521128703.jpg","localfile":"test.jpg","id":"1"}}

第一种的时候就会arrMsg就只会是文件地址了 第二种就可以那样返回了 感谢老大,我没仔细看,嘿嘿。