/(function($){ Drupal.behaviors.block_carousel = { attach: function (context, settings) { if ($('.page-node .owl-carousel-rte').length) { $('.owl-carousel-rte').owlCarousel({ pagination: false, navigation: true, // Show next and prev buttons slideSpeed: 300, paginationSpeed: 400, singleItem: true, // "singleItem:true" is a shortcut for: // items : 1, // itemsDesktop : false, // itemsDesktopSmall : false, // itemsTablet: false, itemsMobile: false }); } } }; })(jQuery); ;/*})'"*/ ;/*})'"*/ /** * Attaches the calendar behavior to all required fields */ (function($) { function makeFocusHandler(e) { if (!$(this).hasClass('date-popup-init')) { var datePopup = e.data; // Explicitely filter the methods we accept. switch (datePopup.func) { case 'datepicker': $(this) .datepicker(datePopup.settings) .addClass('date-popup-init'); $(this).click(function(){ $(this).focus(); }); break; case 'timeEntry': $(this) .timeEntry(datePopup.settings) .addClass('date-popup-init'); $(this).click(function(){ $(this).focus(); }); break; case 'timepicker': // Translate the PHP date format into the style the timepicker uses. datePopup.settings.timeFormat = datePopup.settings.timeFormat // 12-hour, leading zero, .replace('h', 'hh') // 12-hour, no leading zero. .replace('g', 'h') // 24-hour, leading zero. .replace('H', 'HH') // 24-hour, no leading zero. .replace('G', 'H') // AM/PM. .replace('A', 'p') // Minutes with leading zero. .replace('i', 'mm') // Seconds with leading zero. .replace('s', 'ss'); datePopup.settings.startTime = new Date(datePopup.settings.startTime); $(this) .timepicker(datePopup.settings) .addClass('date-popup-init'); $(this).click(function(){ $(this).focus(); }); break; } } } Drupal.behaviors.date_popup = { attach: function (context) { for (var id in Drupal.settings.datePopup) { $('#'+ id).bind('focus', Drupal.settings.datePopup[id], makeFocusHandler); } } }; })(jQuery); ;/*})'"*/ ;/*})'"*/ (function ($) { // Store the original beforeSerialize, as we want to continue using // it after we've overridden it. Drupal.ajax.prototype.originalBeforeSerialize = Drupal.ajax.prototype.beforeSerialize; /** * Override core's beforeSerialize. * * We switch to using GET if this is for an ajax View. * We also avoid adding ajax_html_id and ajax_page_state. * (This happens in core's beforeSerialize). */ Drupal.ajax.prototype.beforeSerialize = function (element, options) { // If this is for a view, switch to GET. if (options.url && options.url.indexOf('/views/ajax') !== -1 && Drupal.settings.viewsAjaxGet && $.inArray(options.data.view_name, Drupal.settings.viewsAjaxGet) !== -1) { // @See Drupal.ajax.prototype.beforeSerialize if (this.form) { var settings = this.settings || Drupal.settings; Drupal.detachBehaviors(this.form, settings, 'serialize'); } options.type = 'GET'; return; } return this.originalBeforeSerialize(element, options); }; })(jQuery); ;/*})'"*/ ;/*})'"*/ /** * @file views_load_more.js * * Handles the AJAX pager for the view_load_more plugin. */ (function ($) { /** * Provide a series of commands that the server can request the client perform. */ Drupal.ajax.prototype.commands.viewsLoadMoreAppend = function (ajax, response, status) { // Get information from the response. If it is not there, default to // our presets. var wrapper = response.selector ? $(response.selector) : $(ajax.wrapper); var method = response.method || ajax.method; var targetList = response.targetList || ''; var effect = ajax.getEffect(response); var pager_selector = response.options.pager_selector ? response.options.pager_selector : '.pager-load-more'; // We don't know what response.data contains: it might be a string of text // without HTML, so don't rely on jQuery correctly iterpreting // $(response.data) as new HTML rather than a CSS selector. Also, if // response.data contains top-level text nodes, they get lost with either // $(response.data) or $('
').replaceWith(response.data). var new_content_wrapped = $('').html(response.data); var new_content = new_content_wrapped.contents(); // For legacy reasons, the effects processing code assumes that new_content // consists of a single top-level element. Also, it has not been // sufficiently tested whether attachBehaviors() can be successfully called // with a context object that includes top-level text nodes. However, to // give developers full control of the HTML appearing in the page, and to // enable Ajax content to be inserted in places where DIV elements are not // allowed (e.g., within TABLE, TR, and SPAN parents), we check if the new // content satisfies the requirement of a single top-level element, and // only use the container DIV created above when it doesn't. For more // information, please see http://drupal.org/node/736066. if (new_content.length != 1 || new_content.get(0).nodeType != 1) { new_content = new_content_wrapped; } // If removing content from the wrapper, detach behaviors first. var settings = response.settings || ajax.settings || Drupal.settings; Drupal.detachBehaviors(wrapper, settings); if ($.waypoints != undefined) { $.waypoints('refresh'); } // Set up our default query options. This is for advance users that might // change there views layout classes. This allows them to write there own // jquery selector to replace the content with. // Provide sensible defaults for unordered list, ordered list and table // view styles. var content_query = targetList && !response.options.content ? '> .view-content ' + targetList : response.options.content || '> .view-content'; // If we're using any effects. Hide the new content before adding it to the DOM. if (effect.showEffect != 'show') { new_content.find(content_query).children().hide(); } // Update the pager // Find both for the wrapper as the newly loaded content the direct child // .item-list in case of nested pagers wrapper.find(pager_selector).replaceWith(new_content.find(pager_selector)); // Add the new content to the page. wrapper.find(content_query)[method](new_content.find(content_query).children()); // Re-class the loaded content. // @todo this is faulty in many ways. first of which is that user may have configured view to not have these classes at all. wrapper.find(content_query).children() .removeClass('views-row-first views-row-last views-row-odd views-row-even') .filter(':first') .addClass('views-row-first') .end() .filter(':last') .addClass('views-row-last') .end() .filter(':even') .addClass('views-row-odd') .end() .filter(':odd') .addClass('views-row-even') .end(); if (effect.showEffect != 'show') { wrapper.find(content_query).children(':not(:visible)')[effect.showEffect](effect.showSpeed); } // Additional processing over new content wrapper.trigger('views_load_more.new_content', new_content.clone()); // Attach all JavaScript behaviors to the new content // Remove the Jquery once Class, TODO: There needs to be a better // way of doing this, look at .removeOnce() :-/ var classes = wrapper.attr('class'); var onceClass = classes.match(/jquery-once-[0-9]*-[a-z]*/); wrapper.removeClass(onceClass[0]); settings = response.settings || ajax.settings || Drupal.settings; Drupal.attachBehaviors(wrapper, settings); }; /** * Attaches the AJAX behavior to Views Load More waypoint support. */ Drupal.behaviors.ViewsLoadMore = { attach: function (context, settings) { var default_opts = { offset: '100%' }; if (settings && settings.viewsLoadMore && settings.views && settings.views.ajaxViews) { $.each(settings.viewsLoadMore, function(i, setting) { var view = '.view-id-' + setting.view_name + '.view-display-id-' + setting.view_display_id + ' .pager-next a', opts = {}; $.extend(opts, default_opts, settings.viewsLoadMore[i].opts); $(view).waypoint('destroy'); $(view).waypoint(function(event, direction) { $(view).click(); }, opts); }); } }, detach: function (context, settings, trigger) { if (settings && settings.viewsLoadMore && settings.views && settings.views.ajaxViews) { $.each(settings.viewsLoadMore, function(i, setting) { var view = '.view-id-' + setting.view_name + '.view-display-id-' + setting.view_display_id; if ($(context).is(view)) { $('.pager-next a', view).waypoint('destroy'); } else { $(view, context).waypoint('destroy'); } }); } } }; })(jQuery); ;/*})'"*/ ;/*})'"*/ /** * @file * Some basic behaviors and utility functions for Views. */ (function ($) { Drupal.Views = {}; /** * JQuery UI tabs, Views integration component. */ Drupal.behaviors.viewsTabs = { attach: function (context) { if ($.viewsUi && $.viewsUi.tabs) { $('#views-tabset').once('views-processed').viewsTabs({ selectedClass: 'active' }); } $('a.views-remove-link').once('views-processed').click(function(event) { var id = $(this).attr('id').replace('views-remove-link-', ''); $('#views-row-' + id).hide(); $('#views-removed-' + id).get(0).checked = true; event.preventDefault(); }); // Here is to handle display deletion // (checking in the hidden checkbox and hiding out the row). $('a.display-remove-link') .addClass('display-processed') .click(function() { var id = $(this).attr('id').replace('display-remove-link-', ''); $('#display-row-' + id).hide(); $('#display-removed-' + id).get(0).checked = true; return false; }); } }; /** * Helper function to parse a querystring. */ Drupal.Views.parseQueryString = function (query) { var args = {}; var pos = query.indexOf('?'); if (pos != -1) { query = query.substring(pos + 1); } var pairs = query.split('&'); for (var i in pairs) { if (typeof(pairs[i]) == 'string') { var pair = pairs[i].split('='); // Ignore the 'q' path argument, if present. if (pair[0] != 'q' && pair[1]) { args[decodeURIComponent(pair[0].replace(/\+/g, ' '))] = decodeURIComponent(pair[1].replace(/\+/g, ' ')); } } } return args; }; /** * Helper function to return a view's arguments based on a path. */ Drupal.Views.parseViewArgs = function (href, viewPath) { // Provide language prefix. if (Drupal.settings.pathPrefix) { var viewPath = Drupal.settings.pathPrefix + viewPath; } var returnObj = {}; var path = Drupal.Views.getPath(href); // Ensure there is a correct path. if (viewPath && path.substring(0, viewPath.length + 1) == viewPath + '/') { var args = decodeURIComponent(path.substring(viewPath.length + 1, path.length)); returnObj.view_args = args; returnObj.view_path = path; } return returnObj; }; /** * Strip off the protocol plus domain from an href. */ Drupal.Views.pathPortion = function (href) { // Remove e.g. http://example.com if present. var protocol = window.location.protocol; if (href.substring(0, protocol.length) == protocol) { // 2 is the length of the '//' that normally follows the protocol. href = href.substring(href.indexOf('/', protocol.length + 2)); } return href; }; /** * Return the Drupal path portion of an href. */ Drupal.Views.getPath = function (href) { href = Drupal.Views.pathPortion(href); href = href.substring(Drupal.settings.basePath.length, href.length); // 3 is the length of the '?q=' added to the URL without clean URLs. if (href.substring(0, 3) == '?q=') { href = href.substring(3, href.length); } var chars = ['#', '?', '&']; for (var i in chars) { if (href.indexOf(chars[i]) > -1) { href = href.substr(0, href.indexOf(chars[i])); } } return href; }; })(jQuery); ;/*})'"*/ ;/*})'"*/ (function ($) { /** * A progressbar object. Initialized with the given id. Must be inserted into * the DOM afterwards through progressBar.element. * * method is the function which will perform the HTTP request to get the * progress bar state. Either "GET" or "POST". * * e.g. pb = new progressBar('myProgressBar'); * some_element.appendChild(pb.element); */ Drupal.progressBar = function (id, updateCallback, method, errorCallback) { var pb = this; this.id = id; this.method = method || 'GET'; this.updateCallback = updateCallback; this.errorCallback = errorCallback; // The WAI-ARIA setting aria-live="polite" will announce changes after users // have completed their current activity and not interrupt the screen reader. this.element = $(''); this.element.html('