global.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. function autoFlashHeight(){
  2. var infoHeight = $(".contactInfo").height();
  3. var headerHeight = $(".header").height();
  4. var cateHeight = $(".contactCate").height();
  5. var groupcHeight = $(".groupCate").height();
  6. var lockHeight = $(".lockCate").height();
  7. var contactTab = $(".contactTab").height();
  8. var seCensor = $(".seCensor").height();
  9. var btnList = $(".reportButton").height();
  10. $(".autoHeight").height($(window).height());
  11. $(".autoHeightL1").height($(window).height()-lockHeight-53);
  12. $(".autoHeightL2").height($(window).height()-cateHeight-86);
  13. $(".autoHeightL3").height($(window).height()-groupcHeight-77);
  14. $(".autoHeightR1").height($(window).height()-infoHeight-contactTab-2);
  15. $(".autoHeightR2").height($(window).height()-headerHeight-contactTab-17);
  16. $(".autoHeightR3").height($(window).height()-contactTab);
  17. $(".autoHeightR4").height($(window).height()-infoHeight-48);
  18. $(".autoHeightR5").height($(window).height()-48);
  19. $(".autoHeightI1").height($(window).height()-144);
  20. $(".autoHeightI2").height($(window).height()-132);
  21. $(".mailAutoHeigh").height($(window).height()-75);
  22. $(".censorHeight").height(seCensor-btnList-27);
  23. };
  24. $(window).resize(autoFlashHeight);
  25. $(function(){
  26. var infoHeight = $(".contactInfo").height();
  27. $(".zhzdFir").click(function () {
  28. $(this).toggleClass("now").siblings(".zhzdMenu").slideToggle("fast")
  29. });
  30. $(".amInput").children("label").children("input:checkbox").click(function(){
  31. if($(this).is(":checked")) {
  32. // 当前未选中
  33. $(".amInput").find("input:checked").removeAttr("checked");
  34. $(this).attr("checked", "checked");
  35. }
  36. });
  37. $(".pmInput").children("label").children("input:checkbox").click(function(){
  38. if($(this).is(":checked")) {
  39. // 当前未选中
  40. $(".pmInput").find("input:checked").removeAttr("checked");
  41. $(this).attr("checked", "checked");
  42. }
  43. });
  44. $('*[data-toggle=ctooltip]').mouseover(function() {
  45. $(this).ctooltip('show');
  46. });
  47. $("#openRecallInput").click(function(){
  48. $(this).parent(".toolItem").hide().siblings(".toolItem").show();
  49. });
  50. /*顶部提醒*/
  51. $("#openRemind").click(function(){
  52. $(this).toggleClass("focus").siblings(".remindList").toggle("fast");
  53. $(".remind").toggleClass("focus")
  54. }
  55. );
  56. /*顶部提醒*/
  57. $("#closeST").click(function(){
  58. $(".searchTips").hide();
  59. });
  60. $(".sortAddup").hover(function () {
  61. $(this).siblings("ul,div").animate({opacity:'0.2'},0);
  62. $(this).addClass("focus").find(".sec").show();
  63. },
  64. function () {
  65. $(this).siblings("ul,div").animate({opacity:'1'},0);
  66. $(this).removeClass("focus").find("dl").hide();
  67. }
  68. );
  69. $(".rmDone").click(function(){
  70. $(this).parent().parent("th").removeClass().toggleClass("grM");
  71. });
  72. $(".rmUdone").click(function(){
  73. $(this).parent().parent("th").removeClass().toggleClass("reM");
  74. });
  75. $(".rmClear").click(function(){
  76. $(this).parent().parent("th").removeClass();
  77. });
  78. $(".smileImg").click(function(){
  79. $(this).siblings(".smileItem").toggle();
  80. });
  81. $(".demandBoard .tab a").click(function(){
  82. $(this).addClass("focus").siblings().removeClass("focus");
  83. $(".boardList .entry ").hide().eq($(".demandBoard .tab a").index(this)).show();});
  84. /*档案库类别折叠2*/
  85. $(".snavLeve0 li").click(function(){
  86. $(this).children("h4").addClass("focus");
  87. $(this).children(".snavLeve1").slideDown();
  88. $(this).siblings("li").children("h4").removeClass("focus");
  89. $(this).siblings("li").children(".snavLeve1").slideUp();
  90. });
  91. /*侧滑窗口*/
  92. $(".opensidebar").click(function(){
  93. $(".wrapDetil").animate({width:"702"}).addClass("open");
  94. });
  95. // $("body").click(function(event){
  96. // var e = event || window.event; //浏览器兼容性
  97. // var elem = event.target || e.srcElement;
  98. // while (elem) { //循环判断至跟节点,防止点击的是div子元素
  99. // if (elem.className == "opensidebar" || elem.className == 'wrapDetil open') {
  100. // return false;
  101. // }
  102. // elem = elem.parentNode;
  103. // }
  104. // $(".wrapDetil").animate({width:"0"}).removeClass("open")// 关闭处理
  105. // });
  106. $("body").click(function(event){
  107. var e = event || window.event; //浏览器兼容性
  108. if(!$(event.target).is('a')) {
  109. var elem = event.target || e.srcElement;
  110. while (elem) { //循环判断至跟节点,防止点击的是div子元素
  111. if (elem.className == "opensidebar" || elem.className == 'wrapDetil open') {
  112. return false;
  113. }
  114. elem = elem.parentNode;
  115. }
  116. $(".wrapDetil").animate({width:"0"}).removeClass("open")// 关闭处理
  117. }
  118. });
  119. /*侧滑窗口*/
  120. });
  121. function slideupInfo(c){
  122. $(c).parent(".addRecord").hide().siblings(".addRecord").show();
  123. $('.contactInfo').slideUp();
  124. $('.lockRecord').toggleClass("autoHeightR1").height($(window).height()-53);
  125. };
  126. function slidedownInfo(a){
  127. var infoHeight = $(".contactInfo").height();
  128. $(a).parent(".addRecord").hide().siblings(".addRecord").show();
  129. $('.contactInfo').slideDown();
  130. $('.lockRecord').toggleClass("autoHeightR1").height($(window).height()-infoHeight-48);
  131. };
  132. /**
  133. * Bootstrap.js by @fat & @mdo
  134. * plugins: bootstrap-modal.js
  135. * Copyright 2012 Twitter, Inc.
  136. * http://www.apache.org/licenses/LICENSE-2.0.txt
  137. */
  138. !function(a){var b=function(b,c){this.options=c,this.$element=a(b).delegate('[data-dismiss="modal"]',"click.dismiss.modal",a.proxy(this.hide,this)),this.options.remote&&this.$element.find(".modal-body").load(this.options.remote)};b.prototype={constructor:b,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var b=this,c=a.Event("show");this.$element.trigger(c);if(this.isShown||c.isDefaultPrevented())return;this.isShown=!0,this.escape(),this.backdrop(function(){var c=a.support.transition&&b.$element.hasClass("fade");b.$element.parent().length||b.$element.appendTo(document.body),b.$element.show(),c&&b.$element[0].offsetWidth,b.$element.addClass("in").attr("aria-hidden",!1),b.enforceFocus(),c?b.$element.one(a.support.transition.end,function(){b.$element.focus().trigger("shown")}):b.$element.focus().trigger("shown")})},hide:function(b){b&&b.preventDefault();var c=this;b=a.Event("hide"),this.$element.trigger(b);if(!this.isShown||b.isDefaultPrevented())return;this.isShown=!1,this.escape(),a(document).off("focusin.modal"),this.$element.removeClass("in").attr("aria-hidden",!0),a.support.transition&&this.$element.hasClass("fade")?this.hideWithTransition():this.hideModal()},enforceFocus:function(){var b=this;a(document).on("focusin.modal",function(a){b.$element[0]!==a.target&&!b.$element.has(a.target).length&&b.$element.focus()})},escape:function(){var a=this;this.isShown&&this.options.keyboard?this.$element.on("keyup.dismiss.modal",function(b){b.which==27&&a.hide()}):this.isShown||this.$element.off("keyup.dismiss.modal")},hideWithTransition:function(){var b=this,c=setTimeout(function(){b.$element.off(a.support.transition.end),b.hideModal()},500);this.$element.one(a.support.transition.end,function(){clearTimeout(c),b.hideModal()})},hideModal:function(){var a=this;this.$element.hide(),this.backdrop(function(){a.removeBackdrop(),a.$element.trigger("hidden")})},removeBackdrop:function(){this.$backdrop&&this.$backdrop.remove(),this.$backdrop=null},backdrop:function(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;this.$backdrop=a('<div class="modal-backdrop '+d+'" />').appendTo(document.body),this.$backdrop.click(this.options.backdrop=="static"?a.proxy(this.$element[0].focus,this.$element[0]):a.proxy(this.hide,this)),e&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in");if(!b)return;e?this.$backdrop.one(a.support.transition.end,b):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,b):b()):b&&b()}};var c=a.fn.modal;a.fn.modal=function(c){return this.each(function(){var d=a(this),e=d.data("modal"),f=a.extend({},a.fn.modal.defaults,d.data(),typeof c=="object"&&c);e||d.data("modal",e=new b(this,f)),typeof c=="string"?e[c]():f.show&&e.show()})},a.fn.modal.defaults={backdrop:!0,keyboard:!0,show:!0},a.fn.modal.Constructor=b,a.fn.modal.noConflict=function(){return a.fn.modal=c,this},a(document).on("click.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d=c.attr("href"),e=a(c.attr("data-target")||d&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({remote:!/#/.test(d)&&d},e.data(),c.data());b.preventDefault(),e.modal(f).one("hide",function(){c.focus()})})}(window.jQuery)
  139. !function(a){var b=function(a,b){this.init("ctooltip",a,b)};b.prototype={constructor:b,init:function(b,c,d){var e,f,g,h,i;this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.enabled=!0,g=this.options.trigger.split(" ");for(i=g.length;i--;)h=g[i],h=="click"?this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this)):h!="manual"&&(e=h=="hover"?"mouseenter":"focus",f=h=="hover"?"mouseleave":"blur",this.$element.on(e+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(f+"."+this.type,this.options.selector,a.proxy(this.leave,this)));this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(b){return b=a.extend({},a.fn[this.type].defaults,this.$element.data(),b),b.delay&&typeof b.delay=="number"&&(b.delay={show:b.delay,hide:b.delay}),b},enter:function(b){var c=a.fn[this.type].defaults,d={},e;this._options&&a.each(this._options,function(a,b){c[a]!=b&&(d[a]=b)},this),e=a(b.currentTarget)[this.type](d).data(this.type);if(!e.options.delay||!e.options.delay.show)return e.show();clearTimeout(this.timeout),e.hoverState="in",this.timeout=setTimeout(function(){e.hoverState=="in"&&e.show()},e.options.delay.show)},leave:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);this.timeout&&clearTimeout(this.timeout);if(!c.options.delay||!c.options.delay.hide)return c.hide();c.hoverState="out",this.timeout=setTimeout(function(){c.hoverState=="out"&&c.hide()},c.options.delay.hide)},show:function(){var b,c,d,e,f,g,h=a.Event("show");if(this.hasContent()&&this.enabled){this.$element.trigger(h);if(h.isDefaultPrevented())return;b=this.tip(),this.setContent(),this.options.animation&&b.addClass("fade"),f=typeof this.options.placement=="function"?this.options.placement.call(this,b[0],this.$element[0]):this.options.placement,b.detach().css({top:0,left:0,display:"block"}),this.options.container?b.appendTo(this.options.container):b.insertAfter(this.$element),c=this.getPosition(),d=b[0].offsetWidth,e=b[0].offsetHeight;switch(f){case"bottom":g={top:c.top+c.height,left:c.left+c.width/2-d/2};break;case"top":g={top:c.top-e,left:c.left+c.width/2-d/2};break;case"left":g={top:c.top+c.height/2-e/2,left:c.left-d};break;case"right":g={top:c.top+c.height/2-e/2,left:c.left+c.width}}this.applyPlacement(g,f),this.$element.trigger("shown")}},applyPlacement:function(a,b){var c=this.tip(),d=c[0].offsetWidth,e=c[0].offsetHeight,f,g,h,i;c.offset(a).addClass(b).addClass("in"),f=c[0].offsetWidth,g=c[0].offsetHeight,b=="top"&&g!=e&&(a.top=a.top+e-g,i=!0),b=="bottom"||b=="top"?(h=0,a.left<0&&(h=a.left*-2,a.left=0,c.offset(a),f=c[0].offsetWidth,g=c[0].offsetHeight),this.replaceArrow(h-d+f,f,"left")):this.replaceArrow(g-e,g,"top"),i&&c.offset(a)},replaceArrow:function(a,b,c){this.arrow().css(c,a?50*(1-a/b)+"%":"")},setContent:function(){var a=this.tip(),b=this.getTitle();a.find(".ctooltip-inner")[this.options.html?"html":"text"](b),a.removeClass("fade in top bottom left right")},hide:function(){function e(){var b=setTimeout(function(){c.off(a.support.transition.end).detach()},500);c.one(a.support.transition.end,function(){clearTimeout(b),c.detach()})}var b=this,c=this.tip(),d=a.Event("hide");this.$element.trigger(d);if(d.isDefaultPrevented())return;return c.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?e():c.detach(),this.$element.trigger("hidden"),this},fixTitle:function(){var a=this.$element;(a.attr("title")||typeof a.attr("data-original-title")!="string")&&a.attr("data-original-title",a.attr("title")||"").attr("title","")},hasContent:function(){return this.getTitle()},getPosition:function(){var b=this.$element[0];return a.extend({},typeof b.getBoundingClientRect=="function"?b.getBoundingClientRect():{width:b.offsetWidth,height:b.offsetHeight},this.$element.offset())},getTitle:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||(typeof c.title=="function"?c.title.call(b[0]):c.title),a},tip:function(){return this.$tip=this.$tip||a(this.options.template)},arrow:function(){return this.$arrow=this.$arrow||this.tip().find(".ctooltip-arrow")},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(b){var c=b?a(b.currentTarget)[this.type](this._options).data(this.type):this;c.tip().hasClass("in")?c.hide():c.show()},destroy:function(){this.hide().$element.off("."+this.type).removeData(this.type)}};var c=a.fn.ctooltip;a.fn.ctooltip=function(c){return this.each(function(){var d=a(this),e=d.data("ctooltip"),f=typeof c=="object"&&c;e||d.data("ctooltip",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.ctooltip.Constructor=b,a.fn.ctooltip.defaults={animation:!0,placement:"top",selector:!1,template:'<div class="ctooltip"><div class="ctooltip-arrow"></div><div class="ctooltip-inner"></div></div>',trigger:"hover focus",title:"",delay:0,html:!1,container:!1},a.fn.ctooltip.noConflict=function(){return a.fn.ctooltip=c,this}}(window.jQuery)
  140. !function(a){function d(){a(".dropdown-backdrop").remove(),a(b).each(function(){e(a(this)).removeClass("open")})}function e(b){var c=b.attr("data-target"),d;c||(c=b.attr("href"),c=c&&/#/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,"")),d=c&&a(c);if(!d||!d.length)d=b.parent();return d}var b="[data-toggle=dropdown]",c=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};c.prototype={constructor:c,toggle:function(b){var c=a(this),f,g;if(c.is(".disabled, :disabled"))return;return f=e(c),g=f.hasClass("open"),d(),g||("ontouchstart"in document.documentElement&&a('<div class="dropdown-backdrop"/>').insertBefore(a(this)).on("click",d),f.toggleClass("open")),c.focus(),!1},keydown:function(c){var d,f,g,h,i,j;if(!/(38|40|27)/.test(c.keyCode))return;d=a(this),c.preventDefault(),c.stopPropagation();if(d.is(".disabled, :disabled"))return;h=e(d),i=h.hasClass("open");if(!i||i&&c.keyCode==27)return c.which==27&&h.find(b).focus(),d.click();f=a("[role=menu] li:not(.divider):visible a",h);if(!f.length)return;j=f.index(f.filter(":focus")),c.keyCode==38&&j>0&&j--,c.keyCode==40&&j<f.length-1&&j++,~j||(j=0),f.eq(j).focus()}};var f=a.fn.dropdown;a.fn.dropdown=function(b){return this.each(function(){var d=a(this),e=d.data("dropdown");e||d.data("dropdown",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.dropdown.Constructor=c,a.fn.dropdown.noConflict=function(){return a.fn.dropdown=f,this},a(document).on("click.dropdown.data-api",d).on("click.dropdown.data-api",".dropdown form",function(a){a.stopPropagation()}).on("click.dropdown.data-api",b,c.prototype.toggle).on("keydown.dropdown.data-api",b+", [role=menu]",c.prototype.keydown)}(window.jQuery);