Additional imgur links

Adds links to the user homepages on imgur, for "all images" and "albums"

이 스크립트를 설치하려면 Tampermonkey, Greasemonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Violentmonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey 또는 Userscripts와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 Tampermonkey와 같은 확장 프로그램이 필요합니다.

이 스크립트를 설치하려면 유저 스크립트 관리자 확장 프로그램이 필요합니다.

(이미 유저 스크립트 관리자가 설치되어 있습니다. 설치를 진행합니다!)

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 Stylus와 같은 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

이 스타일을 설치하려면 유저 스타일 관리자 확장 프로그램이 필요합니다.

(이미 유저 스타일 관리자가 설치되어 있습니다. 설치를 진행합니다!)

// ==UserScript==
// @name         Additional imgur links
// @namespace    http://heyisthisusernametaken.com/imgur/user_links
// @version      0.1
// @description  Adds links to the user homepages on imgur, for "all images" and "albums"
// @author       heyisthisusernametaken
// @match        http://imgur.com/user/*
// @require  http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require  http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js
// @grant    GM_addStyle
// @grant    GM_getResourceText
// ==/UserScript==

// --- Get username and set up URLs
var url = document.URL;
var uname = url.split("/")[4];
var allUrl = "http://" + uname + ".imgur.com/all";
var albumUrl = "http://" + uname + ".imgur.com";

// --- Create the clickable areas and set up attributes
var allImgBtn   = document.createElement ('div');
allImgBtn.innerHTML = '<h2>All Images</h2>';
allImgBtn.setAttribute('id', 'allImgBtn');

var albumBtn      = document.createElement ('div');
albumBtn.innerHTML = '<h2>Albums</h2>';
albumBtn.setAttribute('id', 'albumBtn');

allImgBtn.setAttribute ('class', 'textbox button');
albumBtn.setAttribute('class', 'textbox button');

// --- Add clickable areas to the side menu
var elems = document.getElementsByClassName('panel menu');
menuNode = elems[0];
var pmBtn = document.getElementById('pm-button');
menuNode.insertBefore(allImgBtn, pmBtn);
menuNode.insertBefore(albumBtn, pmBtn);

//--- add event listeners to buttons.
document.getElementById ("allImgBtn").addEventListener  (
    "click", showAllImages, false
);
function showAllImages (zEvent) {
    window.location.href = allUrl;
}
document.getElementById("albumBtn").addEventListener  (
    "click", showAlbums, false
);
function showAlbums (zEvent) {
    window.location.href = albumUrl;
}