PageSourceSearch

https://www.tousdehors.fr/themes/margot/javascripts/margot.js?v=4.1.5

js tousdehors.fr collected 2026-10-05 05:31:24 UTC 6,661 bytes, 193 lines download raw bytes

1$(document).ready(function() {
2  // replace full calendar icons
3  $(".fc-prev-button")
4    .html('<span class="fa fa-chevron-left"></span>')
5    .prependTo(".fc-toolbar.fc-header-toolbar")
6    .removeClass("btn btn-default");
7  $(".fc-next-button")
8    .html('<span class="fa fa-chevron-right"></span>')
9    .appendTo(".fc-toolbar.fc-header-toolbar")
10    .removeClass("btn btn-default");
11
12  $(".form-control").each(function() {
13    var parent = $(this).closest(".form-group");
14    parent.addClass(
15      $(this)
16        .prop("tagName")
17        .toLowerCase()
18    );
19    parent.addClass($(this).attr("type"));
20    if ($(this).hasClass('bazar-date')) parent.addClass('date');
21    if ($(this).hasClass('summernote')) parent.addClass('summernote');
22    if ($(this).hasClass("wiki-textarea")) {
23      parent.addClass("wiki-textarea");
24      parent.find(".control-label").prependTo(parent.find(".aceditor-toolbar"));
25    }
26  });
27  $('[type=checkbox]').each(function() {
28    $(this).closest(".form-group").addClass('checkbox');
29  });
30
31  $(".controls .radio, .controls .checkbox").each(function() {
32    var parent = $(this).closest(".form-group");
33    parent.addClass("form-control wrapper");
34  });
35  $('.bazar-radio').each(function() {
36    $(this).closest('.wrapper').addClass('radio')
37  })
38
39  // also when page is loaded in modal
40  $(document).on("yw-modal-open", function() {
41    $modal = $("#YesWikiModal");
42    var title = $modal.find('.BAZ_fiche_titre:first');
43    if (title.length == 0){
44      title = $modal.find('.modal-body h1,.modal-body h3').first();
45    }
46    if (title.length > 0){
47      $modal.find('.modal-header h1').remove();
48      $modal.find('.modal-header h3').remove();
49      $modal.find('.modal-header').prepend(title);
50    }
51    var image = $modal.find('[data-id=bf_image]');
52    $modal.find(".BAZ_cadre_fiche").prepend(image);
53    $modal.find('.modal-body').prepend("<div class='separator'></div>");
54    // ajout du span pour les checkbox/radio oubliés
55    $("#YesWikiModal input[type='checkbox'], #YesWikiModal input[type='radio']").each(function(){updateSpanInput(this)})
56    // Modification des boutons pour retourner dans l'historique
57    $("#YesWikiModal input.btn[onclick*='history.back()']").each(function (){
58      $(this).attr('data-dismiss','modal') ;
59      $(this).removeAttr('onclick') ;
60    }) ;
61    $("#YesWikiModal .tooltip_aide").each(function(){addTooltip(this)});
62    $("#YesWikiModal .bazar-list .panel-collapse")
63    .on("hide.bs.collapse", function() {
64      $(this)
65        .parent()
66        .addClass("collapsed");
67    })
68    .on("show.bs.collapse", function() {
69      $(this)
70        .parent()
71        .removeClass("collapsed");
72    });
73    $("#YesWikiModal #search-form + .facette-container").each(function() {
74      $(this)
75        .siblings("#search-form")
76        .prependTo($(this).find(".results-col"));
77    });
78  });
79
80  // ajout du span pour les checkbox/radio oubliés
81  $("input[type='checkbox'],input[type='radio']").each(function(){updateSpanInput(this)});
82  
83  function updateSpanInput(element) {
84    if (
85      $(element)
86        .next().length == 0 ||
87        $(element).next().not("span").length > 0
88    ) {
89      if ($(element).parents(".switch").length==0) {
90		if ($(element).parent("td").length > 0){
91          $(element).after("<label class=" + $(element).attr('type') + "></label>");
92		  var label_elem = $(element).next() ;
93		  label_elem.append(element);
94		  label_elem.append("<span></span>");
95	    } else {
96		  $(element).after("<span></span>");
97		}
98      }
99    }
100  };
101  // hack pour la ferme a wiki dont l'input hidden cachait le reste
102  $("#bf_dossier-wiki")
103    .parents(".control-group.email.password")
104    .removeClass("hidden");
105
106  $(".tooltip_aide").each(function(){addTooltip(this)});
107  function addTooltip(element) {
108    var tooltip = $(element).data("original-title") || ($(element).attr("title") || '');
109    var newImage = $(
110      "<span class='form-help fa fa-question-circle' title='" +
111      tooltip.replace(/'/g, "&#39;") +
112      "' onclick=\"$(element).tooltip(\'toggle\')\"></span>"
113    );
114    $(element)
115      .parent()
116      .append(newImage);
117     newImage.tooltip();
118    $(element).remove();
119  };
120
121  $(".bazar-list .panel-collapse")
122    .on("hide.bs.collapse", function() {
123      $(this)
124        .parent()
125        .addClass("collapsed");
126    })
127    .on("show.bs.collapse", function() {
128      $(this)
129        .parent()
130        .removeClass("collapsed");
131    });
132
133  $("#search-form + .facette-container").each(function() {
134    $(this)
135      .siblings("#search-form")
136      .prependTo($(this).find(".results-col"));
137  });
138
139  window.onresize = resizeNav;
140  resizeNav();
141
142  $("#yw-topnav .btn-menu").click(function() {
143    $links = $("#yw-topnav:visible .links-container");
144    if ($links.is(":visible")) {
145      $links.fadeOut(200);
146      $("#yw-topnav:visible .menu-backdrop").remove();
147    } else {
148      $links.fadeIn(200);
149      $backdrop = $("<div class='menu-backdrop'></div>");
150      $links.before($backdrop);
151      $backdrop.click(function(e) {
152        $("#yw-topnav:visible .btn-menu").trigger("click");
153        e.preventDefault();
154        e.stopPropagation();
155      });
156    }
157  });
158
159  // Datatables
160  $('.dataTables_wrapper').each(function() {
161    var search = $(this).find('.dataTables_filter input[type=search]');
162    search.prependTo(search.closest('.dataTables_filter'));
163    search.before('<span class="input-group-addon"><i class="fa fa-search search-icon"></i></span>');
164    search.parent().addClass('input-group');
165    $(this).find('.dataTables_filter label').remove();
166    $(this).find('> .row:first-child').addClass('dataTables_header');
167    $(this).find('> .row:last-child').addClass('dataTables_footer');
168
169    var container = $(this)
170    var paginationSelect = $(this).find('.dataTables_length select')
171    paginationSelect.change(function() {
172      var pagination = container.find('.pagination')
173      pagination.closest('.dataTables_footer')
174        .toggleClass('no-pagination', pagination.find('li').length <= 3)
175    }).trigger('change');
176    
177    // remove ugly style of dt-button :)
178    $(this).find('.dt-button').removeClass('dt-button')    
179  });
180
181  // Annuaire
182  $('.bazar-list[data-template="annuaire_alphabetique.tpl.html"]').each(function() {
183    if ($(this).prev().is('h1, h2, h3, h4, h5')) {
184      $(this).prev().addClass('annuaire-title')
185      $(this).prev().prepend('<i class="fa fa-search fa-flip-horizontal"></i>')
186    }
187  })
188});
189
190function resizeNav() {
191  var navHeight = $("#yw-topnav").outerHeight();
192  $("<style type='text/css'>.nav-down ~ #yw-main #ACEditor .btn-toolbar { top: " + navHeight + "px } </style>").appendTo("head");
193}

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.