Changeset 269 for lang/javascript/userchrome
- Timestamp:
- 09/24/07 13:34:51 (16 months ago)
- Files:
-
- 1 modified
-
lang/javascript/userchrome/tumblr-multi.uc.js (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/userchrome/tumblr-multi.uc.js
r267 r269 56 56 57 57 this.menu = document.createElementNS(kXULNS, "menupopup"); 58 // proxySetting.forEach(function (f) {59 // var mi = document.createElementNS(kXULNS, "menuitem");60 // mi.setAttribute("label", f.name);61 // mi.addEventListener("command", command, false);62 // menu.appendChild(mi);63 // });64 58 65 59 this.panel.appendChild(this.menu); … … 100 94 switchUser : function (password) { 101 95 var self = this; 96 this.sessions = this.sessions || {}; 102 97 103 98 // var cookie = this.cookies.getCookieString(this.IOService.newURI("http://www.tumblr.com", null, null), null) 104 // alert(cookie);105 99 self.setStatus("Logging in..."); 106 100 var req = new XMLHttpRequest; 107 101 req.open("POST", "http://www.tumblr.com/login", true); 108 req.onload = function (e) { 102 req.onload = function (e) { try { 109 103 if (req.responseText.match(/Logging in/)) { 110 104 self.setStatus(password.user); 105 content.location = "javascript:var d=document,w=window,e=w.getSelection,k=d.getSelection,x=d.selection,s=(e?e():(k)?k():(x?x.createRange().text:0)),f='http://www.tumblr.com/share',l=d.location,e=encodeURIComponent,p='?v=3&u='+e(l.href) +'&t='+e(d.title) +'&s='+e(s),u=f+p;try{if(!/^(.*\\.)?tumblr[^.]*$/.test(l.host))throw(0);tstbklt();}catch(z){a =function(){if(!w.open(u,'t','toolbar=0,resizable=0,status=1,width=450,height=430'))l.href=u;};if(/Firefox/.test(navigator.userAgent))setTimeout(a,0);else a();}void(0)"; 106 } else { 107 self.setStatus("Failed"); 111 108 } 112 } ;109 } catch (e) { alert(e) } }; 113 110 req.onerror = function (e) { 114 111 alert(e); … … 116 113 req.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); 117 114 req.send([ 118 "email=", encodeURI (password.user),119 "&password=", encodeURI (password.password),115 "email=", encodeURIComponent(password.user), 116 "&password=", encodeURIComponent(password.password), 120 117 ].join("")); 121 118
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)