harmony 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (111) hide show
  1. data/Manifest +0 -104
  2. data/README.md +7 -1
  3. data/harmony.gemspec +2 -1
  4. data/lib/harmony.rb +1 -1
  5. data/lib/harmony/page.rb +8 -7
  6. data/test/page_test.rb +28 -0
  7. metadata +13 -107
  8. data/vendor/README +0 -1
  9. data/vendor/envjs/README +0 -36
  10. data/vendor/envjs/bin/envjsrb +0 -255
  11. data/vendor/envjs/bin/jquery-1.2.6-test.js +0 -33
  12. data/vendor/envjs/bin/jquery-1.3.1-test.js +0 -33
  13. data/vendor/envjs/bin/jquery-1.3.2-test.js +0 -106
  14. data/vendor/envjs/bin/prototype-1.6.0.3-test.js +0 -82
  15. data/vendor/envjs/bin/prototype_1.6.0.3_tmpl.txt +0 -27
  16. data/vendor/envjs/bin/test-jquery.sh +0 -58
  17. data/vendor/envjs/bin/test-prototype.sh +0 -54
  18. data/vendor/envjs/bin/tidy +0 -0
  19. data/vendor/envjs/lib/envjs.rb +0 -23
  20. data/vendor/envjs/lib/envjs/env.js +0 -21665
  21. data/vendor/envjs/lib/envjs/net.rb +0 -3
  22. data/vendor/envjs/lib/envjs/net/cgi.rb +0 -94
  23. data/vendor/envjs/lib/envjs/net/file.rb +0 -75
  24. data/vendor/envjs/lib/envjs/options.rb +0 -11
  25. data/vendor/envjs/lib/envjs/runtime.rb +0 -351
  26. data/vendor/envjs/lib/envjs/tempfile.rb +0 -24
  27. data/vendor/envjs/test/base64.js +0 -80
  28. data/vendor/envjs/test/call-load-test.js +0 -15
  29. data/vendor/envjs/test/data.js +0 -45
  30. data/vendor/envjs/test/debug.js +0 -53
  31. data/vendor/envjs/test/firebug/errorIcon.png +0 -0
  32. data/vendor/envjs/test/firebug/firebug.css +0 -209
  33. data/vendor/envjs/test/firebug/firebug.html +0 -23
  34. data/vendor/envjs/test/firebug/firebug.js +0 -672
  35. data/vendor/envjs/test/firebug/firebugx.js +0 -10
  36. data/vendor/envjs/test/firebug/infoIcon.png +0 -0
  37. data/vendor/envjs/test/firebug/warningIcon.png +0 -0
  38. data/vendor/envjs/test/fixtures/html/events.html +0 -171
  39. data/vendor/envjs/test/fixtures/html/iframe1.html +0 -46
  40. data/vendor/envjs/test/fixtures/html/iframe1a.html +0 -46
  41. data/vendor/envjs/test/fixtures/html/iframe2.html +0 -45
  42. data/vendor/envjs/test/fixtures/html/iframe3.html +0 -28
  43. data/vendor/envjs/test/fixtures/html/iframeN.html +0 -57
  44. data/vendor/envjs/test/fixtures/html/malformed.html +0 -181
  45. data/vendor/envjs/test/fixtures/html/scope.html +0 -81
  46. data/vendor/envjs/test/fixtures/html/trivial.html +0 -19
  47. data/vendor/envjs/test/fixtures/html/with_js.html +0 -26
  48. data/vendor/envjs/test/fixtures/images/icon-blue.png +0 -0
  49. data/vendor/envjs/test/fixtures/js/external_script.js +0 -1
  50. data/vendor/envjs/test/fixtures/js/script.js +0 -1
  51. data/vendor/envjs/test/fixtures/js/script_error.js +0 -2
  52. data/vendor/envjs/test/html/events.html +0 -171
  53. data/vendor/envjs/test/html/iframe1.html +0 -46
  54. data/vendor/envjs/test/html/iframe1a.html +0 -46
  55. data/vendor/envjs/test/html/iframe2.html +0 -45
  56. data/vendor/envjs/test/html/iframe3.html +0 -30
  57. data/vendor/envjs/test/html/iframeN.html +0 -57
  58. data/vendor/envjs/test/html/malformed.html +0 -181
  59. data/vendor/envjs/test/html/scope.html +0 -87
  60. data/vendor/envjs/test/html/script.js +0 -1
  61. data/vendor/envjs/test/html/trivial.html +0 -19
  62. data/vendor/envjs/test/html/with_js.html +0 -26
  63. data/vendor/envjs/test/index.html +0 -328
  64. data/vendor/envjs/test/java-prototype.js +0 -9
  65. data/vendor/envjs/test/primary-tests.js +0 -24
  66. data/vendor/envjs/test/prototype-test.js +0 -13
  67. data/vendor/envjs/test/qunit.js +0 -61
  68. data/vendor/envjs/test/qunit/qunit/qunit.css +0 -17
  69. data/vendor/envjs/test/qunit/qunit/qunit.js +0 -997
  70. data/vendor/envjs/test/scope.rb +0 -25
  71. data/vendor/envjs/test/specs/dist/env.spec.js +0 -1534
  72. data/vendor/envjs/test/specs/envjs.spec.css +0 -46
  73. data/vendor/envjs/test/specs/parser/html.js +0 -31
  74. data/vendor/envjs/test/specs/parser/spec.html +0 -40
  75. data/vendor/envjs/test/specs/parser/xml.js +0 -31
  76. data/vendor/envjs/test/specs/qunit.bdd.js +0 -210
  77. data/vendor/envjs/test/specs/qunit.css +0 -17
  78. data/vendor/envjs/test/specs/qunit.js +0 -997
  79. data/vendor/envjs/test/specs/template/spec-0.js +0 -31
  80. data/vendor/envjs/test/specs/template/spec-1.js +0 -31
  81. data/vendor/envjs/test/specs/template/spec.html +0 -40
  82. data/vendor/envjs/test/specs/window/css.js +0 -23
  83. data/vendor/envjs/test/specs/window/dialog.js +0 -25
  84. data/vendor/envjs/test/specs/window/document.js +0 -23
  85. data/vendor/envjs/test/specs/window/event.js +0 -25
  86. data/vendor/envjs/test/specs/window/history.js +0 -34
  87. data/vendor/envjs/test/specs/window/location.js +0 -34
  88. data/vendor/envjs/test/specs/window/navigator.js +0 -71
  89. data/vendor/envjs/test/specs/window/screen.js +0 -42
  90. data/vendor/envjs/test/specs/window/spec.html +0 -48
  91. data/vendor/envjs/test/specs/window/timer.js +0 -26
  92. data/vendor/envjs/test/specs/window/window.js +0 -53
  93. data/vendor/envjs/test/specs/xhr/spec.html +0 -47
  94. data/vendor/envjs/test/specs/xhr/xhr.js +0 -31
  95. data/vendor/envjs/test/test.js +0 -10
  96. data/vendor/envjs/test/unit/dom.js +0 -44
  97. data/vendor/envjs/test/unit/elementmembers.js +0 -60
  98. data/vendor/envjs/test/unit/events.js +0 -195
  99. data/vendor/envjs/test/unit/fixtures/external_script.js +0 -1
  100. data/vendor/envjs/test/unit/iframe.js +0 -234
  101. data/vendor/envjs/test/unit/multi-window.js +0 -212
  102. data/vendor/envjs/test/unit/nu.validator.js +0 -34
  103. data/vendor/envjs/test/unit/onload.js +0 -90
  104. data/vendor/envjs/test/unit/parser.js +0 -121
  105. data/vendor/envjs/test/unit/prototypecompat.js +0 -22
  106. data/vendor/envjs/test/unit/proxy.js +0 -6
  107. data/vendor/envjs/test/unit/scope.js +0 -209
  108. data/vendor/envjs/test/unit/timer.js +0 -115
  109. data/vendor/envjs/test/unit/window.js +0 -41
  110. data/vendor/envjs/test/vendor/jQuery/README +0 -2
  111. data/vendor/envjs/test/vendor/prototype-1.6.0.3.js +0 -4320
@@ -1,24 +0,0 @@
1
- require 'tempfile'
2
-
3
- require 'envjs'
4
-
5
- class Envjs::TempFile < Tempfile
6
-
7
- def initialize pattern, suffix = nil
8
- super(pattern)
9
-
10
-
11
- if suffix
12
- new_path = path + "." + suffix
13
- File.link path, new_path
14
- File.unlink path
15
- # blah ... implementation specific ...
16
- @data[0] = @tmpname = new_path
17
- end
18
- end
19
-
20
- def getAbsolutePath
21
- path
22
- end
23
-
24
- end
@@ -1,80 +0,0 @@
1
- // This code was written by Tyler Akins and has been placed in the
2
- // public domain. It would be nice if you left this header intact.
3
- // Base64 code from Tyler Akins -- http://rumkin.com
4
-
5
- var Base64 = (function () {
6
- var keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
7
-
8
- var obj = {
9
- /**
10
- * Encodes a string in base64
11
- * @param {String} input The string to encode in base64.
12
- */
13
- encode: function (input) {
14
- var output = "";
15
- var chr1, chr2, chr3;
16
- var enc1, enc2, enc3, enc4;
17
- var i = 0;
18
-
19
- do {
20
- chr1 = input.charCodeAt(i++);
21
- chr2 = input.charCodeAt(i++);
22
- chr3 = input.charCodeAt(i++);
23
-
24
- enc1 = chr1 >> 2;
25
- enc2 = ((chr1 & 3) << 4) | (chr2 >> 4);
26
- enc3 = ((chr2 & 15) << 2) | (chr3 >> 6);
27
- enc4 = chr3 & 63;
28
-
29
- if (isNaN(chr2)) {
30
- enc3 = enc4 = 64;
31
- } else if (isNaN(chr3)) {
32
- enc4 = 64;
33
- }
34
-
35
- output = output + keyStr.charAt(enc1) + keyStr.charAt(enc2) +
36
- keyStr.charAt(enc3) + keyStr.charAt(enc4);
37
- } while (i < input.length);
38
-
39
- return output;
40
- },
41
-
42
- /**
43
- * Decodes a base64 string.
44
- * @param {String} input The string to decode.
45
- */
46
- decode: function (input) {
47
- var output = "";
48
- var chr1, chr2, chr3;
49
- var enc1, enc2, enc3, enc4;
50
- var i = 0;
51
-
52
- // remove all characters that are not A-Z, a-z, 0-9, +, /, or =
53
- input = input.replace(/[^A-Za-z0-9\+\/\=]/g, "");
54
-
55
- do {
56
- enc1 = keyStr.indexOf(input.charAt(i++));
57
- enc2 = keyStr.indexOf(input.charAt(i++));
58
- enc3 = keyStr.indexOf(input.charAt(i++));
59
- enc4 = keyStr.indexOf(input.charAt(i++));
60
-
61
- chr1 = (enc1 << 2) | (enc2 >> 4);
62
- chr2 = ((enc2 & 15) << 4) | (enc3 >> 2);
63
- chr3 = ((enc3 & 3) << 6) | enc4;
64
-
65
- output = output + String.fromCharCode(chr1);
66
-
67
- if (enc3 != 64) {
68
- output = output + String.fromCharCode(chr2);
69
- }
70
- if (enc4 != 64) {
71
- output = output + String.fromCharCode(chr3);
72
- }
73
- } while (i < input.length);
74
-
75
- return output;
76
- }
77
- };
78
-
79
- return obj;
80
- })();
@@ -1,15 +0,0 @@
1
- load("test/qunit.js");
2
-
3
- Envjs("test/index.html", {});
4
-
5
- test("'index.html' loaded correctly via 'Envjs()' call", function(){
6
- expect(1);
7
- try{ ok(document.getElementById('body').id == "body",
8
- "'index.html' page content available");
9
- }catch(e){print(e);}
10
- });
11
-
12
- test("window.location= following Envjs() initialization flagged as error",
13
- function(){
14
- expect(0);
15
- });
@@ -1,45 +0,0 @@
1
- #!/usr/bin/env envjsrb
2
- load('base64.js');
3
- inner = "<head><title>Hello, World from a data uri!</title></head><body></body>";
4
- doc = "<html>"+inner+"</html>";
5
- url_escaped = "data:text/html,"+escape(doc);
6
- base64 = "data:text/html;base64,"+Base64.encode(doc);
7
- debug(url_escaped);
8
- window.location = "about:blank";
9
- Envjs.wait();
10
- window.location = url_escaped;
11
- Envjs.wait();
12
- debug(window.document.documentElement.innerHTML);
13
- if(window.document.documentElement.innerHTML != inner){
14
- debug(window.document.documentElement.innerHTML);
15
- debug(inner);
16
- throw new Error(window.document.documentElement.innerHTML);
17
- }
18
- debug(base64);
19
- window.location = "about:blank";
20
- Envjs.wait();
21
- window.location = base64;
22
- Envjs.wait();
23
- debug(window.document.documentElement.innerHTML);
24
- if(window.document.documentElement.innerHTML != inner){
25
- throw new Error("b"+window.document.documentElement.innerHTML);
26
- }
27
- window.location = "about:blank";
28
- Envjs.wait();
29
- window.location = "data:,"+escape("Hello, World from a data uri!");
30
- Envjs.wait();
31
- debug(window.location+"");
32
- debug(window.document.documentElement.innerHTML);
33
- inner = "<head><title></title></head><body>Hello, World from a data uri!</body>";
34
- if(window.document.documentElement.innerHTML != inner){
35
- throw new Error("c"+window.document.documentElement.innerHTML);
36
- }
37
-
38
- /* not implemented yet ...
39
- w = open("about:blank");
40
- w.foo = 10;
41
- debug(w.foo);
42
- uri = "data:text/javascript;base64,"+"foo = 20;";
43
- w.load(uri);
44
- debug(w.foo);
45
- */
@@ -1,53 +0,0 @@
1
- // Init
2
- load("src/env.js");
3
- load("src/htmlparser.js");
4
-
5
- window.location = "test/index.html";
6
-
7
- window.onload = function(){
8
- load("test/testrunner.js");
9
- load("test/jquery.js");
10
-
11
- var depth = 0;
12
-
13
- function indent(){
14
- var str = "";
15
- for ( var i = 0; i < depth; i++ ) {
16
- str += " ";
17
- }
18
- return str;
19
- }
20
-
21
- function dump(name, args, ret){
22
- print(name + ": " + Array.prototype.slice.call(args) + " - Return: " + ret);
23
- }
24
-
25
- for ( var method in jQuery.fn ) (function(method){ if ( method != "init" ) {
26
- var old = jQuery.fn[method];
27
- jQuery.fn[method] = function(){
28
- print(indent() + method + ": " + Array.prototype.slice.call(arguments));
29
- depth++;
30
- var ret = old.apply(this, arguments);
31
- depth--;
32
- print(indent() + method + ": Return " + ret);
33
- return ret;
34
- };
35
- } })(method);
36
-
37
- for ( var method in jQuery ) (function(method){ if ( method != "prototype" && method != "fn" ) {
38
- var old = jQuery[method];
39
- jQuery[method] = function(){
40
- print(indent() + "$." + method + ": " + Array.prototype.slice.call(arguments));
41
- depth++;
42
- var ret = old.apply(this, arguments);
43
- depth--;
44
- print(indent() + "$." + method + ": Return " + ret);
45
- return ret;
46
- };
47
- } })(method);
48
-
49
- jQuery.prototype.toString = DOMNodeList.prototype.toString;
50
- Function.prototype.toString = function(){ return "function()"; };
51
-
52
- print("Ready.");
53
- };
@@ -1,209 +0,0 @@
1
-
2
- html, body {
3
- margin: 0;
4
- background: #FFFFFF;
5
- font-family: Lucida Grande, Tahoma, sans-serif;
6
- font-size: 11px;
7
- overflow: hidden;
8
- }
9
-
10
- a {
11
- text-decoration: none;
12
- }
13
-
14
- a:hover {
15
- text-decoration: underline;
16
- }
17
-
18
- .toolbar {
19
- height: 14px;
20
- border-top: 1px solid ThreeDHighlight;
21
- border-bottom: 1px solid ThreeDShadow;
22
- padding: 2px 6px;
23
- background: ThreeDFace;
24
- }
25
-
26
- .toolbarRight {
27
- position: absolute;
28
- top: 4px;
29
- right: 6px;
30
- }
31
-
32
- #log {
33
- overflow: auto;
34
- position: absolute;
35
- left: 0;
36
- width: 100%;
37
- }
38
-
39
- #commandLine {
40
- position: absolute;
41
- bottom: 0;
42
- left: 0;
43
- width: 100%;
44
- height: 18px;
45
- border: none;
46
- border-top: 1px solid ThreeDShadow;
47
- }
48
-
49
- /************************************************************************************************/
50
-
51
- .logRow {
52
- position: relative;
53
- border-bottom: 1px solid #D7D7D7;
54
- padding: 2px 4px 1px 6px;
55
- background-color: #FFFFFF;
56
- }
57
-
58
- .logRow-command {
59
- font-family: Monaco, monospace;
60
- color: blue;
61
- }
62
-
63
- .objectBox-null {
64
- padding: 0 2px;
65
- border: 1px solid #666666;
66
- background-color: #888888;
67
- color: #FFFFFF;
68
- }
69
-
70
- .objectBox-string {
71
- font-family: Monaco, monospace;
72
- color: red;
73
- white-space: pre;
74
- }
75
-
76
- .objectBox-number {
77
- color: #000088;
78
- }
79
-
80
- .objectBox-function {
81
- font-family: Monaco, monospace;
82
- color: DarkGreen;
83
- }
84
-
85
- .objectBox-object {
86
- color: DarkGreen;
87
- font-weight: bold;
88
- }
89
-
90
- /************************************************************************************************/
91
-
92
- .logRow-info,
93
- .logRow-error,
94
- .logRow-warning {
95
- background: #FFFFFF no-repeat 2px 2px;
96
- padding-left: 20px;
97
- padding-bottom: 3px;
98
- }
99
-
100
- .logRow-info {
101
- background-image: url(infoIcon.png);
102
- }
103
-
104
- .logRow-warning {
105
- background-color: cyan;
106
- background-image: url(warningIcon.png);
107
- }
108
-
109
- .logRow-error {
110
- background-color: LightYellow;
111
- background-image: url(errorIcon.png);
112
- }
113
-
114
- .errorMessage {
115
- vertical-align: top;
116
- color: #FF0000;
117
- }
118
-
119
- .objectBox-sourceLink {
120
- position: absolute;
121
- right: 4px;
122
- top: 2px;
123
- padding-left: 8px;
124
- font-family: Lucida Grande, sans-serif;
125
- font-weight: bold;
126
- color: #0000FF;
127
- }
128
-
129
- /************************************************************************************************/
130
-
131
- .logRow-group {
132
- background: #EEEEEE;
133
- border-bottom: none;
134
- }
135
-
136
- .logGroup {
137
- background: #EEEEEE;
138
- }
139
-
140
- .logGroupBox {
141
- margin-left: 24px;
142
- border-top: 1px solid #D7D7D7;
143
- border-left: 1px solid #D7D7D7;
144
- }
145
-
146
- /************************************************************************************************/
147
-
148
- .selectorTag,
149
- .selectorId,
150
- .selectorClass {
151
- font-family: Monaco, monospace;
152
- font-weight: normal;
153
- }
154
-
155
- .selectorTag {
156
- color: #0000FF;
157
- }
158
-
159
- .selectorId {
160
- color: DarkBlue;
161
- }
162
-
163
- .selectorClass {
164
- color: red;
165
- }
166
-
167
- /************************************************************************************************/
168
-
169
- .objectBox-element {
170
- font-family: Monaco, monospace;
171
- color: #000088;
172
- }
173
-
174
- .nodeChildren {
175
- margin-left: 16px;
176
- }
177
-
178
- .nodeTag {
179
- color: blue;
180
- }
181
-
182
- .nodeValue {
183
- color: #FF0000;
184
- font-weight: normal;
185
- }
186
-
187
- .nodeText,
188
- .nodeComment {
189
- margin: 0 2px;
190
- vertical-align: top;
191
- }
192
-
193
- .nodeText {
194
- color: #333333;
195
- }
196
-
197
- .nodeComment {
198
- color: DarkGreen;
199
- }
200
-
201
- /************************************************************************************************/
202
-
203
- .propertyNameCell {
204
- vertical-align: top;
205
- }
206
-
207
- .propertyName {
208
- font-weight: bold;
209
- }
@@ -1,23 +0,0 @@
1
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
2
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3
-
4
- <html xmlns="http://www.w3.org/1999/xhtml">
5
-
6
- <head>
7
- <title>Firebug</title>
8
- <link rel="stylesheet" type="text/css" href="firebug.css">
9
- </head>
10
-
11
- <body>
12
- <div id="toolbar" class="toolbar">
13
- <a href="#" onclick="parent.console.clear()">Clear</a>
14
- <span class="toolbarRight">
15
- <a href="#" onclick="parent.console.close()">Close</a>
16
- </span>
17
- </div>
18
- <div id="log"></div>
19
- <input type="text" id="commandLine">
20
-
21
- <script>parent.onFirebugReady(document);</script>
22
- </body>
23
- </html>