Commit 847e9e3f authored by Agami4's avatar Agami4
Browse files

Merge branch '1.3.x' of git.drupal.org:project/socialbase into...

Merge branch '1.3.x' of git.drupal.org:project/socialbase into feature/3239654-new-layout-structure-form-elements-visibility-section
parents be7dceab 7a236859
......@@ -742,7 +742,7 @@ form:not(.layout-builder-add-block) .tabledrag-handle {
form:not(.layout-builder-add-block) .tabledrag-handle ~ .form-managed-file {
display: block;
padding-left: 24px;
margin-left: 24px;
}
.table-responsive {
......
......@@ -115,6 +115,10 @@
line-height: 24px;
}
.navbar-nav.main > li {
max-width: 100%;
}
.navbar-nav > li > ul > li.expanded {
position: relative;
}
......@@ -368,6 +372,7 @@
margin-bottom: 13px;
}
.navbar-nav.main > li {
max-width: none;
margin-bottom: -13px;
}
.navbar-collapse {
......
!function(){var l=Drupal.autocomplete;Drupal.autocomplete.options.select=function(e,t){var a=l.splitValues(e.target.value);return a.pop(),0<t.item.value.search(",")?a.push('"'+t.item.label+'"'):a.push(t.item.label),e.target.value=a.join(", "),!1}}(jQuery);
\ No newline at end of file
"use strict";
(function ($) {
// Initiate the Drupal autocomplete made in core/misc/autocomplete.js
var autocomplete = Drupal.autocomplete;
/**
* Handles an autocomplete select event.
*
* @param {jQuery.Event} event
* The event triggered.
* @param {object} ui
* The jQuery UI settings object.
*
* @return {bool}
* Returns false to indicate the event status.
*/
function selectHandlerCustom(event, ui) {
var terms = autocomplete.splitValues(event.target.value); // Remove the current input.
terms.pop(); // Add the selected item.
if (ui.item.value.search(',') > 0) {
terms.push('"' + ui.item.label + '"');
} else {
terms.push(ui.item.label);
}
event.target.value = terms.join(', '); // Return false to tell jQuery UI that we've filled in the value already.
return false;
} // Override the select handler initiated in core/misc/autocomplete.js by our custom one.
Drupal.autocomplete.options.select = selectHandlerCustom;
})(jQuery);
\ No newline at end of file
!function(a){Drupal.behaviors.textareaAutogrow={attach:function(o,t){a(".form-control--autogrow",o).once("textareaAutogrow").each(function(){autosize.destroy(a(".form-control--autogrow")),autosize(a(".form-control--autogrow")),autosize.update(a(".form-control--autogrow"))})}},Drupal.behaviors.textareaFocus={attach:function(o,t){a("textarea:last").focusin(function(){a(this).parents(".main-container").toggleClass("open-keyboard")}),a("textarea:last").focusout(function(){a(this).parents(".main-container").toggleClass("open-keyboard")})}}}(jQuery);
\ No newline at end of file
"use strict";
(function ($) {
Drupal.behaviors.textareaAutogrow = {
attach: function attach(context, settings) {
// Attach autosize listener.
$(".form-control--autogrow", context).once("textareaAutogrow").each(function () {
autosize.destroy($('.form-control--autogrow'));
autosize($('.form-control--autogrow'));
autosize.update($('.form-control--autogrow'));
});
}
};
Drupal.behaviors.textareaFocus = {
attach: function attach(context, settings) {
$('textarea:last').focusin(function () {
$(this).parents('.main-container').toggleClass('open-keyboard');
});
$('textarea:last').focusout(function () {
$(this).parents('.main-container').toggleClass('open-keyboard');
});
}
};
})(jQuery);
\ No newline at end of file
!function(c){Drupal.behaviors.initDatepicker={attach:function(e,t){if(!function(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}()){var e=c(e),a=c(".form-time"),i=c(".form-date");if(function(){var e=document.createElement("input");e.setAttribute("type","date");var t="not-a-date";return e.setAttribute("value",t),e.value!==t}()&&void 0!==drupalSettings.socialbase&&void 0!==drupalSettings.socialbase.datepicker&&void 0!==drupalSettings.socialbase.datepicker.nativeDatePickFields&&Array.isArray(drupalSettings.socialbase.datepicker.nativeDatePickFields)){const n=drupalSettings.socialbase.datepicker.nativeDatePickFields;i=i.filter(function(){const e=c(this),t=e.attr("name");return!t||!n.some(e=>t.includes(e))})}e.find(a).once("timePicker").each(function(){a.prop("type","text"),a.timepicker({show2400:!1,scrollDefault:"now",timeFormat:"H:i",step:5}),a.on("changeTime",function(){var e=c("#edit-field-event-date-end-0-value-time");e.val()||e.val(c(this).val())})}),e.find(i).once("datePicker").each(function(){var n=c("#edit-field-event-date-0-value-date"),r=c("#edit-field-event-date-end-0-value-date");i.prop("type","text"),i.datepicker({altFormat:"yy-mm-dd",dateFormat:"yy-mm-dd",onSelect:function(e,t){var a,i;r.val()?(a=new Date(n[0].value).getTime(),(i=new Date(r[0].value).getTime())<a&&r.val(e),i<a&&n.val(e)):r.val(e)},beforeShowDay:function(e){var t=new Date(n.val()).getTime()-864e5,a=new Date(r.val()).getTime(),e=e.getTime();return t<=e&&e<=a?[!0,"bg-info",""]:[!0,"",""]}})})}}}}(jQuery);
\ No newline at end of file
"use strict";
(function ($) {
Drupal.behaviors.initDatepicker = {
attach: function attach(context, settings) {
// Only for Desktop we switch the jquery datepicker.
if (!isMobile()) {
// Defaults
var $context = $(context);
var $time = $('.form-time');
var $date = $('.form-date'); // We want to use the native date picker when the browser supports this
// on specific fields and fields have been defined as requiring the
// native date picker.
if (browserSupportsDateInput() && typeof drupalSettings.socialbase !== "undefined" && typeof drupalSettings.socialbase.datepicker !== "undefined" && typeof drupalSettings.socialbase.datepicker.nativeDatePickFields !== "undefined" && Array.isArray(drupalSettings.socialbase.datepicker.nativeDatePickFields)) {
// Filter out any date elements where the name attribute contains any
// of the strings in the array of field names to exclude.
var nativeFieldNames = drupalSettings.socialbase.datepicker.nativeDatePickFields;
$date = $date.filter(function () {
var $dateEl = $(this);
var elName = $dateEl.attr('name'); // If it has no name then keep it.
if (!elName) {
return true;
} // Keep it if it has no match to the configured excluded fields.
return !nativeFieldNames.some(function (excludedName) {
return elName.includes(excludedName);
});
});
} // TIME
$context.find($time).once('timePicker').each(function () {
// Change it's input to text. Only for date element and only on Desktop.
// If JS is disabled the fallback is the HTML 5 element, not too user friendly.
$time.prop('type', 'text'); // Initiate the datepicker element. So we can make it user friendly again.
$time.timepicker({
'show2400': false,
'scrollDefault': 'now',
'timeFormat': 'H:i',
'step': 5
}); // Listen for changes in the time field and update the end value.
$time.on('changeTime', function () {
var endTime = $("#edit-field-event-date-end-0-value-time");
if (!endTime.val()) endTime.val($(this).val());
});
}); // DATES
$context.find($date).once('datePicker').each(function () {
// Set the prepoluted value of the datepicker for the end date
var startDate = $("#edit-field-event-date-0-value-date");
var endDate = $("#edit-field-event-date-end-0-value-date"); // Change it's input to text. Only for date element and only on Desktop.
// If JS is disabled the fallback is the HTML 5 element, not too user friendly.
$date.prop('type', 'text'); // Initiate the datepicker element. So we can make it user friendly again.
$date.datepicker({
altFormat: 'yy-mm-dd',
dateFormat: 'yy-mm-dd',
// @Todo we can alter this to show the user a different format.
onSelect: function onSelect(dateText, inst) {
// Check if end date field is empty and populate the target field
if (!endDate.val()) {
endDate.val(dateText);
} // If the end date field is already set start comparing timestamps
else {
// Create timestamps to compare
var startDateTimestamp = new Date(startDate[0].value).getTime();
var endDateTimestamp = new Date(endDate[0].value).getTime();
if (startDateTimestamp > endDateTimestamp) endDate.val(dateText);
if (endDateTimestamp < startDateTimestamp) startDate.val(dateText);
}
},
beforeShowDay: function beforeShowDay(date) {
// Create timestamps to compare
var startDateTimestamp = new Date(startDate.val()).getTime() - 86400000; // Minus a day in ms
var endDateTimestamp = new Date(endDate.val()).getTime();
var currentDateTimestamp = date.getTime();
if (currentDateTimestamp >= startDateTimestamp && currentDateTimestamp <= endDateTimestamp) {
return [true, 'bg-info', ''];
}
return [true, '', ''];
}
});
}); //
}
}
};
/**
* Check if the browser supports [type='date'] input fields.
*
* See https://stackoverflow.com/a/10199306/576060
*/
function browserSupportsDateInput() {
var input = document.createElement('input');
input.setAttribute('type', 'date');
var notADateValue = 'not-a-date';
input.setAttribute('value', notADateValue);
return input.value !== notADateValue;
}
function isMobile() {
try {
document.createEvent("TouchEvent");
return true;
} catch (e) {
return false;
}
}
})(jQuery);
\ No newline at end of file
!function(e,a){"use strict";a.ImageWidgetCropType.prototype.updateSummary=function(){return""},a.behaviors.socialBaseImageWidgetCrop={attach:function(a,t){e(".image-widget-data").each(function(a,t){e("> .form-file",t).length||e(t).data("crop-attached")?e("> .form-file",t).length&&e(t).data("crop-attached")&&e(t).data("crop-attached",!1):(e(t).parent().next(".image-data__crop-wrapper").attr("open","open"),e(t).data("crop-attached",!0))})}},e(".image-widget-data").each(function(a,t){e("> .form-file",t).length||e(t).data("crop-attached",!0)}),delete a.behaviors.imageWidgetCrop.detach}(jQuery,Drupal,drupalSettings);
\ No newline at end of file
"use strict";
/**
* @file
* Defines the custom behaviors needed for cropper integration.
*/
(function ($, Drupal, drupalSettings) {
'use strict';
/**
* Updates the summary of the wrapper.
*/
Drupal.ImageWidgetCropType.prototype.updateSummary = function () {
return '';
};
Drupal.behaviors.socialBaseImageWidgetCrop = {
attach: function attach(context, drupalSettings) {
// Open widget when file is uploaded.
$('.image-widget-data').each(function (i, e) {
if (!$('> .form-file', e).length && !$(e).data('crop-attached')) {
$(e).parent().next('.image-data__crop-wrapper').attr('open', 'open');
$(e).data('crop-attached', true);
} else if ($('> .form-file', e).length && $(e).data('crop-attached')) {
$(e).data('crop-attached', false);
}
});
}
};
$('.image-widget-data').each(function (i, e) {
if (!$('> .form-file', e).length) {
$(e).data('crop-attached', true);
}
});
delete Drupal.behaviors.imageWidgetCrop.detach;
})(jQuery, Drupal, drupalSettings);
\ No newline at end of file
!function(i){window.informBlockClick=void i(".block-data-policy").on("click",function(){window.innerWidth<900&&i(this).find("footer a").click()})}(jQuery,Drupal);
\ No newline at end of file
"use strict";
/**
* @file
* Inform block click behaviour.
*/
(function ($, Drupal) {
window.informBlockClick = function () {
$('.block-data-policy').on('click', function () {
var viewportWidth = window.innerWidth;
var tabletLandscapeUpBreakpoint = 900;
if (viewportWidth < tabletLandscapeUpBreakpoint) {
$(this).find('footer a').click();
}
});
}();
})(jQuery, Drupal);
\ No newline at end of file
!function(l,r){"use strict";function e(){}window.likeAndDislikeService=window.likeAndDislikeService||(e.vote=function(n,o,e){l.ajax({type:"POST",url:drupalSettings.path.baseUrl+"like_and_dislike/"+o+"/"+e+"/"+n,success:function(a){["like","dislike"].forEach(function(e){var i="#"+e+"-container-"+o+"-"+n,t=l(i+" a");if(0!=t.length&&(a.operation[e]?t.addClass("voted"):t.removeClass("voted"),l(i+" .count").text(a[e+"s"]),"like"===e)){var s=r.formatPlural(a[e+"s"],"@count like","@count likes");t.parent().nextAll(".vote__count").find("a").html(s).attr("data-dialog-options",'{"title":"'+s+'", "width":"auto"}')}}),l(".region.region-highlighted").html("<div class='messages__wrapper layout-container'><div class='messages messages--"+a.message_type+" role='contentinfo'>"+a.message+"</div></div>")}})},e)}(jQuery,Drupal);
\ No newline at end of file
"use strict";
/**
* @file
* Like and dislike icons behavior.
*/
(function ($, Drupal) {
'use strict';
window.likeAndDislikeService = window.likeAndDislikeService || function () {
function likeAndDislikeService() {}
likeAndDislikeService.vote = function (entity_id, entity_type, tag) {
$.ajax({
type: "POST",
url: drupalSettings.path.baseUrl + 'like_and_dislike/' + entity_type + '/' + tag + '/' + entity_id,
success: function success(response) {
// Expected response is a json object where likes is the new number
// of likes, dislikes is the new number of dislikes, message_type is
// the type of message to display ("status" or "warning") and message
// is the message to display.
['like', 'dislike'].map(function (iconType) {
var selector = '#' + iconType + '-container-' + entity_type + '-' + entity_id;
var $aTag = $(selector + ' a');
if ($aTag.length == 0) {
return;
}
response.operation[iconType] ? $aTag.addClass('voted') : $aTag.removeClass('voted');
$(selector + ' .count').text(response[iconType + 's']); // Updates the likes count.
if (iconType === 'like') {
var likeText = Drupal.formatPlural(response[iconType + 's'], "@count like", "@count likes");
$aTag.parent().nextAll('.vote__count').find('a').html(likeText).attr('data-dialog-options', '{"title":"' + likeText + '", "width":"auto"}');
}
}); // Display a message whether the vote was registered or an error
// happened.
// @todo - this will work only for case when theme has messages in
// highlighted region.
$('.region.region-highlighted').html("<div class='messages__wrapper layout-container'><div class='messages messages--" + response.message_type + " role='contentinfo'>" + response.message + "</div></div>");
}
});
};
return likeAndDislikeService;
}();
})(jQuery, Drupal);
\ No newline at end of file
!function(e){Drupal.behaviors.navbarCollapse={attach:function(o,n){var a=e("body");a.once("navbarCollapse").on("click",".dropdown-toggle, #content",function(){e(".navbar-collapse").collapse("hide");var o=e(".navbar-default .dropdown");setTimeout(function(){o.hasClass("open")?a.addClass("open-dropdown-menu"):a.removeClass("open-dropdown-menu")},0)})}}}(jQuery);
\ No newline at end of file
"use strict";
(function ($) {
Drupal.behaviors.navbarCollapse = {
attach: function attach(context, settings) {
// Delegate the event to body to prevent screenreaders from thinking
// teasers are clickable.
var $body = $('body');
$body.once('navbarCollapse').on('click', '.dropdown-toggle, #content', function () {
$('.navbar-collapse').collapse('hide');
var headerDropDown = $('.navbar-default .dropdown');
setTimeout(function () {
if (headerDropDown.hasClass('open')) {
$body.addClass('open-dropdown-menu');
} else {
$body.removeClass('open-dropdown-menu');
}
}, 0);
});
}
};
})(jQuery);
\ No newline at end of file
!function(n){Drupal.behaviors.navbarMainMenu={attach:function(a,e){n(".menu-main > .main > .expanded > .dropdown-menu > .expanded > a").removeAttr("data-toggle").removeClass("dropdown-toggle")}}}(jQuery);
\ No newline at end of file
"use strict";
(function ($) {
Drupal.behaviors.navbarMainMenu = {
attach: function attach(context, settings) {
$('.menu-main > .main > .expanded > .dropdown-menu > .expanded > a').removeAttr('data-toggle').removeClass('dropdown-toggle');
}
};
})(jQuery);
\ No newline at end of file
!function(e){Drupal.behaviors.navbarProfileDropdown={attach:function(n,o){function a(){900<=window.innerWidth?e(".dropdown-menu",".dropdown.profile.not-logged-in").removeClass().addClass("menu nav navbar-nav"):e(".menu.nav.navbar-nav",".dropdown.profile.not-logged-in").removeClass().addClass("dropdown-menu")}a(),e(window).resize(_.debounce(function(){a()},500))}}}(jQuery);
\ No newline at end of file
"use strict";
(function ($) {
Drupal.behaviors.navbarProfileDropdown = {
attach: function attach(context, settings) {
// Toggles inline display of profile dropdown menu items.
var navbarResizeUpdate = function navbarResizeUpdate() {
var viewportWidth = window.innerWidth;
var tabletLandscapeUpBreakpoint = 900;
if (viewportWidth >= tabletLandscapeUpBreakpoint) {
$('.dropdown-menu', '.dropdown.profile.not-logged-in').removeClass().addClass('menu nav navbar-nav');
} else {
$('.menu.nav.navbar-nav', '.dropdown.profile.not-logged-in').removeClass().addClass('dropdown-menu');
}
}; // Executed on document load and window resize.
navbarResizeUpdate();
$(window).resize(_.debounce(function () {
navbarResizeUpdate();
}, 500));
}
};
})(jQuery);
\ No newline at end of file
!function(a){Drupal.behaviors.initNavbarSearch={attach:function(e,o){a(".navbar__open-search-block").on("click",function(e){e.preventDefault(),a("body").addClass("mode-search"),a(".search-take-over .form-text").focus()}),a(".btn--close-search-take-over").on("click",function(){a("body").removeClass("mode-search"),a(".search-take-over .form-text").blur()}),a("body").keydown(function(e){27==e.keyCode&&(a("body").removeClass("mode-search"),a(".search-take-over .form-text").blur())})}}}(jQuery);
\ No newline at end of file
"use strict";
(function ($) {
/*
** Behaviour when user clicks the element
* with class navbar__open-search-block the body gets
* a class which opens the form. This file is part
* of the navbar component.
*/
Drupal.behaviors.initNavbarSearch = {
attach: function attach(context, settings) {
$('.navbar__open-search-block').on('click', function (e) {
e.preventDefault();
$('body').addClass('mode-search');
$('.search-take-over .form-text').focus();
});
$('.btn--close-search-take-over').on('click', function () {
$('body').removeClass('mode-search');
$('.search-take-over .form-text').blur();
});
$('body').keydown(function (e) {
if (e.keyCode == 27) {
$('body').removeClass('mode-search');
$('.search-take-over .form-text').blur();
}
});
}
};
})(jQuery);
\ No newline at end of file
!function(w){function i(e){function t(e){(e=e||window.event).preventDefault?e.preventDefault():e.returnValue=!1;var t=function e(t,i){return t&&(i(t)?t:e(t.parentNode,i))}(e.target||e.srcElement,function(e){return"A"===e.tagName});if(t){for(var i,n=t.parentNode,r=t.parentNode.childNodes,a=r.length,o=0,l=0;l<a;l++)if(1===r[l].nodeType){if(r[l]===t){i=o;break}o++}return 0<=i&&s(i,n),!1}}for(var s=function(e,t,i,n){w(".iframe-container .pswp").length&&(l=w(".pswp").first(),w(".pswp").each(function(){w(this).remove()}),l.appendTo("body"));var r,a,o,l=document.querySelectorAll(".pswp")[0];if(o=function(e){for(var t,i,n,r=e.childNodes,a=r.length,o=[],l=0;l<a;l++)if(1===(e=r[l]).nodeType){t=e.children,i=e.getAttribute("data-size").split("x"),(n={src:e.getAttribute("href"),w:parseInt(i[0],10),h:parseInt(i[1],10),author:e.getAttribute("data-author")}).el=e,0<t.length&&(n.msrc=t[0].getAttribute("src"),1<t.length&&(n.title=t[1].innerHTML));var s=e.getAttribute("data-med");s&&(i=e.getAttribute("data-med-size").split("x"),n.m={src:s,w:parseInt(i[0],10),h:parseInt(i[1],10)}),n.o={src:n.src,w:n.w,h:n.h},o.push(n)}return o}(t),a={galleryUID:t.getAttribute("data-pswp-uid"),getThumbBoundsFn:function(e){var t=o[e].el.children[0],i=window.pageYOffset||document.documentElement.scrollTop,n=t.getBoundingClientRect();return{x:n.left,y:n.top+i,w:n.width}},addCaptionHTMLFn:function(e,t,i){return e.title?(t.children[0].innerHTML=e.title+"<br/><small>Photo: "+e.author+"</small>",!0):(t.children[0].innerText="",!1)}},n)if(a.galleryPIDs){for(var s=0;s<o.length;s++)if(o[s].pid==e){a.index=s;break}}else a.index=parseInt(e,10)-1;else a.index=parseInt(e,10);if(!isNaN(a.index)){for(var d=document.getElementsByName("gallery-style"),c=0,u=d.length;c<u;c++)if(d[c].checked){"radio-all-controls"==d[c].id||"radio-minimal-black"==d[c].id&&(a.mainClass="pswp--minimal--dark",a.barsSize={top:0,bottom:0},a.captionEl=!1,a.fullscreenEl=!1,a.shareEl=!1,a.bgOpacity=.85,a.tapToClose=!0,a.tapToToggleControls=!1);break}i&&(a.showAnimationDuration=0),r=new PhotoSwipe(l,PhotoSwipeUI_Default,o,a);var p,h,f=!1,g=!0;r.listen("beforeResize",function(){var e=window.devicePixelRatio?window.devicePixelRatio:1;e=Math.min(e,2.5),1200<=(p=r.viewportSize.x*e)||!r.likelyTouchDevice&&800<p||1200<screen.width?f||(h=f=!0):f&&(h=!(f=!1)),h&&!g&&r.invalidateCurrItems(),g=g&&!1,h=!1}),r.listen("gettingData",function(e,t){f?(t.src=t.o.src,t.w=t.o.w,t.h=t.o.h):(t.src=t.m.src,t.w=t.m.w,t.h=t.m.h)}),r.init()}},i=document.querySelectorAll(e),n=0,r=i.length;n<r;n++)i[n].setAttribute("data-pswp-uid",n+1),i[n].onclick=t;var a=function(){var e=window.location.hash.substring(1),t={};if(e.length<5)return t;for(var i=e.split("&"),n=0;n<i.length;n++)if(i[n]){var r=i[n].split("=");r.length<2||(t[r[0]]=r[1])}return t.gid&&(t.gid=parseInt(t.gid,10)),t}();a.pid&&a.gid&&s(a.pid,i[a.gid-1],!0,!0)}Drupal.behaviors.photoSwipe={attach:function(e,t){i(".photoswipe-gallery")}}}(jQuery);
\ No newline at end of file
"use strict";
(function ($) {
var initPhotoSwipeFromDOM = function initPhotoSwipeFromDOM(gallerySelector) {
var parseThumbnailElements = function parseThumbnailElements(el) {
var thumbElements = el.childNodes,
numNodes = thumbElements.length,
items = [],
el,
childElements,
thumbnailEl,
size,
item;
for (var i = 0; i < numNodes; i++) {
el = thumbElements[i]; // include only element nodes
if (el.nodeType !== 1) {
continue;
}
childElements = el.children;
size = el.getAttribute('data-size').split('x'); // create slide object
item = {
src: el.getAttribute('href'),
w: parseInt(size[0], 10),
h: parseInt(size[1], 10),
author: el.getAttribute('data-author')
};
item.el = el; // save link to element for getThumbBoundsFn
if (childElements.length > 0) {
item.msrc = childElements[0].getAttribute('src'); // thumbnail url
if (childElements.length > 1) {
item.title = childElements[1].innerHTML; // caption (contents of figure)
}
}
var mediumSrc = el.getAttribute('data-med');
if (mediumSrc) {
size = el.getAttribute('data-med-size').split('x'); // "medium-sized" image
item.m = {
src: mediumSrc,
w: parseInt(size[0], 10),
h: parseInt(size[1], 10)
};
} // original image
item.o = {
src: item.src,
w: item.w,
h: item.h
};
items.push(item);
}
return items;
}; // find nearest parent element
var closest = function closest(el, fn) {
return el && (fn(el) ? el : closest(el.parentNode, fn));
};
var onThumbnailsClick = function onThumbnailsClick(e) {
e = e || window.event;
e.preventDefault ? e.preventDefault() : e.returnValue = false;
var eTarget = e.target || e.srcElement;
var clickedListItem = closest(eTarget, function (el) {
return el.tagName === 'A';
});
if (!clickedListItem) {
return;
}
var clickedGallery = clickedListItem.parentNode;
var childNodes = clickedListItem.parentNode.childNodes,
numChildNodes = childNodes.length,
nodeIndex = 0,
index;
for (var i = 0; i < numChildNodes; i++) {
if (childNodes[i].nodeType !== 1) {
continue;
}
if (childNodes[i] === clickedListItem) {
index = nodeIndex;
break;
}
nodeIndex++;
}
if (index >= 0) {
openPhotoSwipe(index, clickedGallery);
}
return false;
};
var photoswipeParseHash = function photoswipeParseHash() {
var hash = window.location.hash.substring(1),
params = {};
if (hash.length < 5) {
// pid=1
return params;
}
var vars = hash.split('&');
for (var i = 0; i < vars.length; i++) {
if (!vars[i]) {
continue;
}
var pair = vars[i].split('=');
if (pair.length < 2) {
continue;
}