* FieldTable -- a simple table where each row has a label and a value,
and an optional note. Good for simple forms.
* externals -- for a widget to declare that it needs some external
resource, like a script or a stylesheet. It gets collected inside a
class var and then emitted in HEAD by...
* Page -- a widget that emits a whole HTML page, complete with doctype
and externals
* jquery -- a method that takes a JS snippet and then executes it
during $(document).ready
I'd like feedback on all this. Especially naming. Is 'externals'
meaningful? etc. etc.
Also, I left Page and FieldTable in the root namespace because it's so
cumbersome to say Erector::Widgets::FieldTable.new... Is there an easy
way to suck in a module namespace in Ruby? Would 'include' do that?
---
Alex Chaffee - al...@cohuman.com - http://alexch.github.com
Stalk me: http://friendfeed.com/alexch | http://twitter.com/alexch |
http://alexch.tumblr.com
Done, sort of: I extracted a basic_styles method which you can override.
> * Fix most of the TODOs. Most important for me would be different CSS
> media.
Done.
> (Actually, unless externals gains all the features of the Rails
> stylesheet_link_tag and javascript_include_tag helpers, I can't really
> use it at all.)
You mean timestamps and asset hosts?
> It would also be nice to have a way to specify classes for the body
> tag without overriding content. (I like to use haml's page_class
> helper for the body class.)
Done. Override the body_attributes method.
>> * jquery -- a method that takes a JS snippet and then executes it
>> during $(document).ready
>
> This should support pages running with jQuery.noConflict(), i.e. use:
>
> jQuery(document).ready(function($){ ... });
Done.