Permalink
Browse files

Initial import

  • Loading branch information...
tdd committed Jul 22, 2010
0 parents commit 1ea81eee8e91b67ce10241c252ecb667ace00aa3
Showing with 12,098 additions and 0 deletions.
  1. +1 −0 .gitignore
  2. +13 −0 debugbench.html
  3. +5 −0 debugbench.js
  4. +16 −0 dojo.js
  5. +36 −0 dom/background.html
  6. +47 −0 dom/background.js
  7. +22 −0 dom/delegation.html
  8. +19 −0 dom/delegation.js
  9. +11 −0 ext-all.js
  10. +7 −0 ext-base.js
  11. +262 −0 form/autocompletion/autocomplete.php
  12. +12 −0 form/autocompletion/autocompletion.css
  13. +45 −0 form/autocompletion/autocompletion.js
  14. +31 −0 form/autocompletion/index.html
  15. BIN form/checklist/attachment.png
  16. +12 −0 form/checklist/checklist.css
  17. +19 −0 form/checklist/checklist.js
  18. +54 −0 form/checklist/index.html
  19. +37 −0 form/checklist/index_for_book.html
  20. +6 −0 form/feedback/feedback.css
  21. +39 −0 form/feedback/feedback.js
  22. +23 −0 form/feedback/index.html
  23. +27 −0 form/submit/index.html
  24. +31 −0 form/submit/post_comment.html
  25. +34 −0 form/submit/post_comment.php
  26. BIN form/submit/spinner.gif
  27. +7 −0 form/submit/submit.css
  28. +22 −0 form/submit/submit.js
  29. +53 −0 form/tooltips/index.html
  30. BIN form/tooltips/lightbulb.png
  31. +13 −0 form/tooltips/tooltips.css
  32. +18 −0 form/tooltips/tooltips.js
  33. +22 −0 form/uploads/index.html
  34. BIN form/uploads/page_white.png
  35. BIN form/uploads/page_word.png
  36. BIN form/uploads/picture.png
  37. BIN form/uploads/remove.png
  38. +12 −0 form/uploads/server.php
  39. +12 −0 form/uploads/uploads.css
  40. +33 −0 form/uploads/uploads.js
  41. +39 −0 form/validation101/index.html
  42. +30 −0 form/validation101/index_for_book.html
  43. +9 −0 form/validation101/validation101.css
  44. +21 −0 form/validation101/validation101.js
  45. +48 −0 form/validation102/index.html
  46. +15 −0 form/validation102/validation102.css
  47. +44 −0 form/validation102/validation102.js
  48. +7 −0 form/validation_ajax/check_login.php
  49. +55 −0 form/validation_ajax/index.html
  50. BIN form/validation_ajax/ko.png
  51. BIN form/validation_ajax/ok.png
  52. BIN form/validation_ajax/spinner.gif
  53. +22 −0 form/validation_ajax/validation_ajax.css
  54. +65 −0 form/validation_ajax/validation_ajax.js
  55. +19 −0 jquery-1.3.2.min.js
  56. +13 −0 mashups/flickr/flickr.css
  57. +35 −0 mashups/flickr/flickr.js
  58. +19 −0 mashups/flickr/index.html
  59. BIN mashups/flickr/spinner.gif
  60. +13 −0 mashups/geo/geo.css
  61. +73 −0 mashups/geo/geo.js
  62. +29 −0 mashups/geo/index.html
  63. +39 −0 mashups/geo/placemaker.js
  64. BIN mashups/geo/spinner.gif
  65. BIN mashups/twitter/calendar_empty.png
  66. +28 −0 mashups/twitter/index.html
  67. BIN mashups/twitter/spinner.gif
  68. +41 −0 mashups/twitter/twitter.css
  69. +84 −0 mashups/twitter/twitter.js
  70. +356 −0 mootools-1.2.3-core-yc.js
  71. +6,001 −0 prototype.js
  72. +963 −0 scripty181/controls.js
  73. +1,120 −0 scripty181/effects.js
  74. +3 −0 server/crossdomain1/crossdomain1.css
  75. +48 −0 server/crossdomain1/crossdomain1.js
  76. +29 −0 server/crossdomain1/index.html
  77. +5 −0 server/crossdomain1/ssp.php
  78. +22 −0 server/crossdomain1/xdr_response.php
  79. +1 −0 server/crossdomain1/xdr_response_df1.php
  80. +3 −0 server/crossdomain1/xdr_response_df2.php
  81. +3 −0 server/crossdomain2/crossdomain2.css
  82. +65 −0 server/crossdomain2/crossdomain2.js
  83. +9 −0 server/crossdomain2/csshttprequest.min.js
  84. +28 −0 server/crossdomain2/index.html
  85. +26 −0 server/crossdomain2/xdr_response_chr.php
  86. +12 −0 server/crossdomain2/xdr_response_jsonp.php
  87. +41 −0 server/json/index.html
  88. +10 −0 server/json/json.css
  89. +20 −0 server/json/json.js
  90. +18 −0 server/json/json_response.php
  91. +39 −0 server/jsonp/index.html
  92. +18 −0 server/jsonp/json_response.php
  93. +10 −0 server/jsonp/jsonp.css
  94. +36 −0 server/jsonp/jsonp.js
  95. +7 −0 server/jsonp/postdemo.php
  96. +40 −0 testbench.html
  97. +42 −0 ui/infinite/index.html
  98. +5 −0 ui/infinite/infinite.css
  99. +32 −0 ui/infinite/infinite.js
  100. +14 −0 ui/infinite/more.html
  101. +17 −0 ui/infinite/more.php
  102. BIN ui/infinite/spinner.gif
  103. BIN ui/lightbox/beach.jpg
  104. BIN ui/lightbox/beach_normal.jpg
  105. BIN ui/lightbox/feline.jpg
  106. BIN ui/lightbox/feline_normal.jpg
  107. BIN ui/lightbox/fruits.jpg
  108. BIN ui/lightbox/fruits_normal.jpg
  109. +70 −0 ui/lightbox/index.html
  110. +14 −0 ui/lightbox/lightbox.css
  111. +5 −0 ui/lightbox/lightbox.js
  112. BIN ui/lightbox/river.jpg
  113. BIN ui/lightbox/river_normal.jpg
  114. BIN ui/lightbox/vendor/fancybox/fancy_closebox.png
  115. BIN ui/lightbox/vendor/fancybox/fancy_left.png
  116. BIN ui/lightbox/vendor/fancybox/fancy_progress.png
  117. BIN ui/lightbox/vendor/fancybox/fancy_right.png
  118. BIN ui/lightbox/vendor/fancybox/fancy_shadow_e.png
  119. BIN ui/lightbox/vendor/fancybox/fancy_shadow_n.png
  120. BIN ui/lightbox/vendor/fancybox/fancy_shadow_ne.png
  121. BIN ui/lightbox/vendor/fancybox/fancy_shadow_nw.png
  122. BIN ui/lightbox/vendor/fancybox/fancy_shadow_s.png
  123. BIN ui/lightbox/vendor/fancybox/fancy_shadow_se.png
  124. BIN ui/lightbox/vendor/fancybox/fancy_shadow_sw.png
  125. BIN ui/lightbox/vendor/fancybox/fancy_shadow_w.png
  126. BIN ui/lightbox/vendor/fancybox/fancy_title_left.png
  127. BIN ui/lightbox/vendor/fancybox/fancy_title_main.png
  128. BIN ui/lightbox/vendor/fancybox/fancy_title_right.png
  129. +283 −0 ui/lightbox/vendor/fancybox/jquery.fancybox-1.2.6.css
  130. +620 −0 ui/lightbox/vendor/fancybox/jquery.fancybox-1.2.6.js
  131. +16 −0 ui/lightbox/vendor/fancybox/jquery.fancybox-1.2.6.pack.js
  132. +19 −0 ui/lightbox/vendor/jquery-1.3.2.min.js
  133. +20 −0 ui/popups/index.html
  134. 0 ui/popups/popups.css
  135. +16 −0 ui/popups/popups.js
  136. BIN ui/preloading/cppsu.jpg
  137. BIN ui/preloading/cppsu_closeup.jpg
  138. +26 −0 ui/preloading/index.html
  139. +11 −0 ui/preloading/preloading.css
  140. +27 −0 ui/preloading/preloading.js
  141. BIN ui/preloading/vsscala.jpg
  142. BIN ui/preloading/vsscala_closeup.jpg
  143. BIN ui/tooltips/bg_tooltip.png
  144. +42 −0 ui/tooltips/index.html
  145. +29 −0 ui/tooltips/tooltips.css
  146. +19 −0 ui/tooltips/tooltips.js
  147. +40 −0 ui/viewport/index.html
  148. +15 −0 ui/viewport/known_comments.html
  149. +2 −0 ui/viewport/viewport.css
  150. +22 −0 ui/viewport/viewport.js
  151. +10 −0 yui-min.js
@@ -0,0 +1 @@
+.svn
@@ -0,0 +1,13 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <script type="text/javascript" src="debugbench.js"></script>
+ <title>Pocket JavaScript debug bench</title>
+</head>
+<body>
+ <h1>Debug bench</h1>
+ <input type="button" onclick="alert(fibo(20))" value="Fibo(20)" />
+</body>
+</html>
@@ -0,0 +1,5 @@
+function fibo(base) {
+ if (base <= 2)
+ return 1;
+ return fibo(base - 1) + fibo(base - 2);
+}
16 dojo.js

Large diffs are not rendered by default.

Oops, something went wrong.
@@ -0,0 +1,36 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <script type="text/javascript" src="../prototype.js"></script>
+ <script type="text/javascript" src="background.js"></script>
+ <title>Simulating background processing - Pocket JavaScript</title>
+ <style type="text/css">
+ #progress {
+ border: 2px solid gray; text-align: center;
+ background: white; color: black; position: relative; width: 30em;
+ font-family: sans-serif;
+ }
+ #progress.over50 { color: white; }
+ #progress .visual {
+ position: absolute; left: 0; top: 0; height: 100%; width: 0;
+ background: green; z-index: 1;
+ }
+ #progress .figure { position: relative; z-index: 2; font-weight: bold; }
+ </style>
+</head>
+<body>
+<h1>Simulating background processing</h1>
+<!-- START:MAIN -->
+<p id="progress">
+ <span class="visual"></span>
+ <span class="figure">0%</span>
+</p>
+<p>
+ <input type="button" id="btnToggle" value="Toggle" />
+ <input type="button" id="btnOtherTask" value="Do some other stuff" />
+</p>
+<!-- END:MAIN -->
+</body>
+</html>
@@ -0,0 +1,47 @@
+(function() {
+ // START:MAIN
+ var CHUNK_INTERVAL = 25; // ms.
+ var running = false, progress = 0, processTimer;
+
+ function runChunk() {
+ window.clearTimeout(processTimer);
+ processTimer = null;
+ if (!running) return;
+ // Some work chunk. Let's simulate it:
+ for (var i = 0; i < 10000; i += (Math.random() * 5).round())
+ ;
+ ++progress;
+ updateUI(); // See source archive -- just updates a progressbar
+ if (progress < 100) {
+ processTimer = window.setTimeout(runChunk, CHUNK_INTERVAL);
+ } else {
+ progress = 0, running = false;
+ }
+ }
+
+ function toggleProcessing() {
+ running = !running;
+ if (running) {
+ processTimer = window.setTimeout(runChunk, CHUNK_INTERVAL);
+ }
+ }
+ // END:MAIN
+
+ var progressbar, visual, figure;
+
+ function updateUI() {
+ visual.setStyle('width: ' + progress + '%;');
+ progressbar[progress < 50 ? 'removeClassName' : 'addClassName']('over50');
+ figure.update(progress + '%');
+ }
+
+ document.observe('dom:loaded', function() {
+ $('btnToggle').observe('click', toggleProcessing);
+ $('btnOtherTask').observe('click', function() {
+ $$('h1').first().insert(', yeah');
+ });
+ progressbar = $('progress');
+ visual = progressbar.down('.visual');
+ figure = progressbar.down('.figure');
+ });
+})();
@@ -0,0 +1,22 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html>
+<head>
+ <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+ <script type="text/javascript" src="../prototype.js"></script>
+ <script type="text/javascript" src="delegation.js"></script>
+ <title>Leveraging event delegation - Pocket JavaScript</title>
+</head>
+<body>
+<h1>Leveraging event delegation</h1>
+<!-- START:MAIN -->
+<ul id="items">
+ <!-- We will insert togglers in each LI using JS -->
+ <li><div><p>Data 1</p><p>Data 2</p></div></li>
+ <li><div><p>Data 1</p><p>Data 2</p></div></li>
+ <li><div><p>Data 1</p><p>Data 2</p></div></li>
+ <!-- Potentially lots more elements here… -->
+</ul>
+<!-- END:MAIN -->
+</body>
+</html>
@@ -0,0 +1,19 @@
+document.observe('dom:loaded', function() {
+ // START:MAIN
+ $('items').observe('click', function(e) { // <label id="code.eventDelegation.observe" />
+ var trigger = e.findElement('a.toggler'); // <label id="code.eventDelegation.findElement" />
+ if (!trigger) return;
+ e.stop();
+ var content = trigger.up('p').next('div');
+ if (!content) return;
+ content.toggle();
+ trigger.update(content.visible() ? 'Close' : 'Open');
+ trigger.blur();
+ });
+
+ $('items').select('li').each(function(item) {
+ item.insert({ top: '<p><a class="toggler" href="#">Open</a></p>' });
+ item.down('div').hide();
+ });
+ // END:MAIN
+});

Large diffs are not rendered by default.

Oops, something went wrong.

Large diffs are not rendered by default.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit 1ea81ee

Please sign in to comment.