Jump to content

sakura

Members
  • Content Count

    75
  • Joined

  • Last visited

Posts posted by sakura


  1. Hi,

     

    I have a IDE plug-in which acts upon an opened file in the IDE (IOTAIDENotifier.FileNotification - aNotifyCode = ofnFileOpened).

    It loads the corresponding IOTAModule and the IOTAEditorContent for the PAS-File

    Before displaying, I want to do some formating for the viewer and set the content through the IOTAEditorContent interface.

     

    Nicely, as I do not call MarkModified, the editor view acts like the content has not been modified. However, the IOTAModule believes that the module has been modified and asks, whether the changes shall be saved (which I do not desire, when just viewing).

     

    Is there a way, to inform the IDE, that at this point, no changes have occurred. The question to save changes should not appear, when the user did not actually change anything 😉

     

    Thanks,
    Daniel


  2. Hi,

     

    just for you guys to weigh in, we have located a bug in the Delphi 10.4 compiler, that removes a totally valid assign statement in RELEASE mode, believing, that the code will never be executed. 

     

    The actual method is from the mORMot library in releases before last week (unit SynCommons.pas, method TSynAnsiFixedWidth.AnsiBufferToUTF8. A full discussion is available at the mORMot-Forum: https://synopse.info/forum/viewtopic.php?id=5520 .

     

    I have reported the bug to Embarcadero: https://quality.embarcadero.com/browse/RSP-30088 .

     

    Please check out my report and try to confirm and weigh in there. It should be reproducible.

     

    ---

     

    Note, the compiler will tell you (Hint H2077), that the value assigned is never used and thus, in RELEASE mode, with optimizations enabled, drop the code completely.

     

    Thanks for your time and support 👍

    • Thanks 4
    • Sad 1

  3. 2 hours ago, Uwe Raabe said:

    Just curious: Do you know why wuppdi is mentioned in %ProgramFiles(x86)%\Embarcadero\Studio\21.0\Welcomepage\js\wpLoader.js

     

    
    open/closevar classHide = 'wuppdi';
    var regHide = /\s*wuppdi/;

     

    Yepp, I know why 😄

     

    The original Welcome Page was designed by me during the field test, and at that time "wuppdi" was the "thing" at the German Delphi Praxis, and I wanted to include that somehow and that's how it ended up there 😄

    wuppdi is a simple CSS class to hide different things.

    doShow CSS class was used to override wuppdi 😄

     

     

    • Like 1
    • Haha 2

  4. 7 minutes ago, Sherlock said:

    Well, clearly I'm not there yet, and neither is any of the folks whose code I've had the chance to read.

    Don't worry, I've never seen larger projects, where the code could explain all the thinking behind the tinkering, especially the larger picture. 

     

    I think we all can agree, that good code explains what it is doing quite well, however, rarely, if ever why and never the reason behind he full logic of a multi-year-project.

    • Like 1
    • Thanks 1

  5. @Vincent Parrett Done yet? 😄

     

    Honestly, refactoring does not only mean fixing and improving code itself, though, as stated above, as learning and evolving creature, there is always a chance for that, no matter how expertly you done it, but requirements change, features need to be implemented, and so on. Existing code may anticipate a lot of upcoming changes, but ever everything? So yes, there will always be a need for refactoring.

     

    Now, let's go back to my last paragraph and do that 😉

    • Like 1

  6. 26 minutes ago, Vincent Parrett said:

    Kudos on getting this forum up and running, but please consider hosting it somewhere more central (like the US). From Australia each page load is painfully slow (5+ second page loads).  Hosting in the US would even out response times for more users (obviously it would make it slower for europe). 

    It almost got to be in Europe, as it is run by a European person (Daniel 😉). Going abroad, outside the EU, is hard in regards to the DSGVO (privacy laws), as it is almost impossible to guarantee a provider to obey those laws at sensible prices. Especially with US gov agencies trying to access anything and everything nowadays.

     

    ... 🐈 ...


  7. 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
        }
    })();

     

    • Like 1

  8. Hi,

     

    just a tiny tidbit, but wouldn't it be prudent to have the Code-Language default to Pascal? So far, it is HTML. I admit, I've only posted JavaScript at this point 😊, but I am looking forward to actually be helpful at some point 😉

     

    ... 🐈 ...


  9. 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
        }
    })();

     

    • Like 1

  10. 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 😉

     

    ... 🐈 ...


  11. 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.


  12. Hi, 

     

    not sure I think this is a good idea. Just hope you'll watch how it works out. Rather would think max. size per attachment would be better. Otherwise users might start deleting attachments made, which can/will lead to broken threads at some point.

     

    Mine is now at: 

    You have used 229.84 kB of your 488.28 MB attachment limit.

     

    ... 🐈 ...

    • Like 1

  13. 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
        }
    })();

     


  14. 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
        }
    })();

     

×