More and more sites allow code to be edited in the browser... anything from simple templates all the way up to complete applications integrating both client and server code. The most popular editor for this purpose is probably still <textarea>, which is a terrible code editor (just hit the tab key to see what I mean!)
There's no excuse for just using <textarea> any more. The Ajax.org Cloud9 Editor (Ace) project was born out of Ajax.org's Cloud9 IDE cloud-based coding environment and Mozilla's Bespin/Skywriter project. With this project, we're creating an easily embeddable, "no compromises" editor.
In our talk, we'll show off how you can:
Use Ace in your own projects by adding just a couple of lines to your page
Configure Ace to your tastes
Extend Ace with custom features
Along the way, you'll see a number of Ace's features that go beyond just syntax highlighting: live syntax checking, highlight uses of variables, easy keyboard navigation (even for vim users!) and more.
18. Virtual Viewport
..
..
....
..
...
.... . . ...
.
• rendering a full document in ..
.
.
the DOM doesn‘t scale ..
..
.
..
.. ..
.
.. . ..
..
.... . . .
.
Montag, 2. Mai 2011
19. Virtual Viewport
..
..
....
..
...
.... . . ...
.
• rendering a full document in ..
.
.
the DOM doesn‘t scale ..
..
• only render visible rows .
..
.. ..
.
.. . ..
..
.... . . .
.
Montag, 2. Mai 2011
20. Virtual Viewport
..
..
....
..
...
.... . . ...
.
• rendering a full document in ..
.
.
the DOM doesn‘t scale ..
..
• only render visible rows .
..
.. ..
.
.. . ..
..
.... . . .
.
Montag, 2. Mai 2011
21. Performance
• Document size shouldn‘t matter
• Everything in the main thread should scale with the
viewport size
Montag, 2. Mai 2011
22. Performance
• Document size shouldn‘t matter
• Everything in the main thread should scale with the
viewport size
BUT
Montag, 2. Mai 2011
23. Performance
• Document size shouldn‘t matter
• Everything in the main thread should scale with the
viewport size
BUT
• not everything does!
Montag, 2. Mai 2011
24. Performance
• Document size shouldn‘t matter
• Everything in the main thread should scale with the
viewport size
BUT
• not everything does!
• We need web workers
Montag, 2. Mai 2011
40. Happy Coding!
@cloud9_editor
http://ace.ajax.org
https://github.com/fjakobs/coffeepreview
Montag, 2. Mai 2011
41. Photo Credits
• Big Bang http://www.flickr.com/photos/neychurluvr/4021590334/
• Mozilla Dinosaur http://www.flickr.com/photos/neychurluvr/4021590334/
• Bacon http://en.wikipedia.org/wiki/File:RawBacon.JPG
• Ben and Dion http://www.flickr.com/photos/franksvalli/5163228449/
Montag, 2. Mai 2011