|
@@ -7990,7 +7990,7 @@ KindEditor.plugin('media', function(K) {
|
|
|
'</div>',
|
|
|
'<div class="ke-dialog-row">',
|
|
|
'<label for="keWidth" style="width:60px;">标题</label>',
|
|
|
- '<input type="text" id="keName" class="ke-input-text" style="width:160px;" name="name" value="" maxlength="30" />',
|
|
|
+ '<input type="text" id="keName" class="ke-input-text" style="width:160px;" name="name" value="" maxlength="30" /> 宽高:<input type="text" id="keWh" class="ke-input-text" style="width:100px;" name="wh" value="200px*200px" maxlength="100" />',
|
|
|
'</div>',
|
|
|
'<div class="ke-dialog-row">',
|
|
|
'<label for="keUrl" style="width:60px;">封面</label>',
|
|
@@ -8027,8 +8027,12 @@ KindEditor.plugin('media', function(K) {
|
|
|
var url = K.trim(urlBox.val()),
|
|
|
coverUrl = K.trim(coverUrlBox.val()),
|
|
|
name = nameBox.val(),
|
|
|
+ wh = whBox.val(),
|
|
|
width = widthBox.val(),
|
|
|
height = heightBox.val();
|
|
|
+ var temp = wh.split('*');
|
|
|
+ width = temp[0];
|
|
|
+ height = temp[1];
|
|
|
if (url == 'http://' || K.invalidUrl(url)) {
|
|
|
alert(self.lang('invalidUrl'));
|
|
|
urlBox[0].focus();
|
|
@@ -8039,11 +8043,18 @@ KindEditor.plugin('media', function(K) {
|
|
|
urlBox[0].focus();
|
|
|
return;
|
|
|
}
|
|
|
+ if (!wh) {
|
|
|
+ alert('请填写宽高');
|
|
|
+ urlBox[0].focus();
|
|
|
+ return;
|
|
|
+ }
|
|
|
if (coverUrl == 'http://' || K.invalidUrl(coverUrl)) {
|
|
|
alert('请上传封面');
|
|
|
urlBox[0].focus();
|
|
|
return;
|
|
|
}
|
|
|
+
|
|
|
+ /*
|
|
|
if (!/^\d*$/.test(width)) {
|
|
|
alert(self.lang('invalidWidth'));
|
|
|
widthBox[0].focus();
|
|
@@ -8054,6 +8065,7 @@ KindEditor.plugin('media', function(K) {
|
|
|
heightBox[0].focus();
|
|
|
return;
|
|
|
}
|
|
|
+ */
|
|
|
|
|
|
if (!coverUrl) {
|
|
|
var cover = self.themesPath + 'common/blank.gif';
|
|
@@ -8071,13 +8083,14 @@ KindEditor.plugin('media', function(K) {
|
|
|
loop : 'true'
|
|
|
});
|
|
|
*/
|
|
|
- var html = '<img src="'+cover+'" style="width:'+width+'px;height:'+height+'px;" data-file="'+url+'||'+name+'"/>';
|
|
|
+ var html = '<img src="'+cover+'" style="width:'+width+';height:'+height+';" data-file="'+url+'||'+name+'||'+wh+'"/>';
|
|
|
self.insertHtml(html).hideDialog().focus();
|
|
|
}
|
|
|
}
|
|
|
}),
|
|
|
div = dialog.div,
|
|
|
nameBox = K('[name="name"]', div),
|
|
|
+ whBox = K('[name="wh"]', div),
|
|
|
coverUrlBox = K('[name="cover_url"]', div),
|
|
|
viewCoverServerBtn = K('[name="viewCoverServer"]', div),
|
|
|
|