Merge branch 'master' of ssh://git.citadel.org/appl/gitroot/citadel
authorWilfried Goesgens <dothebart@citadel.org>
Wed, 1 Dec 2010 21:25:57 +0000 (22:25 +0100)
committerWilfried Goesgens <dothebart@citadel.org>
Wed, 1 Dec 2010 21:25:57 +0000 (22:25 +0100)
webcit/static/closewindow.gif
webcit/static/modal.js [new file with mode: 0644]
webcit/static/pixel.gif [new file with mode: 0644]
webcit/static/styles/global.css
webcit/static/styles/modal.css [new file with mode: 0644]
webcit/static/styles/webcit.css
webcit/static/t/confirmlogoff.html [new file with mode: 0644]
webcit/static/t/head.html
webcit/static/t/iconbar.html
webcit/static/t/paging/failed_hook.html
webcit/static/wclib.js

index f55ad8ba9388102eee47013b92d4c456cdb2cd24..0cdac60b03e4e0b42f4f33df48d3110069387374 100644 (file)
Binary files a/webcit/static/closewindow.gif and b/webcit/static/closewindow.gif differ
diff --git a/webcit/static/modal.js b/webcit/static/modal.js
new file mode 100644 (file)
index 0000000..bd5de79
--- /dev/null
@@ -0,0 +1,89 @@
+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) {}
+       }
+       
+};
diff --git a/webcit/static/pixel.gif b/webcit/static/pixel.gif
new file mode 100644 (file)
index 0000000..5bfd67a
Binary files /dev/null and b/webcit/static/pixel.gif differ
index 0a12c86d91db51855d9f2a069e507622e09bfbf5..8e72d865959456bcc209640a2479dae302995823 100644 (file)
@@ -10,4 +10,3 @@
 }
 
 #global center { width: 80% }
-
diff --git a/webcit/static/styles/modal.css b/webcit/static/styles/modal.css
new file mode 100644 (file)
index 0000000..6389974
--- /dev/null
@@ -0,0 +1,75 @@
+.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;
+}
index 66e1daeaebc76faf77446dca8f73ba89b76bd98c..358a771799d3215e6c02bf5fd1fd5ef4ce6f8b31 100644 (file)
 @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% }
@@ -1264,4 +1262,3 @@ a.event_title:hover span.bttbottom, a.event_unread:hover span.bttbottom, a.event
        font-size: 100%;
        font-style: italic;
 }
-
diff --git a/webcit/static/t/confirmlogoff.html b/webcit/static/t/confirmlogoff.html
new file mode 100644 (file)
index 0000000..c6c3b82
--- /dev/null
@@ -0,0 +1,8 @@
+<html>
+<body>
+<center>
+<h1><a href="termquit"><img src="static/logoff_32x.gif" border="0">&nbsp;<?_("Log off")></a></h1>
+<h1><a href="javascript:toggleModal(0);"><img src="static/closewindow.gif" height="32" width="32" border="0">&nbsp;<?_("Cancel")></a></h1>
+</center>
+</body>
+</html>
index 85b398bf5364eecff867d1f80759bab074b03689..1840e24882c4112ba56553a173d4fd3726e954d2 100644 (file)
                <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")-->
index 65d7d3a9d3d991fe1871ffca8448f3ba19e0dec2..ab386f7c06fbc1139b4927f1cf83b85f63a7ccd4 100644 (file)
@@ -71,7 +71,7 @@
 </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>
index d814fcb6aa08c4c290b5c377dfafd661cb5ee867..200c39a30ad6fa7bba3dfe52c3fa8bdedb329098 100644 (file)
@@ -1,5 +1,13 @@
 <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>
index 938ed03fee086e448b87cb982fb4b59d1688e3c9..7a85697ecaad8823adb72c62b049d2a84b09d563 100644 (file)
@@ -861,3 +861,17 @@ function DeleteSMTPqueueMsg(msgnum1, msgnum2) {
                }
        );
 }
+
+
+function ConfirmLogoff() {
+       new Ajax.Updater(
+               'md-content',
+               'do_template?template=confirmlogoff',
+                {
+                        method: 'get',
+                       onSuccess: function(cl_success) {
+                               toggleModal(1);
+                       }
+                }
+        );
+}