application.js 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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-2.1.1.js
  8. //= require ./app/lib/core/jquery-ui-1.11.2.js
  9. //= require ./app/lib/core/underscore-1.7.0.js
  10. //= require ./app/lib/animations/velocity.min.js
  11. //= require ./app/lib/animations/velocity.ui.js
  12. //not_used= require_tree ./app/lib/spine
  13. //= require ./app/lib/spine/spine.coffee
  14. //= require ./app/lib/spine/ajax.coffee
  15. //= require ./app/lib/spine/local.coffee
  16. //= require ./app/lib/spine/route.coffee
  17. //= require ./app/lib/flot/jquery.flot.js
  18. //= require ./app/lib/flot/jquery.flot.selection.js
  19. //not_used= require_tree ./app/lib/bootstrap
  20. //= require ./app/lib/bootstrap/dropdown.js
  21. //= require ./app/lib/bootstrap/tooltip.js
  22. //= require ./app/lib/bootstrap/popover.js
  23. //= require ./app/lib/bootstrap/modal.js
  24. //= require ./app/lib/bootstrap/tab.js
  25. //= require ./app/lib/bootstrap/transition.js
  26. //= require ./app/lib/bootstrap/button.js
  27. //= require ./app/lib/bootstrap/collapse.js
  28. //= require_tree ./app/lib/base
  29. //= require ./app/index.js.coffee
  30. // IE8 workaround for missing console.log
  31. if (!window.console) {
  32. window.console = {}
  33. }
  34. if (!console.log) {
  35. console.log = function(){}
  36. }
  37. function escapeRegExp(str) {
  38. return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&");
  39. }
  40. Date.prototype.getWeek = function() {
  41. var onejan = new Date(this.getFullYear(),0,1);
  42. return Math.ceil((((this - onejan) / 86400000) + onejan.getDay()+1)/7);
  43. }
  44. function difference(object1, object2) {
  45. var changes = {};
  46. for ( var name in object1 ) {
  47. if ( name in object2 ) {
  48. if ( _.isObject( object2[name] ) && !_.isArray( object2[name] ) ) {
  49. var diff = difference( object1[name], object2[name] );
  50. if ( !_.isEmpty( diff ) ) {
  51. changes[name] = diff;
  52. }
  53. } else if ( !_.isEqual( object1[name], object2[name] ) ) {
  54. changes[name] = object2[name];
  55. }
  56. }
  57. }
  58. return changes;
  59. }
  60. function clone(object) {
  61. if (!object) {
  62. return object
  63. }
  64. return JSON.parse(JSON.stringify(object));
  65. }
  66. jQuery.event.special.remove = {
  67. remove: function(e) {
  68. if (e.handler) e.handler();
  69. }
  70. };
  71. // start application
  72. jQuery(function(){
  73. new App.Run();
  74. });