andrewdavey / knapsack

Project moved to https://github.com/andrewdavey/cassette
MIT License
24 stars 3 forks source link

External script references #9

Open andrewdavey opened 13 years ago

andrewdavey commented 13 years ago

Allow external references, such as: Html.ReferenceScript("http://platform.twitter.com/widgets.js");

Naive implementation can just put them after all internal scripts. A better implementation will allow dependencies to be taken on the external script, meaning it has to be sorted correctly with the internal scripts.

It may be better to keep the external URLs in the web.config, rather than in every partial/view that uses them. Adding a "module" reference feature could help here. Html.ReferenceScriptModule("twitter-api");

In the config: <add path="twitter-api" url="http://platform.twitter.com/widgets.js" />

andrewdavey commented 13 years ago

Naive implementation is now in master. Example web application updated to show it in action (tweet and fork buttons).