AddProperties.jsp
4.85 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
<%@ page language="java" contentType="text/html; charset=UTF-8"%>
<HTML>
<HEAD>
<LINK href="/css/Weaver_wev8.css" type="text/css" rel=STYLESHEET>
<SCRIPT language="javascript" src="/js/weaver_wev8.js"></script>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<script type="text/javascript">
var parentWin = null;
var dialog = null;
try{
parentWin = parent.getParentWindow(window);
dialog = parent.parent.getDialog(window);
}catch(e){}
</script>
<%
//判断只有管理员才有权限
int userid = user.getUID();
if(userid!=1) {
response.sendRedirect("/notice/noright.jsp");
return;
}
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort();
String imagefilename = "/images/hdMaintenance_wev8.gif";
String titlename = "";
String needfav = "1";
String needhelp = "";
String menuTitle = "";
String message = request.getParameter("message");
%>
<%@ include file="/systeminfo/TopTitle_wev8.jsp" %>
<%@ include file="/systeminfo/RightClickMenuConent_wev8.jsp" %>
<%
RCMenu += "{"+SystemEnv.getHtmlLabelName(83413,user.getLanguage())+",javascript:onSubmit(),_self} " ;
RCMenuHeight += RCMenuHeightStep ;
String pathgroupname = SystemEnv.getHtmlLabelNames("18493,18499",user.getLanguage());
%>
<%@ include file="/systeminfo/RightClickMenu_wev8.jsp" %>
</HEAD>
<BODY style="overflow:hidden;">
<jsp:include page="/systeminfo/commonTabHead.jsp">
<jsp:param name="mouldID" value="upgrade" />
<jsp:param name="navName" value="新建Properties文件" />
</jsp:include>
<table id="topTitle" cellpadding="0" cellspacing="0">
<tr>
<td></td>
<td class="rightSearchSpan" style="text-align:right; width:500px!important">
<span id="advancedSearch" class="advancedSearch" style='display:none;'><%=SystemEnv.getHtmlLabelName(21995 ,user.getLanguage()) %></span>
<span title="<%=SystemEnv.getHtmlLabelName(23036 ,user.getLanguage()) %>" class="cornerMenu"></span>
</td>
</tr>
</table>
<div id="tabDiv" >
<span style="font-size:14px;font-weight:bold;"></span>
</div>
<div class="cornerMenuDiv"></div>
<div class="advancedSearchDiv" id="advancedSearchDiv" style='display:none;'></div>
<form name="frmAdd" method="post" action="AddPropertiesOperation.jsp">
<wea:layout>
<wea:group context="<%=pathgroupname%>">
<wea:item><%=SystemEnv.getHtmlLabelNames("18493,18499",user.getLanguage())%></wea:item>
<wea:item>
<wea:required id="pathimage" required="true">
<input class="inputstyle" name="path" id="path" value="" onchange='checkinput("path","pathimage")'></input>
</wea:required>
<input type="button" style="width:100%;max-width:120px!important;" class="e8_btn_top" value="<%=SystemEnv.getHtmlLabelName(83413,user.getLanguage())%>" onclick="onSubmit()"/>
</wea:item>
</wea:group>
<wea:group context="Properties内容">
<wea:item attributes="{colspan:'full',id:'tableitem'}">
<textarea id="contentarea" name="contentarea" style="width:100%!important;overflow:auto;"></textarea>
</wea:item>
</wea:group>
</wea:layout>
</form>
</div>
</BODY>
</HTML>
<script type="text/javascript">
$(document).ready(function(){
jQuery('#menu_content').perfectScrollbar();
jQuery("#topTitle").topMenuTitle();
jQuery(".topMenuTitle td:eq(0)").html($("#tabDiv").html());
jQuery("#tabDiv").remove();
$("#tableitem").removeClass("fieldName");
var docheight = $(document).height();
var areaheight = docheight*0.8;
$("#contentarea").height(areaheight);
});
function onSubmit() {
var path = $("#path").val();
if(path=="") {
top.Dialog.alert("<%=SystemEnv.getHtmlLabelNames("18493,18499",user.getLanguage())%><%=SystemEnv.getHtmlLabelName(18622,user.getLanguage())%>");
return;
}
if(path.indexOf(".properties") <= 0) {
top.Dialog.alert("非Properties文件");
return;
}
$.ajax({
url:"AddPropertiesOperation.jsp",
dataType:"json",
type:"post",
data:{
"path":$("#path").val(),
"contentarea":$("#contentarea").val(),
},
success:function(data){
var res = data.message;
if(res=="1") {
top.Dialog.alert("<%=SystemEnv.getHtmlLabelName(25021,user.getLanguage())%>");
return;
} else if(res=="2") {
top.Dialog.alert("<%=SystemEnv.getHtmlLabelName(82259,user.getLanguage())%>");
return;
} else if(res=="error") {
top.Dialog.alert("<%=SystemEnv.getHtmlLabelName(18493,user.getLanguage())%><%=SystemEnv.getHtmlLabelName(82259,user.getLanguage())%>");
return;
} else if(res=="ok") {
top.Dialog.alert("<%=SystemEnv.getHtmlLabelName(125,user.getLanguage())%><%=SystemEnv.getHtmlLabelName(25008,user.getLanguage())%>");
window.location.href="EditProperties.jsp?from=add&fpath="+$("#path").val();
return;
}
}
});
}
//屏蔽回车事件
$(document).keydown(function(event){
switch(event.keyCode){
case 13:return false;
}
});
</script>