1
0
Fork 0

Merge pull request #5789 from friendica/master

Update develop from master-2019.09
This commit is contained in:
Hypolite Petovan 2018-09-23 18:55:20 -04:00 committed by GitHub
commit a6996601d5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
125 changed files with 17335 additions and 17104 deletions

View file

@ -1,7 +1,7 @@
$(document).ready(function() {
// Go to the permissions tab if the checkbox is checked.
$('body').on("click", "#id_share", function() {
if ($('#id_share').is(':checked') && !( $('#id_share').attr("disabled"))) {
if ($('#id_share').is(':checked') && !( $('#id_share').attr("disabled"))) {
$('#acl-wrapper').show();
$("a#event-perms-lnk").parent("li").show();
toggleEventNav("a#event-perms-lnk");
@ -54,20 +54,19 @@ $(document).ready(function() {
// without page reloading (e.g. closing an old modal and open a new modal).
// Otherwise we wouldn't get the ACL data.
/// @todo: Try to implement some kind of ACL reloading in acl.js.
if (typeof acl !== "undefined") {
var eventPerms = document.getElementById('event-edit-form');
acl = new ACL(
baseurl + "/acl",
[
eventPerms.dataset.allow_cid,
eventPerms.dataset.allow_gid,
eventPerms.dataset.deny_cid,
eventPerms.dataset.deny_gid
]
);
}
var eventPerms = document.getElementById('event-edit-form');
acl = new ACL(
baseurl + "/acl",
[
JSON.parse(eventPerms.dataset.allow_cid),
JSON.parse(eventPerms.dataset.allow_gid),
JSON.parse(eventPerms.dataset.deny_cid),
JSON.parse(eventPerms.dataset.deny_gid)
]
);
acl.get(0, 100);
});
// Load the html of the actual event and incect the output to the
@ -81,7 +80,7 @@ function doEventPreview() {
}
// The following functions show/hide the specific event-edit content
// The following functions show/hide the specific event-edit content
// in dependence of the selected nav.
function eventAclActive() {
$("#event-edit-wrapper, #event-preview, #event-desc-wrapper").hide();

View file

@ -15,7 +15,14 @@ $(document).ready(function() {
}).trigger('change');
// Click event listener for the album edit link/button.
$("body").on('click', '#album-edit-link', function() {
var modalUrl = $(this).attr("data-modal-url");
if (typeof modalUrl !== "undefined") {
addToModal(modalUrl, 'photo-album-edit-wrapper');
}
});
});
$(window).load(function() {

View file

@ -188,14 +188,25 @@ function loadModalTitle() {
}
}
// This function loads html content from a friendica page
// into a modal.
function addToModal(url) {
/**
* This function loads html content from a friendica page into a modal.
*
* @param {string} url The url with html content.
* @param {string} id The ID of a html element (can be undefined).
* @returns {void}
*/
function addToModal(url, id) {
var char = qOrAmp(url);
url = url + char + 'mode=none';
var modal = $('#modal').modal();
// Only search for an element if we have an ID.
if (typeof id !== "undefined") {
url = url + " div#" + id;
}
modal
.find('#modal-body')
.load(url, function (responseText, textStatus) {
@ -215,7 +226,7 @@ function addToModal(url) {
});
}
// Add a element (by it's id) to a bootstrap modal.
// Add an element (by its id) to a bootstrap modal.
function addElmToModal(id) {
var elm = $(id).html();
var modal = $('#modal').modal();