1 2if (typeof isStreamLive == 'undefined') { 3 var isStreamLive = true; 4} 5if (typeof streamUrl == 'undefined') { 6 var streamUrl = ""; 7} 8if (typeof bcuID == 'undefined') { 9 var bcuID = ""; 10} 11 12function videoHandler(e) { 13 console.log("videoHandler triggered"); 14 console.log(e); 15} 16 17function checkIfLive() 18{ 19 $.get("/ajax/isStreamLive.php", function(data) { 20 if (data == "1") 21 isStreamLive = true; 22 }).done(function() { 23 }).fail(function(data, textStatus, xhr) { 24 isStreamLive = false; 25 }).always(function() { 26 }); 27 console.log("Is stream live: ", isStreamLive); 28 return isStreamLive; 29} 30 31/* 32 1 => "Force go to stream PRIMARY", 33 2 => "Force go to stream SECONDARY", 34 3 => "Force refresh stream PRIMARY", 35 4 => "Force refresh stream SECONDARY", 36 5 => "Force refresh stream BOTH", 37 6 => "Stream ended" 38*/ 39function ping() 40{ 41 $.get("/ajax/pong.php?bcuID="+bcuID, function(data) { 42 if (data == "0") 43 return true; 44 else if (data == "1") 45 { 46 window.location.replace('/?s=1'); 47 } 48 else if (data == "2") 49 { 50 window.location.replace('/?s=2'); 51 } 52 else if (data == "6") 53 { 54 //stream ended 55 $("#streamPlayer").remove(); 56 $("#streamEnded").show(); 57 videojs(player).dispose(); 58 } 59 else 60 { 61 location.reload(); 62 } 63 }).done(function() { 64 }).fail(function(data, textStatus, xhr) { 65 return false; 66 }).always(function() { 67 }); 68} 69 70(function( $ ) { 71 72 'use strict'; 73 74 /* 75 Popup with video or map 76 */ 77 theme.fn.execOnceTroughEvent( $('.popup-youtube, .popup-vimeo, .popup-gmaps'), 'mouseover.trigger.iframe.lightbox', function(){ 78 $(this).magnificPopup({ 79 type: 'iframe', 80 mainClass: 'mfp-fade', 81 removalDelay: 160, 82 preloader: false, 83 84 fixedContentPos: false 85 }); 86 }); 87 88 /* 89 Dialog with CSS animation 90 */ 91 theme.fn.execOnceTroughEvent( $('.popup-with-zoom-anim'), 'mouseover.trigger.zoom.lightbox', function(){ 92 $(this).magnificPopup({ 93 type: 'inline', 94 95 fixedContentPos: false, 96 fixedBgPos: true, 97 98 overflowY: 'auto', 99 100 closeBtnInside: true, 101 preloader: false, 102 103 midClick: true, 104 removalDelay: 300, 105 mainClass: 'my-mfp-zoom-in' 106 }); 107 }); 108 109 theme.fn.execOnceTroughEvent( $('.popup-with-move-anim'), 'mouseover.trigger.slide.lightbox', function(){ 110 $(this).magnificPopup({ 111 type: 'inline', 112 113 fixedContentPos: false, 114 fixedBgPos: true, 115 116 overflowY: 'auto', 117 118 closeBtnInside: true, 119 preloader: false, 120 121 midClick: true, 122 removalDelay: 300, 123 mainClass: 'my-mfp-slide-bottom' 124 }); 125 }); 126 127 /* 128 Form 129 */ 130 theme.fn.execOnceTroughEvent( $('.popup-with-form'), 'mouseover.trigger.form.lightbox', function(){ 131 $(this).magnificPopup({ 132 type: 'inline', 133 preloader: false, 134 focus: '#resetPwdEmail2', 135 callbacks: { 136 open: function() { 137 $('html').addClass('lightbox-opened'); 138 }, 139 close: function() { 140 $('html').removeClass('lightbox-opened'); 141 } 142 } 143 }); 144 }); 145 146 /* 147 Ajax 148 */ 149 theme.fn.execOnceTroughEvent( $('.simple-ajax-popup'), 'mouseover.trigger.ajax.lightbox', function(){ 150 $(this).magnificPopup({ 151 type: 'ajax', 152 callbacks: { 153 open: function() { 154 $('html').addClass('lightbox-opened'); 155 }, 156 close: function() { 157 $('html').removeClass('lightbox-opened'); 158 } 159 } 160 }); 161 }); 162 163}).apply( this, [ jQuery ]); 164 165 166 167$( document ).ready(function() { 168 169 $('.gdpr-preferences-trigger').on('click', function(e){ 170 e.preventDefault(); 171 $('.gdpr-preferences-popup').addClass('show'); 172 }); 173 174 /* ON LOAD: set dark mode if user wants it, and does not have a preference set */ 175 if ($.cookie("dark") === undefined) 176 { 177 if (window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches) { 178 $('html').addClass("dark"); 179 $.cookie("dark", 1, {expires: 15, path: '/'}); 180 $('#accessibilityColorSchemeLabel').html("Svetli naÄin"); 181 } else { 182 $('html').removeClass("dark"); 183 $.cookie("dark", 0, {expires: 15, path: '/'}); 184 $('#accessibilityColorSchemeLabel').html("Temni naÄin"); 185 } 186 } 187 /* ON CHANGE, isto kot zgoraj */ 188 window.matchMedia('(prefers-color-scheme: dark)').addEventListener('change', event => { 189 if (event.matches) 190 { 191 $('html').addClass("dark"); 192 $.cookie("dark", 1, {expires: 15, path: '/'}); 193 $('#accessibilityColorSchemeLabel').html("Svetli naÄin"); 194 } 195 else 196 { 197 $('html').removeClass("dark"); 198 $.cookie("dark", 0, {expires: 15, path: '/'}); 199 $('#accessibilityColorSchemeLabel').html("Temni naÄin"); 200 } 201 }); 202 203 $('#color-scheme-toggle').on('click', function(e){
204 e.preventDefault(); 205 206 if ($('html').hasClass("dark")) 207 { 208 /* smo v temnem, gremo v svetlo */ 209 $('html').removeClass("dark"); 210 $.cookie("dark", 0, {expires: 15, path: '/'}); 211 $('#accessibilityColorSchemeLabel').html("Temni naÄin"); 212 } 213 else 214 { 215 /* smo v svetlem, gremo v temo */ 216 $('html').addClass("dark"); 217 $.cookie("dark", 1, {expires: 15, path: '/'}); 218 $('#accessibilityColorSchemeLabel').html("Svetli naÄin"); 219 } 220 }); 221 222 if ($('#frmSignInHeader').length) 223 { 224 $('#frmSignInHeader').on('submit', function(e){ 225 /*e.preventDefault();*/ 226 }); 227 $('#frmSignInHeaderSubmit').on('click', function(e){ 228 e.preventDefault(); 229 230 $('#frmSignInHeader').submit(); 231 }); 232 233 } 234 235 236 /*$('#forgotPwdLink').on('click', function(e){ 237 238 });*/ 239 240 /* PWD RESET FROM HEADER */ 241 if ($('#resetPwdForm').length) 242 { 243 $('#resetPwdFormSubmit').on('click', function(e){ 244 e.preventDefault(); 245 246 $("#resetPwdForm .alert").remove(); 247 248 $.ajax({ 249 type: 'GET', 250 url: '/ajax/resetPwd.php', 251 data: { e: $("#resetPwdForm input[name=email]").val() }, 252 dataType: 'json', 253 success: function (data) { 254 $.each(data, function(index, element) { 255 if (index == "response" && element == "success") 256 { 257 $("#resetPwdForm input[name=email]").val(""); 258 $('#resetPwdForm').prepend('<div class="alert alert-success">Navodila ste prejeli na elektronski naslov.</div>'); 259 } 260 else if (index == "response" && element == "error") 261 { 262 $("#resetPwdForm input[name=email]").val(""); 263 $('#resetPwdForm').prepend('<div class="alert alert-danger" id="resetPwdFormErrorBox">Napaka.</div>'); 264 } 265 else if (index == "errorMessage") 266 { 267 $('#resetPwdFormErrorBox').append('<br/>' + element); 268 } 269 }); 270 } 271 }); 272 }); 273 } 274 275 /* PWD RESET FROM LOGIN PAGE */ 276 if ($('#resetPwdForm2').length) 277 { 278 279 $('#resetPwdForm2').on('submit', function(e){ 280 e.preventDefault(); 281 $('#resetPwdFormSubmit2').click(); 282 }); 283 $('#resetPwdFormSubmit2').on('click', function(e){ 284 e.preventDefault(); 285 286 $("#resetPwdForm2 .alert").remove(); 287 288 $.ajax({ 289 type: 'GET', 290 url: '/ajax/resetPwd.php', 291 data: { e: $("#resetPwdForm2 #resetPwdEmail2").val() }, 292 dataType: 'json', 293 success: function (data) { 294 $.each(data, function(index, element) { 295 if (index == "response" && element == "success") 296 { 297 $("#resetPwdForm2 #resetPwdEmail2").val(""); 298 $('#resetPwdForm2').prepend('<div class="alert alert-success">Navodila ste prejeli na elektronski naslov.</div>'); 299 } 300 else if (index == "response" && element == "error") 301 { 302 $("#resetPwdForm2 #resetPwdEmail2").val(""); 303 $('#resetPwdForm2').prepend('<div class="alert alert-danger" id="resetPwdFormErrorBox">Napaka.</div>'); 304 } 305 else if (index == "errorMessage") 306 { 307 $('#resetPwdFormErrorBox').append('<br/>' + element); 308 } 309 }); 310 } 311 }); 312 }); 313 } 314 315 /* 316 REGISTRACIJA 317 */ 318 if ($('#frmSignUp').length) 319 { 320 $('#frmSignUp').on('submit', function(e){ 321 e.preventDefault(); 322 323 324 $.ajax({ 325 type: 'POST', 326 url: '/ajax/users_register.php', 327 data: $('#frmSignUp').serialize(), 328 dataType: 'json', 329 success: function (data) { 330 331 if (data.response === "success") 332 { 333 $('#successBoxSignup').hide(); 334 $('#successBoxSignup').removeClass("d-none"); 335 $('#successBoxSignup').show("slow"); 336 $('#frmSignUp').trigger("reset"); 337 } 338 else 339 { 340 $('#errorBoxSignup').hide(); 341 $('#errorBoxSignup').removeClass("d-none"); 342 $('#errorBoxSignup').show("slow"); 343 $('.errorTxt').html(data.errorMessage); 344 } 345 } 346 }); 347 }); 348 349 350 351 } 352 353 /* REQUEST AN EVENT ORGANISATION FOR MYSELF */ 354 if ($('#requestEventOrgForm').length) 355 { 356 var requestEventOrgFormValidator = $('#requestEventOrgForm').validate(); 357 $('#ID_aEventOrg').on('change', function() { 358 if ($(this).find(":selected").val() == "") 359 { 360 $("#requestEventOrgForm input.req").prop('required',true); 361 requestEventOrgFormValidator = $('#requestEventOrgForm').validate(); 362 363 } else 364 { 365 $("#requestEventOrgForm input.req").prop('required',false); 366 requestEventOrgFormValidator.destroy(); 367 $("#requestEventOrgForm input").removeClass("is-invalid"); 368 $("#requestEventOrgForm input").val(""); 369 } 370 }); 371 $('#requestEventOrgFormSubmit').on('click', function(e){
372 373 if ($('#requestEventOrgForm').valid()) 374 { 375 $.ajax({ 376 type: 'POST', 377 url: '/ajax/users_eventOrg.php', 378 data: $('#requestEventOrgForm').serialize(), 379 dataType: 'json', 380 success: function (data) { 381 $.each(data, function(index, element) { 382 if (index == "response" && element == "success") 383 { 384 $('#eventOrgFrm_success').fadeIn(); 385 setTimeout(function () { 386 location.reload(true); 387 }, 3000); 388 } 389 else if (index == "response" && element == "error") 390 { 391 $('#eventOrgFrm_error').fadeIn(); 392 } 393 else if (index == "errorMessage") 394 { 395 $('#eventOrgFrm_errorMsg').html(element); 396 } 397 }); 398 $('#requestEventOrg').modal('hide'); 399 $('#requestEventOrgForm').trigger("reset"); 400 } 401 }); 402 } 403 404 405 }); 406 $('#requestEventOrgForm').on('submit', function(e){ 407 e.preventDefault(); 408 }); 409 $("#requestEventOrgForm input").change(function() { 410 $("#ID_aEventOrg").val("").change(); 411 }); 412 $('#requestEventOrg').on('shown.bs.modal', function(e){ 413 $('#eventOrgFrm_error').hide(); 414 $('#eventOrgFrm_success').hide(); 415 }); 416 } 417 418 /* 419 editEventOrg 420 */ 421 $('#editEventForm').validate(); 422 $('.deleteOrgBtn').on('click', function(e){ 423 e.preventDefault(); 424 const refID = $(this).data('refid'); 425 426 $.confirm({ 427 title: 'Odstrani organizacijo?', 428 content: 'Organizacija ostane, le vi izgubite pravice do objave dogodkov.', 429 buttons: { 430 deleteUser: { 431 text: 'Odstrani zame', 432 btnClass: 'btn-danger', 433 action: function () { 434 $.ajax({
435 type: 'POST', 436 url: '/ajax/users_eventOrg.php', 437 data: { "IDorg": refID, "action" : "delete" }, 438 dataType: 'json', 439 success: function (data) { 440 441 if (data.response === "success") 442 { 443 $('#eventOrg_'+refID).hide("slow"); 444 } 445 else 446 { 447 $.alert({ 448 title: 'Napaka!', 449 content: data.errorMessage, 450 }); 451 } 452 } 453 }); 454 455 } 456 }, 457 preklic: { 458 text: 'PrekliÄi' 459 } 460 461 } 462 }); 463 464 }); 465 $('.editOrgBtn').on('click', function(e){ 466 e.preventDefault(); 467 468 const refID = $(this).data('refid'); 469 $("#editEventForm input#IDorg").val(refID); 470 $("#editEventForm input#title").val( $("#title_"+refID).html() ); 471 $("#editEventForm input#address").val( $("#address_"+refID).html() ); 472 $("#editEventForm input#post").val( $("#post_"+refID).html() ); 473 $("#editEventForm input#locality").val( $("#locality_"+refID).html() ); 474 $("#editEventForm input#email").val( $("#email_"+refID).html() ); 475 $("#editEventForm input#web").val( $("#web_"+refID).html() ); 476 $("#editEventForm input#phone").val( $("#phone_"+refID).html() ); 477 478 $('#editEventOrg').modal('show'); 479 }); 480 $('#editEventOrg').on('hidden.bs.modal', function(e){ 481 $("#editEventForm input").val(""); 482 }); 483 $('#editEventOrgSubmit').on('click', function(e){ 484 if ($('#editEventForm').valid()) 485 { 486 $.ajax({ 487 type: 'POST', 488 url: '/ajax/users_eventOrg.php', 489 data: $('#editEventForm').serialize(), 490 dataType: 'json', 491 success: function (data) { 492 const refID = $("#editEventForm input#IDorg").val(); 493 $.each(data, function(index, element) { 494 //console.log(index, element); 495 if (index == "response" && element == "success") 496 { 497 $("#title_"+refID).html( $("#editEventForm input#title").val() ); 498 $("#address_"+refID).html( $("#editEventForm input#address").val() ); 499 $("#post_"+refID).html( $("#editEventForm input#post").val() ); 500 $("#locality_"+refID).html( $("#editEventForm input#locality").val() ); 501 $("#email_"+refID).html( $("#editEventForm input#email").val() ); 502 $("#web_"+refID).html( $("#editEventForm input#web").val() ); 503 $("#phone_"+refID).html( $("#editEventForm input#phone").val() ); 504 505 $('#eventOrgError'+refID).remove(); 506 } 507 else if (index == "response" && element == "error") 508 { 509 $('#eventOrg_'+refID).append('<div class="alert alert-danger" id="eventOrgError'+refID+'">Napaka.</div>'); 510 } 511 else if (index == "errorMessage") 512 { 513 $('#eventOrgError'+refID).html(element); 514 } 515 }); 516 $('#editEventOrg').modal('hide'); 517 $('#editEventForm').trigger("reset"); 518 } 519 }); 520 } 521 }); 522 523 /* list events */ 524 $('.myEventDelete').on('click', function(e){ 525 e.preventDefault(); 526 const refID = $(this).data('refid'); 527 528 $.confirm({ 529 title: 'IzbriÅ¡em vsebino?', 530 content: 'Res želite nepreklicno izbrisati dogodek?', 531 buttons: { 532 deleteUser: { 533 text: 'IzbriÅ¡i', 534 btnClass: 'btn-danger', 535 action: function () { 536 $.ajax({
537 type: 'POST', 538 url: '/ajax/users_event.php', 539 data: { "eventID": refID, "action" : "delete" }, 540 dataType: 'json', 541 success: function (data) { 542 543 if (data.response === "success") 544 { 545 $('#eventRow_'+refID).hide("slow"); 546 } 547 else 548 { 549 $.alert({ 550 title: 'Napaka!', 551 content: data.errorMessage, 552 }); 553 } 554 } 555 }); 556 557 } 558 }, 559 preklic: { 560 text: 'PrekliÄi' 561 } 562 563 } 564 }); 565 }); 566 567 568 /* event edit form */ 569 if ($('#bcuEditForm').length) 570 { 571 $("#venueSearch").change(function() { 572 $('#ID_gVenue').val(""); 573 }); 574 var lastSearchQ = ""; 575 $('#venueSearch').autocomplete({ 576 serviceUrl: '/ajax/users_event.php', 577 paramName: 'venueSearch', 578 dataType: 'json', 579 minChars: 3, 580 preserveInput: false, 581 onInvalidateSelection: function() { 582 $('#ID_gVenue').val(""); 583 }, 584 onSearchStart: function(param) { 585 lastSearchQ = $(this).val(); 586 }, 587 onSelect: function (suggestion) { 588 589 if (suggestion.data > 0) 590 { 591 $('#ID_gVenue').val(suggestion.data); 592 } 593 else 594 { 595 $.confirm({ 596 title: 'Novo prizoriÅ¡Äe', 597 content: '' + 598 '<form action="" class="formName">' + 599 '<div class="form-group">' + 600 '<label class="required">Ime prizoriÅ¡Äa</label>' + 601 '<input type="text" placeholder="" class="venueTitle form-control" value="' + lastSearchQ + '" required />' + 602 '<label class="mt-2 required">Naslov</label>' + 603 '<input type="text" placeholder="" class="venueAddr form-control" value="" required />' + 604 '</div>' + 605 '</form>', 606 buttons: { 607 formSubmit: { 608 text: 'Dodaj', 609 btnClass: 'btn-blue', 610 action: function () { 611 var venueTitle = this.$content.find('.venueTitle').val(); 612 if(!venueTitle){ 613 this.$content.find('.venueTitle').addClass("is-invalid"); 614 return false; 615 } else 616 { 617 this.$content.find('.venueTitle').removeClass("is-invalid"); 618 this.$content.find('.venueTitle').addClass("is-valid"); 619 } 620 var venueAddr = this.$content.find('.venueAddr').val(); 621 if(!venueAddr){ 622 this.$content.find('.venueAddr').addClass("is-invalid"); 623 return false; 624 } else 625 { 626 this.$content.find('.venueAddr').removeClass("is-invalid"); 627 this.$content.find('.venueAddr').addClass("is-valid"); 628 } 629 $.ajax({
630 type: 'POST', 631 url: '/ajax/users_event.php', 632 data: { "venueTitle": venueTitle, "venueAddr" : venueAddr }, 633 dataType: 'json', 634 success: function (data) { 635 636 if (data.response === "success") 637 { 638 $('#ID_gVenue').val(data.venueID); 639 $('#venueSearch').val(venueTitle); 640 } 641 else 642 { 643 $.alert({ 644 title: 'Napaka!', 645 content: data.errorMessage, 646 }); 647 } 648 } 649 }); 650 651 } 652 }, 653 cancel: function () { 654 $('#ID_gVenue').val(""); 655 $('#venueSearch').val(""); 656 }, 657 }, 658 onContentReady: function () { 659 // bind to events 660 var jc = this; 661 this.$content.find('form').on('submit', function (e) { 662 // if the user submits the form by pressing enter in the field. 663 e.preventDefault(); 664 jc.$$formSubmit.trigger('click'); // reference the button and click it 665 }); 666 } 667 }); 668 } 669 670 671 } 672 }); 673 674 675 //$('#content').richText(); 676 677 $('#content').richText({ 678 bold: true, 679 italic: true, 680 underline: true, 681 682 leftAlign: false, 683 centerAlign: false, 684 rightAlign: false, 685 justify: false, 686 687 // lists 688 ol: true, 689 ul: true, 690 691 // title 692 heading: false, 693 694 // fonts 695 fonts: false, 696 fontColor: false, 697 fontSize: false, 698 699 // uploads 700 imageUpload: false, 701 fileUpload: false, 702 703 // media 704 videoEmbed: false, 705 706 // link 707 urls: true, 708 709 // tables 710 table: true, 711 712 // code 713 removeStyles: true, 714 code: false, 715 716 // colors 717 colors: [], 718 719 // dropdowns 720 fileHTML: '', 721 imageHTML: '', 722 723 // translations 724 translations: { 725 'title': 'Title', 726 'white': 'White', 727 'black': 'Black', 728 'brown': 'Brown', 729 'beige': 'Beige', 730 'darkBlue': 'Dark Blue', 731 'blue': 'Blue', 732 'lightBlue': 'Light Blue', 733 'darkRed': 'Dark Red', 734 'red': 'Red', 735 'darkGreen': 'Dark Green', 736 'green': 'Green', 737 'purple': 'Purple', 738 'darkTurquois': 'Dark Turquois', 739 'turquois': 'Turquois', 740 'darkOrange': 'Dark Orange', 741 'orange': 'Orange', 742 'yellow': 'Yellow', 743 'imageURL': 'Image URL', 744 'fileURL': 'File URL', 745 'linkText': 'Link text', 746 'url': 'URL', 747 'size': 'Velikost', 748 'responsive': 'Responsive', 749 'text': 'Besedilo', 750 'openIn': 'Odpri v', 751 'sameTab': 'Isto okno', 752 'newTab': 'Novo okno', 753 'align': 'Align', 754 'left': 'Left', 755 'center': 'Center', 756 'right': 'Right', 757 'rows': 'Rows', 758 'columns': 'Columns', 759 'add': 'Dodaj', 760 'pleaseEnterURL': 'Vnesite povezavo', 761 'videoURLnotSupported': 'Video URL not supported', 762 'pleaseSelectImage': 'Please select an image', 763 'pleaseSelectFile': 'Please select a file', 764 'bold': 'Krepko', 765 'italic': 'LežeÄe', 766 'underline': 'PodÄrtano', 767 'alignLeft': 'Align left', 768 'alignCenter': 'Align centered', 769 'alignRight': 'Align right', 770 'addOrderedList': 'Add ordered list', 771 'addUnorderedList': 'Add unordered list', 772 'addHeading': 'Add Heading/title', 773 'addFont': 'Add font', 774 'addFontColor': 'Add font color', 775 'addFontSize' : 'Add font size', 776 'addImage': 'Add image', 777 'addVideo': 'Add video', 778 'addFile': 'Add file', 779 'addURL': 'Vstavi povezavo', 780 'addTable': 'Vstavi tabelo', 781 'removeStyles': 'Odstrani oblikovanje', 782 'code': 'Prikaži HTML kodo', 783 'undo': 'Razveljavi', 784 'redo': 'Uveljavi', 785 'close': 'Zapri' 786 }, 787 788 // privacy 789 youtubeCookies: false, 790 791 // preview 792 preview: false, 793 794 // placeholder 795 placeholder: '', 796 797 // developer settings 798 useSingleQuotes: false, 799 height: 500, 800 heightPercentage: 0, 801 adaptiveHeight: false, 802 id: "", 803 class: "", 804 useParagraph: true, 805 //maxlength: 65535, 806 callback: undefined, 807 useTabForNext: false 808 }); 809 810 811 812 /* file upload - naslovka */ 813 var fileuploaderDiv = $("div").find("[data-provides='fileupload']"); 814 815 var reader = new FileReader(); 816 reader.onload = function (e) { 817 $('#bcuImageImg').attr('src', e.target.result); 818 $("#bcuImageImg").addClass("d-block"); 819 $("#bcuImageRemoveBtn").addClass("d-block"); 820 } 821 function readURL(input) { 822 if (input.files && input.files[0]) {
823 reader.readAsDataURL(input.files[0]); 824 } 825 } 826 $("#bcuImageFile").change(function(){ 827 828 readURL(this); 829 fileuploaderDiv.removeClass("fileupload-new"); 830 fileuploaderDiv.addClass("fileupload-exists"); 831 832 $(".fileupload-preview", fileuploaderDiv).html(this.files[0].name); 833 834 $("#ID_bcuMedia").val(""); 835 }); 836 837 $('#bcuImageFileRemove').on('click', function(e){ 838 $("#ID_bcuMedia").val(""); 839 fileuploaderDiv.addClass("fileupload-new"); 840 fileuploaderDiv.removeClass("fileupload-exists"); 841 $(".fileupload-preview", fileuploaderDiv).html(""); 842 $('#bcuImageImg').attr('src', 'data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw=='); 843 }); 844 845 846 $('#startDT').on('change', function() { 847 $('#endDT').attr("min", $(this).val()); 848 }); 849 850 851 $('.dz-remove').on('click', function(e){ 852 $.ajax({ 853 type: 'POST', 854 url: '/ajax/users_event.php', 855 data: { "eventID": $("#bcuID").val(), "mediaTitle" : $(this).data('filename') }, 856 dataType: 'json', 857 success: function (data) { 858 859 if (data.response === "success") 860 { 861 $('#bcuMedia_'+data.mediaID).hide("slow"); 862 } 863 else 864 { 865 $.alert({ 866 title: 'Napaka!', 867 content: data.errorMessage, 868 }); 869 } 870 } 871 }); 872 }); 873 874 var additionalImagesZone = $("div#imagesDropzone").dropzone({ 875 url: "/ajax/users_event.php?eventID="+$("#bcuID").val(), 876 maxFilesize: 7, //Mb 877 thumbnailWidth: 180, 878 thumbnailHeight: 180, 879 maxFiles: 6, 880 addRemoveLinks: true, 881 acceptedFiles: 'image/*', 882 dictDefaultMessage: 'Kliknite za izbiro datoteke oz. jih odložite tukaj', 883 dictFallbackMessage: 'VaÅ¡ brskalnik ne omogoÄa odlaganja datotek. Klikni in izberi datoteko.', 884 dictFallbackText: 'VaÅ¡ brskalnik ne omogoÄa prenosa datotek.', 885 dictFileTooBig: 'Slika je prevelika ({{filesize}}MiB). NajveÄja velikost: {{maxFilesize}}MiB.', 886 dictInvalidFileType: 'Podprte so le slike.', 887 dictResponseError: 'Strežnik je odgovoril s kodo {{statusCode}}.', 888 dictCancelUpload: 'PrekliÄi prenos', 889 dictCancelUploadConfirmation: 'Ste prepriÄani, da želite prekiniti prenos?', 890 dictRemoveFile: 'Odstrani sliko', 891 dictMaxFilesExceeded: 'Å tevilo slik je omejeno na 6.', 892 init: function() { 893 this.on("addedfile", function(file) { 894 //console.log("addedfile", file); 895 }); 896 this.on("success", function(file) { 897 //console.log("success", file); 898 }); 899 this.on("removedfile", function(file) { 900 $.ajax({
901 type: 'POST', 902 url: '/ajax/users_event.php', 903 data: { "eventID": $("#bcuID").val(), "mediaTitle" : file.name }, 904 dataType: 'json', 905 success: function (data) { 906 907 if (data.response === "success") 908 { 909 $('#bcuMedia_'+data.mediaID).hide("slow"); 910 } 911 else 912 { 913 $.alert({ 914 title: 'Napaka!', 915 content: data.errorMessage, 916 }); 917 } 918 } 919 }); 920 }); 921 this.on("error", function(file, message) { 922 //console.log(file, message); 923 }); 924 } 925 }); 926 $("div#imagesDropzone").addClass("dropzone"); 927 928 929 930 931 932 } 933 /* end event edit form */ 934 935 /* events export form */ 936 if ($('#exportForm').length) 937 { 938 939 $('#endD').attr("min", $('#startD').val()); 940 $('#startD').on('change', function() { 941 $('#endD').attr("min", $(this).val()); 942 }); 943 } 944 945 946 947 948 /* 949 https://github.com/devbridge/jQuery-Autocomplete 950 */ 951 952 953 954 955 if ($('#liveStreamWebko').length) 956 { 957 958 if (isStreamLive == false) 959 { 960 setInterval(function() { 961 if (checkIfLive()) 962 location.reload(); 963 }, 43*1000); 964 965 966 var x = setInterval(function() { 967 968 var now = new Date().getTime(); 969 var distance = countDownDate - now; 970 971 // Time calculations for days, hours, minutes and seconds 972 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); 973 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); 974 var seconds = Math.floor((distance % (1000 * 60)) / 1000); 975 976 document.getElementById("odstevanje").innerHTML = "Å e " + hours + " h " 977 + minutes + " min " + seconds + " s"; 978 979 if (distance < 0) { 980 clearInterval(x); 981 document.getElementById("odstevanje").innerHTML = "VSAK TRENUTEK"; 982 } 983 }, 1000); 984 } else { 985 986 } 987 988 setInterval(function() { 989 ping(); 990 }, 14*1000); 991 992 993 if ($('#liveVideo').length) 994 document.getElementById('liveVideo').addEventListener('ended',videoHandler,false); 995 996 997 } 998 999 1000 1001 let eventsPage = 6; 1002 if ($('#loadMoreEventsBtn').length) 1003 { 1004 $('#loadMoreEventsBtn').click(function(e){ 1005 1006 $('#loadMoreEventsBtn').html('<i class="fa fa-spinner fa-spin"></i>'); 1007 1008 $.get("/ajax/retrieveEvents.php?page="+eventsPage, function(data) { 1009 1010 if (data.length > 10) 1011 { 1012 $('#loadMoreEvents').append(data); 1013 eventsPage = eventsPage + 1; 1014 } else { 1015 $('#loadMoreEventsBtn').hide(); 1016 } 1017 1018 }).done(function() { 1019 1020 $('#loadMoreEventsBtn').html('Prikaži veÄ'); 1021 1022 }).fail(function(data, textStatus, xhr) { 1023 $('#loadMoreEventsBtn').hide(); 1024 1025 }).always(function() { 1026 }); 1027 1028 }); 1029 1030 1031 1032 1033 } 1034 1035 1036 /* START Reminder Btn */ 1037 if ($('#addReminderBtn').length) 1038 { 1039 // Current info: https://github.com/AnandChowdhary/calendar-link/tree/master 1040 1041 $('#addReminderBtn').click(function(e){ 1042 $('.reminderDropdownChoose').toggleClass('reminderDropdownChoose-show'); 1043 e.preventDefault(); 1044 }); 1045 $(document).click(function(e){ 1046 if(!$(e.target).closest('#addReminderBtn, .reminderDropdownChoose').length){ 1047 $('.reminderDropdownChoose').removeClass('reminderDropdownChoose-show'); 1048 } 1049 }) 1050 1051 $('#addReminderBtnGoogle').click(function(e){ 1052 if (eventData == undefined) 1053 { 1054 console.log("No event data!"); 1055 return false; 1056 } 1057 /* 1058 https://calendar.google.com/calendar/u/0/r/eventedit? 1059 dates=20240409T193000/20240409T213000 1060 &ctz=Europe/Ljubljana 1061 &text=Stand+up+veÄer:+Kobal,+Kuzman,+PeÅ¡ka 1062 &location=Dom+kulture+Kamnik,+Fužine+10,+Kamnik 1063 &details=stand+up 1064 */ 1065 //let reminderLink = "https://calendar.google.com/calendar/u/0/r/eventedit?"; 1066 let reminderLink = "https://calendar.google.com/calendar/render?action=TEMPLATE&"; 1067 1068 1069 let [startYear, startMonth, startDay] = eventData['startDate'].split("-"); 1070 let [startHour, startMinute] = eventData['startTime'].split(":"); 1071 let startCombined = startYear + startMonth + startDay + "T" + startHour + startMinute + "00"; 1072 1073 let endYear, endMonth, endDay; 1074 1075 if (eventData['endDate'] !== null) { 1076 [endYear, endMonth, endDay] = eventData['endDate'].split("-"); 1077 } else { 1078 [endYear, endMonth, endDay] = eventData['startDate'].split("-"); 1079 } 1080 1081 let [endHour, endMinute] = eventData['endTime'].split(":"); 1082 let endCombined = endYear + endMonth + endDay + "T" + endHour + endMinute + "00"; 1083 1084 reminderLink += "dates=" + startCombined + "/" + endCombined; 1085 reminderLink += "&ctz=" + encodeURIComponent(eventData['timeZone']); 1086 reminderLink += "&text=" + encodeURIComponent(eventData['name']); 1087 reminderLink += "&location=" + encodeURIComponent(eventData['location']); 1088 reminderLink += "&details=" + encodeURIComponent(eventData['description']); 1089 1090 //alert(reminderLink); 1091 //console.log(reminderLink); 1092 window.open(reminderLink, "_blank"); 1093 }); 1094 $('#addReminderBtn365').click(function(e){
1095 /* 1096 https://outlook.office.com/calendar/action/compose?rru=addevent 1097 &startdt=2024-04-09T17:30:00Z 1098 &enddt=2024-04-09T19:30:00Z 1099 &subject=Stand%20up%20veÄer%3A%20Kobal%2C%20Kuzman%2C%20PeÅ¡ka 1100 &location=Dom%20kulture%20Kamnik%2C%20Fužine%2010%2C%20Kamnik 1101 &body=stand%20up 1102 */ 1103 if (eventData == undefined) 1104 { 1105 console.log("No event data!"); 1106 return false; 1107 } 1108 1109 let reminderLink = "https://outlook.office.com/calendar/action/compose?rru=addevent"; 1110 1111 if (eventData['endDate'] == null) { 1112 eventData['endDate'] = eventData['startDate']; 1113 } 1114 1115 reminderLink += "&startdt=" + eventData['startDate'] + "T" + eventData['startTime'] + ":00"; 1116 reminderLink += "&enddt=" + eventData['endDate'] + "T" + eventData['endTime'] + ":00"; 1117 reminderLink += "&subject=" + encodeURIComponent(eventData['name']); 1118 reminderLink += "&location=" + encodeURIComponent(eventData['location']); 1119 reminderLink += "&body=" + encodeURIComponent(eventData['description']); 1120 1121 window.open(reminderLink, "_blank"); 1122 }); 1123 $('#addReminderBtnICal, #addReminderBtnApple').click(function(e){ 1124 if (eventData === undefined || eventData === null) { 1125 console.log("No event data!"); 1126 return false; 1127 } 1128 if (eventData['endDate'] == null) { 1129 eventData['endDate'] = eventData['startDate']; 1130 } 1131 1132 // Combine startDate and startTime to get start time 1133 let startDate = eventData['startDate']; 1134 let startTime = eventData['startTime']; 1135 let startDateTime = `${startDate.replace(/-/g, '')}T${startTime.replace(/:/g, '')}00`; 1136 1137 // Combine endDate and endTime to get end time 1138 let endDate = eventData['endDate']; 1139 let endTime = eventData['endTime']; 1140 let endDateTime = `${endDate.replace(/-/g, '')}T${endTime.replace(/:/g, '')}00`; 1141 1142 const formattedDescription = (eventData['description'] || "") 1143 .replace(/,/gm, ",") 1144 .replace(/;/gm, ";") 1145 .replace(/\r\n/gm, "\n") 1146 .replace(/\n/gm, "\\n") 1147 .replace(/(\\n)[\s\t]+/gm, "\\n"); 1148 const formattedLocation = (eventData['location'] || "") 1149 .replace(/,/gm, ",") 1150 .replace(/;/gm, ";") 1151 .replace(/\r\n/gm, "\n") 1152 .replace(/\n/gm, "\\n") 1153 .replace(/(\\n)[\s\t]+/gm, "\\n"); 1154 1155 const dtstamp = new Date().toISOString().slice(0, -5).replace(/[:-]/g, '') + 'Z'; 1156 console.log(dtstamp); 1157 1158 const calendarChunks = [ 1159 { key: "BEGIN", value: "VCALENDAR" }, 1160 { key: "VERSION", value: "2.0" }, 1161 { key: "PRODID", value: "WebkoCMS" }, 1162 { key: "BEGIN", value: "VEVENT" }, 1163 { key: "UID", value: eventData['bcuID'] }, 1164 { key: "DTSTAMP", value: dtstamp }, 1165 { key: "DTSTART", value: startDateTime }, 1166 { key: "DTEND", value: endDateTime }, 1167 { key: "SUMMARY", value: eventData['name'] }, 1168 { key: "DESCRIPTION", value: formattedDescription }, 1169 { key: "LOCATION", value: formattedLocation }, 1170 { key: "END", value: "VEVENT" }, 1171 { key: "END", value: "VCALENDAR" } 1172 ]; 1173 1174 let calendarUrl = ""; 1175 1176 calendarChunks.forEach((chunk) => { 1177 if (chunk.value) { 1178 //calendarUrl += `${chunk.key}:${encodeURIComponent(`${chunk.value}`)}`; 1179 calendarUrl += `${chunk.key}:${(`${chunk.value}`)}`; 1180 calendarUrl += "\r\n"; 1181 } 1182 }); 1183 1184 //console.log(calendarUrl); 1185 //window.location.href = "data:text/calendar;charset=utf-8," + encodeURIComponent(calendarUrl); 1186 1187 const blob = new Blob([calendarUrl], { type: "text/calendar;charset=utf-8" }); 1188 const url = URL.createObjectURL(blob);
1189 const a = document.createElement("a"); 1190 a.href = url; 1191 a.download = "domkulture.org_koledar.ics"; 1192 document.body.appendChild(a); 1193 a.click(); 1194 1195 document.body.removeChild(a); 1196 URL.revokeObjectURL(url); 1197 }); 1198 1199 1200 } 1201 /* END Reminder Btn */ 1202 1203 1204 let fontCurrent = 0; 1205 $('#accessibilityBtn').click(function(e){ 1206 e.preventDefault(); 1207 }); 1208 function refreshFontSize() 1209 { 1210 //console.log("Font size: "+fontCurrent+"."); 1211 if (fontCurrent < 0) 1212 { 1213 $('#accessibilityFontBigger').removeClass("btn-success"); 1214 $('#accessibilityFontBigger').addClass("btn-dark-scale-2"); 1215 $('#accessibilityFontSmaller').addClass("btn-success"); 1216 $('#accessibilityFontSmaller').removeClass("btn-dark-scale-2"); 1217 $('#accessibilityFontReset').removeClass("btn-success"); 1218 $('#accessibilityFontReset').addClass("btn-dark-scale-2"); 1219 1220 if (fontCurrent < 0) 1221 $('#accessibilityFontSmaller').prop('disabled', true); 1222 else 1223 $('#accessibilityFontSmaller').prop('disabled', false); 1224 } 1225 else if (fontCurrent > 0) 1226 { 1227 $('#accessibilityFontBigger').addClass("btn-success"); 1228 $('#accessibilityFontBigger').removeClass("btn-dark-scale-2"); 1229 $('#accessibilityFontSmaller').removeClass("btn-success"); 1230 $('#accessibilityFontSmaller').addClass("btn-dark-scale-2"); 1231 $('#accessibilityFontReset').removeClass("btn-success"); 1232 $('#accessibilityFontReset').addClass("btn-dark-scale-2"); 1233 1234 if (fontCurrent > 1) 1235 $('#accessibilityFontBigger').prop('disabled', true); 1236 else 1237 $('#accessibilityFontBigger').prop('disabled', false); 1238 } 1239 else 1240 { 1241 $('#accessibilityFontBigger').removeClass("btn-success"); 1242 $('#accessibilityFontBigger').addClass("btn-dark-scale-2"); 1243 $('#accessibilityFontSmaller').removeClass("btn-success"); 1244 $('#accessibilityFontSmaller').addClass("btn-dark-scale-2"); 1245 $('#accessibilityFontReset').addClass("btn-success"); 1246 $('#accessibilityFontReset').removeClass("btn-dark-scale-2"); 1247 1248 $('#accessibilityFontBigger').prop('disabled', false); 1249 $('#accessibilityFontSmaller').prop('disabled', false); 1250 } 1251 1252 $('html').removeClass("accessFontPlus1"); 1253 $('html').removeClass("accessFontPlus2"); 1254 $('html').removeClass("accessFontMinus1"); 1255 1256 if (fontCurrent == 1) 1257 $('html').addClass("accessFontPlus1"); 1258 else if (fontCurrent == 2) 1259 $('html').addClass("accessFontPlus2"); 1260 else if (fontCurrent == -1) 1261 $('html').addClass("accessFontMinus1"); 1262 1263 $.cookie("accessibilityFontSize", fontCurrent, {expires: 15, path: '/'}); 1264 1265 } 1266 if ($.cookie("accessibilityFontSize") !== undefined) 1267 { 1268 fontCurrent = $.cookie("accessibilityFontSize"); 1269 refreshFontSize(); 1270 } 1271 $('#accessibilityFontBigger').click(function(e){ 1272 e.preventDefault(); 1273 1274 fontCurrent++; 1275 refreshFontSize(); 1276 }); 1277 $('#accessibilityFontSmaller').click(function(e){ 1278 e.preventDefault(); 1279 1280 fontCurrent--; 1281 refreshFontSize(); 1282 }); 1283 $('#accessibilityFontReset').click(function(e){ 1284 e.preventDefault(); 1285 1286 fontCurrent = 0; 1287 refreshFontSize(); 1288 }); 1289 1290 1291 1292 if ($.cookie("accessibilityFontDyslexic") == 1) 1293 { 1294 $('html').addClass("accessDyslexic"); 1295 $('#accessibilityFontDyslexic').addClass("btn-success"); 1296 $('#accessibilityFontDyslexic').removeClass("btn-dark-scale-2"); 1297 } 1298 $('#accessibilityFontDyslexic').click(function(e){ 1299 e.preventDefault(); 1300 1301 if ($('html').hasClass("accessDyslexic")) 1302 { 1303 $('html').removeClass("accessDyslexic"); 1304 $.cookie("accessibilityFontDyslexic", 0, {expires: 15, path: '/'}); 1305 $(this).removeClass("btn-success"); 1306 $(this).addClass("btn-dark-scale-2"); 1307 } 1308 else 1309 { 1310 $('html').addClass("accessDyslexic"); 1311 $.cookie("accessibilityFontDyslexic", 1, {expires: 15, path: '/'}); 1312 $(this).addClass("btn-success"); 1313 $(this).removeClass("btn-dark-scale-2"); 1314 } 1315 }); 1316 1317 $('#accessibilityReset').click(function(e){ 1318 e.preventDefault(); 1319 1320 fontCurrent = 0; 1321 refreshFontSize(); 1322 1323 $('html').removeClass("accessDyslexic"); 1324 $.cookie("accessibilityFontDyslexic", 0, {expires: 15, path: '/'}); 1325 $('#accessibilityFontDyslexic').removeClass("btn-success"); 1326 $('#accessibilityFontDyslexic').addClass("btn-dark-scale-2"); 1327 1328 $('html').removeClass("accessSaturation");
1329 $.cookie("accessibilitySaturation", 0, {expires: 15, path: '/'}); 1330 $('#accessibilityColorSaturation').removeClass("btn-success"); 1331 $('#accessibilityColorSaturation').addClass("btn-dark-scale-2"); 1332 }); 1333 1334 1335 $('#accessibilityColorScheme').click(function(e){ 1336 if ($('html').hasClass("dark")) 1337 { 1338 /* smo v temnem, gremo v svetlo */ 1339 $('html').removeClass("dark"); 1340 $.cookie("dark", 0, {expires: 15, path: '/'}); 1341 $('#accessibilityColorSchemeLabel').html("Temni naÄin"); 1342 } 1343 else 1344 { 1345 /* smo v svetlem, gremo v temo */ 1346 $('html').addClass("dark"); 1347 $.cookie("dark", 1, {expires: 15, path: '/'}); 1348 $('#accessibilityColorSchemeLabel').html("Svetli naÄin"); 1349 } 1350 }); 1351 1352 if ($.cookie("accessibilitySaturation") == 1) 1353 { 1354 $('html').addClass("accessSaturation"); 1355 $('#accessibilityColorSaturation').addClass("btn-success"); 1356 $('#accessibilityColorSaturation').removeClass("btn-dark-scale-2"); 1357 } 1358 $('#accessibilityColorSaturation').click(function(e){ 1359 e.preventDefault(); 1360 1361 if ($('html').hasClass("accessSaturation")) 1362 { 1363 $('html').removeClass("accessSaturation"); 1364 $.cookie("accessibilitySaturation", 0, {expires: 15, path: '/'}); 1365 $(this).removeClass("btn-success"); 1366 $(this).addClass("btn-dark-scale-2"); 1367 } 1368 else 1369 { 1370 $('html').addClass("accessSaturation"); 1371 $.cookie("accessibilitySaturation", 1, {expires: 15, path: '/'}); 1372 $(this).addClass("btn-success"); 1373 $(this).removeClass("btn-dark-scale-2"); 1374 } 1375 }); 1376 1377 1378 1379 if ($('#main').length) 1380 { } else { 1381 $("div[role='main']").attr("id","main"); 1382 } 1383 1384});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.