portal html css js resource

common.js 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. $(document).ready(function(){
  2. var footerHeight = $("footer").outerHeight(true);
  3. $('#container').css("padding-bottom", footerHeight +"px" );
  4. //窗口大小变更事件
  5. $(window).resize(function() {
  6. footerHeight=$("footer").outerHeight(true);
  7. $('#container').css("padding-bottom", footerHeight +"px" );
  8. //console.log(footerHeight)
  9. });
  10. //退出登录转态
  11. $("#exitLogin").on("click",function(){
  12. exit();
  13. })
  14. //判断登录转态
  15. var orgId = $.cookie("orgId");
  16. if (orgId && orgId != "null" && orgId != null) {
  17. $(".unlogin").addClass("displayNone");
  18. $(".onlogin").removeClass("displayNone");
  19. $.ajax("/ajax/org/" + orgId, {
  20. type: "GET",
  21. dataType: 'json',
  22. async: false,
  23. success: function($data) {
  24. if($data.success){
  25. if($data.data.hasOrgLogo){
  26. $("#imglogo").attr("src","/images/org/"+orgId+".jpg");
  27. }
  28. }
  29. },
  30. error: function() {
  31. $.MsgBox.Alert('提示', '服务器请求失败')
  32. },
  33. });
  34. }else{
  35. $(".unlogin").removeClass("displayNone");
  36. $(".onlogin").addClass("displayNone");
  37. }
  38. });
  39. //Model模态框打开关闭
  40. function modelOpen(){
  41. $(".blackcover").fadeIn();
  42. $(".modelContain").slideDown();
  43. $("body").addClass("modelOpen");
  44. }
  45. function modelClose(){
  46. $(".modelContain").slideUp();
  47. $(".blackcover").fadeOut();
  48. $("body").removeClass("modelOpen");
  49. }
  50. function exit(){
  51. $.cookie('orgId', null,{path:"/"});
  52. $.cookie('orgAuth', null,{path:"/"});
  53. $.cookie('orgEmail', null,{path:"/"});
  54. $.cookie('orgName', null,{path:"/"});
  55. $.cookie('orgType', null,{path:"/"});
  56. location.href="cmp-settled-log.html"
  57. }
  58. //截取url传值
  59. function GetQueryString(name) {
  60. var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
  61. var r = window.location.search.substr(1).match(reg); //��ȡurl��"?"�����ַ�����ƥ��
  62. var context = "";
  63. if (r != null)
  64. context = r[2];
  65. reg = null;
  66. r = null;
  67. return context == null || context == "" || context == "undefined" ? "" : decodeURI(context);
  68. }
  69. //转换格式
  70. function changeTime(dealtime){
  71. var s = dealtime;
  72. //console.log(s);
  73. if(dealtime.length==8){
  74. var y = s.substr(0,4);
  75. var m = s.substr(4,2);
  76. var d = s.substr(6,2);
  77. var formatTime = y+"-"+m+"-"+d;
  78. return formatTime;
  79. }
  80. else
  81. {
  82. var y = s.substr(0,4);
  83. var m = s.substr(4,2);
  84. var d = s.substr(6,2);
  85. var h = s.substr(8,2);
  86. var minute = s.substr(10,2);
  87. var formatTime = y+"-"+m+"-"+d+" "+h+":"+minute;
  88. return formatTime;
  89. }
  90. }
  91. //过滤特殊字符
  92. function replaceStr(s)
  93. {
  94. var pattern = new RegExp("-");
  95. var rs = "";
  96. for (var i = 0; i < s.length; i++) {
  97. rs = rs+s.substr(i, 1).replace(pattern, '');
  98. }
  99. return rs;
  100. }
  101. //根据用户输入的Email跳转到相应的电子邮箱首页
  102. var hash={
  103. 'qq.com': 'http://mail.qq.com',
  104. 'gmail.com': 'http://mail.google.com',
  105. 'sina.com': 'http://mail.sina.com.cn',
  106. '163.com': 'http://mail.163.com',
  107. '126.com': 'http://mail.126.com',
  108. 'yeah.net': 'http://www.yeah.net/',
  109. 'sohu.com': 'http://mail.sohu.com/',
  110. 'tom.com': 'http://mail.tom.com/',
  111. 'sogou.com': 'http://mail.sogou.com/',
  112. '139.com': 'http://mail.10086.cn/',
  113. 'hotmail.com': 'http://www.hotmail.com',
  114. 'live.com': 'http://login.live.com/',
  115. 'live.cn': 'http://login.live.cn/',
  116. 'live.com.cn': 'http://login.live.com.cn',
  117. '189.com': 'http://webmail16.189.cn/webmail/',
  118. 'yahoo.com.cn': 'http://mail.cn.yahoo.com/',
  119. 'yahoo.cn': 'http://mail.cn.yahoo.com/',
  120. 'eyou.com': 'http://www.eyou.com/',
  121. '21cn.com': 'http://mail.21cn.com/',
  122. '188.com': 'http://www.188.com/',
  123. 'ustb.edu.cn': 'http://mail.ustb.edu.cn/',
  124. 'foxmail.coom': 'http://www.foxmail.com'
  125. };