From 4ac3816bc40d08f3e7dbd82c5b7cf3036944d0f8 Mon Sep 17 00:00:00 2001 From: azammitdcarf Date: Wed, 4 Aug 2010 05:03:36 +0000 Subject: [PATCH] Updated from McMaster branch to not use popup windows (better for Kiosks) --- call.php | 8 ++++---- js/popup.js | 39 +++++++++++++++++++++++++++++++++------ js/window.js | 13 ++++++------- rs_answeringmachine.php | 8 ++++---- rs_business.php | 5 +++-- rs_callback.php | 5 ++--- rs_intro.php | 16 ++++++++-------- rs_project_end.php | 5 ++--- rs_project_intro.php | 9 ++++----- rs_quota_end.php | 5 ++--- 10 files changed, 68 insertions(+), 45 deletions(-) diff --git a/call.php b/call.php index 117cb013..0a801be3 100644 --- a/call.php +++ b/call.php @@ -169,9 +169,9 @@ if (isset($_POST['submit'])) $v->dial(get_extension($operator_id),get_call_number($call_id)); } if (is_respondent_selection($operator_id)) - $btext = "onload='openParentObject(\"main-content\",\"rs_intro.php\"); top.close();'"; + $btext = "onload='openParentObject(\"main-content\",\"rs_intro.php\"); parent.closePopup();'"; else - $btext = "onload='top.close();'"; + $btext = "onload='parent.closePopup();'"; xhtml_head(T_("Call"),true,array("css/call.css"),array("js/window.js"),$btext); } } @@ -188,7 +188,7 @@ if (isset($_POST['submit'])) } //disable recording $newtext = T_("Start REC"); - xhtml_head(T_("Call"),true,array("css/call.css"),array("js/window.js"),"onload='toggleRec(\"$newtext\",\"record.php?start=start\",\"offline\"); top.close();'"); + xhtml_head(T_("Call"),true,array("css/call.css"),array("js/window.js"),"onload='toggleRec(\"$newtext\",\"record.php?start=start\",\"offline\"); parent.closePopup();'"); } else { @@ -202,7 +202,7 @@ if (isset($_POST['submit'])) } //disable recording $newtext = T_("Start REC"); - xhtml_head(T_("Call"),true,array("css/call.css"),array("js/window.js"),"onload='toggleRec(\"$newtext\",\"record.php?start=start\",\"offline\"); top.close();'"); + xhtml_head(T_("Call"),true,array("css/call.css"),array("js/window.js"),"onload='toggleRec(\"$newtext\",\"record.php?start=start\",\"offline\"); parent.closePopup();'"); } diff --git a/js/popup.js b/js/popup.js index 3759bb53..2e17092b 100644 --- a/js/popup.js +++ b/js/popup.js @@ -1,6 +1,33 @@ -var newwindow; -function poptastic(url) -{ - newwindow=window.open(url,'name','height=600,width=350,resizable=yes,scrollbars=yes,toolbar=no,status=no'); - if (window.focus) {newwindow.focus()} -} +function poptastic(url, title) +{ + var elem = jQuery("#inpage"); + if (elem.length > 0) { + elem = jQuery(elem[0]); + if (elem.dialog("option", "title") == title) { + if (! elem.dialog("isOpen")) { + elem.dialog("open"); + } + return; + } else { + elem.dialog("close").dialog("destroy").remove(); + } + } + jQuery('