Skip to content

Instantly share code, notes, and snippets.

@yoksel
Last active August 29, 2015 14:24
Show Gist options
  • Save yoksel/a7c973da0756519085eb to your computer and use it in GitHub Desktop.
Save yoksel/a7c973da0756519085eb to your computer and use it in GitHub Desktop.
Most used layers list on customize page (livejournal)
// ==UserScript==
// @name Layers list on customize page
// @namespace http://yoksel.ru/
// @version 0.1
// @description Add customize button to new LJ navigation
// @author You
// @include *livejournal.com/customize/*
// @include *livejournal.ru/customize/*
// @grant none
// ==/UserScript==
var doc = document;
var themesNav = doc.querySelector('.theme-selector-nav');
if ( !themesNav ) {
return;
}
var newList = doc.createElement('ul');
newList.classList.add('theme-nav');
newList.classList.add('nostyle');
var layers = ['Air',
'Bloggish',
'Chameleon',
'Expressive',
'Flexible Squares',
'Smooth Sailing',
'Minimalism'];
for (var i = 0; i < layers.length; i++) {
var layerName = layers[i];
var newItem = doc.createElement('li');
newItem.innerHTML = '<a href=\'index.bml?search=' + layerName + '&show=all\' class=\'theme-nav-cat\'>' + layerName + '</a>';
var newItemElem = newList.appendChild(newItem);
}
var separator = document.querySelector('.theme-nav-separator');
var newSeparator = separator.cloneNode(true);
themesNav.insertBefore( newSeparator, themesNav.children[0]);
themesNav.insertBefore( newList, themesNav.children[0]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment