Advertisement
Guest User

Untitled

a guest
Nov 8th, 2012
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.59 KB | None | 0 0
  1. /*=======================================
  2. MODAL - HELP
  3. =======================================*/
  4.  
  5. $(document).ready(function () {
  6.  
  7. $('.windowClass').click(function () { // <-- bind to all window elements with that class
  8. $.blockUI({
  9. message: $('#' + this.id + '_win'),
  10. css: {
  11. top: ($(window).height() - 300) /2 + 'px',
  12. left: ($(window).width() - 300) /2 + 'px',
  13. width: '300px',
  14. height: '300px'
  15. }
  16. });
  17. });
  18.  
  19. $('[class$=_close]').click(function () { //<-- gets all elements with id's that end with close
  20. $.unblockUI();
  21. return false;
  22. });
  23. });
  24.  
  25. $(window).on('resize', function () {
  26. $('body').children('.blockMsg').css({
  27. top : ($(window).height() - 300) /2 + 'px',
  28. left : ($(window).width() - 300) /2 + 'px'
  29. });
  30. });
  31.  
  32. /*=======================================
  33. MODAL - CREATE BOOKING
  34. =======================================*/
  35.  
  36. $(document).ready(function () {
  37.  
  38. $('.windowClass2').click(function () { // <-- bind to all window elements with that class
  39. $.blockUI({
  40. message: $('#' + this.id + '_win'),
  41. css: {
  42. top: ($(window).height() - 500) /2 + 'px',
  43. left: ($(window).width() - 700) /2 + 'px',
  44. width: '700px',
  45. height: '500px'
  46. }
  47. });
  48. });
  49.  
  50. $('[class$=_close]').click(function () { //<-- gets all elements with id's that end with close
  51. $.unblockUI();
  52. return false;
  53. });
  54. });
  55.  
  56. $(window).on('resize', function () {
  57. $('body').children('.blockMsg').css({
  58. top : ($(window).height() - 500) /2 + 'px',
  59. left : ($(window).width() - 700) /2 + 'px'
  60. });
  61. });
  62.  
  63. /*=======================================
  64. MODAL - VIEW BOOKING
  65. =======================================*/
  66.  
  67. $(document).ready(function () {
  68.  
  69. $('.activity_text').click(function () { // <-- bind to all window elements with that class
  70. $.blockUI({
  71. message: $('#' + this.id + '_win'),
  72. css: {
  73. top: ($(window).height() - 500) /2 + 'px',
  74. left: ($(window).width() - 700) /2 + 'px',
  75. width: '700px',
  76. height: '500px'
  77. }
  78. });
  79. });
  80.  
  81. $('[class$=_close]').click(function () { //<-- gets all elements with id's that end with close
  82. $.unblockUI();
  83. return false;
  84. });
  85. });
  86.  
  87. $(window).on('resize', function () {
  88. $('body').children('.blockMsg').css({
  89. top : ($(window).height() - 500) /2 + 'px',
  90. left : ($(window).width() - 700) /2 + 'px'
  91. });
  92. });
  93.  
  94.  
  95. /*=======================================
  96. MODAL - VIEW BOOKING
  97. =======================================*/
  98.  
  99. $(document).ready(function () {
  100.  
  101. $('.gradeX').click(function () { // <-- bind to all window elements with that class
  102. $.blockUI({
  103. message: $('#' + this.id + '_win'),
  104. css: {
  105. top: ($(window).height() - 500) /2 + 'px',
  106. left: ($(window).width() - 700) /2 + 'px',
  107. width: '700px',
  108. height: '500px'
  109. }
  110. });
  111. });
  112.  
  113. $('[class$=_close]').click(function () { //<-- gets all elements with id's that end with close
  114. $.unblockUI();
  115. return false;
  116. });
  117. });
  118.  
  119. $(window).on('resize', function () {
  120. $('body').children('.blockMsg').css({
  121. top : ($(window).height() - 500) /2 + 'px',
  122. left : ($(window).width() - 700) /2 + 'px'
  123. });
  124. });
  125.  
  126.  
  127. /*=======================================
  128. SORT DATES
  129. =======================================*/
  130.  
  131. $(window).load(function() {
  132. var itemsArray = $.makeArray($("li.item"));
  133. itemsArray.sort(function(a,b){
  134. var aTime = new Date(parseDate($(a).find('.activity_date').text())).getTime();
  135. var bTime = new Date(parseDate($(b).find('.activity_date').text())).getTime();
  136. return bTime - aTime;
  137. });
  138.  
  139. $('#sortAsc').click(function(){
  140. $("#wrapper").empty().append("<ul></ul>");
  141. $(itemsArray).each(function(){
  142. $("#wrapper ul").prepend($(this));
  143. });
  144. });
  145.  
  146. $('#sortDesc').click(function(){
  147. $("#wrapper").empty().append("<ul></ul>");
  148. $(itemsArray).each(function(){
  149. $("#wrapper ul").append($(this));
  150. });
  151. });
  152. });
  153.  
  154. function parseDate(input) {
  155. var parts = input.match(/(\d+)/g);
  156. var date = new Date(parts[2], parts[1], parts[0], 0, 0, 0);
  157. return date;
  158. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement