Despite all the amazing work the guys in DIC have done for the upgrade, the site is still a bit flaky. One of the most annoying snags is the fact that blog posts cannot be posted with year 2010, so they all end up down the list of posts. Another one is that code boxes are still tiny.
This GreaseMonkey script fixes these 2 issues. It is still work in progress, as I'll probably be adding extra stuff in there, but it might prove useful to other people out there:
To install it, you obviously have to have the GreaseMonkey add-on installed in Firefox. Copy-paste the script above into a file called "dreamincode.user.js", and open the file with Firefox (File > Open File...). Firefox will then ask you if you want to install the script. Accept, and you're sorted.
This GreaseMonkey script fixes these 2 issues. It is still work in progress, as I'll probably be adding extra stuff in there, but it might prove useful to other people out there:
// ==UserScript== // @name DreamInCodeBlogIssue // @namespace http://www.dreamincode.net // @include http://www.dreamincode.net/forums/* // @author EdwinNameless // ==/UserScript== (function() { var DreamInCode = { addCurrentYearToSelect: function() { var date = new Date(); var option = document.createElement("option"); option.setAttribute("value", date.getFullYear()); option.setAttribute("selected", "selected"); option.appendChild(document.createTextNode(date.getFullYear())); var select = document.evaluate( '//select[@name="entry_year"]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null); for (var i = 0; i < select.snapshotLength; i++) { var year = select.snapshotItem(i); year.insertBefore(option, year.firstChild); } }, isBlogPage: function(link) { return link.match(/^http:\/\/www\.dreamincode\.net\/[^?]*\?app=blog/i); }, enlargeCodeBox: function() { var codeBoxes = document.getElementsByClassName("prettyprint"); for each (codebox in codeBoxes) { codebox.style.width = "auto"; } }, }; var currentUrl = window.location.href; DreamInCode.enlargeCodeBox(); if (DreamInCode.isBlogPage(currentUrl)) { DreamInCode.addCurrentYearToSelect(); } })();
To install it, you obviously have to have the GreaseMonkey add-on installed in Firefox. Copy-paste the script above into a file called "dreamincode.user.js", and open the file with Firefox (File > Open File...). Firefox will then ask you if you want to install the script. Accept, and you're sorted.
0 Comments On This Entry
About...
This is my fake blog. 'Cause I also have a real blog with real stuff in it.
← April 2018 →
S | M | T | W | T | F | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
My Blog Links
Recent Entries
-
-
My Latest GreaseMonkey Script for DIC
on Feb 11 2010 04:29 AM
-
-
-
Recent Comments
Search My Blog
0 user(s) viewing
0 Guests
0 member(s)
0 anonymous member(s)
0 member(s)
0 anonymous member(s)