Browse Source

编辑器提示信息及关键词修改

jack 7 years ago
parent
commit
c3ed54d7e2
3 changed files with 42 additions and 20 deletions
  1. 30 14
      js/articalIssue.js
  2. 5 5
      js/ueditor/lang/zh-cn/zh-cn.js
  3. 7 1
      js/ueditor/ueditor.all.js

+ 30 - 14
js/articalIssue.js

@ -7,6 +7,7 @@ $(function() {
7 7
	var articleId;
8 8
	var fa = false;
9 9
  	var userid = $.cookie("userid");
10
  	var hbur,hburEnd;
10 11
	//校验标题
11 12
	$("#newstitle").on({
12 13
		focus: function() {
@ -31,17 +32,29 @@ $(function() {
31 32
			$("#keyPrompt").text("");
32 33
		},
33 34
		keyup: function() {
34
			if($(this).val()==""){
35
			var ti=$(this).val();
36
			hbur=ti;
37
			if(ti==""){
35 38
				$(".frmadd").addClass("displayNone");
36 39
				$(".keydrop ul").html("");
37 40
				$(".keydrop").addClass("displayNone");
41
				return;
38 42
			}else{
39 43
				$(".frmadd").removeClass("displayNone");
40 44
			}
41 45
			if($(this).val().length > 15) {
42 46
				$(this).val($(this).val().substr(0, 15));
43 47
			}
44
			KeyWordList();
48
			setTimeout(function(){
49
				console.log(ti);
50
				console.log(hbur);
51
				console.log(hburEnd)
52
				if( ti===hbur && ti!== hburEnd) {
53
					KeyWordList(ti);
54
				}
55
				
56
			},500)
57
			
45 58
		}
46 59
	})
47 60

@ -105,7 +118,8 @@ $(function() {
105 118
		}
106 119
	}
107 120
	
108
	function KeyWordList() {
121
	function KeyWordList(seValue) {
122
		hburEnd=seValue;
109 123
		$.ajax({
110 124
			"url": "/ajax/dataDict/qaHotKey",
111 125
			"type": "get",
@ -114,19 +128,21 @@ $(function() {
114 128
			},
115 129
			"success": function(data) {
116 130
				console.log(data);
117
				if(data.success && data.data != "") {
118
					var itemlist = '';
119
					$("#keydropList").html("");
120
					for(var i = 0; i < 5; i++) {
121
						var itemlist = '<li><p class="h2Font"></p></li>';
122
						$itemlist = $(itemlist);
123
						$("#keydropList").append($itemlist);
124
						$itemlist.find(".h2Font").text(data.data[i].caption);
131
				if(data.success) {
132
					if(hburEnd == seValue){
133
						var itemlist = '';
134
						$("#keydropList").html("");
135
						for(var i = 0; i < Math.min(data.data.length,5); i++) {
136
							var itemlist = '<li><p class="h2Font"></p></li>';
137
							$itemlist = $(itemlist);
138
							$("#keydropList").append($itemlist);
139
							$itemlist.find(".h2Font").text(data.data[i].caption);
140
						}
141
						$(".keydrop").removeClass("displayNone");
125 142
					}
126
					$(".keydrop").removeClass("displayNone");
127 143
				} else {
128
					$(".keydrop").addClass("displayNone");
129
					$(".keydrop ul").html("");
144
					//$(".keydrop").addClass("displayNone");
145
					//$(".keydrop ul").html("");
130 146
				}
131 147
			},
132 148
			"error": function() {

+ 5 - 5
js/ueditor/lang/zh-cn/zh-cn.js

@ -69,7 +69,7 @@ UE.I18N['zh-cn'] = {
69 69
    },
70 70
    'autoupload': {
71 71
        'exceedSizeError': '文件大小超出限制',
72
        'exceedTypeError': '文件格式不允许',
72
        'exceedTypeError': '只能上传jpeg/jpg/png/bmp/gif格式的图片',
73 73
        'jsonEncodeError': '服务器返回格式错误',
74 74
        'loading':"正在上传...",
75 75
        'loadError':"上传错误",
@ -77,7 +77,7 @@ UE.I18N['zh-cn'] = {
77 77
    },
78 78
    'simpleupload':{
79 79
        'exceedSizeError': '文件大小超出限制',
80
        'exceedTypeError': '文件格式不允许',
80
        'exceedTypeError': '只能上传jpeg/jpg/png/bmp/gif格式的图片',
81 81
        'jsonEncodeError': '服务器返回格式错误',
82 82
        'loading':"正在上传...",
83 83
        'loadError':"上传错误",
@ -297,7 +297,7 @@ UE.I18N['zh-cn'] = {
297 297
        'errorNotSupport': 'WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。',
298 298
        'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!',
299 299
        'errorExceedSize':'文件大小超出',
300
        'errorFileType':'文件格式不允许',
300
        'errorFileType':'只能上传jpeg/jpg/png/bmp/gif格式的图片',
301 301
        'errorInterrupt':'文件传输中断',
302 302
        'errorUploadRetry':'上传失败,请重试',
303 303
        'errorHttp':'http请求错误',
@ -334,7 +334,7 @@ UE.I18N['zh-cn'] = {
334 334
        'errorNotSupport': 'WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。',
335 335
        'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!',
336 336
        'errorExceedSize':'文件大小超出',
337
        'errorFileType':'文件格式不允许',
337
        'errorFileType':'只能上传jpeg/jpg/png/bmp/gif格式的图片',
338 338
        'errorInterrupt':'文件传输中断',
339 339
        'errorUploadRetry':'上传失败,请重试',
340 340
        'errorHttp':'http请求错误',
@ -420,7 +420,7 @@ UE.I18N['zh-cn'] = {
420 420
        'errorNotSupport': 'WebUploader 不支持您的浏览器!如果你使用的是IE浏览器,请尝试升级 flash 播放器。',
421 421
        'errorLoadConfig': '后端配置项没有正常加载,上传插件不能正常使用!',
422 422
        'errorExceedSize':'文件大小超出',
423
        'errorFileType':'文件格式不允许',
423
        'errorFileType':'只能上传jpeg/jpg/png/bmp/gif格式的图片',
424 424
        'errorInterrupt':'文件传输中断',
425 425
        'errorUploadRetry':'上传失败,请重试',
426 426
        'errorHttp':'http请求错误',

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

@ -23830,6 +23830,7 @@ UE.plugin.register('autoupload', function (){
23830 23830
                if (json.state == 'SUCCESS' && json.url) {
23831 23831
                    successHandler(json);
23832 23832
                } else {
23833
                	alert(1111);
23833 23834
                    errorHandler(json.state);
23834 23835
                }
23835 23836
            }catch(er){
@ -24533,7 +24534,12 @@ UE.plugin.register('simpleupload', function (){
24533 24534
                            loader.removeAttribute('id');
24534 24535
                            domUtils.removeClasses(loader, 'loadingclass');
24535 24536
                        } else {
24536
                            showErrorLoader && showErrorLoader(json.state);
24537
                        	if(json.state=="文件大小超出限制") {
24538
                        		showErrorLoader && showErrorLoader("文件大小不能超过2M");
24539
                        	}else{
24540
                        		showErrorLoader && showErrorLoader(json.state);
24541
                        	}
24542
                            
24537 24543
                        }
24538 24544
                    }catch(er){
24539 24545
                        showErrorLoader && showErrorLoader(me.getLang('simpleupload.loadError'));