smparkes-envjs 0.0.9 → 0.0.10
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/envjsrb +157 -73
- data/bin/jquery-1.3.2-test.js +11 -4
- data/lib/envjs/env.js +935 -11028
- data/lib/envjs/net/cgi.rb +94 -0
- data/lib/envjs/net/file.rb +4 -4
- data/lib/envjs/runtime.rb +80 -24
- data/test/call-load-test.js +0 -2
- data/test/firebug/errorIcon.png +0 -0
- data/test/firebug/firebug.css +209 -0
- data/test/firebug/firebug.html +23 -0
- data/test/firebug/firebug.js +672 -0
- data/test/firebug/firebugx.js +10 -0
- data/test/firebug/infoIcon.png +0 -0
- data/test/firebug/warningIcon.png +0 -0
- data/test/fixtures/html/events.html +171 -0
- data/test/fixtures/html/iframe1.html +46 -0
- data/test/fixtures/html/iframe1a.html +46 -0
- data/test/fixtures/html/iframe2.html +45 -0
- data/test/fixtures/html/iframe3.html +28 -0
- data/test/fixtures/html/iframeN.html +57 -0
- data/test/fixtures/html/malformed.html +181 -0
- data/test/fixtures/html/scope.html +81 -0
- data/test/fixtures/html/trivial.html +19 -0
- data/test/fixtures/html/with_js.html +26 -0
- data/test/fixtures/images/icon-blue.png +0 -0
- data/test/fixtures/js/external_script.js +1 -0
- data/test/fixtures/js/script.js +1 -0
- data/test/fixtures/js/script_error.js +2 -0
- data/test/html/malformed.html +1 -0
- data/test/index.html +21 -19
- data/test/{primaryTests.js → primary-tests.js} +1 -3
- data/test/{prototype.js → prototype-test.js} +0 -2
- data/test/qunit/qunit/qunit.css +0 -0
- data/test/qunit/qunit/qunit.js +2 -2
- data/test/{qunit/qunit/qunit.js.smp → specs/dist/env.spec.js} +539 -7
- data/test/specs/envjs.spec.css +46 -0
- data/test/specs/parser/html.js +31 -0
- data/test/specs/parser/spec.html +40 -0
- data/test/specs/parser/xml.js +31 -0
- data/test/specs/qunit.bdd.js +210 -0
- data/test/{qunit.smp/qunit → specs}/qunit.css +0 -0
- data/test/{qunit.smp/qunit → specs}/qunit.js +2 -2
- data/test/specs/template/spec-0.js +31 -0
- data/test/specs/template/spec-1.js +31 -0
- data/test/specs/template/spec.html +40 -0
- data/test/specs/window/css.js +23 -0
- data/test/specs/window/dialog.js +25 -0
- data/test/specs/window/document.js +23 -0
- data/test/specs/window/event.js +25 -0
- data/test/specs/window/history.js +34 -0
- data/test/specs/window/location.js +34 -0
- data/test/specs/window/navigator.js +71 -0
- data/test/specs/window/screen.js +42 -0
- data/test/specs/window/spec.html +48 -0
- data/test/specs/window/timer.js +26 -0
- data/test/specs/window/window.js +53 -0
- data/test/specs/xhr/spec.html +47 -0
- data/test/specs/xhr/xhr.js +31 -0
- data/test/test.js +10 -0
- data/test/unit/elementmembers.js +31 -0
- data/test/unit/nu.validator.js +34 -0
- data/test/unit/onload.js +1 -3
- data/test/unit/parser.js +106 -98
- data/test/unit/prototypecompat.js +2 -2
- data/test/vendor/jQuery/1.3.2/ChangeLog.txt +98 -0
- data/test/vendor/jQuery/1.3.2/GPL-LICENSE.txt +278 -0
- data/test/vendor/jQuery/1.3.2/MIT-LICENSE.txt +20 -0
- data/test/vendor/jQuery/1.3.2/Makefile +154 -0
- data/test/vendor/jQuery/1.3.2/README +67 -0
- data/test/vendor/jQuery/1.3.2/build/ant-contrib-0.6.jar +0 -0
- data/test/vendor/jQuery/1.3.2/build/build/min.js +11 -0
- data/test/vendor/jQuery/1.3.2/build/build/pack.js +19 -0
- data/test/vendor/jQuery/1.3.2/build/js/Packer.js +209 -0
- data/test/vendor/jQuery/1.3.2/build/js/ParseMaster.js +106 -0
- data/test/vendor/jQuery/1.3.2/build/js/Words.js +62 -0
- data/test/vendor/jQuery/1.3.2/build/js/base2.js +978 -0
- data/test/vendor/jQuery/1.3.2/build/js/jsmin.js +316 -0
- data/test/vendor/jQuery/1.3.2/build/js/json.js +117 -0
- data/test/vendor/jQuery/1.3.2/build/js/pack.js +316 -0
- data/test/vendor/jQuery/1.3.2/build/js/parse.js +105 -0
- data/test/vendor/jQuery/1.3.2/build/js/writeFile.js +19 -0
- data/test/vendor/jQuery/1.3.2/build/js/xml.js +25 -0
- data/test/vendor/jQuery/1.3.2/build/js.jar +0 -0
- data/test/vendor/jQuery/1.3.2/build/runtest/env.js +1 -0
- data/test/vendor/jQuery/1.3.2/build/runtest/test.js +106 -0
- data/test/vendor/jQuery/1.3.2/build/runtest/testrunner.js +197 -0
- data/test/vendor/jQuery/1.3.2/build/speed/benchmarker.css +65 -0
- data/test/vendor/jQuery/1.3.2/build/speed/benchmarker.js +181 -0
- data/test/vendor/jQuery/1.3.2/build/speed/index.html +72 -0
- data/test/vendor/jQuery/1.3.2/build/speed/jquery-basis.js +3549 -0
- data/test/vendor/jQuery/1.3.2/build/style.xsl +99 -0
- data/test/vendor/jQuery/1.3.2/build/yuicompressor-2.4.2.jar +0 -0
- data/test/vendor/jQuery/1.3.2/build.xml +123 -0
- data/test/vendor/jQuery/1.3.2/dist/jquery.js +4376 -0
- data/test/vendor/jQuery/1.3.2/reminder.txt +3 -0
- data/test/vendor/jQuery/1.3.2/src/ajax.js +541 -0
- data/test/vendor/jQuery/1.3.2/src/core.js +1255 -0
- data/test/vendor/jQuery/1.3.2/src/data.js +145 -0
- data/test/vendor/jQuery/1.3.2/src/dimensions.js +49 -0
- data/test/vendor/jQuery/1.3.2/src/event.js +684 -0
- data/test/vendor/jQuery/1.3.2/src/fx.js +407 -0
- data/test/vendor/jQuery/1.3.2/src/intro.js +13 -0
- data/test/vendor/jQuery/1.3.2/src/offset.js +155 -0
- data/test/vendor/jQuery/1.3.2/src/outro.js +1 -0
- data/test/vendor/jQuery/1.3.2/src/selector.js +1015 -0
- data/test/vendor/jQuery/1.3.2/src/support.js +112 -0
- data/test/vendor/jQuery/1.3.2/test/data/cow.jpg +0 -0
- data/test/vendor/jQuery/1.3.2/test/data/dashboard.xml +11 -0
- data/test/vendor/jQuery/1.3.2/test/data/echoQuery.php +1 -0
- data/test/vendor/jQuery/1.3.2/test/data/iframe.html +8 -0
- data/test/vendor/jQuery/1.3.2/test/data/json.php +9 -0
- data/test/vendor/jQuery/1.3.2/test/data/json_assigned_obj.js +1 -0
- data/test/vendor/jQuery/1.3.2/test/data/json_obj.js +1 -0
- data/test/vendor/jQuery/1.3.2/test/data/jsonp.php +10 -0
- data/test/vendor/jQuery/1.3.2/test/data/name.html +1 -0
- data/test/vendor/jQuery/1.3.2/test/data/name.php +29 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/absolute.html +39 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/body.html +24 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/fixed.html +33 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/relative.html +31 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/scroll.html +39 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/static.html +31 -0
- data/test/vendor/jQuery/1.3.2/test/data/offset/table.html +43 -0
- data/test/vendor/jQuery/1.3.2/test/data/params_html.php +12 -0
- data/test/vendor/jQuery/1.3.2/test/data/test.html +7 -0
- data/test/vendor/jQuery/1.3.2/test/data/test.js +3 -0
- data/test/vendor/jQuery/1.3.2/test/data/test.php +7 -0
- data/test/vendor/jQuery/1.3.2/test/data/test2.html +5 -0
- data/test/vendor/jQuery/1.3.2/test/data/test3.html +3 -0
- data/test/vendor/jQuery/1.3.2/test/data/testrunner.js +1 -0
- data/test/vendor/jQuery/1.3.2/test/data/text.php +12 -0
- data/test/vendor/jQuery/1.3.2/test/data/with_fries.xml +25 -0
- data/test/vendor/jQuery/1.3.2/test/index.html +229 -0
- data/test/vendor/jQuery/1.3.2/test/jqenv-1259090275493.html +247 -0
- data/test/vendor/jQuery/1.3.2/test/jqenv-1259091671501.html +247 -0
- data/test/vendor/jQuery/1.3.2/test/jqenv-1259175319655.html +247 -0
- data/test/vendor/jQuery/1.3.2/test/offset.html +28 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/jquery/1.2.1/jquery.js +11 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/jquery/1.2.3/jquery.js +11 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/mootools/1.11/mootools.js +1577 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/prototype/1.6.0.2/prototype.js +4221 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/builder.js +131 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/controls.js +835 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/dragdrop.js +944 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/effects.js +1090 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/scriptaculous.js +51 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/slider.js +278 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.7.0/unittest.js +564 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/builder.js +136 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/controls.js +965 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/dragdrop.js +974 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/effects.js +1122 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/scriptaculous.js +58 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/slider.js +275 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/sound.js +55 -0
- data/test/vendor/jQuery/1.3.2/test/otherlibs/scriptaculous/1.8.1/unittest.js +568 -0
- data/test/vendor/jQuery/1.3.2/test/polluted.php +64 -0
- data/test/vendor/jQuery/1.3.2/test/qunit/testrunner.js +780 -0
- data/test/vendor/jQuery/1.3.2/test/qunit/testsuite.css +120 -0
- data/test/vendor/jQuery/1.3.2/test/test.js +41 -0
- data/test/vendor/jQuery/1.3.2/test/unit/ajax.js +856 -0
- data/test/vendor/jQuery/1.3.2/test/unit/core.js +1872 -0
- data/test/vendor/jQuery/1.3.2/test/unit/data.js +160 -0
- data/test/vendor/jQuery/1.3.2/test/unit/dimensions.js +86 -0
- data/test/vendor/jQuery/1.3.2/test/unit/event.js +670 -0
- data/test/vendor/jQuery/1.3.2/test/unit/fx.js +451 -0
- data/test/vendor/jQuery/1.3.2/test/unit/offset.js +173 -0
- data/test/vendor/jQuery/1.3.2/test/unit/selector.js +395 -0
- data/test/vendor/jQuery/1.3.2/test/xhtml.php +5 -0
- data/test/vendor/jQuery/1.3.2/version.txt +1 -0
- metadata +158 -22
- data/lib/envjs/runtime.rb.smp +0 -133
- data/test/envjs-call-load-test.js +0 -5
- data/test/envjs-prototype.js +0 -5
- data/test/qunit/package.json +0 -21
- data/test/qunit/test/index.html +0 -17
- data/test/qunit/test/same.js +0 -1368
- data/test/qunit/test/test.js +0 -136
- data/test/qunit.smp/package.json +0 -21
- data/test/qunit.smp/test/index.html +0 -17
- data/test/qunit.smp/test/same.js +0 -1368
- data/test/qunit.smp/test/test.js +0 -136
- data/test/rhino-call-load-test.js +0 -5
- data/test/rhino-prototype.js +0 -5
- data/test/test-with-envs-jar.js +0 -8
- data/test/test-with-rhino-jar.js +0 -9
data/lib/envjs/runtime.rb.smp
DELETED
@@ -1,133 +0,0 @@
|
|
1
|
-
require 'envjs'
|
2
|
-
|
3
|
-
module Envjs::Runtime
|
4
|
-
|
5
|
-
def self.extended object
|
6
|
-
object.instance_eval do
|
7
|
-
|
8
|
-
@outer = {} # ||= new_split_global_outer
|
9
|
-
@inner = {} # ||= new_split_global_inner( @outer )
|
10
|
-
|
11
|
-
@inner["Johnson"] = global["Johnson"]
|
12
|
-
@inner["Ruby"] = global["Ruby"]
|
13
|
-
|
14
|
-
evaluate <<'EOJS'
|
15
|
-
print = function() {
|
16
|
-
var l = arguments.length
|
17
|
-
for( var i = 0; i < l; i++ ) {
|
18
|
-
var s;
|
19
|
-
if ( arguments[i] === null ) {
|
20
|
-
s = "null";
|
21
|
-
} else if ( arguments[i] === undefined ) {
|
22
|
-
s = "undefined"
|
23
|
-
} else {
|
24
|
-
s = arguments[i].toString();
|
25
|
-
}
|
26
|
-
Ruby.print(s);
|
27
|
-
if( i < l-1 ) {
|
28
|
-
Ruby.print(" ");
|
29
|
-
}
|
30
|
-
}
|
31
|
-
Ruby.print("\n");
|
32
|
-
};
|
33
|
-
EOJS
|
34
|
-
|
35
|
-
@inner["print"] = global["print"]
|
36
|
-
|
37
|
-
( class << self; self; end ).send :define_method, :evaluate do |*args|
|
38
|
-
( script, file, line, global, scope ) = *args
|
39
|
-
g ||= @inner
|
40
|
-
s ||= @inner
|
41
|
-
p "super"
|
42
|
-
super( script, file, line, g, s )
|
43
|
-
end
|
44
|
-
|
45
|
-
|
46
|
-
# self.global = outer
|
47
|
-
|
48
|
-
return
|
49
|
-
|
50
|
-
evaluate <<'EOJS'
|
51
|
-
print = function() {
|
52
|
-
var l = arguments.length
|
53
|
-
for( var i = 0; i < l; i++ ) {
|
54
|
-
var s;
|
55
|
-
if ( arguments[i] === null ) {
|
56
|
-
s = "null";
|
57
|
-
} else if ( arguments[i] === undefined ) {
|
58
|
-
s = "undefined"
|
59
|
-
} else {
|
60
|
-
s = arguments[i].toString();
|
61
|
-
}
|
62
|
-
Ruby.print(s);
|
63
|
-
if( i < l-1 ) {
|
64
|
-
Ruby.print(" ");
|
65
|
-
}
|
66
|
-
}
|
67
|
-
Ruby.print("\n");
|
68
|
-
};
|
69
|
-
EOJS
|
70
|
-
|
71
|
-
master = global["$master"] = evaluate("new Object")
|
72
|
-
master.symbols = [ "Johnson", "Ruby", "print", "load", "whichInterpreter", "multiwindow" ]
|
73
|
-
# master.symbols = [ "Johnson", "whichInterpreter" ]
|
74
|
-
master.symbols.each { |symbol| master[symbol] = global[symbol] }
|
75
|
-
|
76
|
-
master.whichInterpreter = "Johnson"
|
77
|
-
|
78
|
-
if true
|
79
|
-
|
80
|
-
master.multiwindow = true
|
81
|
-
|
82
|
-
master.load = lambda { |*files| load *files }
|
83
|
-
|
84
|
-
master.evaluate = lambda { |script|
|
85
|
-
return evaluate(script, nil, nil, master["inner"], master["inner"])
|
86
|
-
}
|
87
|
-
|
88
|
-
master.global = lambda { global }
|
89
|
-
|
90
|
-
master.new_global = lambda { new_global }
|
91
|
-
|
92
|
-
master.set_global = lambda { |target, s| self.global = target }
|
93
|
-
|
94
|
-
master._new_proxy = lambda { |target| new_proxy target }
|
95
|
-
master._set_proxy_target = lambda { |proxy, target| set_proxy_target proxy, target }
|
96
|
-
|
97
|
-
master.new_split_global_outer = lambda { new_split_global_outer }
|
98
|
-
master.new_split_global_inner = lambda { |outer,_| new_split_global_inner outer }
|
99
|
-
|
100
|
-
|
101
|
-
end
|
102
|
-
|
103
|
-
# create an proto window object and proxy
|
104
|
-
|
105
|
-
outer = master["outer"] = new_split_global_outer
|
106
|
-
window = inner = master["inner"] = new_split_global_inner( outer )
|
107
|
-
|
108
|
-
master.symbols.each do |symbol|
|
109
|
-
window[symbol] = master[symbol]
|
110
|
-
end
|
111
|
-
|
112
|
-
master.first_script_window = window
|
113
|
-
|
114
|
-
window["$master"] = master
|
115
|
-
|
116
|
-
self.global = outer
|
117
|
-
|
118
|
-
( class << self; self; end ).send :define_method, :wait do
|
119
|
-
master["finalize"] && master.finalize.call
|
120
|
-
end
|
121
|
-
|
122
|
-
( class << self; self; end ).send :define_method, :evaluate do |*args|
|
123
|
-
( script, file, line, global, scope ) = *args
|
124
|
-
global ||= inner
|
125
|
-
scope ||= inner
|
126
|
-
p "super"
|
127
|
-
super( script, file, line, global, scope )
|
128
|
-
end
|
129
|
-
|
130
|
-
end
|
131
|
-
end
|
132
|
-
|
133
|
-
end
|
data/test/envjs-prototype.js
DELETED
data/test/qunit/package.json
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "qunit",
|
3
|
-
"author": {
|
4
|
-
"name": "John Resig",
|
5
|
-
"email": "jeresig@gmail.com",
|
6
|
-
"url": "http://ejohn.org/"
|
7
|
-
},
|
8
|
-
"maintainer": {
|
9
|
-
"name": "Jörn Zaefferer",
|
10
|
-
"email": "joern.zaefferer@googlemail.com",
|
11
|
-
"url": "http://bassistance.de/"
|
12
|
-
},
|
13
|
-
"url": "http://docs.jquery.com/QUnit",
|
14
|
-
"license": {
|
15
|
-
"name": "MIT",
|
16
|
-
"url": "http://www.opensource.org/licenses/mit-license.php"
|
17
|
-
},
|
18
|
-
"description": "An easy-to-use JavaScript Unit Testing framework.",
|
19
|
-
"keywords": [ "testing", "unit", "jquery" ],
|
20
|
-
"lib": "qunit"
|
21
|
-
}
|
data/test/qunit/test/index.html
DELETED
@@ -1,17 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title>QUnit Test Suite</title>
|
5
|
-
<link rel="stylesheet" href="../qunit/qunit.css" type="text/css" media="screen">
|
6
|
-
<script type="text/javascript" src="../qunit/qunit.js"></script>
|
7
|
-
<script type="text/javascript" src="test.js"></script>
|
8
|
-
<script type="text/javascript" src="same.js"></script>
|
9
|
-
</head>
|
10
|
-
<body>
|
11
|
-
<h1 id="qunit-header">QUnit Test Suite</h1>
|
12
|
-
<h2 id="qunit-banner"></h2>
|
13
|
-
<div id="qunit-testrunner-toolbar"></div>
|
14
|
-
<h2 id="qunit-userAgent"></h2>
|
15
|
-
<ol id="qunit-tests"></ol>
|
16
|
-
</body>
|
17
|
-
</html>
|