Plugin Directory

Changeset 615519


Ignore:
Timestamp:
10/22/2012 09:45:54 AM (12 years ago)
Author:
510crew
Message:

Made changes for v0.2

Location:
maphilight/trunk
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • maphilight/trunk/README.md

    r611688 r615519  
    66__Donate link__:   
    77__Requires at least__: 3.3 
    8 __Tested up to__: 3.4.1 
    9 __Stable tag__: 1.3
     8__Tested up to__: 3.4.2 
     9__Stable tag__: 0.2
    1010__License__: GPLv2 
    1111
     
    1313-----------
    1414
    15 MapHilight makes it easy to integrate the javascript needed to make your maps or images interactive. Based on the maphilight jQuery plugin, MapHilight allows you to customize a hover effect on your maps or images. 
    16 Plugin uses jQuery plugin found here : https://github.com/kemayo/maphilight - MIT Licensed
     15MapHilight makes it easy to integrate the javascript needed to make your maps or images interactive. Based on the imagemapster jQuery plugin, MapHilight allows you to customize a hover effect on your maps or images.
     16Plugin uses jQuery plugin found here : https://github.com/jamietre/imagemapster
     17Thanks jmcphail for pointing it out on this plugin's Wordpress forum.
    1718
    1819Use it in your Posts by adding the following shortcode : [maphilight]
     
    3132--------------------------
    3233
    33 1.  How do I integrate the map in an article or a post once it has been created in the admin menu ?
     341.  How do I integrate the map in an article or a post once it has been created in the admin menu ? 
    3435>  You only need to use the [maphilight] shortcode in your post or article and the map will appear. The javascript will only be loaded in your page if the shortcode is present.
    3536
     
    4849Changelog
    4950---------
     51### 0.2 ###
     52
     53* Changed jQuery plugin mahilight for imagemapster. Allowing responsive maps !
    5054
    5155### 0.1 ###
  • maphilight/trunk/classes/Map_Hilight.php

    r611688 r615519  
    129129        // echo map tag with corresponding name
    130130        // echo the given areas (stripslashes as wordpress \ when saving)
    131         $html = '<img src="'.$options['map_url'].'" usemap="#map" id="map">';
    132         $html .= '<map name="map">';
     131        $html = '<img src="'.$options['map_url'].'" usemap="#map-area" id="map" />';
     132        $html .= '<map name="map-area">';
    133133        $html .= stripslashes($options['map_area_code']);
    134134        $html .= '</map>';
  • maphilight/trunk/classes/Map_Hilight_Site.php

    r611688 r615519  
    3030        // Scripts
    3131        wp_register_script(
    32             'maphilight' ,
    33             plugins_url('javascript/jquery.maphilight.min.js', Map_Hilight::$file),
     32            'imagemapster' ,
     33            plugins_url('javascript/jquery.imagemapster.min.js', Map_Hilight::$file),
    3434            array('jquery')
    3535        );
     
    3939            'map-hilight-app' ,
    4040            plugins_url('javascript/app.js', Map_Hilight::$file) ,
    41             array('jquery', 'maphilight')
     41            array('jquery', 'imagemapster')
    4242        );
    4343    }
     
    5353        // As of WordPress 3.3 wp_enqueue_script() can be called mid-page (in the HTML body).
    5454        // This will load the script in the footer.
    55         wp_enqueue_script('maphilight');
     55        wp_enqueue_script('imagemapster');
    5656        wp_enqueue_script('map-hilight-app');
    5757        wp_localize_script('map-hilight-app', 'map_hilight_args', Map_Hilight::getOptions());
     
    6767    public static function printScripts() {
    6868        if(self::$printScripts) {
    69             wp_print_scripts(array('maphilight', 'map-hilight-app'));
     69            wp_print_scripts(array('imagemapster', 'map-hilight-app'));
    7070        }
    7171    }
  • maphilight/trunk/javascript/app.js

    r611688 r615519  
    11jQuery.noConflict();
    22jQuery(function($) {
    3     $('#map').maphilight({
     3    var resizeTime = 100;     // total duration of the resize effect, 0 is instant
     4    var resizeDelay = 100;
     5    $('#map').mapster({
    46        fillColor: map_hilight_args.background_color,
    57        fillOpacity: map_hilight_args.opacity,
    6         strokeColor: map_hilight_args.border_color
     8        strokeColor: map_hilight_args.border_color,
     9        clickNavigate: true
    710    });
     11    $(window).bind('resize',onWindowResize);
     12    // Resize the map to fit within the boundaries provided
     13
     14    function resize(maxWidth,maxHeight) {
     15         var image =  $('#map'),
     16            imgWidth = image.width(),
     17            imgHeight = image.height(),
     18            newWidth=0,
     19            newHeight=0;
     20
     21        if (imgWidth/maxWidth>imgHeight/maxHeight) {
     22            newWidth = maxWidth;
     23        } else {
     24            newHeight = maxHeight;
     25        }
     26        image.mapster('resize',newWidth,newHeight,resizeTime);   
     27    }
     28
     29    // Track window resizing events, but only actually call the map resize when the
     30    // window isn't being resized any more
     31
     32    function onWindowResize() {
     33        var curWidth = $('#map').parent().parent().width(),
     34            curHeight = $('#map').parent().parent().height(),
     35            checking=false;
     36        if (checking) {
     37            return;
     38                }
     39        checking = true;
     40        window.setTimeout(function() {
     41            var newWidth = $('#map').parent().parent().width(),
     42               newHeight = $('#map').parent().parent().height();
     43            if (newWidth === curWidth &&
     44                newHeight === curHeight) {
     45                resize(newWidth,newHeight);
     46            }
     47            checking=false;
     48        },resizeDelay );
     49    }
    850});
  • maphilight/trunk/readme.txt

    r611917 r615519  
    66Requires at least: 3.3
    77Tested up to: 3.4.2
    8 Stable tag: 0.1
     8Stable tag: 0.2
    99License: GPLv2
    1010
    1111== Description ==
    1212
    13 MapHilight makes it easy to integrate the javascript needed to make your maps or images interactive. Based on the maphilight jQuery plugin, MapHilight allows you to customize a hover effect on your maps or images.
    14 Plugin uses jQuery plugin found here : https://github.com/kemayo/maphilight - MIT Licensed
     13MapHilight makes it easy to integrate the javascript needed to make your maps or images interactive. Based on the imagemapster jQuery plugin, MapHilight allows you to customize a hover effect on your maps or images.
     14Plugin uses jQuery plugin found here : https://github.com/jamietre/imagemapster
     15Thanks jmcphail for pointing it out on this plugin's Wordpress forum.
    1516
    1617Use it in your Posts by adding the following shortcode : [maphilight]
     
    4445== Changelog ==
    4546
     47= 0.2 =
     48
     49* Changed jQuery plugin mahilight for imagemapster. Allowing responsive maps !
     50
    4651= 0.1 =
    4752
Note: See TracChangeset for help on using the changeset viewer.