Skip to content

Commit 1aba6b5

Browse files
committed
basic calculator works with minified.js, lots of references still broken
1 parent 9b9a0da commit 1aba6b5

File tree

16 files changed

+343
-903
lines changed

16 files changed

+343
-903
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
angular-minified.map
2+
externs.js

Rakefile

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,39 @@
11
include FileUtils
22

3+
desc 'Generate Externs'
4+
task :compileexterns do
5+
out = File.new("externs.js", "w")
6+
7+
out.write("function _(){};\n")
8+
file = File.new("lib/underscore/underscore.js", "r")
9+
while (line = file.gets)
10+
if line =~ /^\s*_\.(\w+)\s*=.*$/
11+
out.write("_.#{$1}=function(){};\n")
12+
end
13+
end
14+
file.close
15+
16+
out.write("function jQuery(){};\n")
17+
file = File.new("lib/jquery/jquery-1.3.2.js", "r")
18+
while (line = file.gets)
19+
if line =~ /^\s*(\w+)\s*:\s*function.*$/
20+
out.write("jQuery.#{$1}=function(){};\n")
21+
end
22+
end
23+
file.close
24+
out.write("jQuery.scope=function(){};\n")
25+
out.write("jQuery.controller=function(){};\n")
26+
27+
out.close
28+
end
29+
330
desc 'Compile JavaScript'
431
task :compile do
32+
Rake::Task['compileexterns'].execute
33+
534
concat = %x(cat \
6-
lib/underscore/underscore.js \
735
src/angular.prefix \
836
lib/webtoolkit/webtoolkit.base64.js \
9-
lib/swfobject.js/swfobject.js \
1037
src/Loader.js \
1138
src/API.js \
1239
src/Binder.js \
@@ -30,6 +57,8 @@ task :compile do
3057
%x(java -jar lib/compiler-closure/compiler.jar \
3158
--compilation_level ADVANCED_OPTIMIZATIONS \
3259
--js angular.js \
60+
--externs externs.js \
61+
--create_source_map ./angular-minified.map \
3362
--js_output_file angular-minified.js)
3463
end
3564

angular-minified.js

Lines changed: 109 additions & 122 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)