rocket-js 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +5 -52
- data/spec/ruby/spec_helper.rb +2 -1
- metadata +7 -129
- data/src/vendor/web-socket-js/FABridge.js +0 -604
- data/src/vendor/web-socket-js/README.txt +0 -109
- data/src/vendor/web-socket-js/WebSocketMain.swf +0 -0
- data/src/vendor/web-socket-js/WebSocketMainInsecure.zip +0 -0
- data/src/vendor/web-socket-js/flash-src/WebSocket.as +0 -473
- data/src/vendor/web-socket-js/flash-src/WebSocketMain.as +0 -88
- data/src/vendor/web-socket-js/flash-src/WebSocketMainInsecure.as +0 -19
- data/src/vendor/web-socket-js/flash-src/WebSocketStateEvent.as +0 -32
- data/src/vendor/web-socket-js/flash-src/bridge/FABridge.as +0 -943
- data/src/vendor/web-socket-js/flash-src/build.sh +0 -10
- data/src/vendor/web-socket-js/flash-src/com/adobe/net/proxies/RFC2817Socket.as +0 -204
- data/src/vendor/web-socket-js/flash-src/com/gsolo/encryption/MD5.as +0 -375
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/Crypto.as +0 -287
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/cert/MozillaRootCertificates.as +0 -3235
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/cert/X509Certificate.as +0 -218
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/cert/X509CertificateCollection.as +0 -57
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/HMAC.as +0 -82
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/IHMAC.as +0 -27
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/IHash.as +0 -21
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/MAC.as +0 -137
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/MD2.as +0 -124
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/MD5.as +0 -204
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHA1.as +0 -106
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHA224.as +0 -28
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHA256.as +0 -115
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHABase.as +0 -71
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/prng/ARC4.as +0 -90
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/prng/IPRNG.as +0 -20
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/prng/Random.as +0 -119
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/prng/TLSPRF.as +0 -142
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/rsa/RSAKey.as +0 -339
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/AESKey.as +0 -2797
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/BlowFishKey.as +0 -375
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/CBCMode.as +0 -55
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/CFB8Mode.as +0 -61
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/CFBMode.as +0 -64
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/CTRMode.as +0 -58
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/DESKey.as +0 -365
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/ECBMode.as +0 -86
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/ICipher.as +0 -21
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/IMode.as +0 -15
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/IPad.as +0 -32
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/IStreamCipher.as +0 -21
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/ISymmetricKey.as +0 -35
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/IVMode.as +0 -110
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/NullPad.as +0 -34
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/OFBMode.as +0 -52
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/PKCS5.as +0 -44
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/SSLPad.as +0 -44
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/SimpleIVMode.as +0 -60
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/TLSPad.as +0 -42
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/TripleDESKey.as +0 -88
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/XTeaKey.as +0 -94
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/aeskey.pl +0 -29
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/dump.txt +0 -2304
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/AESKeyTest.as +0 -1220
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/ARC4Test.as +0 -58
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/BigIntegerTest.as +0 -39
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/BlowFishKeyTest.as +0 -148
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/CBCModeTest.as +0 -160
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/CFB8ModeTest.as +0 -71
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/CFBModeTest.as +0 -98
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/CTRModeTest.as +0 -109
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/DESKeyTest.as +0 -112
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/ECBModeTest.as +0 -151
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/HMACTest.as +0 -184
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/ITestHarness.as +0 -20
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/MD2Test.as +0 -56
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/MD5Test.as +0 -58
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/OFBModeTest.as +0 -101
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/RSAKeyTest.as +0 -92
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/SHA1Test.as +0 -198
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/SHA224Test.as +0 -58
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/SHA256Test.as +0 -60
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/TLSPRFTest.as +0 -51
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/TestCase.as +0 -42
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/TripleDESKeyTest.as +0 -59
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/XTeaKeyTest.as +0 -66
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/BulkCiphers.as +0 -102
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/CipherSuites.as +0 -117
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/IConnectionState.as +0 -14
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/ISecurityParameters.as +0 -29
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/KeyExchanges.as +0 -24
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/MACs.as +0 -38
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/SSLConnectionState.as +0 -171
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/SSLEvent.as +0 -26
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/SSLSecurityParameters.as +0 -340
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSConfig.as +0 -70
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSConnectionState.as +0 -151
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSEngine.as +0 -895
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSError.as +0 -39
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSEvent.as +0 -27
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSSecurityParameters.as +0 -197
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSSocket.as +0 -370
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSSocketEvent.as +0 -26
- data/src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSTest.as +0 -180
- data/src/vendor/web-socket-js/flash-src/com/hurlant/math/BarrettReduction.as +0 -90
- data/src/vendor/web-socket-js/flash-src/com/hurlant/math/BigInteger.as +0 -1543
- data/src/vendor/web-socket-js/flash-src/com/hurlant/math/ClassicReduction.as +0 -35
- data/src/vendor/web-socket-js/flash-src/com/hurlant/math/IReduction.as +0 -11
- data/src/vendor/web-socket-js/flash-src/com/hurlant/math/MontgomeryReduction.as +0 -85
- data/src/vendor/web-socket-js/flash-src/com/hurlant/math/NullReduction.as +0 -34
- data/src/vendor/web-socket-js/flash-src/com/hurlant/math/bi_internal.as +0 -11
- data/src/vendor/web-socket-js/flash-src/com/hurlant/util/ArrayUtil.as +0 -25
- data/src/vendor/web-socket-js/flash-src/com/hurlant/util/Base64.as +0 -189
- data/src/vendor/web-socket-js/flash-src/com/hurlant/util/Hex.as +0 -66
- data/src/vendor/web-socket-js/flash-src/com/hurlant/util/Memory.as +0 -28
- data/src/vendor/web-socket-js/flash-src/com/hurlant/util/der/ByteString.as +0 -43
- data/src/vendor/web-socket-js/flash-src/com/hurlant/util/der/DER.as +0 -210
- data/src/vendor/web-socket-js/flash-src/com/hurlant/util/der/IAsn1Type.as +0 -21
- data/src/vendor/web-socket-js/flash-src/com/hurlant/util/der/Integer.as +0 -44
- data/src/vendor/web-socket-js/flash-src/com/hurlant/util/der/OID.as +0 -35
- data/src/vendor/web-socket-js/flash-src/com/hurlant/util/der/ObjectIdentifier.as +0 -112
- data/src/vendor/web-socket-js/flash-src/com/hurlant/util/der/PEM.as +0 -118
- data/src/vendor/web-socket-js/flash-src/com/hurlant/util/der/PrintableString.as +0 -49
- data/src/vendor/web-socket-js/flash-src/com/hurlant/util/der/Sequence.as +0 -90
- data/src/vendor/web-socket-js/flash-src/com/hurlant/util/der/Set.as +0 -27
- data/src/vendor/web-socket-js/flash-src/com/hurlant/util/der/Type.as +0 -94
- data/src/vendor/web-socket-js/flash-src/com/hurlant/util/der/UTCTime.as +0 -60
- data/src/vendor/web-socket-js/sample.html +0 -76
- data/src/vendor/web-socket-js/swfobject.js +0 -4
- data/src/vendor/web-socket-js/web_socket.js +0 -388
data/Rakefile
CHANGED
@@ -1,56 +1,9 @@
|
|
1
1
|
# -*- ruby -*-
|
2
|
-
|
3
|
-
$:.unshift(File.expand_path('../../rocket/lib/', __FILE__))
|
4
|
-
require 'rspec/core/rake_task'
|
5
|
-
require 'rake/rdoctask'
|
2
|
+
require File.expand_path('../../load_paths', __FILE__)
|
6
3
|
require 'rocket/version'
|
7
4
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
end
|
5
|
+
$LIB_BASENAME = "rocket-js"
|
6
|
+
$LIB_FULLNAME = "#{$LIB_BASENAME}-#{Rocket.version}"
|
7
|
+
$LIB_TITLE = "Rocket JavaScript Tools #{Rocket.version}"
|
12
8
|
|
13
|
-
|
14
|
-
t.rcov = true
|
15
|
-
t.rspec_opts = %q[-I../rocket-core/lib -I../rocket/lib -Ilib -c -b]
|
16
|
-
t.rcov_opts = %q[-I../rocket-core/lib -I../rocket/lib -Ilib -T -x "spec"]
|
17
|
-
end
|
18
|
-
|
19
|
-
Rake::RDocTask.new do |rdoc|
|
20
|
-
rdoc.title = "Rocket JavaScript Tools #{Rocket.version}"
|
21
|
-
rdoc.rdoc_dir = 'rdoc'
|
22
|
-
rdoc.rdoc_files.include('README*')
|
23
|
-
rdoc.rdoc_files.include('lib/**/*.rb')
|
24
|
-
end
|
25
|
-
|
26
|
-
desc "Build current version as a rubygem"
|
27
|
-
task :build do
|
28
|
-
sh "gem build rocket-js.gemspec"
|
29
|
-
sh "mkdir -p pkg"
|
30
|
-
sh "mv rocket-js-*.gem pkg/"
|
31
|
-
end
|
32
|
-
|
33
|
-
desc "Relase current version to rubygems.org"
|
34
|
-
task :release => :build do
|
35
|
-
sh "gem push pkg/rocket-js-#{Rocket.version}.gem"
|
36
|
-
end
|
37
|
-
|
38
|
-
desc "Perform installation via rubygems"
|
39
|
-
task :install => :build do
|
40
|
-
sh "gem install pkg/rocket-js-#{Rocket.version}.gem"
|
41
|
-
end
|
42
|
-
|
43
|
-
namespace :js do
|
44
|
-
desc 'Bundle and minify source files.'
|
45
|
-
task :build do
|
46
|
-
require 'rocket-js'
|
47
|
-
Rocket::JS::Builder.new(File.dirname(__FILE__), true).generate_script
|
48
|
-
end
|
49
|
-
|
50
|
-
desc 'Start test server.'
|
51
|
-
task :test do
|
52
|
-
exec 'ruby -I../rocket/lib -Ilib test/js/app.rb'
|
53
|
-
end
|
54
|
-
end
|
55
|
-
|
56
|
-
task :default => :spec
|
9
|
+
load File.expand_path('../../Rakefile.common', __FILE__)
|
data/spec/ruby/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rocket-js
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Araneo Ltd.
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-11-
|
19
|
+
date: 2010-11-29 00:00:00 +01:00
|
20
20
|
default_executable: rocket-js
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -27,12 +27,12 @@ dependencies:
|
|
27
27
|
requirements:
|
28
28
|
- - "="
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
hash:
|
30
|
+
hash: 25
|
31
31
|
segments:
|
32
32
|
- 0
|
33
33
|
- 0
|
34
|
-
-
|
35
|
-
version: 0.0.
|
34
|
+
- 3
|
35
|
+
version: 0.0.3
|
36
36
|
type: :runtime
|
37
37
|
version_requirements: *id001
|
38
38
|
- !ruby/object:Gem::Dependency
|
@@ -148,128 +148,6 @@ files:
|
|
148
148
|
- src/rocket.defaults.js
|
149
149
|
- src/rocket.license.js
|
150
150
|
- src/vendor/json/json2.js
|
151
|
-
- src/vendor/web-socket-js/WebSocketMain.swf
|
152
|
-
- src/vendor/web-socket-js/WebSocketMainInsecure.zip
|
153
|
-
- src/vendor/web-socket-js/web_socket.js
|
154
|
-
- src/vendor/web-socket-js/flash-src/com/adobe/net/proxies/RFC2817Socket.as
|
155
|
-
- src/vendor/web-socket-js/flash-src/com/gsolo/encryption/MD5.as
|
156
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/math/bi_internal.as
|
157
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/math/NullReduction.as
|
158
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/math/MontgomeryReduction.as
|
159
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/math/BarrettReduction.as
|
160
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/math/BigInteger.as
|
161
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/math/IReduction.as
|
162
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/math/ClassicReduction.as
|
163
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/util/der/OID.as
|
164
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/util/der/PEM.as
|
165
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/util/der/Set.as
|
166
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/util/der/IAsn1Type.as
|
167
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/util/der/ObjectIdentifier.as
|
168
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/util/der/Integer.as
|
169
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/util/der/ByteString.as
|
170
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/util/der/PrintableString.as
|
171
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/util/der/Sequence.as
|
172
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/util/der/UTCTime.as
|
173
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/util/der/Type.as
|
174
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/util/der/DER.as
|
175
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/util/Hex.as
|
176
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/util/Memory.as
|
177
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/util/Base64.as
|
178
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/util/ArrayUtil.as
|
179
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/rsa/RSAKey.as
|
180
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/KeyExchanges.as
|
181
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSConfig.as
|
182
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/IConnectionState.as
|
183
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/MACs.as
|
184
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSEvent.as
|
185
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/SSLEvent.as
|
186
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/SSLConnectionState.as
|
187
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSConnectionState.as
|
188
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSTest.as
|
189
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSSocketEvent.as
|
190
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSEngine.as
|
191
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/CipherSuites.as
|
192
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/ISecurityParameters.as
|
193
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSSocket.as
|
194
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/SSLSecurityParameters.as
|
195
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSSecurityParameters.as
|
196
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/BulkCiphers.as
|
197
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tls/TLSError.as
|
198
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/cert/X509CertificateCollection.as
|
199
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/cert/MozillaRootCertificates.as
|
200
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/cert/X509Certificate.as
|
201
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/MAC.as
|
202
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/MD2.as
|
203
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/MD5.as
|
204
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHA1.as
|
205
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHA224.as
|
206
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHA256.as
|
207
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/IHMAC.as
|
208
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/HMAC.as
|
209
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/SHABase.as
|
210
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/hash/IHash.as
|
211
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/prng/Random.as
|
212
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/prng/TLSPRF.as
|
213
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/prng/ARC4.as
|
214
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/prng/IPRNG.as
|
215
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/TestCase.as
|
216
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/XTeaKeyTest.as
|
217
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/CTRModeTest.as
|
218
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/MD5Test.as
|
219
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/TripleDESKeyTest.as
|
220
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/ECBModeTest.as
|
221
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/DESKeyTest.as
|
222
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/BigIntegerTest.as
|
223
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/SHA1Test.as
|
224
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/MD2Test.as
|
225
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/OFBModeTest.as
|
226
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/ITestHarness.as
|
227
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/HMACTest.as
|
228
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/AESKeyTest.as
|
229
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/CFBModeTest.as
|
230
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/RSAKeyTest.as
|
231
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/TLSPRFTest.as
|
232
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/CBCModeTest.as
|
233
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/BlowFishKeyTest.as
|
234
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/ARC4Test.as
|
235
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/SHA256Test.as
|
236
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/CFB8ModeTest.as
|
237
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/tests/SHA224Test.as
|
238
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/SimpleIVMode.as
|
239
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/CFB8Mode.as
|
240
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/ICipher.as
|
241
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/BlowFishKey.as
|
242
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/CBCMode.as
|
243
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/AESKey.as
|
244
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/PKCS5.as
|
245
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/TLSPad.as
|
246
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/CTRMode.as
|
247
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/IVMode.as
|
248
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/ECBMode.as
|
249
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/XTeaKey.as
|
250
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/OFBMode.as
|
251
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/CFBMode.as
|
252
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/IMode.as
|
253
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/IPad.as
|
254
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/DESKey.as
|
255
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/ISymmetricKey.as
|
256
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/NullPad.as
|
257
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/aeskey.pl
|
258
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/IStreamCipher.as
|
259
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/dump.txt
|
260
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/TripleDESKey.as
|
261
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/symmetric/SSLPad.as
|
262
|
-
- src/vendor/web-socket-js/flash-src/com/hurlant/crypto/Crypto.as
|
263
|
-
- src/vendor/web-socket-js/flash-src/WebSocket.as
|
264
|
-
- src/vendor/web-socket-js/flash-src/bridge/FABridge.as
|
265
|
-
- src/vendor/web-socket-js/flash-src/build.sh
|
266
|
-
- src/vendor/web-socket-js/flash-src/WebSocketStateEvent.as
|
267
|
-
- src/vendor/web-socket-js/flash-src/WebSocketMain.as
|
268
|
-
- src/vendor/web-socket-js/flash-src/WebSocketMainInsecure.as
|
269
|
-
- src/vendor/web-socket-js/swfobject.js
|
270
|
-
- src/vendor/web-socket-js/README.txt
|
271
|
-
- src/vendor/web-socket-js/sample.html
|
272
|
-
- src/vendor/web-socket-js/FABridge.js
|
273
151
|
has_rdoc: true
|
274
152
|
homepage: http://github.com/araneo/rocket
|
275
153
|
licenses: []
|
@@ -1,604 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
/*
|
3
|
-
Copyright 2006 Adobe Systems Incorporated
|
4
|
-
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"),
|
6
|
-
to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
7
|
-
and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
8
|
-
|
9
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
10
|
-
|
11
|
-
|
12
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
13
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
14
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
|
15
|
-
OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
16
|
-
|
17
|
-
*/
|
18
|
-
|
19
|
-
|
20
|
-
/*
|
21
|
-
* The Bridge class, responsible for navigating AS instances
|
22
|
-
*/
|
23
|
-
function FABridge(target,bridgeName)
|
24
|
-
{
|
25
|
-
this.target = target;
|
26
|
-
this.remoteTypeCache = {};
|
27
|
-
this.remoteInstanceCache = {};
|
28
|
-
this.remoteFunctionCache = {};
|
29
|
-
this.localFunctionCache = {};
|
30
|
-
this.bridgeID = FABridge.nextBridgeID++;
|
31
|
-
this.name = bridgeName;
|
32
|
-
this.nextLocalFuncID = 0;
|
33
|
-
FABridge.instances[this.name] = this;
|
34
|
-
FABridge.idMap[this.bridgeID] = this;
|
35
|
-
|
36
|
-
return this;
|
37
|
-
}
|
38
|
-
|
39
|
-
// type codes for packed values
|
40
|
-
FABridge.TYPE_ASINSTANCE = 1;
|
41
|
-
FABridge.TYPE_ASFUNCTION = 2;
|
42
|
-
|
43
|
-
FABridge.TYPE_JSFUNCTION = 3;
|
44
|
-
FABridge.TYPE_ANONYMOUS = 4;
|
45
|
-
|
46
|
-
FABridge.initCallbacks = {};
|
47
|
-
FABridge.userTypes = {};
|
48
|
-
|
49
|
-
FABridge.addToUserTypes = function()
|
50
|
-
{
|
51
|
-
for (var i = 0; i < arguments.length; i++)
|
52
|
-
{
|
53
|
-
FABridge.userTypes[arguments[i]] = {
|
54
|
-
'typeName': arguments[i],
|
55
|
-
'enriched': false
|
56
|
-
};
|
57
|
-
}
|
58
|
-
}
|
59
|
-
|
60
|
-
FABridge.argsToArray = function(args)
|
61
|
-
{
|
62
|
-
var result = [];
|
63
|
-
for (var i = 0; i < args.length; i++)
|
64
|
-
{
|
65
|
-
result[i] = args[i];
|
66
|
-
}
|
67
|
-
return result;
|
68
|
-
}
|
69
|
-
|
70
|
-
function instanceFactory(objID)
|
71
|
-
{
|
72
|
-
this.fb_instance_id = objID;
|
73
|
-
return this;
|
74
|
-
}
|
75
|
-
|
76
|
-
function FABridge__invokeJSFunction(args)
|
77
|
-
{
|
78
|
-
var funcID = args[0];
|
79
|
-
var throughArgs = args.concat();//FABridge.argsToArray(arguments);
|
80
|
-
throughArgs.shift();
|
81
|
-
|
82
|
-
var bridge = FABridge.extractBridgeFromID(funcID);
|
83
|
-
return bridge.invokeLocalFunction(funcID, throughArgs);
|
84
|
-
}
|
85
|
-
|
86
|
-
FABridge.addInitializationCallback = function(bridgeName, callback)
|
87
|
-
{
|
88
|
-
var inst = FABridge.instances[bridgeName];
|
89
|
-
if (inst != undefined)
|
90
|
-
{
|
91
|
-
callback.call(inst);
|
92
|
-
return;
|
93
|
-
}
|
94
|
-
|
95
|
-
var callbackList = FABridge.initCallbacks[bridgeName];
|
96
|
-
if(callbackList == null)
|
97
|
-
{
|
98
|
-
FABridge.initCallbacks[bridgeName] = callbackList = [];
|
99
|
-
}
|
100
|
-
|
101
|
-
callbackList.push(callback);
|
102
|
-
}
|
103
|
-
|
104
|
-
// updated for changes to SWFObject2
|
105
|
-
function FABridge__bridgeInitialized(bridgeName) {
|
106
|
-
var objects = document.getElementsByTagName("object");
|
107
|
-
var ol = objects.length;
|
108
|
-
var activeObjects = [];
|
109
|
-
if (ol > 0) {
|
110
|
-
for (var i = 0; i < ol; i++) {
|
111
|
-
if (typeof objects[i].SetVariable != "undefined") {
|
112
|
-
activeObjects[activeObjects.length] = objects[i];
|
113
|
-
}
|
114
|
-
}
|
115
|
-
}
|
116
|
-
var embeds = document.getElementsByTagName("embed");
|
117
|
-
var el = embeds.length;
|
118
|
-
var activeEmbeds = [];
|
119
|
-
if (el > 0) {
|
120
|
-
for (var j = 0; j < el; j++) {
|
121
|
-
if (typeof embeds[j].SetVariable != "undefined") {
|
122
|
-
activeEmbeds[activeEmbeds.length] = embeds[j];
|
123
|
-
}
|
124
|
-
}
|
125
|
-
}
|
126
|
-
var aol = activeObjects.length;
|
127
|
-
var ael = activeEmbeds.length;
|
128
|
-
var searchStr = "bridgeName="+ bridgeName;
|
129
|
-
if ((aol == 1 && !ael) || (aol == 1 && ael == 1)) {
|
130
|
-
FABridge.attachBridge(activeObjects[0], bridgeName);
|
131
|
-
}
|
132
|
-
else if (ael == 1 && !aol) {
|
133
|
-
FABridge.attachBridge(activeEmbeds[0], bridgeName);
|
134
|
-
}
|
135
|
-
else {
|
136
|
-
var flash_found = false;
|
137
|
-
if (aol > 1) {
|
138
|
-
for (var k = 0; k < aol; k++) {
|
139
|
-
var params = activeObjects[k].childNodes;
|
140
|
-
for (var l = 0; l < params.length; l++) {
|
141
|
-
var param = params[l];
|
142
|
-
if (param.nodeType == 1 && param.tagName.toLowerCase() == "param" && param["name"].toLowerCase() == "flashvars" && param["value"].indexOf(searchStr) >= 0) {
|
143
|
-
FABridge.attachBridge(activeObjects[k], bridgeName);
|
144
|
-
flash_found = true;
|
145
|
-
break;
|
146
|
-
}
|
147
|
-
}
|
148
|
-
if (flash_found) {
|
149
|
-
break;
|
150
|
-
}
|
151
|
-
}
|
152
|
-
}
|
153
|
-
if (!flash_found && ael > 1) {
|
154
|
-
for (var m = 0; m < ael; m++) {
|
155
|
-
var flashVars = activeEmbeds[m].attributes.getNamedItem("flashVars").nodeValue;
|
156
|
-
if (flashVars.indexOf(searchStr) >= 0) {
|
157
|
-
FABridge.attachBridge(activeEmbeds[m], bridgeName);
|
158
|
-
break;
|
159
|
-
}
|
160
|
-
}
|
161
|
-
}
|
162
|
-
}
|
163
|
-
return true;
|
164
|
-
}
|
165
|
-
|
166
|
-
// used to track multiple bridge instances, since callbacks from AS are global across the page.
|
167
|
-
|
168
|
-
FABridge.nextBridgeID = 0;
|
169
|
-
FABridge.instances = {};
|
170
|
-
FABridge.idMap = {};
|
171
|
-
FABridge.refCount = 0;
|
172
|
-
|
173
|
-
FABridge.extractBridgeFromID = function(id)
|
174
|
-
{
|
175
|
-
var bridgeID = (id >> 16);
|
176
|
-
return FABridge.idMap[bridgeID];
|
177
|
-
}
|
178
|
-
|
179
|
-
FABridge.attachBridge = function(instance, bridgeName)
|
180
|
-
{
|
181
|
-
var newBridgeInstance = new FABridge(instance, bridgeName);
|
182
|
-
|
183
|
-
FABridge[bridgeName] = newBridgeInstance;
|
184
|
-
|
185
|
-
/* FABridge[bridgeName] = function() {
|
186
|
-
return newBridgeInstance.root();
|
187
|
-
}
|
188
|
-
*/
|
189
|
-
var callbacks = FABridge.initCallbacks[bridgeName];
|
190
|
-
if (callbacks == null)
|
191
|
-
{
|
192
|
-
return;
|
193
|
-
}
|
194
|
-
for (var i = 0; i < callbacks.length; i++)
|
195
|
-
{
|
196
|
-
callbacks[i].call(newBridgeInstance);
|
197
|
-
}
|
198
|
-
delete FABridge.initCallbacks[bridgeName]
|
199
|
-
}
|
200
|
-
|
201
|
-
// some methods can't be proxied. You can use the explicit get,set, and call methods if necessary.
|
202
|
-
|
203
|
-
FABridge.blockedMethods =
|
204
|
-
{
|
205
|
-
toString: true,
|
206
|
-
get: true,
|
207
|
-
set: true,
|
208
|
-
call: true
|
209
|
-
};
|
210
|
-
|
211
|
-
FABridge.prototype =
|
212
|
-
{
|
213
|
-
|
214
|
-
|
215
|
-
// bootstrapping
|
216
|
-
|
217
|
-
root: function()
|
218
|
-
{
|
219
|
-
return this.deserialize(this.target.getRoot());
|
220
|
-
},
|
221
|
-
//clears all of the AS objects in the cache maps
|
222
|
-
releaseASObjects: function()
|
223
|
-
{
|
224
|
-
return this.target.releaseASObjects();
|
225
|
-
},
|
226
|
-
//clears a specific object in AS from the type maps
|
227
|
-
releaseNamedASObject: function(value)
|
228
|
-
{
|
229
|
-
if(typeof(value) != "object")
|
230
|
-
{
|
231
|
-
return false;
|
232
|
-
}
|
233
|
-
else
|
234
|
-
{
|
235
|
-
var ret = this.target.releaseNamedASObject(value.fb_instance_id);
|
236
|
-
return ret;
|
237
|
-
}
|
238
|
-
},
|
239
|
-
//create a new AS Object
|
240
|
-
create: function(className)
|
241
|
-
{
|
242
|
-
return this.deserialize(this.target.create(className));
|
243
|
-
},
|
244
|
-
|
245
|
-
|
246
|
-
// utilities
|
247
|
-
|
248
|
-
makeID: function(token)
|
249
|
-
{
|
250
|
-
return (this.bridgeID << 16) + token;
|
251
|
-
},
|
252
|
-
|
253
|
-
|
254
|
-
// low level access to the flash object
|
255
|
-
|
256
|
-
//get a named property from an AS object
|
257
|
-
getPropertyFromAS: function(objRef, propName)
|
258
|
-
{
|
259
|
-
if (FABridge.refCount > 0)
|
260
|
-
{
|
261
|
-
throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");
|
262
|
-
}
|
263
|
-
else
|
264
|
-
{
|
265
|
-
FABridge.refCount++;
|
266
|
-
retVal = this.target.getPropFromAS(objRef, propName);
|
267
|
-
retVal = this.handleError(retVal);
|
268
|
-
FABridge.refCount--;
|
269
|
-
return retVal;
|
270
|
-
}
|
271
|
-
},
|
272
|
-
//set a named property on an AS object
|
273
|
-
setPropertyInAS: function(objRef,propName, value)
|
274
|
-
{
|
275
|
-
if (FABridge.refCount > 0)
|
276
|
-
{
|
277
|
-
throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");
|
278
|
-
}
|
279
|
-
else
|
280
|
-
{
|
281
|
-
FABridge.refCount++;
|
282
|
-
retVal = this.target.setPropInAS(objRef,propName, this.serialize(value));
|
283
|
-
retVal = this.handleError(retVal);
|
284
|
-
FABridge.refCount--;
|
285
|
-
return retVal;
|
286
|
-
}
|
287
|
-
},
|
288
|
-
|
289
|
-
//call an AS function
|
290
|
-
callASFunction: function(funcID, args)
|
291
|
-
{
|
292
|
-
if (FABridge.refCount > 0)
|
293
|
-
{
|
294
|
-
throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");
|
295
|
-
}
|
296
|
-
else
|
297
|
-
{
|
298
|
-
FABridge.refCount++;
|
299
|
-
retVal = this.target.invokeASFunction(funcID, this.serialize(args));
|
300
|
-
retVal = this.handleError(retVal);
|
301
|
-
FABridge.refCount--;
|
302
|
-
return retVal;
|
303
|
-
}
|
304
|
-
},
|
305
|
-
//call a method on an AS object
|
306
|
-
callASMethod: function(objID, funcName, args)
|
307
|
-
{
|
308
|
-
if (FABridge.refCount > 0)
|
309
|
-
{
|
310
|
-
throw new Error("You are trying to call recursively into the Flash Player which is not allowed. In most cases the JavaScript setTimeout function, can be used as a workaround.");
|
311
|
-
}
|
312
|
-
else
|
313
|
-
{
|
314
|
-
FABridge.refCount++;
|
315
|
-
args = this.serialize(args);
|
316
|
-
retVal = this.target.invokeASMethod(objID, funcName, args);
|
317
|
-
retVal = this.handleError(retVal);
|
318
|
-
FABridge.refCount--;
|
319
|
-
return retVal;
|
320
|
-
}
|
321
|
-
},
|
322
|
-
|
323
|
-
// responders to remote calls from flash
|
324
|
-
|
325
|
-
//callback from flash that executes a local JS function
|
326
|
-
//used mostly when setting js functions as callbacks on events
|
327
|
-
invokeLocalFunction: function(funcID, args)
|
328
|
-
{
|
329
|
-
var result;
|
330
|
-
var func = this.localFunctionCache[funcID];
|
331
|
-
|
332
|
-
if(func != undefined)
|
333
|
-
{
|
334
|
-
result = this.serialize(func.apply(null, this.deserialize(args)));
|
335
|
-
}
|
336
|
-
|
337
|
-
return result;
|
338
|
-
},
|
339
|
-
|
340
|
-
// Object Types and Proxies
|
341
|
-
|
342
|
-
// accepts an object reference, returns a type object matching the obj reference.
|
343
|
-
getTypeFromName: function(objTypeName)
|
344
|
-
{
|
345
|
-
return this.remoteTypeCache[objTypeName];
|
346
|
-
},
|
347
|
-
//create an AS proxy for the given object ID and type
|
348
|
-
createProxy: function(objID, typeName)
|
349
|
-
{
|
350
|
-
var objType = this.getTypeFromName(typeName);
|
351
|
-
instanceFactory.prototype = objType;
|
352
|
-
var instance = new instanceFactory(objID);
|
353
|
-
this.remoteInstanceCache[objID] = instance;
|
354
|
-
return instance;
|
355
|
-
},
|
356
|
-
//return the proxy associated with the given object ID
|
357
|
-
getProxy: function(objID)
|
358
|
-
{
|
359
|
-
return this.remoteInstanceCache[objID];
|
360
|
-
},
|
361
|
-
|
362
|
-
// accepts a type structure, returns a constructed type
|
363
|
-
addTypeDataToCache: function(typeData)
|
364
|
-
{
|
365
|
-
var newType = new ASProxy(this, typeData.name);
|
366
|
-
var accessors = typeData.accessors;
|
367
|
-
for (var i = 0; i < accessors.length; i++)
|
368
|
-
{
|
369
|
-
this.addPropertyToType(newType, accessors[i]);
|
370
|
-
}
|
371
|
-
|
372
|
-
var methods = typeData.methods;
|
373
|
-
for (var i = 0; i < methods.length; i++)
|
374
|
-
{
|
375
|
-
if (FABridge.blockedMethods[methods[i]] == undefined)
|
376
|
-
{
|
377
|
-
this.addMethodToType(newType, methods[i]);
|
378
|
-
}
|
379
|
-
}
|
380
|
-
|
381
|
-
|
382
|
-
this.remoteTypeCache[newType.typeName] = newType;
|
383
|
-
return newType;
|
384
|
-
},
|
385
|
-
|
386
|
-
//add a property to a typename; used to define the properties that can be called on an AS proxied object
|
387
|
-
addPropertyToType: function(ty, propName)
|
388
|
-
{
|
389
|
-
var c = propName.charAt(0);
|
390
|
-
var setterName;
|
391
|
-
var getterName;
|
392
|
-
if(c >= "a" && c <= "z")
|
393
|
-
{
|
394
|
-
getterName = "get" + c.toUpperCase() + propName.substr(1);
|
395
|
-
setterName = "set" + c.toUpperCase() + propName.substr(1);
|
396
|
-
}
|
397
|
-
else
|
398
|
-
{
|
399
|
-
getterName = "get" + propName;
|
400
|
-
setterName = "set" + propName;
|
401
|
-
}
|
402
|
-
ty[setterName] = function(val)
|
403
|
-
{
|
404
|
-
this.bridge.setPropertyInAS(this.fb_instance_id, propName, val);
|
405
|
-
}
|
406
|
-
ty[getterName] = function()
|
407
|
-
{
|
408
|
-
return this.bridge.deserialize(this.bridge.getPropertyFromAS(this.fb_instance_id, propName));
|
409
|
-
}
|
410
|
-
},
|
411
|
-
|
412
|
-
//add a method to a typename; used to define the methods that can be callefd on an AS proxied object
|
413
|
-
addMethodToType: function(ty, methodName)
|
414
|
-
{
|
415
|
-
ty[methodName] = function()
|
416
|
-
{
|
417
|
-
return this.bridge.deserialize(this.bridge.callASMethod(this.fb_instance_id, methodName, FABridge.argsToArray(arguments)));
|
418
|
-
}
|
419
|
-
},
|
420
|
-
|
421
|
-
// Function Proxies
|
422
|
-
|
423
|
-
//returns the AS proxy for the specified function ID
|
424
|
-
getFunctionProxy: function(funcID)
|
425
|
-
{
|
426
|
-
var bridge = this;
|
427
|
-
if (this.remoteFunctionCache[funcID] == null)
|
428
|
-
{
|
429
|
-
this.remoteFunctionCache[funcID] = function()
|
430
|
-
{
|
431
|
-
bridge.callASFunction(funcID, FABridge.argsToArray(arguments));
|
432
|
-
}
|
433
|
-
}
|
434
|
-
return this.remoteFunctionCache[funcID];
|
435
|
-
},
|
436
|
-
|
437
|
-
//reutrns the ID of the given function; if it doesnt exist it is created and added to the local cache
|
438
|
-
getFunctionID: function(func)
|
439
|
-
{
|
440
|
-
if (func.__bridge_id__ == undefined)
|
441
|
-
{
|
442
|
-
func.__bridge_id__ = this.makeID(this.nextLocalFuncID++);
|
443
|
-
this.localFunctionCache[func.__bridge_id__] = func;
|
444
|
-
}
|
445
|
-
return func.__bridge_id__;
|
446
|
-
},
|
447
|
-
|
448
|
-
// serialization / deserialization
|
449
|
-
|
450
|
-
serialize: function(value)
|
451
|
-
{
|
452
|
-
var result = {};
|
453
|
-
|
454
|
-
var t = typeof(value);
|
455
|
-
//primitives are kept as such
|
456
|
-
if (t == "number" || t == "string" || t == "boolean" || t == null || t == undefined)
|
457
|
-
{
|
458
|
-
result = value;
|
459
|
-
}
|
460
|
-
else if (value instanceof Array)
|
461
|
-
{
|
462
|
-
//arrays are serializesd recursively
|
463
|
-
result = [];
|
464
|
-
for (var i = 0; i < value.length; i++)
|
465
|
-
{
|
466
|
-
result[i] = this.serialize(value[i]);
|
467
|
-
}
|
468
|
-
}
|
469
|
-
else if (t == "function")
|
470
|
-
{
|
471
|
-
//js functions are assigned an ID and stored in the local cache
|
472
|
-
result.type = FABridge.TYPE_JSFUNCTION;
|
473
|
-
result.value = this.getFunctionID(value);
|
474
|
-
}
|
475
|
-
else if (value instanceof ASProxy)
|
476
|
-
{
|
477
|
-
result.type = FABridge.TYPE_ASINSTANCE;
|
478
|
-
result.value = value.fb_instance_id;
|
479
|
-
}
|
480
|
-
else
|
481
|
-
{
|
482
|
-
result.type = FABridge.TYPE_ANONYMOUS;
|
483
|
-
result.value = value;
|
484
|
-
}
|
485
|
-
|
486
|
-
return result;
|
487
|
-
},
|
488
|
-
|
489
|
-
//on deserialization we always check the return for the specific error code that is used to marshall NPE's into JS errors
|
490
|
-
// the unpacking is done by returning the value on each pachet for objects/arrays
|
491
|
-
deserialize: function(packedValue)
|
492
|
-
{
|
493
|
-
|
494
|
-
var result;
|
495
|
-
|
496
|
-
var t = typeof(packedValue);
|
497
|
-
if (t == "number" || t == "string" || t == "boolean" || packedValue == null || packedValue == undefined)
|
498
|
-
{
|
499
|
-
result = this.handleError(packedValue);
|
500
|
-
}
|
501
|
-
else if (packedValue instanceof Array)
|
502
|
-
{
|
503
|
-
result = [];
|
504
|
-
for (var i = 0; i < packedValue.length; i++)
|
505
|
-
{
|
506
|
-
result[i] = this.deserialize(packedValue[i]);
|
507
|
-
}
|
508
|
-
}
|
509
|
-
else if (t == "object")
|
510
|
-
{
|
511
|
-
for(var i = 0; i < packedValue.newTypes.length; i++)
|
512
|
-
{
|
513
|
-
this.addTypeDataToCache(packedValue.newTypes[i]);
|
514
|
-
}
|
515
|
-
for (var aRefID in packedValue.newRefs)
|
516
|
-
{
|
517
|
-
this.createProxy(aRefID, packedValue.newRefs[aRefID]);
|
518
|
-
}
|
519
|
-
if (packedValue.type == FABridge.TYPE_PRIMITIVE)
|
520
|
-
{
|
521
|
-
result = packedValue.value;
|
522
|
-
}
|
523
|
-
else if (packedValue.type == FABridge.TYPE_ASFUNCTION)
|
524
|
-
{
|
525
|
-
result = this.getFunctionProxy(packedValue.value);
|
526
|
-
}
|
527
|
-
else if (packedValue.type == FABridge.TYPE_ASINSTANCE)
|
528
|
-
{
|
529
|
-
result = this.getProxy(packedValue.value);
|
530
|
-
}
|
531
|
-
else if (packedValue.type == FABridge.TYPE_ANONYMOUS)
|
532
|
-
{
|
533
|
-
result = packedValue.value;
|
534
|
-
}
|
535
|
-
}
|
536
|
-
return result;
|
537
|
-
},
|
538
|
-
//increases the reference count for the given object
|
539
|
-
addRef: function(obj)
|
540
|
-
{
|
541
|
-
this.target.incRef(obj.fb_instance_id);
|
542
|
-
},
|
543
|
-
//decrease the reference count for the given object and release it if needed
|
544
|
-
release:function(obj)
|
545
|
-
{
|
546
|
-
this.target.releaseRef(obj.fb_instance_id);
|
547
|
-
},
|
548
|
-
|
549
|
-
// check the given value for the components of the hard-coded error code : __FLASHERROR
|
550
|
-
// used to marshall NPE's into flash
|
551
|
-
|
552
|
-
handleError: function(value)
|
553
|
-
{
|
554
|
-
if (typeof(value)=="string" && value.indexOf("__FLASHERROR")==0)
|
555
|
-
{
|
556
|
-
var myErrorMessage = value.split("||");
|
557
|
-
if(FABridge.refCount > 0 )
|
558
|
-
{
|
559
|
-
FABridge.refCount--;
|
560
|
-
}
|
561
|
-
throw new Error(myErrorMessage[1]);
|
562
|
-
return value;
|
563
|
-
}
|
564
|
-
else
|
565
|
-
{
|
566
|
-
return value;
|
567
|
-
}
|
568
|
-
}
|
569
|
-
};
|
570
|
-
|
571
|
-
// The root ASProxy class that facades a flash object
|
572
|
-
|
573
|
-
ASProxy = function(bridge, typeName)
|
574
|
-
{
|
575
|
-
this.bridge = bridge;
|
576
|
-
this.typeName = typeName;
|
577
|
-
return this;
|
578
|
-
};
|
579
|
-
//methods available on each ASProxy object
|
580
|
-
ASProxy.prototype =
|
581
|
-
{
|
582
|
-
get: function(propName)
|
583
|
-
{
|
584
|
-
return this.bridge.deserialize(this.bridge.getPropertyFromAS(this.fb_instance_id, propName));
|
585
|
-
},
|
586
|
-
|
587
|
-
set: function(propName, value)
|
588
|
-
{
|
589
|
-
this.bridge.setPropertyInAS(this.fb_instance_id, propName, value);
|
590
|
-
},
|
591
|
-
|
592
|
-
call: function(funcName, args)
|
593
|
-
{
|
594
|
-
this.bridge.callASMethod(this.fb_instance_id, funcName, args);
|
595
|
-
},
|
596
|
-
|
597
|
-
addRef: function() {
|
598
|
-
this.bridge.addRef(this);
|
599
|
-
},
|
600
|
-
|
601
|
-
release: function() {
|
602
|
-
this.bridge.release(this);
|
603
|
-
}
|
604
|
-
};
|