$(document).ready(function() { // beach survey list display if ($('body').hasClass('node-type-beach')) { $('body.node-type-beach .view-display-id-beach_surveys .item-list ul').each(function() { var view = 4; // number of items to be displayed var limit = view-1; if ($(this).find('li').length > (view)) { $(this).find('li:gt('+limit+')').hide().end().append('
  • Show all »
  • '); $('.show').click( function() { $(this).siblings(':gt('+limit+')').toggle(); if ( $('.show_more').length ) { $(this).html('Hide'); $('#block-views-beach_references-beach_surveys .view-beach-references .item-list ul li').css('width', '20%').css('margin-right', 0); } else { $(this).html('Show all »'); $('#block-views-beach_references-beach_surveys .view-beach-references .item-list ul li').css('width', 'auto').css('margin-right', '20px'); } return false; }); }; }); } // cancelled event display changes if ($('body').hasClass('node-type-event')) { if ($('div.field-field-event-status').text().indexOf("Cancelled") >= 0) { $('div.node').addClass('cancelled'); $('div.field-field-beach-reference').before('

    EVENT CANCELLED

    Sorry, this event will no longer be taking place.

    Please check on the beach\'s page via the link below for future beach clean events.

    '); $('div.field-field-event-status').show(); $('div#content-top').hide(); $('form#signup-form').hide(); } $('div.field-field-event-privacy .field-item').each(function() { if ($(this).text().indexOf("Private") >= 0) { $(this).addClass('private'); } }); } if ($('body').hasClass('section-events')) { $('tr.Cancelled td.views-field-title-1 a').each(function() { $(this).text('Cancelled ยป'); }); } if ($('body').hasClass('node-type-beach')) { $('#block-beachwatch-beach-organisers .item-list').before($('#block-views-beach_references-bw_events')); $('#block-views-beach_references-bw_events').show(); } // on events pages show user register block when /user/register link clicked if ($('.node-type-event #block-beachwatch-user_register').length) { // to display as overlay move out of #page div //$('#page').after($('#content-bottom')); //$('#content-bottom').after($('#block-beachwatch-user_register')); $('#content-bottom').before('
    '); // show user register form if there were errors on submission if ($('.messages.error').length) { $('#content-bottom').show(); $('#block-beachwatch-user_register').show(); } $("#block-block-22 a").click(function() { $('#content-bottom').show(); $('#block-beachwatch-user_register').show(); $('html, body').animate({ scrollTop: $('#register').offset().top }, 'slow'); return false; }); $("#sidebar-right form#user-login-form li.first a").click(function() { $("#block-block-22 a").click(); return false; }); } // add a required field * to event To field label if ($('body').hasClass('page-node-add-event') || ($('body').hasClass('node-type-event') && $('body').hasClass('section-node-edit'))) { $('#edit-field-event-datetime-0-value2-wrapper label').append('*'); } $('div.views-widget-filter-beachwatch_beach_postcode_search').append($('div#edit-postcode-distance-wrapper')); if (($('body').hasClass('node-type-survey100m') && $('body').hasClass('section-node-edit')) || $('body').hasClass('page-node-add-survey100m')) { $('.group-survey-plastic').wrap('
    '); $('.group-survey-rubber').before('
    '); $('.fieldset-column.column2').prepend($('.group-survey-metal')); $('.fieldset-column.column2').prepend($('.group-survey-wood')); $('.fieldset-column.column2').prepend($('.group-survey-paper')); $('.fieldset-column.column2').prepend($('.group-survey-cloth')); $('.fieldset-column.column2').prepend($('.group-survey-rubber')); $('.group-survey-glass').before('
    '); $('.fieldset-column.column3').prepend($('.group-survey-other-pollutants')); $('.fieldset-column.column3').prepend($('.group-survey-faeces')); $('.fieldset-column.column3').prepend($('.group-survey-medical')); $('.fieldset-column.column3').prepend($('.group-survey-sanitary')); $('.fieldset-column.column3').prepend($('.group-survey-pottery')); $('.fieldset-column.column3').prepend($('.group-survey-glass')); } }); // $('ul li:gt(3)').hide(); // $('.show_button').click(function() { // $('ul li:gt(3)').show(); // }); // $('body.node-type-beach .view-content .item-list ul') // .find('li:gt(3)') // .hide() // .end() // .append( // $('
  • Show More...
  • ').click( function() { // $(this).siblings(':hidden').show().end().remove(); // }) // );