Commit 7a236859 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 bugfix/3236691-form-elements-file-does-not-exist
parents 3960af25 dcb36321
......@@ -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 {
......
......@@ -252,6 +252,15 @@ details[open] .details__close-icon {
margin-right: 0;
margin-left: 12px;
}
.comment__text .vote-widget {
position: relative;
padding-left: 23px;
}
.comment__text .vote-widget .icon-vote {
position: absolute;
top: 1px;
left: 0;
}
.comment__avatar {
display: block;
}
......
......@@ -58,12 +58,6 @@
align-items: stretch;
}
[dir='rtl'] .cover-wrap {
-webkit-box-align: end;
-ms-flex-align: end;
align-items: flex-end;
}
/* IE11 */
.cover-with-canvas .cover-wrap {
......@@ -267,10 +261,6 @@
max-width: 50%;
margin-left: 25%;
}
[dir='rtl'] .hero-footer__text {
padding-right: 0;
padding-left: 1rem;
}
.block-social-profile .hero-footer__text {
-webkit-box-flex: 0;
-ms-flex: 0 0 auto;
......
......@@ -119,8 +119,7 @@ svg[class^="icon-vote"] {
.vote-like a:hover .icon-vote {
stroke: black;
fill: transparent;
-webkit-transform: scale(1.3);
transform: scale(1.3);
width: 20px;
-webkit-transition: 0.3s;
transition: 0.3s;
}
......
......@@ -9,14 +9,6 @@
line-height: 1.4;
}
[dir='rtl'] .metainfo {
-webkit-box-orient: horizontal;
-webkit-box-direction: reverse;
-ms-flex-direction: row-reverse;
flex-direction: row-reverse;
text-align: right;
}
.metainfo__avatar {
margin-right: 12px;
}
......@@ -132,13 +124,6 @@
margin-bottom: 15px;
}
[dir='rtl'] .article__special-fields .article__special-field {
-webkit-box-orient: horizontal;
-webkit-box-direction: reverse;
-ms-flex-direction: row-reverse;
flex-direction: row-reverse;
}
.article__special-fields .article__special-field:last-child {
margin-bottom: 0;
}
......
......@@ -39,6 +39,10 @@
padding-top: 0;
}
.navbar-default {
position: relative;
}
.navbar {
position: relative;
min-height: 50px;
......@@ -68,6 +72,16 @@
white-space: nowrap;
}
.navbar-user .dropdown-menu {
right: 0;
left: auto;
}
[dir='rtl'] .navbar-user .dropdown-menu {
right: auto;
left: 0;
}
.block-social-language,
.block-language {
-webkit-box-ordinal-group: 5;
......@@ -75,6 +89,12 @@
order: 4;
}
.block-social-language a.dropdown-toggle,
.block-language a.dropdown-toggle {
height: 50px;
padding-top: .875rem;
}
.navbar-header {
-webkit-box-ordinal-group: 1;
-ms-flex-order: 0;
......@@ -87,9 +107,6 @@
display: flex;
-ms-flex-wrap: wrap;
flex-wrap: wrap;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
}
.navbar-nav > li > a, .navbar-nav > li > button {
......@@ -98,6 +115,10 @@
line-height: 24px;
}
.navbar-nav.main > li {
max-width: 100%;
}
.navbar-nav > li > ul > li.expanded {
position: relative;
}
......@@ -148,16 +169,6 @@
z-index: 1030;
}
.navbar-fixed-top .navbar-user .dropdown-menu {
right: 0;
left: auto;
}
[dir='rtl'] .navbar-fixed-top .navbar-user .dropdown-menu {
right: auto;
left: 0;
}
.navbar-brand {
display: -webkit-box;
display: -ms-flexbox;
......@@ -346,10 +357,6 @@
.block-language {
margin-left: auto;
}
.block-social-language a.dropdown-toggle,
.block-language a.dropdown-toggle {
height: 50px;
}
.block-social-language ~ .navbar-user,
.block-language ~ .navbar-user {
margin-left: 0;
......@@ -365,6 +372,7 @@
margin-bottom: 13px;
}
.navbar-nav.main > li {
max-width: none;
margin-bottom: -13px;
}
.navbar-collapse {
......@@ -509,6 +517,9 @@
opacity: 1;
pointer-events: all;
}
.mode-search .navbar-default {
z-index: 1030;
}
.social-gtranslate-list--desktop {
min-width: 200px;
}
......@@ -578,7 +589,7 @@
background: #e6e6e6;
color: #4d4d4d;
}
.navbar-fixed-top .navbar-nav .open .dropdown-menu {
.navbar-nav .open .dropdown-menu {
background-color: #fff;
border: 0;
-webkit-box-shadow: 0 0 6px rgba(0, 0, 0, 0.16), 0 6px 12px rgba(0, 0, 0, 0.32);
......@@ -597,7 +608,7 @@
backface-visibility: hidden;
-webkit-overflow-scrolling: touch;
}
.navbar-fixed-top .navbar-nav .open .dropdown-menu li {
.navbar-nav .open .dropdown-menu li {
-webkit-transform: translateZ(0);
transform: translateZ(0);
}
......
!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) {