|
1 | 1 | /*!
|
2 |
| -* imagemapster - v1.6.0 - 2024-04-05 |
3 |
| -* https://github.com/jamietre/ImageMapster/ |
| 2 | +* imagemapster - v1.7.0 - 2024-04-29 |
| 3 | +* https://jamietre.github.io/ImageMapster |
4 | 4 | * Copyright (c) 2011 - 2024 James Treworgy
|
5 | 5 | * License: MIT
|
6 | 6 | */
|
|
106 | 106 | (function ($) {
|
107 | 107 | 'use strict';
|
108 | 108 |
|
109 |
| - var mapster_version = '1.6.0'; |
| 109 | + var mapster_version = '1.7.0'; |
110 | 110 |
|
111 | 111 | // all public functions in $.mapster.impl are methods
|
112 | 112 | $.fn.mapster = function (method) {
|
|
139 | 139 | includeKeys: '',
|
140 | 140 | altImage: null,
|
141 | 141 | altImageId: null, // used internally
|
142 |
| - altImages: {} |
| 142 | + altImages: {}, |
| 143 | + altImageOpacity: null |
143 | 144 | },
|
144 | 145 | defaults: {
|
145 | 146 | clickNavigate: false,
|
|
148 | 149 | wrapCss: null,
|
149 | 150 | onGetList: null,
|
150 | 151 | sortList: false,
|
151 |
| - listenToList: false, |
| 152 | + // listenToList: false, // not used - see mapdata.js line 1002 |
152 | 153 | mapKey: '',
|
153 | 154 | mapValue: '',
|
154 | 155 | singleSelect: false,
|
|
170 | 171 | autoResizeDelay: 0,
|
171 | 172 | autoResizeDuration: 0,
|
172 | 173 | onAutoResize: null,
|
173 |
| - safeLoad: false, |
174 | 174 | areas: []
|
175 | 175 | },
|
176 | 176 | shared_defaults: {
|
|
357 | 357 | isFunction: function (obj) {
|
358 | 358 | return typeof obj === 'function';
|
359 | 359 | },
|
| 360 | + isNumeric: function (obj) { |
| 361 | + return !isNaN(parseFloat(obj)); |
| 362 | + }, |
360 | 363 | // evaluates "obj", if function, calls it with args
|
361 | 364 | // (todo - update this to handle variable lenght/more than one arg)
|
362 | 365 | ifFunction: function (obj, that, args) {
|
|
571 | 574 | * invoked on an image, or an area; then queues the command if the MapData is in an active state.
|
572 | 575 | *
|
573 | 576 | * @param {[jQuery]} that The target of the invocation
|
574 |
| - * @param {[function]} func_map The callback if the target is an imagemap |
| 577 | + * @param {[function]} func_map The callback if the target is an image map |
575 | 578 | * @param {[function]} func_area The callback if the target is an area
|
576 | 579 | * @param {[object]} opt Options: { key: a map key if passed explicitly
|
577 | 580 | * name: the command name, if it can be queued,
|
|
1203 | 1206 | };
|
1204 | 1207 | return me;
|
1205 | 1208 | })();
|
1206 |
| - |
| 1209 | + console.log('foo3456'); |
1207 | 1210 | $.mapster.impl.init();
|
1208 | 1211 | })(jQuery);
|
1209 | 1212 |
|
1210 |
| -/* |
| 1213 | +/* |
1211 | 1214 | graphics.js
|
1212 | 1215 | Graphics object handles all rendering.
|
1213 | 1216 | */
|
|
1758 | 1761 | );
|
1759 | 1762 | })(jQuery);
|
1760 | 1763 |
|
1761 |
| -/* |
| 1764 | +/* |
1762 | 1765 | mapimage.js
|
1763 |
| - The MapImage object, repesents an instance of a single bound imagemap |
| 1766 | + The MapImage object, repesents an instance of a single bound image map |
1764 | 1767 | */
|
1765 | 1768 |
|
1766 | 1769 | (function ($) {
|
1767 | 1770 | 'use strict';
|
1768 | 1771 |
|
1769 | 1772 | var m = $.mapster,
|
1770 | 1773 | u = m.utils,
|
1771 |
| - ap = []; |
| 1774 | + ap = [], |
| 1775 | + configCheckInterval = 50; |
1772 | 1776 | /**
|
1773 | 1777 | * An object encapsulating all the images used by a MapData.
|
1774 | 1778 | */
|
|
1927 | 1931 | bind: function () {
|
1928 | 1932 | var me = this,
|
1929 | 1933 | promise,
|
1930 |
| - triesLeft = me.owner.options.configTimeout / 200, |
| 1934 | + triesLeft = me.owner.options.configTimeout / configCheckInterval, |
1931 | 1935 | /* A recursive function to continue checking that the images have been
|
1932 | 1936 | loaded until a timeout has elapsed */
|
1933 | 1937 |
|
|
1953 | 1957 | if (triesLeft-- > 0) {
|
1954 | 1958 | me.imgTimeout = window.setTimeout(function () {
|
1955 | 1959 | check.call(me, true);
|
1956 |
| - }, 50); |
| 1960 | + }, configCheckInterval); |
1957 | 1961 | } else {
|
1958 | 1962 | me.imageLoadError.call(me);
|
1959 | 1963 | }
|
|
2039 | 2043 |
|
2040 | 2044 | /*
|
2041 | 2045 | mapdata.js
|
2042 |
| - The MapData object, repesents an instance of a single bound imagemap |
| 2046 | + The MapData object, repesents an instance of a single bound image map |
2043 | 2047 | */
|
2044 | 2048 |
|
2045 | 2049 | (function ($) {
|
|
2809 | 2813 | me.wrapper = wrap;
|
2810 | 2814 |
|
2811 | 2815 | // me.images[1] is the copy of the original image. It should be loaded & at its native size now so we can obtain the true
|
2812 |
| - // width & height. This is needed to scale the imagemap if not being shown at its native size. It is also needed purely |
| 2816 | + // width & height. This is needed to scale the image map if not being shown at its native size. It is also needed purely |
2813 | 2817 | // to finish binding in case the original image was not visible. It can be impossible in some browsers to obtain the
|
2814 | 2818 | // native size of a hidden image.
|
2815 | 2819 |
|
|
2900 | 2904 | $img = $(me.image),
|
2901 | 2905 | opts = me.options;
|
2902 | 2906 |
|
2903 |
| - if (opts.onConfigured && typeof opts.onConfigured === 'function') { |
| 2907 | + if (u.isFunction(opts.onConfigured)) { |
2904 | 2908 | opts.onConfigured.call($img, true);
|
2905 | 2909 | }
|
2906 | 2910 | },
|
|
3505 | 3509 |
|
3506 | 3510 | /**
|
3507 | 3511 | * Compute positions that will place a target with dimensions [width,height] outside
|
3508 |
| - * but near the boundaries of the elements "elements". When an imagemap is passed, the |
| 3512 | + * but near the boundaries of the elements "elements". When an image map is passed, the |
3509 | 3513 | *
|
3510 | 3514 | * @param {Element|Element[]} elements An element or an array of elements (such as a jQuery object)
|
3511 | 3515 | * @param {Element} image The image to which area elements are bound, if this is an image map.
|
|
3682 | 3686 | };
|
3683 | 3687 | })(jQuery);
|
3684 | 3688 |
|
3685 |
| -/* |
| 3689 | +/* |
3686 | 3690 | scale.js
|
3687 | 3691 | Resize and zoom functionality
|
3688 | 3692 | Requires areacorners.js
|
|
3737 | 3741 | /**
|
3738 | 3742 | * Resize the image map. Only one of newWidth and newHeight should be passed to preserve scale
|
3739 | 3743 | *
|
3740 |
| - * @param {int} width The new width OR an object containing named parameters matching this function sig |
| 3744 | + * @param {int} width The new width |
3741 | 3745 | * @param {int} height The new height
|
3742 | 3746 | * @param {int} effectDuration Time in ms for the resize animation, or zero for no animation
|
3743 | 3747 | * @param {function} callback A function to invoke when the operation finishes
|
|
4073 | 4077 | */
|
4074 | 4078 | })(jQuery);
|
4075 | 4079 |
|
4076 |
| -/* |
| 4080 | +/* |
4077 | 4081 | tooltip.js
|
4078 | 4082 | Tooltip functionality
|
4079 | 4083 | Requires areacorners.js
|
|
4348 | 4352 | options.fadeDuration =
|
4349 | 4353 | options.fadeDuration ||
|
4350 | 4354 | (md.options.toolTipFade
|
4351 |
| - ? md.options.fadeDuration || areaOpts.fadeDuration |
| 4355 | + ? u.isNumeric(areaOpts.fadeDuration) ? areaOpts.fadeDuration : md.options.fadeDuration |
4352 | 4356 | : 0);
|
4353 | 4357 |
|
4354 | 4358 | target = ad.area
|
|
0 commit comments