123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153 |
- /* Amber package loading
- usage example:
- TODO
- */
- var require;
- require = function (require) {
- var scripts = document.getElementsByTagName("script");
- var src = scripts[ scripts.length - 1 ].src;
- var home = resolveViaDOM(src).replace(/\/[^\/]+$/, "");
- function resolveViaDOM(url) {
- var a = document.createElement("a");
- a.href = url;
- return a.href;
- }
- var config = {
- baseUrl: home,
- paths: {
- 'amber_set': '.',
- 'amber_vm': '.',
- 'amber_vm/boot': '../boot',
- 'amber_vm/parser': '../parser',
- 'amber': '..',
- 'jquery': 'jQuery/jquery-1.8.2.min',
- 'jquery-ui': 'jQuery/jquery-ui-1.8.16.custom.min'
- },
- map: {
- '*': {
- 'css': 'require-css-0.0.6/css'
- }
- },
- shim: {
- 'jquery-ui': {
- deps: [ 'jquery' ]
- },
- 'jQuery/jquery.textarea': {
- deps: [ 'jquery', 'jquery-ui' ]
- },
- 'CodeMirror/smalltalk': {
- deps: [ 'CodeMirror/codemirror' ]
- },
- 'CodeMirror/addon/hint/show-hint': {
- deps: [ 'CodeMirror/codemirror' ]
- },
- 'ensure-console': {
- exports: 'console'
- },
- 'amber/Kernel-Objects.deploy': {
- deps: []
- },
- 'amber/Kernel-Classes.deploy': {
- deps: [ 'amber/Kernel-Objects.deploy' ]
- },
- 'amber/Kernel-Methods.deploy': {
- deps: [ 'amber/Kernel-Objects.deploy' ]
- },
- 'amber/Kernel-Collections.deploy': {
- deps: [ 'amber/Kernel-Objects.deploy' ]
- },
- 'amber/Kernel-Exceptions.deploy': {
- deps: [ 'amber/Kernel-Objects.deploy' ]
- },
- 'amber/Kernel-Transcript.deploy': {
- deps: [ 'amber/Kernel-Objects.deploy' ]
- },
- 'amber/Kernel-Announcements.deploy': {
- deps: [ 'amber/Kernel-Objects.deploy' ]
- },
- 'amber/Canvas.deploy': {
- deps: [ 'amber/Kernel-Objects.deploy' ]
- },
- 'amber/Kernel-Objects': {
- deps: []
- },
- 'amber/Kernel-Classes': {
- deps: [ 'amber/Kernel-Objects' ]
- },
- 'amber/Kernel-Methods': {
- deps: [ 'amber/Kernel-Objects' ]
- },
- 'amber/Kernel-Collections': {
- deps: [ 'amber/Kernel-Objects' ]
- },
- 'amber/Kernel-Exceptions': {
- deps: [ 'amber/Kernel-Objects' ]
- },
- 'amber/Kernel-Transcript': {
- deps: [ 'amber/Kernel-Objects' ]
- },
- 'amber/Kernel-Announcements': {
- deps: [ 'amber/Kernel-Objects' ]
- },
- 'amber/Canvas': {
- deps: [ 'amber/Kernel-Objects' ]
- },
- 'amber/SUnit': {
- deps: [ 'amber/Kernel-Objects' ]
- },
- 'amber/Importer-Exporter': {
- deps: [ 'amber/Kernel-Objects' ]
- },
- 'amber/Compiler-Exceptions': {
- deps: [ 'amber/Kernel-Exceptions', 'amber/Compiler-AST' ]
- },
- 'amber/Compiler-Core': {
- deps: [ 'amber/Kernel-Objects' ]
- },
- 'amber/Compiler-AST': {
- deps: [ 'amber/Compiler-Core' ]
- },
- 'amber/Compiler-Semantic': {
- deps: [ 'amber/Compiler-Core' ]
- },
- 'amber/Compiler-IR': {
- deps: [ 'amber/Compiler-Core' ]
- },
- 'amber/Compiler-Inlining': {
- deps: [ 'amber/Compiler-IR' ]
- },
- 'amber/Compiler-Interpreter': {
- deps: [ 'amber/Compiler-Core' ]
- },
- 'amber/IDE': {
- deps: [ 'amber/Canvas', 'amber/Kernel-Exceptions' ]
- },
- 'amber/Examples': {
- deps: [ 'amber/Canvas' ]
- },
- 'amber/Benchfib': {
- deps: [ 'amber/Kernel-Objects' ]
- },
- 'amber/Kernel-Tests': {
- deps: [ 'amber/SUnit' ]
- },
- 'amber/Compiler-Tests': {
- deps: [ 'amber/SUnit' ]
- },
- 'amber/SUnit-Tests': {
- deps: [ 'amber/SUnit' ]
- }
- }
- };
- if (require) {
- require.config(config);
- return require;
- } else {
- return config;
- }
- }(require);
|