File:
[LON-CAPA] /
loncom /
html /
htmlarea /
Attic /
dialog.js
Revision
1.2:
download - view:
text,
annotated -
select for diffs
Tue Jun 1 23:46:10 2004 UTC (20 years, 4 months ago) by
www
Branches:
MAIN
CVS tags:
version_2_5_X,
version_2_5_99_0,
version_2_5_2,
version_2_5_1,
version_2_5_0,
version_2_4_X,
version_2_4_99_0,
version_2_4_2,
version_2_4_1,
version_2_4_0,
version_2_3_X,
version_2_3_99_0,
version_2_3_2,
version_2_3_1,
version_2_3_0,
version_2_2_X,
version_2_2_99_1,
version_2_2_99_0,
version_2_2_2,
version_2_2_1,
version_2_2_0,
version_2_1_X,
version_2_1_99_3,
version_2_1_99_2,
version_2_1_99_1,
version_2_1_99_0,
version_2_1_3,
version_2_1_2,
version_2_1_1,
version_2_1_0,
version_2_0_X,
version_2_0_99_1,
version_2_0_2,
version_2_0_1,
version_2_0_0,
version_1_99_3,
version_1_99_2,
version_1_99_1_tmcc,
version_1_99_1,
version_1_99_0_tmcc,
version_1_99_0,
version_1_3_X,
version_1_3_3,
version_1_3_2,
version_1_3_1,
version_1_3_0,
version_1_2_X,
version_1_2_99_1,
version_1_2_99_0,
version_1_2_1,
version_1_2_0,
version_1_1_99_5,
version_1_1_99_4,
version_1_1_99_3,
version_1_1_99_2,
version_1_1_99_1,
version_1_1_99_0,
HEAD
Next version HTMLArea.
// htmlArea v3.0 - Copyright (c) 2003-2004 interactivetools.com, inc.
// This copyright notice MUST stay intact for use (see license.txt).
//
// Portions (c) dynarch.com, 2003-2004
//
// A free WYSIWYG editor replacement for <textarea> fields.
// For full source code and docs, visit http://www.interactivetools.com/
//
// Version 3.0 developed by Mihai Bazon.
// http://dynarch.com/mishoo
//
// $Id: dialog.js,v 1.2 2004/06/01 23:46:10 www Exp $
// Though "Dialog" looks like an object, it isn't really an object. Instead
// it's just namespace for protecting global symbols.
function Dialog(url, action, init) {
if (typeof init == "undefined") {
init = window; // pass this window object by default
}
Dialog._geckoOpenModal(url, action, init);
};
Dialog._parentEvent = function(ev) {
if (Dialog._modal && !Dialog._modal.closed) {
Dialog._modal.focus();
HTMLArea._stopEvent(ev);
}
};
// should be a function, the return handler of the currently opened dialog.
Dialog._return = null;
// constant, the currently opened dialog
Dialog._modal = null;
// the dialog will read it's args from this variable
Dialog._arguments = null;
Dialog._geckoOpenModal = function(url, action, init) {
var dlg = window.open(url, "hadialog",
"toolbar=no,menubar=no,personalbar=no,width=10,height=10," +
"scrollbars=no,resizable=yes");
Dialog._modal = dlg;
Dialog._arguments = init;
// capture some window's events
function capwin(w) {
HTMLArea._addEvent(w, "click", Dialog._parentEvent);
HTMLArea._addEvent(w, "mousedown", Dialog._parentEvent);
HTMLArea._addEvent(w, "focus", Dialog._parentEvent);
};
// release the captured events
function relwin(w) {
HTMLArea._removeEvent(w, "click", Dialog._parentEvent);
HTMLArea._removeEvent(w, "mousedown", Dialog._parentEvent);
HTMLArea._removeEvent(w, "focus", Dialog._parentEvent);
};
capwin(window);
// capture other frames
for (var i = 0; i < window.frames.length; capwin(window.frames[i++]));
// make up a function to be called when the Dialog ends.
Dialog._return = function (val) {
if (val && action) {
action(val);
}
relwin(window);
// capture other frames
for (var i = 0; i < window.frames.length; relwin(window.frames[i++]));
Dialog._modal = null;
};
};
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>