Permalink
Browse files

updating examples

  • Loading branch information...
1 parent 7f81c08 commit b9064995bdd38389b681485062dd94ab4528e369 @arboleya committed Apr 6, 2012
Showing with 222 additions and 463 deletions.
  1. +35 −0 examples/basic/release/app-debug.js
  2. +65 −37 examples/basic/release/app.js
  3. +2 −8 examples/basic/release/index.html
  4. +21 −0 examples/basic/release/toaster/basic/app.js
  5. +0 −34 examples/basic/release/toaster/basic/basic.js
  6. +13 −0 examples/basic/release/toaster/basic/letters/a.js
  7. +13 −0 examples/basic/release/toaster/basic/letters/b.js
  8. +13 −0 examples/basic/release/toaster/basic/repeating/a.js
  9. +13 −0 examples/basic/release/toaster/basic/repeating/b.js
  10. +5 −0 examples/basic/release/toaster/basic/single/script.js
  11. +0 −16 examples/basic/release/toaster/basic/src/app.js
  12. +0 −7 examples/basic/release/toaster/basic/src/letters/a.js
  13. +0 −7 examples/basic/release/toaster/basic/src/letters/b.js
  14. +0 −7 examples/basic/release/toaster/basic/src/repeating/a.js
  15. +0 −7 examples/basic/release/toaster/basic/src/repeating/b.js
  16. +0 −1 examples/basic/release/toaster/basic/src/single/script.js
  17. +0 −7 examples/basic/release/toaster/basic/src/toplevel.js
  18. +13 −0 examples/basic/release/toaster/basic/toplevel.js
  19. +11 −14 examples/basic/src/{ → basic}/app.coffee
  20. 0 examples/basic/src/{ → basic}/letters/a.coffee
  21. 0 examples/basic/src/{ → basic}/letters/b.coffee
  22. 0 examples/basic/src/{ → basic}/repeating/a.coffee
  23. 0 examples/basic/src/{ → basic}/repeating/b.coffee
  24. 0 examples/basic/src/{ → basic}/single/script.coffee
  25. 0 examples/basic/src/{ → basic}/toplevel.coffee
  26. +16 −13 examples/basic/toaster.coffee
  27. +1 −1 examples/basic/vendors/_.js
  28. +1 −1 examples/basic/vendors/jquery.js
  29. +0 −1 examples/multi-modules/README.md
  30. +0 −31 examples/multi-modules/release/animals.js
  31. +0 −61 examples/multi-modules/release/animals_insects.js
  32. +0 −31 examples/multi-modules/release/insects.js
  33. +0 −61 examples/multi-modules/release/insects_animals.js
  34. +0 −26 examples/multi-modules/release/toaster/animals/animals.js
  35. +0 −7 examples/multi-modules/release/toaster/animals/src/animals/horse.js
  36. +0 −26 examples/multi-modules/release/toaster/insects/insects.js
  37. +0 −7 examples/multi-modules/release/toaster/insects/src/insects/bee.js
  38. +0 −2 examples/multi-modules/src_animals/animals/horse.coffee
  39. +0 −2 examples/multi-modules/src_insects/insects/bee.coffee
  40. +0 −46 examples/multi-modules/toaster.coffee
  41. +0 −1 examples/multi-modules/vendors/_.js
  42. +0 −1 examples/multi-modules/vendors/jquery.js
@@ -0,0 +1,35 @@
+var UNDERSCORE = {};
+var JQUERY = {};
+var __t;
+
+__t = function(ns, expose) {
+ var curr, index, part, parts, _len;
+ curr = null;
+ parts = [].concat = ns.split(".");
+ for (index = 0, _len = parts.length; index < _len; index++) {
+ part = parts[index];
+ if (curr === null) {
+ curr = eval(part);
+ if (expose != null) expose[part] = curr;
+ continue;
+ } else {
+ if (curr[part] == null) {
+ curr = curr[part] = {};
+ if (expose != null) expose[part] = curr;
+ } else {
+ curr = curr[part];
+ }
+ }
+ }
+ return curr;
+};
+
+var basic = window.basic = {};
+
+document.write('<scri'+'pt src="./toaster/basic/letters/a.js"></scr'+'ipt>')
+document.write('<scri'+'pt src="./toaster/basic/letters/b.js"></scr'+'ipt>')
+document.write('<scri'+'pt src="./toaster/basic/repeating/a.js"></scr'+'ipt>')
+document.write('<scri'+'pt src="./toaster/basic/repeating/b.js"></scr'+'ipt>')
+document.write('<scri'+'pt src="./toaster/basic/single/script.js"></scr'+'ipt>')
+document.write('<scri'+'pt src="./toaster/basic/toplevel.js"></scr'+'ipt>')
+document.write('<scri'+'pt src="./toaster/basic/app.js"></scr'+'ipt>')
@@ -1,73 +1,101 @@
-// UNDERSCORE
-// JQUERY
-(function() {
- var A, App, B, TopLevel, letters, pkg, repeating, single;
- letters = {};
- repeating = {};
- single = {};
- pkg = function(ns) {
- var curr, index, part, parts, _len;
- curr = null;
- parts = [].concat = ns.split(".");
- for (index = 0, _len = parts.length; index < _len; index++) {
- part = parts[index];
- if (curr === null) {
- curr = eval(part);
- continue;
+var UNDERSCORE = {};
+var JQUERY = {};
+var __t;
+
+__t = function(ns, expose) {
+ var curr, index, part, parts, _len;
+ curr = null;
+ parts = [].concat = ns.split(".");
+ for (index = 0, _len = parts.length; index < _len; index++) {
+ part = parts[index];
+ if (curr === null) {
+ curr = eval(part);
+ if (expose != null) expose[part] = curr;
+ continue;
+ } else {
+ if (curr[part] == null) {
+ curr = curr[part] = {};
+ if (expose != null) expose[part] = curr;
} else {
- if (curr[part] == null) {
- curr = curr[part] = {};
- } else {
- curr = curr[part];
- }
+ curr = curr[part];
}
}
- return curr;
- };
- pkg('letters').A = A = (function() {
+ }
+ return curr;
+};
+
+var basic = window.basic = {};
+
+(function() {
+
+ __t('basic.letters', window).A = (function() {
+
function A() {
console.log("letters/A created!");
}
+
return A;
+
})();
- pkg('letters').B = B = (function() {
+
+ __t('basic.letters', window).B = (function() {
+
function B() {
console.log("letters/B created!");
}
+
return B;
+
})();
- pkg('repeating').A = A = (function() {
+
+ __t('basic.repeating', window).A = (function() {
+
function A() {
console.log("repeating/A created!");
}
+
return A;
+
})();
- pkg('repeating').B = B = (function() {
+
+ __t('basic.repeating', window).B = (function() {
+
function B() {
console.log("repeating/B created!");
}
+
return B;
+
})();
+
console.log("----------------------------------------------------------------------------\n:: I am the single/script file, you wont find any class declaration in me!\n\t So I will run as soon as I am processed, without the needing to be\n\t instantiated etc -- and thats why this log message will appear before\n\t the others (in this example).\n----------------------------------------------------------------------------");
- TopLevel = (function() {
+
+ __t('basic', window).TopLevel = (function() {
+
function TopLevel() {
console.log("TopLevel created!");
}
+
return TopLevel;
+
})();
- App = (function() {
+
+ __t('basic', window).App = (function() {
+
function App() {
console.log("App created!");
- new A;
- new B;
- new TopLevel;
+ new basic.TopLevel;
console.log("--------------------------------------------------------------------\n:: Namespaces are also welcome :)\n\t ..and helps you to differ two classes with the same name.\n\t In the lines bellow, two classes named 'A' and 'B' are\n\t instantiated independently, through namespaces.\n\t Namespaces are automatically generated based on the folder the\n\t the files are, relative to the src folder.\n--------------------------------------------------------------------");
- new letters.A;
- new letters.B;
- new repeating.A;
- new repeating.B;
+ new basic.letters.A;
+ new basic.letters.B;
+ new basic.repeating.A;
+ new basic.repeating.B;
}
+
return App;
+
})();
- new App;
+
+ new basic.App;
+
}).call(this);
@@ -1,8 +1,2 @@
-<html>
- <head>
- <!-- <script type="text/javascript" src="toaster/toaster.js"></script> -->
- <script type="text/javascript" src="app.js"></script>
- </head>
- <body>
- </body>
-</html>
+<!-- <script src="app.js"></script> -->
+<script src="app-debug.js"></script>
@@ -0,0 +1,21 @@
+(function() {
+
+ __t('basic', window).App = (function() {
+
+ function App() {
+ console.log("App created!");
+ new basic.TopLevel;
+ console.log("--------------------------------------------------------------------\n:: Namespaces are also welcome :)\n\t ..and helps you to differ two classes with the same name.\n\t In the lines bellow, two classes named 'A' and 'B' are\n\t instantiated independently, through namespaces.\n\t Namespaces are automatically generated based on the folder the\n\t the files are, relative to the src folder.\n--------------------------------------------------------------------");
+ new basic.letters.A;
+ new basic.letters.B;
+ new basic.repeating.A;
+ new basic.repeating.B;
+ }
+
+ return App;
+
+ })();
+
+ new basic.App;
+
+}).call(this);
@@ -1,34 +0,0 @@
-// UNDERSCORE
-// JQUERY
-letters = {}
-repeating = {}
-single = {}
-
-var pkg;
-pkg = function(ns) {
- var curr, index, part, parts, _len;
- curr = null;
- parts = [].concat = ns.split(".");
- for (index = 0, _len = parts.length; index < _len; index++) {
- part = parts[index];
- if (curr === null) {
- curr = eval(part);
- continue;
- } else {
- if (curr[part] == null) {
- curr = curr[part] = {};
- } else {
- curr = curr[part];
- }
- }
- }
- return curr;
-};
-
-document.write('<scri'+'pt src="./toaster/basic/src/letters/a.js"></scr'+'ipt>')
-document.write('<scri'+'pt src="./toaster/basic/src/letters/b.js"></scr'+'ipt>')
-document.write('<scri'+'pt src="./toaster/basic/src/repeating/a.js"></scr'+'ipt>')
-document.write('<scri'+'pt src="./toaster/basic/src/repeating/b.js"></scr'+'ipt>')
-document.write('<scri'+'pt src="./toaster/basic/src/single/script.js"></scr'+'ipt>')
-document.write('<scri'+'pt src="./toaster/basic/src/toplevel.js"></scr'+'ipt>')
-document.write('<scri'+'pt src="./toaster/basic/src/app.js"></scr'+'ipt>')
@@ -0,0 +1,13 @@
+(function() {
+
+ __t('basic.letters', window).A = (function() {
+
+ function A() {
+ console.log("letters/A created!");
+ }
+
+ return A;
+
+ })();
+
+}).call(this);
@@ -0,0 +1,13 @@
+(function() {
+
+ __t('basic.letters', window).B = (function() {
+
+ function B() {
+ console.log("letters/B created!");
+ }
+
+ return B;
+
+ })();
+
+}).call(this);
@@ -0,0 +1,13 @@
+(function() {
+
+ __t('basic.repeating', window).A = (function() {
+
+ function A() {
+ console.log("repeating/A created!");
+ }
+
+ return A;
+
+ })();
+
+}).call(this);
@@ -0,0 +1,13 @@
+(function() {
+
+ __t('basic.repeating', window).B = (function() {
+
+ function B() {
+ console.log("repeating/B created!");
+ }
+
+ return B;
+
+ })();
+
+}).call(this);
@@ -0,0 +1,5 @@
+(function() {
+
+ console.log("----------------------------------------------------------------------------\n:: I am the single/script file, you wont find any class declaration in me!\n\t So I will run as soon as I am processed, without the needing to be\n\t instantiated etc -- and thats why this log message will appear before\n\t the others (in this example).\n----------------------------------------------------------------------------");
+
+}).call(this);
@@ -1,16 +0,0 @@
-var App;
-App = (function() {
- function App() {
- console.log("App created!");
- new A;
- new B;
- new TopLevel;
- console.log("--------------------------------------------------------------------\n:: Namespaces are also welcome :)\n\t ..and helps you to differ two classes with the same name.\n\t In the lines bellow, two classes named 'A' and 'B' are\n\t instantiated independently, through namespaces.\n\t Namespaces are automatically generated based on the folder the\n\t the files are, relative to the src folder.\n--------------------------------------------------------------------");
- new letters.A;
- new letters.B;
- new repeating.A;
- new repeating.B;
- }
- return App;
-})();
-new App;
@@ -1,7 +0,0 @@
-var A;
-pkg('letters').A = A = (function() {
- function A() {
- console.log("letters/A created!");
- }
- return A;
-})();
@@ -1,7 +0,0 @@
-var B;
-pkg('letters').B = B = (function() {
- function B() {
- console.log("letters/B created!");
- }
- return B;
-})();
@@ -1,7 +0,0 @@
-var A;
-pkg('repeating').A = A = (function() {
- function A() {
- console.log("repeating/A created!");
- }
- return A;
-})();
@@ -1,7 +0,0 @@
-var B;
-pkg('repeating').B = B = (function() {
- function B() {
- console.log("repeating/B created!");
- }
- return B;
-})();
Oops, something went wrong.
@@ -1,7 +0,0 @@
-var TopLevel;
-TopLevel = (function() {
- function TopLevel() {
- console.log("TopLevel created!");
- }
- return TopLevel;
-})();
@@ -0,0 +1,13 @@
+(function() {
+
+ __t('basic', window).TopLevel = (function() {
+
+ function TopLevel() {
+ console.log("TopLevel created!");
+ }
+
+ return TopLevel;
+
+ })();
+
+}).call(this);
Oops, something went wrong.

0 comments on commit b906499

Please sign in to comment.