sakura 45 Posted October 26, 2018 (edited) For those of you, using TamperMonkey in Chrome, I have created a small script, which, for now, will compact the design just a bit. Feel free to enhance/comment. // ==UserScript== // @name [DPE] CSS Overrides // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://en.delphipraxis.net/* // @exclude *?do=edit // @grant none // ==/UserScript== (function() { 'use strict'; // fluid list const $ = jQuery; $('HEADER .logo').attr('style', 'height: auto;'); $('HEADER .logo IMG').attr('style', 'margin-bottom: -30px;'); $('LI.ipsDataItem').attr('style', 'padding: 2px 0'); $('DIV.ipsDataItem_icon').attr('style', 'padding: 0 10px;'); $('DIV.ipsDataItem_main').attr('style', 'padding: 0;'); $('UL.ipsDataItem_stats').attr('style', 'padding: 0 10px 0 0;'); $('LI.ipsDataItem_unread DIV.ipsDataItem_main A[href*=topic]').each(function() { const href = $(this).attr('href'); if (href.indexOf('?') < 0) $(this).attr('href', href + '?do=getNewComment'); }); // thread view const ipsPageHeader = $('DIV.ipsPageHeader'); ipsPageHeader.attr('style', 'padding: 5px;'); const topicControls = ipsPageHeader.next(); const topicControlsLinks = topicControls.find('A'); for (var idx = 0, link; link = topicControlsLinks[idx]; idx++) { const div = $('<div class="ipsPos_right ipsResponsive_noFloat ipsResponsive_hidePhone" style="margin-left: 5px;"></div>'); link.style = 'padding: 5px; line-height: 1.5em;'; div.append(link); ipsPageHeader.prepend(div); } topicControls.remove(); $('UL.cAuthorPane_info').attr('style', 'transform: scale(0.6); padding: 0; margin: -40px;'); $('DIV[data-role="commentContent"]').attr('style', 'padding: 0; font-size: small;'); })(); ... 🐈 ... Edited October 26, 2018 by sakura 2 Share this post Link to post
Neutral General 15 Posted October 26, 2018 I added a little bit to make the code blocks a little bit smaller and the spacing between survey items (See the "Oh my god, I can post code" thread for an example for a survey) I'm not a javascript/css expert so there might still be room for improvement // Code $('PRE.ipsCode').attr('style', 'padding: 5px !important; font-size: small;'); // survey $(':root').attr('style', '--grid-gap: 0px;'); $('span.ipsFaded').attr('style', 'margin-left: 5px;'); Share this post Link to post
sakura 45 Posted October 26, 2018 Added a small tidbit too: // scroll to start of content if (window.location.href.indexOf('?do') < 0) $('html,body').animate({scrollTop: $('#elContent').offset().top},'slow'); Share this post Link to post
Neutral General 15 Posted October 26, 2018 (edited) A 1-liner to slightly highlight the subforum in the fluid list // Highlight subforum in post listing (fluid list) $('.ipsDataItem_meta > a[href*="?forumId="]').css({ color: '#4D7395' }); Edited October 26, 2018 by Neutral General Share this post Link to post
sakura 45 Posted October 26, 2018 // ==UserScript== // @name [DPE] CSS Overrides // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://en.delphipraxis.net/* // @exclude *?do=edit // @exclude */discover/ // @grant none // ==/UserScript== (function() { try{ 'use strict'; const $ = jQuery; const stylesheet = document.styleSheets[document.styleSheets.length - 1]; // fluid list $('HEADER .logo').attr('style', 'height: auto;'); $('HEADER .logo IMG').attr('style', 'margin-bottom: -30px;'); $('LI.ipsDataItem').attr('style', 'padding: 2px 0'); $('DIV.ipsDataItem_icon').attr('style', 'padding: 0 10px;'); $('DIV.ipsDataItem_main').attr('style', 'padding: 0;'); $('UL.ipsDataItem_stats').attr('style', 'padding: 0 10px 0 0;'); $('LI.ipsDataItem_unread DIV.ipsDataItem_main A[href*=topic]').each(function() { const href = $(this).attr('href'); if (href.indexOf('?') < 0) $(this).attr('href', href + '?do=getNewComment'); }); // thread view const ipsPageHeader = $('DIV.ipsPageHeader'); ipsPageHeader.attr('style', 'padding: 5px;'); const topicControls = ipsPageHeader.next(); const topicControlsLinks = topicControls.find('A'); for (var idx = 0, link; link = topicControlsLinks[idx]; idx++) { const div = $('<div class="ipsPos_right ipsResponsive_noFloat ipsResponsive_hidePhone" style="margin-left: 5px;"></div>'); link.style = 'padding: 5px; line-height: 1.5em;'; div.append(link); ipsPageHeader.prepend(div); } topicControls.remove(); $('UL.cAuthorPane_info').attr('style', 'transform: scale(0.6); padding: 0; margin: -40px;'); $('DIV[data-role="commentContent"]').attr('style', 'padding: 0; font-size: small;'); // Code $('PRE.ipsCode').attr('style', 'padding: 5px !important; font-size: small;'); // Survey $(':root').attr('style', '--grid-gap: 0px;'); $('span.ipsFaded').attr('style', 'margin-left: 5px;'); stylesheet.insertRule('.ipsDataList.ipsDataList_zebra > .ipsDataItem { height: 45px; }'); // scroll to start of content if (window.location.href.indexOf('?do') < 0) $('html,body').animate({scrollTop: $('#elContent').offset().top},'slow'); } catch(e) { } })(); ... 🐈 ... 1 Share this post Link to post
Neutral General 15 Posted October 26, 2018 (edited) The script messes something up if you go to a subforum in the non-fluid view. It takes you here for example: https://en.delphipraxis.net/forum/5-rtl-and-delphi-object-pascal/ It's hard to describe. Better look for yourself and compare the page of this link with and without the tampermonkey script. Edited October 26, 2018 by Neutral General Share this post Link to post
dummzeuch 1505 Posted October 26, 2018 Since I am using Firefox and not Chrome: Could you please post a screenshot (before / after ?) so I can see what it does? Share this post Link to post
Markus Kinzler 174 Posted October 26, 2018 4 minutes ago, dummzeuch said: Since I am using Firefox and not Chrome: Could you please post a screenshot (before / after ?) so I can see what it does? TamperMonkey is avaliable for FF, too. Share this post Link to post
Der schöne Günther 316 Posted October 26, 2018 7 minutes ago, dummzeuch said: Since I am using Firefox and not Chrome: Could you please post a screenshot (before / after ?) so I can see what it does? 1 Share this post Link to post
Neutral General 15 Posted October 26, 2018 (edited) The 2nd screenshot from "Der schöne Günther" isn't really how it looks for me with the script. I've attached 2 pictures myself. The small search bar on top isn't officially in the script (yet). That's something I'm working on myself. The script also makes the code blocks a little bit more compact and automatically jumps to the newest post even if you don't click on the little icon etc. Edited October 26, 2018 by Neutral General 1 Share this post Link to post
Neutral General 15 Posted October 26, 2018 (edited) Sorry for my double post. I just wanted to share my own custom version of sakuras script: At the beginning of the script are a couple constants you can set either to true or false to control which features of the script you want to use. // ==UserScript== // @name [DPE] CSS Overrides // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://en.delphipraxis.net/* // @exclude *?do=edit // @grant none // ==/UserScript== (function() { try{ 'use strict'; // Header const enable_compact_banner = true; const enable_compact_searchbar = true; // thread overview const enable_modified_topic_banner = true; const enable_compact_fluidlist = true; const enable_additional_highlight = true; // Threads/Posts const enable_small_userinfo = true; const enable_compact_comment = true; const enable_compact_code = true; const enable_compact_survey = true; // Other const enable_goto_latest_post = true; const enable_scroll_to_content = true; const $ = jQuery; const stylesheet = document.styleSheets[document.styleSheets.length - 1]; if (enable_compact_banner) { $('HEADER .logo').attr('style', 'height: auto;'); $('HEADER .logo IMG').attr('style', 'margin-bottom: -30px;'); } // fluid list if (enable_compact_fluidlist) { $('LI.ipsDataItem').attr('style', 'padding: 2px 0'); $('DIV.ipsDataItem_icon').attr('style', 'padding: 0 10px;'); $('DIV.ipsDataItem_main').attr('style', 'padding: 0;'); $('UL.ipsDataItem_stats').attr('style', 'padding: 0 10px 0 0;'); } if (enable_goto_latest_post) { $('LI.ipsDataItem_unread DIV.ipsDataItem_main A[href*=topic]').each(function() { const href = $(this).attr('href'); if (href.indexOf('?') < 0) $(this).attr('href', href + '?do=getNewComment'); }); } if (enable_modified_topic_banner) { const ipsPageHeader = $('DIV.ipsPageHeader'); ipsPageHeader.attr('style', 'padding: 5px;'); const topicControls = ipsPageHeader.next(); const topicControlsLinks = topicControls.find('A'); for (var idx = 0, link; link = topicControlsLinks[idx]; idx++) { const div = $('<div class="ipsPos_right ipsResponsive_noFloat ipsResponsive_hidePhone" style="margin-left: 5px;"></div>'); link.style = 'padding: 5px; line-height: 1.5em;'; div.append(link); ipsPageHeader.prepend(div); } topicControls.remove(); } if (enable_small_userinfo) { $('UL.cAuthorPane_info').attr('style', 'transform: scale(0.6); padding: 0; margin: -40px;'); } if (enable_compact_comment) { $('DIV[data-role="commentContent"]').attr('style', 'padding: 0; font-size: small;'); } // Code if (enable_compact_code) { $('PRE.ipsCode').attr('style', 'padding: 5px !important; font-size: small;'); } // Survey if (enable_compact_survey) { $(':root').attr('style', '--grid-gap: 0px;'); $('span.ipsFaded').attr('style', 'margin-left: 5px;'); } if (enable_additional_highlight) { // Highlight subforum in post listing (fluid list) $('.ipsDataItem_meta > a[href*="?forumId="]').css({ color: '#4D7395' }); // Highlight user in post listing (fluid list) $('.ipsDataItem_meta > span > a[href*="/profile/"]').css({ color: '#4D7395' }); } // Compact search bar if (enable_compact_searchbar) { $('.nav-bar').attr('style', 'height: 30px;'); $('.secondary-header-align').attr('style', 'height: 30px;'); $('.ipsNavBar_primary > ul > li > a').attr('style', 'line-height: 30px;'); $('.ipsfocus-search').attr('style', 'height: 30px; line-height: 30px;'); } stylesheet.insertRule('.ipsDataList.ipsDataList_zebra > .ipsDataItem { height: 45px; }'); // scroll to start of content if (enable_scroll_to_content) { if (window.location.href.indexOf('?do') < 0) { $('html,body').animate({scrollTop: $('#elContent').offset().top},'slow'); } } } catch(e) { // I don't wanna hear about it } })(); Edited October 26, 2018 by Neutral General 1 Share this post Link to post
Der schöne Günther 316 Posted October 26, 2018 2018-10-26_16-51-53.mp4 What can I do to prevent this? Share this post Link to post
Neutral General 15 Posted October 26, 2018 Don't do that 😛 It's not a perfect solution. The script is open source so if you know how to fix this you're welcome to change stuff 😉 1 Share this post Link to post
toms 29 Posted October 26, 2018 (edited) @Neutral General Is it really supposed to look like this? t is a bit too condensed for my taste. Edited October 26, 2018 by toms 1 Share this post Link to post
Neutral General 15 Posted October 26, 2018 @toms What overview is this screenshot from? The script is supposed to be used with the "Fluid" overview. Can you also give me the url to this view? Maybe I can fix something. Although as I said: If this is anything other than the fluid view, this script isn't supposed to handle this. Share this post Link to post
KodeZwerg 54 Posted October 28, 2018 (edited) On 10/26/2018 at 4:47 PM, Neutral General said: At the beginning of the script are a couple constants you can set either to true or false to control which features of the script you want to use. I love that compact view!!! Great Job @sakura and @Neutral General BTW: script successful tested with Opera Browser and Tampermonkey. Edited October 28, 2018 by KodeZwerg Share this post Link to post
sakura 45 Posted October 28, 2018 I have changed the header, so it only works on the portal page and topic view, but as those are the most important, I think it is for the better, as it does not mess up other pages. // ==UserScript== // @name [DPE] CSS Overrides // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://en.delphipraxis.net/ // @match https://en.delphipraxis.net/topic/* // @grant none // ==/UserScript== (function() { try{ 'use strict'; // Header const enable_compact_banner = true; const enable_compact_searchbar = true; // thread overview const enable_modified_topic_banner = true; const enable_compact_fluidlist = true; const enable_additional_highlight = true; // Threads/Posts const enable_small_userinfo = true; const enable_compact_comment = true; const enable_compact_code = true; const enable_compact_survey = true; // Other const enable_goto_latest_post = true; const enable_scroll_to_content = true; const $ = jQuery; const stylesheet = document.styleSheets[document.styleSheets.length - 1]; if (enable_compact_banner) { $('HEADER .logo').attr('style', 'height: auto;'); $('HEADER .logo IMG').attr('style', 'margin-bottom: -30px;'); } // fluid list if (enable_compact_fluidlist) { $('LI.ipsDataItem').attr('style', 'padding: 2px 0'); $('DIV.ipsDataItem_icon').attr('style', 'padding: 0 10px;'); $('DIV.ipsDataItem_main').attr('style', 'padding: 0;'); $('UL.ipsDataItem_stats').attr('style', 'padding: 0 10px 0 0;'); } if (enable_goto_latest_post) { $('LI.ipsDataItem_unread DIV.ipsDataItem_main A[href*=topic]').each(function() { const href = $(this).attr('href'); if (href.indexOf('?') < 0) $(this).attr('href', href + '?do=getNewComment'); }); } if (enable_modified_topic_banner) { const ipsPageHeader = $('DIV.ipsPageHeader'); ipsPageHeader.attr('style', 'padding: 5px;'); const topicControls = ipsPageHeader.next(); const topicControlsLinks = topicControls.find('A'); for (var idx = 0, link; link = topicControlsLinks[idx]; idx++) { const div = $('<div class="ipsPos_right ipsResponsive_noFloat ipsResponsive_hidePhone" style="margin-left: 5px;"></div>'); link.style = 'padding: 5px; line-height: 1.5em;'; div.append(link); ipsPageHeader.prepend(div); } topicControls.remove(); } if (enable_small_userinfo) { $('UL.cAuthorPane_info').attr('style', 'transform: scale(0.6); padding: 0; margin: -40px;'); } if (enable_compact_comment) { $('DIV[data-role="commentContent"]').attr('style', 'padding: 0; font-size: small;'); } // Code if (enable_compact_code) { $('PRE.ipsCode').attr('style', 'padding: 5px !important; font-size: small;'); } // Survey if (enable_compact_survey) { $(':root').attr('style', '--grid-gap: 0px;'); $('span.ipsFaded').attr('style', 'margin-left: 5px;'); } if (enable_additional_highlight) { // Highlight subforum in post listing (fluid list) $('.ipsDataItem_meta > a[href*="?forumId="]').css({ color: '#4D7395' }); // Highlight user in post listing (fluid list) $('.ipsDataItem_meta > span > a[href*="/profile/"]').css({ color: '#4D7395' }); } // Compact search bar if (enable_compact_searchbar) { $('.nav-bar').attr('style', 'height: 30px;'); $('.secondary-header-align').attr('style', 'height: 30px;'); $('.ipsNavBar_primary > ul > li > a').attr('style', 'line-height: 30px;'); $('.ipsfocus-search').attr('style', 'height: 30px; line-height: 30px;'); } stylesheet.insertRule('.ipsDataList.ipsDataList_zebra > .ipsDataItem { height: 45px; }'); // scroll to start of content if (enable_scroll_to_content) { if (window.location.href.indexOf('?do') < 0) { $('html,body').animate({scrollTop: $('#elContent').offset().top},'slow'); } } } catch(e) { // I don't wanna hear about it } })(); Share this post Link to post
sakura 45 Posted October 28, 2018 One more, code is folded, however, a toggle is at the top right corner... // ==UserScript== // @name [DPE] CSS Overrides // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://en.delphipraxis.net/ // @match https://en.delphipraxis.net/topic/* // @grant none // ==/UserScript== (function() { try{ 'use strict'; // Header const enable_compact_banner = true; const enable_compact_searchbar = true; // thread overview const enable_modified_topic_banner = true; const enable_compact_fluidlist = true; const enable_additional_highlight = true; // Threads/Posts const enable_small_userinfo = true; const enable_compact_comment = true; const enable_compact_pre = true; const enable_compact_code = true; const enable_compact_survey = true; // Other const enable_goto_latest_post = true; const enable_scroll_to_content = true; const $ = jQuery; const stylesheet = document.styleSheets[document.styleSheets.length - 1]; if (enable_compact_banner) { $('HEADER .logo').attr('style', 'height: auto;'); $('HEADER .logo IMG').attr('style', 'margin-bottom: -30px;'); } // fluid list if (enable_compact_fluidlist) { $('LI.ipsDataItem').attr('style', 'padding: 2px 0'); $('DIV.ipsDataItem_icon').attr('style', 'padding: 0 10px;'); $('DIV.ipsDataItem_main').attr('style', 'padding: 0;'); $('UL.ipsDataItem_stats').attr('style', 'padding: 0 10px 0 0;'); } if (enable_goto_latest_post) { $('LI.ipsDataItem_unread DIV.ipsDataItem_main A[href*=topic]').each(function() { const href = $(this).attr('href'); if (href.indexOf('?') < 0) $(this).attr('href', href + '?do=getNewComment'); }); } if (enable_modified_topic_banner) { const ipsPageHeader = $('DIV.ipsPageHeader'); ipsPageHeader.attr('style', 'padding: 5px;'); const topicControls = ipsPageHeader.next(); const topicControlsLinks = topicControls.find('A'); for (var idx = 0, link; link = topicControlsLinks[idx]; idx++) { const div = $('<div class="ipsPos_right ipsResponsive_noFloat ipsResponsive_hidePhone" style="margin-left: 5px;"></div>'); link.style = 'padding: 5px; line-height: 1.5em;'; div.append(link); ipsPageHeader.prepend(div); } topicControls.remove(); } if (enable_small_userinfo) { $('UL.cAuthorPane_info').attr('style', 'transform: scale(0.6); padding: 0; margin: -40px;'); } if (enable_compact_comment) { $('DIV[data-role="commentContent"]').attr('style', 'padding: 0; font-size: small;'); } // Code if (enable_compact_code) { $('PRE.ipsCode').attr('style', 'padding: 5px !important; font-size: small;'); } if (enable_compact_pre) { stylesheet.insertRule('PRE.ipsCode { max-height: 15em; }'); stylesheet.insertRule('PRE.ipsCode.viewAll { max-height: inherit; }'); stylesheet.insertRule('.codefold { right: 0; position: absolute !important; margin-right: 3em; }'); const a = $('<a href="javascript:void(0);" class="codefold" onclick="$(this).parent().toggleClass(\'viewAll\');">open/close</a>'); $('PRE.ipsCode').prepend(a); } // Survey if (enable_compact_survey) { $(':root').attr('style', '--grid-gap: 0px;'); $('span.ipsFaded').attr('style', 'margin-left: 5px;'); } if (enable_additional_highlight) { // Highlight subforum in post listing (fluid list) $('.ipsDataItem_meta > a[href*="?forumId="]').css({ color: '#4D7395' }); // Highlight user in post listing (fluid list) $('.ipsDataItem_meta > span > a[href*="/profile/"]').css({ color: '#4D7395' }); } // Compact search bar if (enable_compact_searchbar) { $('.nav-bar').attr('style', 'height: 30px;'); $('.secondary-header-align').attr('style', 'height: 30px;'); $('.ipsNavBar_primary > ul > li > a').attr('style', 'line-height: 30px;'); $('.ipsfocus-search').attr('style', 'height: 30px; line-height: 30px;'); } stylesheet.insertRule('.ipsDataList.ipsDataList_zebra > .ipsDataItem { height: 45px; }'); // scroll to start of content if (enable_scroll_to_content) { if (window.location.href.indexOf('?do') < 0) { $('html,body').animate({scrollTop: $('#elContent').offset().top},'slow'); } } } catch(e) { // I don't wanna hear about it } })(); Share this post Link to post
sakura 45 Posted October 28, 2018 (edited) Added Activity Stream: // ==UserScript== // @name [DPE] CSS Overrides // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://en.delphipraxis.net/ // @match https://en.delphipraxis.net/?* // @match https://en.delphipraxis.net/topic/* // @match https://en.delphipraxis.net/discover/* // @grant none // ==/UserScript== (function() { try{ 'use strict'; // Header const enable_compact_banner = true; const enable_compact_searchbar = true; // thread overview const enable_modified_topic_banner = true; const enable_compact_fluidlist = true; const enable_additional_highlight = true; // Threads/Posts const enable_small_userinfo = true; const enable_compact_comment = true; const enable_compact_pre = true; const enable_compact_code = true; const enable_compact_survey = true; // Other const enable_goto_latest_post = true; const enable_scroll_to_content = true; const enable_compactDiscover = true; const isDiscover = location.href.indexOf('delphipraxis.net/discover') > 0; const $ = jQuery; const stylesheet = document.styleSheets[document.styleSheets.length - 1]; if (enable_compact_banner) { $('HEADER .logo').attr('style', 'height: auto;'); $('HEADER .logo IMG').attr('style', 'margin-bottom: -30px;'); } // fluid list if (enable_compact_fluidlist && !isDiscover) { $('LI.ipsDataItem').attr('style', 'padding: 2px 0'); $('DIV.ipsDataItem_icon').attr('style', 'padding: 0 10px;'); $('DIV.ipsDataItem_main').attr('style', 'padding: 0;'); $('UL.ipsDataItem_stats').attr('style', 'padding: 0 10px 0 0;'); } if (enable_goto_latest_post) { $('LI.ipsDataItem_unread DIV.ipsDataItem_main A[href*=topic]').each(function() { const href = $(this).attr('href'); if (href.indexOf('?') < 0) $(this).attr('href', href + '?do=getNewComment'); }); } if (enable_modified_topic_banner) { const ipsPageHeader = $('DIV.ipsPageHeader'); ipsPageHeader.attr('style', 'padding: 5px;'); if (!isDiscover) { const topicControls = ipsPageHeader.next(); const topicControlsLinks = topicControls.find('A'); for (var idx = 0, link; link = topicControlsLinks[idx]; idx++) { const div = $('<div class="ipsPos_right ipsResponsive_noFloat ipsResponsive_hidePhone" style="margin-left: 5px;"></div>'); link.style = 'padding: 5px; line-height: 1.5em;'; div.append(link); ipsPageHeader.prepend(div); } topicControls.remove(); } } if (enable_small_userinfo) { $('UL.cAuthorPane_info').attr('style', 'transform: scale(0.6); padding: 0; margin: -40px;'); } if (enable_compact_comment && !isDiscover) { $('DIV[data-role="commentContent"]').attr('style', 'padding: 0; font-size: small;'); } // Code if (enable_compact_code && !isDiscover) { $('PRE.ipsCode').attr('style', 'padding: 5px !important; font-size: small;'); } if (enable_compact_pre) { stylesheet.insertRule('PRE.ipsCode { max-height: 15em; }'); stylesheet.insertRule('PRE.ipsCode.viewAll { max-height: inherit; }'); stylesheet.insertRule('.codefold { right: 0; position: absolute !important; margin-right: 3em; }'); const a = $('<a href="javascript:void(0);" class="codefold" onclick="$(this).parent().toggleClass(\'viewAll\');">open/close</a>'); $('PRE.ipsCode').prepend(a); } // Survey if (enable_compact_survey && !isDiscover) { $(':root').attr('style', '--grid-gap: 0px;'); $('span.ipsFaded').attr('style', 'margin-left: 5px;'); } if (enable_additional_highlight) { // Highlight subforum in post listing (fluid list) $('.ipsDataItem_meta > a[href*="?forumId="]').css({ color: '#4D7395' }); // Highlight user in post listing (fluid list) $('.ipsDataItem_meta > span > a[href*="/profile/"]').css({ color: '#4D7395' }); } // Compact search bar if (enable_compact_searchbar && !isDiscover) { $('.nav-bar').attr('style', 'height: 30px;'); $('.secondary-header-align').attr('style', 'height: 30px;'); $('.ipsNavBar_primary > ul > li > a').attr('style', 'line-height: 30px;'); $('.ipsfocus-search').attr('style', 'height: 30px; line-height: 30px;'); } stylesheet.insertRule('.ipsDataList.ipsDataList_zebra > .ipsDataItem { height: 45px; }'); if (enable_compactDiscover && isDiscover) { $('LI.ipsStreamItem').attr('style', 'padding: 2px 10px !important; margin: 0 0 2px 30px !important;'); $('LI.ipsStreamItem UL.ipsTags').each(function () { $(this).closest('DIV').find('H2').append($(this)); }); } // scroll to start of content if (enable_scroll_to_content) { if (window.location.href.indexOf('?do') < 0) { $('html,body').animate({scrollTop: $('#elContent').offset().top},'slow'); } } } catch(e) { // I don't wanna hear about it } })(); ... 🐈 ... Fixed for start page after login. Edited October 28, 2018 by sakura Share this post Link to post
KodeZwerg 54 Posted October 28, 2018 14 minutes ago, sakura said: ... 🐈 ... Is it normal that it display that line as error? I mean it works just fine, but show on some lines a red crossed badge and I am to unexperienced to decide if this is right or wrong. Share this post Link to post
sakura 45 Posted October 29, 2018 9 hours ago, KodeZwerg said: Is it normal that it display that line as error? I mean it works just fine, but show on some lines a red crossed badge and I am to unexperienced to decide if this is right or wrong. The CodeMonkey code editor is not perfect. I can live with that 😉 ... 🐈 ... Share this post Link to post
KodeZwerg 54 Posted October 29, 2018 Dear @sakura, does the "enable_goto_latest_post" feature work on your browser? My Opera will not jump there, always load page and reside at post #1. Share this post Link to post
sakura 45 Posted October 29, 2018 14 minutes ago, KodeZwerg said: Dear @sakura, does the "enable_goto_latest_post" feature work on your browser? My Opera will not jump there, always load page and reside at post #1. Now it does: // ==UserScript== // @name [DPE] CSS Overrides // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://en.delphipraxis.net/ // @match https://en.delphipraxis.net/?* // @match https://en.delphipraxis.net/topic/* // @match https://en.delphipraxis.net/discover/* // @grant none // ==/UserScript== (function() { try{ 'use strict'; // Header const enable_compact_banner = true; const enable_compact_searchbar = true; // thread overview const enable_modified_topic_banner = true; const enable_compact_fluidlist = true; const enable_additional_highlight = true; // Threads/Posts const enable_small_userinfo = true; const enable_compact_comment = true; const enable_compact_pre = true; const enable_compact_code = true; const enable_compact_survey = true; // Other const enable_goto_latest_post = true; const enable_scroll_to_content = true; const enable_compactDiscover = true; const isDiscover = location.href.indexOf('delphipraxis.net/discover') > 0; const $ = jQuery; const stylesheet = document.styleSheets[document.styleSheets.length - 1]; if (enable_compact_banner) { $('HEADER .logo').attr('style', 'height: auto;'); $('HEADER .logo IMG').attr('style', 'margin-bottom: -30px;'); } // fluid list if (enable_compact_fluidlist && !isDiscover) { $('LI.ipsDataItem').attr('style', 'padding: 2px 0'); $('DIV.ipsDataItem_icon').attr('style', 'padding: 0 10px;'); $('DIV.ipsDataItem_main').attr('style', 'padding: 0;'); $('UL.ipsDataItem_stats').attr('style', 'padding: 0 10px 0 0;'); } if (enable_goto_latest_post) { $('LI.ipsDataItem_unread DIV.ipsDataItem_main A[href*=topic]').each(function() { const href = $(this).attr('href'); if (href.indexOf('?') < 0) $(this).attr('href', href + '?do=getNewComment'); }); } if (enable_modified_topic_banner) { const ipsPageHeader = $('DIV.ipsPageHeader'); ipsPageHeader.attr('style', 'padding: 5px;'); if (!isDiscover) { const topicControls = ipsPageHeader.next(); const topicControlsLinks = topicControls.find('A'); for (var idx = 0, link; link = topicControlsLinks[idx]; idx++) { const div = $('<div class="ipsPos_right ipsResponsive_noFloat ipsResponsive_hidePhone" style="margin-left: 5px;"></div>'); link.style = 'padding: 5px; line-height: 1.5em;'; div.append(link); ipsPageHeader.prepend(div); } topicControls.remove(); } } if (enable_small_userinfo) { $('UL.cAuthorPane_info').attr('style', 'transform: scale(0.6); padding: 0; margin: -40px;'); } if (enable_compact_comment && !isDiscover) { $('DIV[data-role="commentContent"]').attr('style', 'padding: 0; font-size: small;'); } // Code if (enable_compact_code && !isDiscover) { $('PRE.ipsCode').attr('style', 'padding: 5px !important; font-size: small;'); } if (enable_compact_pre) { stylesheet.insertRule('PRE.ipsCode { max-height: 15em; }'); stylesheet.insertRule('PRE.ipsCode.viewAll { max-height: inherit; }'); stylesheet.insertRule('.codefold { right: 0; position: absolute !important; margin-right: 3em; }'); const a = $('<a href="javascript:void(0);" class="codefold" onclick="$(this).parent().toggleClass(\'viewAll\');">open/close</a>'); $('PRE.ipsCode').prepend(a); } // Survey if (enable_compact_survey && !isDiscover) { $(':root').attr('style', '--grid-gap: 0px;'); $('span.ipsFaded').attr('style', 'margin-left: 5px;'); } if (enable_additional_highlight) { // Highlight subforum in post listing (fluid list) $('.ipsDataItem_meta > a[href*="?forumId="]').css({ color: '#4D7395' }); // Highlight user in post listing (fluid list) $('.ipsDataItem_meta > span > a[href*="/profile/"]').css({ color: '#4D7395' }); } // Compact search bar if (enable_compact_searchbar && !isDiscover) { $('.nav-bar').attr('style', 'height: 30px;'); $('.secondary-header-align').attr('style', 'height: 30px;'); $('.ipsNavBar_primary > ul > li > a').attr('style', 'line-height: 30px;'); $('.ipsfocus-search').attr('style', 'height: 30px; line-height: 30px;'); } stylesheet.insertRule('.ipsDataList.ipsDataList_zebra > .ipsDataItem { height: 45px; }'); if (enable_compactDiscover && isDiscover) { $('LI.ipsStreamItem').attr('style', 'padding: 2px 10px !important; margin: 0 0 2px 30px !important;'); $('LI.ipsStreamItem UL.ipsTags').each(function () { $(this).closest('DIV').find('H2').append($(this)); }); } // scroll to start of content if (enable_scroll_to_content) { if ((window.location.href.indexOf('?do') < 0) && window.location.href.indexOf('#') < 0) { $('html,body').animate({scrollTop: $('#elContent').offset().top},'slow'); } } } catch(e) { // I don't wanna hear about it } })(); 1 Share this post Link to post
KodeZwerg 54 Posted October 29, 2018 Still not working, i just tried with this thread, maby my browser aint capable. Thankyou anyway for try helping me. Share this post Link to post
sakura 45 Posted October 29, 2018 Strange, works fine for me now. Anyways, posting a new topic was broke, so here is another fix. 😄 // ==UserScript== // @name [DPE] CSS Overrides // @namespace http://tampermonkey.net/ // @version 0.1 // @description try to take over the world! // @author You // @match https://en.delphipraxis.net/ // @match https://en.delphipraxis.net/?* // @match https://en.delphipraxis.net/topic/* // @match https://en.delphipraxis.net/discover/* // @grant none // ==/UserScript== (function() { try{ 'use strict'; // Header const enable_compact_banner = true; const enable_compact_searchbar = true; // thread overview const enable_modified_topic_banner = true; const enable_compact_fluidlist = true; const enable_additional_highlight = true; // Threads/Posts const enable_small_userinfo = true; const enable_compact_comment = true; const enable_compact_pre = true; const enable_compact_code = true; const enable_compact_survey = true; // Other const enable_goto_latest_post = true; const enable_scroll_to_content = true; const enable_compactDiscover = true; const isDiscover = location.href.indexOf('delphipraxis.net/discover') > 0; const $ = jQuery; const stylesheet = document.styleSheets[document.styleSheets.length - 1]; if (enable_compact_banner) { $('HEADER .logo').attr('style', 'height: auto;'); $('HEADER .logo IMG').attr('style', 'margin-bottom: -30px;'); } // fluid list if (enable_compact_fluidlist && !isDiscover) { $('LI.ipsDataItem').attr('style', 'padding: 2px 0'); $('DIV.ipsDataItem_icon').attr('style', 'padding: 0 10px;'); $('DIV.ipsDataItem_main').attr('style', 'padding: 0;'); $('UL.ipsDataItem_stats').attr('style', 'padding: 0 10px 0 0;'); } if (enable_goto_latest_post) { $('LI.ipsDataItem_unread DIV.ipsDataItem_main A[href*=topic]').each(function() { const href = $(this).attr('href'); if (href.indexOf('?') < 0) $(this).attr('href', href + '?do=getNewComment'); }); } if (enable_modified_topic_banner) { const ipsPageHeader = $('DIV.ipsPageHeader'); ipsPageHeader.attr('style', 'padding: 5px;'); if (!isDiscover) { const topicControls = ipsPageHeader.next(); const topicControlsLinks = topicControls.find('A'); for (var idx = 0, link; link = topicControlsLinks[idx]; idx++) { if ($(link).closest('FORM').length > 0) continue; const div = $('<div class="ipsPos_right ipsResponsive_noFloat ipsResponsive_hidePhone" style="margin-left: 5px;"></div>'); link.style = 'padding: 5px; line-height: 1.5em;'; div.append(link); ipsPageHeader.prepend(div); } } } if (enable_small_userinfo) { $('UL.cAuthorPane_info').attr('style', 'transform: scale(0.6); padding: 0; margin: -40px;'); } if (enable_compact_comment && !isDiscover) { $('DIV[data-role="commentContent"]').attr('style', 'padding: 0; font-size: small;'); } // Code if (enable_compact_code && !isDiscover) { $('PRE.ipsCode').attr('style', 'padding: 5px !important; font-size: small;'); } if (enable_compact_pre) { stylesheet.insertRule('PRE.ipsCode { max-height: 15em; }'); stylesheet.insertRule('PRE.ipsCode.viewAll { max-height: inherit; }'); stylesheet.insertRule('.codefold { right: 0; position: absolute !important; margin-right: 3em; }'); const a = $('<a href="javascript:void(0);" class="codefold" onclick="$(this).parent().toggleClass(\'viewAll\');">open/close</a>'); $('PRE.ipsCode').prepend(a); } // Survey if (enable_compact_survey && !isDiscover) { $(':root').attr('style', '--grid-gap: 0px;'); $('span.ipsFaded').attr('style', 'margin-left: 5px;'); } if (enable_additional_highlight) { // Highlight subforum in post listing (fluid list) $('.ipsDataItem_meta > a[href*="?forumId="]').css({ color: '#4D7395' }); // Highlight user in post listing (fluid list) $('.ipsDataItem_meta > span > a[href*="/profile/"]').css({ color: '#4D7395' }); } // Compact search bar if (enable_compact_searchbar && !isDiscover) { $('.nav-bar').attr('style', 'height: 30px;'); $('.secondary-header-align').attr('style', 'height: 30px;'); $('.ipsNavBar_primary > ul > li > a').attr('style', 'line-height: 30px;'); $('.ipsfocus-search').attr('style', 'height: 30px; line-height: 30px;'); } stylesheet.insertRule('.ipsDataList.ipsDataList_zebra > .ipsDataItem { height: 45px; }'); if (enable_compactDiscover && isDiscover) { $('LI.ipsStreamItem').attr('style', 'padding: 2px 10px !important; margin: 0 0 2px 30px !important;'); $('LI.ipsStreamItem UL.ipsTags').each(function () { $(this).closest('DIV').find('H2').append($(this)); }); } // scroll to start of content if (enable_scroll_to_content) { if ((window.location.href.indexOf('?do') < 0) && window.location.href.indexOf('#') < 0) { $('html,body').animate({scrollTop: $('#elContent').offset().top},'slow'); } } } catch(e) { // I don't wanna hear about it } })(); 1 Share this post Link to post