sys.js 9.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394
  1. var locat = (window.location+'').split('/');
  2. $(function(){if('head'== locat[3]){locat = locat[0]+'//'+locat[2];}else{locat = locat[0]+'//'+locat[2]+'/'+locat[3];};});
  3. $(top.hangge());
  4. //=======================================配置NO4
  5. //====================上传登录背景音乐=================
  6. $(document).ready(function(){
  7. $("#uploadify2").uploadify({
  8. 'buttonImg' : locat+"/static/images/fileup.png",
  9. 'uploader' : locat+"/plugins/uploadify/uploadify.swf",
  10. 'script' : locat+"/plugins/uploadify/uploadFile.jsp;jsessionid="+jsessionid,
  11. 'cancelImg' : locat+"/plugins/uploadify/cancel.png",
  12. 'folder' : locat+"/static/login/music",//上传文件存放的路径,请保持与uploadFile.jsp中PATH的值相同
  13. 'queueId' : "fileQueue",
  14. 'queueSizeLimit' : 1,//限制上传文件的数量
  15. //'fileExt' : "*.rar,*.zip",
  16. //'fileDesc' : "RAR *.rar",//限制文件类型
  17. 'fileExt' : '*.mp3',
  18. 'fileDesc' : 'Please choose(.mp3)',
  19. 'auto' : false,
  20. 'multi' : true,//是否允许多文件上传
  21. 'simUploadLimit': 1,//同时运行上传的进程数量
  22. 'buttonText': "files",
  23. 'scriptData': {'uploadPath':'/static/login/music/','fileNmae':'fh1.mp3'},//这个参数用于传递用户自己的参数,此时'method' 必须设置为GET, 后台可以用request.getParameter('name')获取名字的值
  24. 'method' : "GET",
  25. 'onComplete':function(event,queueId,fileObj,response,data){
  26. },
  27. 'onAllComplete' : function(event,data) {
  28. $("#Form4").submit();
  29. $("#zhongxin").hide();
  30. $("#zhongxin2").show();
  31. },
  32. 'onSelect' : function(event, queueId, fileObj){
  33. $("#hasTp4").val("ok");
  34. }
  35. });
  36. });
  37. //====================上传登录背景音乐=================
  38. function save4(){
  39. if($("#Token").val()==""){
  40. $("#Token").tips({
  41. side:3,
  42. msg:'Token(令牌)',
  43. bg:'#AE81FF',
  44. time:3
  45. });
  46. $("#Token").focus();
  47. return false;
  48. }
  49. if("ok" == $("#hasTp4").val()){
  50. $('#uploadify2').uploadifyUpload();
  51. }else{
  52. $("#Form4").submit();
  53. $("#zhongxin").hide();
  54. $("#zhongxin2").show();
  55. }
  56. }
  57. //注册开关
  58. function openZc(){
  59. if("no" == $("#isZhuce").val()){
  60. $("#isZhuce").val('yes');
  61. }else{
  62. $("#isZhuce").val('no');
  63. }
  64. }
  65. //背景音乐
  66. function openMu(){
  67. if("no" == $("#isMusic").val()){
  68. $("#isMusic").val('yes');
  69. }else{
  70. $("#isMusic").val('no');
  71. }
  72. }
  73. //=======================================配置NO3
  74. function save3(){
  75. if($("#WIMIP").val()==""){
  76. $("#WIMIP").tips({
  77. side:3,
  78. msg:'请输入地址',
  79. bg:'#AE81FF',
  80. time:3
  81. });
  82. $("#WIMIP").focus();
  83. return false;
  84. }
  85. if($("#WIMPORT").val()==""){
  86. $("#WIMPORT").tips({
  87. side:3,
  88. msg:'请输入端口',
  89. bg:'#AE81FF',
  90. time:3
  91. });
  92. $("#WIMPORT").focus();
  93. return false;
  94. }
  95. if($("#VIDEOIP").val()==""){
  96. $("#VIDEOIP").tips({
  97. side:3,
  98. msg:'请输入地址',
  99. bg:'#AE81FF',
  100. time:3
  101. });
  102. $("#VIDEOIP").focus();
  103. return false;
  104. }
  105. if($("#VIDEOPORT").val()==""){
  106. $("#VIDEOPORT").tips({
  107. side:3,
  108. msg:'请输入端口',
  109. bg:'#AE81FF',
  110. time:3
  111. });
  112. $("#VIDEOPORT").focus();
  113. return false;
  114. }
  115. if($("#OLIP").val()==""){
  116. $("#OLIP").tips({
  117. side:3,
  118. msg:'请输入地址',
  119. bg:'#AE81FF',
  120. time:3
  121. });
  122. $("#OLIP").focus();
  123. return false;
  124. }
  125. if($("#OLPORT").val()==""){
  126. $("#OLPORT").tips({
  127. side:3,
  128. msg:'请输入端口',
  129. bg:'#AE81FF',
  130. time:3
  131. });
  132. $("#OLPORT").focus();
  133. return false;
  134. }
  135. $("#Form3").submit();
  136. $("#zhongxin").hide();
  137. $("#zhongxin2").show();
  138. }
  139. //设置站内信声音提示类型
  140. function setFHsmsSoundType(type){
  141. $("#FHsmsSound").val(type);
  142. if('0' != type){
  143. $("#fhsmsobjsys").html('<audio style="display: none;" id="fhsmstsy" src="static/sound/'+type+'.mp3" autoplay controls></audio>');
  144. }
  145. }
  146. //=======================================配置NO2
  147. //清除空格
  148. String.prototype.trim=function(){
  149. return this.replace(/(^\s*)|(\s*$)/g,'');
  150. };
  151. //====================上传水印图片=================
  152. $(document).ready(function(){
  153. $("#uploadify1").uploadify({
  154. 'buttonImg' : locat+"/plugins/uploadify/uploadp.png",
  155. 'uploader' : locat+"/plugins/uploadify/uploadify.swf",
  156. 'script' : locat+"/plugins/uploadify/uploadFile.jsp;jsessionid="+jsessionid,
  157. 'cancelImg' : locat+"/plugins/uploadify/cancel.png",
  158. 'folder' : locat+"/uploadFiles/uploadImgs",//上传文件存放的路径,请保持与uploadFile.jsp中PATH的值相同
  159. 'queueId' : "fileQueue",
  160. 'queueSizeLimit' : 1,//限制上传文件的数量
  161. //'fileExt' : "*.rar,*.zip",
  162. //'fileDesc' : "RAR *.rar",//限制文件类型
  163. 'fileExt' : '*.jpg;*.gif;*.png',
  164. 'fileDesc' : 'Please choose(.JPG, .GIF, .PNG)',
  165. 'auto' : false,
  166. 'multi' : true,//是否允许多文件上传
  167. 'simUploadLimit': 1,//同时运行上传的进程数量
  168. 'buttonText': "files",
  169. 'scriptData': {'uploadPath':'/uploadFiles/uploadImgs/','fileNmae':'watermark.png'},//这个参数用于传递用户自己的参数,此时'method' 必须设置为GET, 后台可以用request.getParameter('name')获取名字的值
  170. 'method' : "GET",
  171. 'onComplete':function(event,queueId,fileObj,response,data){
  172. $("#imgUrl").val(response.trim());
  173. },
  174. 'onAllComplete' : function(event,data) {
  175. $("#Form2").submit();
  176. $("#zhongxin").hide();
  177. $("#zhongxin2").show();
  178. },
  179. 'onSelect' : function(event, queueId, fileObj){
  180. $("#hasTp1").val("ok");
  181. }
  182. });
  183. });
  184. //====================上传图片=================
  185. function save2(){
  186. if($("#fcontent").val()==""){
  187. $("#fcontent").tips({
  188. side:3,
  189. msg:'输入水印文字内容',
  190. bg:'#AE81FF',
  191. time:3
  192. });
  193. $("#fcontent").focus();
  194. return false;
  195. }
  196. if($("#fontSize").val()==""){
  197. $("#fontSize").tips({
  198. side:3,
  199. msg:'输入字号',
  200. bg:'#AE81FF',
  201. time:3
  202. });
  203. $("#fontSize").focus();
  204. return false;
  205. }
  206. if($("#fontX").val()==""){
  207. $("#fontX").tips({
  208. side:3,
  209. msg:'输入X坐标',
  210. bg:'#AE81FF',
  211. time:3
  212. });
  213. $("#fontX").focus();
  214. return false;
  215. }
  216. if($("#fontY").val()==""){
  217. $("#fontY").tips({
  218. side:3,
  219. msg:'输入Y坐标',
  220. bg:'#AE81FF',
  221. time:3
  222. });
  223. $("#fontY").focus();
  224. return false;
  225. }
  226. if($("#imgX").val()==""){
  227. $("#imgX").tips({
  228. side:3,
  229. msg:'输入X坐标',
  230. bg:'#AE81FF',
  231. time:3
  232. });
  233. $("#imgX").focus();
  234. return false;
  235. }
  236. if($("#imgY").val()==""){
  237. $("#imgY").tips({
  238. side:3,
  239. msg:'输入Y坐标',
  240. bg:'#AE81FF',
  241. time:3
  242. });
  243. $("#imgY").focus();
  244. return false;
  245. }
  246. if("ok" == $("#hasTp1").val()){
  247. $('#uploadify1').uploadifyUpload();
  248. }else{
  249. $("#Form2").submit();
  250. $("#zhongxin").hide();
  251. $("#zhongxin2").show();
  252. }
  253. }
  254. //文字水印开关
  255. function openThis1(){
  256. if(document.getElementsByName('fcheckbox')[0].checked){
  257. $("#isCheck1").val('yes');
  258. }else{
  259. $("#isCheck1").val('no');
  260. }
  261. }
  262. //图片水印开关
  263. function openThis2(){
  264. if(document.getElementsByName('fcheckbox')[1].checked){
  265. $("#isCheck2").val('yes');
  266. }else{
  267. $("#isCheck2").val('no');
  268. }
  269. }
  270. //=======================================配置NO1
  271. //保存
  272. function save(){
  273. if($("#YSYNAME").val()==""){
  274. $("#YSYNAME").tips({
  275. side:3,
  276. msg:'输入系统名称',
  277. bg:'#AE81FF',
  278. time:3
  279. });
  280. $("#YSYNAME").focus();
  281. return false;
  282. }
  283. if($("#COUNTPAGE").val()==""){
  284. $("#COUNTPAGE").tips({
  285. side:3,
  286. msg:'输入每页条数',
  287. bg:'#AE81FF',
  288. time:3
  289. });
  290. $("#COUNTPAGE").focus();
  291. return false;
  292. }
  293. if($("#SMTP").val()==""){
  294. $("#SMTP").tips({
  295. side:1,
  296. msg:'输入SMTP',
  297. bg:'#AE81FF',
  298. time:3
  299. });
  300. $("#SMTP").focus();
  301. return false;
  302. }
  303. if($("#PORT").val()==""){
  304. $("#PORT").tips({
  305. side:1,
  306. msg:'输入端口',
  307. bg:'#AE81FF',
  308. time:3
  309. });
  310. $("#PORT").focus();
  311. return false;
  312. }
  313. if($("#EMAIL").val()==""){
  314. $("#EMAIL").tips({
  315. side:3,
  316. msg:'输入邮箱',
  317. bg:'#AE81FF',
  318. time:3
  319. });
  320. $("#EMAIL").focus();
  321. return false;
  322. }else if(!ismail($("#EMAIL").val())){
  323. $("#EMAIL").tips({
  324. side:3,
  325. msg:'邮箱格式不正确',
  326. bg:'#AE81FF',
  327. time:3
  328. });
  329. $("#EMAIL").focus();
  330. return false;
  331. }
  332. if($("#PAW").val()==""){
  333. $("#PAW").tips({
  334. side:1,
  335. msg:'输入密码',
  336. bg:'#AE81FF',
  337. time:3
  338. });
  339. $("#PAW").focus();
  340. return false;
  341. }
  342. $("#Form").submit();
  343. $("#zhongxin").hide();
  344. $("#zhongxin2").show();
  345. }
  346. //登录页面背景图片
  347. function loginImg(){
  348. top.jzts();
  349. var diag = new top.Dialog();
  350. diag.Drag=true;
  351. diag.Title ="背景图片";
  352. diag.URL = locat+'/loginimg/list.do';
  353. diag.Width = 800;
  354. diag.Height = 500;
  355. diag.Modal = true; //有无遮罩窗口
  356. diag. ShowMaxButton = true; //最大化按钮
  357. diag.ShowMinButton = true; //最小化按钮
  358. diag.CancelEvent = function(){ //关闭事件
  359. diag.close();
  360. };
  361. diag.show();
  362. }
  363. function ismail(mail){
  364. return(new RegExp(/^(?:[a-zA-Z0-9]+[_\-\+\.]?)*[a-zA-Z0-9]+@(?:([a-zA-Z0-9]+[_\-]?)*[a-zA-Z0-9]+\.)+([a-zA-Z]{2,})+$/).test(mail));
  365. }