closure 1.4.3 → 1.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (70) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +12 -12
  3. data/closure-compiler/README.md +503 -0
  4. data/closure-compiler/compiler.jar +0 -0
  5. data/closure-templates/SoyToJsSrcCompiler.jar +0 -0
  6. data/closure-templates/soyutils.js +1593 -469
  7. data/closure-templates/soyutils_usegoog.js +1105 -223
  8. data/docs/SCRIPT.md +5 -5
  9. data/docs/closure/Closure/BeanShell.html +63 -54
  10. data/docs/closure/Closure/Compiler/Compilation.html +124 -107
  11. data/docs/closure/Closure/Compiler/Error.html +28 -21
  12. data/docs/closure/Closure/Compiler.html +81 -76
  13. data/docs/closure/Closure/FileResponse.html +113 -98
  14. data/docs/closure/Closure/Goog.html +264 -253
  15. data/docs/closure/Closure/Middleware.html +66 -55
  16. data/docs/closure/Closure/Script/NotFound.html +28 -21
  17. data/docs/closure/Closure/Script/RenderStackOverflow.html +28 -21
  18. data/docs/closure/Closure/Script.html +212 -203
  19. data/docs/closure/Closure/Server.html +100 -90
  20. data/docs/closure/Closure/ShowExceptions.html +63 -52
  21. data/docs/closure/Closure/Sources.html +254 -246
  22. data/docs/closure/Closure/Templates/Error.html +28 -21
  23. data/docs/closure/Closure/Templates.html +88 -80
  24. data/docs/closure/Closure.html +181 -163
  25. data/docs/closure/_index.html +42 -38
  26. data/docs/closure/class_list.html +19 -8
  27. data/docs/closure/css/full_list.css +4 -2
  28. data/docs/closure/css/style.css +68 -51
  29. data/docs/closure/file.LICENSE.html +24 -217
  30. data/docs/closure/file.README.html +54 -47
  31. data/docs/closure/file_list.html +20 -9
  32. data/docs/closure/frames.html +18 -5
  33. data/docs/closure/index.html +54 -47
  34. data/docs/closure/js/app.js +60 -46
  35. data/docs/closure/js/full_list.js +24 -10
  36. data/docs/closure/js/jquery.js +4 -16
  37. data/docs/closure/method_list.html +74 -175
  38. data/docs/closure/top-level-namespace.html +29 -20
  39. data/lib/closure/compiler.rb +32 -42
  40. data/lib/closure/goog.rb +12 -12
  41. data/lib/closure/server.rb +6 -6
  42. data/lib/closure/show_exceptions.rb +15 -12
  43. data/lib/closure/version.rb +1 -1
  44. data/scripts/git.erb +183 -0
  45. data/scripts/hello/compiler.js.erb +2 -2
  46. data/scripts/hello/hello.js +1 -1
  47. data/scripts/hello/index.erb +6 -0
  48. data/scripts/hello/legume.js +12 -7
  49. data/scripts/index.erb +15 -13
  50. data/scripts/modules/compiler.js.erb +3 -3
  51. data/scripts/modules/compiler_build.js +3 -3
  52. data/scripts/modules/compiler_build.map +13 -12159
  53. data/scripts/modules/compiler_build_api.js +1 -1
  54. data/scripts/modules/compiler_build_app.js +74 -71
  55. data/scripts/modules/compiler_build_settings.js +2 -2
  56. data/scripts/modules/index.erb +5 -3
  57. data/scripts/modules/settings.js +1 -1
  58. data/scripts/svn.erb +11 -11
  59. data/scripts/welcome.erb +7 -6
  60. metadata +65 -81
  61. data/closure-compiler/README +0 -292
  62. data/scripts/hello/compiler_build.js +0 -5
  63. data/scripts/hello/compiler_build.map +0 -748
  64. data/scripts/hello/compiler_debug.js +0 -119
  65. data/scripts/modules/compiler_debug.js +0 -6
  66. data/scripts/modules/compiler_debug_api.js +0 -11
  67. data/scripts/modules/compiler_debug_app.js +0 -2414
  68. data/scripts/modules/compiler_debug_settings.js +0 -39
  69. data/scripts/rails/index.erb +0 -46
  70. data/scripts/rails/rails_ujs.js +0 -96
@@ -1,39 +0,0 @@
1
- $goog$ui$Component$$.prototype.$getDomHelper$ = $JSCompiler_unstubMethod$$(2, $JSCompiler_get$$("$dom_$"));
2
- function $example$Settings$$($dom$$4$$) {
3
- $goog$ui$Component$$.call(this, $dom$$4$$)
4
- }
5
- $goog$inherits$$($example$Settings$$, $goog$ui$Component$$);
6
- $example$Settings$$.prototype.$createDom$ = function $$example$Settings$$$$$createDom$$() {
7
- $example$Settings$$.$superClass_$.$createDom$.call(this);
8
- this.$getElement$().innerHTML = "This is the settings component."
9
- };
10
- var $app$$ = $example$App$instance_$$, $child$$inline_578$$ = new $example$Settings$$($app$$.$getDomHelper$()), $index$$inline_579$$ = $app$$.$children_$ ? $app$$.$children_$.length : 0;
11
- $child$$inline_578$$.$inDocument_$ && $JSCompiler_alias_THROW$$(Error("Component already rendered"));
12
- ($index$$inline_579$$ < 0 || $index$$inline_579$$ > ($app$$.$children_$ ? $app$$.$children_$.length : 0)) && $JSCompiler_alias_THROW$$(Error("Child component index out of bounds"));
13
- if(!$app$$.$childIndex_$ || !$app$$.$children_$) {
14
- $app$$.$childIndex_$ = {}, $app$$.$children_$ = []
15
- }
16
- if($child$$inline_578$$.getParent() == $app$$) {
17
- var $key$$inline_580$$ = $child$$inline_578$$.$getId$();
18
- $app$$.$childIndex_$[$key$$inline_580$$] = $child$$inline_578$$;
19
- $goog$array$remove$$($app$$.$children_$, $child$$inline_578$$)
20
- }else {
21
- var $obj$$inline_581$$ = $app$$.$childIndex_$, $key$$inline_582$$ = $child$$inline_578$$.$getId$();
22
- $key$$inline_582$$ in $obj$$inline_581$$ && $JSCompiler_alias_THROW$$(Error('The object already contains the key "' + $key$$inline_582$$ + '"'));
23
- $obj$$inline_581$$[$key$$inline_582$$] = $child$$inline_578$$
24
- }
25
- $JSCompiler_StaticMethods_setParent$$($child$$inline_578$$, $app$$);
26
- (function($arr$$42$$, $index$$55$$, $howMany$$, $var_args$$35$$) {
27
- $goog$asserts$assert$$($arr$$42$$.length != $JSCompiler_alias_NULL$$);
28
- $goog$array$ARRAY_PROTOTYPE_$$.splice.apply($arr$$42$$, $goog$array$slice$$(arguments, 1))
29
- })($app$$.$children_$, $index$$inline_579$$, 0, $child$$inline_578$$);
30
- if($child$$inline_578$$.$inDocument_$ && $app$$.$inDocument_$ && $child$$inline_578$$.getParent() == $app$$) {
31
- var $contentElement$$inline_583$$ = $app$$.$element_$;
32
- $contentElement$$inline_583$$.insertBefore($child$$inline_578$$.$getElement$(), $contentElement$$inline_583$$.childNodes[$index$$inline_579$$] || $JSCompiler_alias_NULL$$)
33
- }else {
34
- $app$$.$element_$ || $app$$.$createDom$();
35
- var $sibling$$inline_584$$ = $app$$.$children_$ ? $app$$.$children_$[$index$$inline_579$$ + 1] || $JSCompiler_alias_NULL$$ : $JSCompiler_alias_NULL$$;
36
- $JSCompiler_StaticMethods_render_$$($child$$inline_578$$, $app$$.$element_$, $sibling$$inline_584$$ ? $sibling$$inline_584$$.$element_$ : $JSCompiler_alias_NULL$$)
37
- }
38
- $JSCompiler_StaticMethods_setLoaded$$($goog$module$ModuleManager$$.$getInstance$(), "settings");
39
-
@@ -1,46 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <style type="text/css" media="screen">
5
- body{font:13px/1.231 arial,helvetica,clean,sans-serif;*font-size:small;*font:x-small;}
6
- select,input,button,textarea,button{font:99% arial,helvetica,clean,sans-serif;}
7
- </style>
8
- <meta content='authenticity_token' name='csrf-param'>
9
- <meta content='cf50faa3fe97702ca1ael=?' name='csrf-token'>
10
- <script src='<%= goog.base_js %>'></script>
11
- <script type='text/javascript'>
12
- //<![CDATA[
13
- goog.require('rails.ujs');
14
- //]]>
15
- </script>
16
- </head>
17
- <body>
18
- <h1>Closure on Rails 3</h1>
19
-
20
- <p>
21
- These examples demonstrate how to implement<br />
22
- the unobtrusive techniques expected by Rails 3.
23
- </p>
24
-
25
- <ul>
26
- <li>
27
- <a data-confirm='Are you sure?' href='?'>a data-confirm</a>
28
- </li>
29
- <li>
30
- <a data-remote='true' href='?'>a data-remote</a>
31
- </li>
32
- <li>
33
- <a data-method='DELETE' href='?'>a data-method</a>
34
- </li>
35
- <li>
36
- <a data-confirm='Seriously?' data-remote='true' href='?'>a data-confirm data-remote</a>
37
- </li>
38
- <li>
39
- <form action='?' data-remote='true' method='post'>
40
- <input class='text' name='name' type='text'>
41
- <input class='button' type='submit' value='Send'>
42
- </form>
43
- </li>
44
- </ul>
45
- </body>
46
- </html>
@@ -1,96 +0,0 @@
1
- goog.provide('rails.ujs');
2
-
3
- goog.require('goog.events');
4
- goog.require('goog.dom');
5
- goog.require('goog.dom.forms');
6
- goog.require('goog.net.XhrIo');
7
-
8
-
9
- goog.events.listen(document, 'click', function(e) {
10
- if (e.target.hasAttribute('data-confirm')) {
11
- if (!confirm(e.target.getAttribute('data-confirm'))) {
12
- e.preventDefault();
13
- e.stopPropagation();
14
- }
15
- }
16
- }, true);
17
-
18
- goog.events.listen(document, 'click', function(e) {
19
- if (e.target.hasAttribute('data-remote')) {
20
- e.preventDefault();
21
- rails.ujs.handleRemote(e.target);
22
- } else if (e.target.hasAttribute('data-method')) {
23
- e.preventDefault();
24
- rails.ujs.handleMethod(e.target);
25
- }
26
- }, false);
27
-
28
- goog.events.listen(document, 'submit', function(e) {
29
- if (e.target.hasAttribute('data-remote')) {
30
- e.preventDefault();
31
- rails.ujs.handleRemote(e.target);
32
- }
33
- }, true);
34
-
35
-
36
- rails.ujs.dispatchEvent = function(el, type) {
37
- var evObj = document.createEvent('Event');
38
- evObj.initEvent(type, true, true);
39
- el.dispatchEvent(evObj);
40
- }
41
-
42
-
43
- rails.ujs.handleRemote = function(el) {
44
- var data, method, url;
45
- if (el.nodeName == goog.dom.TagName.FORM) {
46
- data = goog.dom.forms.getFormDataString(el)
47
- method = el.getAttribute('method') || 'POST';
48
- url = el.getAttribute('action');
49
- } else {
50
- method = el.getAttribute('data-method') || 'GET';
51
- url = el.getAttribute('href');
52
- }
53
- var xhr = new goog.net.XhrIo();
54
- xhr.onreadystatechange = function() {
55
- if (xhr.readyState == goog.net.XmlHttp.ReadyState.COMPLETE) {
56
- goog.events.dispatchEvent(el, new goog.events.Event('ajax:complete'));
57
- };
58
- };
59
- xhr.send(url, method.toUpperCase(), data);
60
- if (xhr.isSuccess()) {
61
- goog.events.dispatchEvent(el, new goog.events.Event('ajax:success'));
62
- } else {
63
- goog.events.dispatchEvent(el, new goog.events.Event('ajax:failure'));
64
- };
65
- }
66
-
67
-
68
- rails.ujs.handleMethod = function(element) {
69
- var method = element.getAttribute('data-method').toLowerCase();
70
- var url = element.getAttribute('href');
71
- var form = goog.dom.createDom('form', { method: "POST", action: url, style: "display: none;" })
72
- goog.dom.appendChild(element, form)
73
- if (method !== 'post') {
74
- goog.dom.appendChild(form,
75
- goog.dom.createDom('input', { type: 'hidden', name: '_method', value: method })
76
- )
77
- }
78
- var csrf_param, csrf_token;
79
- goog.array.forEach(
80
- goog.dom.getElementsByTagNameAndClass('meta'),
81
- function(e) {
82
- var name = e.getAttribute('name')
83
- if (name == 'csrf-param') {
84
- csrf_param = e.getAttribute('content')
85
- } else if (name == 'csrf-token') {
86
- csrf_token = e.getAttribute('content')
87
- }
88
- }
89
- );
90
- if (csrf_param) {
91
- goog.dom.appendChild(form,
92
- goog.dom.createDom('input', { type: 'hidden', name: csrf_param, value: csrf_token })
93
- );
94
- }
95
- form.submit();
96
- }