#6 √ resolved
Mark Bates

RJS

Reported by Mark Bates | July 15th, 2008 @ 11:49 AM | in 0.6.1

JavaScript Support in Mack (mack-javascript)

---------------------------------------------------

The following modules are to be supported:

App generator support:

  • Introduce new switch to mack app generator to specify which JS framework they want to use.

Example:

mack foo -j jquery

The above action should generate the app like usual, and add jquery as the 'js_framework' in app_config.

However, since mack-javascript is part of mack more, the new app_config should be commented out with

instruction on what to do next.

  • mack-js should introduce 'rake generate:javascript' command.

That command should generate all the required .js files in the application's public/javascripts folder.

The files to be generated depends on which framework the user specified--either jquery or prototype.

View Helpers support:

  • New rendering engine (rjs) and rendering type (js).
  • Registering the new engine/type to Mack's rendering registry.
  • MIME update, javascript content-type should be 'text/javascript'. According to Gerardo, only Firefox support the official mime type of javascript ('application/x-javascript'), where all other browsers expect 'text/javascript' as the content-type
  • HTML helpers to support RJS function (e.g. link_to_remote, etc.)

Script Generator helper: (translating ruby code to javascript code)

  • ScriptGenerator class that bridge the 2 framework (jquery or prototype)
  • JQuery handler
  • Prototype handler

All three components should have rspec tests written.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Mack is a Ruby web application framework focused on writing distributed, portal-like, applications. it's built on best of breed technologies, such as Rack, Cachetastic, and DataMapper.

Shared Ticket Bins

People watching this ticket

Referenced by