svncommit
2007-09-25 b0dbf3ce3e8a7b72e9d2c2376015f1f47de84d12
program/js/common.js
@@ -103,6 +103,15 @@
// static functions for event handling
var rcube_event = {
 /**
  * returns the event key code
  */
 get_keycode: function(e)
 {
   e = e || window.event;
   return e && e.keyCode ? e.keyCode : (e && e.which ? e.which : 0);
 },
/**
 * returns modifier key (constants defined at top of file)
 */
@@ -593,4 +602,33 @@
roundcube_browser.prototype.get_cookie = getCookie;
// tiny replacement for Firebox functionality
function rcube_console()
{
  this.box = rcube_find_object('console');
  this.log = function(msg)
  {
    if (this.box)
      this.box.value += str+'\n--------------------------------------\n';
  };
  this.reset = function()
  {
    if (this.box)
      this.box.value = '';
  };
}
var bw = new roundcube_browser();
if (!window.console)
  console = new rcube_console();
// Add escape() method to RegExp object
// http://dev.rubyonrails.org/changeset/7271
RegExp.escape = function(str)
  {
  return String(str).replace(/([.*+?^=!:${}()|[\]\/\\])/g, '\\$1');
  }