/(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);
;/*})'"*/
;/*})'"*/
(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('
' +
'
' +
'' +
'
' +
'' +
'
');
};
/**
* Set the percentage and status message for the progressbar.
*/
Drupal.progressBar.prototype.setProgress = function (percentage, message) {
if (percentage >= 0 && percentage <= 100) {
$('div.progress-bar', this.element).css('width', percentage + '%');
$('div.progress-bar', this.element).attr('aria-valuenow', percentage);
$('div.percentage', this.element).html(percentage + '%');
}
$('div.message', this.element).html(message);
if (this.updateCallback) {
this.updateCallback(percentage, message, this);
}
};
/**
* Start monitoring progress via Ajax.
*/
Drupal.progressBar.prototype.startMonitoring = function (uri, delay) {
this.delay = delay;
this.uri = uri;
this.sendPing();
};
/**
* Stop monitoring progress via Ajax.
*/
Drupal.progressBar.prototype.stopMonitoring = function () {
clearTimeout(this.timer);
// This allows monitoring to be stopped from within the callback.
this.uri = null;
};
/**
* Request progress data from server.
*/
Drupal.progressBar.prototype.sendPing = function () {
if (this.timer) {
clearTimeout(this.timer);
}
if (this.uri) {
var pb = this;
// When doing a post request, you need non-null data. Otherwise a
// HTTP 411 or HTTP 406 (with Apache mod_security) error may result.
$.ajax({
type: this.method,
url: this.uri,
data: '',
dataType: 'json',
success: function (progress) {
// Display errors.
if (progress.status == 0) {
pb.displayError(progress.data);
return;
}
// Update display.
pb.setProgress(progress.percentage, progress.message);
// Schedule next timer.
pb.timer = setTimeout(function () { pb.sendPing(); }, pb.delay);
},
error: function (xmlhttp) {
pb.displayError(Drupal.ajaxError(xmlhttp, pb.uri));
}
});
}
};
/**
* Display errors on the page.
*/
Drupal.progressBar.prototype.displayError = function (string) {
var error = $('
').append(string);
$(this.element).before(error).hide();
if (this.errorCallback) {
this.errorCallback(this);
}
};
})(jQuery);
;/*})'"*/
;/*})'"*/
/**
* jQuery Plugin which renders a standard select with hierarchical options as
* a set of selects, one for each level of the hierarchy.
*
*/
;
(function ($, window, document, undefined) {
// Create the defaults once
var pluginName = "simplerSelect",
defaults = {
noneLabel: "- Please choose -",
noneValue: "_none",
labels: []
};
// The actual plugin constructor
function Plugin(element, options) {
this.element = element;
this.$element = $(element);
// vars
this.settings = $.extend({}, defaults, options);
this._selectOptions = [];
this._tree = null;
this._defaults = defaults;
this._name = pluginName;
// start!
this.init();
}
Plugin.prototype = {
init: function () {
// parse options
var that = this;
$('option', this.element).each(function () {
var $this = $(this);
var parent = $this.data('parent');
parent = (typeof parent !== 'undefined') ? parent : 0;
var value = $this.val();
that._selectOptions.push({
'value': value,
'parent': parent,
'label': $this.text(),
'children': []
});
});
// console.log(this._selectOptions );
this._tree = this.buildTree(this._selectOptions);
if (this._tree == null) {
return;
}
var initialValue = this.$element.val();
var initialParents = [];
if (initialValue) {
// console.log(typeof initialValue);
if (typeof initialValue !== 'string') {
// if array, flatten it
initialValue = initialValue.shift();
}
// get all parents, starting from the initial value
initialParents = this.getAllParents(initialValue);
// reverse the parents, that they start from the root
initialParents.reverse();
// add the current value as the last leave.
initialParents.push(initialValue);
//console.log(initialParents);
}
// create the root select
var $select = this.createSelect(this._tree);
this.$element.after($select);
// create the other selects
var $currentSelect = $select;
$.each(initialParents, function (idx, value) {
that.selectSetValue($currentSelect, value);
var optionInfo = that.getOptionInfoByValue(value);
var $nextSelect = that.createSelect(optionInfo.children, value, idx+1);
$currentSelect.after($nextSelect);
$currentSelect = $nextSelect;
});
//hide the original
this.$element.hide();
},
/**
* onChange handler of a select element
*
* @param $currentSelect
*/
onChange: function ($currentSelect) {
// remove deeper selects
this.selectRemoveNext($currentSelect);
// get the selected value and also set the original drop-down
var $selected = $currentSelect.find('option:selected');
var selectedValue = $selected.val();
var parentValue = $selected.data('parent-value');
if (typeof parentValue == 'undefined') {
parentValue = selectedValue;
}
this.$element.val(parentValue);
this.$element.change();
if (selectedValue == this.settings.noneValue) {
return;
}
// build new child select
var optionInfo = this.getOptionInfoByValue(selectedValue);
if (typeof optionInfo.children !== 'undefined') {
var currentLevel = this.selectGetLevel($currentSelect);
$newSelect = this.createSelect(optionInfo.children, selectedValue, currentLevel);
this.addSelectAfter($currentSelect, $newSelect);
}
},
/**
* Given an array of options, build an HTML select element
*
* @param options
* @returns {*|HTMLElement}
*/
createSelect: function (options, parent, level) {
if (options.length < 1) return;
var that = this;
var parent = typeof parent !== 'undefined' ? parent : that.settings.noneValue;
var level = typeof level !== 'undefined' ? level : 0;
var label = typeof this.settings.labels[level] !== 'undefined' ? this.settings.labels[level] : '';
var $select = $('