reorganize stuff for using JavaScript stuff from Eclipse

This commit is contained in:
dolby 2012-08-21 09:48:53 -04:00
parent 3317c1ccf6
commit 72e8dc9098
308 changed files with 1087 additions and 33377 deletions

View File

@ -3,5 +3,6 @@
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="src" path="source"/>
<classpathentry kind="src" path="data"/>
<classpathentry kind="output" path="bin"/>
</classpath>

View File

@ -0,0 +1,11 @@
java\/awt\/.*
javax\/swing\/.*
sun\/awt\/.*
sun\/swing\/.*
com\/sun\/.*
sun\/.*
org\/netbeans\/.*
org\/openide\/.*
com\/ibm\/crypto\/.*
com\/ibm\/security\/.*
org\/apache\/xerces\/.*

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -20,9 +20,9 @@ import org.junit.Test;
import com.ibm.wala.cast.java.client.JDTJavaSourceAnalysisEngine;
import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine;
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
import com.ibm.wala.cast.java.jdt.test.Activator;
import com.ibm.wala.cast.java.test.ide.IDEIRTestUtil;
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
import com.ibm.wala.core.tests.plugin.CoreTestsPlugin;
import com.ibm.wala.ide.tests.util.EclipseTestUtil;
import com.ibm.wala.ide.util.EclipseFileProvider;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
@ -43,7 +43,7 @@ public class JDTJava15IRTests extends IRTests {
@BeforeClass
public static void beforeClass() {
EclipseTestUtil.importZippedProject(TestPlugin.getDefault(), JDTJavaIRTests.PROJECT_NAME, JDTJavaIRTests.PROJECT_ZIP, new NullProgressMonitor());
EclipseTestUtil.importZippedProject(Activator.getDefault(), JDTJavaIRTests.PROJECT_NAME, JDTJavaIRTests.PROJECT_ZIP, new NullProgressMonitor());
System.err.println("finish importing project");
}
@ -63,7 +63,7 @@ public class JDTJava15IRTests extends IRTests {
try {
engine.setExclusionsFile((new EclipseFileProvider())
.getFileFromPlugin(CoreTestsPlugin.getDefault(), CallGraphTestUtil.REGRESSION_EXCLUSIONS).getAbsolutePath());
.getFileFromPlugin(Activator.getDefault(), CallGraphTestUtil.REGRESSION_EXCLUSIONS).getAbsolutePath());
} catch (IOException e) {
Assert.assertFalse("Cannot find exclusions file", true);
}

View File

@ -50,9 +50,9 @@ import org.junit.BeforeClass;
import com.ibm.wala.cast.java.client.JDTJavaSourceAnalysisEngine;
import com.ibm.wala.cast.java.client.JavaSourceAnalysisEngine;
import com.ibm.wala.cast.java.ipa.callgraph.JavaSourceAnalysisScope;
import com.ibm.wala.cast.java.jdt.test.Activator;
import com.ibm.wala.cast.java.test.ide.IDEIRTestUtil;
import com.ibm.wala.core.tests.callGraph.CallGraphTestUtil;
import com.ibm.wala.core.tests.plugin.CoreTestsPlugin;
import com.ibm.wala.ide.tests.util.EclipseTestUtil;
import com.ibm.wala.ide.util.EclipseFileProvider;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
@ -77,7 +77,7 @@ public class JDTJavaIRTests extends JavaIRTests {
@BeforeClass
public static void beforeClass() {
EclipseTestUtil.importZippedProject(TestPlugin.getDefault(), PROJECT_NAME, PROJECT_ZIP, new NullProgressMonitor());
EclipseTestUtil.importZippedProject(Activator.getDefault(), PROJECT_NAME, PROJECT_ZIP, new NullProgressMonitor());
System.err.println("finish importing project");
}
@ -97,7 +97,7 @@ public class JDTJavaIRTests extends JavaIRTests {
try {
engine.setExclusionsFile((new EclipseFileProvider())
.getFileFromPlugin(CoreTestsPlugin.getDefault(), CallGraphTestUtil.REGRESSION_EXCLUSIONS).getAbsolutePath());
.getFileFromPlugin(Activator.getDefault(), CallGraphTestUtil.REGRESSION_EXCLUSIONS).getAbsolutePath());
} catch (IOException e) {
Assert.assertFalse("Cannot find exclusions file", true);
}

View File

@ -38,17 +38,16 @@
package com.ibm.wala.cast.java.translator.jdt;
import java.io.File;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
import org.eclipse.core.resources.IFile;
import org.eclipse.core.resources.IProject;
import org.eclipse.jdt.core.ICompilationUnit;
import org.eclipse.jdt.core.JavaCore;
import org.eclipse.jdt.core.JavaModelException;
import org.eclipse.jdt.core.compiler.IProblem;
import org.eclipse.jdt.core.dom.AST;
import org.eclipse.jdt.core.dom.ASTParser;
import org.eclipse.jdt.core.dom.ASTRequestor;
@ -61,9 +60,13 @@ import com.ibm.wala.classLoader.JarFileModule;
import com.ibm.wala.classLoader.Module;
import com.ibm.wala.classLoader.ModuleEntry;
import com.ibm.wala.ide.classloader.EclipseSourceFileModule;
import com.ibm.wala.ide.util.HeadlessUtil;
import com.ibm.wala.ide.util.HeadlessUtil.EclipseCompiler;
import com.ibm.wala.ide.util.HeadlessUtil.Parser;
import com.ibm.wala.ipa.callgraph.AnalysisScope;
import com.ibm.wala.types.ClassLoaderReference;
import com.ibm.wala.util.debug.Assertions;
import com.ibm.wala.util.functions.Function;
/**
* A SourceModuleTranslator whose implementation of loadAllSources() uses the PolyglotFrontEnd pseudo-compiler to generate DOMO IR
@ -115,54 +118,44 @@ public class JDTSourceModuleTranslator implements SourceModuleTranslator {
public void loadAllSources(Set<ModuleEntry> modules) {
// TODO: we might need one AST (-> "Object" class) for all files.
// TODO: group by project and send 'em in
System.out.println(modules);
// sort files into projects
Map<IProject, Map<ICompilationUnit,EclipseSourceFileModule>> projectsFiles = new HashMap<IProject, Map<ICompilationUnit,EclipseSourceFileModule>>();
for (ModuleEntry m : modules) {
assert m instanceof EclipseSourceFileModule : "Expecing EclipseSourceFileModule, not " + m.getClass();
EclipseSourceFileModule entry = (EclipseSourceFileModule) m;
IProject proj = entry.getIFile().getProject();
if (!projectsFiles.containsKey(proj)) {
projectsFiles.put(proj, new HashMap<ICompilationUnit,EclipseSourceFileModule>());
HeadlessUtil.parseModules(modules, new EclipseCompiler<ICompilationUnit, CompilationUnit>() {
@Override
public ICompilationUnit getCompilationUnit(IFile file) {
return JavaCore.createCompilationUnitFrom(file);
}
projectsFiles.get(proj).put(JavaCore.createCompilationUnitFrom(entry.getIFile()), entry);
}
final ASTParser parser = ASTParser.newParser(AST.JLS3);
for (final Map.Entry<IProject,Map<ICompilationUnit,EclipseSourceFileModule>> proj : projectsFiles.entrySet()) {
parser.setProject(JavaCore.create(proj.getKey()));
parser.setResolveBindings(true);
Set<ICompilationUnit> units = proj.getValue().keySet();
parser.createASTs(units.toArray(new ICompilationUnit[units.size()]), new String[0], new ASTRequestor() {
public void acceptAST(ICompilationUnit source, CompilationUnit ast) {
try {
JDTJava2CAstTranslator jdt2cast = makeCAstTranslator(ast, source.getUnderlyingResource().getLocation().toOSString());
final Java2IRTranslator java2ir = makeIRTranslator();
java2ir.translate(proj.getValue().get(source), jdt2cast.translateToCAst());
} catch (JavaModelException e) {
e.printStackTrace();
@Override
public Parser<ICompilationUnit, CompilationUnit> getParser() {
return new Parser<ICompilationUnit, CompilationUnit>() {
final ASTParser parser;
{
parser = ASTParser.newParser(AST.JLS3);
parser.setResolveBindings(true);
}
IProblem[] problems = ast.getProblems();
int length = problems.length;
if (length > 0) {
StringBuffer buffer = new StringBuffer();
for (int i = 0; i < length; i++) {
buffer.append(problems[i].getMessage());
buffer.append('\n');
}
if (length != 0)
System.err.println("Unexpected problems in " + source.getElementName() + buffer.toString());
@Override
public void setProject(IProject project) {
parser.setProject(JavaCore.create(project));
}
}
}, null);
@Override
public void processASTs(final Map<ICompilationUnit,EclipseSourceFileModule> files, final Function<Object[], Boolean> errors) {
parser.createASTs(files.keySet().toArray(new ICompilationUnit[files.size()]), new String[0], new ASTRequestor() {
public void acceptAST(ICompilationUnit source, CompilationUnit ast) {
try {
JDTJava2CAstTranslator jdt2cast = makeCAstTranslator(ast, source.getUnderlyingResource().getLocation().toOSString());
final Java2IRTranslator java2ir = makeIRTranslator();
java2ir.translate(files.get(source), jdt2cast.translateToCAst());
} catch (JavaModelException e) {
e.printStackTrace();
}
}
errors.apply(ast.getProblems());
}
}, null);
}
};
}
});
}
protected Java2IRTranslator makeIRTranslator() {

View File

@ -1,8 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="source"/>
<classpathentry kind="lib" path="lib/polyglot.jar"/>
<classpathentry kind="lib" path="lib/java_cup.jar"/>
<classpathentry exported="true" kind="lib" path="lib/polyglot.jar"/>
<classpathentry exported="true" kind="lib" path="lib/java_cup.jar"/>
<classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
<classpathentry kind="output" path="bin"/>

View File

@ -11,25 +11,41 @@ Require-Bundle: com.ibm.wala.cast.java,
org.eclipse.core.runtime,
com.ibm.wala.shrike,
org.eclipse.jdt.core,
org.eclipse.core.resources,
com.ibm.wala.ide
org.eclipse.core.resources
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: com.ibm.wala.cast.java.client.polyglot,
com.ibm.wala.cast.java.polyglot;uses:="org.osgi.framework,org.eclipse.core.runtime",
Export-Package: com.ibm.wala.cast.java.polyglot;uses:="org.eclipse.core.runtime,org.osgi.framework",
com.ibm.wala.cast.java.translator.polyglot;
uses:="com.ibm.wala.types,
polyglot.types,
polyglot.util,
polyglot.ast,
com.ibm.wala.ipa.cha,
com.ibm.wala.cast.java.client,
com.ibm.wala.classLoader,
uses:="polyglot.types,
com.ibm.wala.cast.tree,
com.ibm.wala.cast.java.loader,
com.ibm.wala.ipa.callgraph.impl,
com.ibm.wala.ipa.callgraph,
polyglot.frontend.goals,
com.ibm.wala.cast.tree.impl,
com.ibm.wala.classLoader,
com.ibm.wala.ipa.cha,
com.ibm.wala.cast.java.types,
com.ibm.wala.cast.java.translator,
com.ibm.wala.cast.java.types"
com.ibm.wala.cast.java.client,
com.ibm.wala.types,
polyglot.ast,
polyglot.util,
com.ibm.wala.ipa.callgraph,
polyglot.frontend,
com.ibm.wala.cast.ir.translator,
com.ibm.wala.ipa.callgraph.impl,
com.ibm.wala.cast.java.loader,
com.ibm.wala.cast.tree.impl",
java_cup,
java_cup.runtime,
polyglot.ast,
polyglot.dispatch,
polyglot.frontend,
polyglot.lex,
polyglot.main,
polyglot.parse,
polyglot.qq,
polyglot.types,
polyglot.types.reflect,
polyglot.util,
polyglot.util.typedump,
polyglot.visit
Bundle-ClassPath: lib/java_cup.jar,
lib/polyglot.jar,
.

View File

@ -1,4 +1,6 @@
source.. = source/
output.. = bin/
bin.includes = META-INF/,\
.
.,\
lib/java_cup.jar,\
lib/polyglot.jar

View File

@ -5,13 +5,12 @@ Bundle-SymbolicName: com.ibm.wala.cast.java.test
Bundle-Version: 1.0.0
Bundle-Activator: com.ibm.wala.cast.java.test.TestPlugin
Bundle-Vendor: IBM
Require-Bundle: org.junit4,
com.ibm.wala.core.tests,
Require-Bundle: com.ibm.wala.core.tests,
com.ibm.wala.cast.java,
com.ibm.wala.cast,
com.ibm.wala.core,
com.ibm.wala.shrike,
org.eclipse.core.runtime
org.junit4
Bundle-ActivationPolicy: lazy
Export-Package: com.ibm.wala.cast.java.test
Bundle-RequiredExecutionEnvironment: J2SE-1.5

View File

@ -1,53 +0,0 @@
/******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*****************************************************************************/
package com.ibm.wala.cast.java.test;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
* The main plugin class to be used in the desktop.
*/
public class TestPlugin extends Plugin {
//The shared instance.
private static TestPlugin plugin;
/**
* The constructor.
*/
public TestPlugin() {
plugin = this;
}
/**
* This method is called upon plug-in activation
*/
public void start(BundleContext context) throws Exception {
super.start(context);
}
/**
* This method is called when the plug-in is stopped
*/
public void stop(BundleContext context) throws Exception {
super.stop(context);
plugin = null;
}
/**
* Returns the shared instance.
*/
public static TestPlugin getDefault() {
return plugin;
}
}

View File

@ -3,15 +3,12 @@ Bundle-ManifestVersion: 2
Bundle-Name: Java Source WALA Front End
Bundle-SymbolicName: com.ibm.wala.cast.java
Bundle-Version: 1.0.0.qualifier
Bundle-Activator: com.ibm.wala.cast.java.JavaSourcePlugin
Bundle-Vendor: rfuhrer@watson.ibm.com
Require-Bundle: com.ibm.wala.cast,
com.ibm.wala.core,
com.ibm.wala.shrike,
org.eclipse.core.runtime
com.ibm.wala.shrike
Bundle-ActivationPolicy: lazy
Export-Package: com.ibm.wala.cast.java,
com.ibm.wala.cast.java.analysis.typeInference,
Export-Package: com.ibm.wala.cast.java.analysis.typeInference,
com.ibm.wala.cast.java.client,
com.ibm.wala.cast.java.client.impl,
com.ibm.wala.cast.java.examples.ast,

View File

@ -1,53 +0,0 @@
/******************************************************************************
* Copyright (c) 2002 - 2006 IBM Corporation.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* http://www.eclipse.org/legal/epl-v10.html
*
* Contributors:
* IBM Corporation - initial API and implementation
*****************************************************************************/
package com.ibm.wala.cast.java;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
* The main plugin class to be used in the desktop.
*/
public class JavaSourcePlugin extends Plugin {
//The shared instance.
private static JavaSourcePlugin plugin;
/**
* The constructor.
*/
public JavaSourcePlugin() {
plugin = this;
}
/**
* This method is called upon plug-in activation
*/
public void start(BundleContext context) throws Exception {
super.start(context);
}
/**
* This method is called when the plug-in is stopped
*/
public void stop(BundleContext context) throws Exception {
super.stop(context);
plugin = null;
}
/**
* Returns the shared instance.
*/
public static JavaSourcePlugin getDefault() {
return plugin;
}
}

View File

@ -5,16 +5,14 @@ Bundle-SymbolicName: com.ibm.wala.cast.js.rhino.test
Bundle-Version: 1.0.0
Bundle-Activator: com.ibm.wala.cast.js.rhino.test.Activator
Bundle-Vendor: IBM
Require-Bundle: org.eclipse.core.runtime,
com.ibm.wala.cast.js.rhino;bundle-version="1.0.0",
Require-Bundle: com.ibm.wala.cast.js.rhino;bundle-version="1.0.0",
com.ibm.wala.cast.js;bundle-version="1.0.0",
com.ibm.wala.cast;bundle-version="1.0.0",
com.ibm.wala.core;bundle-version="1.1.3",
com.ibm.wala.cast.js.test;bundle-version="1.0.0",
com.ibm.wala.cast.test;bundle-version="1.0.0",
com.ibm.wala.core.tests;bundle-version="1.1.3",
org.junit4;bundle-version="4.3.1",
com.ibm.wala.ide;bundle-version="1.1.3"
org.junit4;bundle-version="4.3.1"
Bundle-RequiredExecutionEnvironment: J2SE-1.5
Bundle-ActivationPolicy: lazy
Export-Package: com.ibm.wala.cast.js.test

View File

@ -1,50 +0,0 @@
package com.ibm.wala.cast.js.rhino.test;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends Plugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.ibm.wala.cast.js.rhino.test";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

View File

@ -3,10 +3,8 @@ Bundle-ManifestVersion: 2
Bundle-Name: Rhino Plug-in
Bundle-SymbolicName: com.ibm.wala.cast.js.rhino
Bundle-Version: 1.0.0
Bundle-Activator: com.ibm.wala.js.rhino.Activator
Bundle-Vendor: IBM
Require-Bundle: org.eclipse.core.runtime,
com.ibm.wala.cast;bundle-version="1.0.0",
Require-Bundle: com.ibm.wala.cast;bundle-version="1.0.0",
com.ibm.wala.cast.js;bundle-version="1.0.0",
com.ibm.wala.core;bundle-version="1.1.3"
Bundle-RequiredExecutionEnvironment: J2SE-1.5

View File

@ -1,50 +0,0 @@
package com.ibm.wala.js.rhino;
import org.eclipse.core.runtime.Plugin;
import org.osgi.framework.BundleContext;
/**
* The activator class controls the plug-in life cycle
*/
public class Activator extends Plugin {
// The plug-in ID
public static final String PLUGIN_ID = "com.ibm.wala.js.rhino";
// The shared instance
private static Activator plugin;
/**
* The constructor
*/
public Activator() {
}
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugins#start(org.osgi.framework.BundleContext)
*/
public void start(BundleContext context) throws Exception {
super.start(context);
plugin = this;
}
/*
* (non-Javadoc)
* @see org.eclipse.core.runtime.Plugin#stop(org.osgi.framework.BundleContext)
*/
public void stop(BundleContext context) throws Exception {
plugin = null;
super.stop(context);
}
/**
* Returns the shared instance
*
* @return the shared instance
*/
public static Activator getDefault() {
return plugin;
}
}

View File

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>com.ibm.wala.cast.js.test.data</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.wst.jsdt.core.javascriptValidator</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.ManifestBuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.pde.SchemaBuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
<nature>org.eclipse.pde.PluginNature</nature>
</natures>
</projectDescription>

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>

View File

@ -0,0 +1 @@
org.eclipse.wst.jsdt.launching.baseBrowserLibrary

View File

@ -0,0 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: Data
Bundle-SymbolicName: com.ibm.wala.cast.js.test.data;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-ClassPath: examples-src/
Bundle-ActivationPolicy: lazy

View File

@ -0,0 +1,2 @@
bin.includes = META-INF/,\
examples-src/

View File

@ -1,263 +1,258 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<script>
(function top () {
var c = n.jQuery = n.$ = function dollar (a, d) {
return new c.fn.init(a, d)
}
c.fn = c.prototype = {
init: function init (a, d) {
a = a || document;
if (a.nodeType) {
this[0] = a;
this.length = 1;
this.context = a;
return this
}
if (typeof a === "string") {
var f = r.exec(a);
if (f && (f[1] || !d)) if (f[1]) a = c.clean([f[1]], d);
else {
if ((d = document.getElementById(f[3])) && d.id != f[3]) return c().find(a);
f = c(d || []);
f.context = document;
f.selector = a;
return f
} else return c(d).find(a)
} else if (c.isFunction(a)) return c(document).ready(a);
if (a.selector && a.context) {
this.selector =
a.selector;
this.context = a.context
}
return this.setArray(c.isArray(a) ? a : c.makeArray(a))
}
};
c.extend = c.fn.extend = function extend () {
var a =
arguments[0] || {},
d = 1,
f = arguments.length,
j = false,
q;
if (typeof a === "boolean") {
j = a;
a = arguments[1] || {};
d = 2
}
if (typeof a !== "object" && !c.isFunction(a)) a = {};
if (f == d) {
a = this;
--d
}
for (; d < f; d++) if ((q = arguments[d]) != null) for (var t in q) {
var y = a[t],
A = q[t];
if (a !== A) if (j && A && typeof A === "object" && !A.nodeType) a[t] = c.extend(j, y || (A.length != null ? [] : {}), A);
else if (A !== void 0) a[t] = A
}
return a
};
c.extend({
noConflict: function noConflict (a) {
n.$ =
B;
if (a) n.jQuery = w;
return c
},
isFunction: 2,
each: function each (a, d, f) {
var j, q = 0,
t = a.length;
if (f) if (t === void 0) for (j in a) {
if (d.apply(a[j], f) === false) break
} else for (; q < t;) {
if (d.apply(a[q++], f) === false) break
} else if (t === void 0) for (j in a) {
if (d.call(a[j], j, a[j]) === false) break
} else for (f = a[0]; q < t && d.call(f, q, f) !== false; f = a[++q]);
return a
},
className: {
add: function add (a, d) {
c.each((d || "").split(/\s+/), function (f, j) {
if (a.nodeType == 1 && !c.className.has(a.className, j)) a.className += (a.className ? " " : "") + j
})
},
remove: function remove (a, d) {
if (a.nodeType == 1) a.className = d !== void 0 ? c.grep(a.className.split(/\s+/), function (f) {
return !c.className.has(d, f)
}).join(" ") : ""
},
has: function has (a, d) {
return a && c.inArray(d, (a.className || a).toString().split(/\s+/)) > -1
}
},
swap: function swap (a, d, f) {
var j = {};
for (var q in d) {
j[q] = a.style[q];
a.style[q] = d[q]
}
f.call(a);
for (q in d) a.style[q] = j[q]
},
css: function css (a, d, f, j) {
if (d == "width" || d == "height") {
var q;
f = {
position: "absolute",
visibility: "hidden",
display: "block"
};
var t = d == "width" ? ["Left", "Right"] : ["Top", "Bottom"],
y = function () {
q = d == "width" ? a.offsetWidth : a.offsetHeight;
j !== "border" && c.each(t, function () {
j || (q -= parseFloat(c.curCSS(a, "padding" + this, true)) || 0);
if (j === "margin") q += parseFloat(c.curCSS(a, "margin" + this, true)) || 0;
else q -= parseFloat(c.curCSS(a, "border" + this + "Width", true)) || 0
})
};
a.offsetWidth !== 0 ? y() : c.swap(a, f, y);
return Math.max(0, Math.round(q))
}
return c.curCSS(a, d, f)
},
curCSS: function curCSS (a, d, f) {
var j, q = a.style;
if (d == "opacity" && !c.support.opacity) {
j = c.attr(q, "opacity");
return j == "" ? "1" : j
}
if (d.match(/float/i)) d = W;
if (!f && q && q[d]) j = q[d];
else if (F.getComputedStyle) {
if (d.match(/float/i)) d = "float";
d = d.replace(/([A-Z])/g, "-$1").toLowerCase();
if (a = F.getComputedStyle(a, null)) j = a.getPropertyValue(d);
if (d == "opacity" && j == "") j = "1"
} else if (a.currentStyle) {
j = d.replace(/\-(\w)/g, function (t, y) {
return y.toUpperCase()
});
j = a.currentStyle[d] || a.currentStyle[j];
if (!/^\d+(px)?$/i.test(j) && /^\d/.test(j)) {
d = q.left;
f = a.runtimeStyle.left;
a.runtimeStyle.left = a.currentStyle.left;
q.left = j || 0;
j = q.pixelLeft + "px";
q.left = d;
a.runtimeStyle.left = f
}
}
return j
},
clean: function clean (a, d, f) {
d = d || document;
if (typeof d.createElement === "undefined") d = d.ownerDocument || d[0] && d[0].ownerDocument || document;
if (!f && a.length === 1 && typeof a[0] === "string") {
var j = /^<(\w+)\s*\/?>$/.exec(a[0]);
if (j) return [d.createElement(j[1])]
}
c.each(a, function (y, A) {
if (typeof A === "number") A += "";
if (A) {
if (typeof A === "string") {
A = A.replace(/(<(\w+)[^>]*?)\/>/g, function (M, Q, S) {
return S.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? M : Q + "></" + S + ">"
});
y = A.replace(/^\s+/, "").substring(0, 10).toLowerCase();
var L = !y.indexOf("<opt") && [1, "<select multiple='multiple'>", "</select>"] || !y.indexOf("<leg") && [1, "<fieldset>", "</fieldset>"] || y.match(/^<(thead|tbody|tfoot|colg|cap)/) && [1, "<table>", "</table>"] || !y.indexOf("<tr") && [2, "<table><tbody>", "</tbody></table>"] || (!y.indexOf("<td") || !y.indexOf("<th")) && [3, "<table><tbody><tr>", "</tr></tbody></table>"] || !y.indexOf("<col") && [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"] || !c.support.htmlSerialize && [1, "div<div>", "</div>"] || [0, "", ""];
for (t.innerHTML = L[1] + A + L[2]; L[0]--;) t = t.lastChild;
if (!c.support.tbody) {
var N = /<tbody/i.test(A);
y = !y.indexOf("<table") && !N ? t.firstChild && t.firstChild.childNodes : L[1] == "<table>" && !N ? t.childNodes : [];
for (L = y.length - 1; L >= 0; --L) c.nodeName(y[L], "tbody") && !y[L].childNodes.length && y[L].parentNode.removeChild(y[L])
}!c.support.leadingWhitespace && /^\s/.test(A) && t.insertBefore(d.createTextNode(A.match(/^\s*/)[0]), t.firstChild);
A = c.makeArray(t.childNodes)
}
if (A.nodeType) q.push(A);
else q = c.merge(q, A)
}
});
if (f) {
for (a = 0; q[a]; a++) if (c.nodeName(q[a], "script") && (!q[a].type || q[a].type.toLowerCase() === "text/javascript")) j.push(q[a].parentNode ? q[a].parentNode.removeChild(q[a]) : q[a]);
else {
q[a].nodeType === 1 && q.splice.apply(q, [a + 1, 0].concat(c.makeArray(q[a].getElementsByTagName("script"))));
f.appendChild(q[a])
}
return j
}
return q
},
attr: function attr (a, d, f) {
if (!(!a || a.nodeType == 3 || a.nodeType == 8)) {
var j = !c.isXMLDoc(a),
q = f !== void 0;
d = j && c.props[d] || d;
if (a.tagName) {
var t = /href|src|style/.test(d);
if (d in a && j && !t) {
if (q) {
if (d == "type" && c.nodeName(a, "input") && a.parentNode) throw "type property can't be changed";
a[d] = f
}
if (c.nodeName(a, "form") && a.getAttributeNode(d)) return a.getAttributeNode(d).nodeValue;
if (d == "tabIndex") return (d = a.getAttributeNode("tabIndex")) && d.specified ? d.value : a.nodeName.match(/(button|input|object|select|textarea)/i) ? 0 : a.nodeName.match(/^(a|area)$/i) && a.href ? 0 : void 0;
return a[d]
}
if (!c.support.style && j && d == "style") return c.attr(a.style, "cssText", f);
q && a.setAttribute(d, "" + f);
a = !c.support.hrefNormalized && j && t ? a.getAttribute(d, 2) : a.getAttribute(d);
return a === null ? void 0 : a
}
if (!c.support.opacity && d == "opacity") {
if (q) {
a.zoom = 1;
a.filter = (a.filter || "").replace(/alpha\([^)]*\)/, "") + (parseInt(f) + "" == "NaN" ? "" : "alpha(opacity=" + f * 100 + ")")
}
return a.filter && a.filter.indexOf("opacity=") >= 0 ? parseFloat(a.filter.match(/opacity=([^)]*)/)[1]) / 100 + "" : ""
}
d = d.replace(/-([a-z])/ig, function (y, A) {
return A.toUpperCase()
});
if (q) a[d] = f;
return a[d]
}
},
makeArray: function makeArray (a) {
var d = [];
if (a != null) {
var f = a.length;
if (f == null || typeof a === "string" || c.isFunction(a) || a.setInterval) d[0] = a;
else for (; f;) d[--f] = a[f]
}
return d
},
inArray: function inArray (a, d) {
for (var f = 0, j = d.length; f < j; f++) if (d[f] === a) return f;
return -1
},
merge: function merge (a, d) {
var f = 0,
j, q = a.length;
if (c.support.getAll) for (;
(j = d[f++]) != null;) a[q++] = j;
else for (;
(j =
d[f++]) != null;) if (j.nodeType != 8) a[q++] = j;
return a
},
});
})();
</script>
/**
*
*/
(function top () {
var c = n.jQuery = n.$ = function dollar (a, d) {
return new c.fn.init(a, d);
}
c.fn = c.prototype = {
init: function init (a, d) {
a = a || document;
if (a.nodeType) {
this[0] = a;
this.length = 1;
this.context = a;
return this
}
if (typeof a === "string") {
var f = r.exec(a);
if (f && (f[1] || !d)) if (f[1]) a = c.clean([f[1]], d);
else {
if ((d = document.getElementById(f[3])) && d.id != f[3]) return c().find(a);
f = c(d || []);
f.context = document;
f.selector = a;
return f
} else return c(d).find(a)
} else if (c.isFunction(a)) return c(document).ready(a);
if (a.selector && a.context) {
this.selector =
a.selector;
this.context = a.context
}
return this.setArray(c.isArray(a) ? a : c.makeArray(a))
}
};
c.extend = c.fn.extend = function extend () {
var a =
arguments[0] || {},
d = 1,
f = arguments.length,
j = false,
q;
if (typeof a === "boolean") {
j = a;
a = arguments[1] || {};
d = 2
}
if (typeof a !== "object" && !c.isFunction(a)) a = {};
if (f == d) {
a = this;
--d
}
for (; d < f; d++) if ((q = arguments[d]) != null) for (var t in q) {
var y = a[t],
A = q[t];
if (a !== A) if (j && A && typeof A === "object" && !A.nodeType) a[t] = c.extend(j, y || (A.length != null ? [] : {}), A);
else if (A !== void 0) a[t] = A
}
return a
};
c.extend({
noConflict: function noConflict (a) {
n.$ =
B;
if (a) n.jQuery = w;
return c
},
isFunction: 2,
each: function each (a, d, f) {
var j, q = 0,
t = a.length;
if (f) if (t === void 0) for (j in a) {
if (d.apply(a[j], f) === false) break;
} else for (; q < t;) {
if (d.apply(a[q++], f) === false) break;
} else if (t === void 0) for (j in a) {
if (d.call(a[j], j, a[j]) === false) break;
} else for (f = a[0]; q < t && d.call(f, q, f) !== false; f = a[++q]);
return a
},
className: {
add: function add (a, d) {
c.each((d || "").split(/\s+/), function (f, j) {
if (a.nodeType == 1 && !c.className.has(a.className, j)) a.className += (a.className ? " " : "") + j
})
},
remove: function remove (a, d) {
if (a.nodeType == 1) a.className = d !== void 0 ? c.grep(a.className.split(/\s+/), function (f) {
return !c.className.has(d, f)
}).join(" ") : ""
},
has: function has (a, d) {
return a && c.inArray(d, (a.className || a).toString().split(/\s+/)) > -1
}
},
swap: function swap (a, d, f) {
var j = {};
for (var q in d) {
j[q] = a.style[q];
a.style[q] = d[q]
}
f.call(a);
for (q in d) a.style[q] = j[q]
},
css: function css (a, d, f, j) {
if (d == "width" || d == "height") {
var q;
f = {
position: "absolute",
visibility: "hidden",
display: "block"
};
var t = d == "width" ? ["Left", "Right"] : ["Top", "Bottom"],
y = function () {
q = d == "width" ? a.offsetWidth : a.offsetHeight;
j !== "border" && c.each(t, function () {
j || (q -= parseFloat(c.curCSS(a, "padding" + this, true)) || 0);
if (j === "margin") q += parseFloat(c.curCSS(a, "margin" + this, true)) || 0;
else q -= parseFloat(c.curCSS(a, "border" + this + "Width", true)) || 0
})
};
a.offsetWidth !== 0 ? y() : c.swap(a, f, y);
return Math.max(0, Math.round(q))
}
return c.curCSS(a, d, f)
},
curCSS: function curCSS (a, d, f) {
var j, q = a.style;
if (d == "opacity" && !c.support.opacity) {
j = c.attr(q, "opacity");
return j == "" ? "1" : j
}
if (d.match(/float/i)) d = W;
if (!f && q && q[d]) j = q[d];
else if (F.getComputedStyle) {
if (d.match(/float/i)) d = "float";
d = d.replace(/([A-Z])/g, "-$1").toLowerCase();
if (a = F.getComputedStyle(a, null)) j = a.getPropertyValue(d);
if (d == "opacity" && j == "") j = "1"
} else if (a.currentStyle) {
j = d.replace(/\-(\w)/g, function (t, y) {
return y.toUpperCase()
});
j = a.currentStyle[d] || a.currentStyle[j];
if (!/^\d+(px)?$/i.test(j) && /^\d/.test(j)) {
d = q.left;
f = a.runtimeStyle.left;
a.runtimeStyle.left = a.currentStyle.left;
q.left = j || 0;
j = q.pixelLeft + "px";
q.left = d;
a.runtimeStyle.left = f
}
}
return j
},
clean: function clean (a, d, f) {
d = d || document;
if (typeof d.createElement === "undefined") d = d.ownerDocument || d[0] && d[0].ownerDocument || document;
if (!f && a.length === 1 && typeof a[0] === "string") {
var j = /^<(\w+)\s*\/?>$/.exec(a[0]);
if (j) return [d.createElement(j[1])]
}
c.each(a, function (y, A) {
if (typeof A === "number") A += "";
if (A) {
if (typeof A === "string") {
A = A.replace(/(<(\w+)[^>]*?)\/>/g, function (M, Q, S) {
return S.match(/^(abbr|br|col|img|input|link|meta|param|hr|area|embed)$/i) ? M : Q + "></" + S + ">"
});
y = A.replace(/^\s+/, "").substring(0, 10).toLowerCase();
var L = !y.indexOf("<opt") && [1, "<select multiple='multiple'>", "</select>"] || !y.indexOf("<leg") && [1, "<fieldset>", "</fieldset>"] || y.match(/^<(thead|tbody|tfoot|colg|cap)/) && [1, "<table>", "</table>"] || !y.indexOf("<tr") && [2, "<table><tbody>", "</tbody></table>"] || (!y.indexOf("<td") || !y.indexOf("<th")) && [3, "<table><tbody><tr>", "</tr></tbody></table>"] || !y.indexOf("<col") && [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"] || !c.support.htmlSerialize && [1, "div<div>", "</div>"] || [0, "", ""];
for (t.innerHTML = L[1] + A + L[2]; L[0]--;) t = t.lastChild;
if (!c.support.tbody) {
var N = /<tbody/i.test(A);
y = !y.indexOf("<table") && !N ? t.firstChild && t.firstChild.childNodes : L[1] == "<table>" && !N ? t.childNodes : [];
for (L = y.length - 1; L >= 0; --L) c.nodeName(y[L], "tbody") && !y[L].childNodes.length && y[L].parentNode.removeChild(y[L])
}!c.support.leadingWhitespace && /^\s/.test(A) && t.insertBefore(d.createTextNode(A.match(/^\s*/)[0]), t.firstChild);
A = c.makeArray(t.childNodes)
}
if (A.nodeType) q.push(A);
else q = c.merge(q, A)
}
});
if (f) {
for (a = 0; q[a]; a++) if (c.nodeName(q[a], "script") && (!q[a].type || q[a].type.toLowerCase() === "text/javascript")) j.push(q[a].parentNode ? q[a].parentNode.removeChild(q[a]) : q[a]);
else {
q[a].nodeType === 1 && q.splice.apply(q, [a + 1, 0].concat(c.makeArray(q[a].getElementsByTagName("script"))));
f.appendChild(q[a])
}
return j
}
return q
},
attr: function attr (a, d, f) {
if (!(!a || a.nodeType == 3 || a.nodeType == 8)) {
var j = !c.isXMLDoc(a),
q = f !== void 0;
d = j && c.props[d] || d;
if (a.tagName) {
var t = /href|src|style/.test(d);
if (d in a && j && !t) {
if (q) {
if (d == "type" && c.nodeName(a, "input") && a.parentNode) throw "type property can't be changed";
a[d] = f
}
if (c.nodeName(a, "form") && a.getAttributeNode(d)) return a.getAttributeNode(d).nodeValue;
if (d == "tabIndex") return (d = a.getAttributeNode("tabIndex")) && d.specified ? d.value : a.nodeName.match(/(button|input|object|select|textarea)/i) ? 0 : a.nodeName.match(/^(a|area)$/i) && a.href ? 0 : void 0;
return a[d]
}
if (!c.support.style && j && d == "style") return c.attr(a.style, "cssText", f);
q && a.setAttribute(d, "" + f);
a = !c.support.hrefNormalized && j && t ? a.getAttribute(d, 2) : a.getAttribute(d);
return a === null ? void 0 : a
}
if (!c.support.opacity && d == "opacity") {
if (q) {
a.zoom = 1;
a.filter = (a.filter || "").replace(/alpha\([^)]*\)/, "") + (parseInt(f) + "" == "NaN" ? "" : "alpha(opacity=" + f * 100 + ")")
}
return a.filter && a.filter.indexOf("opacity=") >= 0 ? parseFloat(a.filter.match(/opacity=([^)]*)/)[1]) / 100 + "" : ""
}
d = d.replace(/-([a-z])/ig, function (y, A) {
return A.toUpperCase()
});
if (q) a[d] = f;
return a[d]
}
},
makeArray: function makeArray (a) {
var d = [];
if (a != null) {
var f = a.length;
if (f == null || typeof a === "string" || c.isFunction(a) || a.setInterval) d[0] = a;
else for (; f;) d[--f] = a[f]
}
return d
},
inArray: function inArray (a, d) {
for (var f = 0, j = d.length; f < j; f++) if (d[f] === a) return f;
return -1
},
merge: function merge (a, d) {
var f = 0,
j, q = a.length;
if (c.support.getAll) for (;
(j = d[f++]) != null;) a[q++] = j;
else for (;
(j =
d[f++]) != null;) if (j.nodeType != 8) a[q++] = j;
return a
}
});
})();

View File

@ -0,0 +1,8 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<script src="jquery.js">
</script>

Some files were not shown because too many files have changed in this diff Show More