Hi,
i've installed the colorbox module which needs jquery 1.3.2. After the installation of colorbox, IMCE was not running anymore.
I got the following error: (Firebug Console)
$.support is undefined
[Break on this error] isIE = !$.support.opacity,
colorbox.js?9 (Zeile 12)
$(".colorbox").colorbox is not a function
[Break on this error] $('.colorbox').colorbox();
colorbox.js?9 (Zeile 3)
==> I've checked out what goes wrong and found out that IMCE doenst include the jquery_update module, but its required by colorbox! So colorbox.js throwed an error and IMCE js isnt interpreted.
So can you please include the jquery_update module into IMCE? Iam sure that other modules which require jquery 1.3.2 will break IMCE too!
Greets,
Benedikt
(Sry for my bad english, its not my motherlanguage)
My dirty fix: (Maybe it helps someone else until its fixed @ IMCE)
I know my fix is dirty, but it works for me, because i need it running today:
I've replaced
<?php print drupal_get_js('header'); ?>
in imce-page.tpl.php
with
<?php //print drupal_get_js('header'); ?>
<script src="<?echo base_path();?>misc/jquery.js" type="text/javascript"></script>
<script src="<?echo base_path();?>misc/drupal.js" type="text/javascript"></script>
<script src="<?echo base_path();?>misc/jquery.form.js" type="text/javascript"></script>
<script src="<?php echo drupal_get_path('module', 'imce') .'/js/imce.js'?>" type="text/javascript"></script>
<script src="<?php echo drupal_get_path('module', 'imce') .'/js/imce_set_app.js'?>" type="text/javascript"></script>
<script src="<?php echo drupal_get_path('module', 'imce') .'/js/imce_extras.js'?>" type="text/javascript"></script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
jQuery.extend(Drupal.settings, {... Insert your jquery extend stuff here! ...});
//--><!]]>
</script>
<script type="text/javascript">
<!--//--><![CDATA[//><!--
imce.hooks.load.push(imce.initiateShortcuts);//shortcuts for directories and files
imce.hooks.load.push(imce.initiateSorting);//file sorting
imce.hooks.load.push(imce.initiateResizeBars);//area resizing bars
imce.hooks.list.push(imce.thumbRow); $.extend(imce.vars, {tMaxW: 120, tMaxH: 120, prvW: 40, prvH: 40});//inline thumbs
//--><!]]>
</script>
Comments
Comment #1
ufku commentedWhat's the reason for loading colorbox in IMCE page?
Alternates allow an include/exclude path settings instead of loading the script files in all pages.
Anyway, here is a cleaner workaround.
replace
with
Comment #2
jabberw0cky commentedufku - thanks! I discovered your post while looking for a way to get the jquery_update module to work while still being able to include a page-specific js file. Your code worked beautifully, and I better understand what's going on now. I was calling drupal_get_js() after adding my custom js file, which was overwriting $scripts - therefore the stuff that jquery_update had replaced was getting overwritten.
Thanks,
Jared
Comment #3
ufku commented