topBar.html 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <div id="tabs-container">
  2. <ul class="tabs-menu">
  3. <a href="/broadcast/shots/auditing"><li class="Auditing"><span>UNDER REVIEW</span></li></a>
  4. <a href="/broadcast/shots/pass"><li class="Pass"><span>APPROVED</span></li></a>
  5. <a href="/broadcast/shots/failed"><li class="Failed"><span>REJECTED</span></li></a>
  6. </ul>
  7. <ul class="plusBtn">
  8. <li>
  9. <a id="Photo" href="javascript:;"><div class="plusPhoto">+ Photo Shot</div></a>
  10. </li>
  11. <li>
  12. <a id="Video" href="javascript:;"><div class="plusVideo">+ Video Shot</div></a>
  13. </li>
  14. </ul>
  15. </div>
  16. <script>
  17. $(function(){
  18. //查看视频
  19. $('.video').on('click', function(){
  20. var videoUrl = $(this).attr('data-video');
  21. var status = $(this).attr('data-status');
  22. if(status == 1){
  23. parent.layer.open({
  24. type: 2,
  25. title: '',
  26. closeBtn: 0,
  27. resize: false,
  28. area : ['640px', '519px'],
  29. content: '/broadcast/shotsLayer/playVideo?videoUrl='+videoUrl
  30. });
  31. }else{
  32. parent.layer.open({
  33. type: 2,
  34. title: '',
  35. closeBtn: 0,
  36. resize: false,
  37. area : ['640px', '522px'],
  38. content: '/broadcast/shotsLayer/playError'
  39. });
  40. }
  41. })
  42. //查看图片
  43. var showOriginal = 0;
  44. $('.showOriginal').on('click', function(){
  45. if(showOriginal) {
  46. return false;
  47. }
  48. showOriginal = 1;
  49. var img = $(this).attr('data-img');
  50. var image = new Image();
  51. image.src = img;
  52. image.onload = function(){
  53. var width = image.width;
  54. var height = image.height;
  55. width = width*0.9;
  56. height = height*0.9;
  57. var windowHeigth = $(parent).height();
  58. var windowWidth = $(parent).width();
  59. var imgHeigth = '';
  60. var imgWidth = '';
  61. if(windowHeigth < height){
  62. windowHeigth = parseInt(windowHeigth * 0.6);
  63. windowWidth = parseInt(windowWidth * 0.6);
  64. height = windowHeigth;
  65. width = windowWidth;
  66. imgHeigth = windowHeigth;
  67. imgWidth = windowWidth;
  68. }else{
  69. imgHeigth = height;
  70. imgWidth = width;
  71. }
  72. width = width + 20 + 'px';
  73. height = height + 50 + 'px';
  74. parent.layer.open({
  75. type: 2,
  76. title: '',
  77. closeBtn: 0,
  78. resize: false,
  79. shadeClose: true,
  80. area : [width, height],
  81. content: '/broadcast/shotsLayer/showOriginal?img='+img+'&width='+imgWidth+'&height='+imgHeigth,
  82. end:function(){
  83. showOriginal = 0;
  84. }
  85. });
  86. }
  87. })
  88. //添加视频
  89. $('#Video').on('click', function(){
  90. parent.layer.open({
  91. type: 2,
  92. title: '',
  93. closeBtn: 0,
  94. resize: false,
  95. // shadeClose: true,
  96. area : ['556px', '418px'],
  97. content: '/broadcast/shotsLayer/addVideo',
  98. end:function(){
  99. var status = Cookies.getJSON('add_success_video');
  100. Cookies.remove('add_success_video');
  101. if(status && status.status == 1){
  102. window.location.reload();
  103. }
  104. }
  105. });
  106. })
  107. //添加图片
  108. $('#Photo').on('click', function(){
  109. parent.layer.open({
  110. type: 2,
  111. title: '',
  112. closeBtn: 0,
  113. resize: false,
  114. // shadeClose: true,
  115. area : ['556px', '350px'],
  116. content: '/broadcast/shotsLayer/addPhoto',
  117. end:function(){
  118. var status = Cookies.getJSON('add_success_photo');
  119. Cookies.remove('add_success_photo');
  120. if(status && status.status == 1){
  121. window.location.reload();
  122. }
  123. }
  124. });
  125. })
  126. })
  127. </script>