golf 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/golf.gemspec +1 -1
- data/lib/golf/version.rb +1 -1
- metadata +1 -121
- data/golf-java/README.markdown +0 -41
- data/golf-java/THANKS.markdown +0 -14
- data/golf-java/build/classes.zip +0 -0
- data/golf-java/build/com/thinkminimo/golf/GolfResource$MimeMapping$MimeMappingSingleton.class +0 -0
- data/golf-java/build/com/thinkminimo/golf/GolfResource$MimeMapping.class +0 -0
- data/golf-java/build/com/thinkminimo/golf/GolfResource.class +0 -0
- data/golf-java/build/com/thinkminimo/golf/GolfServlet$1.class +0 -0
- data/golf-java/build/com/thinkminimo/golf/GolfServlet$GolfContext.class +0 -0
- data/golf-java/build/com/thinkminimo/golf/GolfServlet$GolfParams.class +0 -0
- data/golf-java/build/com/thinkminimo/golf/GolfServlet$GolfSession.class +0 -0
- data/golf-java/build/com/thinkminimo/golf/GolfServlet$PermanentRedirectException.class +0 -0
- data/golf-java/build/com/thinkminimo/golf/GolfServlet$RedirectException.class +0 -0
- data/golf-java/build/com/thinkminimo/golf/GolfServlet$StoredJSVM.class +0 -0
- data/golf-java/build/com/thinkminimo/golf/GolfServlet.class +0 -0
- data/golf-java/build/com/thinkminimo/golf/JsonpTunnel.class +0 -0
- data/golf-java/build/com/thinkminimo/golf/Main$1.class +0 -0
- data/golf-java/build/com/thinkminimo/golf/Main$RingList.class +0 -0
- data/golf-java/build/com/thinkminimo/golf/Main.class +0 -0
- data/golf-java/build/com/thinkminimo/golf/ProxyServlet.class +0 -0
- data/golf-java/build/com/yahoo/platform/yui/compressor/CssCompressor.class +0 -0
- data/golf-java/build/com/yahoo/platform/yui/compressor/JarClassLoader.class +0 -0
- data/golf-java/build/com/yahoo/platform/yui/compressor/JavaScriptCompressor.class +0 -0
- data/golf-java/build/com/yahoo/platform/yui/compressor/JavaScriptIdentifier.class +0 -0
- data/golf-java/build/com/yahoo/platform/yui/compressor/JavaScriptToken.class +0 -0
- data/golf-java/build/com/yahoo/platform/yui/compressor/ScriptOrFnScope.class +0 -0
- data/golf-java/build/depends.zip +0 -0
- data/golf-java/build/golf +0 -2
- data/golf-java/build/org/json/JSONArray.class +0 -0
- data/golf-java/build/org/json/JSONException.class +0 -0
- data/golf-java/build/org/json/JSONObject$1.class +0 -0
- data/golf-java/build/org/json/JSONObject$Null.class +0 -0
- data/golf-java/build/org/json/JSONObject.class +0 -0
- data/golf-java/build/org/json/JSONString.class +0 -0
- data/golf-java/build/org/json/JSONStringer.class +0 -0
- data/golf-java/build/org/json/JSONTokener.class +0 -0
- data/golf-java/build/org/json/JSONWriter.class +0 -0
- data/golf-java/build/resources.zip +0 -0
- data/golf-java/build.xml +0 -174
- data/golf-java/dist/golf.zip +0 -0
- data/golf-java/lib/ant-launcher.jar +0 -0
- data/golf-java/lib/ant.jar +0 -0
- data/golf-java/lib/commons-codec-1.4.jar +0 -0
- data/golf-java/lib/commons-collections-3.2.1.jar +0 -0
- data/golf-java/lib/commons-fileupload-1.2.1.jar +0 -0
- data/golf-java/lib/commons-httpclient-3.1.jar +0 -0
- data/golf-java/lib/commons-io-1.4.jar +0 -0
- data/golf-java/lib/commons-lang-2.4.jar +0 -0
- data/golf-java/lib/commons-logging-1.1.1.jar +0 -0
- data/golf-java/lib/cssparser-0.9.5.jar +0 -0
- data/golf-java/lib/getopt-0.1-dev.jar +0 -0
- data/golf-java/lib/htmlunit-2.6.jar +0 -0
- data/golf-java/lib/htmlunit-core-js-2.6.jar +0 -0
- data/golf-java/lib/java-xmlbuilder-1.jar +0 -0
- data/golf-java/lib/jets3t-0.7.0.jar +0 -0
- data/golf-java/lib/jetty-6.1.15.jar +0 -0
- data/golf-java/lib/jetty-util-6.1.15.jar +0 -0
- data/golf-java/lib/log4j-1.2.15.jar +0 -0
- data/golf-java/lib/nekohtml-1.9.13.jar +0 -0
- data/golf-java/lib/sac-1.3.jar +0 -0
- data/golf-java/lib/serializer-2.7.1.jar +0 -0
- data/golf-java/lib/servlet-api-2.5-20081211.jar +0 -0
- data/golf-java/lib/xalan-2.7.1.jar +0 -0
- data/golf-java/lib/xercesImpl-2.9.1.jar +0 -0
- data/golf-java/lib/xml-apis-1.3.04.jar +0 -0
- data/golf-java/resources/app_error.html +0 -60
- data/golf-java/resources/error.html +0 -29
- data/golf-java/resources/forcebot.txt +0 -0
- data/golf-java/resources/forceclient.txt +0 -0
- data/golf-java/resources/forceproxy.txt +0 -0
- data/golf-java/resources/head.html +0 -0
- data/golf-java/resources/jquery.address.js +0 -439
- data/golf-java/resources/jquery.golf.js +0 -945
- data/golf-java/resources/jquery.js +0 -4376
- data/golf-java/resources/jsdetect.html +0 -23
- data/golf-java/resources/loading.gif +0 -0
- data/golf-java/resources/new.html +0 -45
- data/golf-java/resources/new.static.html +0 -45
- data/golf-java/resources/noscript.forceclient.html +0 -11
- data/golf-java/resources/noscript.html +0 -18
- data/golf-java/resources/noscript.static.html +0 -15
- data/golf-java/resources/project.xml +0 -21
- data/golf-java/resources/proxy_project.xml +0 -11
- data/golf-java/resources/proxy_web.xml +0 -40
- data/golf-java/resources/static_project.xml +0 -37
- data/golf-java/resources/version +0 -1
- data/golf-java/resources/web.xml +0 -36
- data/golf-java/resources/welcome2golf.html +0 -50
- data/golf-java/src/com/thinkminimo/golf/GolfResource.java +0 -582
- data/golf-java/src/com/thinkminimo/golf/GolfServlet.java +0 -1055
- data/golf-java/src/com/thinkminimo/golf/JsonpTunnel.java +0 -86
- data/golf-java/src/com/thinkminimo/golf/Main.java +0 -1299
- data/golf-java/src/com/thinkminimo/golf/ProxyServlet.java +0 -577
- data/golf-java/src/com/yahoo/platform/yui/compressor/CssCompressor.java +0 -188
- data/golf-java/src/com/yahoo/platform/yui/compressor/JarClassLoader.java +0 -158
- data/golf-java/src/com/yahoo/platform/yui/compressor/JavaScriptCompressor.java +0 -1281
- data/golf-java/src/com/yahoo/platform/yui/compressor/JavaScriptIdentifier.java +0 -55
- data/golf-java/src/com/yahoo/platform/yui/compressor/JavaScriptToken.java +0 -28
- data/golf-java/src/com/yahoo/platform/yui/compressor/ScriptOrFnScope.java +0 -160
- data/golf-java/src/org/json/JSONArray.java +0 -934
- data/golf-java/src/org/json/JSONException.java +0 -27
- data/golf-java/src/org/json/JSONObject.java +0 -1550
- data/golf-java/src/org/json/JSONString.java +0 -18
- data/golf-java/src/org/json/JSONStringer.java +0 -78
- data/golf-java/src/org/json/JSONTokener.java +0 -422
- data/golf-java/src/org/json/JSONWriter.java +0 -323
- data/golf-java/test/client/golftest/README.markdown +0 -3
- data/golf-java/test/client/golftest/components/com/thinkminimo/golf/test/Harness.css +0 -114
- data/golf-java/test/client/golftest/components/com/thinkminimo/golf/test/Harness.html +0 -17
- data/golf-java/test/client/golftest/components/com/thinkminimo/golf/test/Harness.js +0 -81
- data/golf-java/test/client/golftest/components/com/thinkminimo/golf/test/Harness.res/asc.gif +0 -0
- data/golf-java/test/client/golftest/components/com/thinkminimo/golf/test/Harness.res/bg.gif +0 -0
- data/golf-java/test/client/golftest/components/com/thinkminimo/golf/test/Harness.res/desc.gif +0 -0
- data/golf-java/test/client/golftest/components/com/thinkminimo/golf/test/Harness.res/test/test.html +0 -1
- data/golf-java/test/client/golftest/controller.js +0 -131
- data/golf-java/test/client/golftest/forceclient.txt +0 -0
- data/golf-java/test/client/golftest/forceproxy.txt +0 -0
- data/golf-java/test/client/golftest/head.html +0 -1
- data/golf-java/test/client/golftest/scripts/jquery.tablesort.js +0 -75
- data/golf-java/test/client/golftest/styles/style.css +0 -18
- data/golf-java/test/client/golftest/test/test.html +0 -1
@@ -1,55 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* YUI Compressor
|
3
|
-
* Author: Julien Lecomte <jlecomte@yahoo-inc.com>
|
4
|
-
* Copyright (c) 2007, Yahoo! Inc. All rights reserved.
|
5
|
-
* Code licensed under the BSD License:
|
6
|
-
* http://developer.yahoo.net/yui/license.txt
|
7
|
-
*/
|
8
|
-
|
9
|
-
package com.yahoo.platform.yui.compressor;
|
10
|
-
|
11
|
-
import net.sourceforge.htmlunit.corejs.javascript.Token;
|
12
|
-
|
13
|
-
/**
|
14
|
-
* JavaScriptIdentifier represents a variable/function identifier.
|
15
|
-
*/
|
16
|
-
class JavaScriptIdentifier extends JavaScriptToken {
|
17
|
-
|
18
|
-
private int refcount = 0;
|
19
|
-
private String mungedValue;
|
20
|
-
private ScriptOrFnScope declaredScope;
|
21
|
-
private boolean markedForMunging = true;
|
22
|
-
|
23
|
-
JavaScriptIdentifier(String value, ScriptOrFnScope declaredScope) {
|
24
|
-
super(Token.NAME, value);
|
25
|
-
this.declaredScope = declaredScope;
|
26
|
-
}
|
27
|
-
|
28
|
-
ScriptOrFnScope getDeclaredScope() {
|
29
|
-
return declaredScope;
|
30
|
-
}
|
31
|
-
|
32
|
-
void setMungedValue(String value) {
|
33
|
-
mungedValue = value;
|
34
|
-
}
|
35
|
-
|
36
|
-
String getMungedValue() {
|
37
|
-
return mungedValue;
|
38
|
-
}
|
39
|
-
|
40
|
-
void preventMunging() {
|
41
|
-
markedForMunging = false;
|
42
|
-
}
|
43
|
-
|
44
|
-
boolean isMarkedForMunging() {
|
45
|
-
return markedForMunging;
|
46
|
-
}
|
47
|
-
|
48
|
-
void incrementRefcount() {
|
49
|
-
refcount++;
|
50
|
-
}
|
51
|
-
|
52
|
-
int getRefcount() {
|
53
|
-
return refcount;
|
54
|
-
}
|
55
|
-
}
|
@@ -1,28 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* YUI Compressor
|
3
|
-
* Author: Julien Lecomte <jlecomte@yahoo-inc.com>
|
4
|
-
* Copyright (c) 2007, Yahoo! Inc. All rights reserved.
|
5
|
-
* Code licensed under the BSD License:
|
6
|
-
* http://developer.yahoo.net/yui/license.txt
|
7
|
-
*/
|
8
|
-
|
9
|
-
package com.yahoo.platform.yui.compressor;
|
10
|
-
|
11
|
-
public class JavaScriptToken {
|
12
|
-
|
13
|
-
private int type;
|
14
|
-
private String value;
|
15
|
-
|
16
|
-
JavaScriptToken(int type, String value) {
|
17
|
-
this.type = type;
|
18
|
-
this.value = value;
|
19
|
-
}
|
20
|
-
|
21
|
-
int getType() {
|
22
|
-
return type;
|
23
|
-
}
|
24
|
-
|
25
|
-
String getValue() {
|
26
|
-
return value;
|
27
|
-
}
|
28
|
-
}
|
@@ -1,160 +0,0 @@
|
|
1
|
-
/*
|
2
|
-
* YUI Compressor
|
3
|
-
* Author: Julien Lecomte <jlecomte@yahoo-inc.com>
|
4
|
-
* Copyright (c) 2007, Yahoo! Inc. All rights reserved.
|
5
|
-
* Code licensed under the BSD License:
|
6
|
-
* http://developer.yahoo.net/yui/license.txt
|
7
|
-
*/
|
8
|
-
|
9
|
-
package com.yahoo.platform.yui.compressor;
|
10
|
-
|
11
|
-
import java.util.ArrayList;
|
12
|
-
import java.util.Enumeration;
|
13
|
-
import java.util.Hashtable;
|
14
|
-
|
15
|
-
class ScriptOrFnScope {
|
16
|
-
|
17
|
-
private int braceNesting;
|
18
|
-
private ScriptOrFnScope parentScope;
|
19
|
-
private ArrayList subScopes;
|
20
|
-
private Hashtable identifiers = new Hashtable();
|
21
|
-
private Hashtable hints = new Hashtable();
|
22
|
-
private boolean markedForMunging = true;
|
23
|
-
private int varcount = 0;
|
24
|
-
|
25
|
-
ScriptOrFnScope(int braceNesting, ScriptOrFnScope parentScope) {
|
26
|
-
this.braceNesting = braceNesting;
|
27
|
-
this.parentScope = parentScope;
|
28
|
-
this.subScopes = new ArrayList();
|
29
|
-
if (parentScope != null) {
|
30
|
-
parentScope.subScopes.add(this);
|
31
|
-
}
|
32
|
-
}
|
33
|
-
|
34
|
-
int getBraceNesting() {
|
35
|
-
return braceNesting;
|
36
|
-
}
|
37
|
-
|
38
|
-
ScriptOrFnScope getParentScope() {
|
39
|
-
return parentScope;
|
40
|
-
}
|
41
|
-
|
42
|
-
JavaScriptIdentifier declareIdentifier(String symbol) {
|
43
|
-
JavaScriptIdentifier identifier = (JavaScriptIdentifier) identifiers.get(symbol);
|
44
|
-
if (identifier == null) {
|
45
|
-
identifier = new JavaScriptIdentifier(symbol, this);
|
46
|
-
identifiers.put(symbol, identifier);
|
47
|
-
}
|
48
|
-
return identifier;
|
49
|
-
}
|
50
|
-
|
51
|
-
JavaScriptIdentifier getIdentifier(String symbol) {
|
52
|
-
return (JavaScriptIdentifier) identifiers.get(symbol);
|
53
|
-
}
|
54
|
-
|
55
|
-
void addHint(String variableName, String variableType) {
|
56
|
-
hints.put(variableName, variableType);
|
57
|
-
}
|
58
|
-
|
59
|
-
void preventMunging() {
|
60
|
-
if (parentScope != null) {
|
61
|
-
// The symbols in the global scope don't get munged,
|
62
|
-
// but the sub-scopes it contains do get munged.
|
63
|
-
markedForMunging = false;
|
64
|
-
}
|
65
|
-
}
|
66
|
-
|
67
|
-
private ArrayList getUsedSymbols() {
|
68
|
-
ArrayList result = new ArrayList();
|
69
|
-
Enumeration elements = identifiers.elements();
|
70
|
-
while (elements.hasMoreElements()) {
|
71
|
-
JavaScriptIdentifier identifier = (JavaScriptIdentifier) elements.nextElement();
|
72
|
-
String mungedValue = identifier.getMungedValue();
|
73
|
-
if (mungedValue == null) {
|
74
|
-
mungedValue = identifier.getValue();
|
75
|
-
}
|
76
|
-
result.add(mungedValue);
|
77
|
-
}
|
78
|
-
return result;
|
79
|
-
}
|
80
|
-
|
81
|
-
private ArrayList getAllUsedSymbols() {
|
82
|
-
ArrayList result = new ArrayList();
|
83
|
-
ScriptOrFnScope scope = this;
|
84
|
-
while (scope != null) {
|
85
|
-
result.addAll(scope.getUsedSymbols());
|
86
|
-
scope = scope.parentScope;
|
87
|
-
}
|
88
|
-
return result;
|
89
|
-
}
|
90
|
-
|
91
|
-
int incrementVarCount() {
|
92
|
-
varcount++;
|
93
|
-
return varcount;
|
94
|
-
}
|
95
|
-
|
96
|
-
void munge() {
|
97
|
-
|
98
|
-
if (!markedForMunging) {
|
99
|
-
// Stop right here if this scope was flagged as unsafe for munging.
|
100
|
-
return;
|
101
|
-
}
|
102
|
-
|
103
|
-
int pickFromSet = 1;
|
104
|
-
|
105
|
-
// Do not munge symbols in the global scope!
|
106
|
-
if (parentScope != null) {
|
107
|
-
|
108
|
-
ArrayList freeSymbols = new ArrayList();
|
109
|
-
|
110
|
-
freeSymbols.addAll(JavaScriptCompressor.ones);
|
111
|
-
freeSymbols.removeAll(getAllUsedSymbols());
|
112
|
-
if (freeSymbols.size() == 0) {
|
113
|
-
pickFromSet = 2;
|
114
|
-
freeSymbols.addAll(JavaScriptCompressor.twos);
|
115
|
-
freeSymbols.removeAll(getAllUsedSymbols());
|
116
|
-
}
|
117
|
-
if (freeSymbols.size() == 0) {
|
118
|
-
pickFromSet = 3;
|
119
|
-
freeSymbols.addAll(JavaScriptCompressor.threes);
|
120
|
-
freeSymbols.removeAll(getAllUsedSymbols());
|
121
|
-
}
|
122
|
-
if (freeSymbols.size() == 0) {
|
123
|
-
throw new IllegalStateException("The YUI Compressor ran out of symbols. Aborting...");
|
124
|
-
}
|
125
|
-
|
126
|
-
Enumeration elements = identifiers.elements();
|
127
|
-
while (elements.hasMoreElements()) {
|
128
|
-
if (freeSymbols.size() == 0) {
|
129
|
-
pickFromSet++;
|
130
|
-
if (pickFromSet == 2) {
|
131
|
-
freeSymbols.addAll(JavaScriptCompressor.twos);
|
132
|
-
} else if (pickFromSet == 3) {
|
133
|
-
freeSymbols.addAll(JavaScriptCompressor.threes);
|
134
|
-
} else {
|
135
|
-
throw new IllegalStateException("The YUI Compressor ran out of symbols. Aborting...");
|
136
|
-
}
|
137
|
-
// It is essential to remove the symbols already used in
|
138
|
-
// the containing scopes, or some of the variables declared
|
139
|
-
// in the containing scopes will be redeclared, which can
|
140
|
-
// lead to errors.
|
141
|
-
freeSymbols.removeAll(getAllUsedSymbols());
|
142
|
-
}
|
143
|
-
|
144
|
-
String mungedValue;
|
145
|
-
JavaScriptIdentifier identifier = (JavaScriptIdentifier) elements.nextElement();
|
146
|
-
if (identifier.isMarkedForMunging()) {
|
147
|
-
mungedValue = (String) freeSymbols.remove(0);
|
148
|
-
} else {
|
149
|
-
mungedValue = identifier.getValue();
|
150
|
-
}
|
151
|
-
identifier.setMungedValue(mungedValue);
|
152
|
-
}
|
153
|
-
}
|
154
|
-
|
155
|
-
for (int i = 0; i < subScopes.size(); i++) {
|
156
|
-
ScriptOrFnScope scope = (ScriptOrFnScope) subScopes.get(i);
|
157
|
-
scope.munge();
|
158
|
-
}
|
159
|
-
}
|
160
|
-
}
|