Syntax Highlighting in SU WebDialog
-
@jim said:
Here's one:
Just saw a story that Google Code Hosting is now using this.
(1) Go to this website: http://eloquentjavascript.net/chapter1.html
(2) Scroll down till you see the sample JS codebox, that begins:
var total = 0, count = 1;(3) on the right side of the codebox, click the "Load into Console" button...
Look familiar Jim ??
-
I'm liking code mirror:
-
looks good!
-
@jim said:
I'm liking code mirror:
that's great
I started to put it into yours as well, but haven't had much time
did you make a new SU Ruby library? or point it to something that exist?
can you PM me a WIP to see if the Mac likes it?
john
-
hi Jim,
I had a chance to play with CodeMirror in your new box...
Managed to get a clean fit, after a lot of looking.
I added a choice of 3 colours (shades of grey, really).
Border reduction and text-color's are next on list.The pushed inner html is where you can tweek some of the .editbox things and you only need the textarea for pre-loading a template, so I put it back in.
I'll work through and update everything to the latest versions before sending.
... and then work around your windows only features...
john
-
Howdy!
Can't believe it took me until now to find Codemirror... I am working on adding it to my editor as well. In case you're curious, here's a live preview:
http://media.alexschreyer.net/rubyedit/
I also added the other languages - in case someone wants to edit an HTML web dialog file etc.
Cheers,
Alex -
@alexschreyer said:
Can't believe it took me until now to find Codemirror...
Well it's relatively new is is not? When this topic started I think it was still listed as beta.
@alexschreyer said:
In case you're curious, here's a live preview:
Looking really good Alex!
P.S.: Do you have a way to use standard Windows styling instead of that charcoal theme?
-
@dan rathbun said:
Do you have a way to use standard Windows styling instead of that charcoal theme?
I still have to make the light and dark themes work. I started with the dark theme first...
Because Codemirror has an autocomplete function, I am looking into implementing this, too. What is the function that gives me access to all available methods in SU? I tried the following one but the list is limited to the Sketchup object.
puts Sketchup.methods.sort.join("\n").to_s
Cheers,
AlexP.S. I put in the request to disable the single undo.
-
hi Alex, and all
just to muddy the waters, after trying to get Codemirror to play nice inside SU on the mac I've been working on Ace editor http://ace.ajax.org/ and it's fantastic... very well supported and with some tweaking, usable 'offline'. It's the same 'engine' in cloud9 which everyone should try out .
The css may not work the same on PC's but the js should and for now I'm only after a Mac solution, if you want to try it 'offline' from source, clone 'cloud9' from github, then find this index.html
~/Sites/mysite/cloud9/cloud9/support/ace/index.html
It should run the demo in safari, chrome, firefox and maybe IE9 or if you have local host or install cloud9 you can run it with node.js.the ruby support is very good...
I've almost finished a new theme called 'blendin', which adds the 'scrollable' line stripes and chameleon tendencies. I'm struggling with the SU interface at the moment and using cut'n'paste... -
The Ace highlighter looks very good, too. Great to see a few of these popping up now. However, I just fixed my Ruby editor up with Codemirror, so I am not moving...
I'll have an updated version of my editor ready after a bit of testing. Here is a picture for now:
Cheers,
Alex
Advertisement