Modifying OcUK

Soldato
OP
Joined
26 Dec 2003
Posts
16,522
Location
London
Oh yah whoops :cool:

Dunno, my current code is so far removed from the one I uploaded up there that it could be anything. Uninstall for now and install the final one when it's released :)
 
Soldato
OP
Joined
26 Dec 2003
Posts
16,522
Location
London
SpankLikeThis said:
ok cool :) will the final have the css in it too so i dont have to edit any files? :p

Yep but probably just in a lazy way - ie, you type in a bunch of hex values yourself, no kind of colour-picker or anything.
 
Soldato
OP
Joined
26 Dec 2003
Posts
16,522
Location
London
Well most of the things you can hack around. Take finding the thread's ID, for instance; it's not always in the URL, so I use this code:

Code:
ocuk.threadId = selectSingleNode(doc, doc, "//input[@type = 'hidden' and @name = 'searchthreadid']").value;

to get it out of the search form's hidden input. It's mainly stuff like that, hacking around the problems you find. Most of it's pretty straightforward though.

As for the language, all Firefox extensions are coded in Javascript and XUL. This is the biggest thing I've ever written in pure JS but I've been pretty comfortable with it for a while. It's just getting used to the things that are different between writing JS for content and JS for XUL and content.
 
Last edited:
Soldato
OP
Joined
26 Dec 2003
Posts
16,522
Location
London
SpankLikeThis said:
ok cool :) will the final have the css in it too so i dont have to edit any files? :p


I've changed my mind: probably not. After coding it, it's too annoying to see the flash of default colours before the stylesheet is applied.
 
Soldato
OP
Joined
26 Dec 2003
Posts
16,522
Location
London
Bump because I created an SVN repository for the extension and I'm going to start working on it again now that I have more time :)

Code:
svn co http://svn.robm.me.uk/ocukbb/trunk/

Just source. Run build.bat to build the XPI as well as a directory that you can use with Firefox's dynamic extension loading. To dynamically load the extension, create a text file called


in your profile/extensions directory, which should look be:

Code:
%appdata%\Mozilla\Firefox\Profiles\[b]some string of letters[/b]\extensions

In it, simply put the full path to the build directory that the build script generates (in my case, C:\firefox\ocuk\build). When you start Firefox, it'll load the extension; simply restart Firefox whenever you update your source from the repository.
 
Soldato
OP
Joined
26 Dec 2003
Posts
16,522
Location
London
Nah it's fine :)

Here you go:

Code:
@-moz-document domain(forums.overclockers.co.uk) {
	/*
	** OcUK colour scheme changer 
	** By Rob Miller
	*/
	* { color:#000 !important; }
	textarea, input { background:#ddd !important; }
	body, .page, .thead, .tfoot, .alt2, .alt2Active, .panel { background-color: #fff !important; }
	.alt1, .alt1Active, .panelsurround, .vbmenu_option { background-color: #fff !important; }
	.alt2 { background:#dfdfdf !important; }
	.vbmenu_control, .vbmenu_control *, .vbmenu_hilite, .vbmenu_hilite *, .tcat, .tcat * { background-color: #006598 !important; color:#fff !important; }
	.vbmenu_popup { border: 1px solid #ccc !important; }
}
 
Soldato
OP
Joined
26 Dec 2003
Posts
16,522
Location
London
Dunno how Opera's custom CSS works, but you'd just find out how to load a custom stylesheet and put this code in it:

Code:
/*
** OcUK colour scheme changer 
** By Rob Miller
*/
* { color:#000 !important; }
textarea, input { background:#ddd !important; }
body, .page, .thead, .tfoot, .alt2, .alt2Active, .panel { background-color: #fff !important; }
.alt1, .alt1Active, .panelsurround, .vbmenu_option { background-color: #fff !important; }
.alt2 { background:#dfdfdf !important; }
.vbmenu_control, .vbmenu_control *, .vbmenu_hilite, .vbmenu_hilite *, .tcat, .tcat * { background-color: #006598 !important; color:#fff !important; }
.vbmenu_popup { border: 1px solid #ccc !important; }

Not sure if it lets you limit the CSS to certain domains or what-have-you.

Edit: It tells you how to do site-specific user CSS here:

http://operawiki.info/OperaUserCSS
 
Soldato
OP
Joined
26 Dec 2003
Posts
16,522
Location
London
georges said:
I'll recommend the "stylish" extension from the firefox site mentioned earlier. Lets you instantly change and preview changes by rightclicking in the status bar the icon, with saved css being on a list for that site or global ones.

Neat. Do changes persist or are they just for a single pageview, á la Firefox's built-in style switcher?
 
Soldato
OP
Joined
26 Dec 2003
Posts
16,522
Location
London
Augmented said:
Persist. It's just a nice, live wrapper for usercontent.css. Anything you can do with @-moz-document works - so current URI, domain, subdomain etc. Very handy. (/edit - n.b. doesn't actually modify usercontent.css, uses stylish.rdf in the profile folder).

Neateroonosity.
 
Back
Top Bottom