Plugin Directory

Changeset 1286682


Ignore:
Timestamp:
11/15/2015 05:54:47 PM (10 years ago)
Author:
chrisy
Message:

add javascript to scale imagemaps to the size of images that use them

Location:
tfo-graphviz/trunk
Files:
3 added
2 edited

Legend:

Unmodified
Added
Removed
  • tfo-graphviz/trunk/readme.txt

    r1286661 r1286682  
    234234* Add the SVG output format. See http://blog.flirble.org/2015/11/15/adding-svg-support-tfo-graphviz/ for example. (Joachim Durchholz)
    235235* Add a fix for if the requires GV class isn't loadable, such as when GV gets upgraded on the system. (Sam Wilson)
     236* Include some JavaScript when both an image map and width/height scaling is specified. This is required to scale the image map to whatever the image has been scaled to. Image map scaling code comes from https://github.com/davidjbradshaw/image-map-resizer
    236237
    237238= 1.12 =
  • tfo-graphviz/trunk/tfo-graphviz.php

    r1286661 r1286682  
    158158
    159159        if (TFO_GV_DEBUG) file_put_contents(sys_get_temp_dir() . "/pre", $dot);
     160
     161        // Load some JavaScript to resize imagemaps if we have scaled images and
     162        // image maps.
     163        if ($atts['imap'] && (!empty($atts['width']) || !empty($atts['height']))) {
     164            wp_enqueue_script('jquery');
     165            $url = plugins_url(basename(dirname(__FILE__)) . '/js/imageMapResizer.min.js');
     166            wp_enqueue_script('imageMapResizer', $url, array('jquery'), '1.0.0', true);
     167            $url = plugins_url(basename(dirname(__FILE__)) . '/js/tfo-gv.js');
     168            wp_enqueue_script('tfo-gv', $url, array('jquery', 'imageMapResizer'), '1.0.0', true);
     169            $url = false;
     170        }
    160171
    161172        // GraphViz mangles newlines into HTML <br /> and </p>'s
Note: See TracChangeset for help on using the changeset viewer.