Przeglądaj źródła

回答编辑框

luyanan 7 lat temu
rodzic
commit
2f9b1aa6e7
9 zmienionych plików z 46 dodań i 14 usunięć
  1. 5 3
      css/genindex.css
  2. 1 1
      e/wen.html
  3. 7 0
      js/common.js
  4. 1 1
      js/discover.js
  5. 5 0
      js/public/shareCom.js
  6. 22 6
      js/qa-show.js
  7. 1 1
      js/ueditor/ueditor.all.js
  8. 2 2
      js/userInforShow.js
  9. 2 0
      qa-show.html

+ 5 - 3
css/genindex.css

@ -701,7 +701,7 @@ div.zoomMask{position:absolute;background:url("../images/g-resource-mask.png") r
701 701
.navconBox .rightbtn .foldtr {top: 26px;right:32px;}
702 702
.navconBox .rightbtn .foldtr:before{border-top-color:#666;}
703 703
.navconBox>ul{position: relative}
704
.navconBox>ul>li{position:relative;float: left;padding:20px 0;cursor:pointer;margin-right:60px;font-size: 16px;color: #999;}
704
.navconBox>ul>li{position:relative;float: left;padding:20px 0;cursor:pointer;margin-right:50px;font-size: 16px;color: #999;}
705 705
.navconBox>ul>li:last-child{margin-right: 0;}
706 706
.navconBox>ul>li>.counts{font-size: 15px;}
707 707
.navconBox>ul>li.liNow:after{position: absolute;left: 0;bottom: 0;content:"";height:3px;background:#000;width: 100%;}
@ -886,7 +886,9 @@ div.zoomMask{position:absolute;background:url("../images/g-resource-mask.png") r
886 886
.qa-owner .owner-info{padding-left:38px;}
887 887
.owner-name{float: left;font-size:16px;color: #333;}
888 888
.owner-tit{font-size:14px;margin-left:10px;float: left;max-width:90%;color:#888888}
889
.qa-con{font-size:15px;line-height: 22px;color:#333;text-align: justify;margin-top: 10px;}
889
.qa-con{font-size:15px;line-height: 22px;color:#333;margin-top: 10px;}
890
.qa-con>p{margin-bottom: 10px;text-align: justify;}
891
.qa-con img{width:100%;}
890 892
.showspan{overflow: hidden;margin-top:10px;}
891 893
.showspan>span{padding-right:10px;font-size: 14px;color:#999;}
892 894
@ -931,7 +933,7 @@ div.zoomMask{position:absolute;background:url("../images/g-resource-mask.png") r
931 933
.list-hold .owner-name{float: none;}
932 934
.list-hold .owner-tit{display:block;float:none;color:#888888;max-width:100%;margin-left: 0;line-height: 22px;}
933 935
.list-hold .qa-con{line-height: 24px;word-break: break-word;}
934
.list-hold .msgContbox textarea{min-height:240px;margin: 0;}
936
/*.list-hold .msgContbox textarea{min-height:240px;margin: 0;}*/
935 937
.list-hold .buttonbox{text-align: right;margin:14px 0}
936 938
.list-hold .buttonbox .btnModel{width:84px;}
937 939

+ 1 - 1
e/wen.html

@ -222,7 +222,7 @@
222 222
						liStr.className = "mui-table-view-cell";
223 223
						liStr.innerHTML = '<div class="madiaInfo">' +
224 224
							'<div class="flexCenter qa-owner"></div>' +
225
							'<p class="qa-con mui-ellipsis-5">' + (dataStr.cnt).replace(/\n/g,"<br />") + '</p>' +
225
							'<div class="qa-con mui-ellipsis-5">' + listConCut(dataStr.cnt) + '</div>' +
226 226
							'<div class="showliSpan mui-ellipsis">' +
227 227
							'<span>' + commenTime(dataStr.createTime) + '</span>' + hd + '<span class="leaveMsgCount"></span>' +
228 228
							'</div>' +

+ 7 - 0
js/common.js

@ -305,6 +305,13 @@ function changeTime(dealtime) {
305 305
	}
306 306

307 307
}
308

309
function listConCut(str){//**回答内容过滤html标签**//
310
	var regTag =/<\/?[a-zA-Z]+[^><]*?>/g;
311
	var strTo=str.replace(/<img(.*?)>/g, "[图片]").replace(regTag,"")
312
	return strTo
313
}
314

308 315
//******过滤特殊字符*******//
309 316
function replaceStr(s) {
310 317
	var pattern = new RegExp("-");

+ 1 - 1
js/discover.js

@ -716,7 +716,7 @@ $(function() {
716 716
            '<div class="ellipsisSty qa-question"></div>' +
717 717
            '<div class="flexCenter qa-owner">' +
718 718
            '</div>' +
719
            '<p class="qa-con ellipsisSty-3">' + (dataStr.cnt).replace(/\n/g,"<br />") +'</p>' +
719
            '<div class="qa-con ellipsisSty-3">' + listConCut(dataStr.cnt) +'</div>' +
720 720
            '<div class="showspan">' +
721 721
            '<span>'+commenTime(dataStr.createTime)+'</span>' +
722 722
            '<span class="agree"></span>' +

+ 5 - 0
js/public/shareCom.js

@ -1,6 +1,11 @@
1 1
var wlogurl="http://192.168.3.233:8080"
2 2
//var wlogurl="http://www.ekexiu.com:8082";
3 3

4
function listConCut(str){//**回答内容过滤html标签**//
5
	var regTag =/<\/?[a-zA-Z]+[^><]*?>/g;
6
	var strTo=str.replace(/<img(.*?)>/g, "[图片]").replace(regTag,"")
7
	return strTo
8
}
4 9
function GetQueryString(name) {
5 10
	var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
6 11
	var r = window.location.search.substr(1).match(reg);

+ 22 - 6
js/qa-show.js

@ -237,7 +237,9 @@ $(function() {
237 237
				//点击马上抢答
238 238
				 $("#curAnswers").parent().find(".nowAn").on('click', function() {
239 239
					if(userid && userid != null && userid != "null") {
240
						goAnswerFn($(".answerQu"))
240
						if($(".answerQu").is(':hidden')){
241
							goAnswerFn($(".answerQu"))
242
						}
241 243
					}else{
242 244
						quickLog();
243 245
						operatTab();
@ -368,7 +370,7 @@ $(function() {
368 370
			
369 371
			liStr.innerHTML = '<div class="madiaInfo answerInfo">' +
370 372
				'<div class="flexCenter qa-owner"></div>' +
371
				'<p class="qa-con">' + (dataStr.cnt).replace(/\n/g,"<br />") + '</p>' +
373
				'<div class="qa-con">' + dataStr.cnt + '</div>' +
372 374
				'<div class="item_info"><span class="time">' + time + '</span></div>'+
373 375
				operatStr+
374 376
				'</div>'+
@ -388,22 +390,32 @@ $(function() {
388 390
		goAnswerFn=function(objN,anid,text,aflag){
389 391
			var dataStr={},typeUrl="",tip="";
390 392
			var str='<div class="madiaInfo"><div class="flexCenter qa-owner"></div></div>'+
391
					'<div class="msgContbox"><textarea class="frmcontype msgCont quCNT" placeholder="请填写回答内容..."></textarea></div>'+
393
					'<script id="editor" name="content" type="text/plain" style="height:240px"></script>'+
392 394
					'<div class="buttonbox">'+
393 395
						'<button type="button" class="frmcontype btnModel fontLink">取消</button>'+
394 396
						'<button type="button" class="frmcontype btnModel saveGo">保存</button>'+
395 397
					'</div>'
396 398
			objN.html(str);
399
			var ue = UE.getEditor('editor', {//初始引用编辑器
400
			    toolbars: [
401
			        [ 'undo', 'redo', '|','spechars', '|', 'simpleupload','link']
402
			    ],
403
			    autoHeightEnabled: true,
404
			    autoFloatEnabled: true
405
			});
397 406
			proinfo(userid,objN);
407
			
398 408
			if(aflag){
399 409
				objN.show();
400
				objN.find(".quCNT").val(text)
410
				ue.ready(function() {
411
			        ue.setContent(text);
412
			    });
401 413
				objN.parents(".list-qa").find(".answerInfo").hide()
402 414
			}else{
403 415
				objN.slideDown(300);
404 416
			}
405 417
			objN.find(".buttonbox").on("click",".saveGo",function(){
406
				var conV=objN.find(".quCNT").val();
418
				var conV=ue.getContent();
407 419
				if(conV.length<10) {
408 420
					$.MsgBox.Alert("提示", "回答不得少于10个字");
409 421
					return;
@ -434,6 +446,7 @@ $(function() {
434 446
					}else{
435 447
						objN.slideUp(300);	
436 448
					}
449
					ue.destroy();
437 450
					objN.html("");
438 451
					$.MsgBox.Alert("提示", tip);
439 452
					$("#mb_msgicon").css("background", 'url("images/sign_icon_chenggong_nor.png") 0% 0% / contain');
@ -448,6 +461,7 @@ $(function() {
448 461
				}else{
449 462
					objN.slideUp(300);	
450 463
				}
464
				ue.destroy();
451 465
				objN.html("");
452 466
			})
453 467
		},
@ -841,7 +855,9 @@ $(function() {
841 855
		var can = this.getAttribute("data-can");
842 856
		if(userid && userid != null && userid != "null") {
843 857
			if(can=="1") {
844
				goAnswerFn($(".answerQu"))
858
				if($(".answerQu").is(':hidden')){
859
					goAnswerFn($(".answerQu"))
860
				}
845 861
			} else if(can=="2") {
846 862
				var anid= this.getAttribute("data-anid");
847 863
				oAjax("/ajax/question/answer/unDel", {

+ 1 - 1
js/ueditor/ueditor.all.js

@ -21928,7 +21928,7 @@ UE.plugins['tablesort'] = function () {
21928 21928

21929 21929
UE.plugins['contextmenu'] = function () {
21930 21930
    var me = this;
21931
    me.setOpt('enableContextMenu',true);
21931
    me.setOpt('enableContextMenu',false);
21932 21932
    if(me.getOpt('enableContextMenu') === false){
21933 21933
        return;
21934 21934
    }

+ 2 - 2
js/userInforShow.js

@ -61,7 +61,6 @@ $(function() {
61 61
		getPatent(10,1,true);//获取个人发布的专利
62 62
		getDemands(5,1,true);//获取个人发布的需求
63 63
		attentCount();
64
		collAttent(10,1,true);
65 64
        getMyAnswer(professorId,true);//获取个人的回答
66 65
		if(userid!=professorId){
67 66
			liulanAdd();
@ -77,6 +76,7 @@ $(function() {
77 76
			watchType=0;
78 77
			attentMy();
79 78
		}else{
79
			collAttent(10,1,true);
80 80
            getMyQuestion(userid,true);//获取个人的提问
81 81
			$(".goSpanTo").show();
82 82
			$(".myoneself").show();
@ -2086,7 +2086,7 @@ $(function() {
2086 2086
            '<div class="ellipsisSty qa-question"></div>' +
2087 2087
            '<div class="flexCenter qa-owner">' +
2088 2088
            '</div>' +
2089
            '<p class="qa-con ellipsisSty-3">' + (dataStr.cnt).replace(/\n/g,"<br />") +'</p>' +
2089
            '<div class="qa-con ellipsisSty-3">' + listConCut(dataStr.cnt) +'</div>' +
2090 2090
            '<div class="showspan">' +
2091 2091
            '<span>'+commenTime(dataStr.createTime)+'</span>' +
2092 2092
            '<span class="agree"></span>' +

+ 2 - 0
qa-show.html

@ -195,6 +195,8 @@
195 195
<script type="text/javascript" src="js/jquery.cookie.js"></script>
196 196
<script type="text/javascript" src="js/jquery.similar.msgbox.js"></script>
197 197
<script type="text/javascript" src="js/weixinshare/qrcode.min.js"></script>
198
<script type="text/javascript" src="js/ueditor/ueditor.config.js"></script>
199
<script type="text/javascript" src="js/ueditor/ueditor.all.js"> </script>
198 200
<script type="text/javascript" src="js/jquery.page.js"></script>
199 201
<script type="text/javascript" src="js/common.js"></script>
200 202
<script type="text/javascript" src="js/answerLeaveW.js"></script>