Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*=======================================
- MODAL - HELP
- =======================================*/
- $(document).ready(function () {
- $('.windowClass').click(function () { // <-- bind to all window elements with that class
- $.blockUI({
- message: $('#' + this.id + '_win'),
- css: {
- top: ($(window).height() - 300) /2 + 'px',
- left: ($(window).width() - 300) /2 + 'px',
- width: '300px',
- height: '300px'
- }
- });
- });
- $('[class$=_close]').click(function () { //<-- gets all elements with id's that end with close
- $.unblockUI();
- return false;
- });
- });
- $(window).on('resize', function () {
- $('body').children('.blockMsg').css({
- top : ($(window).height() - 300) /2 + 'px',
- left : ($(window).width() - 300) /2 + 'px'
- });
- });
- /*=======================================
- MODAL - CREATE BOOKING
- =======================================*/
- $(document).ready(function () {
- $('.windowClass2').click(function () { // <-- bind to all window elements with that class
- $.blockUI({
- message: $('#' + this.id + '_win'),
- css: {
- top: ($(window).height() - 500) /2 + 'px',
- left: ($(window).width() - 700) /2 + 'px',
- width: '700px',
- height: '500px'
- }
- });
- });
- $('[class$=_close]').click(function () { //<-- gets all elements with id's that end with close
- $.unblockUI();
- return false;
- });
- });
- $(window).on('resize', function () {
- $('body').children('.blockMsg').css({
- top : ($(window).height() - 500) /2 + 'px',
- left : ($(window).width() - 700) /2 + 'px'
- });
- });
- /*=======================================
- MODAL - VIEW BOOKING
- =======================================*/
- $(document).ready(function () {
- $('.activity_text').click(function () { // <-- bind to all window elements with that class
- $.blockUI({
- message: $('#' + this.id + '_win'),
- css: {
- top: ($(window).height() - 500) /2 + 'px',
- left: ($(window).width() - 700) /2 + 'px',
- width: '700px',
- height: '500px'
- }
- });
- });
- $('[class$=_close]').click(function () { //<-- gets all elements with id's that end with close
- $.unblockUI();
- return false;
- });
- });
- $(window).on('resize', function () {
- $('body').children('.blockMsg').css({
- top : ($(window).height() - 500) /2 + 'px',
- left : ($(window).width() - 700) /2 + 'px'
- });
- });
- /*=======================================
- MODAL - VIEW BOOKING
- =======================================*/
- $(document).ready(function () {
- $('.gradeX').click(function () { // <-- bind to all window elements with that class
- $.blockUI({
- message: $('#' + this.id + '_win'),
- css: {
- top: ($(window).height() - 500) /2 + 'px',
- left: ($(window).width() - 700) /2 + 'px',
- width: '700px',
- height: '500px'
- }
- });
- });
- $('[class$=_close]').click(function () { //<-- gets all elements with id's that end with close
- $.unblockUI();
- return false;
- });
- });
- $(window).on('resize', function () {
- $('body').children('.blockMsg').css({
- top : ($(window).height() - 500) /2 + 'px',
- left : ($(window).width() - 700) /2 + 'px'
- });
- });
- /*=======================================
- SORT DATES
- =======================================*/
- $(window).load(function() {
- var itemsArray = $.makeArray($("li.item"));
- itemsArray.sort(function(a,b){
- var aTime = new Date(parseDate($(a).find('.activity_date').text())).getTime();
- var bTime = new Date(parseDate($(b).find('.activity_date').text())).getTime();
- return bTime - aTime;
- });
- $('#sortAsc').click(function(){
- $("#wrapper").empty().append("<ul></ul>");
- $(itemsArray).each(function(){
- $("#wrapper ul").prepend($(this));
- });
- });
- $('#sortDesc').click(function(){
- $("#wrapper").empty().append("<ul></ul>");
- $(itemsArray).each(function(){
- $("#wrapper ul").append($(this));
- });
- });
- });
- function parseDate(input) {
- var parts = input.match(/(\d+)/g);
- var date = new Date(parts[2], parts[1], parts[0], 0, 0, 0);
- return date;
- }
-
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement