Plugin Directory

Changeset 626301


Ignore:
Timestamp:
11/16/2012 09:50:09 PM (13 years ago)
Author:
philip.newcomer
Message:

Updating plugin to version 1.3

Location:
responsive-image-maps/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • responsive-image-maps/trunk/jquery.rwdImageMaps.min.js

    r609515 r626301  
    11/*
    2 * rwdImageMaps jQuery plugin v1.3
     2* rwdImageMaps jQuery plugin v1.4
    33*
    44* 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
     
    99* Licensed under the MIT license
    1010*/
    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 i,k,l="width",g="height";if(c<1.6){i=f.getAttribute(l),k=f.getAttribute(g)}else{i=e.attr(l),k=e.attr(g)}var j=e.width()/100,n=e.height()/100,m=e.attr("usemap").replace("#",""),o="coords";a('map[name="'+m+'"]').find("area").each(function(){var r=a(this);if(!r.data(o)){r.data(o,r.attr(o))}var q=r.data(o).split(","),p=new Array(q.length);for(var h=0;h<p.length;++h){if(h%2===0){p[h]=parseInt(((q[h]/i)*100)*j)}else{p[h]=parseInt(((q[h]/k)*100)*n)}}r.attr(o,p.toString())})}).attr("src",e.attr("src"))})};a(window).resize(b).trigger("resize");return this}})(jQuery);
     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);
  • responsive-image-maps/trunk/readme.txt

    r609524 r626301  
    55Donate link: http://philipnewcomer.net/donate/
    66Tags: responsive, image map, image, map, jquery, jquery plugin
    7 Version: 1.2
    8 Stable tag: 1.2
     7Version: 1.3
     8Stable tag: 1.3
    99Requires at least: 3.0
    10 Tested up to: 3.4.1
     10Tested up to: 3.4.2
    1111License: GPLv2 or later
    1212License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    1616== Description ==
    1717
    18 I'm not a big fan of image maps, but there are times when they do have legitimate uses. This plugin simply packages the [RWD Image Maps](https://github.com/stowball/jQuery-rwdImageMaps) jQuery plugin for use in WordPress, providing an easy way to make image maps responsive in any WordPress theme.
     18This plugin simply packages the [RWD Image Maps](https://github.com/stowball/jQuery-rwdImageMaps) jQuery plugin for use in WordPress, providing an easy way to make image maps responsive in a WordPress theme.
    1919
    2020This plugin is licensed under the GPLv2, and the jQuery plugin is licensed under the MIT license.
     
    3030== Changelog ==
    3131
     32= 1.3 =
     33* Updated the [RWD Image Maps jQuery plugin](https://github.com/stowball/jQuery-rwdImageMaps) to version 1.4. Images are no longer required to have width/height attributes.
     34* Updated readme.txt
     35
    3236= 1.2 =
    3337* Updated the jQuery RWD Image Maps plugin to version 1.3, which adds IE8 support: https://github.com/stowball/jQuery-rwdImageMaps/pull/7
     
    4044* Initial release
    4145
    42 == Implementation ==
    43 
    44 Your image map needs to keep the original width and height attributes in the HTML markup for the RWD Image Maps jQuery plugin to function properly. However, the *Responsive Image Maps* WordPress plugin will add the CSS styles `max-width: 100%; height: auto;` to all image maps, which will override the HTML width and height attributes for the image map's display. That will make the image maps responsive while allowing the RWD Image Maps jQuery plugin to function properly.
    45 
    4646== Javascript Warning ==
    4747
  • responsive-image-maps/trunk/responsive-image-maps.php

    r609516 r626301  
    33Plugin Name: Responsive Image Maps
    44Plugin URI: http://philipnewcomer.net/wordpress-plugins/responsive-image-maps/
    5 Description: Makes image maps responsive by packaging the RWD Image Maps jQuery plugin for use in WordPress
    6 Version: 1.2
     5Description: Makes image maps responsive by packaging the RWD Image Maps jQuery plugin for use in WordPress.
     6Version: 1.3
    77Author: Philip Newcomer
    88Author URI: http://philipnewcomer.net
     
    2828function pn_rim_enqueue_scripts()
    2929{
    30     wp_enqueue_script( 'jQuery.rwd_image_maps', plugins_url( 'jquery.rwdImageMaps.min.js', __FILE__ ), array( 'jquery' ), '1.3', true );
     30    wp_enqueue_script( 'jQuery.rwd_image_maps', plugins_url( 'jquery.rwdImageMaps.min.js', __FILE__ ), array( 'jquery' ), '1.4', true );
    3131}
    3232add_action( 'wp_enqueue_scripts', 'pn_rim_enqueue_scripts' );
Note: See TracChangeset for help on using the changeset viewer.