Plugin Directory

Changeset 1054560


Ignore:
Timestamp:
12/26/2014 03:33:15 PM (11 years ago)
Author:
philip.newcomer
Message:

updated plugin to version 1.4

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

Legend:

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

    r626301 r1054560  
    11/*
    2 * rwdImageMaps jQuery plugin v1.4
     2* rwdImageMaps jQuery plugin v1.5
    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
    55*
    6 * Copyright (c) 2012 Matt Stow
     6* Copyright (c) 2013 Matt Stow
    77* https://github.com/stowball/jQuery-rwdImageMaps
    88* http://mattstow.com
    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 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  
    55Donate link: http://philipnewcomer.net/donate/
    66Tags: responsive, image map, image, map, jquery, jquery plugin
    7 Version: 1.3
    8 Stable tag: 1.3
     7Version: 1.4
     8Stable tag: 1.4
    99Requires at least: 3.0
    10 Tested up to: 3.4.2
     10Tested up to: 4.1
    1111License: GPLv2 or later
    1212License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    2929
    3030== Changelog ==
     31
     32= 1.4 =
     33* Updated the [RWD Image Maps jQuery plugin](https://github.com/stowball/jQuery-rwdImageMaps) to version 1.5.
    3134
    3235= 1.3 =
  • responsive-image-maps/trunk/responsive-image-maps.php

    r626301 r1054560  
    44Plugin URI: http://philipnewcomer.net/wordpress-plugins/responsive-image-maps/
    55Description: Makes image maps responsive by packaging the RWD Image Maps jQuery plugin for use in WordPress.
    6 Version: 1.3
     6Version: 1.4
    77Author: Philip Newcomer
    88Author URI: http://philipnewcomer.net
     
    1010*/
    1111
    12 /*  Copyright 2012 Philip Newcomer (email: contact@philipnewcomer.net)
     12/*  Copyright 2014 Philip Newcomer (email: contact@philipnewcomer.net)
    1313
    1414    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
    1616    published by the Free Software Foundation.
    1717
     
    2828function pn_rim_enqueue_scripts()
    2929{
    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 );
    3131}
    3232add_action( 'wp_enqueue_scripts', 'pn_rim_enqueue_scripts' );
Note: See TracChangeset for help on using the changeset viewer.