Actualización

This commit is contained in:
Xes
2025-04-10 11:37:29 +02:00
parent 4bfeadb360
commit 8969cc929d
39112 changed files with 975884 additions and 0 deletions

View File

@@ -0,0 +1,46 @@
{
"name": "imageMap-resizer",
"version": "0.5.4",
"homepage": "https://github.com/davidjbradshaw/imagemap-resizer",
"authors": [
"David J. Bradshaw <dave@bradshaw.net>"
],
"description": "Keep HTML Image Maps scaled to the size of an image. It detects the window being resized and updates the co-ordinates of the image map.",
"main": "js/imageMapResizer.min.js",
"keywords": [
"imagemap",
"resizer",
"responsive",
"RWD",
"fluid",
"resize",
"design"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests",
"examples",
"*.md",
"AUTHORS.txt",
"grunt.js",
"gruntfile.js",
"package.json",
"bower.json"
],
"dependencies": {
"jquery": ">=1.7"
},
"_release": "0.5.4",
"_resolution": {
"type": "version",
"tag": "v0.5.4",
"commit": "eef318b0892b5ecec2c95a9c2f7f06c420978cbe"
},
"_source": "https://github.com/davidjbradshaw/image-map-resizer.git",
"_target": "0.5.*",
"_originalSource": "image-map-resizer"
}

View File

@@ -0,0 +1,37 @@
{
"name": "imageMap-resizer",
"version": "0.5.4",
"homepage": "https://github.com/davidjbradshaw/imagemap-resizer",
"authors": [
"David J. Bradshaw <dave@bradshaw.net>"
],
"description": "Keep HTML Image Maps scaled to the size of an image. It detects the window being resized and updates the co-ordinates of the image map.",
"main": "js/imageMapResizer.min.js",
"keywords": [
"imagemap",
"resizer",
"responsive",
"RWD",
"fluid",
"resize",
"design"
],
"license": "MIT",
"ignore": [
"**/.*",
"node_modules",
"bower_components",
"test",
"tests",
"examples",
"*.md",
"AUTHORS.txt",
"grunt.js",
"gruntfile.js",
"package.json",
"bower.json"
],
"dependencies": {
"jquery": ">=1.7"
}
}

View File

@@ -0,0 +1,37 @@
{
"name": "imageMapResizer",
"title": "Image Map Resizer",
"description": "Keep HTML Image Maps scaled to the size of an image. It detects the window being resized and updates the co-ordinates of the image map.",
"keywords": [
"imagemap",
"resizer",
"responsive",
"RWD",
"fluid",
"resize",
"design"
],
"version": "0.5.4",
"author": {
"name": "David J. Bradshaw",
"email": "davidjbradshaw+github@gmail.com"
},
"maintainers": [
{
"name": "David J. Bradshaw",
"email": "davidjbradshaw+github@gmail.com"
}
],
"licenses": [
{
"type": "MIT",
"url": "https://github.com/jquery/jquery-color/blob/2.1.2/MIT-LICENSE.txt"
}
],
"bugs": "https://github.com/davidjbradshaw/imagemap-resizer/issues",
"homepage": "http://davidjbradshaw.github.io/imagemap-resizer/",
"docs": "https://github.com/davidjbradshaw/imagemap-resizer",
"dependencies": {
"jquery": ">=1.0"
}
}

View File

@@ -0,0 +1,48 @@
//PolyFils from MDN.
(function() {
if (!Array.prototype.map){
Array.prototype.map = function(fun /*, thisArg */){
"use strict";
if (this === void 0 || this === null || typeof fun !== "function"){
throw new TypeError();
}
var
t = Object(this),
len = t.length >>> 0,
res = new Array(len),
thisArg = arguments.length >= 2 ? arguments[1] : void 0;
for (var i = 0; i < len; i++){
if (i in t) {
res[i] = fun.call(thisArg, t[i], i, t);
}
}
return res;
};
}
if (!Array.prototype.forEach){
Array.prototype.forEach = function(fun /*, thisArg */){
"use strict";
if (this === void 0 || this === null || typeof fun !== "function"){
throw new TypeError();
}
var
t = Object(this),
len = t.length >>> 0,
thisArg = arguments.length >= 2 ? arguments[1] : void 0;
for (var i = 0; i < len; i++){
if (i in t){
fun.call(thisArg, t[i], i, t);
}
}
};
}
})();

View File

@@ -0,0 +1 @@
{"version":3,"file":"ie8.polyfil.min.js","sources":["ie8.polyfil.js"],"names":["Array","prototype","map","fun","this","TypeError","t","Object","len","length","res","thisArg","arguments","i","call","forEach"],"mappings":"CACA,WACOA,MAAMC,UAAUC,MACnBF,MAAMC,UAAUC,IAAM,SAASC,GAC7B,YAEA,IAAa,SAATC,MAA4B,OAATA,MAAgC,kBAARD,GAC7C,KAAM,IAAIE,UASZ,KAAK,GALDC,GAAIC,OAAOH,MACXI,EAAMF,EAAEG,SAAW,EACnBC,EAAM,GAAIV,OAAMQ,GAChBG,EAAUC,UAAUH,QAAU,EAAIG,UAAU,GAAK,OAE5CC,EAAI,EAAOL,EAAJK,EAASA,IACnBA,IAAKP,KACPI,EAAIG,GAAKV,EAAIW,KAAKH,EAASL,EAAEO,GAAIA,EAAGP,GAIxC,OAAOI,KAINV,MAAMC,UAAUc,UACnBf,MAAMC,UAAUc,QAAU,SAASZ,GACjC,YAEA,IAAa,SAATC,MAA4B,OAATA,MAAgC,kBAARD,GAC7C,KAAM,IAAIE,UAQZ,KAAK,GAJHC,GAAIC,OAAOH,MACXI,EAAMF,EAAEG,SAAW,EACnBE,EAAUC,UAAUH,QAAU,EAAIG,UAAU,GAAK,OAE1CC,EAAI,EAAOL,EAAJK,EAASA,IACnBA,IAAKP,IACPH,EAAIW,KAAKH,EAASL,EAAEO,GAAIA,EAAGP"}

View File

@@ -0,0 +1,2 @@
!function(){Array.prototype.map||(Array.prototype.map=function(a){"use strict";if(void 0===this||null===this||"function"!=typeof a)throw new TypeError;for(var b=Object(this),c=b.length>>>0,d=new Array(c),e=arguments.length>=2?arguments[1]:void 0,f=0;c>f;f++)f in b&&(d[f]=a.call(e,b[f],f,b));return d}),Array.prototype.forEach||(Array.prototype.forEach=function(a){"use strict";if(void 0===this||null===this||"function"!=typeof a)throw new TypeError;for(var b=Object(this),c=b.length>>>0,d=arguments.length>=2?arguments[1]:void 0,e=0;c>e;e++)e in b&&a.call(d,b[e],e,b)})}();
//# sourceMappingURL=ie8.polyfil.map

View File

@@ -0,0 +1,131 @@
/*! Image Map Resizer
* Desc: Resize HTML imageMap to scaled image.
* Copyright: (c) 2014 David J. Bradshaw - dave@bradshaw.net
* License: MIT
*/
(function(){
'use strict';
function scaleImageMap(){
function resizeMap() {
function resizeAreaTag(cachedAreaCoords){
function scaleCoord(e){
return e * scallingFactor[(1===(isWidth = 1-isWidth) ? 'width' : 'height')];
}
var isWidth = 0;
return cachedAreaCoords.split(',').map(Number).map(scaleCoord).map(Math.floor).join(',');
}
var scallingFactor = {
width : displayedImage.width / sourceImage.width,
height : displayedImage.height / sourceImage.height
};
for (var i=0; i < areasLen ; i++) {
areas[i].coords = resizeAreaTag(cachedAreaCoordsArray[i]);
}
}
function start(){
var
displayedWidth = null,
displayedHeight = null;
//WebKit asyncs image loading, so we have to catch the load event.
sourceImage.onload = function sourceImageOnLoadF(){
displayedWidth = displayedImage.width;
displayedHeight = displayedImage.height;
if ((displayedWidth !== sourceImage.width) || (displayedHeight !== sourceImage.height)) {
resizeMap();
}
};
//IE11 can late load this image, so make sure we have the correct sizes (#10)
displayedImage.onload = function() {
if (null !== displayedWidth && displayedImage.width !== displayedWidth) {
resizeMap();
}
};
//Make copy of image, so we can get the actual size measurements
sourceImage.src = displayedImage.src;
}
function listenForResize(){
function debounce() {
clearTimeout(timer);
timer = setTimeout(resizeMap, 250);
}
if (window.addEventListener) { window.addEventListener('resize', debounce, false); }
else if (window.attachEvent) { window.attachEvent('onresize', debounce); }
}
function getCoords(e){
// normalize coord-string to csv format without any space chars
return e.coords.replace(/ *, */g,',').replace(/ +/g,',');
}
var
/*jshint validthis:true */
map = this,
areas = map.getElementsByTagName('area'),
areasLen = areas.length,
cachedAreaCoordsArray = Array.prototype.map.call(areas, getCoords),
displayedImage = document.querySelector('img[usemap="#'+map.name+'"]'),
sourceImage = new Image(),
timer = null;
start();
listenForResize();
}
function factory(){
function init(element){
if(!element.tagName) {
throw new TypeError('Object is not a valid DOM element');
} else if ('MAP' !== element.tagName.toUpperCase()) {
throw new TypeError('Expected <MAP> tag, found <'+element.tagName+'>.');
}
scaleImageMap.call(element);
}
return function imageMapResizeF(target){
switch (typeof(target)){
case 'undefined':
case 'string':
Array.prototype.forEach.call(document.querySelectorAll(target||'map'),init);
break;
case 'object':
init(target);
break;
default:
throw new TypeError('Unexpected data type ('+typeof(target)+').');
}
};
}
if (typeof define === 'function' && define.amd) {
define([],factory);
} else if (typeof exports === 'object') { //Node for browserfy
module.exports = factory();
} else {
window.imageMapResize = factory();
}
if('jQuery' in window) {
jQuery.fn.imageMapResize = function $imageMapResizeF(){
return this.filter('map').each(scaleImageMap).end();
};
}
})();

View File

@@ -0,0 +1 @@
{"version":3,"file":"imageMapResizer.min.js","sources":["imageMapResizer.js"],"names":["scaleImageMap","resizeMap","resizeAreaTag","cachedAreaCoords","scaleCoord","e","scallingFactor","isWidth","split","map","Number","Math","floor","join","width","displayedImage","sourceImage","height","i","areasLen","areas","coords","cachedAreaCoordsArray","start","displayedWidth","displayedHeight","onload","src","listenForResize","debounce","clearTimeout","timer","setTimeout","window","addEventListener","attachEvent","getCoords","replace","this","getElementsByTagName","length","Array","prototype","call","document","querySelector","name","Image","factory","init","element","tagName","TypeError","toUpperCase","target","forEach","querySelectorAll","define","amd","exports","module","imageMapResize","jQuery","fn","filter","each","end"],"mappings":";;;;;;CAMA,WACI,YAEA,SAASA,KAEL,QAASC,KACL,QAASC,GAAcC,GACnB,QAASC,GAAWC,GAChB,MAAOA,GAAIC,EAAgB,KAAKC,EAAU,EAAEA,GAAW,QAAU,UAGrE,GAAIA,GAAU,CAEd,OAAOJ,GAAiBK,MAAM,KAAKC,IAAIC,QAAQD,IAAIL,GAAYK,IAAIE,KAAKC,OAAOC,KAAK,KAQxF,IAAK,GALDP,IACAQ,MAASC,EAAeD,MAASE,EAAYF,MAC7CG,OAASF,EAAeE,OAASD,EAAYC,QAGxCC,EAAE,EAAOC,EAAJD,EAAeA,IACzBE,EAAMF,GAAGG,OAASnB,EAAcoB,EAAsBJ,IAI9D,QAASK,KACL,GACIC,GAAkB,KAClBC,EAAkB,IAGtBT,GAAYU,OAAS,WACjBF,EAAiBT,EAAeD,MAChCW,EAAkBV,EAAeE,QAE5BO,IAAmBR,EAAYF,OAAWW,IAAoBT,EAAYC,SAC3EhB,KAKRc,EAAeW,OAAS,WAChB,OAASF,GAAkBT,EAAeD,QAAUU,GACpDvB,KAKRe,EAAYW,IAAMZ,EAAeY,IAGrC,QAASC,KACL,QAASC,KACLC,aAAaC,GACbA,EAAQC,WAAW/B,EAAW,KAE9BgC,OAAOC,iBAAoBD,OAAOC,iBAAiB,SAAUL,GAAU,GAClEI,OAAOE,aAAeF,OAAOE,YAAY,WAAYN,GAGlE,QAASO,GAAU/B,GAEf,MAAOA,GAAEgB,OAAOgB,QAAQ,SAAS,KAAKA,QAAQ,MAAM,KAGxD,GAEI5B,GAAwB6B,KACxBlB,EAAwBX,EAAI8B,qBAAqB,QACjDpB,EAAwBC,EAAMoB,OAC9BlB,EAAwBmB,MAAMC,UAAUjC,IAAIkC,KAAKvB,EAAOgB,GACxDrB,EAAwB6B,SAASC,cAAc,gBAAgBpC,EAAIqC,KAAK,MACxE9B,EAAwB,GAAI+B,OAC5BhB,EAAwB,IAE5BR,KACAK,IAKJ,QAASoB,KACL,QAASC,GAAKC,GACV,IAAIA,EAAQC,QACR,KAAM,IAAIC,WAAU,oCACjB,IAAI,QAAUF,EAAQC,QAAQE,cACjC,KAAM,IAAID,WAAU,8BAA8BF,EAAQC,QAAQ,KAGtEnD,GAAc2C,KAAKO,GAGvB,MAAO,UAAyBI,GAC5B,aAAc,IACV,IAAK,YACL,IAAK,SACDb,MAAMC,UAAUa,QAAQZ,KAAKC,SAASY,iBAAiBF,GAAQ,OAAOL,EACtE,MACJ,KAAK,SACDA,EAAKK,EACL,MACJ,SACI,KAAM,IAAIF,WAAU,+BAA+B,GAAS,QAMtD,kBAAXK,SAAyBA,OAAOC,IACvCD,UAAUT,GACgB,gBAAZW,SACdC,OAAOD,QAAUX,IAEjBf,OAAO4B,eAAiBb,IAIzB,UAAYf,UACX6B,OAAOC,GAAGF,eAAiB,WACvB,MAAOvB,MAAK0B,OAAO,OAAOC,KAAKjE,GAAekE"}

View File

@@ -0,0 +1,8 @@
/*! Image Map Resizer (imageMapResizer.min.js ) - v0.5.3 - 2015-04-21
* Desc: Resize HTML imageMap to scaled image.
* Copyright: (c) 2015 David J. Bradshaw - dave@bradshaw.net
* License: MIT
*/
!function(){"use strict";function a(){function a(){function a(a){function c(a){return a*b[1===(d=1-d)?"width":"height"]}var d=0;return a.split(",").map(Number).map(c).map(Math.floor).join(",")}for(var b={width:i.width/j.width,height:i.height/j.height},c=0;g>c;c++)f[c].coords=a(h[c])}function b(){var b=null,c=null;j.onload=function(){b=i.width,c=i.height,(b!==j.width||c!==j.height)&&a()},i.onload=function(){null!==b&&i.width!==b&&a()},j.src=i.src}function c(){function b(){clearTimeout(k),k=setTimeout(a,250)}window.addEventListener?window.addEventListener("resize",b,!1):window.attachEvent&&window.attachEvent("onresize",b)}function d(a){return a.coords.replace(/ *, */g,",").replace(/ +/g,",")}var e=this,f=e.getElementsByTagName("area"),g=f.length,h=Array.prototype.map.call(f,d),i=document.querySelector('img[usemap="#'+e.name+'"]'),j=new Image,k=null;b(),c()}function b(){function b(b){if(!b.tagName)throw new TypeError("Object is not a valid DOM element");if("MAP"!==b.tagName.toUpperCase())throw new TypeError("Expected <MAP> tag, found <"+b.tagName+">.");a.call(b)}return function(a){switch(typeof a){case"undefined":case"string":Array.prototype.forEach.call(document.querySelectorAll(a||"map"),b);break;case"object":b(a);break;default:throw new TypeError("Unexpected data type ("+typeof a+").")}}}"function"==typeof define&&define.amd?define([],b):"object"==typeof exports?module.exports=b():window.imageMapResize=b(),"jQuery"in window&&(jQuery.fn.imageMapResize=function(){return this.filter("map").each(a).end()})}();
//# sourceMappingURL=imageMapResizer.map