One click login Head-fi.org
Status
Not open for further replies.
Jan 10, 2016 at 7:30 PM Thread Starter Post #1 of 3

hifi nub

100+ Head-Fier
Joined
Aug 24, 2014
Posts
315
Likes
33
Not my work. overclock.net uses same forum, all I did was copied the userscript removed overclock.net and replaced it with head-fi.org and it turned out to work.
Original: http://www.overclock.net/t/1546841/ocn-dark-theme http://jiiks.net/projects/ocnscripts/

You need Greasemonkey for firefox, copy the code, click greasmonkey icon click New User Script. New window will pop up and insert User script from clipboard, save and close, sign out of head-fi.org and a One Click Login will appear on head-fi.org.


Code:
// ==UserScript==
// @name Head-Fi 'Improvements'
// @namespace none
// @include http://www.head-fi.org/*
// @version 1.0
// @grant none
// @require http://code.jquery.com/jquery-1.6.4.js
// ==/UserScript==

(function() {

 //One click login 
 if($(".profile a").attr("href") == "/join") { 

 var loginForm = $("", { 
 method: "POST", 
 action: "/login" 
 }); 

 var usernameInput = $("", { 
 type: "text", 
 name: "username", 
 placeholder: "Username or Email", 
 css: { 
 "display": "inline-bloc", 
 "width": "110px", 
 "padding": "3px", 
 } 
 }); 

 var passwordInput = $("", { 
 type: "password", 
 name: "password", 
 placeholder: "Password", 
 css: { 
 "display": "inline-bloc", 
 "width": "110px", 
 "padding": "3px", 
 "margin-left": "4px" 
 } 
 }); 

 var rememberMeInput = $("", { 
 type: "checkbox", 
 id: "rememberme", 
 name: "rememberme", 
 checked: "checked", 
 css: { 
 "display": "block", 
 "margin-left": "277px", 
 "margin-top": "4px" 
 } 
 }); 

 var rememberMeLabel = $("", { 
 text: "Remember me", 
 css: { 
 "color": "#A7A7A7", 
 "display": "block", 
 "margin-top": "-16px", 
 "margin-left": "179px" 
 } 
 }); 

 rememberMeLabel.attr("for", "rememberme"); 

 var submitButton = $("", { 
 type: "submit", 
 name: "Login", 
 text: "Login", 
 css: { 
 "margin-left": "4px" 
 } 
 }); 

 var loginContainer = $("
"); 

 loginForm.append(usernameInput); 
 loginForm.append(passwordInput); 
 loginForm.append(submitButton); 
 loginForm.append(rememberMeInput); 
 loginForm.append(rememberMeLabel); 

 loginContainer.append(loginForm); 

 loginContainer.append($("", { 
 href: "/users/lost_password", 
 text: "Forgot password?", 
 css: { 
 "display": "block", 
 "margin-top": "-17px", 
 "width": "120px" 
 } 
 })); 

 $("#sidebar").prepend(loginContainer); 
 } 



 //Profile dropdown items
 var userData = $(".profile .user-avatar a").attr("href").split("/");
 var userId = userData[2]; var userName = userData[3];
 var plText = ""; var plUrl = "";


})();
 
Status
Not open for further replies.

Users who are viewing this thread

Back
Top