Browse Source

资源发布,修改添加编辑器

xuchunyang 8 years ago
parent
commit
38f4f52aee
5 changed files with 37 additions and 17 deletions
  1. 1 1
      css/webuploader/webuploader.css
  2. 15 7
      js/newsciresource.js
  3. 15 5
      js/popup.js
  4. 2 2
      newsciresource.html
  5. 4 2
      workspaces.html

+ 1 - 1
css/webuploader/webuploader.css

@ -43,7 +43,7 @@
43 43
    height: 240px;
44 44
}
45 45
#uploader  .thumbnail img {
46
   width:100%;
46
       height: 230px;
47 47
}
48 48
.uploader-list {
49 49
    width: 100%;

+ 15 - 7
js/newsciresource.js

@ -2,6 +2,7 @@
2 2

3 3
$(function(){
4 4
	//alert("sciresouser");
5
	//var ue;
5 6
	
6 7
	var userid = $.cookie("userid");
7 8
	var name = $.cookie("userName");
@ -90,9 +91,10 @@ $(function(){
90 91
	}
91 92
//我的资源的删除,修改
92 93
	$("#workmysrc").on("click",".resoumag",function()
93
			{ 		
94
			{ 	
95
				//初始引用编辑器
94 96
				ResourceInfo();
95
				addDele()
97
				addDele();
96 98
				$(".limitBox").removeClass("limitBox");
97 99
		        $(".limitwords").removeClass("limitwords");
98 100
		        $(".limitwordbox").removeClass("limitwordbox");
@ -134,8 +136,11 @@ $(function(){
134 136
								$("#hopePayMethod").val(info.data.hopePayMethod) ;
135 137
								$("#cooperationNotes").val(info.data.cooperationNotes) ;
136 138
								industryShow(info.data.subject,"SubjectList","deleteSubject");
137
								 industryShow(info.data.industry,"industryList","deleteIndustry");								
138
								$("#descp").val(info.data.descp);
139
								industryShow(info.data.industry,"industryList","deleteIndustry");	
140
							    ue.ready(function() {
141
							        ue.setContent(info.data.descp);
142
							    });
143

139 144
								$("#professor").text(name);
140 145
								if(info.data.images.length) {
141 146
															 var $liMages = $(
@ -188,7 +193,7 @@ $(function(){
188 193
								$data.cooperationNotes = $("#cooperationNotes").val();
189 194
								$data.subject=captiureSubInd("SubjectList .deleteSubject");
190 195
								$data.industry=captiureSubInd("industryList .deleteIndustry");
191
								$data.descp=$("#descp").val();								
196
								$data.descp=ue.getContent();	
192 197
								if(cacheImageKey){
193 198
									console.log(cacheImageKey);
194 199
									$data.fn=cacheImageKey;
@ -198,13 +203,15 @@ $(function(){
198 203
									$data.resourceId = resourceID;
199 204
									
200 205
								}
206
								console.log($data);
201 207
								function getDataput(){		
202 208
									$.ajax({"url" : "ajax/resource/updateResource",
203 209
										"type" :  "post" ,
204 210
										"success" : function(rdata) {
205 211
											console.log(rdata);
206 212
											if (rdata.success){													
207
													getDataResource();						
213
													getDataResource();	
214
													UE.delEditor('editor');
208 215
											} else {
209 216
												$.MsgBox.Alert("消息","资源发布失败");
210 217
											}
@ -236,7 +243,8 @@ $(function(){
236 243
													$(".blackcover").remove();
237 244
													$("body").css("position","static");												
238 245
													getDataResource();
239
													$.MsgBox.Alert("消息","资源发布成功");										
246
													$.MsgBox.Alert("消息","资源发布成功");	
247
													UE.delEditor('editor');
240 248
											} 
241 249
											else 
242 250
											{

+ 15 - 5
js/popup.js

@ -11,7 +11,7 @@ function ResourceInfo() {
11 11
		PopHtml += '<div class="resoutit">资源信息<div class="stateinfor"><em></em><span>申请</span></div></div>';
12 12
		PopHtml += '<div class="resoubox">';
13 13
		//资源信息
14
		PopHtml += '<table class="resoutab floatL"><tr>';
14
		PopHtml += '<div><table class="resoutab floatL"><tr>';
15 15
		PopHtml += '<th class="resouinfotype" scope="row">资源名称</th>';
16 16
		PopHtml += '<td><div class="resouinforcon"><input type="text" class="frmtype" id="resourceName" ><span class="requiredcon">*</span></div></td>';
17 17
		PopHtml += '</tr>';
@ -25,10 +25,13 @@ function ResourceInfo() {
25 25
		PopHtml += '<tr><th class="resouinfotype"  scope="row">应用行业</th><td><div class="resouinforcon" id="resouinforcon"><input type="text" class="frmtype" id="industry"><input type="button" value="添加" class="addIndusry" id="industryAdd"></div></td></tr>'; 	
26 26
		PopHtml += '<tr><th></th><td><div class="addlist" id="industryList"></div></td></tr>';
27 27
		//PopHtml += '<tr><th class="resouinfotype"  scope="row">期望付款方式</th><td><div class="resouinforcon"><input type="text" class="frmtype" placeholder="例:一次性付款"  id="hopePayMethod"></div></td></tr>';
28
		PopHtml += '<tr class="limitBox"><th class="resouinfotype"  scope="row">详细描述</th><td class="limitwordbox"><div class="resouinforcon limitwords"><textarea class="frmtype" id="descp"></textarea></div></td></tr>';
29 28
		PopHtml += '<tr class="limitBox"><th class="resouinfotype" scope="row">合作备注</th><td class="limitwordbox"><div class="resouinforcon limitwords"><textarea class="frmtype" id="cooperationNotes"></textarea></div></td></tr>';
29
		//PopHtml += '<tr class="limitBox"><th class="resouinfotype"  scope="row">详细描述</th><td class="limitwordbox"><div class="resouinforcon limitwords"><textarea class="frmtype" id="descp"></textarea></div></td></tr>';
30
		//PopHtml += '<tr class="limitBox"><th class="resouinfotype"  scope="row">详细描述</th><td class="limitwordbox"></td></tr>';
30 31
		PopHtml +='</table>';
31 32
		
33
		
34
		
32 35
		/////////////资源图片上传////////////////////
33 36
		//图像
34 37
		PopHtml +='<div class="resouimgbox resouimgboxadd floatL">';
@ -40,7 +43,8 @@ function ResourceInfo() {
40 43
		PopHtml += '<div id="fileList" class="uploader-list"></div>';
41 44
		PopHtml += '<div id="filePicker">选择图片</div></div>';
42 45
		PopHtml += '<span class="resouimgmsg">尺寸240*240,大小在5M以内,<br/>JPG、PNG格式</span>';
43
		PopHtml += '</div></div>';
46
		PopHtml += '</div></div></div>';
47
		PopHtml +='<div style="clear: both;padding:15px 0 10px 0;overflow: hidden;"><span class="resouinfotype" style="display: block;float: left;">详细描述</span><script id="editor" name="content" type="text/plain" style="width:550px; height:200px;float: left;margin-left: 30px;"></script></div>';
44 48
		/////////////资源图片上传 结束////////////////////
45 49
		
46 50
		//按钮盒子
@ -66,7 +70,12 @@ function ResourceInfo() {
66 70
		//必须先将html添加到body,再设置Css样式
67 71
		$("body").prepend(PopHtml);
68 72
        $("body").css("position","fixed");
69
      //上传资源图像的hover
73
        //初始引用编辑器
74
        ue = UE.getEditor('editor', {
75
		  // lang:"zh-cn"
76
		});
77
		         
78
        //上传资源图像的hover
70 79
        // $(".resouimg").hover(function(){
71 80
        // 	$(".resouup").animate({
72 81
        // 		"bottom": "0px"
@ -95,7 +104,8 @@ function ResourceInfo() {
95 104
		$(".workclose").click(function(){
96 105
			$(".blackcover").remove();
97 106
			$("body").css("position","static");
98
		});
107
			UE.delEditor('editor');
108
 		});
99 109
		
100 110
		function resourceName()
101 111
		{

+ 2 - 2
newsciresource.html

@ -11,9 +11,9 @@
11 11
            	
12 12
            </div>
13 13
        </div>
14
       
14
   
15 15
    </div>
16 16
</div>
17
<!--科研资源  // -->
18 17

18
<!--科研资源  // -->
19 19
<script type="text/javascript" src="js/newsciresource.js"></script>

+ 4 - 2
workspaces.html

@ -103,7 +103,11 @@
103 103
        <a class="beianbox" target="_black" rel="nofollow" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11010802022306"><span class="beian-icon"></span> 京公网安备11010802022306号</a>
104 104
    </div>
105 105
</div>
106
<script type="text/javascript" src="js/jquery-1.11.1.js"></script>
107
<script type="text/javascript" charset="utf-8" src="js/ueditor/ueditor.config.js"></script>
108
<script type="text/javascript" charset="utf-8" src="js/ueditor/ueditor.all.js"> </script>
106 109
<script type="text/javascript">
110

107 111
	//下拉菜单
108 112
	function showSelect(obj1,obj2,attrPa){
109 113
	    $("."+ obj2).css("display","block"); 
@ -133,8 +137,6 @@
133 137

134 138
</script>
135 139

136

137
<script type="text/javascript" src="js/jquery-1.11.1.js"></script>
138 140
<script src="//apps.bdimg.com/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
139 141
<script type="text/javascript" src="js/common.js"></script>
140 142
<script type="text/javascript" src="js/webuploader/webuploader.js"></script>