Rework Login dialog to work with rekonq (and hopefully Safari)
authorWilfried Goesgens <dothebart@citadel.org>
Sun, 31 Mar 2013 11:52:02 +0000 (13:52 +0200)
committerWilfried Goesgens <dothebart@citadel.org>
Sun, 31 Mar 2013 11:52:02 +0000 (13:52 +0200)
  - modal.js: don't use a function pointer - simply name the function as the pointer.
  - head.html: if we're not logged in, we add the login dialog to the page; its hidden anyways.
  - login.html: since we get printed into existing pages, we don't need <html><body> - its wrong in first place to have them.
  - authmethods.js: GetLoggedInFirst(): we don't need to send an ajax request to retrieve the login mask; if its needed, head.html already contains it. Simply uncover it to the user.

webcit/static/authmethods.js
webcit/static/modal.js
webcit/static/t/get_logged_in.html
webcit/static/t/head.html
webcit/static/t/login.html

index a80543fdbbbedcff21bee5c02313ef7e80c8ad6a..fe7da239e915ff298f5ce53f4a3dbb0cad3cedfd 100644 (file)
@@ -38,16 +38,7 @@ function GetLoggedInFirst(destination_url) {
        new Ajax.Request(p, { method: 'get' } );
 
        /* If not logged in, go modal and ask the user to log in first. */
-       new Ajax.Updater(
-               'md-content',
-               'do_template?template=get_logged_in',
-                {
-                        method: 'get',
-                       onSuccess: function() {
-                               toggleModal(1);
-                       }
-                }
-        );
+        toggleModal(1);
 }
 
 
index bd5de79603a410be1170662a92ad70ea61df111f..5b631b14b40f6acd1baa685ae10e916804239337 100644 (file)
@@ -69,7 +69,7 @@ if ( isSafari ) {
 // need to do some special stuff to handle MSIE.
 
 
-var toggleModal = function (b) {
+function toggleModal (b) {
 
        if (modalShowing && b) return;
        if (!modalShowing && !b) return;
index 27b75a773b0142de41882fe247d3fd0414c6242a..e7284c76b934b94307fbe54f5b7e8f4ac338d221 100644 (file)
@@ -1,12 +1,10 @@
-<html>
-<body>
 <div id="loginbox_topline_container">
 <div id="loginbox_title">
 <?_("You must be logged in to access this page.")>
 </div>
 <div id="loginbox_closebutton">
 <a href="javascript:toggleModal(0);">
-<?_("Close window")>&nbsp;<img src="static/webcit_icons/closewindow.gif" border="0"></a>
+<?_("Close window")>&nbsp;<img src="static/webcit_icons/closewindow.gif" border="0" alt='<?_("Close window")>'></a>
 </div>
 </div>
 <br><br>
 </div>
 
 </div>
-</body>
-</html>
index e342a75975e04fb6b200aecadfd8a1db95b0eac3..20c82f72ddd97fecef36dc1ad3c3ee380a76dfe2 100644 (file)
@@ -41,6 +41,7 @@
                        <div class="md-dialog-wrap">
                                <div class="md-dialog" id="dialog">
                                        <div class="md-content" id="md-content">
+                                         <?!("COND:LOGGEDIN", 1><?=("get_logged_in")><??("X", 1)>
                                                <!-- contents of modal box go here -->
                                        </div>
                                </div>
index 96beced84490f634854b35da11fe95ec3377c80d..5be82d88d6873d87c9f3279e9333321c62af5e5f 100644 (file)
@@ -1,4 +1,6 @@
 <?=("head")>
+
+
 <!-- start login.html -->
 <div id="login_screen">
                <div class="box">