/* differences from orig html * 1) "subscribe" link in login_container is now hardcoded as https://order.wsj.com/sub/ * instead of determined via pID and document.write'd * 2) login_form's hidden url field: used to be changed using vars pID and overrideLogin, * this script block commented out, field's value now changed to window.location.href * via an init function (which can be changed if necessary) * so you'll end up on same page you started. * 3) login_form's action is now hardcoded as "https://commerce.wsj.com/auth/submitlogin" instead of the relative "/login" * 4) for welcome_container, added id "welcome_user_name" to span, use epiton callsign to render name instead of document.write'ing it * 5) logout link hardcoded to "http://online.wsj.com/logout" (onclick runs popup first if it should) * - note that popup's YES button's onclick is still a window.opener.location redirect; now goes to the same hardcoded logout address * - popup: * seems to be stored in relative path "/static_html_files/logout_confirmation.htm" * under multiple domains eg s.wsj.net, online.wsj.com, commerce.barrons.com * what i'm doing: i have a local copy of popup html file that i've edited, * opened via relative url: "/logout_confirmation.htm" * 6) login_form's onsubmit: changed onsubmit="suppress_popup=true;return true;" to "if(suppress_popup!==undefined)suppress_popup=true;return true;" * 7) stylesheet: assume login box will inherit it from whatever page it's rendered on * so my test page has it hardcoded into the
as "http://s.wsj.net/j20type.css" * as for the popup...leave it relative, just /j20type.css (i have a local copy) * 8) hardcoding links in welcome container instead of document.write's with nSP */ /* notes * * re #6 above: * from commonFunctions.js : * document.onmousedown=isJournalURL var suppress_popup=false if(document.captureEvents) document.captureEvents(Event.MOUSEDOWN) function isJournalURL(e){ var re=/wsj.com/ var e=(!e)?window.event:e try{ suppress_popup=(e.srcElement)?((e.srcElement.href && re.test(e.srcElement.href))?true:((e.srcElement.parentNode.href && re.test(e.srcElement.parentNode.href))?true:false)):((e.target)?((e.target.href && re.test(e.target.href))?true:((e.target.parentNode)?((e.target.parentNode.href && re.test(e.target.parentNode.href))?true:false):false)):false) } catch(ex){} } */ epiton.gui.LoginBox = function(){ var _private = { //these are functions i stole from somewhere utils: { /* //from http://s.wsj.net/headerscripts.js //also on http://s.wsj.net/javascript/commonFunctions.js GetCookie: function(N){ epiton.utils.DebugLogger.log("LoginBox","get cookie"); var co=document.cookie,pos=co.indexOf(N+"="); return (pos!=-1)?unescape(co.substring(pos+N.length+1,(co.indexOf("; ",pos)!=-1?co.indexOf("; ",pos):co.length))):null; }, */ /* //from http://s.wsj.net/javascript/commonFunctions.js SetCookie: function(N, V, E, P, D, S) { if (E) { E = E.charAt(E.length - 1) == "+" || E.charAt(E.length - 1) == "-" ? _private.utils.CalcDate(E) : E; } document.cookie = N + "=" + escape(V) + (E ? "; expires=" + E : "") + (P ? "; path=" + P : "; path=/") + (D ? "; domain=" + D : "; domain=.wsj.com") + (S ? "; secure=" + S : ""); }, */ /* //from http://s.wsj.net/javascript/commonFunctions.js CalcDate: function(D) { var TD = D.substring(0, D.length - 2), TC = D.substring(D.length - 2, D.length - 1).toLowerCase(), MS = 0, dO = new Date; MS = TC == "m" ? TD * ((86400000) * 30) : MS; MS = TC == "d" ? TD * 86400000 : MS; MS = TC == "s" ? TD * 1000 : MS; dO.setTime(D.substring(D.length - 1, D.length) == "+" ? dO.getTime() + MS : dO.getTime() - MS); return dO.toGMTString(); }, */ //from http://s.wsj.net/javascript/commonFunctions.js //modified to return ref to the popup OpenWin: function(U,N,W,H,A,F,L,T,C){ //args Url(r),Name(r),Width(opt),Height(opt),Attributes(opt),Focus(opt),Left(opt),Top(opt),Center(opt) var WO; var WA=new Array(); var a=new Array("directories","location","menubar","resizable","scrollbars","status","titlebar","toolbar"); A=(A)?"".concat(A):"on"; for(i=0;i