diff --git a/src/app/browser.coffee b/src/app/browser.coffee index b0f6300a6b..6042821d90 100644 --- a/src/app/browser.coffee +++ b/src/app/browser.coffee @@ -10,41 +10,27 @@ restoreRefs = module.exports.restoreRefs = (model) -> ### Loads JavaScript files from (1) public/js/* and (2) external sources - We use this file (instead of or inside .html) so we can utilize require() to concatinate for - faster page load, and $.getScript for asyncronous external script loading + If a library is available in a CDN, we put it in (index.html) for better caching. If not, we use + this function to utilize require() to concatinate for faster page load, and $.getScript for asyncronous external script loading ### loadJavaScripts = (model) -> - require '../../public/vendor/jquery-ui/jquery-1.9.1' unless model.get('_view.mobileDevice') require '../../public/vendor/jquery-ui/ui/jquery.ui.core' require '../../public/vendor/jquery-ui/ui/jquery.ui.widget' require '../../public/vendor/jquery-ui/ui/jquery.ui.mouse' require '../../public/vendor/jquery-ui/ui/jquery.ui.sortable' - # Bootstrap - require '../../public/vendor/bootstrap/docs/assets/js/bootstrap' -# require '../../public/vendor/bootstrap/js/bootstrap-tooltip' -# require '../../public/vendor/bootstrap/js/bootstrap-tab' -# require '../../public/vendor/bootstrap/js/bootstrap-popover' -# require '../../public/vendor/bootstrap/js/bootstrap-modal' -# require '../../public/vendor/bootstrap/js/bootstrap-dropdown' - - - require '../../public/vendor/jquery-cookie/jquery.cookie' require '../../public/vendor/bootstrap-tour/bootstrap-tour' - require '../../public/vendor/bootstrap-datepicker/js/bootstrap-datepicker' - require '../../public/vendor/bootstrap-growl/jquery.bootstrap-growl.min' - # JS files not needed right away (google charts) or entirely optional (analytics) # Each file getsload asyncronously via $.getScript, so it doesn't bog page-load unless model.get('_view.mobileDevice') - $.getScript("https://s7.addthis.com/js/250/addthis_widget.js#pubid=lefnire"); + $.getScript("//s7.addthis.com/js/250/addthis_widget.js#pubid=lefnire"); # Google Charts - $.getScript "https://www.google.com/jsapi", -> + $.getScript "//www.google.com/jsapi", -> # Specifying callback in options param is vital! Otherwise you get blank screen, see http://stackoverflow.com/a/12200566/362790 google.load "visualization", "1", {packages:["corechart"], callback: ->} diff --git a/views/app/index.html b/views/app/index.html index 3f3a318cfa..d826d011ee 100644 --- a/views/app/index.html +++ b/views/app/index.html @@ -43,8 +43,17 @@ - - + + + + + + + + + {#if equal(_view.nodeEnv,"production")}