Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ==UserScript==
- // @name LOR Classic
- // @namespace http://linux.org.ru
- // @require http://code.jquery.com/jquery-1.8.1.min.js
- // @version 3
- // @author Sadler
- // @grant none
- // ==/UserScript==
- if (window.location.hostname.indexOf('linux.org.ru') != -1) {
- //window.addEventListener('load', function (e) {
- $ = window.$;
- $('.fav-buttons').hide();
- $('.sign').css('margin-left','0');
- $('.msg').css('padding','0');
- $('.msg-container').css('margin-left','5px');
- $('.msg-container').css('padding-bottom','7px');
- $('footer').css('border-top','0');
- $('footer').css('border-bottom','0');
- $('footer').css('padding-top','0');
- $('footer').css('padding-bottom','0');
- $('footer').css('margin-bottom','0');
- $('.msg h1').css('font-size','x-large');
- $('.msg h1').css('padding-left','10px');
- $('.msg_body').css('margin-left','5px');
- $('.tags-section-info').css('border-top','0');
- $('.tags-section-info').css('border-bottom','0');
- $('.tags-section-info').css('padding-top','0');
- $('.tags-section-info').css('padding-bottom','0');
- $('.tags-section-info').css('padding-left','8px');
- $('.fav-buttons a').css('font-size','100%');
- $('div[itemprop="articleBody"]').css('padding-bottom','0');
- $('.title').css('padding-left','5px');
- var navPath = "";
- $('.msg').each(function() {
- message = $(this);
- title = message.children('.title');
- container = message.children('.msg-container');
- messagebody = container.children('.msg_body');
- msgfooter = messagebody.children('footer');
- reply = messagebody.children('.reply').children('ul');
- tags = message.children('.tags-section-info').children('span[itemprop="articleSection"]');
- //////////////////////////// FAV-ки в заголовок ///////////////////////////
- /* favText = container.children('.fav-buttons').html();
- if (favText !== undefined)
- {
- titleButtons = $('<div style="float: right;"></div>').addClass('fav-buttons');
- titleButtons.appendTo(title);
- $('#favs_button').appendTo(titleButtons);
- $('#favs_count').appendTo(titleButtons);
- $('<span> </span>').appendTo(titleButtons);
- $('#memories_button').appendTo(titleButtons);
- $('#memories_count').appendTo(titleButtons);
- }
- */
- /////////////////////////// ИЩЕМ ССЫЛКИ И ПРЕВРАЩАЕМ ИХ В РЕШЁТКИ //////////////////////
- msg_link = "";
- reply.children('li').each(function() {
- msg_link = $(this).children('a').attr('href');
- if ($(this).children('a').text() == "Ссылка") {
- $(this).hide();
- }
- });
- oldTitle = title.html();
- title.html('[<a href="'+msg_link+'">#</a>] '+oldTitle);
- ///////////////////////// ИЩЕМ ТЕГИ И ПЕРЕНОСИМ НАВИГАЦИЮ НАВЕРХ //////////////////////
- if (tags !== undefined)
- {
- tagsText = '<i class="icon-tag"></i> ';
- navPath2 = tags.html();
- if (navPath2 !== undefined)
- {
- navPath = navPath2;
- navPath2 = navPath.split('<i class="icon-tag">')[0];
- if (navPath2.length > 0) navPath = navPath2;
- }
- tagList = tags.children('.tag');
- if (tagList.length==0) tagsText = '';
- tagList.each( function(index) {
- if (index>0) tagsText += ', ';
- tagName = $(this).html();
- tagsText += '<a class="tag" href="/tag/'+tagName+'" rel="tag">'+tagName+'</a>';
- });
- tags.html(tagsText);
- }
- //////////////////////// ИЩЕМ АВАТАРКУ НЕ НА МЕСТЕ ////////////////////////////////////
- msgfooter.children('.userpic').each(function() {
- messagebody.children('div[itemprop="articleBody"]').css('padding-left','170px');
- messagebody.children('footer').css('margin-left','170px');
- messagebody.children('.reply').css('margin-left','170px');
- userpic = $(this);
- userpic.css('padding-top','5px');
- userpic.css('margin-right','10px');
- userpic.children('img').attr('width','150px');
- userpic.children('img').removeAttr('height');
- userpic.prependTo(messagebody);
- });
- });
- //////////////////////// Восстанавливаем навигацию ////////////////////////////////////
- //<div class="nav">
- //<div id="navPath">
- if ($('#navPath').length == 0 && navPath.length > 0)
- {
- navPath = navPath.replace('Форум -','<a href="/forum/">Форум</a> -');
- $('#bd').prepend('<div class="nav"><div id="navPath">'+navPath+'</div></div>');
- }
- //});
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement