OpenUserJs/OpenUserJS.org — pull request #250 by Zren (2014-07-09 06:08:53+00:00)
Title: Implement #150

* Only show the install button on the script about page.

-----

These changes aren't commited yet.

* Make the script in scriptViewSourcePage read only.
* Move generated `options.hasCollab` / `options.collaborators` code to `script.hasCollab` / `script.collaborators` which is set in modelParser.
* `script.collaborators` is now a list of `parseUser({name: 'Zren'})` so we can access `user.userPageUrl` rather `{{text}}`.
* Normalized routes to `/scripts/userName/scriptName` and `/libs/userName/scriptName`. The only routes where it was singular was on the edit page, which wouldn't have been linked by a user, so it's less breaking than going to singular. `/users/` Should follow suit later.
* Use `app.param` to define the `:scriptType` route parameter. This allows us to remove the duplicate routes definitions for `/libs/...`. `next()` inside a param will go to the next middleware for the current route (which will be our controller). `next('route')` will tell the router to check the next route definition that matches the url.
* Removed `:namespace` from the modified routes as it's no longer required. We should probably check & removed it from the other routes as well.
* Created `scriptStorage.script_getSource(script, callback)` that accept a script object rather than do a second query on the db when we already have it. These are mapped to `script.getSource(callback)` with modelParser.
*