/*! * * Responsive Timetable for Wordpress * For Wordpress * * @author Rik de Vos * @link http://rikdevos.com/ * @version 1.7.0 * * This is not free software. Visit http://rikdevos.com/demos/wordpress-responsive-timetable/ to purchase a license * */ (function($){ var sched_url_opened = false; $(document).ready(function() { $("body").append('
Mark Sixma
'); $(".sched").each(function() { new Schedule($(this)); }); }); var Schedule = function($schedule) { var that = this; this.$schedule = $schedule; this.$columns = this.$schedule.find('.sched-column'); this.$events = this.$schedule.find('.sched-event'); this.$popup = $(".sched-popup"); this.$overlay = $(".sched-popup-overlay"); this.$sorts = this.$schedule.find('.sched-sort'); this.editor_mode = ($schedule.hasClass('sched-editor-mode')) ? true : false; this.id = this.$schedule.attr('id'); this.options = $.parseJSON(this.$schedule.attr('data-options')); this.info = { open_event_id: false, ios: ( navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? true : false ), mobile: ( navigator.userAgent.match(/(Android|webOS|iPad|iPhone|iPod|BlackBerry|Windows Phone)/g) ? true : false ), animations: true, animations_speed: 200, break_columns: false, popup_top_offset: 100, previous_width: 0, style_lighten_amount: 60, has_filters: that.$schedule.find('.sched-sort').length == 1, title_width: (that.$schedule.find('.sched-title').length === 0) ? 0 : that.$schedule.find('.sched-title').innerWidth(), filter_label_width: (that.$schedule.find('.sched-sort-label').length === 0) ? 0 : that.$schedule.find('.sched-sort-label').innerWidth(), filter_dropdown_closed_width: parseFloat(this.options.filter_dropdown_width)+38, filter_dropdown_open_width: parseFloat(this.options.filter_dropdown_hover_width)+18+38, hashchange_method: 'normal', next_event: false, previous_event: false, event_box_padding_break: 110, event_box_padding: 14, loader: this.$schedule.siblings('.sched-loader') } this.info.popup_top_offset = this.info.mobile ? 20 : this.info.popup_top_offset; this.info.animations = (this.options.animations == 0 || (this.info.mobile && this.options.animations_mobile == 0)) ? false : true; if(this.editor_mode) { if(this.options.animations_editor == 0) { this.info.animations = false; } } if(this.options.animations_speed == 'slow') { this.info.animations_speed = 280; }else if(this.options.animations_speed == 'normal') { this.info.animations_speed = 200; }else if(this.options.animations_speed == 'fast') { this.info.animations_speed = 150; } if(this.info.animations == 0) { this.info.animations_speed = 1; } this.init(); //$(window).on('resize', that.resize); setTimeout(function() { that.info.loader.remove(); that.$schedule.addClass('sched-visible'); }, 100); }; Schedule.prototype.init = function() { var that = this; $(window).on('resize', function() { that.resize(); }); if($('.sched[data-timetable-id='+this.$schedule.attr('data-timetable-id')+']').length > 1) { this.options.hashtag_url = 0; } //this.resize(); this.info.event_box_padding_break = parseFloat(this.options.event_box_padding_break); if(this.info.mobile) { this.$schedule.addClass('sched-is-mobile'); this.info.event_box_padding_break = 150; } if(this.info.ios) { this.$schedule.addClass('sched-is-ios'); } var style = this.$schedule.find('.sched-style').html(); if(style !== '') { $('