Skip to content

Commit

Permalink
Merge pull request #104 from H2-invent/feature/maxParticipants
Browse files Browse the repository at this point in the history
add a max Participants to public rooms
  • Loading branch information
holema authored Mar 27, 2021
2 parents f6a5bf4 + cd509c4 commit 015ff77
Show file tree
Hide file tree
Showing 15 changed files with 509 additions and 409 deletions.
46 changes: 32 additions & 14 deletions assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ import listPlugin from '@fullcalendar/list';
import Chart from 'chart.js';
import autosize from 'autosize'
import ClipboardJS from 'clipboard'

$.urlParam = function (name) {
var results = new RegExp('[\?&]' + name + '=([^&#]*)').exec(window.location.href);
if (results == null) {
Expand Down Expand Up @@ -118,13 +119,15 @@ $(document).on('click', '.loadContent', function (e) {

});
});
function initServerFeatures(){

function initServerFeatures() {

getMoreFeature($('.moreFeatures').val())
$('.moreFeatures').change(function (){
getMoreFeature($(this).val());
$('.moreFeatures').change(function () {
getMoreFeature($(this).val());
})
}

$('#loadContentModal').on('shown.bs.modal', function (e) {
$('.flatpickr').flatpickr({
minDate: "today",
Expand All @@ -148,7 +151,21 @@ $('#loadContentModal').on('shown.bs.modal', function (e) {
}
});

$(".copyLink").click(function(){
if (typeof $('room_public') !== 'undefined') {
if ($('#room_public').prop('checked')) {
$('#maxParticipants').collapse('show')
} else {
$('#maxParticipants').collapse('hide')
}
$('#room_public').change(function (){
if ($('#room_public').prop('checked')) {
$('#maxParticipants').collapse('show')
} else {
$('#maxParticipants').collapse('hide')
}
})
}
$(".copyLink").click(function () {
var $temp = $("<input>");
$("body").append($temp);
$temp.val($(element).text()).select();
Expand All @@ -166,14 +183,14 @@ $('#loadContentModal').on('shown.bs.modal', function (e) {
});

});
$(document).on( 'click','.directSend', function(e) {
$(document).on('click', '.directSend', function (e) {
var $url = $(this).prop('href');
var $targetUrl = $(this).data('url');
var target = $(this).data('target');

e.preventDefault();
$.get($url,function (){
$(target).closest('div').load($targetUrl +' ' +target);
$.get($url, function () {
$(target).closest('div').load($targetUrl + ' ' + target);
})
});
$(".clickable-row").click(function () {
Expand Down Expand Up @@ -240,15 +257,16 @@ function initDropDown() {


}
function getMoreFeature(id){
if(typeof id !== 'undefined'){
$.getJSON(moreFeatureUrl,'id='+id,function (data){

function getMoreFeature(id) {
if (typeof id !== 'undefined') {
$.getJSON(moreFeatureUrl, 'id=' + id, function (data) {
var feature = data.feature;
for (var prop in feature) {
if(feature[prop] == true){
$('#'+prop).removeClass('d-none')
}else {
$('#'+prop).addClass('d-none')
if (feature[prop] == true) {
$('#' + prop).removeClass('d-none')
} else {
$('#' + prop).addClass('d-none')
}
}
})
Expand Down
Loading

0 comments on commit 015ff77

Please sign in to comment.