<?xml version="1.0" encoding="UTF-8" ?>
<Module>
    <ModulePrefs title="Associated User Accounts">
        <Require feature="pubsub-2"/>
    </ModulePrefs>
    <Content type="html" view="default">
        <![CDATA[

        <link rel="stylesheet" type="text/css" href="js/ui/css/main.css">
        <link rel="stylesheet" type="text/css" href="js/ui/css/smoothness/jquery-ui-1.12.1.custom.min.css">
        <link rel="stylesheet" type="text/css" href="js/ui/css/smoothness/jqueryui-themeroller.css">
        <link rel="stylesheet" type="text/css" href="js/ui/css/dialog.css">
        <link rel="stylesheet" type="text/css" href="js/ui/css/bootstrap.css">
        <link rel="stylesheet" type="text/css" href="js/ui/css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="js/ui/css/bootstrap-theme.css">

        <script type="text/javascript" src="js/jquery.min.js"></script>
        <script type="text/javascript" src="serverinfo.jag"></script>
        <script>
            var headID = document.getElementsByTagName("head")[0];
            var cssNode = document.createElement('link');
            cssNode.type = 'text/css';
            cssNode.rel = 'stylesheet';
            cssNode.href = PROXY_CONTEXT_PATH + '/portal/gadgets/connected_accounts/js/ui/font-awesome/css/font-awesome.min.css';
            headID.appendChild(cssNode);
        </script>
        <script>
            $(function () {
                $('.max_view').click(function () {
                    gadgets.Hub.publish('org.wso2.is.dashboard', {
                        msg:'A message from Manage associated user accounts',
                        id:"manage_accounts  .expand-widget"
                    });
                });
            });
        </script>

        <div class='icon-retweet icon-user-retweet icon-marketing-styles'></div>
        <p>Manage Associated User Accounts & Federated IDs.</p>
        <p><a class='btn btn-default max_view' href=''>View details</a></p>
        ]]>
    </Content>

    <Content type="html" view="home">
        <![CDATA[
        <script type="text/javascript" src="/portal/csrf.js"></script>
        <script type="text/javascript" src="js/jquery.min.js" type="text/javascript"></script>
        <script type="text/javascript" src="js/main.js" type="text/javascript"></script>
        <script type="text/javascript" src="js/modal.js" type="text/javascript"></script>
        <script type="text/javascript" src="js/gadget.js" type="text/javascript"></script>
        <script type="text/javascript" src="js/landing.js" type="text/javascript"></script>
        <script type="text/javascript" src="serverinfo.jag"></script>

        <script type="text/javascript" src="../wso2-dev/js/jquery.numberformatter-1.2.3.js" type="text/javascript"></script>
        <script type="text/javascript" src="../wso2-dev/js/jquery.dependClass-0.1.js" type="text/javascript"></script>
        <script type="text/javascript" src="../wso2-dev/js/jquery.slider.js" type="text/javascript"></script>
        <script type="text/javascript" src="../../themes/portal/js/UESContainer.js"></script>

        <link rel="stylesheet" type="text/css" href="js/ui/css/main.css">
        <link rel="stylesheet" type="text/css" href="js/ui/css/bootstrap.css">
        <link rel="stylesheet" type="text/css" href="js/ui/css/bootstrap.min.css">
        <link rel="stylesheet" type="text/css" href="js/ui/css/bootstrap-theme.css">
        <link rel="stylesheet" type="text/css" href="js/ui/css/bootstrap-missing.css">
        <link rel="stylesheet" type="text/css" href="js/ui/css/bootstrap-theme.min.css">
        <link rel="stylesheet" type="text/css" href="js/ui/css/dialog.css">
        <link rel="stylesheet" type="text/css" href="js/ui/css/smoothness/jquery-ui-1.12.1.custom.min.css">
        <link rel="stylesheet" type="text/css" href="js/ui/css/smoothness/jqueryui-themeroller.css">
        <link rel="stylesheet" href="/portal/gadgets/connected_accounts/js/ui/css/localstyles.css">

        <script>
            var headID = document.getElementsByTagName("head")[0];
            var cssNode = document.createElement('link');
            cssNode.type = 'text/css';
            cssNode.rel = 'stylesheet';
            cssNode.href = PROXY_CONTEXT_PATH + '/portal/gadgets/connected_accounts/js/ui/font-awesome/css/font-awesome.min.css';
            headID.appendChild(cssNode);
        </script>

        <script type="text/javascript">
            var cookie = null;
            var json = null;
            var fedJson = null;
            var userName = null;
            var serverUrl = window.location.host + PROXY_CONTEXT_PATH;

            $(function WindowLoad(event) {
                url = 'wss://' + serverUrl + '/dashboard/session_manager.jag';
                ws = new WebSocket(url);

                ws.onopen = function () {
                    console.log("web Socket onopen. ");
                    ws.send("First Message open");
                };
                ws.onmessage = function (event) {
                    var obj = $.parseJSON(event.data);
                    cookie = obj.cookie;
                    userName = obj.user;
                    reloadGrid();
                };
                ws.onclose = function () {
                    console.log("web Socket onclose. ");
                };
            });

        </script>

        <form id="gadgetForm" class="form-horizontal" >
        	<div class="connectedDiv">
        	<br>
	        <button id="connectBtn" class="btn btn-primary mgL14px" type="button" >Add Association</button>
	        <br>
            <div id="gadgetBody" class="gadgetBodyScrollbar"></div>
            <br>
            </div>
	        <div id="message"></div>
        </form>
        <div id="light" class="white_content associationWindow" style="width: initial;height: initial;">This is the lightbox content. <a href = "javascript:void(0)" onclick = "document.getElementById('light').style.display='none';document.getElementById('fade').style.display='none'">Close</a></div>
        <div id="fade" class="black_overlay"></div>

        ]]>
    </Content>

</Module>
