closure 1.3.1 → 1.4.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +142 -9
- data/bin/closure-script +19 -0
- data/closure-compiler/README +18 -4
- data/closure-compiler/compiler.jar +0 -0
- data/closure-templates/SoyToJsSrcCompiler.jar +0 -0
- data/closure-templates/soydata.js +163 -0
- data/closure-templates/soyutils.js +1191 -159
- data/closure-templates/soyutils_usegoog.js +1107 -60
- data/docs/closure/Closure.html +58 -52
- data/docs/closure/Closure/BeanShell.html +6 -3
- data/docs/closure/Closure/Compiler.html +18 -15
- data/docs/closure/Closure/Compiler/Compilation.html +9 -3
- data/docs/closure/Closure/Compiler/Error.html +3 -3
- data/docs/closure/Closure/FileResponse.html +13 -7
- data/docs/closure/Closure/Goog.html +49 -85
- data/docs/closure/Closure/Middleware.html +5 -3
- data/docs/closure/Closure/Script.html +14 -5
- data/docs/closure/Closure/Script/NotFound.html +3 -3
- data/docs/closure/Closure/Script/RenderStackOverflow.html +3 -3
- data/docs/closure/Closure/Server.html +6 -3
- data/docs/closure/Closure/ShowExceptions.html +5 -3
- data/docs/closure/Closure/Sources.html +145 -37
- data/docs/closure/Closure/Templates.html +11 -10
- data/docs/closure/Closure/Templates/Error.html +3 -3
- data/docs/closure/_index.html +4 -4
- data/docs/closure/css/full_list.css +2 -0
- data/docs/closure/css/style.css +2 -0
- data/docs/closure/file.LICENSE.html +3 -3
- data/docs/closure/file.README.html +151 -10
- data/docs/closure/frames.html +1 -1
- data/docs/closure/index.html +151 -10
- data/docs/closure/js/full_list.js +23 -6
- data/docs/closure/method_list.html +91 -83
- data/docs/closure/top-level-namespace.html +3 -3
- data/lib/closure.rb +3 -16
- data/lib/closure/compiler.rb +135 -53
- data/lib/closure/goog.rb +5 -29
- data/lib/closure/sources.rb +22 -9
- data/lib/closure/version.rb +1 -1
- data/scripts/config.ru +0 -1
- data/scripts/hello/compiler_build.js +5 -5
- data/scripts/hello/compiler_build.map +518 -522
- data/scripts/hello/compiler_debug.js +7 -13
- data/scripts/hello/legume.js +2 -2
- data/scripts/index.erb +0 -3
- data/scripts/modules/compiler_build.js +3 -3
- data/scripts/modules/compiler_build.map +11569 -11476
- data/scripts/modules/compiler_build_api.js +1 -1
- data/scripts/modules/compiler_build_app.js +71 -70
- data/scripts/modules/compiler_build_settings.js +2 -2
- data/scripts/modules/compiler_debug.js +3 -3
- data/scripts/modules/compiler_debug_api.js +2 -2
- data/scripts/modules/compiler_debug_app.js +926 -1382
- data/scripts/modules/compiler_debug_settings.js +21 -24
- metadata +8 -18
- data/externs/chrome_extensions.externs +0 -968
- data/externs/jquery-1.3.2.externs +0 -718
- data/externs/jquery-1.4.3.externs +0 -1289
- data/externs/jquery-1.4.4.externs +0 -1302
- data/externs/jquery-1.5.externs +0 -1697
- data/externs/jquery-ui.externs +0 -10
- data/externs/jquery.externs +0 -4
- data/scripts/jquery/compiler.js.erb +0 -7
- data/scripts/jquery/compiler_out.js +0 -1
- data/scripts/jquery/index.erb +0 -25
- data/scripts/jquery/jquery_1.4.4.js +0 -167
- data/scripts/jquery/jquery_test.js +0 -8
@@ -6,7 +6,7 @@
|
|
6
6
|
<title>
|
7
7
|
Top Level Namespace
|
8
8
|
|
9
|
-
— Documentation by YARD 0.7.
|
9
|
+
— Documentation by YARD 0.7.3
|
10
10
|
|
11
11
|
</title>
|
12
12
|
|
@@ -94,9 +94,9 @@
|
|
94
94
|
</div>
|
95
95
|
|
96
96
|
<div id="footer">
|
97
|
-
Generated on
|
97
|
+
Generated on Sun Oct 23 22:43:17 2011 by
|
98
98
|
<a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
|
99
|
-
0.7.
|
99
|
+
0.7.3 (ruby-1.9.2).
|
100
100
|
</div>
|
101
101
|
|
102
102
|
</body>
|
data/lib/closure.rb
CHANGED
@@ -12,6 +12,7 @@
|
|
12
12
|
# See the License for the specific language governing permissions and
|
13
13
|
# limitations under the License.
|
14
14
|
|
15
|
+
require 'rack'
|
15
16
|
require 'ostruct'
|
16
17
|
require 'tempfile'
|
17
18
|
|
@@ -28,19 +29,6 @@ require 'tempfile'
|
|
28
29
|
|
29
30
|
class Closure
|
30
31
|
|
31
|
-
autoload(:VERSION, 'closure/version')
|
32
|
-
autoload(:BeanShell, 'closure/beanshell')
|
33
|
-
autoload(:Script, 'closure/script')
|
34
|
-
autoload(:Sources, 'closure/sources')
|
35
|
-
autoload(:FileResponse, 'closure/file_response')
|
36
|
-
autoload(:Middleware, 'closure/middleware')
|
37
|
-
autoload(:Compiler, 'closure/compiler')
|
38
|
-
autoload(:Server, 'closure/server')
|
39
|
-
autoload(:Goog, 'closure/goog')
|
40
|
-
autoload(:Templates, 'closure/templates')
|
41
|
-
autoload(:ShowExceptions, 'closure/show_exceptions')
|
42
|
-
|
43
|
-
|
44
32
|
# Filesystem location of the Closure Script install.
|
45
33
|
# Typically, where the gem was installed. This is mainly used
|
46
34
|
# internally but may be useful for experimental configurations.
|
@@ -53,7 +41,6 @@ class Closure
|
|
53
41
|
# Scripts that are distributed with the gem. These will help get you started quickly.
|
54
42
|
BUILT_INS = {
|
55
43
|
:soy => File.join(base_path, 'closure-templates'),
|
56
|
-
:externs => File.join(base_path, 'externs'),
|
57
44
|
:docs => File.join(base_path, 'docs')
|
58
45
|
}
|
59
46
|
|
@@ -61,7 +48,7 @@ class Closure
|
|
61
48
|
# Easy config. This adds to the global instance of sources and
|
62
49
|
# supports using the {BUILT_INS}.
|
63
50
|
# @example
|
64
|
-
# Closure.add_source :
|
51
|
+
# Closure.add_source :soy, '/soy_js'
|
65
52
|
# Closure.add_source './myapp', '/myapp'
|
66
53
|
# @overload add_source(directory, path=nil)
|
67
54
|
# @overload add_source(built_in, path=nil)
|
@@ -135,7 +122,6 @@ class Closure
|
|
135
122
|
end
|
136
123
|
@@config
|
137
124
|
end
|
138
|
-
require 'closure/engines'
|
139
125
|
|
140
126
|
# Run the welcome server. Handy for gem users.
|
141
127
|
# @example
|
@@ -155,3 +141,4 @@ class Closure
|
|
155
141
|
|
156
142
|
end
|
157
143
|
|
144
|
+
Dir.glob(File.expand_path('**/*.rb', File.dirname(__FILE__))).each {|f| require f}
|
data/lib/closure/compiler.rb
CHANGED
@@ -184,49 +184,7 @@ class Closure
|
|
184
184
|
args
|
185
185
|
end
|
186
186
|
|
187
|
-
|
188
|
-
# @param [Array<String>] args
|
189
|
-
# @return [Array<Hash>] mods
|
190
|
-
def self.module_augment(args)
|
191
|
-
found_starred = false
|
192
|
-
found_numeric = false
|
193
|
-
js_files = []
|
194
|
-
mods = []
|
195
|
-
args_index = args.length
|
196
|
-
while args_index > 0
|
197
|
-
args_index = args_index - 2
|
198
|
-
option, value = args[args_index, 2]
|
199
|
-
if option == '--js'
|
200
|
-
js_files.unshift value
|
201
|
-
elsif option == '--module'
|
202
|
-
if js_files.empty?
|
203
|
-
raise "No --js files for --module #{value}"
|
204
|
-
end
|
205
|
-
mod = value.split ':'
|
206
|
-
if mod[1] == '*'
|
207
|
-
mod[1] = js_files.size
|
208
|
-
found_starred = true
|
209
|
-
else
|
210
|
-
found_numeric = true
|
211
|
-
end
|
212
|
-
mods.unshift({
|
213
|
-
:name => mod[0],
|
214
|
-
:requires => mod[2..-1],
|
215
|
-
:files => js_files
|
216
|
-
})
|
217
|
-
js_files = []
|
218
|
-
args[args_index+1] = mod.join ':'
|
219
|
-
end
|
220
|
-
end
|
221
|
-
unless js_files.empty? or mods.empty?
|
222
|
-
raise 'Automatic --module must appear before first --js option.'
|
223
|
-
end
|
224
|
-
if found_starred and found_numeric
|
225
|
-
raise 'Static and automatic --module options can not be mixed.'
|
226
|
-
end
|
227
|
-
mods
|
228
|
-
end
|
229
|
-
|
187
|
+
|
230
188
|
# The javascript snippet for module info
|
231
189
|
# @param [Array<Hash>] mods
|
232
190
|
def self.module_info(mods)
|
@@ -262,6 +220,22 @@ class Closure
|
|
262
220
|
js += "\n};\n"
|
263
221
|
end
|
264
222
|
|
223
|
+
|
224
|
+
# Main function to convert --ns arguments into --js arguments.
|
225
|
+
# Returns module info when modules are processed.
|
226
|
+
# @param [Array<String>] args
|
227
|
+
# @return [Array<Hash>] mods
|
228
|
+
def self.augment(args, sources, env={})
|
229
|
+
mods = extract_modules args
|
230
|
+
if mods
|
231
|
+
module_augment args, sources, mods, env
|
232
|
+
else
|
233
|
+
namespace_augment args, sources, [], env
|
234
|
+
end
|
235
|
+
mods
|
236
|
+
end
|
237
|
+
|
238
|
+
|
265
239
|
# Extracts the values for a options in the arguments.
|
266
240
|
# Use Array#last to emulate compiler.jar for single options.
|
267
241
|
# Will collect from an array of options.
|
@@ -281,12 +255,42 @@ class Closure
|
|
281
255
|
values
|
282
256
|
end
|
283
257
|
|
258
|
+
|
259
|
+
private
|
260
|
+
|
261
|
+
|
284
262
|
# Converts --ns arguments into --js arguments
|
285
263
|
# @param [Array<String>] args
|
286
|
-
|
287
|
-
|
264
|
+
def self.module_augment(args, sources, mods, env)
|
265
|
+
walk_modules sources, mods, env
|
288
266
|
files = []
|
289
|
-
|
267
|
+
mods.each do |mod|
|
268
|
+
mod_args = mod[:args]
|
269
|
+
mod_files = (mod[:files] ||= [])
|
270
|
+
# We are adding the bubbled namespaces to the end.
|
271
|
+
# This allows moduleManager.setLoaded to fire earlier
|
272
|
+
# since the bubbled files are needed only for the children.
|
273
|
+
(mod[:bubble]||[]).each do |mod_bubble|
|
274
|
+
namespaces = sources.namespaces_for mod_bubble, env
|
275
|
+
namespaces.each do |ns|
|
276
|
+
mod_args << '--ns' << ns
|
277
|
+
end
|
278
|
+
end
|
279
|
+
namespace_augment(mod_args, sources, files, env)
|
280
|
+
args << '--module'
|
281
|
+
args << "#{mod[:name]}:#{mod_args.size / 2}:#{mod[:requires].join(',')}"
|
282
|
+
mod_args.each_slice(2) do |a,b|
|
283
|
+
args << a << b
|
284
|
+
mod_files << b
|
285
|
+
end
|
286
|
+
end
|
287
|
+
end
|
288
|
+
|
289
|
+
|
290
|
+
# Converts --ns arguments into --js arguments
|
291
|
+
# @param [Array<String>] args
|
292
|
+
def self.namespace_augment(args, sources, files, env)
|
293
|
+
files_index = files.length
|
290
294
|
args_index = 0
|
291
295
|
while args_index < args.length
|
292
296
|
option, value = args[args_index, 2]
|
@@ -294,12 +298,7 @@ class Closure
|
|
294
298
|
sources.files_for(value, files, env)
|
295
299
|
replacement = []
|
296
300
|
while files_index < files.length
|
297
|
-
|
298
|
-
# use_externs_hack = true
|
299
|
-
replacement.push '--externs'
|
300
|
-
else
|
301
|
-
replacement.push '--js'
|
302
|
-
end
|
301
|
+
replacement.push '--js'
|
303
302
|
replacement.push files[files_index]
|
304
303
|
files_index = files_index + 1
|
305
304
|
end
|
@@ -308,7 +307,90 @@ class Closure
|
|
308
307
|
args_index = args_index + 2
|
309
308
|
end
|
310
309
|
end
|
311
|
-
|
310
|
+
end
|
311
|
+
|
312
|
+
|
313
|
+
# Insanity-inducing recursive explorer to find common files in child modules.
|
314
|
+
# Try every branch in the tree and bubble up common files as we see them.
|
315
|
+
def self.walk_modules(sources, mods, env, seek=nil, mods_seen=[], files_seen=[])
|
316
|
+
files = []
|
317
|
+
mods_seen << seek
|
318
|
+
mods.each do |mod|
|
319
|
+
if (!seek and mod[:requires].empty?) or mod[:requires].include? seek
|
320
|
+
next if mods_seen.include? mod[:name]
|
321
|
+
# Find the needed files for this module's --ns args
|
322
|
+
files_seen_dup = files_seen.dup
|
323
|
+
mod[:args].each_slice(2) do |option, value|
|
324
|
+
if option == '--ns'
|
325
|
+
sources.files_for value, files_seen_dup, env
|
326
|
+
end
|
327
|
+
end
|
328
|
+
mod_files = files_seen_dup[files_seen.size..-1]
|
329
|
+
# Get the needed files for each of the modules requiring this mod
|
330
|
+
files_sets = walk_modules sources, mods, env, mod[:name], mods_seen, files_seen_dup
|
331
|
+
# Find the common files that will bubble up
|
332
|
+
common_files = []
|
333
|
+
child_files = files_sets.reduce([]){|memo, v|common_files |= memo&v; memo|v}
|
334
|
+
mod[:bubble] = common_files
|
335
|
+
# Clear bubbling files from children
|
336
|
+
mods.each do |child_mod|
|
337
|
+
if child_mod[:requires].include? mod[:name]
|
338
|
+
child_mod[:bubble] -= common_files
|
339
|
+
end
|
340
|
+
end
|
341
|
+
# Add to result array
|
342
|
+
files << (mod_files + child_files).uniq
|
343
|
+
end
|
344
|
+
end
|
345
|
+
files
|
346
|
+
end
|
347
|
+
|
348
|
+
|
349
|
+
# @param [Array<String>] args
|
350
|
+
# @return [Array<Hash>] mods
|
351
|
+
def self.extract_modules(args)
|
352
|
+
found_starred = false
|
353
|
+
found_numeric = false
|
354
|
+
mod_args = []
|
355
|
+
mods = []
|
356
|
+
args_index = args.length
|
357
|
+
while args_index > 0
|
358
|
+
args_index = args_index - 2
|
359
|
+
option, value = args[args_index, 2]
|
360
|
+
if %w{--js --ns}.include? option
|
361
|
+
mod_args.unshift args.delete_at args_index + 1
|
362
|
+
mod_args.unshift args.delete_at args_index
|
363
|
+
elsif option == '--module'
|
364
|
+
if mod_args.empty?
|
365
|
+
raise "No --js or --ns files for --module #{value}"
|
366
|
+
end
|
367
|
+
mod = value.split ':'
|
368
|
+
if mod[1] == '*'
|
369
|
+
found_starred = true
|
370
|
+
else
|
371
|
+
found_numeric = true
|
372
|
+
end
|
373
|
+
mods.unshift({
|
374
|
+
:name => mod[0],
|
375
|
+
:requires => (mod[2]||'').split(','),
|
376
|
+
:args => mod_args
|
377
|
+
})
|
378
|
+
mod_args = []
|
379
|
+
2.times {args.delete_at args_index}
|
380
|
+
end
|
381
|
+
end
|
382
|
+
unless mod_args.empty? or mods.empty?
|
383
|
+
raise 'Automatic --module must appear before first --js or --ns option.'
|
384
|
+
end
|
385
|
+
if found_starred and found_numeric
|
386
|
+
raise 'Static and automatic --module options can not be mixed.'
|
387
|
+
end
|
388
|
+
if mods.empty?
|
389
|
+
args.insert -1, *mod_args
|
390
|
+
nil
|
391
|
+
else
|
392
|
+
mods
|
393
|
+
end
|
312
394
|
end
|
313
395
|
|
314
396
|
end
|
data/lib/closure/goog.rb
CHANGED
@@ -72,13 +72,11 @@ class Closure
|
|
72
72
|
pre_js_tempfile = nil
|
73
73
|
begin
|
74
74
|
Compiler::Util.expand_paths args, File.dirname(@render_stack.last)
|
75
|
-
|
76
|
-
Compiler::Util.namespace_augment args, @sources, @env
|
77
|
-
mods = Compiler::Util.module_augment args
|
75
|
+
mods = Compiler::Util.augment args, @sources, @env
|
78
76
|
if Compiler::Util.arg_values(args, '--compilation_level').empty?
|
79
77
|
# Raw mode
|
80
78
|
comp = Compiler::Compilation.new @env
|
81
|
-
|
79
|
+
if mods
|
82
80
|
comp << Compiler::Util.module_info(mods)
|
83
81
|
comp << Compiler::Util.module_uris_raw(mods, @sources)
|
84
82
|
end
|
@@ -92,41 +90,19 @@ class Closure
|
|
92
90
|
comp << "document.write(#{script_tag.dump});\n"
|
93
91
|
js_counter += 1
|
94
92
|
# For modules, just the files for the first module
|
95
|
-
break if
|
93
|
+
break if mods and js_counter >= mods[0][:files].length
|
96
94
|
end
|
97
95
|
args_index = args_index + 2
|
98
96
|
end
|
99
97
|
else
|
100
98
|
# Compiled mode
|
101
99
|
module_output_path_prefix = Compiler::Util.arg_values(args, '--module_output_path_prefix').last
|
102
|
-
if
|
100
|
+
if mods and !module_output_path_prefix
|
103
101
|
# raise this before compilation so we don't write to a weird place
|
104
102
|
raise "--module_output_path_prefix is required when using --module"
|
105
103
|
end
|
106
|
-
# If the externs were changed by namespace_augment then we need to include
|
107
|
-
# a temp file containing the goog.provide statements that satisfy compiler.jar.
|
108
|
-
if orig_externs != Compiler::Util.arg_values(args, '--externs')
|
109
|
-
pre_js_tempfile = Tempfile.new 'closure_pre_js'
|
110
|
-
# Insert before the first --js (in case of modules)
|
111
|
-
args_index = 0
|
112
|
-
while args_index < args.length
|
113
|
-
if args[args_index] == '--js'
|
114
|
-
args.insert args_index, '--js', pre_js_tempfile.path
|
115
|
-
break
|
116
|
-
end
|
117
|
-
args_index = args_index + 2
|
118
|
-
end
|
119
|
-
pre_js_tempfile.open
|
120
|
-
@sources.deps_response(File.dirname(base_js), @env).each do |s|
|
121
|
-
next unless s =~ /^goog\.provide/
|
122
|
-
pre_js_tempfile.write s
|
123
|
-
end
|
124
|
-
pre_js_tempfile.close
|
125
|
-
# File mtime is rolled back to not trigger compilation.
|
126
|
-
File.utime(Time.now, Time.at(0), pre_js_tempfile.path)
|
127
|
-
end
|
128
104
|
comp = Compiler.compile args, @dependencies, @env
|
129
|
-
|
105
|
+
if mods
|
130
106
|
refresh # compilation may add new files, module_uris_compiled uses src_for
|
131
107
|
prefix = File.expand_path module_output_path_prefix, File.dirname(@render_stack.last)
|
132
108
|
if comp.js_output_file
|
data/lib/closure/sources.rb
CHANGED
@@ -131,11 +131,7 @@ class Closure
|
|
131
131
|
response = @deps[base] ||= Rack::Response.new
|
132
132
|
response.write "// Dynamic Deps by Closure Script\n"
|
133
133
|
@files.sort{|a,b|(a[1][:path]||'')<=>(b[1][:path]||'')}.each do |filename, dep|
|
134
|
-
if
|
135
|
-
dep[:provide].each do |dep_provide|
|
136
|
-
response.write "goog.provide(#{dep_provide.dump});\n"
|
137
|
-
end
|
138
|
-
elsif dep[:path]
|
134
|
+
if dep[:path]
|
139
135
|
path = Pathname.new(dep[:path]).relative_path_from(base)
|
140
136
|
path = "#{path}?#{dep[:mtime].to_i}"
|
141
137
|
response.write "goog.addDependency(#{path.dump}, #{dep[:provide].inspect}, #{dep[:require].inspect});\n"
|
@@ -192,28 +188,45 @@ class Closure
|
|
192
188
|
calcdeps(ns, namespace, filenames)
|
193
189
|
end
|
194
190
|
|
191
|
+
|
195
192
|
# Calculate the file server path for a filename
|
196
193
|
# @param (String) filename
|
197
194
|
# @return (String)
|
198
195
|
def src_for(filename, env={})
|
199
196
|
@semaphore.synchronize do
|
200
197
|
refresh(env)
|
201
|
-
|
202
|
-
unless
|
198
|
+
file = @files[filename]
|
199
|
+
unless file and file.has_key? :path
|
203
200
|
raise "#{filename.dump} is not available from file server"
|
204
201
|
end
|
205
|
-
"#{
|
202
|
+
"#{file[:path]}?#{file[:mtime].to_i}"
|
206
203
|
end
|
207
204
|
end
|
208
205
|
|
206
|
+
|
207
|
+
# Return all provided and required namespaces for a file.
|
208
|
+
# @param (String) filename
|
209
|
+
# @return (String)
|
210
|
+
def namespaces_for(filename, env={})
|
211
|
+
@semaphore.synchronize do
|
212
|
+
refresh(env)
|
213
|
+
file = @files[filename]
|
214
|
+
raise "#{filename.dump} not found" unless file
|
215
|
+
file[:provide] + file[:require]
|
216
|
+
end
|
217
|
+
end
|
218
|
+
|
219
|
+
|
209
220
|
# Certain Script operations, such as building Templates, will need
|
210
221
|
# to invalidate the cache.
|
211
222
|
def invalidate(env)
|
212
223
|
env.delete ENV_FLAG
|
213
224
|
@last_been_run = Time.at 0
|
214
225
|
end
|
226
|
+
|
215
227
|
|
216
228
|
protected
|
229
|
+
|
217
230
|
|
218
231
|
# Namespace recursion with circular stop on the filename
|
219
232
|
def calcdeps(ns, namespace, filenames, prev = nil)
|
@@ -248,7 +261,7 @@ class Closure
|
|
248
261
|
# Scan filesystem for changes.
|
249
262
|
@sources.each do |dir, path|
|
250
263
|
dir_range = (dir.length..-1)
|
251
|
-
Dir.glob(File.join(dir,'**','*.
|
264
|
+
Dir.glob(File.join(dir,'**','*.js')).each do |filename|
|
252
265
|
dep = (@files[filename] ||= {})
|
253
266
|
dep.delete(:not_found)
|
254
267
|
mtime = File.mtime(filename)
|
data/lib/closure/version.rb
CHANGED
data/scripts/config.ru
CHANGED
@@ -10,7 +10,6 @@ Closure.add_source '.', '/'
|
|
10
10
|
# Add some useful built-ins.
|
11
11
|
Closure.add_source :soy, '/soy'
|
12
12
|
Closure.add_source :docs, '/docs'
|
13
|
-
Closure.add_source :externs
|
14
13
|
|
15
14
|
# Feel free to use your own compilers.
|
16
15
|
# Closure.config.compiler_jar = 'closure-compiler/compiler.jar'
|
@@ -1,5 +1,5 @@
|
|
1
|
-
var c=this;Math.floor(Math.random()*2147483648).toString(36);function d(a
|
2
|
-
a:{var
|
3
|
-
function
|
4
|
-
k[2])}while(b==0)}
|
5
|
-
|
1
|
+
var c=this;Math.floor(Math.random()*2147483648).toString(36);function d(a,b){if(a<b)return-1;else if(a>b)return 1;return 0};var e,f,h,i;function l(){return c.navigator?c.navigator.userAgent:null}i=h=f=e=false;var m;if(m=l()){var n=c.navigator;e=m.indexOf("Opera")==0;f=!e&&m.indexOf("MSIE")!=-1;h=!e&&m.indexOf("WebKit")!=-1;i=!e&&!h&&n.product=="Gecko"}var o=f,p=i,q=h,t;
|
2
|
+
a:{var u="",v;if(e&&c.opera)var w=c.opera.version,u=typeof w=="function"?w():w;else if(p?v=/rv\:([^\);]+)(\)|;)/:o?v=/MSIE\s+([^\);]+)(\)|;)/:q&&(v=/WebKit\/(\S+)/),v)var x=v.exec(l()),u=x?x[1]:"";if(o){var y,z=c.document;y=z?z.documentMode:void 0;if(y>parseFloat(u)){t=String(y);break a}}t=u}var A={};
|
3
|
+
function B(a){if(!A[a]){for(var b=0,r=String(t).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),g=String(a).replace(/^[\s\xa0]+|[\s\xa0]+$/g,"").split("."),K=Math.max(r.length,g.length),s=0;b==0&&s<K;s++){var L=r[s]||"",M=g[s]||"",N=RegExp("(\\d*)(\\D*)","g"),O=RegExp("(\\d*)(\\D*)","g");do{var j=N.exec(L)||["","",""],k=O.exec(M)||["","",""];if(j[0].length==0&&k[0].length==0)break;b=d(j[1].length==0?0:parseInt(j[1],10),k[1].length==0?0:parseInt(k[1],10))||d(j[2].length==0,k[2].length==0)||d(j[2],
|
4
|
+
k[2])}while(b==0)}A[a]=b>=0}}var C={};function D(){return C[9]||(C[9]=o&&document.documentMode&&document.documentMode>=9)};!o||D();!p&&!o||o&&D()||p&&B("1.9.1");o&&B("9");o&&B(8);var E;(E="ScriptEngine"in c&&c.ScriptEngine()=="JScript")&&(c.ScriptEngineMajorVersion(),c.ScriptEngineMinorVersion(),c.ScriptEngineBuildVersion());function F(a,b){this.a=E?[]:"";a!=null&&this.append.apply(this,arguments)}E?(F.prototype.c=0,F.prototype.append=function(a,b,r){b==null?this.a[this.c++]=a:(this.a.push.apply(this.a,arguments),this.c=this.a.length);return this}):F.prototype.append=function(a,b,r){this.a+=a;if(b!=null)for(var g=1;g<arguments.length;g++)this.a+=arguments[g];return this};F.prototype.clear=function(){E?this.c=this.a.length=0:this.a=""};
|
5
|
+
F.prototype.toString=function(){if(E){var a=this.a.join("");this.clear();a&&this.append(a);return a}else return this.a};var G={"\x00":"�",'"':""","&":"&","'":"'","<":"<",">":">","\t":"	","\n":" ","\u000b":"","\u000c":"","\r":" "," ":" ","-":"-","/":"/","=":"=","`":"`","\u0085":"…","\u00a0":" ","\u2028":"
","\u2029":"
"};function H(a){return G[a]}var I=/[\x00\x22\x26\x27\x3c\x3e]/g;function J(a){var b=new F;b.append("\tHello ",typeof a.b==="object"&&a.b&&a.b.d===0?a.b.content:String(a.b).replace(I,H),"!");return b.toString()};function P(a){document.write(J({b:a}))}var Q="hello".split("."),R=c;!(Q[0]in R)&&R.execScript&&R.execScript("var "+Q[0]);for(var S;Q.length&&(S=Q.shift());)!Q.length&&P!==void 0?R[S]=P:R=R[S]?R[S]:R[S]={};
|