Commit cc621740 authored by Richard Mansfield's avatar Richard Mansfield
Browse files
parents 99a24b1a cd61deef
......@@ -522,25 +522,13 @@ MochiKit.Base.update(MochiKit.Signal, {
var observers = self._observers;
for (var i = 0; i < observers.length; i++) {
self._disconnect(observers[i]);
}
delete self._observers;
try {
window.onload = undefined;
} catch(e) {
// pass
}
try {
window.onunload = undefined;
} catch(e) {
// pass
if (observers[i][1] !== 'onload' && observers[i][1] !== 'onunload') {
self._disconnect(observers[i]);
}
}
},
_listener: function (src, func, obj, isDOM) {
_listener: function (src, sig, func, obj, isDOM) {
var self = MochiKit.Signal;
var E = self.Event;
if (!isDOM) {
......@@ -548,13 +536,27 @@ MochiKit.Base.update(MochiKit.Signal, {
}
obj = obj || src;
if (typeof(func) == "string") {
return function (nativeEvent) {
obj[func].apply(obj, [new E(src, nativeEvent)]);
};
if (sig === 'onload' || sig === 'onunload') {
return function (nativeEvent) {
obj[func].apply(obj, [new E(src, nativeEvent)]);
MochiKit.Signal.disconnect(src, sig, obj, func);
};
} else {
return function (nativeEvent) {
obj[func].apply(obj, [new E(src, nativeEvent)]);
};
}
} else {
return function (nativeEvent) {
func.apply(obj, [new E(src, nativeEvent)]);
};
if (sig === 'onload' || sig === 'onunload') {
return function (nativeEvent) {
func.apply(obj, [new E(src, nativeEvent)]);
MochiKit.Signal.disconnect(src, sig, func);
};
} else {
return function (nativeEvent) {
func.apply(obj, [new E(src, nativeEvent)]);
};
}
}
},
......@@ -637,7 +639,7 @@ MochiKit.Base.update(MochiKit.Signal, {
sig = "onmouseout";
}
} else {
var listener = self._listener(src, func, obj, isDOM);
var listener = self._listener(src, sig, func, obj, isDOM);
}
if (src.addEventListener) {
......@@ -668,6 +670,7 @@ MochiKit.Base.update(MochiKit.Signal, {
var src = ident[0];
var sig = ident[1];
var listener = ident[2];
if (src.removeEventListener) {
src.removeEventListener(sig.substr(2), listener, false);
} else if (src.detachEvent) {
......
......@@ -50,7 +50,7 @@ $string['dbconnfailed'] = 'Failed to connect to database, error message was %s';
// if you change these next two , be sure to change them in libroot/errors.php
// as they are duplicated there, in the case that get_string was not available.
$string['unrecoverableerror'] = 'A nonrecoverable error occured. This probably means that you have encountered a bug in the system';
$string['unrecoverableerror'] = 'A nonrecoverable error occurred. This probably means that you have encountered a bug in the system.';
$string['unrecoverableerrortitle'] = '%s - Site Unavailable';
$string['parameterexception'] = 'A required parameter was missing';
$string['accessdeniedexception'] = 'You do not have access to view this page';
......
......@@ -919,8 +919,8 @@ function pieform_validate(Pieform $form, $values) {
function pieform_element_calendar_configure($element) {
$element['jsroot'] = '/js/jscalendar/';
$element['themefile'] = get_config('themeurl') . 'style/calendar.css';
$element['imagefile'] = get_config('themeurl') . 'calendar.gif';
$element['themefile'] = theme_get_url('style/calendar.css');
$element['imagefile'] = theme_get_url('calendar.gif');
$element['language'] = 'en'; // @todo: language file names for the js calendar may need to be changed
return $element;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment