chrome 多图上传的bug #17

Open
wentmac opened this Issue Aug 22, 2015 · 1 comment

Projects

None yet

2 participants

@wentmac
wentmac commented Aug 22, 2015

注释的地方是bug.注释下面的一行是修改成功的。
this.showImg = function() {
var a = $(getLang(htmlImg)),
b = _this.getParent("img"),
c = $("#xheImgUrl", a),
d = $("#xheImgAlt", a),
e = $("#xheImgAlign", a),
f = $("#xheImgWidth", a),
g = $("#xheImgHeight", a),
h = $("#xheImgBorder", a),
i = $("#xheImgVspace", a),
j = $("#xheImgHspace", a),
k = $("#xheSave", a);
if (1 === b.length) {
c.val(xheAttr(b, "src")),
d.val(b.attr("alt")),
e.val(b.attr("align")),
f.val(b.attr("width")),
g.val(b.attr("height")),
h.val(b.attr("border"));
var l = b.attr("vspace"),
m = b.attr("hspace");
i.val(0 >= l ? "": l),
j.val(0 >= m ? "": m)
}
settings.upImgUrl && _this.uploadInit(c, settings.upImgUrl, settings.upImgExt),
k.click(function() {
_this.loadBookmark();
var a = c.val();
if ("" !== a && "http://" !== a) {
var k = a.toString().split(" "),
l = d.val(),
m = e.val(),
n = f.val(),
o = g.val(),
p = h.val(),
q = i.val(),
r = j.val();
if (k.length > 1) {
var s, t = '<img src="xhe_tmpurl"',
u = [];
"" !== l && (t += ' alt="' + l + '"'),
"" !== m && (t += ' align="' + m + '"'),
"" !== n && (t += ' width="' + n + '"'),
"" !== o && (t += ' height="' + o + '"'),
"" !== p && (t += ' border="' + p + '"'),
"" !== q && (t += ' vspace="' + q + '"'),
"" !== r && (t += ' hspace="' + r + '"'),
t += " />";
//for (var v in k) a = k[v],
for (var v=0,len=k.length;v<len;v++) a = k[v],
"" !== a &&
(
//a = a.split("||"),
a = a.toString().split("||"),
s = t, s = s.replace("xhe_tmpurl", a[0]),
a[1] && (s = '' + s + ""),
u.push(s)
);

                    _this.pasteHTML(u.join("&nbsp;"))
                } else if (1 === k.length && (a = k[0], "" !== a && (a = a.split("||"), 0 === b.length && (_this.pasteHTML('<img src="' + a[0] + '#xhe_tmpurl" />'), b = $('img[src$="#xhe_tmpurl"]', _doc)), xheAttr(b, "src", a[0]), "" !== l && b.attr("alt", l), "" !== m ? b.attr("align", m) : b.removeAttr("align"), "" !== n ? b.attr("width", n) : b.removeAttr("width"), "" !== o ? b.attr("height", o) : b.removeAttr("height"), "" !== p ? b.attr("border", p) : b.removeAttr("border"), "" !== q ? b.attr("vspace", q) : b.removeAttr("vspace"), "" !== r ? b.attr("hspace", r) : b.removeAttr("hspace"), a[1]))) {
                    var w = b.parent("a");
                    0 === w.length && (b.wrap("<a></a>"), w = b.parent("a")),
                    xheAttr(w, "href", a[1]),
                    w.attr("target", "_blank")
                }
            } else 1 === b.length && b.remove();
            return _this.hidePanel(),
            !1
        }),
        _this.saveBookmark(),
        _this.showDialog(a)
    },
@yaniswang
Owner

也不能说是BUG吧,是你返回的值不正确,如果返回的值是字符串的,就不会出问题。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment