var fn = function () { AsyncWidgets.user.isLogged({ callBack: function (isLogged) { if (isLogged) { //****Enabled Session Resume Option On Refresh if User Logged In*****// $(document).timeout(); //****End****// //****Load Proxy User On Refresh if User Logged In*****// var f = AsyncWidgets.get('frmMenu_Header'); f.LoadCombo(f, $('[argumentid="ProxyUsers"]', f.el)); f.on('onComboFilled', function (cf) { if ($(cf.combo).attr('argumentid') == "ProxyUsers") $('option:first', cf.combo).remove(); }); //****End****// } } }); $('[argumentid="UserName"]', t.el).focus(); $('[argumentid="UserName"],[argumentid="UserPassword"]', t.el).keyup(function () { if (!!t.msg) t.msg.hide(); }); t.login = function (t, cf, btn) { var t = this; if (!!t.msg) t.msg.hide(); var cf = decJSON($(btn).attr('conf')); if (!t.validator.isValid()) { t.showInvalid(t); return false; } var inv = new AsyncWidgets.RAInvoker(); inv.on('onSuccess', function (res) { debugger;; var res = decJSON(res); if (res.status == 'OK') { t.hide(); if (res.Response.Authenticated) { var arRoles = res.Response.Roles.split(','); if (arRoles.length) { for (var i = 0; i < arRoles.length; i++) { //if(arRoles[i]) $('[displayroles*=' + arRoles[i] + ']').show(); } } AsyncWidgets.user.conf = res.Response.Conf; var frmMH = AsyncWidgets.get('frmMenu_Header').show(); //LoggedUser $('.LoggedUser', frmMH.el).html(res.Response.Name); if (!window.StartupWidgetId ) { StartupWidgetId = "frmInbox"; } else if (!AsyncWidgets.has(StartupWidgetId)) { StartupWidgetId = "frmInbox"; } AsyncWidgets.get(StartupWidgetId).hide(); AsyncWidgets.get(StartupWidgetId).show(); AsyncWidgets.user.login(); //****Enabled Session Resume Option On Log In*****// $(document).timeout(); //****End****// //****Load Proxy User On Log In*****// var f = AsyncWidgets.get('frmMenu_Header'); f.LoadCombo(f, $('[argumentid="ProxyUsers"]', f.el)); f.on('onComboFilled', function (cf) { if ($(cf.combo).attr('argumentid') == "ProxyUsers") $('option:first', cf.combo).remove(); }); //****End****// } else { t.show(); var txt = $('[argumentid="UserName"]', t.el), pos = txt.offset(), msg = $('<div class="wrongpassword tmp_rtxt" style="background:#73ABCB;position:absolute;display:none;color:white;font-weight:bold;padding-top:2px;padding-bottom:2px;padding-right:10px;padding-left:10px;">Invalid User ID or Password!</div>'); if (!t.msg) { $('body').append(msg); t.msg = msg; } t.msg.css({ left: pos.left, top: pos.top + 24 }).show('fast'); if (!t.hideDT) t.hideDT = new Ext.util.DelayedTask(function () { t.msg.hide('fast'); }); t.hideDT.delay(3000); //alert('Unable to logged in!'); } } else { //$('.wrongpassword', t.el).html('Unable to login, contact system administrator!'); //alert('Unable to logged in!'); } $(t.el).unmask(); //$('body').unmask(); }); inv.on('onFailure', function (res) { $(t.el).unmask(); //$('body').unmask(); //$('.wrongpassword', t.el).html('Connection Error, contact system administrator!'); //alert('Problem occured while connection to web server'); }); t.$el.mask('Please wait while loading ...'); //$('body').mask('Please wait while loading ...'); ServiceInfo = getForm(t.el, null, null); //debugger; inv.invokeRA({ params: ["ActorId", cf.ActorId, "ActionId", cf.ActionId, "ServiceInfo", ServiceInfo] }); }; };
//*****Proxy Code *****// var mouseOut, hideProxyList, iPL, mnuDelay = 500; hideProxyList = function () { $('.ProxyList').hide(); }; mouseOut = function () { iPL[0].DT.delay(mnuDelay); }; iPL = $('.ShowProxyList'); iPL[0].DT = new Ext.util.DelayedTask(hideProxyList); iPL.mouseenter(function () { if (!this.init) { this.init = true; var i = 0, PLHtml = "<tr id='trlbl'><td class='ProxyListHeader' colspan='2' align='left'><span>Proxy Users</span></td>"; $('.cboProxy option').each(function () { PLHtml += '<tr idx="' + i + '"><td class="ProxyListFC"><div > </div></td><td class="ProxyListSC">' + $(this).html() + '</td></tr>'; i++; }); // if (i < 2) { // $('.ShowProxyList').hide(); // } $('.ProxyList table').html(PLHtml).filter('tr:last td').css('border-bottom', '1px'); $('.ProxyList table tr:last td').css('border-bottom', '0px'); $('.ProxyList tr') .mouseenter(function () { $('td', this).each(function () { var td = $(this); if (td.hasClass('ProxyListFC')) { td.addClass('ProxyListHoverFC'); } else { if (!td.hasClass('ProxyListHeader')) td.addClass('ProxyListHoverSC'); } }); }).mouseleave(function () { $('td', this).each(function () { var td = $(this); td.removeClass('ProxyListHoverSC ProxyListHoverFC'); }); }).click(function () { $('.cboProxy')[0].selectedIndex = $(this).attr('idx'); if ($(this).attr('id') != 'trlbl') $('.cboProxy').trigger('change'); hideProxyList(); }); } // debugger; var IE6 = false; if ($.browser.msie && parseInt($.browser.version.charAt(0)) < 7) { IE6 = true; } iPL[0].DT.cancel(); var p = $('.ProxyList').show().offsetParent(), ptop, pleft; var pos = $(this).offset(), height width = 0; height = $(this).height(); var isBody = p[0].tagName == 'BODY', prxTblWidth; //debugger; $('.ProxyList').css({ 'left': '5000', 'z-index': '9999' }).show(); $('.ProxyList td.ProxyListSC').addClass('ProxyListHoverSC'); prxTblWidth = parseInt($('.ProxyList table').width()); $('.ProxyList td.ProxyListSC').removeClass('ProxyListHoverSC'); $('.ProxyList').css('width', prxTblWidth); // if (prxTblWidth < parseInt($('.ProxyList').width())) { // $('.ProxyList table').css('width',parseInt( $('.ProxyList').css('width'))); // } ptop = -((isBody ? 0 : p.offset().top) + (IE6 || isBody ? 0 : parseInt(p.css('border-top-width')) || 0)) + pos.top + height + (isBody ? parseInt(p.css('border-top-width')) || 0 : 0); pleft = -((isBody ? 0 : p.offset().left) + (IE6 || isBody ? 0 : parseInt(p.css('border-left-width')) || 0)) + pos.left + (isBody ? parseInt(p.css('border-left-width')) || 0 : 0); // + ) // pleft -= $('.ProxyList').outerWidth() - $(this).width(); $('.ProxyList').css({ "left": pleft + "px", "top": ptop + 5 + "px" }).show(); $('.logger').html('Icon {Left: ' + pos.left + ' - Top:' + pos.top + " - Heigth:" + height + " - Width:" + width + "}" + 'Menu { offset parent top: ' + p.offset().top + ' - ' + 'offset parent left: ' + p.offset().left + "} " + 'pleft: ' + pleft + ' - ptop: ' + ptop); }).mouseout(mouseOut); $('.ProxyList').mouseenter(function () { iPL[0].DT.cancel(); }).mouseleave(function () { iPL[0].DT.delay(mnuDelay); }); //End of Proxy Code var centerE = function (el) { el.css("position", "absolute"); el.css("top", (($(window).height() - el.outerHeight()) / 2) + $(window).scrollTop() + "px"); el.css("left", (($(window).width() - el.outerWidth()) / 2) + $(window).scrollLeft() + "px"); }; var msgbox = function (msg) { if (!msgbox.msgdiv) { msgbox.msgdiv = $('<div style="border: 1px solid black; background: none repeat scroll 0% 0% rgb(213, 220, 232); width: 400px; height: 200px; position: absolute; top: 253.5px; left: 367px;"><center><div style="overflow: auto; width: 400px; height: 160px" class="msgcontainer"></div></center><div style="vertical-align:middle"><center><input type="button" value="OK" style="width:80px" class="btnOK"></center></div></div>'); $('body').append(msgbox.msgdiv); } $('.msgcontainer', msgbox.msgdiv).text(msg); msgbox.msgdiv.show(); centerE(msgbox.msgdiv); $('.btnOK', msgbox.msgdiv).click(function () { msgbox.msgdiv.hide(); }); }; var fn = function () { $('.logout', t.el).click(function () { // debugger; var inv = new AsyncWidgets.RAInvoker(); inv.invokeRA({ params: ["ActorId", "Authentication", "ActionId", "LogoutUser", "ServiceInfo", ""] }); AsyncWidgets.user.logout(); inv.on('onSuccess', function (res) { window.location.pathname = BASE_PATH + "default"; //"Logout.aspx"; }); }); var getMenu = function (rws) { var i, j, mnuHTML = "<ul id='jsddm' style='z-index:999'>"; for (i = 0; i < rws.length && rws[i].ParentMenuId == 0; i++) { var prntId = rws[i].MenuId; if (rws[i].MenuName == "Home") mnuHTML += String.format("<li><a href='javascript:void(0);' showwidget='{1}'>{0}</a><ul style='z-index:1000'>", rws[i].MenuName, rws[i].ShowWidget); else mnuHTML += String.format("<li><a href='javascript:void(0);' >{0}</a><ul style='z-index:1000'>", rws[i].MenuName); for (j = 0; j < rws.length; j++) { if (rws[j].ParentMenuId == 0 || prntId != rws[j].ParentMenuId) { continue; } mnuHTML += String.format("<li style='text-align:left'><a showwidget='{1}' returntype='true' href='javascript:void(0);'>{0}</a></li>", rws[j].MenuName, rws[j].ShowWidget); } mnuHTML += "</ul></li>"; } mnuHTML += "</ul>"; return mnuHTML; }; AsyncWidgets.user.on('loggedIn', function () { if (!t.Menu) { var inv = new AsyncWidgets.RAInvoker(); t.hide(); inv.on('onSuccess', function (res) { t.Menu = true; //debugger; var res = decJSON(res), mnuHTML; if (res.status == 'OK') { $('.menuContainer', t.el).html(getMenu(res.Response.Rows)); if (__touch) { $('#jsddm > li', t.el).bind('click', jsddm_open) $(document).bind('click', jsddm_timer); } else $('#jsddm > li', t.el).bind('mouseover', jsddm_openMO).bind('mouseout', jsddm_timerMO); AsyncWidgets.WidgetManager.bind($('.menuContainer [showwidget]', t.el)); } else { // if (dbg()) { alert('Unable to logged in!'); // } } t.show(); $(t.el).unmask(); }); inv.on('onFailure', function (res) { t.show(); $(t.el).unmask(); alert('Problem occured while connection to web server'); }); t.$el.mask('Please wait while loading ...'); ServiceInfo = getForm(null, null, { Command: 'FX_SEL_SimpleMenu' }); inv.invokeRA({ params: ["ActorId", 'Authentication', "ActionId", 'GetUserMenu', "ServiceInfo", ServiceInfo] }); } }); if (!t.Menu) { //if menu is not rendered if (!!window.MenuData) { t.Menu = true; $('.menuContainer', t.el).html(getMenu(MenuData.Response.Rows)); if (__touch) { $('#jsddm > li', t.el).bind('click', jsddm_open) $(document).bind('click', jsddm_timer); } else $('#jsddm > li', t.el).bind('mouseover', jsddm_openMO).bind('mouseout', jsddm_timerMO); AsyncWidgets.WidgetManager.bind($('.menuContainer [showwidget]', t.el)); return; } } }
Thank you for using the system, this page will be redirected to home page in