PageSourceSearch

https://www.finaland.com/scripts/with-jquery-v8-5.js

js finaland.com collected 2026-10-02 19:07:30 UTC 14,685 bytes, 450 lines download raw bytes

1function init_onload($) {
2
3  $(".toggle-info").on("click", function () {
4    $(this).next(".info-panel").slideToggle(200);
5  });
6
7  $(".info-panel").on("click", function () {
8    $(this).slideUp(200);
9  });
10
11  init_upload($);
12}
13
14function init_upload($) {
15
16  $(".info-panel").hide();
17}
18
19
20(init_onload)(jQuery);
21
22(function ($) {
23  //---------------------------------------------------------------- Module recherche de pseudo
24  if ($("#recherche_pseudo").length == 1) {
25    var redirection = $("#recherche_pseudo").attr("redirection");
26    $("#recherche_pseudo").usernamePicker(
27      {
28        path: "scripts/usernamePicker/",
29        sizeMenu: 10,
30        choiceFunction: function (user_id, username) {
31          window.location = redirection.replace("{user_id}", user_id);
32        }
33      }
34    );
35  }
36  if ($("#privmsg_rech_pseudo").length == 1) {
37    $("#privmsg_rech_pseudo").usernamePicker(
38      {
39        path: "scripts/usernamePicker/",
40        sizeMenu: 10,
41        choiceFunction: function (user_id, username) {
42          $("#privmsg_userid").val(user_id);
43        }
44      }
45    );
46  }
47
48  //---------------------------------------------------------------- Module MyProfil
49  if ($("#myprofil_formulaire").length == 1) {
50    $("#myprofil_change_mdp_oui").change(function () {
51      $("#myprofil_change_mdp_inputs").fadeToggle();
52    });
53    $("#myprofil_change_mdp_non").change(function () {
54      $("#myprofil_change_mdp_inputs").fadeToggle();
55    });
56    $("#myprofil_date_naissance").datepicker();
57  }
58
59  //---------------------------------------------------------------- Slide actuellement sur le site
60
61  var actuellementSlide = repeatSlide();
62
63  $(".actuellementSlide").mouseover(function () {
64    clearInterval(actuellementSlide);
65    $("#fleche-actu1").css({display: 'block'});
66    $("#fleche-actu2").css({display: 'block'});
67  })
68
69  $(".actuellementSlide").mouseout(function () {
70    actuellementSlide = repeatSlide();
71    $("#fleche-actu1").css({display: 'none'});
72    $("#fleche-actu2").css({display: 'none'});
73  })
74
75  $("#fleche-actu1").click(function () {
76    slide('right');
77  })
78
79  $("#fleche-actu2").click(function () {
80    slide('left');
81  })
82
83  function repeatSlide() {
84    return setInterval(function () {
85      slide('left');
86    }, 7000);
87  }
88
89  function slide(direction) {
90    if (direction === 'left') {
91      $(".actuellementSlide ul").animate({marginLeft: -100 + '%'}, 600, function () {
92        $(this).css({marginLeft: 0}).find("li:last").after($(this).find("li:first"));
93      })
94    }
95    else {
96      $(".actuellementSlide ul").css({marginLeft: -100 + '%'}).find("li:first").before($(".actuellementSlide ul").find("li:last"));
97      $(".actuellementSlide ul").animate({marginLeft: 0}, 600)
98    }
99  }
100
101  //---------------------------------------------------------------- FancyBox (module dans le dossier fancybox)
102
103  $("#content").find("a:has(img)").each(function (i, el) {
104    var href_value = el.href;
105    if (/\.(jpg|jpeg|bmp|png|gif)$/.test(href_value)) {
106      $(this).addClass('fancybox-screen fancybox.iframe');
107    }
108  });
109
110
111  $(".fancybox-screen").fancybox({
112    width: '80%',
113    afterLoad: function () {
114      $('.fancybox-wrap').addClass('fancybox-hide'); // On cache le wrap le temps que l'iframe soit à la bonne taille
115                                                     // et bien placée
116    },
117    onUpdate: function () {
118      var adjustHeight = $('.fancybox-inner').find('iframe').contents().find('img').height() + 16;
119      var adjustWidth = $('.fancybox-inner').find('iframe').contents().find('img').width() + 46;
120      $('.fancybox-inner').width(adjustWidth - 30).height(adjustHeight);
121      $('.fancybox-wrap').width(adjustWidth);
122      $.fancybox.reposition();
123      $('.fancybox-wrap').removeClass('fancybox-hide');
124    }
125  });
126
127  $(".fancybox-trophees").fancybox({
128    width: '80%',
129    afterLoad: function () {
130      $('.fancybox-wrap').addClass('fancybox-hide'); // On cache le wrap le temps que l'iframe soit à la bonne taille
131                                                     // et bien placée
132      // Comptage du nombre de trophées et apparition des boutons précédent et suivant en fonction
133      var display = $('.fancybox-trophees').length > 1 ? '' : ';display:none';
134      // Ajout des boutons de navigation
135      $('.fancybox-iframe').after(' \
136                <div style="text-align:center; margin-top: -40px"> \
137                    <button type="button" onclick="$.fancybox.prev();return false;" style="background-color:#3faa66;width:20%;height:30px;border-radius:6px;color:white;font-weight:bold' + display + '">Précédent</button>&nbsp; \
138                    <button type="button" onclick="$.fancybox.close();return false;" style="background-color:#75a9ff;width:20%;height:30px;border-radius:6px;color:white;font-weight:bold">OK</button>&nbsp; \
139                    <button type="button" onclick="$.fancybox.next();return false;"style="background-color:#3faa66;width:20%;height:30px;border-radius:6px;color:white;font-weight:bold' + display + '">Suivant</button> \
140                </div> \
141            ');
142    },
143    onUpdate: function () {
144      var adjustHeight = $('.fancybox-inner').find('iframe').contents().find('div').height() + 56;
145      var adjustWidth = $('.fancybox-inner').find('iframe').contents().find('div').width() + 86;
146      $('.fancybox-inner').width(adjustWidth - 30).height(adjustHeight);
147      $('.fancybox-wrap').width(adjustWidth);
148      $.fancybox.reposition();
149      $('.fancybox-wrap').removeClass('fancybox-hide');
150    }
151  });
152
153  //-----------------------------------Front Page
154  var menuLeSite = {
155    init: function () {
156      voile = $("#voile");
157      menu = $("#menuLeSite");
158      lienMenu = $("#LienMenuLeSite");
159      fermer = $("#fermer");
160      liParent = $("#LienMenuLeSite").parent("li");
161      menuLeSite.fermer();
162      $(document).click(function (event) {
163        var $target = $(event.target);
164        if ((!liParent.hasClass("focus")) && ($target.is(lienMenu))) {
165          // on ouvre au clic sur le lien
166          event.preventDefault();
167          menuLeSite.ouvrir();
168        }
169        else if (liParent.hasClass("focus")) {
170          if (event.target == lienMenu) {
171            // on referme au clic sur le lien
172            event.preventDefault();
173            menuLeSite.fermer();
174          }
175          if (event.relatedTarget != menu) {
176            // on ferme au clic à l'extérieur
177            menuLeSite.fermer();
178          }
179        }
180      });
181      fermer.click(function () {
182        menuLeSite.fermer();
183      });
184      menu.focusout(function () {
185        menuLeSite.fermer();
186      });
187    },
188    ouvrir: function () {
189      voileHeight = document.body.offsetHeight - 179;
190      voile.height(voileHeight);
191      voile.fadeIn("fast");
192      menu.slideDown("fast");
193      menu.attr('aria-hidden', 'false');
194      liParent.addClass("focus");
195    },
196    fermer: function () {
197      menu.slideUp("fast");
198      voile.fadeOut("fast");
199      menu.attr('aria-hidden', 'true');
200      liParent.removeClass("focus");
201    }
202  }
203  $(menuLeSite.init);
204
205  var memberCardToggle = {
206    init: function () {
207      var cardToggle = $("#memberCardToggle");
208      var card = $("#memberCard");
209
210      $(cardToggle).click(function () {
211        if ($("body").hasClass("openCard")) {
212          $("body").removeClass("openCard");
213          $(card).attr('aria-hidden', 'true');
214          $(cardToggle).attr('aria-expanded', 'false');
215        }
216        else {
217          $("body").addClass("openCard");
218          $(card).removeAttr('aria-hidden');
219          $(cardToggle).attr('aria-expanded', 'true');
220        }
221      });
222    }
223  }
224  $(memberCardToggle.init);
225
226  var spoiler = {
227    init: function () {
228      teaser = $(".spoiler.js .teaser");
229      contenu = $(".spoiler.js .contenu");
230      contenu.hide();
231      contenu.attr('aria-hidden', 'true');
232      teaser.click(function () {
233        if ($(this).hasClass("afficher")) {
234          $(this).removeClass("afficher");
235          $(this).next().slideUp("200").delay("200").removeClass("open").attr('aria-hidden', 'true');
236        }
237        else {
238          $(this).addClass("afficher");
239          $(this).next().slideDown("200").delay("200").addClass("open").attr('aria-hidden', 'false');
240        }
241      });
242    },
243    spoilOuvrir: function () {
244    },
245    spoilFermer: function () {
246    }
247  }
248  $(spoiler.init);
249
250
251  //------------------------------------fnd-image : composant pour images cliquables
252  function getAttributes(element) {
253    var attributes = {};
254    if (element.attributes) {
255      $.each(element.attributes, function (index, attr) {
256        attributes[attr.name] = attr.value;
257      });
258    }
259    return attributes;
260  };
261
262  $.fn.setFinalandImages = function () {
263    $(this).replaceWith(function (n) {
264      var attributes = getAttributes(this);
265      if (attributes['cliquable'] === 'true') { // Image cliquable
266        var srcSmall = 'img.php?src=[serveur=' + attributes['serveur'] + ']' + attributes['source'].trim('/') + '/small/' + attributes['nom'];
267        var srcBig = 'image.php?serveur=' + attributes['serveur'] + '&image=' + attributes['source'].trim('/') + '/big/' + attributes['nom'];
268        delete attributes['source'];
269        delete attributes['nom'];
270        delete attributes['serveur'];
271        delete attributes['cliquable'];
272        var image = $('<img/>');
273        image.attr('src', srcSmall);
274        $.each(attributes, function (index, attr) {
275          image.attr(index, attr || "");
276        });
277        var link = $('<a>');
278        if (attributes['title']) link.attr('title', attributes['title']);
279        link.attr('href', srcBig);
280        link.attr('rel', 'gallery');
281        link.addClass('fancybox fancybox-screen fancybox.iframe');
282        link.append(image);
283        return link;
284      }
285      else { // Image non cliquable
286        var src = 'img.php?src=[serveur=' + attributes['serveur'] + ']' + attributes['source'].trim('/') + '/' + attributes['nom'];
287        delete attributes['source'];
288        delete attributes['nom'];
289        delete attributes['serveur'];
290        delete attributes['cliquable'];
291        var image = $('<img/>');
292        image.attr('src', src);
293        $.each(attributes, function (index, attr) {
294          image.attr(index, attr);
295        });
296        return image;
297      }
298    });
299    return this;
300  };
301
302})(jQuery);
303
304jQuery(document).ready(function () {
305  var $body = $('body');
306
307  // Launch trophees
308  $("#fancybox-trophees0").trigger('click');
309  // What
310  $("a.external").click(function () {
311    window.open(this.href);
312    return false;
313  });
314  // Replace <fnd-images>
315  $("fnd-image").setFinalandImages();
316
317  //------------------------------------ Menu
318  var items = '.menu .menu-item';
319  var buttons = '.menu button.no-link';
320
321  // Add aria attribute.
322  $(buttons).attr('aria-expanded', 'false');
323
324  // Toggle sub-level on click.
325  $body.on('click', buttons, function (event) {
326    var $menuBtn = $(this);
327    var $menuItem = $(event.target).closest('.menu-item--expanded');
328
329    // Check if it's already open.
330    if ($menuBtn.attr('aria-expanded') === 'true') {
331      // Close current item.
332      $menuBtn.attr('aria-expanded', 'false');
333      $menuItem.removeClass('is-expanded');
334    }
335    else {
336      // Open current item.
337      $menuBtn.attr('aria-expanded', 'true');
338      $menuItem.addClass('is-expanded');
339    }
340  });
341
342  // Close on click somewhere else.
343  $body.on('click focusin', function (event) {
344
345    var $menuItem = $(event.target).closest('.menu-item');
346    var $itemOpen = $menuItem.siblings('.menu-item--expanded');
347
348    // If focus is outside.
349    if ($menuItem.length === 0) {
350      // Close all items.
351      $(items).removeClass('is-expanded');
352      $(buttons).attr('aria-expanded', 'false');
353    }
354    else {
355      // Wait for buttons click to happen before
356      setTimeout(function () {
357        // Inside a menu-item, close the siblings (for keyboard navigation).
358        $itemOpen.removeClass('is-expanded');
359        $itemOpen.find('> button.no-link').attr('aria-expanded', 'false');
360      }, 200);
361    }
362  });
363
364  //------------------------------------ Collapsibles
365
366  // Toggle on click on the button.
367  $body.on('click', '.js-collapsible-btn', function (event) {
368    var $btn = $(this);
369    var $parent = $btn.closest('.js-collapsible');
370    var rel = $parent.attr('data-collapsible-rel');
371    var $others;
372
373    if ($btn.attr('aria-expanded') === 'false') {
374      if (rel) {
375        // Close others if they are in relation (data-collapsible-rel attribute).
376        $others = $('[data-collapsible-rel="' + rel + '"].is-expanded');
377        $others.find('.js-collapsible-btn').first().attr('aria-expanded', 'false');
378        $others.removeClass('is-expanded');
379        $others.trigger('collapsible-close');
380      }
381
382      $btn.attr('aria-expanded', 'true');
383      $parent.addClass('is-expanded');
384
385      // Custom event.
386      $parent.trigger('collapsible-open');
387    }
388    else {
389      $btn.attr('aria-expanded', 'false');
390      $parent.removeClass('is-expanded');
391
392      // Custom event.
393      $parent.trigger('collapsible-close');
394    }
395  });
396
397  // Close on click somewhere else.
398  $body.on('click focusin', function (event) {
399    var $target = $(event.target);
400    // Maybe the click is somewhere inside a collapsible.
401    var $parent = $target.closest('.js-collapsible');
402
403    // For all open collapsibles, but not the one where the click happens.
404    $('.js-collapsible.is-expanded').not($parent).each(function () {
405      var $collapsible = $(this);
406
407      // Only if their data-collapsible-close==true.
408      if ($collapsible.attr('data-collapsible-close') === 'true') {
409        var $btn = $collapsible.find('.js-collapsible-btn');
410
411        // Close them.
412        $btn.attr('aria-expanded', 'false');
413        $collapsible.removeClass('is-expanded');
414
415        // Custom event.
416        $collapsible.trigger('collapsible-close');
417      }
418    });
419  });
420
421  //------------------------------------ Back to top
422  var btn = $('.back-top');
423  var footerOffsetTop = $('#footer').offset().top;
424
425  $(window).scroll(function () {
426    if ($(window).scrollTop() > 500) {
427      btn.addClass('show');
428    }
429    else {
430      btn.removeClass('show');
431    }
432
433    if (($(window).scrollTop() + window.innerHeight) < (footerOffsetTop - '30')) {
434      btn.addClass('sticky');
435    }
436    else {
437      btn.removeClass('sticky');
438    }
439  });
440
441  btn.on('click', function (e) {
442    e.preventDefault();
443    $('html, body').animate({scrollTop: 0}, '300');
444  });
445
446  //------------------------------------ Responsive tables
447  $('table.large.scroll').each(function () {
448    $(this).wrap('<div class="table-container"></div>');
449  });
450});

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.