|
|
This is something that would make a great developer tool/ userscript. Syntax highlighting for all files, eg.
--Miksago |
|
|
Shouldn't be hard, and its an awesome idea. I'll look at it. |
|
|
I posted an attempt, but it stopped working :( |
|
|
what do you mean, it stopped working? |
|
|
I thought I had correctly modified it, but it only worked on my test page and nowhere else. I have to include the style information as well. I will get back to this asap. |
|
|
Alan and miksago, I took a look at the script from the link and the CSS issue Alan seemed to have. The original script only needed its initialization function called to run. The issue with the CSS is that the original script didn't have any. That's right, the CSS was located in their test.html file. A few calls to GM_addStyle fixed that. I then added a few comments. The end result is at http://userscripts.org/scripts/show/7982 Thanks for the idea and resources for this script; I think it'll help a lot of us code monkeys quite a bit. |
|
|
None of the above seem to work for me... which is kinda odd.. maybe i could see your test page to check.. |
|
|
Yes, i figured out that was where the CSS was, i just didnt get around to adding to to the script. btw, it still doesn't work on my test page... |
|
|
I'm getting an error all over the place when I try to use this script:
|
|
|
Adrian, It looks like you're right. I had copied and pasted into the text box as the method of uploading the script. I re-uploaded the script by file selection instead, uninstalled my copy of the script, and reinstalled from the site. It works with the test HTML I provided. Sorry for the mistake; I will be sure to use this method of upload exclusively in the future. -Joel |
|
|
Has anyone reported this as a bug to us.o? |
|
|
Added ticket, thanks: http://userscripts.devjavu.com/projects/userscr... |
|
|
It still only partially works on my test code |
|
|
Alan, My first guess is that only the HTML and CSS are highlighting; this is the default mode. The first line of executable code looks like:
If that doesn't solve the issue, I'll need more details, such as javascript console errors or a better description of what's happening or which code types aren't working and how they're not working. -Joel |
|
|
Hm, I took a look at this code, and right now it's got a few quirks in it. It seems to only work on:
I wasn't able to get it to work on text pages, such as the "View Script Source" pages on us.o, even though they use <pre> tags, it won't seem to let me change anything... |
|
|
Adrian: Currently, "View Script Source" just outputs the source with the MIME type text/javascript. Eventually we'll probably wrap it in a HTML page (and add an install button and syntax highlighting). Any markup you might see is due to Firefox, and I suppose the GM extension doesn't run on those kinds of pages. |
|
|
Joel: That was it. I assumed you had set it up to highlight all. Should have looked at the code. |
|
|
Adrian, that is because it is a text file, like Henrik said. It would have to be wrapped in an HTML page in order for CSS styles to be applied to it. |
|
|
Alan, If this is a point of confusion, perhaps I should default it to all. The reason I removed most of them is that the more obscure languages (such as delphi) are still checked, and I noticed it slowing down one of my older computers. Not terribly much, but since this is also set up by default to run on all pages, it annoyed me enough that I changed it. -Joel |