var cancel_function = null;
var ok_function = null;
var popup_remember = null;
var popup_alert;
var popup_background;
var popup_cancel;
var popup_favicon;
var popup_iframe;
var popup_menubar;
var popup_ok;
var popup_text;
var popup_title;
var popup_alert;
var popup_window;
function popup_click_cancel() {
// hide popup. Must go before cancel_function because that might show another popup.
popup_hide();
// run cancel function
if (cancel_function!=null) {
cancel_function(popup_remember);
popup_reset();
}
}
function popup_click_close() {
popup_hide_window();
}
function popup_click_ok() {
// hide popup. Must go before ok_function because that might show another popup.
popup_hide();
// run ok function
if (ok_function!=null) {
ok_function(popup_remember);
popup_reset();
}
}
function popup_hide() {
// hide alert
popup_alert.className = "hidden";
// hide background, unless window is still visible (for file manager, etc).
if (popup_window.className.indexOf("hidden")!=-1) {
popup_background.className = "hidden";
}
}
function popup_hide_window() {
// hide alert
popup_window.className = "hidden";
// hide background, unless alert is still visible (unlikely).
if (popup_alert.className.indexOf("hidden")!=-1) {
popup_background.className = "hidden";
}
}
function popup_reset() {
ok_function = null;
cancel_function = null;
popup_remember = null;
}
/**
* from model_[...]
*/
function popup_init() {
//alert("popup_init");
popup_alert = document.getElementById("popup_alert");
popup_background = document.getElementById("popup_background");
popup_cancel = document.getElementById("popup_cancel");
popup_favicon = document.getElementById("popup_favicon");
popup_iframe = document.getElementById("popup_iframe");
popup_menubar = document.getElementById("popup_menubar");
popup_ok = document.getElementById("popup_ok");
popup_text = document.getElementById("popup_text");
popup_title = document.getElementById("popup_title");
popup_window = document.getElementById("popup_window");
}
function popup_show_url(_url, _title) {
// test init
if (typeof(popup_background)=='undefined') {alert("popup_background is undefined. Use popup_init()");}
// show background
popup_background.className = "";
// clear iframe, in case we've opened another page before.
//popup_iframe.src = "about:blank"; // didn't work...
// go iframe
popup_iframe.src = _url;
// set title
popup_title.innerHTML = (typeof(_title)=="undefined") ? _url : _title;
// show iframe + menubar. hide text, ok, cancel. See popup.css
popup_window.className = "";
}
function popup_show_text_only(_text) {
//alert("popup_show_text_only "+_text)
// test init
if (typeof(popup_background)=='undefined') {alert("popup_background is undefined. Use popup_init()");}
// show background
popup_background.className = "";
// set text
popup_text.innerHTML = _text;
// show only text
popup_alert.className = "text_only";
}
function popup_show_ok(_text, _style, _ok_function, _ok_remember) {
// test init
if (typeof(popup_background)=='undefined') {alert("popup_background is undefined. Use popup_init()");}
// test vars
else if (typeof(_text)!="string") {alert("popup_show_ok requires text. _text="+_text);}
else if (typeof(_style)!="string") {alert("popup_show_ok requires _style. _style="+_style);}
else {
// show background
popup_background.className = "";
// set text
popup_text.innerHTML = _text;
// set style (and hide iframe + menubar) See popup.css: welcome /error /delete /question
popup_alert.className = "ok "+_style;
// remember stuff
ok_function = (typeof(_ok_function)=='undefined') ? null : _ok_function;
popup_remember = (typeof(_remember)=='undefined') ? null : _remember;
}
}
function popup_show_ok_cancel(_text, _style, _ok_function, _cancel_function, _remember) {
// test init
if (typeof(popup_background)=='undefined') {alert("popup_backgound is undefined. Use popup_init()");}
// test vars
else if (typeof(_text)!="string") {alert("popup_show_ok_cancel requires text. _text="+_text);}
else if (typeof(_style)!="string") {alert("popup_show_ok_cancel requires _style. _style="+_style);}
else if (typeof(_ok_function)!="function") {alert("popup_show_ok_cancel requires _ok_function. _ok_function="+_ok_function);}
else if (typeof(_cancel_function)!="function") {alert("popup_show_ok_cancel requires _cancel_function. _cancel_function="+_cancel_function);}
else {
// show background
popup_background.className = "";
// set text
popup_text.innerHTML = _text;
// set style (and hide iframe + menubar) See popup.css: welcome /error /delete /question
popup_alert.className = "ok_cancel "+_style;
// remember stuff
ok_function = (typeof(_ok_function)=='undefined') ? null : _ok_function;
cancel_function = (typeof(_cancel_function)=='undefined') ? null : _cancel_function;
popup_remember = (typeof(_remember)=='undefined') ? null : _remember;
}
}
function popup_text_tips() {
var style = "style='padding:5px;border-bottom-color:#999999;border-bottom-style:solid;border-bottom-width:1px;'"
var s = "De tekstweergave kunt u aanpassen met de volgende codes:
";
s += "
| **dik gedrukt** | dik gedrukt |
| //schuin gedrukt// | schuin gedrukt |
| Link naar http://www.digidicht.nl | Link naar www.digidicht.nl |
| Link naar [http://google.com een site]. | Link naar een site. |
| Link naar [mailto:info@example.com een email adres]. | Link naar een email adres. |