Permalink
Browse files

update assets to reflect chapters

  • Loading branch information...
1 parent fb7b84b commit e4b0dc70b0ef36a265d52b6e897869105c204748 @maccman committed May 30, 2011
Showing with 4,030 additions and 11,567 deletions.
  1. +3 −3 ch03/inherit.html
  2. +2 −2 ch03/model.js
  3. +0 −38 ch05/examples/index.html
  4. +0 −44 ch05/examples/index2.html
  5. +0 −42 ch05/examples/index3.html
  6. +0 −63 ch05/examples/lib/klass.js
  7. +0 −230 ch05/examples/lib/model.js
  8. +0 −25 ch05/examples/lib/model.link.js
  9. +0 −13 ch05/examples/lib/pubsub.js
  10. +0 −226 ch05/jquery.datalink/README.md
  11. +0 −42 ch05/jquery.datalink/demos/demo-contacts.css
  12. +0 −65 ch05/jquery.datalink/demos/demo-contacts.html
  13. +0 −111 ch05/jquery.datalink/demos/demo-contacts.js
  14. +0 −257 ch05/jquery.datalink/jquery.datalink.js
  15. +0 −57 ch05/jquery.link.js
  16. +0 −7 ch05/jquery.tmpl/.gitignore
  17. +0 −17 ch05/jquery.tmpl/README.md
  18. +0 −353 ch05/jquery.tmpl/demos/movies/PagesCore/movies.html
  19. +0 −363 ch05/jquery.tmpl/demos/movies/PagesCore/moviesNoGlobals.html
  20. +0 −354 ch05/jquery.tmpl/demos/movies/PagesTmplPlus/movies1.html
  21. +0 −344 ch05/jquery.tmpl/demos/movies/PagesTmplPlus/movies2.html
  22. +0 −333 ch05/jquery.tmpl/demos/movies/PagesTmplPlus/movies3.html
  23. +0 −1,929 ch05/jquery.tmpl/demos/movies/components/jquery-ui-1.8.1.custom.js
  24. +0 −96 ch05/jquery.tmpl/demos/movies/components/jquery-ui-1.8.1.custom.min.js
  25. +0 −132 ch05/jquery.tmpl/demos/movies/components/jquery.pager.js
  26. +0 −408 ch05/jquery.tmpl/demos/movies/css/jquery-ui-1.8.1.custom.css
  27. +0 −273 ch05/jquery.tmpl/demos/movies/css/movies.css
  28. BIN ch05/jquery.tmpl/demos/movies/images/ui-bg_diagonals-thick_75_f3d8d8_40x40.png
  29. BIN ch05/jquery.tmpl/demos/movies/images/ui-bg_dots-small_65_a6a6a6_2x2.png
  30. BIN ch05/jquery.tmpl/demos/movies/images/ui-bg_flat_0_333333_40x100.png
  31. BIN ch05/jquery.tmpl/demos/movies/images/ui-bg_flat_65_ffffff_40x100.png
  32. BIN ch05/jquery.tmpl/demos/movies/images/ui-bg_flat_75_ffffff_40x100.png
  33. BIN ch05/jquery.tmpl/demos/movies/images/ui-bg_glass_55_fbf8ee_1x400.png
  34. BIN ch05/jquery.tmpl/demos/movies/images/ui-bg_glass_75_dadada_1x400.png
  35. BIN ch05/jquery.tmpl/demos/movies/images/ui-bg_highlight-hard_100_eeeeee_1x100.png
  36. BIN ch05/jquery.tmpl/demos/movies/images/ui-bg_highlight-hard_100_f6f6f6_1x100.png
  37. BIN ch05/jquery.tmpl/demos/movies/images/ui-bg_highlight-soft_15_cc0000_1x100.png
  38. BIN ch05/jquery.tmpl/demos/movies/images/ui-icons_004276_256x240.png
  39. BIN ch05/jquery.tmpl/demos/movies/images/ui-icons_cc0000_256x240.png
  40. BIN ch05/jquery.tmpl/demos/movies/images/ui-icons_ffffff_256x240.png
  41. BIN ch05/jquery.tmpl/demos/samplesCore/Interactive/resources/collapsed.png
  42. BIN ch05/jquery.tmpl/demos/samplesCore/Interactive/resources/empty.png
  43. BIN ch05/jquery.tmpl/demos/samplesCore/Interactive/resources/expanded.png
  44. BIN ch05/jquery.tmpl/demos/samplesCore/Interactive/resources/folder.png
  45. +0 −75 ch05/jquery.tmpl/demos/samplesCore/Interactive/resources/tabs.css
  46. +0 −50 ch05/jquery.tmpl/demos/samplesCore/Interactive/resources/treeView.css
  47. +0 −77 ch05/jquery.tmpl/demos/samplesCore/Interactive/tabsTmpl.html
  48. +0 −94 ch05/jquery.tmpl/demos/samplesCore/Interactive/tabsWrap.html
  49. +0 −74 ch05/jquery.tmpl/demos/samplesCore/Interactive/tabsWrapImperative.html
  50. +0 −116 ch05/jquery.tmpl/demos/samplesCore/Interactive/tabsWrapNested.html
  51. +0 −123 ch05/jquery.tmpl/demos/samplesCore/Interactive/treeView.html
  52. +0 −133 ch05/jquery.tmpl/demos/samplesCore/basic.html
  53. +0 −91 ch05/jquery.tmpl/demos/samplesCore/composition.html
  54. +0 −36 ch05/jquery.tmpl/demos/samplesCore/conditional.html
  55. +0 −79 ch05/jquery.tmpl/demos/samplesCore/each.html
  56. +0 −98 ch05/jquery.tmpl/demos/samplesCore/parameters.html
  57. +0 −95 ch05/jquery.tmpl/demos/samplesTmplPlus/basic.html
  58. +0 −91 ch05/jquery.tmpl/demos/samplesTmplPlus/composition.html
  59. +0 −80 ch05/jquery.tmpl/demos/samplesTmplPlus/each.html
  60. +0 −98 ch05/jquery.tmpl/demos/samplesTmplPlus/parameters.html
  61. +0 −483 ch05/jquery.tmpl/jquery.tmpl.js
  62. +0 −10 ch05/jquery.tmpl/jquery.tmpl.min.js
  63. +0 −99 ch05/jquery.tmpl/jquery.tmplPlus.js
  64. +0 −11 ch05/jquery.tmpl/jquery.tmplPlus.min.js
  65. +0 −396 ch05/jquery.tmpl/tests/core.js
  66. +0 −22 ch05/jquery.tmpl/tests/index.html
  67. +0 −196 ch05/jquery.tmpl/tests/qunit.css
  68. +0 −1,364 ch05/jquery.tmpl/tests/qunit.js
  69. +3,737 −1,603 ch05/{examples → }/lib/jquery.js
  70. +50 −29 ch05/{examples → }/lib/jquery.tmpl.js
  71. +57 −0 ch05/model.html
  72. +84 −0 ch09/jasmine/class.js
  73. +1 −1 ch09/jasmine/index.html
  74. +0 −52 ch09/jasmine/klass.js
  75. +4 −4 ch09/jasmine/model.js
  76. +84 −0 ch09/qunit/class.js
  77. +1 −1 ch09/qunit/index.html
  78. +0 −52 ch09/qunit/klass.js
  79. +4 −4 ch09/qunit/model.js
  80. +3 −3 ch09/qunit/model.test.js
View
@@ -37,7 +37,7 @@
return object;
},
- inst: function(){
+ init: function(){
var instance = Object.create(this.prototype);
instance.parent = this;
instance.init.apply(instance, arguments);
@@ -76,7 +76,7 @@
this.records = {};
for (var i=0, il = values.length; i < il; i++) {
- var record = this.inst(values[i]);
+ var record = this.init(values[i]);
record.newRecord = false;
this.records[record.id] = record;
}
@@ -135,7 +135,7 @@
var Asset = Model.create("Asset");
var Person = Model.create("Person");
- var asset = Asset.inst();
+ var asset = Asset.init();
asset.load({one: 1});
</script>
View
@@ -41,7 +41,7 @@ Model.extend({
this.records = {};
for (var i=0, il = values.length; i < il; i++) {
- var record = this.inst(values[i]);
+ var record = this.init(values[i]);
record.newRecord = false;
this.records[record.id] = record;
}
@@ -109,7 +109,7 @@ Model.extend({
},
create: function(atts){
- var record = this.inst(atts);
+ var record = this.init(atts);
record.save();
return record;
},
View
@@ -1,38 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Linky</title>
- <script src="lib/jquery.js" type="text/javascript" charset="utf-8"></script>
- <script src="lib/jquery.tmpl.js" type="text/javascript" charset="utf-8"></script>
- <script src="../jquery.link.js" type="text/javascript" charset="utf-8"></script>
-
- <script type="text/javascript" charset="utf-8">
- jQuery(function($){
- var object = {
- name: "Test Name"
- };
-
- $("#user").link(object, function(e, data){
- $(this).empty();
- $(this).append($("#userTmpl").tmpl(data));
- });
-
- object.change();
-
- setTimeout(function(){
- object.name = "Test 2";
- object.change();
- }, 2000)
- });
- </script>
-</head>
-
-<body>
- <script id="userTmpl" type="text/x-jquery-tmpl" charset="utf-8">
- <span>${name}</span>
- </script>
-
- <div id="user">
- </div>
-</body>
-</html>
View
@@ -1,44 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Linky</title>
- <script src="lib/jquery.js" type="text/javascript" charset="utf-8"></script>
- <script src="lib/jquery.tmpl.js" type="text/javascript" charset="utf-8"></script>
- <script src="../jquery.link.js" type="text/javascript" charset="utf-8"></script>
-
- <script src="lib/klass.js" type="text/javascript" charset="utf-8"></script>
- <script src="lib/pubsub.js" type="text/javascript" charset="utf-8"></script>
- <script src="lib/model.js" type="text/javascript" charset="utf-8"></script>
- <script src="lib/model.link.js" type="text/javascript" charset="utf-8"></script>
-
- <script type="text/javascript" charset="utf-8">
- var User = Model.setup("User", ["name"]);
-
- User.populate([{name: "First one"}]);
-
- jQuery(function($){
- $("#users").link(User, function(){
- var template = $("#userTmpl").tmpl(User.all());
-
- $(this).empty();
- $(this).append(template);
- });
-
- User.change();
-
- setTimeout(function(){
- User.create({name: "Another one"});
- }, 2000);
- });
- </script>
-</head>
-
-<body>
- <script id="userTmpl" type="text/x-jquery-tmpl">
- <li>${name}</li>
- </script>
-
- <ul id="users">
- </ul>
-</body>
-</html>
View
@@ -1,42 +0,0 @@
-<!DOCTYPE html>
-<html>
-<head>
- <title>Linky</title>
- <script src="lib/jquery.js" type="text/javascript" charset="utf-8"></script>
- <script src="lib/jquery.tmpl.js" type="text/javascript" charset="utf-8"></script>
- <script src="../jquery.link.js" type="text/javascript" charset="utf-8"></script>
-
- <script type="text/javascript" charset="utf-8">
- jQuery(function($){
- var objects = [{
- name: "Test Name"
- }];
-
- $.addChange(objects);
-
- var element = $("#users");
-
- objects.change(function(){
- element.empty();
- element.append($("#userTmpl").tmpl(this));
- });
-
- objects.change();
-
- setTimeout(function(){
- objects.push({name: "Another one"});
- objects.change();
- }, 2000)
- });
- </script>
-</head>
-
-<body>
- <script id="userTmpl" type="text/x-jquery-tmpl" charset="utf-8">
- <div>${name}</div>
- </script>
-
- <div id="users">
- </div>
-</body>
-</html>
View
@@ -1,63 +0,0 @@
-if (typeof Object.create !== "function")
- Object.create = function(o) {
- function F() {}
- F.prototype = o;
- return new F();
- };
-
-var Klass = {
- init: function(){},
-
- prototype: {
- init: function(){}
- },
-
- create: function(){
- var object = Object.create(this);
- object.parent = this;
- object.init.apply(object, arguments);
- return object;
- },
-
- inst: function(){
- var instance = Object.create(this.prototype);
- instance.parent = this;
- instance.init.apply(instance, arguments);
- return instance;
- },
-
- proxy: function(func){
- var thisObject = this;
- return(function(){
- return func.apply(thisObject, arguments);
- });
- },
-
- include: function(obj){
- var included = obj.included || obj.setup;
-
- delete obj.included;
- delete obj.extended;
- delete obj.setup;
-
- for(var i in obj)
- this.fn[i] = obj[i];
- if (included) included.apply(this);
- },
-
- extend: function(obj){
- var extended = obj.extended || obj.setup;
-
- delete obj.included;
- delete obj.extended;
- delete obj.setup;
-
- for(var i in obj)
- this[i] = obj[i];
- if (extended) extended.apply(this);
- delete extended;
- }
-};
-
-Klass.fn = Klass.prototype;
-Klass.fn.proxy = Klass.proxy;
Oops, something went wrong.

0 comments on commit e4b0dc7

Please sign in to comment.