Internet Explorer 6-8 support

Created on 9 April 2013, over 11 years ago
Updated 28 February 2023, almost 2 years ago

I installed this module and used the 2.3.0 version of the signature-pad library. It largely worked out of the gates, except for versions of IE lower than 9 because of their lack of support. It looked like the 'includes/system.inc' file of this module was trying to load up files named 'excanvas-r71.min.js' and 'excanvas-r3.min.js' from the library's 'assets' directory to help with canvas support. However, neither the files nor the directory existed with the 2.3.0 version of the library that I downloaded.

Upon inspection of the library's directory I noticed that the examples were utilizing a file named 'flashcanvas.js' in the 'build' directory. So I made the module load up that file by modifying the start of the signaturefield_after_build() function in the 'includes/system.inc' file:

<?php
function signaturefield_after_build($element, $form_state) {

  $libpath = libraries_get_path('signature-pad');
  $modpath = drupal_get_path('module', 'signaturefield');

  //fixing the canvas support in IE<9
  global $base_url;
  $flashcanvas_html = "<!--[if lt IE 9]><script type='text/javascript' src='{$base_url}/{$libpath}/build/flashcanvas.js'></script><![endif]-->";
  $flashcanvas_link = array(
    '#type' => 'markup',
    '#markup' => $flashcanvas_html,
  );
  drupal_add_html_head($flashcanvas_link, 'signaturefield-excanvas');
 
  /* commenting out old code
  drupal_add_html_head("<!--[if gte IE 7]><script type='text/javascript' src='{$libpath}/assets/excanvas-r71.min.js'></script><![endif]-->
  <!--[if IE 6]><script type='text/javascript' src='{$libpath}/assets/excanvas-r3.min.js'></script><![endif]-->", $key = NULL);
  */
?>  

This seems to have done the trick.

🐛 Bug report
Status

Closed: won't fix

Version

1.0

Component

Code

Created by

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024