templates/Include/footer.html.twig line 1

Open in your IDE?
  1.         <div id="mymodal" class="modal" tabindex="-1">
  2.             <div class="modal-dialog modal-lg">
  3.                 <div class="modal-content">
  4.                     <div class="modal-header">
  5.                         <h4 class="modal-title">INFORMATION</h4>
  6.                         <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  7.                     </div>
  8.                     <div class="modal-body">
  9.                         <iframe id="framemodal" frameborder=0 width="100%" height="600px"></iframe>
  10.                     </div>
  11.                 </div>
  12.             </div>
  13.         </div>
  14.         <div id="modalinfo" class="modal" tabindex="-1">
  15.             <div class="modal-dialog">
  16.                 <div class="modal-content">
  17.                     <div class="modal-header">
  18.                         <h4 class="modal-title">INFORMATION</h4>
  19.                         <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
  20.                     </div>
  21.                     <div class="modal-body">
  22.                         <div id="modalinfotext"></div>
  23.                     </div>
  24.                 </div>
  25.             </div>
  26.         </div>
  27.         
  28.         <script>
  29.             {% if websocket_activate %}
  30.                 function subscribe(channeltype,channelkey,userkey) {
  31.                     console.log("== SUBSCRIBE "+channeltype+"-"+channelkey+" with userkey "+userkey);
  32.                     conn.send(JSON.stringify({
  33.                         command: "subscribe",
  34.                         log: "subscribe",
  35.                         channel: channeltype+"-"+channelkey,
  36.                         channeltype: channeltype,
  37.                         channelkey: channelkey,
  38.                         userkey: userkey
  39.                     }));
  40.                 }
  41.                 function sendMessage(msg) {
  42.                     json=JSON.stringify(msg);
  43.                     console.log("== SEND MSG = "+json);
  44.                     conn.send(json);
  45.                 }
  46.             {% endif %}   
  47.             function iformat(icon) {
  48.                 return $('<span><i class="' + icon.id + '"></i> ' + icon.text + '</span>');
  49.             }
  50.             $('.select2-icon').select2({
  51.                 width: "100%",
  52.                 placeholder: 'choisir un icône',
  53.                 allowClear: true,                
  54.                 templateSelection: iformat,
  55.                 templateResult: iformat,
  56.                 formatResult: iformat,
  57.                 allowHtml: true,
  58.                 escapeMarkup: function(m) {
  59.                     return m;
  60.                 }
  61.             })
  62.             function seeUser(id) {
  63.                 {% if app.user %}
  64.                     $("#mymodal").find(".modal-title").html("FICHE UTILISATEUR");
  65.                     var url="{{ path('app_core_user_view',{id:'xx'}) }}";
  66.                     url=url.replace('xx',id);
  67.                     $("#mymodal").find("#framemodal").attr("src",url);
  68.                     $("#mymodal").modal("show");
  69.                 {% endif %}
  70.             }   
  71.             function inIframe () {
  72.                 try {
  73.                     return window.self !== window.top;
  74.                 } catch (e) {
  75.                     return true;
  76.                 }
  77.             } 
  78.             function switchHeader(flag) {
  79.                 {% if app.user %}
  80.                 $.ajax({
  81.                     method: "POST",
  82.                     url: "{{ path('app_core_user_preference') }}",
  83.                     data: {
  84.                         id:0,
  85.                         key:'fguserheader',
  86.                         value: flag
  87.                     },
  88.                     success: function() {
  89.                         location.reload();
  90.                     }            
  91.                 });
  92.                 {% endif %}                
  93.             }
  94.             // Cacher afficher le menu des widgets 
  95.             $( ".widget").hover(function() {
  96.                 if($(this).children(".widgetmenu").length) {
  97.                     var widthwidget=$(this).width();
  98.                     var widthtitle=$(this).children(".widgetheader").children(".title").width()+$(this).children(".widgetheader").children("img").width();
  99.                     var widthmenu=$(this).children(".widgetmenu").width();
  100.                     if(widthtitle+widthmenu+10>widthwidget) $(this).children(".widgetheader").children(".title").hide();
  101.                     $(this).children(".widgetmenu").show();
  102.                 }
  103.             });
  104.             $( ".widget" ).mouseleave(function() {
  105.                 $(this).children(".widgetmenu").hide();
  106.                 $(this).children(".widgetheader").children(".title").show();
  107.             });
  108.             $( ".grid-item-content").hover(function() {
  109.                 $(this).children(".item-heart").show();
  110.                 $(this).children(".item-delete").show();
  111.                 $(this).children(".item-restaure").show();
  112.                 $(this).children(".item-update").show();
  113.                 $(this).children(".item-preview").show();
  114.             });
  115.             $( ".grid-item-content" ).mouseleave(function() {
  116.                 $(this).children(".item-heart").hide();
  117.                 $(this).children(".item-delete").hide();
  118.                 $(this).children(".item-restaure").hide();
  119.                 $(this).children(".item-update").hide();
  120.                 $(this).children(".item-preview").hide();
  121.             });
  122.             $(".navbar-toggle").mouseup(function() {
  123.                 setTimeout(function() {
  124.                     resize();
  125.                 }, 50);                
  126.                 
  127.             });
  128.             
  129.             function resize() {
  130.                 var heightbody = $('html').height();
  131.                 var heightheader = ($('.header').height()&&$('.header').is(":visible")?$('.header').height():0);
  132.                 var heightlittleheader = ($('.littleheader').height()&&$('.littleheader').is(":visible")?$('.littleheader').height():0);
  133.                 var heightmenu = ($('#menu').height()&&$('#menu').is(":visible")?$('#menu').height():0);
  134.                 
  135.                 var heightframe = heightbody-heightheader-heightlittleheader-heightmenu-1;
  136.                 $("#page-wrapper").css("min-height",heightframe);
  137.                 $(".pageframe").each(function(){
  138.                     $(this).height(heightframe);
  139.                 });
  140.             }        
  141.             $(window).resize(function() {
  142.                 resize();
  143.             });
  144.             $(document).ready(function() {
  145.                 $(".js-datepicker").datepicker({
  146.                     format: "dd/mm/yyyy",
  147.                     language: "fr"
  148.                 });
  149.                 $('.select2simple').select2();
  150.                 $('.select2ajax').select2({
  151.                     ajax: {
  152.                         processResults: function (data) {
  153.                             return {
  154.                                 results: data
  155.                             };
  156.                         }                    
  157.                     }
  158.                 });
  159.                 $('.select2').each(function() {
  160.                     if($(this).attr('data-init')) {
  161.                         $(this).val(2);
  162.                     }
  163.                 });
  164.                 // Dans une iframe on enlève des élèment
  165.                 if(inIframe()) {
  166.                     $("nav").remove();
  167.                     $("body").removeClass("body");
  168.                     $("body").addClass("simple");
  169.                     $("#page-wrapper").css("margin","0px");
  170.                     $("#page-wrapper").css("border-left","none");
  171.                 }
  172.                 // Resize des dom
  173.                 resize();
  174.             });                  
  175.         </script>