Changeset 615519
- Timestamp:
- 10/22/2012 09:45:54 AM (12 years ago)
- Location:
- maphilight/trunk
- Files:
-
- 1 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
maphilight/trunk/README.md
r611688 r615519 6 6 __Donate link__: 7 7 __Requires at least__: 3.3 8 __Tested up to__: 3.4. 19 __Stable tag__: 1.38 __Tested up to__: 3.4.2 9 __Stable tag__: 0.2 10 10 __License__: GPLv2 11 11 … … 13 13 ----------- 14 14 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 15 MapHilight 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. 16 Plugin uses jQuery plugin found here : https://github.com/jamietre/imagemapster 17 Thanks jmcphail for pointing it out on this plugin's Wordpress forum. 17 18 18 19 Use it in your Posts by adding the following shortcode : [maphilight] … … 31 32 -------------------------- 32 33 33 1. How do I integrate the map in an article or a post once it has been created in the admin menu ? 34 1. How do I integrate the map in an article or a post once it has been created in the admin menu ? 34 35 > 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. 35 36 … … 48 49 Changelog 49 50 --------- 51 ### 0.2 ### 52 53 * Changed jQuery plugin mahilight for imagemapster. Allowing responsive maps ! 50 54 51 55 ### 0.1 ### -
maphilight/trunk/classes/Map_Hilight.php
r611688 r615519 129 129 // echo map tag with corresponding name 130 130 // 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">'; 133 133 $html .= stripslashes($options['map_area_code']); 134 134 $html .= '</map>'; -
maphilight/trunk/classes/Map_Hilight_Site.php
r611688 r615519 30 30 // Scripts 31 31 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), 34 34 array('jquery') 35 35 ); … … 39 39 'map-hilight-app' , 40 40 plugins_url('javascript/app.js', Map_Hilight::$file) , 41 array('jquery', ' maphilight')41 array('jquery', 'imagemapster') 42 42 ); 43 43 } … … 53 53 // As of WordPress 3.3 wp_enqueue_script() can be called mid-page (in the HTML body). 54 54 // This will load the script in the footer. 55 wp_enqueue_script(' maphilight');55 wp_enqueue_script('imagemapster'); 56 56 wp_enqueue_script('map-hilight-app'); 57 57 wp_localize_script('map-hilight-app', 'map_hilight_args', Map_Hilight::getOptions()); … … 67 67 public static function printScripts() { 68 68 if(self::$printScripts) { 69 wp_print_scripts(array(' maphilight', 'map-hilight-app'));69 wp_print_scripts(array('imagemapster', 'map-hilight-app')); 70 70 } 71 71 } -
maphilight/trunk/javascript/app.js
r611688 r615519 1 1 jQuery.noConflict(); 2 2 jQuery(function($) { 3 $('#map').maphilight({ 3 var resizeTime = 100; // total duration of the resize effect, 0 is instant 4 var resizeDelay = 100; 5 $('#map').mapster({ 4 6 fillColor: map_hilight_args.background_color, 5 7 fillOpacity: map_hilight_args.opacity, 6 strokeColor: map_hilight_args.border_color 8 strokeColor: map_hilight_args.border_color, 9 clickNavigate: true 7 10 }); 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 } 8 50 }); -
maphilight/trunk/readme.txt
r611917 r615519 6 6 Requires at least: 3.3 7 7 Tested up to: 3.4.2 8 Stable tag: 0. 18 Stable tag: 0.2 9 9 License: GPLv2 10 10 11 11 == Description == 12 12 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 13 MapHilight 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. 14 Plugin uses jQuery plugin found here : https://github.com/jamietre/imagemapster 15 Thanks jmcphail for pointing it out on this plugin's Wordpress forum. 15 16 16 17 Use it in your Posts by adding the following shortcode : [maphilight] … … 44 45 == Changelog == 45 46 47 = 0.2 = 48 49 * Changed jQuery plugin mahilight for imagemapster. Allowing responsive maps ! 50 46 51 = 0.1 = 47 52
Note: See TracChangeset
for help on using the changeset viewer.