|
|
|
@ -929,14 +929,35 @@ function _mediaClass(type) {
|
|
|
|
|
function _mediaAttrs(srcTag) {
|
|
|
|
|
return _getAttrList(unescape(srcTag));
|
|
|
|
|
}
|
|
|
|
|
function _mediaEmbed(attrs) {
|
|
|
|
|
var html = '<embed ';
|
|
|
|
|
function _mediaEmbed(attrs,target) {
|
|
|
|
|
if(target && target === "media"){
|
|
|
|
|
var html = [[],"<img class=\"mediaIco\" src=\"../../images/video.png\" "],_ww = window.screen.width,_wh = window.screen.height;//_docHeight(window.document);
|
|
|
|
|
_each(attrs, function(key, val) {
|
|
|
|
|
if(key === "src"){
|
|
|
|
|
html[0].push("<a class=\"mediaIcobox\" href=\"javascript:window.open('"+ val+"','newwindow','");
|
|
|
|
|
}else{
|
|
|
|
|
if(key === "width"){
|
|
|
|
|
html[0].push("width="+val,",left="+(_ww-val)/2 + ",");
|
|
|
|
|
}else if(key === "height"){
|
|
|
|
|
html[0].push("height="+val,",top="+(_wh-val)/2);
|
|
|
|
|
}else{
|
|
|
|
|
html.push(key, "=\"" , val , "\" ");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
html[0].push("')\">");
|
|
|
|
|
html[0] = html[0].join("");
|
|
|
|
|
html.push("/></a>");
|
|
|
|
|
return html.join("");
|
|
|
|
|
}else{
|
|
|
|
|
var html = '<img ';
|
|
|
|
|
_each(attrs, function(key, val) {
|
|
|
|
|
html += key + '="' + val + '" ';
|
|
|
|
|
});
|
|
|
|
|
html += '/>';
|
|
|
|
|
return html;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
function _mediaImg(blankPath, attrs) {
|
|
|
|
|
var width = attrs.width,
|
|
|
|
|
height = attrs.height,
|
|
|
|
@ -2765,7 +2786,7 @@ _extend(KCmd, {
|
|
|
|
|
sel.addRange(rng);
|
|
|
|
|
if (doc !== document) {
|
|
|
|
|
var pos = K(rng.endContainer).pos();
|
|
|
|
|
win.scrollTo(pos.x, pos.y);
|
|
|
|
|
//win.scrollTo(pos.x, pos.y);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
win.focus();
|
|
|
|
@ -5646,8 +5667,29 @@ _plugin('core', function(K) {
|
|
|
|
|
}else{
|
|
|
|
|
//TODO 暂时什么也不做
|
|
|
|
|
}
|
|
|
|
|
var _bod = $(self.cmd.doc.body);
|
|
|
|
|
var body = self.cmd.doc.body;
|
|
|
|
|
var _bw = _bod.width(),_bh = Math.max((K.IE ? body.scrollHeight : (K.GECKO ? body.offsetHeight+26:body.offsetHeight)));
|
|
|
|
|
var _bsh = 0;
|
|
|
|
|
_bod.children().each(function(){
|
|
|
|
|
_bsh += $(this).height();
|
|
|
|
|
});
|
|
|
|
|
var _imgbase = _bod.find("img");
|
|
|
|
|
_imgbase[0].onload = function(){
|
|
|
|
|
var _iw=_imgbase.width(),_ih = _imgbase.height();
|
|
|
|
|
var _alh = _bsh + _ih;
|
|
|
|
|
var _rhig = _alh > _bh ? _alh : _bh;
|
|
|
|
|
switch(self.resizeType){
|
|
|
|
|
case 1:
|
|
|
|
|
var _defh = self.toolbar.div.height() + self.statusbar.height();
|
|
|
|
|
_defh = _defh > 0 ? _defh + 6 : _defh;
|
|
|
|
|
self.resize(null,_rhig + _defh);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
alert(data.message);
|
|
|
|
|
//alert(data.message);
|
|
|
|
|
alert("仅支持如下图片格式:bmp,jpeg,jpg,png,gif,BMP,JPEG,JPG,PNG,GIF");
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
afterError : function(str) {
|
|
|
|
@ -6018,7 +6060,7 @@ _plugin('core', function(K) {
|
|
|
|
|
}
|
|
|
|
|
attrs.width = _undef(imgAttrs.width, width);
|
|
|
|
|
attrs.height = _undef(imgAttrs.height, height);
|
|
|
|
|
return _mediaEmbed(attrs);
|
|
|
|
|
return _mediaEmbed(attrs,"media");
|
|
|
|
|
})
|
|
|
|
|
.replace(/<img[^>]*class="?ke-anchor"?[^>]*>/ig, function(full) {
|
|
|
|
|
var imgAttrs = _getAttrList(full);
|
|
|
|
|