Changeset 4774


Ignore:
Timestamp:
03/19/14 13:43:38 (10 years ago)
Author:
stephanie.roth@snd.gu.se
Message:

Added dialog with login iFrame.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • DASISH/t5.6/client/trunk/chrome/markingcollection/content/markingcollection/loginDialog.xul

    r4751 r4774  
    33<!DOCTYPE overlay SYSTEM "chrome://markingcollection/locale/markingcollection.dtd">
    44<dialog
    5         id="tagoutputDialog"
    6         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
    7         xmlns:html="http://www.w3.org/1999/xhtml"
    8         title="Login">
    9    
    10 
    11         <iframe height="500" width="650" type="content" src="https://lux17.mpi.nl/ds/webannotator/api/authentication/login" flex="2" id="browserTable" name="table_frame"/>
     5    id="tagoutputDialog"
     6    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
     7    xmlns:html="http://www.w3.org/1999/xhtml"
     8    title="Login"
     9    onload="loginLoad()">
     10    <script type="application/x-javascript">
     11            <![CDATA[       
     12                function loginLoad() {
     13                    //navigate to login page from the params
     14                    document.getElementById("loginIframe").setAttribute("src", window.arguments[0].backend+"/api/authentication/login");                   
     15                }
     16               
     17                window.addEventListener("load",Listen,false);
     18               
     19                function Listen(){
     20                    var frame = document.getElementById("loginIframe");
     21                    frame.addEventListener("DOMContentLoaded", DomLoadedEventHandler, true);                                             
     22                }
     23 
     24                function DomLoadedEventHandler() {
     25                    var frame = document.getElementById("loginIframe");
     26                    alert("Current url: "+frame.contentDocument.location.href);
     27                    alert("target url: "+window.arguments[0].backend+'/api');
     28                    if(frame.contentDocument.location.href == window.arguments[0].backend+'/api'){
     29                        alert("login done");
     30                    }
     31                }
     32            ]]>
     33    </script>
     34    <iframe id="loginIframe" height="500" width="650" type="content" src="" flex="2" />
    1235</dialog>
Note: See TracChangeset for help on using the changeset viewer.