MediaWiki:Common.js: Unterschied zwischen den Versionen

Aus Controlling-Wiki
Keine Bearbeitungszusammenfassung
Keine Bearbeitungszusammenfassung
Zeile 21: Zeile 21:


$(window).resize(function(e) {
$(window).resize(function(e) {
   if ($(e).width() <= 320) {
   if ($(e.target).width() <= 320) {
console.log(1);
console.log(1);
       console.log(e);
       console.log(e);
   } else if ($(e).width() <= 360) {
   } else if ($(e.target).width() <= 360) {
console.log(2);
console.log(2);
       console.log(e);
       console.log(e);

Version vom 29. Juni 2018, 14:57 Uhr

/* Das folgende JavaScript wird für alle Benutzer geladen. */
/* Einbinden Socialmedia Buttons */
$("#mw-panel").append('<div class="portal"><h3>Besuchen Sie uns auf</h3><a href="https://www.facebook.com/ifz.zug?ref=hl" target="_blank"><img src="https://blog.hslu.ch/financialmanagement/files/2015/04/icon-facebook.png" alt="facebook"  title="facebook" width="28" height="28" border="0" style="margin-right:4px;" /></a><a href="https://www.xing.com/net/pri65aa5ax/financialmanagement/" target="_blank"><img src="https://blog.hslu.ch/financialmanagement/files/2015/04/icon-xing.png" alt="xing"  title="xing" width="28" height="28" border="0" style="margin-right:4px;" /></a><a href="https://www.linkedin.com/showcase/ifz-zug/" target="_blank"><img src="https://blog.hslu.ch/financialmanagement/files/2015/04/icon-linkedin.png" alt="linkedin" title="linkedin" width="28" height="28" border="0" style="margin-right:4px;"/></a><a href="https://plus.google.com/u/0/102839662342174913370/posts" target="_blank"><img src="https://blog.hslu.ch/financialmanagement/files/2015/04/icon-googleplus.png" alt="google plus" title="google+" width="28" height="28" border="0" style="margin-right:4px;"/></a></div>');

/* Einbinden Google Analytics */
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

ga('create', 'UA-71081271-1', 'auto');
ga('require', 'linkid', 'linkid.js');
ga('send', 'pageview');


/* Einbinden ImageMap-Resizer */

$(document).ready(function() {
    $('map').imageMapResize();
});

$(window).resize(function(e) {
   if ($(e.target).width() <= 320) {
console.log(1);
       console.log(e);
   } else if ($(e.target).width() <= 360) {
console.log(2);
       console.log(e);
   } else {
console.log(3);
       console.log(e);
   }
});

/*! Image Map Resizer (imageMapResizer.min.js ) - v1.0.7 - 2018-05-01
 *  Desc: Resize HTML imageMap to scaled image.
 *  Copyright: (c) 2018 David J. Bradshaw - dave@bradshaw.net
 *  License: MIT
 */

!function(){"use strict";function a(){function a(){function a(a,d){function e(a){var d=1===(f=1-f)?"width":"height";return c[d]+Math.floor(Number(a)*b[d])}var f=0;j[d].coords=a.split(",").map(e).join(",")}var b={width:l.width/l.naturalWidth,height:l.height/l.naturalHeight},c={width:parseInt(window.getComputedStyle(l,null).getPropertyValue("padding-left"),10),height:parseInt(window.getComputedStyle(l,null).getPropertyValue("padding-top"),10)};k.forEach(a)}function b(a){return a.coords.replace(/ *, */g,",").replace(/ +/g,",")}function c(){clearTimeout(m),m=setTimeout(a,250)}function d(){l.width===l.naturalWidth&&l.height===l.naturalHeight||a()}function e(){l.addEventListener("load",a,!1),window.addEventListener("focus",a,!1),window.addEventListener("resize",c,!1),window.addEventListener("readystatechange",a,!1),document.addEventListener("fullscreenchange",a,!1)}function f(){return"function"==typeof i._resize}function g(a){return document.querySelector('img[usemap="'+a+'"]')}function h(){j=i.getElementsByTagName("area"),k=Array.prototype.map.call(j,b),l=g("#"+i.name)||g(i.name),i._resize=a}var i=this,j=null,k=null,l=null,m=null;f()?i._resize():(h(),e(),d())}function b(){function b(a){if(!a.tagName)throw new TypeError("Object is not a valid DOM element");if("MAP"!==a.tagName.toUpperCase())throw new TypeError("Expected <MAP> tag, found <"+a.tagName+">.")}function c(c){c&&(b(c),a.call(c),d.push(c))}var d;return function(a){switch(d=[],typeof a){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(a||"map"),c);break;case"object":c(a);break;default:throw new TypeError("Unexpected data type ("+typeof a+").")}return d}}"function"==typeof define&&define.amd?define([],b):"object"==typeof module&&"object"==typeof module.exports?module.exports=b():window.imageMapResize=b(),"jQuery"in window&&(jQuery.fn.imageMapResize=function(){return this.filter("map").each(a).end()})}();
//# sourceMappingURL=imageMapResizer.map