application.js 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778
  1. // This is a manifest file that'll be compiled into including all the files listed below.
  2. // Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
  3. // be included in the compiled file accessible from http://example.com/assets/application.js
  4. // It's not advisable to add code directly here, but if you do, it'll appear at the bottom of the
  5. // the compiled file.
  6. //
  7. //= require ./app/lib/core/jquery-1.10.2.min.js
  8. //= require ./app/lib/core/jquery-ui-1.8.23.custom.min.js
  9. //= require ./app/lib/core/underscore-1.5.1.js
  10. //not_used= require_tree ./app/lib/spine
  11. //= require ./app/lib/spine/spine.js
  12. //= require ./app/lib/spine/ajax.js
  13. //= require ./app/lib/spine/local.js
  14. //= require ./app/lib/spine/route.js
  15. //= require ./app/lib/flot/jquery.flot.js
  16. //= require ./app/lib/flot/jquery.flot.selection.js
  17. //not_used= require_tree ./app/lib/bootstrap
  18. //= require ./app/lib/bootstrap/bootstrap-dropdown.js
  19. //= require ./app/lib/bootstrap/bootstrap-tooltip.js
  20. //= require ./app/lib/bootstrap/bootstrap-popover.js
  21. //= require ./app/lib/bootstrap/bootstrap-modal.js
  22. //= require ./app/lib/bootstrap/bootstrap-tab.js
  23. //= require ./app/lib/bootstrap/bootstrap-transition.js
  24. //= require ./app/lib/bootstrap/bootstrap-button.js
  25. //= require ./app/lib/bootstrap/bootstrap-collapse.js
  26. //= require_tree ./app/lib/base
  27. //= require ./app/index.js.coffee
  28. // IE8 workaround for missing console.log
  29. if (!window.console) {
  30. window.console = {}
  31. }
  32. if (!console.log) {
  33. console.log = function(){}
  34. }
  35. function escapeRegExp(str) {
  36. return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
  37. }
  38. Date.prototype.getWeek = function() {
  39. var onejan = new Date(this.getFullYear(),0,1);
  40. return Math.ceil((((this - onejan) / 86400000) + onejan.getDay()+1)/7);
  41. }
  42. function difference(object1, object2) {
  43. var changes = {};
  44. for ( var name in object1 ) {
  45. if ( name in object2 ) {
  46. if ( _.isObject( object2[name] ) && !_.isArray( object2[name] ) ) {
  47. var diff = difference( object1[name], object2[name] );
  48. if ( !_.isEmpty( diff ) ) {
  49. changes[name] = diff;
  50. }
  51. } else if ( !_.isEqual( object1[name], object2[name] ) ) {
  52. changes[name] = object2[name];
  53. }
  54. }
  55. }
  56. return changes;
  57. }
  58. jQuery.event.special.remove = {
  59. remove: function(e) {
  60. if (e.handler) e.handler();
  61. }
  62. };
  63. // start application
  64. jQuery(function(){
  65. new App.Run();
  66. });