Problem with Jquery Corner plugin at firefox 4 ?

If your jquery.corner.js is not working with firefox 4 then a small modification of your plugin can make it OK for firefox 4.

Open your jquery.corner.js file. At the beginning of the code you will find some code like

var style = document.createElement('div').style;
var moz = style['MozBorderRadius'] !== undefined;
var webkit = style['WebkitBorderRadius'] !== undefined;
var radius = style['BorderRadius'] !== undefined;

In this plugin,

var moz = style['MozBorderRadius'] !== undefined;

was actually for firefox. But from firefox 4 there is no longer exists -moz-radius, that means style[‘MozBorderRadius’] will not work for firemox 4 anymore.

For firefox 4, they use the standard “border-radius” for curve corner of an element. So change the line

var radius = style['BorderRadius'] !== undefined;

to

var radius = (style['BorderRadius'] || style['borderRadius']) !== undefined;

This change of  jquery.corner.js plugin will work for both old firefox version as well as Firefox 4.

cheers!

Advertisements

Drupal – Clear cache from module

In Drupal, if you need to clear cache from your module then you can add this code when you need to clear cache. Mostly when we create a custom FORM to add/edit/delete anything other than node, we may need to clear cache.

Code:

function MODULENAME_flush_cache(){
  // this will clear any type of cache
  cache_clear_all(NULL, 'cache_block');
  cache_clear_all(NULL, 'cache_page');
  cache_clear_all('*', 'cache', TRUE);
  cache_clear_all('*', 'content', TRUE);
  cache_clear_all('*', 'cache_page', TRUE);
  cache_clear_all('*', 'cache_menu', TRUE);
  cache_clear_all('*', 'cache_filter', TRUE);
}