2
0

amber.js 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. /* Amber package loading
  2. usage example:
  3. TODO
  4. */
  5. var require;
  6. require = function (require) {
  7. var scripts = document.getElementsByTagName("script");
  8. var src = scripts[ scripts.length - 1 ].src;
  9. var home = resolveViaDOM(src).replace(/\/[^\/]+$/, "");
  10. function resolveViaDOM(url) {
  11. var a = document.createElement("a");
  12. a.href = url;
  13. return a.href;
  14. }
  15. var config = {
  16. baseUrl: home,
  17. paths: {
  18. 'amber_set': '.',
  19. 'amber_vm': '.',
  20. 'amber_css': '../css',
  21. 'amber_core': '../js',
  22. 'amber_core/_source': '../st',
  23. 'jquery': 'jQuery/jquery-1.8.2.min',
  24. 'jquery-ui': 'jQuery/jquery-ui-1.8.16.custom.min'
  25. },
  26. map: {
  27. '*': {
  28. 'css': 'requirejs/require-css-0.0.6/css'
  29. },
  30. 'amber_set/full-devel-helios': {
  31. 'jquery-ui': 'jQuery/jquery-ui-1.8.24.custom.min'
  32. }
  33. },
  34. shim: {
  35. 'jquery-ui': {
  36. deps: [ 'jquery' ]
  37. },
  38. 'bootstrap/js/bootstrap': {
  39. deps: [ 'css!bootstrap/css/bootstrap' ]
  40. },
  41. 'CodeMirror/codemirror': {
  42. deps: [ 'css!CodeMirror/codemirror' ]
  43. },
  44. 'jQuery/jquery.textarea': {
  45. deps: [ 'jquery', 'jquery-ui' ]
  46. },
  47. 'CodeMirror/smalltalk': {
  48. deps: [ './codemirror' ]
  49. },
  50. 'CodeMirror/addon/hint/show-hint': {
  51. deps: [ '../../codemirror' ]
  52. },
  53. 'ensure-console': {
  54. exports: 'console'
  55. }
  56. }
  57. };
  58. if (require) {
  59. require.config(config);
  60. return require;
  61. } else {
  62. return config;
  63. }
  64. }(require);