Foundation 5 and IMCE

Having trouble getting IMCE to play well with Foundation 5?

Why does IMCE not work with Foundation 5?

  • Foundation needs jQuery 1.10 or higher
  • IMCE uses $.browser which is not in 1.10
  • IMCE needs to use another jQuery version or use the jQuery migrate js file which is outlined below. 

Work around:

  1. Download jquery-migrate-1.2.1.js from https://github.com/jquery/jquery-migrate/ and put it in the js folder of your theme. jQuery migrate adds back the $.browser in addition to many other functions removed from jQuery 1.9. 
  2. Create a file called imce-page.tpl.php and copy/paste the HTML code below. Change the bolded text with the path to the query migrate file. This allows IMCE to use $.browser.
  3. Clear theme registry or clear cache.
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="http://www.w3.org/1999/xhtml" lang="<?php print $GLOBALS['language']->language; ?>" xml:lang="<?php print $GLOBALS['language']->language; ?>" class="imce">
 
<head>
  <title><?php print t('File Browser'); ?></title>
  <?php if (isset($_GET['app'])): drupal_add_js(drupal_get_path('module', 'imce') .'/js/imce_set_app.js'); endif;?>
  <?php print drupal_get_html_head(); ?>
  <?php drupal_add_js(drupal_get_path('theme', 'deerpath') . '/js/vendor/jquery-migrate-1.2.1.js');?>  <?php print drupal_get_css(); ?>
  <?php print drupal_get_js('header'); ?>
  <style media="all" type="text/css">/*Quick-override*/</style>
</head>
 
<body class="imce">
<div id="imce-messages"><?php print theme('status_messages'); ?></div>
<?php print $content; ?>
<?php print drupal_get_js('footer'); ?>
</body>
 
</html>