/Src/Bowerbird.Website/js/main.js

https://github.com/Bowerbird/bowerbird-web · JavaScript · 95 lines · 81 code · 3 blank · 11 comment · 0 complexity · ccdbf2316975bd85e0fd13067b1f0106 MD5 · raw file

  1. /// <reference path="../libs/log.js" />
  2. /// <reference path="../libs/require/require.js" />
  3. /// <reference path="../libs/jquery/jquery-1.7.2.js" />
  4. /// <reference path="../libs/underscore/underscore.js" />
  5. /// <reference path="../libs/backbone/backbone.js" />
  6. /// <reference path="../libs/backbone.marionette/backbone.marionette.js" />
  7. // Require AMD config
  8. // ------------------
  9. // Setup config
  10. require.config({
  11. baseUrl: '/js/bowerbird',
  12. paths: {
  13. jquery: 'http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery', // jQuery is now AMD compliant
  14. json2: '../libs/json/json2',
  15. underscore: '../libs/underscore/underscore', // AMD version from https://github.com/amdjs
  16. backbone: '../libs/backbone/backbone', // AMD version from https://github.com/amdjs,
  17. queryparams: '../libs/backbone.queryparams/backbone.queryparams',
  18. marionette: '../libs/backbone.marionette/backbone.marionette',
  19. noext: '../libs/require/noext', //https://github.com/millermedeiros/requirejs-plugins
  20. async: '../libs/require/async', // Required by google loader
  21. goog: '../libs/require/goog', // Google async loader
  22. propertyParser: '../libs/require/propertyparser', // Required by google loader
  23. ich: '../libs/icanhaz/icanhaz', // Mustache templates cache and renderer
  24. jqueryui: '../libs/jqueryui',
  25. datepicker: '../libs/bootstrap/bootstrap-datepicker',
  26. multiselect: '../libs/jquery.multiselect/jquery.multiselect',
  27. loadimage: '../libs/jquery.fileupload/load-image',
  28. fileupload: '../libs/jquery.fileupload/jquery.fileupload',
  29. iframetransport: '../libs/jquery.fileupload/jquery.iframe-transport',
  30. signalr: '../libs/jquery.signalr/jquery.signalr',
  31. timeago: '../libs/jquery.timeago/jquery.timeago',
  32. jsonp: '../libs/jquery.jsonp/jquery.jsonp',
  33. log: '../libs/log/log',
  34. hubs: 'hubs',
  35. grab: '../libs/jquery.jplayer/jquery.grab',
  36. transform: '../libs/jquery.jplayer/jquery.transform',
  37. jplayer: '../libs/jquery.jplayer/jquery.jplayer',
  38. circleplayer: '../libs/jquery.jplayer/circle.player',
  39. progress: '../libs/jquery.animateprogress/jquery.animate-progress',
  40. carousel: '../libs/jquery.carousel/jquery.carousel',
  41. touchswipe: '../libs/jquery.carousel/jquery.touchswipe',
  42. tipsy: '../libs/jquery.tipsy/jquery.tipsy',
  43. tagging: '../libs/jquery.tag-it/jquery.tag-it',
  44. visualize: '../libs/jquery.visualize/jquery.visualize',
  45. tinyscroller: '../libs/jquery.tinyscroller/jquery.tinyscroller',
  46. infinitescroll: '../libs/jquery.infinite-scroll/jquery.infinite-scroll',
  47. moment: '../libs/moment/moment',
  48. i18n: 'noext!/i18n'
  49. }
  50. });
  51. // Start app with primary dependancies
  52. require([
  53. 'app',
  54. 'bootstrap-data', // Get bootstrapped data from inline AMD module
  55. 'ich',
  56. 'log',
  57. 'jquery',
  58. 'json2',
  59. 'underscore',
  60. 'backbone',
  61. 'queryparams',
  62. 'marionette',
  63. 'noext!/templates', // Load templates from server
  64. 'noext!/i18n', // Load localised strings from server
  65. 'models/authenticateduser',
  66. 'controllers/usercontroller',
  67. 'controllers/activitycontroller',
  68. 'controllers/debugcontroller',
  69. 'controllers/homecontroller',
  70. 'controllers/observationcontroller',
  71. 'controllers/recordcontroller',
  72. 'controllers/organisationcontroller',
  73. 'controllers/postcontroller',
  74. 'controllers/projectcontroller',
  75. 'controllers/speciescontroller',
  76. 'controllers/accountcontroller',
  77. 'controllers/chatcontroller',
  78. 'views/headerview',
  79. 'views/footerview',
  80. 'views/sidebarview',
  81. 'views/notificationscompositeview',
  82. 'views/onlineuserlistview',
  83. 'signalr',
  84. 'hubs'
  85. ],
  86. function (app, bootstrapData) {
  87. log('bootstrapped data', bootstrapData);
  88. // Start the app as soon as the DOM is ready, loading in the bootstrapped data
  89. $(function () {
  90. app.start(bootstrapData);
  91. });
  92. });