Knockout js is very nice, but it's not good to call the js directly from github, for it's slow and somehow may not able to access in countries.

Hope to see more detail features with drupal soon!

Comments

Cyberflyer’s picture

Title: Use libraries module to call js file » How to use libraries module to call js file
Status: Active » Needs review

All you have to do to use libraries is modify the module code to this:

function knockout_init() {
//  drupal_add_js('https://raw.github.com/SteveSanderson/knockout/master/build/output/knockout-latest.js', 'external');
drupal_add_js('/sites/all/libraries/knockout/knockout-latest.js', 'file');
//  drupal_add_js('/sites/all/libraries/knockout/knockout-latest.debug', 'file');
}

By changing what you comment out, you can shift from a local version, a local debug version and the latest via remote.

Then go to:

http://knockoutjs.com/downloads/index.html

Download the latest production and debug versions into /sites/all/libraries/knockout/ and name them accordingly.

Code in the header of any page should look something like this if you are successful:

<script type="text/javascript" src="http://your-site.dev/sites/all/modules/jquery_update/replace/jquery/jquery.js?v=1.5.2"></script>
<script type="text/javascript" src="http://your-site.dev/sites/all/modules/jquery_update/replace/ui/external/jquery.cookie.js?v=67fb34f6a866c40d0570"></script>
<script type="text/javascript" src="/sites/all/libraries/knockout/knockout-latest.js?mgj3ok"></script>
<script type="text/javascript" src="http://your-site.dev/modules/toolbar/toolbar.js?mgj3ok"></script>
<script type="text/javascript">