1.issue编辑器定下最高高度到了改为滚动条

2.提问和建议修改提示语
3.KE插入代码框去掉我要回复字样
4.自动识别URL优化可识别? 和cn等
5.KE缩进修改等
This commit is contained in:
yuanke 2016-06-02 13:55:40 +08:00
parent e650dca1ed
commit 0d38fa53a2
10 changed files with 83 additions and 15 deletions

View File

@ -358,7 +358,7 @@ zh:
# 意见反馈
#
label_feedback: 意见反馈
label_feedback_tips: "请在此提问平台问题,或直接加入师姐答疑群,谢谢!"
label_feedback_tips: "请在此发布平台问题和建议,或直接加入答疑群,谢谢!"
label_technical_support: "QQ 在线支持:"
label_feedback_success: "您的意见已经反馈到公共贴吧的新手讨论吧,我们会第一时间解决您的问题,谢谢支持!"
label_feedback_value: "该帖来自用户反馈:)"

View File

@ -83,7 +83,8 @@ function _inString(val, str, delimiter) {
}
function _addUnit(val, unit) {
unit = unit || 'px';
return val && /^\d+$/.test(val) ? val + unit : val;
//return val && /^\d+$/.test(val) ? val + unit : val;
return val && /^-?\d+(?:\.\d+)?$/.test(val) ? val + unit : val;
}
function _removeUnit(val) {
var match;
@ -304,7 +305,7 @@ K.options = {
img : ['id', 'class', 'src', 'width', 'height', 'border', 'alt', 'title', 'align', '.width', '.height', '.border'],
'p,ol,ul,li,blockquote,h1,h2,h3,h4,h5,h6' : [
'id', 'class', 'align', '.text-align', '.color', '.background-color', '.font-size', '.font-family', '.background',
'.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.text-indent', '.margin-left'
'.font-weight', '.font-style', '.text-decoration', '.vertical-align', '.text-indent', '.margin-left', '.margin', '.border', '.padding'
],
pre : ['id', 'class'],
hr : ['id', 'class', '.page-break-after'],
@ -597,7 +598,7 @@ function _ready(fn) {
}
_bind(window, 'load', readyFunc);
}
if (_IE) {
if (window.attachEvent) {
window.attachEvent('onunload', function() {
_each(_eventData, function(key, events) {
if (events.el) {
@ -2531,6 +2532,7 @@ K.START_TO_START = _START_TO_START;
K.START_TO_END = _START_TO_END;
K.END_TO_END = _END_TO_END;
K.END_TO_START = _END_TO_START;
function _nativeCommand(doc, key, val) {
try {
doc.execCommand(key, false, val);
@ -3361,6 +3363,10 @@ function _drag(options) {
});
}
clickEl.mousedown(function(e) {
//新加的
if(e.button !== 0 && e.button !== 1) {
return;
}
e.stopPropagation();
var self = clickEl.get(),
x = _removeUnit(moveEl.css('left')),
@ -3681,13 +3687,20 @@ _extend(KEdit, KWidget, {
if (isDocumentDomain) {
doc.domain = document.domain;
}
doc.write(_getInitHtml(themesPath, bodyClass, cssPath, cssData));
doc.close();
self.win = self.iframe[0].contentWindow;
self.doc = doc;
var cmd = _cmd(doc);
self.afterChange(function(e) {
cmd.selection();
// if (e.which == 8) {
// var range = cmd.range
// var bookmark = range.createBookmark();
// cmd.doc.body.innerHTML = cmd.doc.body.innerHTML.replace(/<p>\s*<\/p>/g,"");
// range.moveToBookmark(bookmark);
// }
cmd.selection();
});
if (_WEBKIT) {
K(doc).click(function(e) {
@ -3824,9 +3837,20 @@ _extend(KEdit, KWidget, {
if (!self.designMode) {
val = self.html();
self.designMode = true;
self.html(val);
//self.html(val);
//self.textarea.hide();
//self.iframe.show();
//新加
self.textarea.hide();
self.iframe.show();
self.html(val);
var iframe = self.iframe;
var height = _removeUnit(self.height);
iframe.height(height - 2);
iframe.show();
setTimeout(function() {
iframe.height(height);
}, 0);
}
} else {
if (self.designMode) {
@ -3958,7 +3982,7 @@ _extend(KToolbar, KWidget, {
}else if(!$("#full",container).is(':hidden')){
pdiv = $("#full",container);
}
return (this._itemMap[name] = K('span.ke-icon-' + name, pdiv).parent());
return (this._itemMap[name] = K('span.ke-icon-' + name, this.div).parent());
},
select : function(name) {
_selectToolbar.call(this, name, function(knode) {
@ -4864,6 +4888,11 @@ KEditor.prototype = {
},
loadPlugin : function(name, fn) {
var self = this;
//新加
var _pluginStatus = this._pluginStatus;
if (!_pluginStatus) {
_pluginStatus = this._pluginStatus = {};
}
if (_plugins[name]) {
if (!_isFunction(_plugins[name])) {
setTimeout(function() {
@ -4871,7 +4900,12 @@ KEditor.prototype = {
}, 100);
return self;
}
_plugins[name].call(self, KindEditor);
//_plugins[name].call(self, KindEditor);
//新加
if(!_pluginStatus[name]) {
_plugins[name].call(self, KindEditor);
_pluginStatus[name] = 'inited';
}
if (fn) {
fn.call(self);
}
@ -5510,6 +5544,11 @@ function _create(expr, options) {
_each(_plugins, function(name, fn) {
if (_isFunction(fn)) {
fn.call(editor, KindEditor);
//新加
if (!editor._pluginStatus) {
editor._pluginStatus = {};
}
editor._pluginStatus[name] = 'inited';
}
});
return editor.create();
@ -5772,13 +5811,14 @@ _plugin('core', function(K) {
click : function() {
self.select().exec('formatblock', '<' + key + '>').hideMenu();
//by yk利用html的特性使h1 h2 h3 h4标签之间不能相互包含 并将空的标签去掉
if (key != "p"){
// if (key != "p"){
var val = self.select().html();
self.select().html(val);
self.cmd.doc.body.innerHTML = self.cmd.doc.body.innerHTML.replace(/<p>\s*<\/p>/g,"");
val = self.select().html().replace(/(<h1>\s*<\/h1>)|(<h2>\s*<\/h2>)|(<h3>\s*<\/h3>)|(<h4>\s*<\/h4>)/g,"");
self.select().html(val);
self.select();
}
// }
}
});
});
@ -6059,6 +6099,9 @@ _plugin('core', function(K) {
} else {
cmd.range.selectNodeContents(div[0]);
cmd.select();
//新加
div[0].tabIndex = -1;
div[0].focus();
}
setTimeout(function() {
movePastedData();

View File

@ -27,9 +27,19 @@ KindEditor.plugin('autoheight', function(K) {
var edit = self.edit;
var body = edit.doc.body;
edit.iframe.height(minHeight);
//最高418 超过用滚动条
self.resize(null, Math.max(
(K.IE ? body.scrollHeight : body.offsetHeight)
(K.IE ? body.scrollHeight : body.offsetHeight) > 385 ? 385+33 : (K.IE ? body.scrollHeight : body.offsetHeight)
+ 33, minHeight));
if( self.height == "418px" ){
edit.iframe[0].scroll = 'yes';
body.style.overflowY = 'auto';
}
else{
hideScroll();
}
}
function init() {

View File

@ -42,6 +42,9 @@ KindEditor.plugin('code', function(K) {
yesBtn : {
name : self.lang('yes'),
click : function(e) {
if(/^\s*<\w*\s*\w*\=\"\w*\"\s*\w*\=\"\w*\:\s*\#\d*\;\s*\w*\-\w*\:\s*\w*\;\"\>[\u4e00-\u9fa5]*<\/\w*\>\s*$/.test(self.edit.html())){
self.edit.html('');
}
var type = K('.ke-code-type', dialog.div).val(),
code = textarea.val(),
cls = type === '' ? '' : ' lang-' + type,

View File

@ -46,7 +46,7 @@
.ke-content div.ref .ref_body {margin:0;padding:2px;line-height:20px;color:#666;font-size:9pt;}
.ke-content blockquote {margin:15px 10px;border:2px solid #eee;padding:5px 5px 5px 35px;background:#f4f5f7 url('../img/blockquote.gif') no-repeat left top;color:#060;font-size:9pt;}
.ke-content blockquote {margin:15px 10px;border:2px solid #eee;padding:5px 5px 5px 35px;}
span.at {color:#269ac9;}
span.at a{color:#269ac9;text-decoration: none;}

View File

@ -1353,7 +1353,7 @@ function autoUrl(id){
$("#"+id+" p,#"+ id +" span,#"+id+" em,#"+id+" h1,#"+id+" h2,#"+id+" h3,#"+id+" h4,#"+id+" strong,#"+id+" b,#"+id+" font,#"+id+" i").each(function(){
if ($(this).children().length == 0){
var html = $(this).text();
html = html.replace(/((https?|ftp|news):\/\/)?([a-z]([a-z0-9\-]*[\.。])+(aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel)|(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))(\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(\?[a-z0-9+_\-\.%=&]*)?)?(#[a-z][a-z0-9_]*)?/g,function(full) {
html = html.replace(/((https?|ftp|news):\/\/)?([a-z]([a-z0-9\-]*[\.。])+(aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel|cn)|(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))(\/[A-Za-z0-9_\-\.~]+)*(\?[A-Za-z0-9+_\-\.%=&]*)?(\/([A-Za-z0-9_\-\.]*)(\?[A-Za-z0-9+_\-\.%=&]*)?)?(#[a-z][a-z0-9_]*)?/g,function(full) {
//没有://的都加上http://
var reStr = full;
if (full.length > 0){
@ -1372,7 +1372,7 @@ function autoUrl(id){
}
else{
var html = $("#"+id).text();
html = html.replace(/((https?|ftp|news):\/\/)?([a-z]([a-z0-9\-]*[\.。])+(aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel)|(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))(\/[a-z0-9_\-\.~]+)*(\/([a-z0-9_\-\.]*)(\?[a-z0-9+_\-\.%=&]*)?)?(#[a-z][a-z0-9_]*)?/g,function(full) {
html = html.replace(/((https?|ftp|news):\/\/)?([a-z]([a-z0-9\-]*[\.。])+(aero|arpa|biz|com|coop|edu|gov|info|int|jobs|mil|museum|name|nato|net|org|pro|travel|cn)|(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5]))(\/[A-Za-z0-9_\-\.~]+)*(\?[A-Za-z0-9+_\-\.%=&]*)?(\/([A-Za-z0-9_\-\.]*)(\?[A-Za-z0-9+_\-\.%=&]*)?)?(#[a-z][a-z0-9_]*)?/g,function(full) {
//没有://的都加上http://
var reStr = full;
if (full.length > 0){

View File

@ -152,6 +152,7 @@ a.postTypeGrey:hover {color:#269ac9;}
.homepagePostIntro ul li{list-style-type: disc;margin-left: 40px;}
.homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;}
.homepagePostIntro a{color: #15bccf;}
.homepagePostIntro blockquote{background: none;}
.homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;}
.homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;}
.homepagePostReply {width:710px; margin:0px auto; background-color:#f1f1f1; margin-top:10px;}
@ -194,6 +195,7 @@ a.postOptionLink2:hover {color:#ffffff; background-color:#269ac9;}
.homepagePostReplyContent ul li{list-style-type: disc;margin-left: 20px;}
.homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;}
.homepagePostReplyContent a{color: #15bccf;}
.homepagePostReplyContent blockquote{background: none;}
.table_maxWidth table {max-width: 642px;}
.homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;}
.homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;}
@ -301,6 +303,7 @@ a:hover.talk_btn{ background:#2a9dc1;}
/****讨论区内页***/
.mt0{ margin-top:0px !important;}
.talk_info{ color:#7d7d7d; margin-left:60px; margin-top:10px;}
.talk_info a{ color:#15bccf; }
a.talk_edit{ color:#269ac9; margin-right:5px;}
a:hover.talk_edit{ color:#297fb8;}
.talk_reply { background:#eeeeee; padding:10px; margin-bottom:10px;}
@ -1141,6 +1144,7 @@ a.link_file_a2{ background:url(../images/pic_file.png) 0 -15px no-repeat; paddin
.postDetailDes ul li{list-style-type: disc;margin-left: 40px;}
.postDetailDes td,.postDetailDes tr {border: 1px solid; border-color: inherit;}
.postDetailDes a{color: #15bccf;}
.postDetailDes blockquote{background: none;}
.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; }
.postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;}
.postDetailDate {color:#888888; font-size:12px; float:left;}

View File

@ -683,6 +683,7 @@ a.postTypeGrey:hover {color:#269ac9;}
.homepagePostIntro ul li{list-style-type: disc;margin-left: 40px;}
.homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;}
.homepagePostIntro a{color: #15bccf;}
.homepagePostIntro blockquote{background: none;}
.homepagePostReplyBanner {width:718px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888; position: relative;}
.borderBottomNone {border-bottom:none !important;}
.homepagePostReplyBanner {width:718px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888;}
@ -723,6 +724,7 @@ a.postOptionLink:hover {color:#ffffff; background-color:#269ac9;}
.homepagePostReplyContent ul li{list-style-type: disc;margin-left: 40px;}
.homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;}
.homepagePostReplyContent a{color: #15bccf;}
.homepagePostReplyContent blockquote{background: none;}
.table_maxWidth table {max-width: 642px;}
.homepagePostProjectState {width:52px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;}
.homepagePostAssignTo {float:left; font-size:14px; color:#269ac9;}
@ -868,6 +870,7 @@ a.sortArrowActiveU {background:url(images/post_image_list.png) -17px -20px no-re
.postDetailDes ul li{list-style-type: disc;margin-left: 40px;}
.postDetailDes td,.postDetailDes tr {border: 1px solid; border-color: inherit;}
.postDetailDes a{color: #15bccf;}
.postDetailDes blockquote{background: none;}
.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important; } /*line-height: 18px !important;*/
.postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;}
.postDetailDate {color:#888888; font-size:12px; float:left;}

View File

@ -219,6 +219,7 @@ a:hover.talk_btn{ background:#2a9dc1;}
/****讨论区内页***/
.mt0{ margin-top:0px;}
.talk_info{ margin-left:60px; margin-top:10px;}
.talk_info a{ color:#15bccf; }
/*.issue_desc li{list-style-type: decimal;margin-left: 20px;}*/
.issue_desc ol li{list-style-type: decimal;margin-left: 40px;}
.issue_desc ul li{list-style-type: disc;margin-left: 40px;}
@ -977,6 +978,7 @@ a:hover.Reply_pic{border:1px solid #64bdd9;}
.homepagePostIntro ul li{list-style-type: disc;margin-left: 40px;}
.homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;}
.homepagePostIntro a{color: #15bccf;}
.homepagePostIntro blockquote{background: none;}
.topBorder {
border-top: 1px solid #E4E4E4;
}
@ -1119,6 +1121,7 @@ a:hover.BlueCirBtnMini{ background:#269ac9; color:#fff;}
.postDetailDes ul li{list-style-type: disc;margin-left: 40px;}
.postDetailDes td,.postDetailDes tr {border: 1px solid; border-color: inherit;}
.postDetailDes a{color: #15bccf;}
.postDetailDes blockquote{background: none;}
.homepagePostIntro p,.homepagePostIntro div,.homepagePostIntro em, .homepagePostIntro span{text-align: justify; text-justify:inter-ideograph; word-break: normal !important; word-wrap: break-word !important;}
.postDetailCreater {color:#888888; font-size:12px; float:left; margin-right:25px;}
.postDetailDate {color:#888888; font-size:12px; float:left;}

View File

@ -614,6 +614,7 @@ a.postTypeGrey:hover {color:#269ac9;}
.homepagePostIntro ul li{list-style-type: disc;margin-left: 40px;}
.homepagePostIntro td,.homepagePostIntro tr {border: 1px solid; border-color: inherit;}
.homepagePostIntro a{color: #15bccf;}
.homepagePostIntro blockquote{background: none;}
.homepagePostDeadline {font-size:12px; color:#888888; float:left; margin-top: 2px;}
.homepagePostDate {font-size:12px; color:#888888;margin-bottom: 5px;}
.homepagePostReplyBanner {width:708px; height:33px; border:1px solid #e4e4e4; line-height:33px; vertical-align:middle; font-size:12px; color:#888888; position: relative;}
@ -651,6 +652,7 @@ a.postReplyCancel:hover {color:#ffffff;}
.homepagePostReplyContent ul li{list-style-type: disc;margin-left: 40px;}
.homepagePostReplyContent td,.homepagePostReplyContent tr {border: 1px solid; border-color: inherit;}
.homepagePostReplyContent a{color: #15bccf;}
.homepagePostReplyContent blockquote{background: none;}
.table_maxWidth table {max-width: 642px;}
.homepagePostProjectState {width:42px; height:20px; line-height:20px; border-radius:1px; background-color:#28be6c; color:#ffffff; text-align:center; vertical-align:middle; font-size:12px; display:inline-block; margin-left:5px;}
.homepagePostAssignTo {float:left; font-size:14px; color:#15bccf;}