Permalink
Browse files

Fix formatting.

  • Loading branch information...
KL-7 committed Apr 14, 2012
1 parent e7a6ccc commit c535c6f91cea4619091adce44b4e39c33451f548
Showing with 42 additions and 42 deletions.
  1. +2 −3 lastfm-ctrl-enter-shouts.user.js
  2. +40 −39 lastfm-images.user.js
@@ -1,6 +1,6 @@
// ==UserScript==
// @name Last.fm Ctrl+Enter Shouts
-// @version 1.1
+// @version 1.2
// @date 05/04/2012
// @author Kirill Lashuk aka KL-7
// @namespace http://about.me/kl7
@@ -9,8 +9,7 @@
// @include http://www.lastfm.*/*
// ==/UserScript==
//
-
-(function () {
+(function() {
var shoutmsg = document.getElementById('shoutmsg');
if (shoutmsg) {
shoutmsg.setAttribute(
View
@@ -1,6 +1,6 @@
// ==UserScript==
// @name Last.fm Images
-// @version 2.1
+// @version 2.2
// @date 15/04/2012
// @author Kirill Lashuk aka KL-7
// @namespace http://about.me/kl7
@@ -14,64 +14,65 @@
// @exclude http://www.lastfm.*/music/+*
// @exclude http://www.lastfm.*/music/*/_/*
// ==/UserScript==
+(function() {
+ var GM_Debug = 1;
-(function () {
- var GM_Debug = 1;
-
- if(GM_Debug) {
- var log = (unsafeWindow.console) ? unsafeWindow.console.log : GM_log;
- } else {
- var log = function(){};
- }
+ if (GM_Debug) {
+ var log = (unsafeWindow.console) ? unsafeWindow.console.log: GM_log;
+ } else {
+ var log = function() {};
+ }
- var ru = window.location.host.match(/lastfm.ru$/) ? 1 : 0;
+ var ru = window.location.host.match(/lastfm.ru$/) ? 1: 0;
var labels = {
- full_size: ['Get full size', 'Скачать'],
- covers: ['Cover Arts', 'Обложки'],
+ full_size: ['Get full size', 'Скачать'],
+ covers: ['Cover Arts', 'Обложки'],
all_covers: ['See all cover arts', 'Все обложки']
}
- var label = function(key) { return labels[key][ru]; }
+ var label = function(key) {
+ return labels[key][ru];
+ }
- var album_page = document.getElementsByClassName('current')[0].firstChild.href.match(/albums$/);
- var image = document.getElementsByClassName('the-image');
+ var album_page = document.getElementsByClassName('current')[0].firstChild.href.match(/albums$/);
+ var image = document.getElementsByClassName('the-image');
var view = image && image[0];
- // Image view page
- if (view) {
- // Add full-size image link
- var art_src = view.getElementsByTagName('img')[0].src;
- var link = document.createElement('a');
- link.href = art_src.replace(/serve\/[^\/]*/, 'serve/_');
- link.innerHTML = label('full_size');
+ // Image view page
+ if (view) {
+ // Add full-size image link
+ var art_src = view.getElementsByTagName('img')[0].src;
+ var link = document.createElement('a');
+ link.href = art_src.replace(/serve\/[^\/]*/, 'serve/_');
+ link.innerHTML = label('full_size');
link.target = '_blank';
- var span = document.createElement('span');
- span.className = 'moduleOptions';
- span.appendChild(link);
+ var span = document.createElement('span');
+ span.className = 'moduleOptions';
+ span.appendChild(link);
span.style.position = 'absolute';
span.style.top = 0;
span.style.right = 0;
document.getElementsByClassName('imageInfo')[0].style.position = 'relative'
- var uploadInfo = document.getElementsByClassName('uploadInfo')[0];
- uploadInfo.parentNode.appendChild(span);
+ var uploadInfo = document.getElementsByClassName('uploadInfo')[0];
+ uploadInfo.parentNode.appendChild(span);
- log('fullsize link added');
- // Album main page
- } else if (album_page && document.getElementById('catalogueHead')) {
- var covers_link = document.createElement('a');
- covers_link.href = window.location.href + '/+images';
- covers_link.innerHTML = label('all_covers');
+ log('fullsize link added');
+ // Album main page
+ } else if (album_page && document.getElementById('catalogueHead')) {
+ var covers_link = document.createElement('a');
+ covers_link.href = window.location.href + '/+images';
+ covers_link.innerHTML = label('all_covers');
- var span = document.createElement('span');
- span.className = 'moduleOptions';
- span.appendChild(covers_link);
+ var span = document.createElement('span');
+ span.className = 'moduleOptions';
+ span.appendChild(covers_link);
- document.getElementById('catalogueHead').getElementsByClassName('albumCover')[0].appendChild(span);
+ document.getElementById('catalogueHead').getElementsByClassName('albumCover')[0].appendChild(span);
- log('covers link added');
- }
+ log('covers link added');
+ }
})();

0 comments on commit c535c6f

Please sign in to comment.