PageSourceSearch

http://www.kinderliteraturpreis.at/swstatic-240829093827/swscripts/std/stdHTMLhead.js

js kinderliteraturpreis.at collected 2026-10-07 23:02:50 UTC 17,706 bytes, 535 lines download raw bytes

1/**
2 * standard scripts in HTML head -> tags_htmlhead.tpl
3 */
4
5$(document).ready(function(){
6
7  // ===== prettyPhoto ======
8    $("a[rel^='prettyPhoto']").prettyPhoto({
9      animation_speed: 'fast',		/* fast/slow/normal */
10      opacity: 0.35,					/* Value between 0 and 1 */
11      show_title: false,				/* true/false */
12      allow_resize: true,				/* true/false */
13      counter_separator_label: '/',	/* The separator for the gallery counter 1 "of" 2 */
14      theme: 'light_square',			/* pp_default / light_rounded / dark_rounded / light_square / dark_square / facebook */
15      overlay_gallery: false,			/* If set to true, a gallery will overlay the fullscreen image on mouse over */
16      deeplinking: false,				/* Allow prettyPhoto to update the url to enable deeplinking. */
17      social_tools: ''				/* AZP: disable social sharing */
18    });
19
20    // ===== magnificPopup-edit ======
21      if ($('.magnificPopup-edit').length > 0) {
22
23      $(".magnificPopup-edit").click(function(){
24        /* delay 2sec and create warning box */
25        $(this).animate({opacity: 1},2000,function(){
26          $("body").prepend('<div id="editWarningWrapper"><div class="editWarning">Bitte warten Sie, bis die Seite neu geladen wurde</div></div>');
27          $("#editWarningWrapper").css({
28            "top": Math.max(0, (($(window).height() - $(this).outerHeight()) / 2) + $(window).scrollTop()) + "px"
29          });
30        });
31      });
32
33      $('.magnificPopup-edit').magnificPopup({
34        type:'iframe',
35        removalDelay: 500, //delay removal by X to allow out-animation
36        preloader: false,
37        fixedContentPos: false,
38        callbacks: {
39          beforeOpen: function() {
40            this.st.mainClass = "mfp-zoom-in";
41            $("body").addClass("editOverlay");
42          },
43          close: function() {
44            var curlUrl = document.location.href.split("?")[0].split("#")[0];
45            document.location.href = curlUrl;
46          }
47        },
48        midClick: true // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.
49      });
50    }
51
52
53    /* ============================================
54    MAGNIFIC-POPUP SETTINGS
55
56    ==> IMAGE <==
57      Single image popup, needs class ".swpup-image" to initialize.
58
59      HTML markup:
60      <a href="http://placekitten.com/1500/1500" class="swpup-image" data-swpup-title="Titel" data-swpup-description="Die Beschreibung im Text...">IMAGE</a>
61
62      Attributes:
63
64        href="url"						| link to popup image
65        data-mfp-src="url"				| overrides href attribute - link to popup image
66        data-swpup-title="abc"			| title of image
67        data-swpup-description="xyz"	| small description of image
68
69
70    ==> GALLERY <==
71      Image gallery with next/prev arrows.
72      Class ".swpup-image-gallery" = container, items need "data-swpup-item" attribute.
73
74      HTML markup:
75      <div class="swpup-image-gallery">
76        <a href="http://placekitten.com/800/600" data-swpup-item data-swpup-title="Titel 1" data-swpup-description="Die Beschreibung im Text 1...">Item 1</a>
77        <a href="http://placekitten.com/700/700" data-swpup-item data-swpup-title="Titel 2" data-swpup-description="Die Beschreibung im Text 2...">Item 2</a>
78        <a href="http://placekitten.com/750/650" data-swpup-item data-swpup-title="Titel 3" data-swpup-description="Die Beschreibung im Text 3...">Item 3</a>
79      </div>
80
81      Attributes:
82
83        href="url"						| link to popup image
84        data-mfp-src="url"				| overrides href attribute - link to popup 
84image
85        data-swpup-item					| empty attribute to mark as gallery item
86        data-swpup-title="abc"			| title of image
87        data-swpup-description="xyz"	| small description of image
88
89
90    ==> INLINE <==
91      Opens a hidden div. Markup:
92
93      HTML markup:
94      <a href="#test-popup" class="swpup-inline">OPEN</a>
95      <div id="test-popup" class="white-popup mfp-with-anim mfp-hide">...TEXT...</div>
96
97      Classes:
98        white-popup						| theme class - see "swscripts/bower/custom/magnific-popup/magnific-popup-site.custom.css"
99        mfp-with-anim					| used for animation marker
100        mfp-hide						| initially hide content
101
102
103    ==> FRAME <==
104      Opens overlay with iFrame content.
105
106      HTML markup:
107      <a href="IFRAME URL" class="swpup-iframe">iFrame</a>
108
109      Classes:
110        swpup-iframe					| init iframe
111
112
113    ==> VIDEO / MAPS <==
114      Opens overlay with iFrame content - optimized for video (youtube, vimeo) and maps (gmap).
115
116      HTML markup:
117      <a class="swpup-youtube" href="https://www.youtube.com/watch?v=dQw4w9WgXcQ">YouTube video</a><br>
118      <a class="swpup-vimeo" href="https://vimeo.com/120469122">Vimeo video</a><br>
119      <a class="swpup-gmap" href="https://maps.google.com/maps?q=221B+Baker+Street,+London,+United+Kingdom&amp;hl=en&amp;t=v&amp;hnear=221B+Baker+St,+London+NW1+6XE,+United+Kingdom">Google Map</a>
120
121      Classes:
122        swpup-youtube					| init youtube video
123        swpup-vimeo						| init vimeo video
124        swpup-gmap						| init google maps
125
126    ============================================ */
127
128
129      $('.swpup-image, [data-swpup-image]').magnificPopup({
130        type:'image',
131        removalDelay: 500, //delay removal by X to allow out-animation
132        image: {
133          titleSrc: function(item) {
134            return item.el.attr('data-swpup-title') + '<small>' + item.el.attr("data-swpup-description") + '</small>';
135          }
136        },
137        callbacks: {
138          beforeOpen: function() {
139            // just a hack that adds mfp-anim class to markup
140            this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
141            var el = this.st.el;
142            var theme = el.data("swpup-theme");
143
144            if (theme) {
145              this.st.mainClass = theme;
146            } else {
147              this.st.mainClass = "mfp-zoom-in";
148            }
149          }
150        },
151        closeOnContentClick: true,
152        midClick: true // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.
153      });
154
155
156      $('.swpup-image-gallery').each(function() {
157        $(this).magnificPopup({
158          type:'image',
159          delegate: '[data-swpup-item]', // child items selector, by clicking on it popup will open
160          removalDelay: 500, //delay removal by X to allow out-animation
161          gallery: {
162            enabled: true,
163            navigateByImgClick: true,
164            preload: [0,1] // Will preload 0 - before current, and 1 after the current image
165          },
166          image: {
167            titleSrc: function(item) {
168              return item.el.attr('data-swpup-title') + '<small>' + item.el.attr("data-swpup-description") + '</small>';
169            }
170          },
171          callbacks: {
172            beforeOpen: function() {
173              // just a hack that adds mfp-anim class to markup
174              this.st.image.markup = this.st.image.markup.replace('mfp-figure', 'mfp-figure mfp-with-anim');
175
176              var el = this.st.el;
177              var theme = el.data("swpup-theme");
178
179              if (theme) {
180                this.st.mainClass = theme;
181              } else {
182                this.st.mainClass = "mfp-zoom-in";
183              }
184            }
185          },
186          closeOnContentClick: true,
187          midClick: true // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.
188        });
189      });
190
191      $('.swpup-iframe').magnificPopup({
192        type:'iframe',
193        removalDelay: 500, //delay removal by X to allow out-animation
194        preloader: false,
195        fixedContentPos: false,
196        callbacks: {
197          beforeOpen: function() {
198            var el = this.st.el;
199            var theme = el.data("swpup-theme");
200
201            if (theme) {
202              this.st.mainClass = theme;
203            } else {
204              this.st.mainClass = "mfp-zoom-in";
205            }
206          }
207        },
208        midClick: true // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.
209      });
210
211      $('.swpup-iframe-group').magnificPopup({
212        delegate:'.swpup-iframe-item',
213        type:'iframe',
214        removalDelay: 500, //delay removal by X to allow out-animation
215        preloader: false,
216        fixedContentPos: false,
217        callbacks: {
218          beforeOpen: function() {
219            var el = this.st.el;
220            var theme = el.data("swpup-theme");
221
222            if (theme) {
223              this.st.mainClass = theme;
224            } else {
225              this.st.mainClass = "mfp-zoom-in";
226            }
227          }
228        },
229        midClick: true // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.
230      });
231
232      $('.swpup-inline').magnificPopup({
233        type:'inline',
234        removalDelay: 500, //delay removal by X to allow out-animation
235        callbacks: {
236          beforeOpen: function() {
237            var el = this.st.el;
238            var theme = el.data("swpup-theme");
239
240            if (theme) {
241              this.st.mainClass = theme;
242            } else {
243              this.st.mainClass = "mfp-zoom-in";
244            }
245          }
246        },
247        midClick: true // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.
248      });
249
250      $('.swpup-inline-group').magnificPopup({
251        delegate:'.swpup-inline-item',
252        type:'inline',
253        removalDelay: 500, //delay removal by X to allow out-animation
254        callbacks: {
255          beforeOpen: function() {
256            var el = this.st.el;
257            var theme = el.data("swpup-theme");
258
259            if (theme) {
260              this.st.mainClass = theme;
261            } else {
262              this.st.mainClass = "mfp-zoom-in";
263            }
264          }
265        },
266        midClick: true // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.
267      });
268
269      $('.swpup-youtube, .swpup-vimeo, .swpup-gmap').magnificPopup({
270        type:'iframe',
271        removalDelay: 500, //delay removal by X to allow out-animation
272        preloader: false,
273        fixedContentPos: false,
274        callbacks: {
275          beforeOpen: function() {
276            var el = this.st.el;
277            var theme = el.data("swpup-theme");
278
279            if (theme) {
280              this.st.mainClass = theme;
281            } else {
282              this.st.mainClass = "mfp-zoom-in";
283            }
284          }
285        },
286        midClick: true // allow opening popup on middle mouse click. Always set it to true if you don't provide alternative source.
287      });
288
289
290
291  // ===== sweAccordion ======
292    var cnt = 0;
293    $(".sweAccordion").each(function(idx, oldRoot){
294        // get "rel"-attribute to select tab when created
295        var accSel = $(oldRoot).attr("rel") ? "rel='" + $(oldRoot).attr("rel") + "'" : '';
296        $newRoot = $("<div class='sweAccordion' " + accSel + "></div>");
297        $(oldRoot).after($newRoot);
298
299        var subcnt = cnt;
300        var $elm = $(oldRoot).find("tr:first").add($(oldRoot).find("tr:first").siblings("tr")).filter("tr:even");
301
302        $elm.each(function(idx, childElm){
303            $newRoot.append("<div>" + $(childElm).html() + "</div>");
304            $newRoot.append("<div>" + $(childElm).next().find("td").html() + "</div>");
305            subcnt++;
306          });
307
308        // remove original accordion table
309        $(oldRoot).detach();
310      });
311
312    $(".sweAccordion").accordion({
313        autoHeight: false,
314        active: false,
315        collapsible: true
316      });
317
318    $(".sweAccordion[class*='ui-'], .sweAccordion [class*='ui-']").attr('class', function(i, c){
319      return c.replace(/(^|\s)ui-\S+/g, '');
320    });
321
322    // select content based on "rel"-attribute
323    $(".sweAccordion").each(function(){
324      var accSel = Number($(this).attr("rel"));
325      if (!isNaN(accSel)) {
326        $(this).accordion('activate', accSel);
327      }
328    });
329
330  // ===== sweTabs ======
331    var cnt = 0;
332    $(".sweTabs").each(function(idx, oldRoot){
333
334      // get "rel"-attribute to select tab when created
335      var tabSel = $(oldRoot).attr("rel") ? "rel='" + $(oldRoot).attr("rel") + "'" : '';
336
337      $newRoot = $("<div class='sweTabs' " + tabSel + "></div>");
338      $(oldRoot).after($newRoot);
339
340      // Tab-Header
341      $newTabRoot = $("<ul></ul>");
342      $newRoot.append($newTabRoot);
343
344      var subcnt = cnt;
345      var $elm = $(oldRoot).find("tr:first").add($(oldRoot).find("tr:first").siblings("tr")).filter("tr:even");
346
347      $elm.each(function(idx, childElm){
348          $newTabRoot.append("<li><a href='#sweTabs-" + subcnt + "'>" + $(childElm).html() + "</a></li>");
349          subcnt++;
350        });
351
352      // Tab-Content
353      $newRoot.append($newTabRoot);
354      subcnt = cnt;
355      $elm.each(function(idx, childElm){
356          $newRoot.append("<div id='sweTabs-" + subcnt + "'>" + $(childElm).next().find("td:first-child").html() + "</div>");
357          subcnt++;
358        });
359
360      // remove original accordion table
361      $(oldRoot).detach();
362
363      cnt = cnt + subcnt;
364    });
365
366    $(".sweTabs").tabs();
367
368    $(".sweTabs[class*='ui-']").attr('class', function(i, c){
369      return c.replace(/(^|\s)ui-\S+/g, '');
370    });
371
372    // select tab based on "rel"-attribute
373    $(".sweTabs").each(function(){
374      var tabSel = Number($(this).attr("rel"));
375      if (!isNaN(tabSel)) {
376        var $tabs = $(".sweTabs").tabs();
377        $tabs.tabs('select', tabSel);
378      }
379    });
380
381
382    // ---===== scroll anchor links =====---
383    $('a.scrollto[href^="#"]').on('click',function (e) {
384      e.preventDefault();
385      var target = this.hash;
386      var offsetdiff = $(this).attr('data-offset') || 50;
387      $target = $(target);
388
389      if ($(target).length > 0) {
390        var offset = $target.offset().top - offsetdiff;
391
392        $('html, body').stop().animate({
393            'scrollTop': offset
394          }, 900, 'swing', function () {
395            //window.location.hash = target;
396          });
397      }
398    });
399
400
401    // ---===== prevent links for wai/design from triggering =====---
402    $(".dummyLink").click(function(event) {
403      event.preventDefault();
404    });
405
406
407    // Toggle content for Help Buttons
408    //
409    // e.g.:
410    // <span class="icon btnHelp" data-helpcontent="helpCntCaching"></span>
411    // <div id="helpCntCaching" class="helpCnt">Content text</div>
412    //
413    $("[data-helpcontent]").on("click", function(e) {
414      e.preventDefault();
415      var $helpContent = $("#" + $(this).data("helpcontent"));
416      $helpContent.slideToggle();
417      return false;
418    });
419
420
421    addAjaxLink();
422
423});
424
425
426// ---===== AJAX-LINK: quick ajax =====---
427// get all a links within the data-swajax object and load it into the attribute value
428// only ids are allowed | only a tags will be processed | no scripts within the loaded url will be executed
429//
430// <div data-swajax="inpage_nav_{|$row.id|}"> <a href="myurl.html">AJAX-Link</a> </div>
431function addAjaxLink () {
432
433  $("[data-swajax]").each(function(){
434    var $ajaxobj = $(this);
435    var targetItem = $ajaxobj.data('swajax');
436    var $targetElement = $("#" + targetItem);
437
438    $ajaxobj.find("a").each(function(){
439      var itemurl = $(this).attr('href');
440
441      $(this).click(function(e){
442        e.preventDefault();
443        swScrollTo("#" + targetItem, -150);
444        $targetElement.fadeTo("slow", 0.3);
445
446        $targetElement.load(itemurl + " #" + targetItem, function(response, status, xhr) {
447
448            if (status == "success") {
449              $targetElement.children(':first').unwrap();
450              addAjaxLink();
451            } else if (status == "error") {
452              document.location.href = itemurl;
453            }
454
455        });
456
457      });
458
459    });
460
461  });
462
463}
464
465
466/**
467 * can be called everywhere to explicitly set the Siteswift Do-Not-Track Cookie
468 * @param enable
469 */
470function handleSWDoNotTrack(enable) {
471  if (enable == true) {
472    var exdate=new Date();
473    exdate.setDate(exdate.getDate() + 365);
474    document.cookie='swdonottrack=1; expires='+exdate.toUTCString()+';';
475  } else {
476    document.cookie='swdonottrack=;expires=Thu, 01-Jan-70 00:00:01 GMT;';
477  }
478  return false;
479}
480
481function swSlideLink(url, target) {
482  if (target == "_blank") {
483    window.open(url, "swlink");
484  } else {
485    document.location.href=url;
486  }
487}
488
489function swSubmitForm(searchId, searchEmptyVal, searchAlert, searchFormId) {
490  var searchVal = searchId.val();
491  var searchValClean = searchVal.replace(/ /g,'');
492
493  if (searchVal == searchEmptyVal || searchVal == "" || searchValClean == "") {
494    alert(searchAlert);
495    return false;
496  } else {
497    var formToSumit = document.getElementById(searchFormId);
498    formToSumit.submit();
499  }
500}
501
502function swScrollTo(target,offsetpos) {
503  var $target = $(target);
504  var targetoffset = (offsetpos === undefined) ? -50 : offsetpos;
505
506  if ($target.length > 0) {
507    var offset = $target.offset().top + targetoffset;
508    $('html, body').stop().animate({
509        'scrollTop': offset
510      }, 900, 'swing');
511  }
512}
513
514$.fn.toggleClick=function(){
515  var functions=arguments, iteration=0
516  return this.click(function(){
517    functions[iteration].apply(this,arguments)
518    iteration= (iteration+1) %functions.length
519  })
520}
521
522// ====== content aware form width: start ======
523function dynamic_form_resize() {
524  var $dynForm = $("form.responsive");
525
526  if ($dynForm.parent().width() < 420) {
527    $dynForm.addClass("labelTop fluid");
528  } else {
529    $dynForm.removeClass("labelTop fluid");
530  }
531}
532
533$(document).ready(dynamic_form_resize);
534$(window).resize(dynamic_form_resize);
535// ====== content aware form width: end ======

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.