It is currently Sat Dec 16, 2017 12:28 am

All times are UTC - 7 hours





Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Sun Jan 27, 2013 7:01 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2983
Location: Tampere, Finland
Update 2014-09-13: v03 released. Added syntax highlighting in the wiki. As is the case with the forum, the code can't differentiate between code and other text, so it highlights everything.

--

This is a GreaseMonkey user script that enables syntax highlighting on this forum. It also modifies the forum titles so that the post title always comes first (making tabbed browsing easier).

In Firefox, you need the Greasemonkey add-on to use this. In Google Chrome, it should work out of the box, but only if you switch to the dev channel!

* To install in Chrome, download the file, open the extensions view (chrome://extensions/), and drag & drop the file in there.
* To install in Firefox, download Greasemonkey, choose Manage User Scripts, and drag & drop the script into the list.

Here's the old "after" result, the color scheme has changed a bit since then:
Attachment:
after.png
after.png [ 13.22 KiB | Viewed 3832 times ]

Latest version (v03), with wiki syntax highlighting:
Attachment:
nesdev-enhancer.user.js [88.49 KiB]
Downloaded 111 times

Old version (v02) without wiki syntax highlighting:
Attachment:
nesdev-enhancer.user.js [87.99 KiB]
Downloaded 132 times

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Last edited by thefox on Fri Sep 12, 2014 7:02 pm, edited 5 times in total.

Top
 Profile  
 
PostPosted: Sun Jan 27, 2013 8:32 am 
Offline
User avatar

Joined: Sun Jan 02, 2011 11:50 am
Posts: 522
It seemed I needed to go to Tools -> Extensions and then check "Developer mode" before chrome would allow me to install this.


Top
 Profile  
 
PostPosted: Sun Jan 27, 2013 8:59 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2983
Location: Tampere, Finland
Movax12 wrote:
It seemed I needed to go to Tools -> Extensions and then check "Developer mode" before chrome would allow me to install this.

Did you try drag & dropping it on to the Extensions window (it should display "Drop to install" while this is being done)?

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Sun Jan 27, 2013 1:15 pm 
Offline
User avatar

Joined: Sun Jan 02, 2011 11:50 am
Posts: 522
I uninstalled and tried it again and your instruction worked. Not sure what problem I had, which is why I qualified my post with 'seemed'.

Pretty good. How do I change the colors and or font?


Top
 Profile  
 
PostPosted: Sun Jan 27, 2013 1:23 pm 
Offline
User avatar

Joined: Mon Feb 07, 2011 12:46 pm
Posts: 941
Which assemblers is it compatible with? Does it work with MagicKit?

_________________
.


Top
 Profile  
 
PostPosted: Sun Jan 27, 2013 1:45 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
Neat, and pretty! That gets me wondering if phpBB has support for that sort of thing server-side, i.e. could make a [6502] tag for code and let it do the rest itself. I'd have to read the god-awful innards I bet...


Top
 Profile  
 
PostPosted: Sun Jan 27, 2013 2:42 pm 
Offline
User avatar

Joined: Fri Nov 19, 2004 7:35 pm
Posts: 3969
Any chance of a userscript/greasemonkey version?

_________________
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!


Top
 Profile  
 
PostPosted: Sun Jan 27, 2013 6:39 pm 
Offline
User avatar

Joined: Sat Feb 12, 2005 9:43 pm
Posts: 10165
Location: Rio de Janeiro - Brazil
koitsu wrote:
Neat, and pretty! That gets me wondering if phpBB has support for that sort of thing server-side, i.e. could make a [6502] tag for code and let it do the rest itself. I'd have to read the god-awful innards I bet...

Now that's an interesting idea!


Top
 Profile  
 
PostPosted: Mon Jan 28, 2013 12:21 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2983
Location: Tampere, Finland
Movax12 wrote:
I uninstalled and tried it again and your instruction worked. Not sure what problem I had, which is why I qualified my post with 'seemed'.

Pretty good. How do I change the colors and or font?

You'd have to edit the script (CRX is just a ZIP file, you'd have to extract that and then modify the files).

zzo38 wrote:
Which assemblers is it compatible with? Does it work with MagicKit?

Should work well enough with all the common dialects.

koitsu wrote:
Neat, and pretty! That gets me wondering if phpBB has support for that sort of thing server-side, i.e. could make a [6502] tag for code and let it do the rest itself. I'd have to read the god-awful innards I bet...

I suggested that in this post some time ago. Personally I wouldn't mind a client-side solution, because it should be easier to add than a server-side one. Basically it would be just a matter of including a couple of JavaScript files, some CSS files, and adding a BBCode tag to generate a <pre> tag with a special class name.

Dwedit wrote:
Any chance of a userscript/greasemonkey version?

Nope, not from me, sorry.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Mon Jan 28, 2013 5:13 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
thefox wrote:
koitsu wrote:
Neat, and pretty! That gets me wondering if phpBB has support for that sort of thing server-side, i.e. could make a [6502] tag for code and let it do the rest itself. I'd have to read the god-awful innards I bet...

I suggested that in this post some time ago. Personally I wouldn't mind a client-side solution, because it should be easier to add than a server-side one. Basically it would be just a matter of including a couple of JavaScript files, some CSS files, and adding a BBCode tag to generate a <pre> tag with a special class name.

I'm fine with either client-side or server-side. The problems with client-side is that more often than not these things end up chewing/wasting CPU time in such a way where interactivity is hindered in some way; i.e. "I just got back a bunch of HTML, and now I need to parse a bunch of HTML and turn it into some other HTML, so while I do this you won't be able to click on anything or adjust pulldowns". Throw JavaScript into the mix and now it's even scarier. Varies per browser of course, but you get my point. The server-side solution involves figuring out the phpBB bits and if it even supports doing that, but has the added advantage that the results look the same for everyone (including search engines/crawlers) and there's no "if you want it to look like this you gotta install this software/extension/script" nonsense.

thefox wrote:
Dwedit wrote:
Any chance of a userscript/greasemonkey version?

Nope, not from me, sorry.

Reason I'm quoting two things in one: because "a couple of JavaScript files, some CSS, etc." is exactly what GreaseMonkey scripts would do (although for sanity you really need to keep everything in one single script). I have some familiarity with GreaseMonkey scripts since I maintain a public one.

I don't use Chrome thus the .crx stuff does me zero good. (I like Chrome mind you, I forced myself to use it for a week, but there were UI bits/pieces that I could not stand and I hate tabbed browsing like you wouldn't believe)


Top
 Profile  
 
PostPosted: Tue Jan 29, 2013 12:44 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2983
Location: Tampere, Finland
koitsu wrote:
The server-side solution involves figuring out the phpBB bits and if it even supports doing that, but has the added advantage that the results look the same for everyone (including search engines/crawlers) and there's no "if you want it to look like this you gotta install this software/extension/script" nonsense.

Yes, I'd definitely prefer a server-side solution too, if there is one that works.

koitsu wrote:
thefox wrote:
Dwedit wrote:
Any chance of a userscript/greasemonkey version?

Nope, not from me, sorry.

Reason I'm quoting two things in one: because "a couple of JavaScript files, some CSS, etc." is exactly what GreaseMonkey scripts would do (although for sanity you really need to keep everything in one single script). I have some familiarity with GreaseMonkey scripts since I maintain a public one.

Yeah I know about GreaseMonkey, Chrome actually has native support for at least some subset of its functionality, and I have written one such script in the past. But in this case I needed to use multiple source files so this way was easier. And I wanted to learn a little bit in the process too.

Anybody is free to take and modify the source to work with Greasemonkey though, it's all in the CRX and it's pretty short (except for the actual SyntaxHighlighter engine).

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Thu Jan 31, 2013 2:04 pm 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2983
Location: Tampere, Finland
Here's another tiny script that fixes something that has been bothering me when using this forum: the fact that in thread titles there's garbage like "nesdev.com • View topic - " before the actual thread title (making tabbed browsing harder than it has to be). This one should work with Greasemonkey as well.

http://thefox.aspekt.fi/nesdev-enhancer.user.js
(This is outdated, use the latest version from the first post)

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Sat Apr 12, 2014 10:54 am 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2983
Location: Tampere, Finland
I've made a new version of this. Download is in the first post or here.

It's now an user script, so it will work in Firefox too. Tested on Google Chrome and Firefox. I've also integrated the topic hackery from the old nesdev-enhancer.user.js script into this new version.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
PostPosted: Sat Apr 12, 2014 5:04 pm 
Offline
User avatar

Joined: Sun Sep 19, 2004 9:28 pm
Posts: 3192
Location: Mountain View, CA, USA
You might consider maintaining this "semi-officially" using userscripts.org, by the way. It would make getting updates a lot easier (Greasemonkey will notice there's a new version when you push one out, etc.). To give you an idea, here's the script I used to maintain (their site seems down/broken right now though): http://userscripts.org/scripts/show/154089


Top
 Profile  
 
PostPosted: Fri Apr 18, 2014 2:56 pm 
Offline
User avatar

Joined: Mon Jan 03, 2005 10:36 am
Posts: 2983
Location: Tampere, Finland
koitsu wrote:
You might consider maintaining this "semi-officially" using userscripts.org, by the way. It would make getting updates a lot easier (Greasemonkey will notice there's a new version when you push one out, etc.). To give you an idea, here's the script I used to maintain (their site seems down/broken right now though): http://userscripts.org/scripts/show/154089

Yeah I'll do that at least if there's a next version.

_________________
Download STREEMERZ for NES from fauxgame.com! — Some other stuff I've done: kkfos.aspekt.fi


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 22 posts ]  Go to page 1, 2  Next

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group