On 4/27/07, David Koontz <david at koontzfamily.org>
wrote:>
> I noticed in the literature for Masterview that the offline pages are
> capable of having javascript links for the forms so that they are
> navigable. I haven''t been able to find any information on
actually
> enabling this. Am I totally off base on this?
>
>
Yes MasterView has some javascript that can be used to make offline pages
navigate as if they were running in rails. If you generate some pages using
the generator, then you can see how these are used. It isn''t necessary
to
use the generator to use the javascript, but it will give you an example of
how it is used.
Here is roughly how it works.
First, for the links, we just put the href to the other view, so they work
as you would think, nothing fancy there.
Second, for the buttons, we use javascript to register onclick events with
the buttons so that they also go to the proper offline page. The generator
uses specific crud based class names that it looks for and what to link it
to.
Third, we copy and remove sections, and finally we adjust some of the
messages on the pages.
You''ll see this activated by a javascript inclusion at the bottom of
the
pages.
<script mv:replace=""
src="../../masterview/extra/mvpreview.js"
type="text/javascript"></script>
<script mv:replace="" type="text/javascript">
mvpreview.preparePage( ''products'', {} );
</script>
The script also changes some messages, copies sections, removes sections,
etc., all things to help the prototype look more like it would when running.
You are right that we haven''t documented this as we should have. I will
put
this as a todo item. In the meantime, I''d recommend that you try out
the
generator (script/generator masterview Foo Bar) and see what it creates and
post up any additional questions you have. We''ll take these and use
them for
the new documentation.
Thanks,
Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/masterview-users/attachments/20070429/c7a8f3cb/attachment.html