--- /dev/null
+var focusedElement = null;
+
+var modal = document.getElementById('modal');
+var dialog = document.getElementById('dialog');
+var body = document.getElementById('global');
+var html = document.documentElement;
+
+var modalShowing = (html.className === 'modal');
+
+
+// Have to hack for Safari, due to poor support for the focus() function.
+try {
+ var isSafari = window.navigator.vendor.match(/Apple/);
+} catch (ex) {
+ isSafari = false;
+}
+if ( isSafari ) {
+ var dialogFocuser = document.createElement('a');
+ dialogFocuser.href="#";
+ dialogFocuser.style.display='block';
+ dialogFocuser.style.height='0';
+ dialogFocuser.style.width='0';
+ dialogFocuser.style.position = 'absolute';
+ dialog.insertBefore(dialogFocuser, dialog.firstChild);
+} else {
+ dialogFocuser = dialog;
+}
+
+window.onunload = function () {
+ dialogFocuser = focusedElement = modal = dialog = body = html = null;
+};
+
+var onfocus = function (e) {
+ e = e || window.event;
+ var el = e.target || e.srcElement;
+
+ // save the last focused element when the modal is hidden.
+ if ( !modalShowing ) {
+ focusedElement = el;
+ return;
+ }
+
+ // if we're focusing the dialog, then just clear the blurring flag.
+ // else, focus the dialog and prevent the other event.
+ var p = el.parentNode;
+ while ( p && p.parentNode && p !== dialog ) {
+ p=p.parentNode;
+ }
+ if ( p !== dialog ) {
+ dialogFocuser.focus();
+ }
+};
+
+
+
+var onblur = function () {
+ if ( !modalShowing ) {
+ focusedElement = body;
+ }
+};
+
+html.onfocus = html.onfocusin = onfocus;
+html.onblur = html.onfocusout = onblur;
+if ( isSafari ) {
+ html.addEventListener('DOMFocusIn',onfocus);
+ html.addEventListener('DOMFocusOut',onblur);
+}
+// focus and blur events are tricky to bubble.
+// need to do some special stuff to handle MSIE.
+
+
+var toggleModal = function (b) {
+
+ if (modalShowing && b) return;
+ if (!modalShowing && !b) return;
+
+ html.className=modalShowing?'':'modal';
+
+ modalShowing = !modalShowing;
+
+ if (modalShowing) {
+ dialog.focus();
+ } else if (focusedElement) {
+ try {
+ focusedElement.focus();
+ } catch(ex) {}
+ }
+
+};
}
#global center { width: 80% }
-
--- /dev/null
+.md-overlay-decorator {
+ background: #222;
+ height: 100%;
+ width: 100%;
+ position: absolute;
+ top:0;
+ left:0;
+ opacity:0.8;
+ z-index:2000;
+ *display:none;
+}
+
+.md-overlay-wrap {
+ height:100%;
+ width:100%;
+ display:block;
+ position:absolute;
+ top:0;
+ left:0;
+ z-index:2001;
+ overflow:auto;
+ *overflow-x:hidden;
+ *zoom:1;
+ /* (0.8 * 255).toString(16) = cc */
+ *filter:progid:DXImageTransform.Microsoft.gradient(startColorstr=#cc222222,endColorstr=#cc222222);
+ *background:transparent url(../pixel.gif);
+}
+
+.md-overlay {
+ z-index:2001;
+ position:relative;
+ margin:0 auto;
+ display:table;
+ height:100%;
+ vertical-align:middle;
+ width:300px;
+ z-index:9999;
+ *width:100%;
+ *text-align:center;
+ *position:static;
+ *display:block;
+}
+
+.md-dialog-wrap {
+ display:table-cell;
+ vertical-align:middle;
+ *width:300px;
+ *text-align:left;
+ *zoom:1;
+ *display:inline;
+}
+
+.md-dialog-decorator {
+ display:none;
+ *vertical-align:middle;
+ *zoom:1;
+ *display:inline;
+ *height:100%;
+ *width:0;
+ *background:red;
+}
+
+#modal {
+ display:none;
+}
+
+.modal #modal {
+ display:block;
+}
+
+.md-dialog {
+ background: white;
+ border: 2px solid #800;
+ padding: 10px;
+}
@import url("navbar.css");
@import url("content.css");
@import url("box.css");
+@import url("modal.css");
@media print {
input#toggler, .toolbar { display: none }
}
-/* Typography */
-
-html {
+html, body {
font-size: 100;
- overflow: hidden;
-}
-
-body {
- font-size: 100%;
- overflow: hidden;
+ height:100%;
+ width:100%;
+ margin:0;
+ padding:0;
+ overflow:hidden;
}
.address_book_popup_title { font-size: 130% }
font-size: 100%;
font-style: italic;
}
-
--- /dev/null
+<html>
+<body>
+<center>
+<h1><a href="termquit"><img src="static/logoff_32x.gif" border="0"> <?_("Log off")></a></h1>
+<h1><a href="javascript:toggleModal(0);"><img src="static/closewindow.gif" height="32" width="32" border="0"> <?_("Cancel")></a></h1>
+</center>
+</body>
+</html>
<script type="text/javascript" src="static/wclib.js"></script>
<script type="text/javascript" src="static/roomops.js"></script>
<script type="text/javascript" src="static/ctdldragdrop.js"></script>
+ <script type="text/javascript" src="static/modal.js"></script>
</head>
<body>
<??("COND:LOGGEDIN",1)>
<?ICONBAR>
<??("X",1)>
+<!--("begin modal container")-->
+<div id="modal">
+ <div class="md-overlay-decorator"></div>
+ <div class="md-overlay-wrap">
+ <div class="md-overlay">
+ <div class="md-dialog-decorator"></div>
+ <div class="md-dialog-wrap">
+ <div class="md-dialog" id="dialog">
+ <div class="md-content" id="md-content">
+
+This is the modal dialog box. If you are seeing this message, the
+modal dialog was invoked without first populating its contents, which
+is a mistake.
+<br>
+<h2><a href="javascript:toggleModal(0);">Dismiss</a></h2>
+
+ </div>
+ </div>
+ </div>
+ </div>
+ </div>
+</div>
+<!--("end modal container")-->
<div id="global">
<!--("end head.html")-->
</ul>
</div>
<div id="ib_logoff" class="ib_button">
-<a class="ib_button_link" href="termquit" onclick="return confirm('<?_("Log off now?")>');" title="<?_("Log off")>"><span><?_("Log off")></span></a>
+<a class="ib_button_link" href="javascript:ConfirmLogoff()" title="<?_("Log off")>"><span><?_("Log off")></span></a>
</div>
<div id="customize" class="iconbar_text">
<span><a href="do_template?template=iconbar_edit"><?_("customize this menu")></a></span>
<script type="text/javascript">
+
+function PopUpExplicit() {
+ window.open('static/instant_messenger.html', 'CTDL_MESSENGER', 'width=700,height=400');
+ toggleModal(0);
+}
+
function PopUpFailed() {
- alert("<?_("You have one or more instant messages waiting, but the Citadel Instant Messenger window failed to open. This is probably because you have a popup blocker installed. Please configure your popup blocker to allow popups from this site if you wish to receive instant messages.")>");
+
+ $('md-content').innerHTML = "<div align='justify'><?_("You have one or more instant messages waiting, but the Citadel Instant Messenger window failed to open. This is probably because you have a popup blocker installed. Please configure your popup blocker to allow popups from this site if you wish to receive instant messages.")></div><br><br><div align='center'><h2><a href='javascript:PopUpExplicit();'>OK</a></h2></div>";
+ toggleModal(1);
}
</script>
}
);
}
+
+
+function ConfirmLogoff() {
+ new Ajax.Updater(
+ 'md-content',
+ 'do_template?template=confirmlogoff',
+ {
+ method: 'get',
+ onSuccess: function(cl_success) {
+ toggleModal(1);
+ }
+ }
+ );
+}