Changeset 1054560
- Timestamp:
- 12/26/2014 03:33:15 PM (11 years ago)
- Location:
- responsive-image-maps/trunk
- Files:
-
- 3 edited
-
jquery.rwdImageMaps.min.js (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
responsive-image-maps.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
responsive-image-maps/trunk/jquery.rwdImageMaps.min.js
r626301 r1054560 1 1 /* 2 * rwdImageMaps jQuery plugin v1. 42 * rwdImageMaps jQuery plugin v1.5 3 3 * 4 4 * Allows image maps to be used in a responsive design by recalculating the area coordinates to match the actual image size on load and window.resize 5 5 * 6 * Copyright (c) 201 2Matt Stow6 * Copyright (c) 2013 Matt Stow 7 7 * https://github.com/stowball/jQuery-rwdImageMaps 8 8 * http://mattstow.com 9 9 * Licensed under the MIT license 10 10 */ 11 ;(function(a){a.fn.rwdImageMaps=function(){var d=this,c=parseFloat(a.fn.jquery);var b=function(){d.each(function(){if(typeof(a(this).attr("usemap"))=="undefined"){return}var f=this,e=a(f);a("<img />").load(function(){var o,k,i="width",n="height";if(c<1.6){o=f.getAttribute(i),k=f.getAttribute(n)}else{o=e.attr(i),k=e.attr(n)}if(!o||!k){var p=new Image();p.src=e.attr("src");if(!o){o=p.width}if(!k){k=p.height}}var g=e.width()/100,l=e.height()/100,j=e.attr("usemap").replace("#",""),m="coords";a('map[name="'+j+'"]').find("area").each(function(){var s=a(this);if(!s.data(m)){s.data(m,s.attr(m))}var r=s.data(m).split(","),q=new Array(r.length);for(var h=0;h<q.length;++h){if(h%2===0){q[h]=parseInt(((r[h]/o)*100)*g)}else{q[h]=parseInt(((r[h]/k)*100)*l)}}s.attr(m,q.toString())})}).attr("src",e.attr("src"))})};a(window).resize(b).trigger("resize");return this}})(jQuery);11 ;(function(a){a.fn.rwdImageMaps=function(){var c=this;var b=function(){c.each(function(){if(typeof(a(this).attr("usemap"))=="undefined"){return}var e=this,d=a(e);a("<img />").load(function(){var g="width",m="height",n=d.attr(g),j=d.attr(m);if(!n||!j){var o=new Image();o.src=d.attr("src");if(!n){n=o.width}if(!j){j=o.height}}var f=d.width()/100,k=d.height()/100,i=d.attr("usemap").replace("#",""),l="coords";a('map[name="'+i+'"]').find("area").each(function(){var r=a(this);if(!r.data(l)){r.data(l,r.attr(l))}var q=r.data(l).split(","),p=new Array(q.length);for(var h=0;h<p.length;++h){if(h%2===0){p[h]=parseInt(((q[h]/n)*100)*f)}else{p[h]=parseInt(((q[h]/j)*100)*k)}}r.attr(l,p.toString())})}).attr("src",d.attr("src"))})};a(window).resize(b).trigger("resize");return this}})(jQuery); -
responsive-image-maps/trunk/readme.txt
r626301 r1054560 5 5 Donate link: http://philipnewcomer.net/donate/ 6 6 Tags: responsive, image map, image, map, jquery, jquery plugin 7 Version: 1. 38 Stable tag: 1. 37 Version: 1.4 8 Stable tag: 1.4 9 9 Requires at least: 3.0 10 Tested up to: 3.4.210 Tested up to: 4.1 11 11 License: GPLv2 or later 12 12 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 29 29 30 30 == Changelog == 31 32 = 1.4 = 33 * Updated the [RWD Image Maps jQuery plugin](https://github.com/stowball/jQuery-rwdImageMaps) to version 1.5. 31 34 32 35 = 1.3 = -
responsive-image-maps/trunk/responsive-image-maps.php
r626301 r1054560 4 4 Plugin URI: http://philipnewcomer.net/wordpress-plugins/responsive-image-maps/ 5 5 Description: Makes image maps responsive by packaging the RWD Image Maps jQuery plugin for use in WordPress. 6 Version: 1. 36 Version: 1.4 7 7 Author: Philip Newcomer 8 8 Author URI: http://philipnewcomer.net … … 10 10 */ 11 11 12 /* Copyright 201 2Philip Newcomer (email: contact@philipnewcomer.net)12 /* Copyright 2014 Philip Newcomer (email: contact@philipnewcomer.net) 13 13 14 14 This program is free software; you can redistribute it and/or modify 15 it under the terms of the GNU General Public License, version 2, as 15 it under the terms of the GNU General Public License, version 2, as 16 16 published by the Free Software Foundation. 17 17 … … 28 28 function pn_rim_enqueue_scripts() 29 29 { 30 wp_enqueue_script( 'jQuery.rwd_image_maps', plugins_url( 'jquery.rwdImageMaps.min.js', __FILE__ ), array( 'jquery' ), '1. 4', true );30 wp_enqueue_script( 'jQuery.rwd_image_maps', plugins_url( 'jquery.rwdImageMaps.min.js', __FILE__ ), array( 'jquery' ), '1.5', true ); 31 31 } 32 32 add_action( 'wp_enqueue_scripts', 'pn_rim_enqueue_scripts' );
Note: See TracChangeset
for help on using the changeset viewer.