User talk:Learn more/Tampermonkey

From ReactOS Wiki
< User talk:Learn more
Revision as of 00:56, 19 April 2017 by Justincase (talk | contribs) (AddLinks only works on Your dashboard: new section)
Jump to: navigation, search

Suggestion: add CSS "height: auto" to Patchbot links script

The links don't show for me on Firefox because height=42 & overflow=hidden, thus I suggest adding "height auto" which can be done like this:

        $(this).parent().parent().css("height", "auto");

AddLinks only works on Your dashboard

You're using an element id which ends up being different on different people's JIRA dashboards, thus this won't work as intended (or in some cases, at all) on other people's dashboards.

I reworked it a bit to use class instead of id, make it fit in a bit better stylistically, and add the links on multiple instances of the quick links dashboard item (just in case).

(function() {
    'use strict';
    var title = "More";
    var newquicklinks = [
        '<a href="//reactos.org/testman/" target="_blank" title="View automatic regression test data">Testman</a>',
        '<a href="//build.reactos.org/builders" target="_blank" title="View recent continuous integration status results">Buildbot</a>',
        '<a href="//reactos.org/wiki" target="_blank" title="View or edit the wiki">Wiki</a>'
        ];
    var quicklinksdashboarditems = document.getElementsByClassName("quicklinks-dashboard-item");
    var i;
    for (i=0; i < quicklinksdashboarditems.length; i++) {
        quicklinksdashboarditems[i].insertAdjacentHTML('beforeend', '<ul class="quicklinks-links-list"><h6 class="list-label">' + title + '</h6><li>' + newquicklinks.join('</li><li>') + '</li></ul>');
    }
})();