diff --git a/plugins/codebehind/pom.xml b/plugins/codebehind/pom.xml
deleted file mode 100644
index ec347f206..000000000
--- a/plugins/codebehind/pom.xml
+++ /dev/null
@@ -1,72 +0,0 @@
-
-
-
- 4.0.0
-
- org.apache.struts
- struts2-plugins
- 2.5-SNAPSHOT
-
-
- struts2-codebehind-plugin
- jar
- Struts 2 Codebehind Plugin
-
-
-
- org.apache.commons
- commons-lang3
-
-
- ${project.groupId}
- struts2-junit-plugin
- test
-
-
- mockobjects
- mockobjects-core
- test
-
-
- org.springframework
- spring-test
- test
-
-
- org.springframework
- spring-core
- test
-
-
-
- javax.servlet
- jsp-api
- provided
-
-
-
-
- UTF-8
-
-
diff --git a/plugins/codebehind/src/main/java/org/apache/struts2/codebehind/CodebehindUnknownHandler.java b/plugins/codebehind/src/main/java/org/apache/struts2/codebehind/CodebehindUnknownHandler.java
deleted file mode 100644
index 430ec6557..000000000
--- a/plugins/codebehind/src/main/java/org/apache/struts2/codebehind/CodebehindUnknownHandler.java
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.codebehind;
-
-import com.opensymphony.xwork2.Action;
-import com.opensymphony.xwork2.ActionContext;
-import com.opensymphony.xwork2.ObjectFactory;
-import com.opensymphony.xwork2.Result;
-import com.opensymphony.xwork2.UnknownHandler;
-import com.opensymphony.xwork2.XWorkException;
-import com.opensymphony.xwork2.config.Configuration;
-import com.opensymphony.xwork2.config.ConfigurationException;
-import com.opensymphony.xwork2.config.entities.ActionConfig;
-import com.opensymphony.xwork2.config.entities.InterceptorLocator;
-import com.opensymphony.xwork2.config.entities.PackageConfig;
-import com.opensymphony.xwork2.config.entities.ResultConfig;
-import com.opensymphony.xwork2.config.entities.ResultTypeConfig;
-import com.opensymphony.xwork2.config.providers.InterceptorBuilder;
-import com.opensymphony.xwork2.inject.Inject;
-import com.opensymphony.xwork2.util.ClassLoaderUtil;
-import com.opensymphony.xwork2.util.logging.Logger;
-import com.opensymphony.xwork2.util.logging.LoggerFactory;
-
-import javax.servlet.ServletContext;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Collections;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-/**
- * Uses code-behind conventions to solve the two unknown problems.
- */
-public class CodebehindUnknownHandler implements UnknownHandler {
-
- protected String defaultPackageName;
- protected ServletContext servletContext;
- protected Map resultsByExtension;
- protected String templatePathPrefix;
- protected Configuration configuration;
- protected ObjectFactory objectFactory;
-
- protected static final Logger LOG = LoggerFactory.getLogger(CodebehindUnknownHandler.class);
-
- @Inject
- public CodebehindUnknownHandler(@Inject("struts.codebehind.defaultPackage") String defaultPackage,
- @Inject Configuration configuration) {
-
- this.configuration = configuration;
- this.defaultPackageName = defaultPackage;
- resultsByExtension = new LinkedHashMap();
- PackageConfig parentPackage = configuration.getPackageConfig(defaultPackageName);
- if (parentPackage == null) {
- throw new ConfigurationException("Unknown parent package: "+parentPackage);
- }
- Map results = parentPackage.getAllResultTypeConfigs();
-
- resultsByExtension.put("jsp", results.get("dispatcher"));
- resultsByExtension.put("vm", results.get("velocity"));
- resultsByExtension.put("ftl", results.get("freemarker"));
-
- }
-
- @Inject("struts.codebehind.pathPrefix")
- public void setPathPrefix(String prefix) {
- this.templatePathPrefix=prefix;
- }
-
- @Inject
- public void setServletContext(ServletContext servletContext) {
- this.servletContext = servletContext;
- }
-
- @Inject
- public void setObjectFactory(ObjectFactory objectFactory) {
- this.objectFactory = objectFactory;
- }
-
- public ActionConfig handleUnknownAction(String namespace, String actionName)
- throws XWorkException {
- String pathPrefix = determinePath(templatePathPrefix, namespace);
- ActionConfig actionConfig = null;
- for (String ext : resultsByExtension.keySet()) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Trying to locate unknown action template with extension ."+ext+" in directory "+pathPrefix);
- }
- String path = string(pathPrefix, actionName, "." , ext);
- try {
- if (locateTemplate(path) != null) {
- actionConfig = buildActionConfig(path, namespace, actionName, resultsByExtension.get(ext));
- break;
- }
- } catch (MalformedURLException e) {
- LOG.warn("Unable to parse template path: "+path+", skipping...");
- }
- }
- return actionConfig;
- }
-
- /** Create a new ActionConfig in the default package, with the default interceptor stack and a single result */
- protected ActionConfig buildActionConfig(String path, String namespace, String actionName, ResultTypeConfig resultTypeConfig) {
- final PackageConfig pkg = configuration.getPackageConfig(defaultPackageName);
- return new ActionConfig.Builder(defaultPackageName, "execute", pkg.getDefaultClassRef())
- .addInterceptors(InterceptorBuilder.constructInterceptorReference(new InterceptorLocator() {
- public Object getInterceptorConfig(String name) {
- return pkg.getAllInterceptorConfigs().get(name); // recurse package hiearchy
- }
- }, pkg.getFullDefaultInterceptorRef(),
- Collections.EMPTY_MAP, null, objectFactory))
- .addResultConfig(new ResultConfig.Builder(Action.SUCCESS, resultTypeConfig.getClassName())
- .addParams(resultTypeConfig.getParams())
- .addParam(resultTypeConfig.getDefaultResultParam(), path)
- .build())
- .build();
- }
-
- public Result handleUnknownResult(ActionContext actionContext, String actionName,
- ActionConfig actionConfig, String resultCode) throws XWorkException {
-
- Result result = null;
- PackageConfig pkg = configuration.getPackageConfig(actionConfig.getPackageName());
- String ns = pkg.getNamespace();
- String pathPrefix = determinePath(templatePathPrefix, ns);
-
- for (String ext : resultsByExtension.keySet()) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Trying to locate result with extension ."+ext+" in directory "+pathPrefix);
- }
- String path = string(pathPrefix, actionName, "-", resultCode, "." , ext);
- try {
- if (locateTemplate(path) != null) {
- result = buildResult(path, resultCode, resultsByExtension.get(ext), actionContext);
- break;
- }
- } catch (MalformedURLException e) {
- LOG.warn("Unable to parse template path: "+path+", skipping...");
- }
-
- path = string(pathPrefix, actionName, "." , ext);
- try {
- if (locateTemplate(path) != null) {
- result = buildResult(path, resultCode, resultsByExtension.get(ext), actionContext);
- break;
- }
- } catch (MalformedURLException e) {
- LOG.warn("Unable to parse template path: "+path+", skipping...");
- }
- }
-
- return result;
- }
-
- protected Result buildResult(String path, String resultCode, ResultTypeConfig config, ActionContext invocationContext) {
- ResultConfig resultConfig = new ResultConfig.Builder(resultCode, config.getClassName())
- .addParams(config.getParams())
- .addParam(config.getDefaultResultParam(), path)
- .build();
- try {
- return objectFactory.buildResult(resultConfig, invocationContext.getContextMap());
- } catch (Exception e) {
- throw new XWorkException("Unable to build codebehind result", e, resultConfig);
- }
- }
-
- protected String string(String... parts) {
- StringBuilder sb = new StringBuilder();
- for (String part : parts) {
- sb.append(part);
- }
- return sb.toString();
- }
-
- protected String joinPaths(boolean leadingSlash, boolean trailingSlash, String... parts) {
- StringBuilder sb = new StringBuilder();
- if (leadingSlash) {
- sb.append("/");
- }
- for (String part : parts) {
- if (sb.length() > 0 && sb.charAt(sb.length()-1) != '/') {
- sb.append("/");
- }
- sb.append(stripSlashes(part));
- }
- if (trailingSlash) {
- if (sb.length() > 0 && sb.charAt(sb.length()-1) != '/') {
- sb.append("/");
- }
- }
- return sb.toString();
- }
-
- protected String determinePath(String prefix, String ns) {
- return joinPaths(true, true, prefix, ns);
- }
-
- protected String stripLeadingSlash(String path) {
- String result;
- if (path != null) {
- if (path.length() > 0) {
- if (path.charAt(0) == '/') {
- result = path.substring(1);
- } else {
- result = path;
- }
- } else {
- result = path;
- }
- } else {
- result = "";
- }
-
- return result;
- }
-
- protected String stripTrailingSlash(String path) {
- String result;
-
- if (path != null) {
- if (path.length() > 0) {
- if (path.charAt(path.length() - 1) == '/') {
- result = path.substring(0, path.length()-1);
- } else {
- result = path;
- }
- } else {
- result = path;
- }
- } else {
- result = "";
- }
-
- return result;
- }
-
- protected String stripSlashes(String path) {
- return stripLeadingSlash(stripTrailingSlash(path));
- }
-
- URL locateTemplate(String path) throws MalformedURLException {
- URL template = servletContext.getResource(path);
- if (template != null) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Loaded template '" + path + "' from servlet context.");
- }
- } else {
- template = ClassLoaderUtil.getResource(stripLeadingSlash(path), getClass());
- if (template != null && LOG.isDebugEnabled()) {
- LOG.debug("Loaded template '" + stripLeadingSlash(path) + "' from class path.");
- }
- }
- return template;
- }
-
-
- /**
- * Not used
- */
- public Object handleUnknownActionMethod(Object action, String methodName) throws NoSuchMethodException {
- throw new NoSuchMethodException();
- }
-
-}
diff --git a/plugins/codebehind/src/main/java/org/apache/struts2/config/Action.java b/plugins/codebehind/src/main/java/org/apache/struts2/config/Action.java
deleted file mode 100644
index f139202a8..000000000
--- a/plugins/codebehind/src/main/java/org/apache/struts2/config/Action.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.config;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-
-@Retention(RetentionPolicy.RUNTIME)
-public @interface Action {
- public static final String DEFAULT_NAMESPACE = "__default_namespace__";
- String namespace() default DEFAULT_NAMESPACE;
- String name();
-}
diff --git a/plugins/codebehind/src/main/java/org/apache/struts2/config/ClasspathPackageProvider.java b/plugins/codebehind/src/main/java/org/apache/struts2/config/ClasspathPackageProvider.java
deleted file mode 100644
index 0840e2175..000000000
--- a/plugins/codebehind/src/main/java/org/apache/struts2/config/ClasspathPackageProvider.java
+++ /dev/null
@@ -1,761 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.config;
-
-import com.opensymphony.xwork2.Action;
-import com.opensymphony.xwork2.config.Configuration;
-import com.opensymphony.xwork2.config.ConfigurationException;
-import com.opensymphony.xwork2.config.PackageProvider;
-import com.opensymphony.xwork2.config.entities.ActionConfig;
-import com.opensymphony.xwork2.config.entities.PackageConfig;
-import com.opensymphony.xwork2.config.entities.ResultConfig;
-import com.opensymphony.xwork2.config.entities.ResultTypeConfig;
-import com.opensymphony.xwork2.inject.Inject;
-import com.opensymphony.xwork2.util.ClassLoaderUtil;
-import com.opensymphony.xwork2.util.ResolverUtil;
-import com.opensymphony.xwork2.util.ResolverUtil.ClassTest;
-import com.opensymphony.xwork2.util.logging.Logger;
-import com.opensymphony.xwork2.util.logging.LoggerFactory;
-import org.apache.commons.lang3.StringUtils;
-
-import javax.servlet.ServletContext;
-import java.lang.reflect.Modifier;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.LinkedHashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * ClasspathPackageProvider loads the configuration
- * by scanning the classpath or selected packages for Action classes.
- *
- * This provider is only invoked if one or more action packages are passed to the dispatcher,
- * usually from the web.xml.
- * Configurations are created for objects that either implement Action or have classnames that end with "Action".
- */
-public class ClasspathPackageProvider implements PackageProvider {
-
- /**
- * The default page prefix (or "path").
- * Some applications may place pages under "/WEB-INF" as an extreme security precaution.
- */
- protected static final String DEFAULT_PAGE_PREFIX = "struts.configuration.classpath.defaultPagePrefix";
-
- /**
- * The default page prefix (none).
- */
- private String defaultPagePrefix = "";
-
- /**
- * The default page extension, to use in place of ".jsp".
- */
- protected static final String DEFAULT_PAGE_EXTENSION = "struts.configuration.classpath.defaultPageExtension";
-
- /**
- * The defacto default page extension, usually associated with JavaServer Pages.
- */
- private String defaultPageExtension = ".jsp";
-
- /**
- * A setting to indicate a custom default parent package,
- * to use in place of "struts-default".
- */
- protected static final String DEFAULT_PARENT_PACKAGE = "struts.configuration.classpath.defaultParentPackage";
-
- /**
- * A setting to disable action scanning.
- */
- protected static final String DISABLE_ACTION_SCANNING = "struts.configuration.classpath.disableActionScanning";
-
- /**
- * Name of the framework's default configuration package,
- * that application configuration packages automatically inherit.
- */
- private String defaultParentPackage = "struts-default";
-
- /**
- * The default page prefix (or "path").
- * Some applications may place pages under "/WEB-INF" as an extreme security precaution.
- */
- protected static final String FORCE_LOWER_CASE = "struts.configuration.classpath.forceLowerCase";
-
- /**
- * Whether to use a lowercase letter as the initial letter of an action.
- * If false, actions will retain the initial uppercase letter from the Action class.
- * (view.action (true) versus View.action (false)).
- */
- private boolean forceLowerCase = true;
-
- protected static final String CLASS_SUFFIX = "struts.codebehind.classSuffix";
- /**
- * Default suffix that can be used to indicate POJO "Action" classes.
- */
- protected String classSuffix = "Action";
-
- protected static final String CHECK_IMPLEMENTS_ACTION = "struts.codebehind.checkImplementsAction";
-
- /**
- * When testing a class, check that it implements Action
- */
- protected boolean checkImplementsAction = true;
-
- protected static final String CHECK_ANNOTATION = "struts.codebehind.checkAnnotation";
-
- /**
- * When testing a class, check that it has an @Action annotation
- */
- protected boolean checkAnnotation = true;
-
- /**
- * Helper class to scan class path for server pages.
- */
- private PageLocator pageLocator = new ClasspathPageLocator();
-
- /**
- * Flag to indicate the packages have been loaded.
- *
- * @see #loadPackages
- * @see #needsReload
- */
- private boolean initialized = false;
-
- private boolean disableActionScanning = false;
-
- private PackageLoader packageLoader;
-
- /**
- * Logging instance for this class.
- */
- private static final Logger LOG = LoggerFactory.getLogger(ClasspathPackageProvider.class);
-
- /**
- * The XWork Configuration for this application.
- *
- * @see #init
- */
- private Configuration configuration;
-
- private String actionPackages;
-
- private ServletContext servletContext;
-
- public ClasspathPackageProvider() {
- }
-
- /**
- * PageLocator defines a locate method that can be used to discover server pages.
- */
- public static interface PageLocator {
- public URL locate(String path);
- }
-
- /**
- * ClasspathPathLocator searches the classpath for server pages.
- */
- public static class ClasspathPageLocator implements PageLocator {
- public URL locate(String path) {
- return ClassLoaderUtil.getResource(path, getClass());
- }
- }
-
- @Inject("actionPackages")
- public void setActionPackages(String packages) {
- this.actionPackages = packages;
- }
-
- public void setServletContext(ServletContext ctx) {
- this.servletContext = ctx;
- }
-
- /**
- * Disables action scanning.
- *
- * @param disableActionScanning True to disable
- */
- @Inject(value=DISABLE_ACTION_SCANNING, required=false)
- public void setDisableActionScanning(String disableActionScanning) {
- this.disableActionScanning = "true".equals(disableActionScanning);
- }
-
- /**
- * Check that the class implements Action
- *
- * @param checkImplementsAction True to check
- */
- @Inject(value=CHECK_IMPLEMENTS_ACTION, required=false)
- public void setCheckImplementsAction(String checkImplementsAction) {
- this.checkImplementsAction = "true".equals(checkImplementsAction);
- }
-
- /**
- * Check that the class has an @Action annotation
- *
- * @param checkImplementsAction True to check
- */
- @Inject(value=CHECK_ANNOTATION, required=false)
- public void setCheckAnnotation(String checkAnnotation) {
- this.checkAnnotation = "true".equals(checkAnnotation);
- }
-
- /**
- * Register a default parent package for the actions.
- *
- * @param defaultParentPackage the new defaultParentPackage
- */
- @Inject(value=DEFAULT_PARENT_PACKAGE, required=false)
- public void setDefaultParentPackage(String defaultParentPackage) {
- this.defaultParentPackage = defaultParentPackage;
- }
-
- /**
- * Register a default page extension to use when locating pages.
- *
- * @param defaultPageExtension the new defaultPageExtension
- */
- @Inject(value=DEFAULT_PAGE_EXTENSION, required=false)
- public void setDefaultPageExtension(String defaultPageExtension) {
- this.defaultPageExtension = defaultPageExtension;
- }
-
- /**
- * Reigster a default page prefix to use when locating pages.
- *
- * @param defaultPagePrefix the defaultPagePrefix to set
- */
- @Inject(value=DEFAULT_PAGE_PREFIX, required=false)
- public void setDefaultPagePrefix(String defaultPagePrefix) {
- this.defaultPagePrefix = defaultPagePrefix;
- }
-
- /**
- * Default suffix that can be used to indicate POJO "Action" classes.
- *
- * @param classSuffix the classSuffix to set
- */
- @Inject(value=CLASS_SUFFIX, required=false)
- public void setClassSuffix(String classSuffix) {
- this.classSuffix = classSuffix;
- }
-
- /**
- * Whether to use a lowercase letter as the initial letter of an action.
- *
- * @param force If false, actions will retain the initial uppercase letter from the Action class.
- * (view.action (true) versus View.action (false)).
- */
- @Inject(value=FORCE_LOWER_CASE, required=false)
- public void setForceLowerCase(String force) {
- this.forceLowerCase = "true".equals(force);
- }
-
- /**
- * Register a PageLocation to use to scan for server pages.
- *
- * @param locator
- */
- public void setPageLocator(PageLocator locator) {
- this.pageLocator = locator;
- }
-
- /**
- * Scan a list of packages for Action classes.
- *
- * This method loads classes that implement the Action interface
- * or have a class name that ends with the letters "Action".
- *
- * @param pkgs A list of packages to load
- * @see #processActionClass
- */
- protected void loadPackages(String[] pkgs) {
-
- packageLoader = new PackageLoader();
- ResolverUtil resolver = new ResolverUtil();
- resolver.find(createActionClassTest(), pkgs);
-
- Set extends Class extends Class>> actionClasses = resolver.getClasses();
- for (Object obj : actionClasses) {
- Class cls = (Class) obj;
- if (!Modifier.isAbstract(cls.getModifiers())) {
- processActionClass(cls, pkgs);
- }
- }
-
- for (PackageConfig config : packageLoader.createPackageConfigs()) {
- configuration.addPackageConfig(config.getName(), config);
- }
- }
-
- protected ClassTest createActionClassTest() {
- return new ClassTest() {
- // Match Action implementations and classes ending with "Action"
- public boolean matches(Class type) {
- // TODO: should also find annotated classes
- return ((checkImplementsAction && Action.class.isAssignableFrom(type)) ||
- type.getSimpleName().endsWith(getClassSuffix()) ||
- (checkAnnotation && type.getAnnotation(org.apache.struts2.config.Action.class) != null));
- }
-
- };
- }
-
- protected String getClassSuffix() {
- return classSuffix;
- }
-
- /**
- * Create a default action mapping for a class instance.
- *
- * The namespace annotation is honored, if found, otherwise
- * the Java package is converted into the namespace
- * by changing the dots (".") to slashes ("/").
- *
- * @param cls Action or POJO instance to process
- * @param pkgs List of packages that were scanned for Actions
- */
- protected void processActionClass(Class> cls, String[] pkgs) {
- String name = cls.getName();
- String actionPackage = cls.getPackage().getName();
- String actionNamespace = null;
- String actionName = null;
-
- org.apache.struts2.config.Action actionAnn =
- (org.apache.struts2.config.Action) cls.getAnnotation(org.apache.struts2.config.Action.class);
- if (actionAnn != null) {
- actionName = actionAnn.name();
- if (actionAnn.namespace().equals(org.apache.struts2.config.Action.DEFAULT_NAMESPACE)) {
- actionNamespace = "";
- } else {
- actionNamespace = actionAnn.namespace();
- }
- } else {
- for (String pkg : pkgs) {
- if (name.startsWith(pkg)) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("ClasspathPackageProvider: Processing class "+name);
- }
- name = name.substring(pkg.length() + 1);
-
- actionNamespace = "";
- actionName = name;
- int pos = name.lastIndexOf('.');
- if (pos > -1) {
- actionNamespace = "/" + name.substring(0, pos).replace('.','/');
- actionName = name.substring(pos+1);
- }
- break;
- }
- }
- // Truncate Action suffix if found
- if (actionName.endsWith(getClassSuffix())) {
- actionName = actionName.substring(0, actionName.length() - getClassSuffix().length());
- }
-
- // Force initial letter of action to lowercase, if desired
- if ((forceLowerCase) && (actionName.length() > 1)) {
- int lowerPos = actionName.lastIndexOf('/') + 1;
- StringBuilder sb = new StringBuilder();
- sb.append(actionName.substring(0, lowerPos));
- sb.append(Character.toLowerCase(actionName.charAt(lowerPos)));
- sb.append(actionName.substring(lowerPos + 1));
- actionName = sb.toString();
- }
- }
-
- PackageConfig.Builder pkgConfig = loadPackageConfig(actionNamespace, actionPackage, cls);
-
- // In case the package changed due to namespace annotation processing
- if (!actionPackage.equals(pkgConfig.getName())) {
- actionPackage = pkgConfig.getName();
- }
-
- List parents = findAllParentPackages(cls);
- if (parents.size() > 0) {
- pkgConfig.addParents(parents);
-
- // Try to guess the namespace from the first package
- PackageConfig firstParent = parents.get(0);
- if (StringUtils.isEmpty(pkgConfig.getNamespace()) && StringUtils.isNotEmpty(firstParent.getNamespace())) {
- pkgConfig.namespace(firstParent.getNamespace());
- }
- }
-
-
- ResultTypeConfig defaultResultType = packageLoader.getDefaultResultType(pkgConfig);
- ActionConfig actionConfig = new ActionConfig.Builder(actionPackage, actionName, cls.getName())
- .addResultConfigs(new ResultMap(cls, actionName, defaultResultType))
- .build();
- pkgConfig.addActionConfig(actionName, actionConfig);
- }
-
- /**
- * Finds all parent packages by first looking at the ParentPackage annotation on the package, then the class
- * @param cls The action class
- * @return A list of unique packages to add
- */
- private List findAllParentPackages(Class> cls) {
-
- List parents = new ArrayList();
- // Favor parent package annotations from the package
- Set parentNames = new LinkedHashSet();
- ParentPackage annotation = cls.getPackage().getAnnotation(ParentPackage.class);
- if (annotation != null) {
- parentNames.addAll(Arrays.asList(annotation.value()));
- }
- annotation = cls.getAnnotation(ParentPackage.class);
- if (annotation != null) {
- parentNames.addAll(Arrays.asList(annotation.value()));
- }
- if (parentNames.size() > 0) {
- for (String parent : parentNames) {
- PackageConfig parentPkg = configuration.getPackageConfig(parent);
- if (parentPkg == null) {
- throw new ConfigurationException("ClasspathPackageProvider: Unable to locate parent package "+parent, annotation);
- }
- parents.add(parentPkg);
- }
- }
- return parents;
- }
-
- /**
- * Finds or creates the package configuration for an Action class.
- *
- * The namespace annotation is honored, if found,
- * and the namespace is checked for a parent configuration.
- *
- * @param actionNamespace The configuration namespace
- * @param actionPackage The Java package containing our Action classes
- * @param actionClass The Action class instance
- * @return PackageConfig object for the Action class
- */
- protected PackageConfig.Builder loadPackageConfig(String actionNamespace, String actionPackage, Class actionClass) {
- PackageConfig.Builder parent = null;
-
- // Check for the @Namespace annotation
- if (actionClass != null) {
- Namespace ns = (Namespace) actionClass.getAnnotation(Namespace.class);
- if (ns != null) {
- parent = loadPackageConfig(actionNamespace, actionPackage, null);
- actionNamespace = ns.value();
- actionPackage = actionClass.getName();
-
- // See if the namespace has been overridden by the @Action annotation
- } else {
- org.apache.struts2.config.Action actionAnn =
- (org.apache.struts2.config.Action) actionClass.getAnnotation(org.apache.struts2.config.Action.class);
- if (actionAnn != null && !actionAnn.DEFAULT_NAMESPACE.equals(actionAnn.namespace())) {
- // we pass null as the namespace in case the parent package hasn't been loaded yet
- parent = loadPackageConfig(null, actionPackage, null);
- actionPackage = actionClass.getName();
- }
- }
- }
-
-
- PackageConfig.Builder pkgConfig = packageLoader.getPackage(actionPackage);
- if (pkgConfig == null) {
- pkgConfig = new PackageConfig.Builder(actionPackage);
-
- pkgConfig.namespace(actionNamespace);
- if (parent == null) {
- PackageConfig cfg = configuration.getPackageConfig(defaultParentPackage);
- if (cfg != null) {
- pkgConfig.addParent(cfg);
- } else {
- throw new ConfigurationException("ClasspathPackageProvider: Unable to locate default parent package: " +
- defaultParentPackage);
- }
- }
-
- packageLoader.registerPackage(pkgConfig);
-
- // if the parent package was first created by a child, ensure the namespace is correct
- } else if (pkgConfig.getNamespace() == null) {
- pkgConfig.namespace(actionNamespace);
- }
-
- if (parent != null) {
- packageLoader.registerChildToParent(pkgConfig, parent);
- }
-
- if (LOG.isDebugEnabled()) {
- LOG.debug("class:"+actionClass+" parent:"+parent+" current:"+(pkgConfig != null ? pkgConfig.getName() : ""));
- }
-
- return pkgConfig;
- }
-
- /**
- * Default destructor. Override to provide behavior.
- */
- public void destroy() {
-
- }
-
- /**
- * Register this application's configuration.
- *
- * @param config The configuration for this application.
- */
- public void init(Configuration config) {
- this.configuration = config;
- }
-
- /**
- * Clears and loads the list of packages registered at construction.
- *
- * @throws ConfigurationException
- */
- public void loadPackages() throws ConfigurationException {
- if (actionPackages != null && !disableActionScanning) {
- String[] names = actionPackages.split("\\s*[,]\\s*");
- // Initialize the classloader scanner with the configured packages
- if (names.length > 0) {
- setPageLocator(new ServletContextPageLocator(servletContext));
- }
- loadPackages(names);
- }
- initialized = true;
- }
-
- /**
- * Indicates whether the packages have been initialized.
- *
- * @return True if the packages have been initialized
- */
- public boolean needsReload() {
- return !initialized;
- }
-
- /**
- * Creates ResultConfig objects from result annotations,
- * and if a result isn't found, creates it on the fly.
- */
- class ResultMap extends HashMap {
- private Class actionClass;
- private String actionName;
- private ResultTypeConfig defaultResultType;
-
- public ResultMap(Class actionClass, String actionName, ResultTypeConfig defaultResultType) {
- this.actionClass = actionClass;
- this.actionName = actionName;
- this.defaultResultType = defaultResultType;
-
- // check if any annotations are around
- while (!actionClass.getName().equals(Object.class.getName())) {
- //noinspection unchecked
- Results results = (Results) actionClass.getAnnotation(Results.class);
- if (results != null) {
- // first check here...
- for (int i = 0; i < results.value().length; i++) {
- Result result = results.value()[i];
- ResultConfig config = createResultConfig(result);
- if (!containsKey((K)config.getName())) {
- put((K)config.getName(), (V)config);
- }
- }
- }
-
- // what about a single Result annotation?
- Result result = (Result) actionClass.getAnnotation(Result.class);
- if (result != null) {
- ResultConfig config = createResultConfig(result);
- if (!containsKey((K)config.getName())) {
- put((K)config.getName(), (V)config);
- }
- }
-
- actionClass = actionClass.getSuperclass();
- }
- }
-
- /**
- * Extracts result name and value and calls {@link #createResultConfig}.
- *
- * @param result Result annotation reference representing result type to create
- * @return New or cached ResultConfig object for result
- */
- protected ResultConfig createResultConfig(Result result) {
- Class extends Object> cls = result.type();
- if (cls == NullResult.class) {
- cls = null;
- }
- return createResultConfig(result.name(), cls, result.value(), createParameterMap(result.params()));
- }
-
- protected Map createParameterMap(String[] parms) {
- Map map = new HashMap();
- int subtract = parms.length % 2;
- if(subtract != 0) {
- LOG.warn("Odd number of result parameters key/values specified. The final one will be ignored.");
- }
- for (int i = 0; i < parms.length - subtract; i++) {
- String key = parms[i++];
- String value = parms[i];
- map.put(key, value);
- if(LOG.isDebugEnabled()) {
- LOG.debug("Adding parmeter["+key+":"+value+"] to result.");
- }
- }
- return map;
- }
-
- /**
- * Creates a default ResultConfig,
- * using either the resultClass or the default ResultType for configuration package
- * associated this ResultMap class.
- *
- * @param key The result type name
- * @param resultClass The class for the result type
- * @param location Path to the resource represented by this type
- * @return A ResultConfig for key mapped to location
- */
- private ResultConfig createResultConfig(Object key, Class extends Object> resultClass,
- String location,
- Map extends Object,? extends Object > configParams) {
- if (resultClass == null) {
- configParams = defaultResultType.getParams();
- String className = defaultResultType.getClassName();
- try {
- resultClass = ClassLoaderUtil.loadClass(className, getClass());
- } catch (ClassNotFoundException ex) {
- throw new ConfigurationException("ClasspathPackageProvider: Unable to locate result class "+className, actionClass);
- }
- }
-
- String defaultParam;
- try {
- defaultParam = (String) resultClass.getField("DEFAULT_PARAM").get(null);
- } catch (Exception e) {
- // not sure why this happened, but let's just use a sensible choice
- defaultParam = "location";
- }
-
- HashMap params = new HashMap();
- if (configParams != null) {
- params.putAll(configParams);
- }
-
- params.put(defaultParam, location);
- return new ResultConfig.Builder((String) key, resultClass.getName()).addParams(params).build();
- }
- }
-
- /**
- * Search classpath for a page.
- */
- private final class ServletContextPageLocator implements PageLocator {
- private final ServletContext context;
- private ClasspathPageLocator classpathPageLocator = new ClasspathPageLocator();
-
- private ServletContextPageLocator(ServletContext context) {
- this.context = context;
- }
-
- public URL locate(String path) {
- URL url = null;
- try {
- url = context.getResource(path);
- if (url == null) {
- url = classpathPageLocator.locate(path);
- }
- } catch (MalformedURLException e) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("Unable to resolve path "+path+" against the servlet context");
- }
- }
- return url;
- }
- }
-
- private static class PackageLoader {
-
- /**
- * The package configurations for scanned Actions.
- */
- private Map packageConfigBuilders = new HashMap();
-
- private Map childToParent = new HashMap();
-
- public PackageConfig.Builder getPackage(String name) {
- return packageConfigBuilders.get(name);
- }
-
- public void registerChildToParent(PackageConfig.Builder child, PackageConfig.Builder parent) {
- childToParent.put(child, parent);
- }
-
- public void registerPackage(PackageConfig.Builder builder) {
- packageConfigBuilders.put(builder.getName(), builder);
- }
-
- public Collection createPackageConfigs() {
- Map configs = new HashMap();
-
- Set builders;
- while ((builders = findPackagesWithNoParents()).size() > 0) {
- for (PackageConfig.Builder parent : builders) {
- PackageConfig config = parent.build();
- configs.put(config.getName(), config);
- packageConfigBuilders.remove(config.getName());
-
- for (Iterator> i = childToParent.entrySet().iterator(); i.hasNext(); ) {
- Map.Entry entry = i.next();
- if (entry.getValue() == parent) {
- entry.getKey().addParent(config);
- i.remove();
- }
- }
- }
- }
- return configs.values();
- }
-
- Set findPackagesWithNoParents() {
- Set builders = new HashSet();
- for (PackageConfig.Builder child : packageConfigBuilders.values()) {
- if (!childToParent.containsKey(child)) {
- builders.add(child);
- }
- }
- return builders;
- }
-
- public ResultTypeConfig getDefaultResultType(PackageConfig.Builder pkgConfig) {
- PackageConfig.Builder parent;
- PackageConfig.Builder current = pkgConfig;
-
- while ((parent = childToParent.get(current)) != null) {
- current = parent;
- }
- return current.getResultType(current.getFullDefaultResultType());
- }
- }
-}
diff --git a/plugins/codebehind/src/main/java/org/apache/struts2/config/Namespace.java b/plugins/codebehind/src/main/java/org/apache/struts2/config/Namespace.java
deleted file mode 100644
index 636f942a7..000000000
--- a/plugins/codebehind/src/main/java/org/apache/struts2/config/Namespace.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.config;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-/**
- * Allows an action class to specify its namespace
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface Namespace {
- String value();
-}
diff --git a/plugins/codebehind/src/main/java/org/apache/struts2/config/ParentPackage.java b/plugins/codebehind/src/main/java/org/apache/struts2/config/ParentPackage.java
deleted file mode 100644
index 2d23d4ad1..000000000
--- a/plugins/codebehind/src/main/java/org/apache/struts2/config/ParentPackage.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.config;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-/**
- * Allows an action class or package to specify an xwork package to inherit
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target({ElementType.TYPE, ElementType.PACKAGE})
-public @interface ParentPackage {
- String[] value();
-}
diff --git a/plugins/codebehind/src/main/java/org/apache/struts2/config/Result.java b/plugins/codebehind/src/main/java/org/apache/struts2/config/Result.java
deleted file mode 100644
index fc7c5bd4a..000000000
--- a/plugins/codebehind/src/main/java/org/apache/struts2/config/Result.java
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.config;
-
-import com.opensymphony.xwork2.Action;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Defines an XWork Result
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface Result {
- String name() default Action.SUCCESS;
- Class extends com.opensymphony.xwork2.Result> type() default NullResult.class;
- String value();
- String[] params() default {};
-}
diff --git a/plugins/codebehind/src/main/java/org/apache/struts2/config/Results.java b/plugins/codebehind/src/main/java/org/apache/struts2/config/Results.java
deleted file mode 100644
index a7d909661..000000000
--- a/plugins/codebehind/src/main/java/org/apache/struts2/config/Results.java
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.config;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-import java.lang.annotation.ElementType;
-
-/**
- * Defines multiple XWork Results
- */
-@Retention(RetentionPolicy.RUNTIME)
-@Target(ElementType.TYPE)
-public @interface Results {
- Result[] value();
-}
diff --git a/plugins/codebehind/src/main/resources/LICENSE.txt b/plugins/codebehind/src/main/resources/LICENSE.txt
deleted file mode 100644
index dd5b3a58a..000000000
--- a/plugins/codebehind/src/main/resources/LICENSE.txt
+++ /dev/null
@@ -1,174 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
diff --git a/plugins/codebehind/src/main/resources/NOTICE.txt b/plugins/codebehind/src/main/resources/NOTICE.txt
deleted file mode 100644
index bfba90c29..000000000
--- a/plugins/codebehind/src/main/resources/NOTICE.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-Apache Struts
-Copyright 2000-2011 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
\ No newline at end of file
diff --git a/plugins/codebehind/src/main/resources/struts-plugin.xml b/plugins/codebehind/src/main/resources/struts-plugin.xml
deleted file mode 100644
index 601ba8c35..000000000
--- a/plugins/codebehind/src/main/resources/struts-plugin.xml
+++ /dev/null
@@ -1,38 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugins/codebehind/src/site/site.xml b/plugins/codebehind/src/site/site.xml
deleted file mode 100644
index 07a667ec7..000000000
--- a/plugins/codebehind/src/site/site.xml
+++ /dev/null
@@ -1,57 +0,0 @@
-
-
-
-
- org.apache.maven.skins
- maven-fluido-skin
- 1.3.1
-
-
- Apache Software Foundation
- http://www.apache.org/images/asf-logo.gif
- http://www.apache.org/
-
-
- Apache Struts
- http://struts.apache.org/img/struts-logo.svg
- http://struts.apache.org/
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/plugins/codebehind/src/test/java/org/apache/struts2/codebehind/CodebehindUnknownHandlerTest.java b/plugins/codebehind/src/test/java/org/apache/struts2/codebehind/CodebehindUnknownHandlerTest.java
deleted file mode 100644
index e6cff7965..000000000
--- a/plugins/codebehind/src/test/java/org/apache/struts2/codebehind/CodebehindUnknownHandlerTest.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.codebehind;
-
-import com.mockobjects.dynamic.C;
-import com.mockobjects.dynamic.Mock;
-import com.opensymphony.xwork2.*;
-import com.opensymphony.xwork2.config.entities.ActionConfig;
-import com.opensymphony.xwork2.config.entities.ResultTypeConfig;
-import com.opensymphony.xwork2.util.XWorkTestCaseHelper;
-import org.apache.struts2.StrutsTestCase;
-import org.apache.struts2.dispatcher.ServletDispatcherResult;
-import org.springframework.mock.web.MockServletContext;
-
-import javax.servlet.ServletContext;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Collections;
-import java.util.HashMap;
-
-public class CodebehindUnknownHandlerTest extends StrutsTestCase {
-
- CodebehindUnknownHandler handler;
- Mock mockServletContext;
-
- public void setUp() throws Exception {
- configurationManager = XWorkTestCaseHelper.setUp();
- configuration = configurationManager.getConfiguration();
- container = configuration.getContainer();
- actionProxyFactory = container.getInstance(ActionProxyFactory.class);
- servletContext = new MockServletContext();
- initDispatcher(Collections.singletonMap("actionPackages", "foo.bar"));
- mockServletContext = new Mock(ServletContext.class);
- handler = new CodebehindUnknownHandler("codebehind-default", configuration);
- handler.setPathPrefix("/");
- handler.setObjectFactory(container.getInstance(ObjectFactory.class));
- handler.setServletContext((ServletContext)mockServletContext.proxy());
- }
-
- public void testBuildResult() {
- ActionContext ctx = new ActionContext(new HashMap());
- ResultTypeConfig config = new ResultTypeConfig.Builder("null", SomeResult.class.getName()).defaultResultParam("location").build();
-
- Result result = handler.buildResult("/foo.jsp", "success", config, ctx);
- assertNotNull(result);
- assertTrue(result instanceof SomeResult);
- assertEquals("/foo.jsp", ((SomeResult) result).location);
-
- }
-
- public void testString() {
- assertEquals("foo.bar.jim", handler.string("foo", ".", "bar", ".", "jim"));
- }
-
- public void testDeterminePath() {
- assertEquals("/", handler.determinePath("/", ""));
- assertEquals("/", handler.determinePath("/", null));
- assertEquals("/", handler.determinePath("/", "/"));
- assertEquals("/foo/", handler.determinePath("/", "/foo"));
- assertEquals("/foo/", handler.determinePath("/", "/foo/"));
- assertEquals("/foo/", handler.determinePath("/", "foo"));
- assertEquals("/", handler.determinePath("", ""));
- assertEquals("/foo/", handler.determinePath("", "foo"));
- assertEquals("/foo/", handler.determinePath("", "/foo/"));
- }
-
- public void testLocateTemplate() throws MalformedURLException {
- URL url = new URL("file:/foo.xml");
- mockServletContext.expectAndReturn("getResource", C.args(C.eq("/foo.xml")), url);
- assertEquals(url, handler.locateTemplate("/foo.xml"));
- mockServletContext.verify();
-
- }
-
- public void testLocateTemplateFromClasspath() throws MalformedURLException {
- mockServletContext.expectAndReturn("getResource", C.args(C.eq("struts-plugin.xml")), null);
- URL url = handler.locateTemplate("struts-plugin.xml");
- assertNotNull(url);
- assertTrue(url.toString().endsWith("struts-plugin.xml"));
- mockServletContext.verify();
- }
-
- /**
- * Assert that an unknown action like /foo maps to ActionSupport with a ServletDispatcherResult to /foo.jsp
- */
- public void testBuildActionConfigForUnknownAction() throws MalformedURLException {
- URL url = new URL("file:/foo.jsp");
- mockServletContext.expectAndReturn("getResource", C.args(C.eq("/foo.jsp")), url);
- ActionConfig actionConfig = handler.handleUnknownAction("/", "foo");
- // we need a package
- assertEquals("codebehind-default", actionConfig.getPackageName());
- // a non-empty interceptor stack
- assertTrue(actionConfig.getInterceptors().size() > 0);
- // ActionSupport as the implementation
- assertEquals(ActionSupport.class.getName(), actionConfig.getClassName());
- // with one result
- assertEquals(1, actionConfig.getResults().size());
- // named success
- assertNotNull(actionConfig.getResults().get("success"));
- // of ServletDispatcherResult type
- assertEquals(ServletDispatcherResult.class.getName(), actionConfig.getResults().get("success").getClassName());
- // and finally pointing to foo.jsp!
- assertEquals("/foo.jsp", actionConfig.getResults().get("success").getParams().get("location"));
- }
-
- public static class SomeResult implements Result {
-
- public String location;
- public void setLocation(String loc) {
- this.location = loc;
- }
-
- public void execute(ActionInvocation invocation) throws Exception {
- }
-
- }
-
-}
diff --git a/plugins/codebehind/src/test/java/org/apache/struts2/config/AnnotatedAction.java b/plugins/codebehind/src/test/java/org/apache/struts2/config/AnnotatedAction.java
deleted file mode 100644
index 61ee16c4e..000000000
--- a/plugins/codebehind/src/test/java/org/apache/struts2/config/AnnotatedAction.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.config;
-
-@Action(name="myaction",namespace="/foo")
-public class AnnotatedAction {
-
-}
diff --git a/plugins/codebehind/src/test/java/org/apache/struts2/config/AnotherAnnotatedObject.java b/plugins/codebehind/src/test/java/org/apache/struts2/config/AnotherAnnotatedObject.java
deleted file mode 100644
index 2238bb423..000000000
--- a/plugins/codebehind/src/test/java/org/apache/struts2/config/AnotherAnnotatedObject.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.config;
-
-@Action(name="myaction2")
-public class AnotherAnnotatedObject {
-
-}
diff --git a/plugins/codebehind/src/test/java/org/apache/struts2/config/ClasspathPackageProviderTest.java b/plugins/codebehind/src/test/java/org/apache/struts2/config/ClasspathPackageProviderTest.java
deleted file mode 100644
index b25558b41..000000000
--- a/plugins/codebehind/src/test/java/org/apache/struts2/config/ClasspathPackageProviderTest.java
+++ /dev/null
@@ -1,166 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.config;
-
-import com.opensymphony.xwork2.config.Configuration;
-import com.opensymphony.xwork2.config.entities.ActionConfig;
-import com.opensymphony.xwork2.config.entities.PackageConfig;
-import com.opensymphony.xwork2.config.entities.ResultTypeConfig;
-import com.opensymphony.xwork2.config.impl.DefaultConfiguration;
-import junit.framework.TestCase;
-import org.apache.struts2.dispatcher.ServletDispatcherResult;
-
-import java.util.Map;
-
-public class ClasspathPackageProviderTest extends TestCase {
-
- ClasspathPackageProvider provider;
- Configuration config;
-
- public void setUp() throws Exception {
- provider = new ClasspathPackageProvider();
- provider.setActionPackages("org.apache.struts2.config");
- config = createNewConfiguration();
- provider.init(config);
- provider.loadPackages();
- }
-
- private Configuration createNewConfiguration() {
- Configuration config = new DefaultConfiguration();
- PackageConfig strutsDefault = new PackageConfig.Builder("struts-default")
- .addResultTypeConfig(new ResultTypeConfig.Builder("dispatcher", ServletDispatcherResult.class.getName())
- .defaultResultParam("location")
- .build())
- .defaultResultType("dispatcher")
- .build();
- config.addPackageConfig("struts-default", strutsDefault);
- PackageConfig customPackage = new PackageConfig.Builder("custom-package")
- .namespace("/custom")
- .build();
- config.addPackageConfig("custom-package", customPackage);
- return config;
- }
-
- public void tearDown() throws Exception {
- provider = null;
- config = null;
- }
-
- public void testFoundRootPackages() {
- assertEquals(7, config.getPackageConfigs().size());
- PackageConfig pkg = config.getPackageConfig("org.apache.struts2.config");
- assertNotNull(pkg);
- Map configs = pkg.getActionConfigs();
- assertNotNull(configs);
- // assertEquals(1, configs.size());
- ActionConfig actionConfig = (ActionConfig) configs.get("customParentPackage");
- assertNotNull(actionConfig);
- }
-
- public void testDisableScanning() {
- provider = new ClasspathPackageProvider();
- provider.setActionPackages("org.apache.struts2.config");
- provider.setDisableActionScanning("true");
- config = new DefaultConfiguration();
- provider.init(config);
- provider.loadPackages();
-
- assertEquals(0, config.getPackageConfigs().size());
- }
-
- public void testParentPackage() {
- PackageConfig pkg = config.getPackageConfig("org.apache.struts2.config");
- // assertEquals(2, pkg.getParents().size());
- Map configs = pkg.getActionConfigs();
- ActionConfig config = (ActionConfig) configs.get("customParentPackage");
- assertNotNull(config);
- assertEquals("/custom", pkg.getNamespace());
- }
-
- public void testParentPackageOnPackage() {
- provider = new ClasspathPackageProvider();
- provider.setActionPackages("org.apache.struts2.config.parenttest");
- provider.init(createNewConfiguration());
- provider.loadPackages();
-
-
- PackageConfig pkg = config.getPackageConfig("org.apache.struts2.config.parenttest");
- // assertEquals(2, pkg.getParents().size());
- assertNotNull(pkg);
-
- assertEquals("custom-package", pkg.getParents().get(0).getName());
- Map configs = pkg.getActionConfigs();
- ActionConfig config = (ActionConfig) configs.get("some");
- assertNotNull(config);
- }
-
- public void testCustomNamespace() {
- PackageConfig pkg = config.getPackageConfig("org.apache.struts2.config.CustomNamespaceAction");
- Map configs = pkg.getAllActionConfigs();
- // assertEquals(2, configs.size());
- ActionConfig config = (ActionConfig) configs.get("customNamespace");
- assertEquals(config.getPackageName(), pkg.getName());
- assertEquals(1, pkg.getParents().size());
- assertNotNull(config);
- assertEquals("/mynamespace", pkg.getNamespace());
- ActionConfig ac = (ActionConfig) configs.get("customParentPackage");
- assertNotNull(ac);
- }
-
- public void testCustomActionAnnotation() {
- PackageConfig pkg = config.getPackageConfig("org.apache.struts2.config.AnnotatedAction");
- Map configs = pkg.getAllActionConfigs();
- // assertEquals(2, configs.size());
- ActionConfig config = (ActionConfig) configs.get("myaction");
- assertNotNull(config);
- }
-
- public void testCustomActionAnnotationOfAnyName() {
- PackageConfig pkg = config.getPackageConfig("org.apache.struts2.config");
- Map configs = pkg.getAllActionConfigs();
- // assertEquals(2, configs.size());
- ActionConfig config = (ActionConfig) configs.get("myaction2");
- assertNotNull(config);
- }
-
- public void testResultAnnotations() {
- PackageConfig pkg = config.getPackageConfig("org.apache.struts2.config.cltest");
- assertEquals("/cltest", pkg.getNamespace());
- ActionConfig acfg = pkg.getActionConfigs().get("twoResult");
- assertNotNull(acfg);
- assertEquals(2, acfg.getResults().size());
- assertEquals("input.jsp", acfg.getResults().get("input").getParams().get("location"));
- assertEquals("bob", acfg.getResults().get("chain").getParams().get("location"));
-
- acfg = pkg.getActionConfigs().get("oneResult");
- assertNotNull(acfg);
- assertEquals(1, acfg.getResults().size());
- assertEquals("input-parent.jsp", acfg.getResults().get("input").getParams().get("location"));
- }
-
- public void testActionImplementation() {
- PackageConfig pkg = config.getPackageConfig("org.apache.struts2.config.cltest");
- assertEquals("/cltest", pkg.getNamespace());
- ActionConfig acfg = pkg.getActionConfigs().get("actionImpl");
- assertNotNull(acfg);
- }
-}
diff --git a/plugins/codebehind/src/test/java/org/apache/struts2/config/CustomNamespaceAction.java b/plugins/codebehind/src/test/java/org/apache/struts2/config/CustomNamespaceAction.java
deleted file mode 100644
index 8231bb408..000000000
--- a/plugins/codebehind/src/test/java/org/apache/struts2/config/CustomNamespaceAction.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.config;
-
-@Namespace("/mynamespace")
-public class CustomNamespaceAction {
-
-}
diff --git a/plugins/codebehind/src/test/java/org/apache/struts2/config/CustomParentPackageAction.java b/plugins/codebehind/src/test/java/org/apache/struts2/config/CustomParentPackageAction.java
deleted file mode 100644
index 734d2f927..000000000
--- a/plugins/codebehind/src/test/java/org/apache/struts2/config/CustomParentPackageAction.java
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.config;
-
-@ParentPackage("custom-package")
-public class CustomParentPackageAction {
-
-}
diff --git a/plugins/codebehind/src/test/java/org/apache/struts2/config/cltest/ActionImpl.java b/plugins/codebehind/src/test/java/org/apache/struts2/config/cltest/ActionImpl.java
deleted file mode 100644
index 6863e7553..000000000
--- a/plugins/codebehind/src/test/java/org/apache/struts2/config/cltest/ActionImpl.java
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.config.cltest;
-
-import com.opensymphony.xwork2.Action;
-
-public class ActionImpl implements Action {
-
- public String execute() throws Exception {
- return null;
- }
-
-}
diff --git a/plugins/codebehind/src/test/java/org/apache/struts2/config/cltest/OneResultAction.java b/plugins/codebehind/src/test/java/org/apache/struts2/config/cltest/OneResultAction.java
deleted file mode 100644
index 72efc3cc2..000000000
--- a/plugins/codebehind/src/test/java/org/apache/struts2/config/cltest/OneResultAction.java
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.config.cltest;
-
-import org.apache.struts2.config.Result;
-
-@Result(name="input", value="input-parent.jsp")
-public class OneResultAction {
-
-}
diff --git a/plugins/codebehind/src/test/java/org/apache/struts2/config/cltest/TwoResultAction.java b/plugins/codebehind/src/test/java/org/apache/struts2/config/cltest/TwoResultAction.java
deleted file mode 100644
index a62e02bcc..000000000
--- a/plugins/codebehind/src/test/java/org/apache/struts2/config/cltest/TwoResultAction.java
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.config.cltest;
-
-import org.apache.struts2.config.Result;
-import org.apache.struts2.config.Results;
-import org.apache.struts2.dispatcher.ServletDispatcherResult;
-
-
-@Results({
- @Result(name="chain", value="bob", type=ServletDispatcherResult.class),
- @Result(name="input", value="input.jsp")
-})
-public class TwoResultAction extends OneResultAction {
-
-}
diff --git a/plugins/codebehind/src/test/java/org/apache/struts2/config/parenttest/SomeAction.java b/plugins/codebehind/src/test/java/org/apache/struts2/config/parenttest/SomeAction.java
deleted file mode 100644
index 08263af81..000000000
--- a/plugins/codebehind/src/test/java/org/apache/struts2/config/parenttest/SomeAction.java
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * $Id: ParentPackage.java 651946 2008-04-27 13:41:38Z apetrelli $
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.struts2.config.parenttest;
-
-import com.opensymphony.xwork2.Action;
-
-public class SomeAction implements Action {
-
- public String execute() throws Exception {
- return null; //To change body of implemented methods use File | Settings | File Templates.
- }
-}
diff --git a/plugins/codebehind/src/test/java/org/apache/struts2/config/parenttest/package-info.java b/plugins/codebehind/src/test/java/org/apache/struts2/config/parenttest/package-info.java
deleted file mode 100644
index fdb5c9229..000000000
--- a/plugins/codebehind/src/test/java/org/apache/struts2/config/parenttest/package-info.java
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * $Id: ParentPackage.java 651946 2008-04-27 13:41:38Z apetrelli $
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-@ParentPackage("custom-package")
-package org.apache.struts2.config.parenttest;
-
-import org.apache.struts2.config.ParentPackage;
\ No newline at end of file
diff --git a/plugins/dojo/pom.xml b/plugins/dojo/pom.xml
deleted file mode 100644
index abdc5b88f..000000000
--- a/plugins/dojo/pom.xml
+++ /dev/null
@@ -1,240 +0,0 @@
-
-
-
-
- struts2-plugins
- org.apache.struts
- 2.5-SNAPSHOT
-
-
- 4.0.0
- struts2-dojo-plugin
- Struts 2 Dojo Plugin
-
-
-
- release
-
-
- release
-
-
-
-
-
- org.codehaus.mojo
- rat-maven-plugin
- 1.0-alpha-2
-
-
- verify
-
- check
-
-
- false
-
-
- rat.analysis.license.ApacheSoftwareLicense20
-
-
-
- pom.xml
- src/**
-
-
- src/main/resources/org/apache/struts2/static/dojo/nls/**
- src/main/resources/org/apache/struts2/static/dojo/src/**
- src/main/resources/org/apache/struts2/static/dojo/*
- src/test/resources/org/apache/struts2/dojo/views/jsp/ui/**
-
-
-
-
-
-
-
-
-
-
-
- 2.2
- UTF-8
-
-
-
-
-
- org.apache.myfaces.tobago
- maven-apt-plugin
- 1.0.15
-
-
- uri=/struts-dojo-tags,tlibVersion=${tlib.version},jspVersion=2.0,shortName=sx,
- displayName="Struts Dojo Tags",
- outFile=${basedir}/target/classes/META-INF/struts-dojo-tags.tld,
- description="Struts AJAX tags based on Dojo.",
- outTemplatesDir=${basedir}/../../core/src/site/resources/tags/ajax
-
- target
- false
- true
- true
- true
-
- org.apache.struts.annotations.taglib.apt.TLDAnnotationProcessorFactory
-
- 1.5
-
- **/*.java
-
-
-
-
- compile
-
- execute
-
-
-
-
-
-
-
-
-
-
-
- javax.servlet
- jsp-api
- provided
-
-
-
-
- org.apache.velocity
- velocity
- true
-
-
-
-
- ${project.groupId}
- struts2-junit-plugin
- test
-
-
- jmock
- jmock
- test
-
-
- org.easymock
- easymock
- test
-
-
-
- jmock
- jmock-cglib
- test
-
-
-
- mockobjects
- mockobjects-core
- test
-
-
-
- mockobjects
- mockobjects-jdk1.3
- test
-
-
-
- mockobjects
- mockobjects-alt-jdk1.3
- test
-
-
-
- mockobjects
- mockobjects-alt-jdk1.3-j2ee1.3
- test
-
-
-
- mockobjects
- mockobjects-jdk1.3-j2ee1.3
- test
-
-
-
-
-
- org.springframework
- spring-test
- test
-
-
-
- org.springframework
- spring-core
- test
-
-
-
-
- org.apache.struts
- struts-annotations
- compile
- true
-
-
-
-
-
-
- org.codehaus.mojo
- rat-maven-plugin
- 1.0-alpha-2
-
-
- pom.xml
- src/**
-
-
- src/main/resources/org/apache/struts2/static/dojo/nls/**
- src/main/resources/org/apache/struts2/static/dojo/src/**
- src/main/resources/org/apache/struts2/static/dojo/*
- src/test/resources/org/apache/struts2/dojo/views/jsp/ui/**
-
-
-
-
-
-
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/AbstractRemoteBean.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/AbstractRemoteBean.java
deleted file mode 100644
index b7e58c73e..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/AbstractRemoteBean.java
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.components;
-
-import java.util.Random;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.ClosingUIBean;
-import org.apache.struts2.views.annotations.StrutsTagAttribute;
-import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * AbstractRemoteCallUIBean is superclass for all components dealing with remote
- * calls.
- */
-public abstract class AbstractRemoteBean extends ClosingUIBean implements RemoteBean {
-
- final private static transient Random RANDOM = new Random();
-
- protected String href;
- protected String errorText;
- protected String executeScripts;
- protected String loadingText;
- protected String listenTopics;
- protected String handler;
- protected String formId;
- protected String formFilter;
- protected String notifyTopics;
- protected String showErrorTransportText;
- protected String indicator;
- protected String showLoadingText;
- protected String beforeNotifyTopics;
- protected String afterNotifyTopics;
- protected String errorNotifyTopics;
- protected String highlightColor;
- protected String highlightDuration;
- protected String separateScripts;
- protected String transport;
- protected String parseContent;
-
- public AbstractRemoteBean(ValueStack stack, HttpServletRequest request,
- HttpServletResponse response) {
- super(stack, request, response);
- }
-
- public void evaluateExtraParams() {
- super.evaluateExtraParams();
-
- if (href != null)
- addParameter("href", findString(href));
- if (errorText != null)
- addParameter("errorText", findString(errorText));
- if (loadingText != null)
- addParameter("loadingText", findString(loadingText));
- if (executeScripts != null)
- addParameter("executeScripts", findValue(executeScripts, Boolean.class));
- if (listenTopics != null)
- addParameter("listenTopics", findValue(listenTopics, String.class));
- if (notifyTopics != null)
- addParameter("notifyTopics", findValue(notifyTopics, String.class));
- if (handler != null)
- addParameter("handler", findString(handler));
- if (formId != null)
- addParameter("formId", findString(formId));
- if (formFilter != null)
- addParameter("formFilter", findString(formFilter));
- if (indicator != null)
- addParameter("indicator", findString(indicator));
- if (showErrorTransportText != null)
- addParameter("showErrorTransportText", findValue(showErrorTransportText, Boolean.class));
- else
- addParameter("showErrorTransportText", true);
- if (showLoadingText != null)
- addParameter("showLoadingText", findString(showLoadingText));
- if (beforeNotifyTopics != null)
- addParameter("beforeNotifyTopics", findString(beforeNotifyTopics));
- if (afterNotifyTopics != null)
- addParameter("afterNotifyTopics", findString(afterNotifyTopics));
- if (errorNotifyTopics != null)
- addParameter("errorNotifyTopics", findString(errorNotifyTopics));
- if (highlightColor != null)
- addParameter("highlightColor", findString(highlightColor));
- if (highlightDuration != null)
- addParameter("highlightDuration", findString(highlightDuration));
- if (separateScripts != null)
- addParameter("separateScripts", findValue(separateScripts, Boolean.class));
- if (transport != null)
- addParameter("transport", findString(transport));
- if (parseContent != null)
- addParameter("parseContent", findValue(parseContent, Boolean.class));
- else
- addParameter("parseContent", true);
-
- // generate a random ID if not explicitly set and not parsing the content
- Boolean parseContent = (Boolean)stack.getContext().get(Head.PARSE_CONTENT);
- boolean generateId = (parseContent != null ? !parseContent : true);
-
- addParameter("pushId", generateId);
- if ((this.id == null || this.id.length() == 0) && generateId) {
- // resolves Math.abs(Integer.MIN_VALUE) issue reported by FindBugs
- // http://findbugs.sourceforge.net/bugDescriptions.html#RV_ABSOLUTE_VALUE_OF_RANDOM_INT
- int nextInt = RANDOM.nextInt();
- nextInt = nextInt == Integer.MIN_VALUE ? Integer.MAX_VALUE : Math.abs(nextInt);
- this.id = "widget_" + String.valueOf(nextInt);
- addParameter("id", this.id);
- }
- }
-
- @Override
- @StrutsTagSkipInheritance
- public void setTheme(String theme) {
- super.setTheme(theme);
- }
-
- @Override
- public String getTheme() {
- return "ajax";
- }
-
- @StrutsTagAttribute(description="Topic that will trigger the remote call")
- public void setListenTopics(String listenTopics) {
- this.listenTopics = listenTopics;
- }
-
- @StrutsTagAttribute(description="The URL to call to obtain the content. Note: If used with ajax context, the value must be set as an url tag value.")
- public void setHref(String href) {
- this.href = href;
- }
-
-
- @StrutsTagAttribute(description="The text to display to the user if the is an error fetching the content")
- public void setErrorText(String errorText) {
- this.errorText = errorText;
- }
-
- @StrutsTagAttribute(description="Javascript code in the fetched content will be executed", type="Boolean", defaultValue="false")
- public void setExecuteScripts(String executeScripts) {
- this.executeScripts = executeScripts;
- }
-
- @StrutsTagAttribute(description="Text to be shown while content is being fetched", defaultValue="Loading...")
- public void setLoadingText(String loadingText) {
- this.loadingText = loadingText;
- }
-
-
- @StrutsTagAttribute(description="Javascript function name that will make the request")
- public void setHandler(String handler) {
- this.handler = handler;
- }
-
-
- @StrutsTagAttribute(description="Function name used to filter the fields of the form.")
- public void setFormFilter(String formFilter) {
- this.formFilter = formFilter;
- }
-
- @StrutsTagAttribute(description="Form id whose fields will be serialized and passed as parameters")
- public void setFormId(String formId) {
- this.formId = formId;
- }
-
- @StrutsTagAttribute(description="Comma delimmited list of topics that will published before and after the request, and on errors")
- public void setNotifyTopics(String notifyTopics) {
- this.notifyTopics = notifyTopics;
- }
-
-
- @StrutsTagAttribute(description="Set whether errors will be shown or not", type="Boolean", defaultValue="true")
- public void setShowErrorTransportText(String showError) {
- this.showErrorTransportText = showError;
- }
-
- @StrutsTagAttribute(description="Id of element that will be shown while making request")
- public void setIndicator(String indicator) {
- this.indicator = indicator;
- }
-
- @StrutsTagAttribute(description="Show loading text on targets", type="Boolean", defaultValue="false")
- public void setShowLoadingText(String showLoadingText) {
- this.showLoadingText = showLoadingText;
- }
-
- @StrutsTagAttribute(description="The css class to use for element")
- public void setCssClass(String cssClass) {
- super.setCssClass(cssClass);
- }
-
- @StrutsTagAttribute(description="The css style to use for element")
- public void setCssStyle(String cssStyle) {
- super.setCssStyle(cssStyle);
- }
-
- @StrutsTagAttribute(description="The id to use for the element")
- public void setId(String id) {
- super.setId(id);
- }
-
- @StrutsTagAttribute(description="The name to set for element")
- public void setName(String name) {
- super.setName(name);
- }
-
- @StrutsTagAttribute(description="Comma delimmited list of topics that will published after the request(if the request succeeds)")
- public void setAfterNotifyTopics(String afterNotifyTopics) {
- this.afterNotifyTopics = afterNotifyTopics;
- }
-
- @StrutsTagAttribute(description="Comma delimmited list of topics that will published before the request")
- public void setBeforeNotifyTopics(String beforeNotifyTopics) {
- this.beforeNotifyTopics = beforeNotifyTopics;
- }
-
- @StrutsTagAttribute(description="Comma delimmited list of topics that will published after the request(if the request fails)")
- public void setErrorNotifyTopics(String errorNotifyTopics) {
- this.errorNotifyTopics = errorNotifyTopics;
- }
-
- @StrutsTagAttribute(description = "Color used to perform a highlight effect on the elements specified in the 'targets' attribute",
- defaultValue = "none")
- public void setHighlightColor(String highlightColor) {
- this.highlightColor = highlightColor;
- }
-
- @StrutsTagAttribute(description = "Duration of highlight effect in milliseconds. Only valid if 'highlightColor' attribute is set",
- defaultValue = "2000", type="Integer")
- public void setHighlightDuration(String highlightDuration) {
- this.highlightDuration = highlightDuration;
- }
-
- @StrutsTagAttribute(description="Run scripts in a separate scope, unique for each tag", defaultValue="true")
- public void setSeparateScripts(String separateScripts) {
- this.separateScripts = separateScripts;
- }
-
- @StrutsTagAttribute(description="Transport used by Dojo to make the request", defaultValue="XMLHTTPTransport")
- public void setTransport(String transport) {
- this.transport = transport;
- }
-
- @StrutsTagAttribute(description="Parse returned HTML for Dojo widgets", defaultValue="true", type="Boolean")
- public void setParseContent(String parseContent) {
- this.parseContent = parseContent;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/AbstractValidateBean.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/AbstractValidateBean.java
deleted file mode 100644
index 5bf9705a4..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/AbstractValidateBean.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.components;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Form;
-import org.apache.struts2.views.annotations.StrutsTagAttribute;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * Base class for tags that perform AJAX validation
- */
-public abstract class AbstractValidateBean extends AbstractRemoteBean {
- protected String validate;
- protected String ajaxAfterValidation;
-
- public AbstractValidateBean(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
- super(stack, request, response);
- }
-
- public void evaluateExtraParams() {
- super.evaluateExtraParams();
-
- if (validate != null)
- addParameter("validate", findValue(validate, Boolean.class));
- if (ajaxAfterValidation != null)
- addParameter("ajaxAfterValidation", findValue(ajaxAfterValidation, Boolean.class));
-
- Form form = (Form) findAncestor(Form.class);
- if (form != null)
- addParameter("parentTheme", form.getTheme());
- }
-
- @StrutsTagAttribute(description = "Perform Ajax validation. 'ajaxValidation' interceptor must be applied to action", type="Boolean",
- defaultValue = "false")
- public void setValidate(String validate) {
- this.validate = validate;
- }
-
- @StrutsTagAttribute(description = "Make an asynchronous request if validation succeeds. Only valid if 'validate' is 'true'", type="Boolean",
- defaultValue = "false")
- public void setAjaxAfterValidation(String ajaxAfterValidation) {
- this.ajaxAfterValidation = ajaxAfterValidation;
- }
-}
\ No newline at end of file
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Anchor.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Anchor.java
deleted file mode 100644
index ace440edf..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Anchor.java
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.components;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.views.annotations.StrutsTag;
-import org.apache.struts2.views.annotations.StrutsTagAttribute;
-import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- *
- *
- * A tag that creates an HTML <a/> element, that when clicked makes an asynchronous request(XMLHttpRequest). The url
- * attribute must be build using the <s:url/> tag.
- *
- *
- *
Examples
- *
- *
- * <div id="div1">Div 1</div>
- * <s:url id="ajaxTest" value="/AjaxTest.action"/>
- *
- * <sx:a id="link1" href="%{ajaxTest}" target="div1">
- * Update Content
- * </sx:a>
- *
- *
- *
- * <s:form id="form" action="AjaxTest">
- * <input type="textbox" name="data">
- * <sx:a>Submit form</sx:a>
- * </s:form>
- *
- *
- *
- * <s:form id="form" action="AjaxTest">
- * <input type="textbox" name="data">
- * </s:form>
- *
- * <sx:a formId="form">Submit form</sx:a>
- *
- *
- *
- * <script type="text/javascript">
- * dojo.event.topic.subscribe("/before", function(event, widget){
- * alert('inside a topic event. before request');
- * //event: set event.cancel = true, to cancel request
- * //widget: widget that published the topic
- * });
- * </script>
- *
- * <sx:a beforeNotifyTopics="/before">Publish topics</sx:a>
- *
- *
- *
- * <script type="text/javascript">
- * dojo.event.topic.subscribe("/after", function(data, request, widget){
- * alert('inside a topic event. after request');
- * //data : text returned from request(the html)
- * //request: XMLHttpRequest object
- * //widget: widget that published the topic
- * });
- * </script>
- *
- * <sx:a afterNotifyTopics="/after" highlightColor="red" href="%{#ajaxTest}">Publish topics</sx:a>
- *
- *
- *
- * <script type="text/javascript">
- * dojo.event.topic.subscribe("/error", function(error, request, widget){
- * alert('inside a topic event. on error');
- * //error : error object (error.message has the error message)
- * //request: XMLHttpRequest object
- * //widget: widget that published the topic
- * });
- * </script>
- *
- * <img id="ind1" src="${pageContext.request.contextPath}/images/indicator.gif" style="display:none"/>
- * <sx:a errorNotifyTopics="/error" indicator="ind1" href="%{#ajaxTest}">Publish topics</sx:a>
- *
- */
-@StrutsTag(name="a", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.AnchorTag", description="Renders an HTML anchor element that when clicked calls a URL via remote XMLHttpRequest and updates " +
- "its targets content")
-public class Anchor extends AbstractValidateBean {
- public static final String OPEN_TEMPLATE = "a";
- public static final String TEMPLATE = "a-close";
- public static final String COMPONENT_NAME = Anchor.class.getName();
-
- protected String targets;
-
- public Anchor(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
- super(stack, request, response);
- }
-
- public String getDefaultOpenTemplate() {
- return OPEN_TEMPLATE;
- }
-
- protected String getDefaultTemplate() {
- return TEMPLATE;
- }
-
- public void evaluateExtraParams() {
- super.evaluateExtraParams();
-
- if (targets != null)
- addParameter("targets", findString(targets));
- }
-
- @Override
- @StrutsTagSkipInheritance
- public void setTheme(String theme) {
- super.setTheme(theme);
- }
-
- @StrutsTagAttribute(description="Comma delimited list of ids of the elements whose content will be updated")
- public void setTargets(String targets) {
- this.targets = targets;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Autocompleter.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Autocompleter.java
deleted file mode 100644
index ad6c1f4f0..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Autocompleter.java
+++ /dev/null
@@ -1,528 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.components;
-
-import java.util.Random;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.ComboBox;
-import org.apache.struts2.views.annotations.StrutsTag;
-import org.apache.struts2.views.annotations.StrutsTagAttribute;
-import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- *
- *
The autocomplete tag is a combobox that can autocomplete text entered on the input box. If an action
- * is used to populate the autocompleter, the output of the action must be a well formed JSON string.
- *
The autocompleter follows this rule to find its datasource:
- *
1. If the response is an array, assume that it contains 2-dimension array elements, like:
- *
2. If a value is specified in the "dataFieldName" attribute, and the response has a field with that
- * name, assume that's the datasource, which can be an array of 2-dimension array elements, or a map,
- * like (assuming dataFieldName="state"):
- *
- * <sx:autocompleter name="autocompleter1" href="%{jsonList}"/>
- *
- *
- *
- * <s:autocompleter name="test" list="{'apple','banana','grape','pear'}" autoComplete="false"/>
- *
- *
- *
- * <sx:autocompleter name="mvc" href="%{jsonList}" loadOnTextChange="true" loadMinimumCount="3"/>
- *
- * The text entered on the autocompleter is passed as a parameter to the url specified in "href", like (text is "struts"):
- *
- * http://host/example/myaction.do?mvc=struts
- *
- *
- *
- * <form id="selectForm">
- * <sx:autocompleter name="select" list="{'fruits','colors'}" valueNotifyTopics="/changed" />
- * </form>
- * <sx:autocompleter href="%{jsonList}" formId="selectForm" listenTopics="/changed"/>
- *
- *
- *
- * <sx:autocompleter href="%{jsonList}" id="auto"/>
- * <script type="text/javascript">
- * function getValues() {
- * var autoCompleter = dojo.widget.byId("auto");
- *
- * //key (in the states example above, "AL")
- * var key = autoCompleter.getSelectedKey();
- * alert(key);
- *
- * //value (in the states example above, "Alabama")
- * var value = autoCompleter.getSelectedValue();
- * alert(value);
- *
- * //text currently on the textbox (anything the user typed)
- * var text = autoCompleter.getText();
- * alert(text);
- * }
- *
- * function setValues() {
- * var autoCompleter = dojo.widget.byId("auto");
- *
- * //key (key will be set to "AL" and value to "Alabama")
- * autoCompleter.setSelectedKey("AL");
- *
- * //value (key will be set to "AL" and value to "Alabama")
- * autoCompleter.setAllValues("AL", "Alabama");
- * }
- * </script>
- *
- *
- *
- * <script type="text/javascript">
- * dojo.event.topic.subscribe("/before", function(event, widget){
- * alert('inside a topic event. before request');
- * //event: set event.cancel = true, to cancel request
- * //widget: widget that published the topic
- * });
- * </script>
- *
- * <sx:autocompleter beforeNotifyTopics="/before" href="%{#ajaxTest} />
- *
- *
- *
- * <script type="text/javascript">
- * dojo.event.topic.subscribe("/after", function(data, request, widget){
- * alert('inside a topic event. after request');
- * //data : JavaScript object from parsing response
- * //request: XMLHttpRequest object
- * //widget: widget that published the topic
- * });
- * </script>
- *
- * <sx:autocompleter afterNotifyTopics="/after" href="%{#ajaxTest}" />
- *
- *
- *
- * <script type="text/javascript">
- * dojo.event.topic.subscribe("/error", function(error, request, widget){
- * alert('inside a topic event. on error');
- * //error : error object (error.message has the error message)
- * //request: XMLHttpRequest object
- * //widget: widget that published the topic
- * });
- * </script>
- *
- * <sx:autocompleter errorNotifyTopics="/error" href="%{#ajaxTest}" />
- *
- *
- *
- * <script type="text/javascript">
- * dojo.event.topic.subscribe("/value", function(value, key, text, widget){
- * alert('inside a topic event. after value changed');
- * //value : selected value (like "Florida" in example above)
- * //key: selected key (like "FL" in example above)
- * //text: text typed into textbox
- * //widget: widget that published the topic
- * });
- * </script>
- *
- * <sx:autocompleter valueNotifyTopics="/value" href="%{#ajaxTest}" />
- *
- */
-@StrutsTag(name="autocompleter", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.AutocompleterTag", description="Renders a combobox with autocomplete and AJAX capabilities")
-public class Autocompleter extends ComboBox {
- public static final String TEMPLATE = "autocompleter";
- final private static String COMPONENT_NAME = Autocompleter.class.getName();
- private final static transient Random RANDOM = new Random();
-
- protected String forceValidOption;
- protected String searchType;
- protected String autoComplete;
- protected String delay;
- protected String disabled;
- protected String href;
- protected String dropdownWidth;
- protected String dropdownHeight;
- protected String formId;
- protected String formFilter;
- protected String listenTopics;
- protected String notifyTopics;
- protected String indicator;
- protected String loadOnTextChange;
- protected String loadMinimumCount;
- protected String showDownArrow;
- protected String templateCssPath;
- protected String iconPath;
- protected String keyName;
- protected String dataFieldName;
- protected String beforeNotifyTopics;
- protected String afterNotifyTopics;
- protected String errorNotifyTopics;
- protected String valueNotifyTopics;
- protected String resultsLimit;
- protected String transport;
- protected String preload;
- protected String keyValue;
-
- public Autocompleter(ValueStack stack, HttpServletRequest request,
- HttpServletResponse response) {
- super(stack, request, response);
- }
-
- protected String getDefaultTemplate() {
- return TEMPLATE;
- }
-
- public String getComponentName() {
- return COMPONENT_NAME;
- }
-
-
- public void evaluateExtraParams() {
- super.evaluateExtraParams();
-
- if (forceValidOption != null)
- addParameter("forceValidOption", findValue(forceValidOption,
- Boolean.class));
- if (searchType != null) {
- String type = findString(searchType);
- if(type != null)
- addParameter("searchType", type.toUpperCase());
- }
- if (autoComplete != null)
- addParameter("autoComplete", findValue(autoComplete, Boolean.class));
- if (delay != null)
- addParameter("delay", findValue(delay, Integer.class));
- if (disabled != null)
- addParameter("disabled", findValue(disabled, Boolean.class));
- if (href != null) {
- addParameter("href", findString(href));
- addParameter("mode", "remote");
- }
- if (dropdownHeight != null)
- addParameter("dropdownHeight", findValue(dropdownHeight, Integer.class));
- if (dropdownWidth != null)
- addParameter("dropdownWidth", findValue(dropdownWidth, Integer.class));
- if (formFilter != null)
- addParameter("formFilter", findString(formFilter));
- if (formId != null)
- addParameter("formId", findString(formId));
- if (listenTopics != null)
- addParameter("listenTopics", findString(listenTopics));
- if (notifyTopics != null)
- addParameter("notifyTopics", findString(notifyTopics));
- if (indicator != null)
- addParameter("indicator", findString(indicator));
- if (loadOnTextChange != null)
- addParameter("loadOnTextChange", findValue(loadOnTextChange, Boolean.class));
- if (loadMinimumCount != null)
- addParameter("loadMinimumCount", findValue(loadMinimumCount, Integer.class));
- if (showDownArrow != null)
- addParameter("showDownArrow", findValue(showDownArrow, Boolean.class));
- else
- addParameter("showDownArrow", Boolean.TRUE);
- if (templateCssPath != null)
- addParameter("templateCssPath", findString(templateCssPath));
- if (iconPath != null)
- addParameter("iconPath", findString(iconPath));
- if (dataFieldName != null)
- addParameter("dataFieldName", findString(dataFieldName));
- if (keyName != null)
- addParameter("keyName", findString(keyName));
- else {
- keyName = name + "Key";
- addParameter("keyName", findString(keyName));
- }
- if (transport != null)
- addParameter("transport", findString(transport));
- if (preload != null)
- addParameter("preload", findValue(preload, Boolean.class));
-
- if (keyValue != null)
- addParameter("nameKeyValue", findString(keyValue));
- else {
- String keyNameExpr = "%{" + keyName + "}";
- addParameter("nameKeyValue", findString(keyNameExpr));
- }
-
-
- if (beforeNotifyTopics != null)
- addParameter("beforeNotifyTopics", findString(beforeNotifyTopics));
- if (afterNotifyTopics != null)
- addParameter("afterNotifyTopics", findString(afterNotifyTopics));
- if (errorNotifyTopics != null)
- addParameter("errorNotifyTopics", findString(errorNotifyTopics));
- if (valueNotifyTopics != null)
- addParameter("valueNotifyTopics", findString(valueNotifyTopics));
- if (resultsLimit != null)
- addParameter("searchLimit", findString(resultsLimit));
-
- // generate a random ID if not explicitly set and not parsing the content
- Boolean parseContent = (Boolean)stack.getContext().get(Head.PARSE_CONTENT);
- boolean generateId = (parseContent != null ? !parseContent : true);
-
- addParameter("pushId", generateId);
- if ((this.id == null || this.id.length() == 0) && generateId) {
- // resolves Math.abs(Integer.MIN_VALUE) issue reported by FindBugs
- // http://findbugs.sourceforge.net/bugDescriptions.html#RV_ABSOLUTE_VALUE_OF_RANDOM_INT
- int nextInt = RANDOM.nextInt();
- nextInt = nextInt == Integer.MIN_VALUE ? Integer.MAX_VALUE : Math.abs(nextInt);
- this.id = "widget_" + String.valueOf(nextInt);
- }
- }
-
- @Override
- @StrutsTagSkipInheritance
- public void setTheme(String theme) {
- super.setTheme(theme);
- }
-
- @Override
- public String getTheme() {
- return "ajax";
- }
-
- protected Object findListValue() {
- return (list != null) ? findValue(list, Object.class) : null;
- }
-
- @StrutsTagAttribute(description="Whether autocompleter should make suggestion on the textbox", type="Boolean", defaultValue="false")
- public void setAutoComplete(String autoComplete) {
- this.autoComplete = autoComplete;
- }
-
- @StrutsTagAttribute(description="Enable or disable autocompleter", type="Boolean", defaultValue="false")
- public void setDisabled(String disabled) {
- this.disabled = disabled;
- }
-
- @StrutsTagAttribute(description="Force selection to be one of the options", type="Boolean", defaultValue="false")
- public void setForceValidOption(String forceValidOption) {
- this.forceValidOption = forceValidOption;
- }
-
- @StrutsTagAttribute(description="The URL used to load the options")
- public void setHref(String href) {
- this.href = href;
- }
-
- @StrutsTagAttribute(description="Delay before making the search", type="Integer", defaultValue="100")
- public void setDelay(String searchDelay) {
- this.delay = searchDelay;
- }
-
- @StrutsTagAttribute(description="how the search must be performed, options are: 'startstring', 'startword' " +
- "and 'substring'", defaultValue="stringstart")
- public void setSearchType(String searchType) {
- this.searchType = searchType;
- }
-
- @StrutsTagAttribute(description="Dropdown's height in pixels", type="Integer", defaultValue="120")
- public void setDropdownHeight(String height) {
- this.dropdownHeight = height;
- }
-
- @StrutsTagAttribute(description="Dropdown's width", type="Integer", defaultValue="same as textbox")
- public void setDropdownWidth(String width) {
- this.dropdownWidth = width;
- }
-
- @StrutsTagAttribute(description="Function name used to filter the fields of the form")
- public void setFormFilter(String formFilter) {
- this.formFilter = formFilter;
- }
-
- @StrutsTagAttribute(description="Form id whose fields will be serialized and passed as parameters")
- public void setFormId(String formId) {
- this.formId = formId;
- }
-
- @StrutsTagAttribute(description="Topic that will trigger a reload")
- public void setListenTopics(String listenTopics) {
- this.listenTopics = listenTopics;
- }
-
- @StrutsTagAttribute(description="Topics that will be published when content is reloaded")
- public void setNotifyTopics(String onValueChangedPublishTopic) {
- this.notifyTopics = onValueChangedPublishTopic;
- }
-
- @StrutsTagAttribute(description="Id of element that will be shown while request is made")
- public void setIndicator(String indicator) {
- this.indicator = indicator;
- }
-
- @StrutsTagAttribute(description="Minimum number of characters that will force the content to be loaded", type="Integer", defaultValue="3")
- public void setLoadMinimumCount(String loadMinimumCount) {
- this.loadMinimumCount = loadMinimumCount;
- }
-
- @StrutsTagAttribute(description="Options will be reloaded everytime a character is typed on the textbox", type="Boolean", defaultValue="true")
- public void setLoadOnTextChange(String loadOnType) {
- this.loadOnTextChange = loadOnType;
- }
-
- @StrutsTagAttribute(description="Show or hide the down arrow button", type="Boolean", defaultValue="true")
- public void setShowDownArrow(String showDownArrow) {
- this.showDownArrow = showDownArrow;
- }
-
- // Override as not required
- @StrutsTagAttribute(description="Iteratable source to populate from.")
- public void setList(String list) {
- super.setList(list);
- }
-
- @StrutsTagAttribute(description="Template css path")
- public void setTemplateCssPath(String templateCssPath) {
- this.templateCssPath = templateCssPath;
- }
-
- @StrutsTagAttribute(description="Path to icon used for the dropdown")
- public void setIconPath(String iconPath) {
- this.iconPath = iconPath;
- }
-
- @StrutsTagAttribute(description="Name of the field to which the selected key will be assigned")
- public void setKeyName(String keyName) {
- this.keyName = keyName;
- }
-
- @StrutsTagAttribute(description="Name of the field in the returned JSON object that contains the data array", defaultValue="Value specified in 'name'")
- public void setDataFieldName(String dataFieldName) {
- this.dataFieldName = dataFieldName;
- }
-
- @StrutsTagAttribute(description="The css class to use for element")
- public void setCssClass(String cssClass) {
- super.setCssClass(cssClass);
- }
-
- @StrutsTagAttribute(description="The css style to use for element")
- public void setCssStyle(String cssStyle) {
- super.setCssStyle(cssStyle);
- }
-
- @StrutsTagAttribute(description="The id to use for the element")
- public void setId(String id) {
- super.setId(id);
- }
-
- @StrutsTagAttribute(description="The name to set for element")
- public void setName(String name) {
- super.setName(name);
- }
-
- @StrutsTagAttribute(description="Preset the value of input element")
- public void setValue(String arg0) {
- super.setValue(arg0);
- }
-
- @StrutsTagAttribute(description="Comma delimmited list of topics that will published after the request(if the request succeeds)")
- public void setAfterNotifyTopics(String afterNotifyTopics) {
- this.afterNotifyTopics = afterNotifyTopics;
- }
-
- @StrutsTagAttribute(description="Comma delimmited list of topics that will published before the request")
- public void setBeforeNotifyTopics(String beforeNotifyTopics) {
- this.beforeNotifyTopics = beforeNotifyTopics;
- }
-
- @StrutsTagAttribute(description="Comma delimmited list of topics that will published after the request(if the request fails)")
- public void setErrorNotifyTopics(String errorNotifyTopics) {
- this.errorNotifyTopics = errorNotifyTopics;
- }
-
- @StrutsTagAttribute(description="Comma delimmited list of topics that will published when a value is selected")
- public void setValueNotifyTopics(String valueNotifyTopics) {
- this.valueNotifyTopics = valueNotifyTopics;
- }
-
- @StrutsTagAttribute(description="Limit how many results are shown as autocompletion options, set to -1 for unlimited results", defaultValue="30", type = "Integer")
- public void setResultsLimit(String resultsLimit) {
- this.resultsLimit = resultsLimit;
- }
-
- @StrutsTagAttribute(description="Transport used by Dojo to make the request", defaultValue="XMLHTTPTransport")
- public void setTransport(String transport) {
- this.transport = transport;
- }
-
- @StrutsTagAttribute(description="Load options when page is loaded", type="Boolean", defaultValue="true")
- public void setPreload(String preload) {
- this.preload = preload;
- }
-
- @StrutsTagAttribute(description="Initial key value")
- public void setKeyValue(String keyValue) {
- this.keyValue = keyValue;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java
deleted file mode 100644
index 76a9638f4..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Bind.java
+++ /dev/null
@@ -1,295 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.components;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.views.annotations.StrutsTag;
-import org.apache.struts2.views.annotations.StrutsTagAttribute;
-import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- *
- *
- * This tag will generate event listeners for multiple events on multiple sources,
- * making an asynchronous request to the specified href, and updating multiple targets.
- *
- *
- *
- *
Examples
- *
- *
- * <sx:bind href="%{#ajaxTest}" listenTopics="/makecall"/>
- * <s:submit onclick="dojo.event.topic.publish('/makecall')"/>
- *
- *
- *
- * <img id="indicator" src="${pageContext.request.contextPath}/images/indicator.gif" alt="Loading..." style="display:none"/>
- * <sx:bind id="ex1" href="%{#ajaxTest}" sources="button" targets="div1" events="onclick" indicator="indicator" />
- * <s:submit theme="simple" type="submit" value="submit" id="button"/>
- *
- *
- *
- * <sx:bind id="ex3" href="%{#ajaxTest}" sources="chk1" targets="div1" events="onchange" formId="form1" />
- * <form id="form1">
- * <s:checkbox name="data" label="Hit me" id="chk1"/>
- * </form>
- *
- *
- *
- * <script type="text/javascript">
- * dojo.event.topic.subscribe("/before", function(event, widget){
- * alert('inside a topic event. before request');
- * //event: set event.cancel = true, to cancel request
- * //widget: widget that published the topic
- * });
- * </script>
- *
- * <input type="button" id="button">
- * <sx:bind id="ex1" href="%{#ajaxTest}" beforeNotifyTopics="/before" sources="button" events="onclick"/>
- *
- *
- *
- * <script type="text/javascript">
- * dojo.event.topic.subscribe("/after", function(data, request, widget){
- * alert('inside a topic event. after request');
- * //data : text returned from request(the html)
- * //request: XMLHttpRequest object
- * //widget: widget that published the topic
- * });
- * </script>
- *
- * <input type="button" id="button">
- * <sx:bind id="ex1" href="%{#ajaxTest}" highlightColor="red" afterNotifyTopics="/after" sources="button" events="onclick"/>
- *
- *
- *
- * <script type="text/javascript">
- * dojo.event.topic.subscribe("/error", function(error, request, widget){
- * alert('inside a topic event. on error');
- * //error : error object (error.message has the error message)
- * //request: XMLHttpRequest object
- * //widget: widget that published the topic
- * });
- * </script>
- *
- * <input type="button" id="button">
- * <img id="ind1" src="${pageContext.request.contextPath}/images/indicator.gif" style="display:none"/>
- * <sx:bind href="%{#ajaxTest}" indicator="ind1" errorNotifyTopics="/error" sources="button" events="onclick"/>
- *
- */
-@StrutsTag(name="bind", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.BindTag", description="Attach event listeners to elements to make AJAX calls")
-@StrutsTagSkipInheritance
-public class Bind extends AbstractValidateBean {
- public static final String TEMPLATE = "bind-close";
- public static final String OPEN_TEMPLATE = "bind";
-
- protected String targets;
- protected String sources;
- protected String events;
-
- public Bind(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
- super(stack, request, response);
- }
-
- public String getDefaultOpenTemplate() {
- return OPEN_TEMPLATE;
- }
-
- protected String getDefaultTemplate() {
- return TEMPLATE;
- }
-
- public void evaluateExtraParams() {
- super.evaluateExtraParams();
-
- if (targets != null)
- addParameter("targets", findString(targets));
- if (sources != null)
- addParameter("sources", findString(sources));
- if (events != null)
- addParameter("events", findString(events));
- }
-
- @StrutsTagAttribute(description="Comma delimited list of event names to attach to")
- public void setEvents(String events) {
- this.events = events;
- }
-
- @StrutsTagAttribute(description="Comma delimited list of ids of the elements to attach to")
- public void setSources(String sources) {
- this.sources = sources;
- }
-
- @StrutsTagAttribute(description="Comma delimited list of ids of the elements whose content will be updated")
- public void setTargets(String targets) {
- this.targets = targets;
- }
-
- @Override
- @StrutsTagSkipInheritance
- public void setTheme(String theme) {
- super.setTheme(theme);
- }
-
- @Override
- public String getTheme() {
- return "ajax";
- }
-
- //these attributes are overwritten here just for the TLD generation
-
- @StrutsTagAttribute(description="Topic that will trigger the remote call")
- public void setListenTopics(String listenTopics) {
- this.listenTopics = listenTopics;
- }
-
- @StrutsTagAttribute(description="The URL to call to obtain the content. Note: If used with ajax context, the value must be set as an url tag value.")
- public void setHref(String href) {
- this.href = href;
- }
-
-
- @StrutsTagAttribute(description="The text to display to the user if the is an error fetching the content")
- public void setErrorText(String errorText) {
- this.errorText = errorText;
- }
-
- @StrutsTagAttribute(description="Javascript code in the fetched content will be executed", type="Boolean", defaultValue="false")
- public void setExecuteScripts(String executeScripts) {
- this.executeScripts = executeScripts;
- }
-
- @StrutsTagAttribute(description="Text to be shown while content is being fetched", defaultValue="Loading...")
- public void setLoadingText(String loadingText) {
- this.loadingText = loadingText;
- }
-
-
- @StrutsTagAttribute(description="Javascript function name that will make the request")
- public void setHandler(String handler) {
- this.handler = handler;
- }
-
-
- @StrutsTagAttribute(description="Function name used to filter the fields of the form.")
- public void setFormFilter(String formFilter) {
- this.formFilter = formFilter;
- }
-
- @StrutsTagAttribute(description="Form id whose fields will be serialized and passed as parameters")
- public void setFormId(String formId) {
- this.formId = formId;
- }
-
- @StrutsTagAttribute(description="Comma delimmited list of topics that will published before and after the request, and on errors")
- public void setNotifyTopics(String notifyTopics) {
- this.notifyTopics = notifyTopics;
- }
-
- @StrutsTagAttribute(description="Set whether errors will be shown or not", type="Boolean", defaultValue="true")
- public void setShowErrorTransportText(String showError) {
- this.showErrorTransportText = showError;
- }
-
- @StrutsTagAttribute(description="Id of element that will be shown while making request")
- public void setIndicator(String indicator) {
- this.indicator = indicator;
- }
-
- @StrutsTagAttribute(description="Show loading text on targets", type="Boolean", defaultValue="false")
- public void setShowLoadingText(String showLoadingText) {
- this.showLoadingText = showLoadingText;
- }
-
- @StrutsTagSkipInheritance
- public void setCssClass(String cssClass) {
- super.setCssClass(cssClass);
- }
-
- @StrutsTagSkipInheritance
- public void setCssStyle(String cssStyle) {
- super.setCssStyle(cssStyle);
- }
-
- @StrutsTagSkipInheritance
- public void setName(String name) {
- super.setName(name);
- }
-
- @StrutsTagAttribute(description="Comma delimmited list of topics that will published after the request(if the request succeeds)")
- public void setAfterNotifyTopics(String afterNotifyTopics) {
- this.afterNotifyTopics = afterNotifyTopics;
- }
-
- @StrutsTagAttribute(description="Comma delimmited list of topics that will published before the request")
- public void setBeforeNotifyTopics(String beforeNotifyTopics) {
- this.beforeNotifyTopics = beforeNotifyTopics;
- }
-
- @StrutsTagAttribute(description="Comma delimmited list of topics that will published after the request(if the request fails)")
- public void setErrorNotifyTopics(String errorNotifyTopics) {
- this.errorNotifyTopics = errorNotifyTopics;
- }
-
- @StrutsTagAttribute(description="The id to use for the element")
- public void setId(String id) {
- super.setId(id);
- }
-
- @StrutsTagAttribute(description = "Color used to perform a highlight effect on the elements specified in the 'targets' attribute",
- defaultValue = "none")
- public void setHighlightColor(String highlightColor) {
- this.highlightColor = highlightColor;
- }
-
- @StrutsTagAttribute(description = "Duration of highlight effect in milliseconds. Only valid if 'highlightColor' attribute is set",
- defaultValue = "2000", type="Integer")
- public void setHighlightDuration(String highlightDuration) {
- this.highlightDuration = highlightDuration;
- }
-
- @StrutsTagAttribute(description = "Perform Ajax validation. 'ajaxValidation' interceptor must be applied to action", type="Boolean",
- defaultValue = "false")
- public void setValidate(String validate) {
- this.validate = validate;
- }
-
- @StrutsTagAttribute(description = "Make an asynchronous request if validation succeeds. Only valid is 'validate' is 'true'", type="Boolean",
- defaultValue = "false")
- public void setAjaxAfterValidation(String ajaxAfterValidation) {
- this.ajaxAfterValidation = ajaxAfterValidation;
- }
-
- @StrutsTagAttribute(description="Run scripts in a separate scope, unique for each tag", defaultValue="true")
- public void setSeparateScripts(String separateScripts) {
- this.separateScripts = separateScripts;
- }
-
- @StrutsTagAttribute(description="Transport used by Dojo to make the request", defaultValue="XMLHTTPTransport")
- public void setTransport(String transport) {
- this.transport = transport;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/DateTimePicker.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/DateTimePicker.java
deleted file mode 100644
index 8659560e3..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/DateTimePicker.java
+++ /dev/null
@@ -1,435 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.components;
-
-import java.text.DateFormat;
-import java.text.Format;
-import java.text.MessageFormat;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Calendar;
-import java.util.Date;
-import java.util.List;
-import java.util.Random;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.UIBean;
-import org.apache.struts2.views.annotations.StrutsTag;
-import org.apache.struts2.views.annotations.StrutsTagAttribute;
-import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
-
-import com.opensymphony.xwork2.util.ValueStack;
-import com.opensymphony.xwork2.util.logging.Logger;
-import com.opensymphony.xwork2.util.logging.LoggerFactory;
-
-/**
- *
- *
- * Renders a date/time picker in a dropdown container.
- *
- *
- * A stand-alone DateTimePicker widget that makes it easy to select a date/time, or increment by week, month,
- * and/or year.
- *
- *
- *
- * It is possible to customize the user-visible formatting with either the
- * 'formatLength' (long, short, medium or full) or 'displayFormat' attributes. By defaulty current
- * locale will be used.
- *
- *
- * Syntax supported by 'displayFormat' is (http://www.unicode.org/reports/tr35/tr35-4.html#Date_Format_Patterns):-
- *
- *
- *
Format
- *
Description
- *
- *
- *
d
- *
Day of the month
- *
- *
- *
D
- *
Day of year
- *
- *
- *
M
- *
Month - Use one or two for the numerical month, three for the abbreviation, or four for the full name, or 5 for the narrow name.
- *
- *
- *
y
- *
Year
- *
- *
- *
h
- *
Hour [1-12].
- *
- *
- *
H
- *
Hour [0-23].
- *
- *
- *
m
- *
Minute. Use one or two for zero padding.
- *
- *
- *
s
- *
Second. Use one or two for zero padding.
- *
- *
- *
- *
- * The value sent to the server is a locale-independent value, in a hidden field as defined
- * by the name attribute. The value will be formatted conforming to RFC3 339
- * (yyyy-MM-dd'T'HH:mm:ss)
- *
- *
- * The following formats(in order) will be used to parse the values of the attributes 'value',
- * 'startDate' and 'endDate':
- *
- *
- *
SimpleDateFormat built using RFC 3339 (yyyy-MM-dd'T'HH:mm:ss)
- *
- *
- *
- * <sx:datetimepicker id="picker" label="Order Date" />
- * <script type="text/javascript">
- * function setValue() {
- * var picker = dojo.widget.byId("picker");
- *
- * //string value
- * picker.setValue('2007-01-01');
- *
- * //Date value
- * picker.setValue(new Date());
- * }
- *
- * function showValue() {
- * var picker = dojo.widget.byId("picker");
- *
- * //string value
- * var stringValue = picker.getValue();
- * alert(stringValue);
- *
- * //date value
- * var dateValue = picker.getDate();
- * alert(dateValue);
- * }
- * </script>
- *
- *
- *
- * <sx:datetimepicker id="picker" label="Order Date" valueNotifyTopics="/value"/>
- *
- * <script type="text/javascript">
- * dojo.event.topic.subscribe("/value", function(textEntered, date, widget){
- * alert('value changed');
- * //textEntered: String enetered in the textbox
- * //date: JavaScript Date object with the value selected
- * //widet: widget that published the topic
- * });
- * </script>
- *
- */
-@StrutsTag(name="datetimepicker", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.DateTimePickerTag", description="Render datetimepicker")
-public class DateTimePicker extends UIBean {
-
- final public static String TEMPLATE = "datetimepicker";
- // SimpleDateFormat is not thread-safe see:
- // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6231579
- // http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=6178997
- // solution is to use stateless MessageFormat instead:
- final private static String RFC3339_FORMAT = "yyyy-MM-dd'T'HH:mm:ss";
- final private static String RFC3339_PATTERN = "{0,date," + RFC3339_FORMAT + "}";
- final protected static Logger LOG = LoggerFactory.getLogger(DateTimePicker.class);
- final private static transient Random RANDOM = new Random();
-
- protected String iconPath;
- protected String formatLength;
- protected String displayFormat;
- protected String toggleType;
- protected String toggleDuration;
- protected String type;
-
- protected String displayWeeks;
- protected String adjustWeeks;
- protected String startDate;
- protected String endDate;
- protected String weekStartsOn;
- protected String staticDisplay;
- protected String dayWidth;
- protected String language;
- protected String templateCssPath;
- protected String valueNotifyTopics;
-
- public DateTimePicker(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
- super(stack, request, response);
- }
-
- protected String getDefaultTemplate() {
- return TEMPLATE;
- }
-
- public void evaluateParams() {
- super.evaluateParams();
-
- if(displayFormat != null)
- addParameter("displayFormat", findString(displayFormat));
- if(displayWeeks != null)
- addParameter("displayWeeks", findString(displayWeeks));
- if(adjustWeeks != null)
- addParameter("adjustWeeks", findValue(adjustWeeks, Boolean.class));
-
- if(disabled != null)
- addParameter("disabled", findValue(disabled, Boolean.class));
-
- if(startDate != null)
- addParameter("startDate", format(findValue(startDate)));
- if(endDate != null)
- addParameter("endDate", format(findValue(endDate)));
- if(weekStartsOn != null)
- addParameter("weekStartsOn", findString(weekStartsOn));
- if(staticDisplay != null)
- addParameter("staticDisplay", findValue(staticDisplay, Boolean.class));
- if(dayWidth != null)
- addParameter("dayWidth", findValue(dayWidth, Integer.class));
- if(language != null)
- addParameter("language", findString(language));
- if(value != null)
- addParameter("value", format(findValue(value)));
-
- if(iconPath != null)
- addParameter("iconPath", findString(iconPath));
- if(formatLength != null)
- addParameter("formatLength", findString(formatLength));
- if(toggleType != null)
- addParameter("toggleType", findString(toggleType));
- if(toggleDuration != null)
- addParameter("toggleDuration", findValue(toggleDuration,
- Integer.class));
- if(type != null)
- addParameter("type", findString(type));
- else
- addParameter("type", "date");
- if(templateCssPath != null)
- addParameter("templateCssPath", findString(templateCssPath));
- if(valueNotifyTopics != null)
- addParameter("valueNotifyTopics", findString(valueNotifyTopics));
-
- // format the value to RFC 3399
- if(parameters.containsKey("value")) {
- addParameter("nameValue", parameters.get("value"));
- } else {
- if(parameters.containsKey("name")) {
- addParameter("nameValue", format(findValue((String)parameters.get("name"))));
- }
- }
-
- // generate a random ID if not explicitly set and not parsing the content
- Boolean parseContent = (Boolean)stack.getContext().get(Head.PARSE_CONTENT);
- boolean generateId = (parseContent != null ? !parseContent : true);
-
- addParameter("pushId", generateId);
- if ((this.id == null || this.id.length() == 0) && generateId) {
- // resolves Math.abs(Integer.MIN_VALUE) issue reported by FindBugs
- // http://findbugs.sourceforge.net/bugDescriptions.html#RV_ABSOLUTE_VALUE_OF_RANDOM_INT
- int nextInt = RANDOM.nextInt();
- nextInt = nextInt == Integer.MIN_VALUE ? Integer.MAX_VALUE : Math.abs(nextInt);
- this.id = "widget_" + String.valueOf(nextInt);
- addParameter("id", this.id);
- }
- }
-
- @Override
- @StrutsTagSkipInheritance
- public void setTheme(String theme) {
- super.setTheme(theme);
- }
-
- @Override
- public String getTheme() {
- return "ajax";
- }
-
- @StrutsTagAttribute(description="If true, weekly size of calendar changes to acomodate the month if false," +
- " 42 day format is used", type="Boolean", defaultValue="false")
- public void setAdjustWeeks(String adjustWeeks) {
- this.adjustWeeks = adjustWeeks;
- }
-
- @StrutsTagAttribute(description="How to render the names of the days in the header(narrow, abbr or wide)", defaultValue="narrow")
- public void setDayWidth(String dayWidth) {
- this.dayWidth = dayWidth;
- }
-
- @StrutsTagAttribute(description="Total weeks to display", type="Integer", defaultValue="6")
- public void setDisplayWeeks(String displayWeeks) {
- this.displayWeeks = displayWeeks;
- }
-
- @StrutsTagAttribute(description="Last available date in the calendar set", type="Date", defaultValue="2941-10-12")
- public void setEndDate(String endDate) {
- this.endDate = endDate;
- }
-
- @StrutsTagAttribute(description="First available date in the calendar set", type="Date", defaultValue="1492-10-12")
- public void setStartDate(String startDate) {
- this.startDate = startDate;
- }
-
- @StrutsTagAttribute(description="Disable all incremental controls, must pick a date in the current display", type="Boolean", defaultValue="false")
- public void setStaticDisplay(String staticDisplay) {
- this.staticDisplay = staticDisplay;
- }
-
- @StrutsTagAttribute(description="Adjusts the first day of the week 0==Sunday..6==Saturday", type="Integer", defaultValue="0")
- public void setWeekStartsOn(String weekStartsOn) {
- this.weekStartsOn = weekStartsOn;
- }
-
- @StrutsTagAttribute(description="Language to display this widget in", defaultValue="brower's specified preferred language")
- public void setLanguage(String language) {
- this.language = language;
- }
-
- @StrutsTagAttribute(description="A pattern used for the visual display of the formatted date, e.g. dd/MM/yyyy")
- public void setDisplayFormat(String displayFormat) {
- this.displayFormat = displayFormat;
- }
-
- @StrutsTagAttribute(description="Type of formatting used for visual display. Possible values are " +
- "long, short, medium or full", defaultValue="short")
- public void setFormatLength(String formatLength) {
- this.formatLength = formatLength;
- }
-
- @StrutsTagAttribute(description="Path to icon used for the dropdown")
- public void setIconPath(String iconPath) {
- this.iconPath = iconPath;
- }
-
- @StrutsTagAttribute(description="Duration of toggle in milliseconds", type="Integer", defaultValue="100")
- public void setToggleDuration(String toggleDuration) {
- this.toggleDuration = toggleDuration;
- }
-
- @StrutsTagAttribute(description="Defines the type of the picker on the dropdown. Possible values are 'date'" +
- " for a DateTimePicker, and 'time' for a timePicker", defaultValue="date")
- public void setType(String type) {
- this.type = type;
- }
-
- @StrutsTagAttribute(description="oggle type of the dropdown. Possible values are plain,wipe,explode,fade", defaultValue="plain")
- public void setToggleType(String toggleType) {
- this.toggleType = toggleType;
- }
-
- @StrutsTagAttribute(description="Template css path")
- public void setTemplateCssPath(String templateCssPath) {
- this.templateCssPath = templateCssPath;
- }
-
- @StrutsTagAttribute(description="Preset the value of input element")
- public void setValue(String arg0) {
- super.setValue(arg0);
- }
-
- @StrutsTagAttribute(description="Comma delimmited list of topics that will published when a value is selected")
- public void setValueNotifyTopics(String valueNotifyTopics) {
- this.valueNotifyTopics = valueNotifyTopics;
- }
-
- private String format(Object obj) {
- if(obj == null)
- return null;
-
- if(obj instanceof Date) {
- return MessageFormat.format(RFC3339_PATTERN, (Date) obj);
- } else if(obj instanceof Calendar) {
- return MessageFormat.format(RFC3339_PATTERN, ((Calendar) obj).getTime());
- }
- else {
- // try to parse a date
- String dateStr = obj.toString();
- if(dateStr.equalsIgnoreCase("today"))
- return MessageFormat.format(RFC3339_PATTERN, new Date());
-
-
- Date date = null;
- //formats used to parse the date
- List formats = new ArrayList();
- formats.add(new SimpleDateFormat(RFC3339_FORMAT));
- formats.add(SimpleDateFormat.getTimeInstance(DateFormat.SHORT));
- formats.add(SimpleDateFormat.getDateInstance(DateFormat.SHORT));
- formats.add(SimpleDateFormat.getDateInstance(DateFormat.MEDIUM));
- formats.add(SimpleDateFormat.getDateInstance(DateFormat.FULL));
- formats.add(SimpleDateFormat.getDateInstance(DateFormat.LONG));
- if (this.displayFormat != null) {
- try {
- SimpleDateFormat displayFormat = new SimpleDateFormat(
- (String) getParameters().get("displayFormat"));
- formats.add(displayFormat);
- } catch (Exception e) {
- // don't use it then (this attribute is used by Dojo, not java code)
- LOG.error("Cannot use attribute", e);
- }
- }
-
- for (DateFormat format : formats) {
- try {
- date = format.parse(dateStr);
- if (date != null)
- return MessageFormat.format(RFC3339_PATTERN, date);
- } catch (Exception e) {
- //keep going
- }
- }
-
- // last resource, assume already in correct/default format
- if (LOG.isDebugEnabled())
- LOG.debug("Unable to parse date " + dateStr);
- return dateStr;
- }
- }
-
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Div.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Div.java
deleted file mode 100644
index ae45789b8..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Div.java
+++ /dev/null
@@ -1,176 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.components;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.views.annotations.StrutsTag;
-import org.apache.struts2.views.annotations.StrutsTagAttribute;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- *
- *
- * This tag generates an HTML div that loads its content using an XMLHttpRequest call, via
- * the dojo framework. When the "updateFreq" is set the built in timer will start automatically and
- * reload the div content with the value of "updateFreq" as the refresh period(in milliseconds).
- * Topics can be used to stop(stopTimerListenTopics) and start(startTimerListenTopics) this timer.
- *
- *
- * When used inside a "tabbedpanel" tag, each div becomes a tab. Some attributes are specific
- * to this use case, like:
- *
- *
refreshOnShow: div content is realoded when tab is selected
- *
closable: Tab will have close button
- *
preload: load div content after page is loaded
- *
- *
- *
- *
- *
Examples
- *
- * <sx:div href="%{#url}">Initial Content</sx:div>
- *
- *
- *
- * <img id="indicator" src="${pageContext.request.contextPath}/images/indicator.gif" style="display:none"/>
- * <sx:div href="%{#url}" updateFreq="2000" indicator="indicator">
- * Initial Content
- * </sx:div>
- *
- *
- *
- * <form id="form">
- * <label for="textInput">Text to be submited when div reloads</label>
- * <input type=textbox id="textInput" name="data">
- * </form>
- * <sx:div
- * href="%{#url}"
- * updateFreq="3000"
- * listenTopics="/refresh"
- * startTimerListenTopics="/startTimer"
- * stopTimerListenTopics="/stopTimer"
- * highlightColor="red"
- * formId="form">
- * Initial Content
- * </sx:div>
- *
- */
-@StrutsTag(name="div", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.DivTag", description="Render HTML div providing content from remote call via AJAX")
-public class Div extends AbstractRemoteBean {
-
- public static final String TEMPLATE = "div";
- public static final String TEMPLATE_CLOSE = "div-close";
- public static final String COMPONENT_NAME = Div.class.getName();
-
- protected String updateFreq;
- protected String autoStart;
- protected String delay;
- protected String startTimerListenTopics;
- protected String stopTimerListenTopics;
- protected String refreshOnShow;
- protected String closable;
- protected String preload;
-
- public Div(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
- super(stack, request, response);
- }
-
- public String getDefaultOpenTemplate() {
- return TEMPLATE;
- }
-
- protected String getDefaultTemplate() {
- return TEMPLATE_CLOSE;
- }
-
- public void evaluateExtraParams() {
- super.evaluateExtraParams();
-
- if (updateFreq != null)
- addParameter("updateFreq", findValue(updateFreq, Integer.class));
- if (autoStart != null)
- addParameter("autoStart", findValue(autoStart, Boolean.class));
- if (refreshOnShow != null)
- addParameter("refreshOnShow", findValue(refreshOnShow, Boolean.class));
- if (delay != null)
- addParameter("delay", findValue(delay, Integer.class));
- if (startTimerListenTopics != null)
- addParameter("startTimerListenTopics", findString(startTimerListenTopics));
- if (stopTimerListenTopics != null)
- addParameter("stopTimerListenTopics", findString(stopTimerListenTopics));
- if (separateScripts != null)
- addParameter("separateScripts", findValue(separateScripts, Boolean.class));
- if (closable != null)
- addParameter("closable", findValue(closable, Boolean.class));
- if (preload != null)
- addParameter("preload", findValue(preload, Boolean.class));
- }
-
- @StrutsTagAttribute(description="Start timer automatically", type="Boolean", defaultValue="true")
- public void setAutoStart(String autoStart) {
- this.autoStart = autoStart;
- }
-
- @StrutsTagAttribute(description="How long to wait before fetching the content (in milliseconds)", type="Integer")
- public void setDelay(String delay) {
- this.delay = delay;
- }
-
- @StrutsTagAttribute(description="How often to reload the content (in milliseconds)", type="Integer")
- public void setUpdateFreq(String updateInterval) {
- this.updateFreq = updateInterval;
- }
-
- @StrutsTagAttribute(description="Topics that will start the timer (for autoupdate)")
- public void setStartTimerListenTopics(String startTimerListenTopic) {
- this.startTimerListenTopics = startTimerListenTopic;
- }
-
- @StrutsTagAttribute(description="Topics that will stop the timer (for autoupdate)")
- public void setStopTimerListenTopics(String stopTimerListenTopic) {
- this.stopTimerListenTopics = stopTimerListenTopic;
- }
-
- @StrutsTagAttribute(description="Content will be loaded when div becomes visible, used only inside the tabbedpanel tag", type="Boolean", defaultValue="false")
- public void setRefreshOnShow(String refreshOnShow) {
- this.refreshOnShow = refreshOnShow;
- }
-
- @StrutsTagAttribute(description="Show a close button when the div is inside a 'tabbedpanel'", defaultValue="false")
- public void setClosable(String closable) {
- this.closable = closable;
- }
-
- @StrutsTagAttribute(description="Load content when page is loaded", type="Boolean", defaultValue="true")
- public void setPreload(String preload) {
- this.preload = preload;
- }
-
- @StrutsTagAttribute(description = "Color used to perform a highlight effect on this element",
- defaultValue = "none")
- public void setHighlightColor(String highlightColor) {
- this.highlightColor = highlightColor;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Head.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Head.java
deleted file mode 100644
index 814a510ac..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Head.java
+++ /dev/null
@@ -1,218 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.components;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.views.annotations.StrutsTag;
-import org.apache.struts2.views.annotations.StrutsTagAttribute;
-import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- *
- * The "head" tag renders required JavaScript code to configure Dojo and is required in order to use
- * any of the tags included in the Dojo plugin.
- *
- *
- *
- *
- *
- *
To debug javascript errors set the "debug" attribute to true, which will display Dojo
- * (and Struts) warning and error messages at the bottom of the page. Core Dojo files are by default
- * compressed, to improve loading time, which makes them very hard to read. To debug Dojo and Struts
- * widgets, set the "compressed" attribute to true. Make sure to turn this option off before
- * moving your project into production, as uncompressed files will take longer to download.
- *
- *
For troubleshooting javascript problems the following configuration is recommended:
Dojo files are loaded as required by the Dojo loading mechanism. The problem with this
- * approach is that the files are not cached by the browser, so reloading a page or navigating
- * to a different page that uses the same widgets will cause the files to be reloaded. To solve
- * this problem a custom Dojo profile is distributed with the Dojo plugin. This profile contains
- * the files required by the tags in the Dojo plugin, all in one file (524Kb), which is cached
- * by the browser. This file will take longer to load by the browser but it will be downloaded
- * only once. By default the "cache" attribute is set to false.
- *
- *
Some tags like the "datetimepicker" can use different locales, to use a locale
- * that is different from the request locale, it must be specified on the "extraLocales"
- * attribute. This attribute can contain a comma separated list of locale names. From
- * Dojo's documentation:
- *
- *
- * The locale is a short string, defined by the host environment, which conforms to RFC 3066
- * (http://www.ietf.org/rfc/rfc3066.txt) used in the HTML specification.
- * It consists of short identifiers, typically two characters
- * long which are case-insensitive. Note that Dojo uses dash separators, not underscores like
- * Java (e.g. "en-us", not "en_US"). Typically country codes are used in the optional second
- * identifier, and additional variants may be specified. For example, Japanese is "ja";
- * Japanese in Japan is "ja-jp". Notice that the lower case is intentional -- while Dojo
- * will often convert all locales to lowercase to normalize them, it is the lowercase that
- * must be used when defining your resources.
- *
- *
- *
The "locale" attribute configures Dojo's locale:
- *
- *
"The locale Dojo uses on a page may be overridden by setting djConfig.locale. This may be
- * done to accomodate applications with a known user profile or server pages which do manual
- * assembly and assume a certain locale. You may also set djConfig.extraLocale to load
- * localizations in addition to your own, in case you want to specify a particular
- * translation or have multiple languages appear on your page."
- *
- *
To improve loading time, the property "parseContent" is set to false by default. This property will
- * instruct Dojo to only build widgets using specific element ids. If the property is set to true
- * Dojo will scan the whole document looking for widgets.
- *
- *
Dojo 0.4.3 is distributed with the Dojo plugin, to use a different Dojo version, the
- * "baseRelativePath" attribute can be set to the URL of the Dojo root folder on your application.
- *
- *
- */
-@StrutsTag(name="head", tldBodyContent="empty", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.HeadTag",
- description="Render a chunk of HEAD for your HTML file")
-@StrutsTagSkipInheritance
-public class Head extends org.apache.struts2.components.Head {
- public static final String TEMPLATE = "head";
- public static final String PARSE_CONTENT = "struts.dojo.head.parseContent";
-
- private String debug;
- private String compressed;
- private String baseRelativePath;
- private String extraLocales;
- private String locale;
- private String cache;
- private String parseContent;
-
- public Head(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
- super(stack, request, response);
- }
-
- protected String getDefaultTemplate() {
- return TEMPLATE;
- }
-
- public void evaluateParams() {
- super.evaluateParams();
-
- if (this.debug != null)
- addParameter("debug", findValue(this.debug, Boolean.class));
- if (this.compressed != null)
- addParameter("compressed", findValue(this.compressed, Boolean.class));
- if (this.baseRelativePath != null)
- addParameter("baseRelativePath", findString(this.baseRelativePath));
- if (this.extraLocales != null) {
- String locales = findString(this.extraLocales);
- addParameter("extraLocales", locales.split(","));
- }
- if (this.locale != null)
- addParameter("locale", findString(this.locale));
- if (this.cache != null)
- addParameter("cache", findValue(this.cache, Boolean.class));
- if (this.parseContent != null) {
- Boolean shouldParseContent = (Boolean) findValue(this.parseContent, Boolean.class);
- addParameter("parseContent", shouldParseContent);
- stack.getContext().put(PARSE_CONTENT, shouldParseContent);
- } else {
- addParameter("parseContent", false);
- stack.getContext().put(PARSE_CONTENT, false);
- }
- }
-
- @Override
- @StrutsTagSkipInheritance
- public void setTheme(String theme) {
- super.setTheme(theme);
- }
-
- @Override
- public String getTheme() {
- return "ajax";
- }
-
- public boolean isDebug() {
- return debug != null && Boolean.parseBoolean(debug);
- }
-
- @StrutsTagAttribute(description="Enable Dojo debug messages", defaultValue="false", type="Boolean")
- public void setDebug(String debug) {
- this.debug = debug;
- }
-
- @StrutsTagAttribute(description="Use compressed version of dojo.js", defaultValue="true", type="Boolean")
- public void setCompressed(String compressed) {
- this.compressed = compressed;
- }
-
- @StrutsTagAttribute(description="Context relative path of Dojo distribution folder", defaultValue="/struts/dojo")
- public void setBaseRelativePath(String baseRelativePath) {
- this.baseRelativePath = baseRelativePath;
- }
-
- @StrutsTagAttribute(description="Comma separated list of locale names to be loaded by Dojo, locale names must be specified as in RFC3066")
- public void setExtraLocales(String extraLocales) {
- this.extraLocales = extraLocales;
- }
-
- @StrutsTagAttribute(description="Default locale to be used by Dojo, locale name must be specified as in RFC3066")
- public void setLocale(String locale) {
- this.locale = locale;
- }
-
- @StrutsTagAttribute(description="Use Struts Dojo profile, which contains all Struts widgets in one file, making it possible to be chached by " +
- "the browser", defaultValue="true", type="Boolean")
- public void setCache(String cache) {
- this.cache = cache;
- }
-
- @StrutsTagAttribute(description="Parse the whole document for widgets", defaultValue="false", type="Boolean")
- public void setParseContent(String parseContent) {
- this.parseContent = parseContent;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/RemoteBean.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/RemoteBean.java
deleted file mode 100644
index a65afb2b5..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/RemoteBean.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.components;
-
-
-public interface RemoteBean {
-
- void setListenTopics(String topics);
-
- void setNotifyTopics(String topics);
-
- void setHref(String href);
-
- void setErrorText(String errorText);
-
- void setAfterNotifyTopics(String afterNotifyTopics);
-
- void setBeforeNotifyTopics(String beforeNotifyTopics);
-
- void setErrorNotifyTopics(String errorNotifyTopics);
-
- void setExecuteScripts(String executeScripts);
-
- void setLoadingText(String loadingText);
-
- void setHandler(String handler);
-
- void setFormFilter(String formFilter);
-
- void setFormId(String formId);
-
- void setShowErrorTransportText(String showError);
-
- void setShowLoadingText(String showLoadingText);
-
- void setIndicator(String indicator);
-
- void setName(String name);
-
- void setCssStyle(String style);
-
- void setCssClass(String cssClass);
-
- void setHighlightColor(String color);
-
- void setHighlightDuration(String color);
-
- void setSeparateScripts(String separateScripts);
-
- void setTransport(String transport);
-
- void setParseContent(String parseContent);
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Submit.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Submit.java
deleted file mode 100644
index 815b0705e..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Submit.java
+++ /dev/null
@@ -1,465 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.components;
-
-import java.io.Writer;
-import java.util.Random;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Form;
-import org.apache.struts2.components.FormButton;
-import org.apache.struts2.views.annotations.StrutsTag;
-import org.apache.struts2.views.annotations.StrutsTagAttribute;
-import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
-
-import com.opensymphony.xwork2.util.ValueStack;
-import com.opensymphony.xwork2.util.logging.Logger;
-import com.opensymphony.xwork2.util.logging.LoggerFactory;
-
-/**
- *
- * Renders a submit button that can submit a form asynchronously.
- * The submit can have three different types of rendering:
- *
- *
input: renders as html <input type="submit"...>
- *
image: renders as html <input type="image"...>
- *
button: renders as html <button type="submit"...>
- *
- * Please note that the button type has advantages by adding the possibility to seperate the submitted value from the
- * text shown on the button face, but has issues with Microsoft Internet Explorer at least up to 6.0
- *
- *
- *
Examples
- *
- * <sx:submit value="%{'Submit'}" />
- *
- *
- *
- * <sx:submit type="image" value="%{'Submit'}" label="Submit the form" src="submit.gif"/>
- *
-
- *
- * <sx:submit type="button" value="%{'Submit'}" label="Submit the form"/>
- *
- *
- *
- * <div id="div1">Div 1</div>
- * <s:url id="ajaxTest" value="/AjaxTest.action"/>
- *
- * <sx:submit id="link1" href="%{ajaxTest}" target="div1" />
- *
- *
- *
- * <s:form id="form" action="AjaxTest">
- * <input type="textbox" name="data">
- * <sx:submit />
- * </s:form>
- *
- *
- *
- * <s:form id="form" action="AjaxTest">
- * <input type="textbox" name="data">
- * </s:form>
- *
- * <sx:submit formId="form" />
- *
- *
- *
- * <script type="text/javascript">
- * dojo.event.topic.subscribe("/before", function(event, widget){
- * alert('inside a topic event. before request');
- * //event: set event.cancel = true, to cancel request
- * //widget: widget that published the topic
- * });
- * </script>
- *
- * <sx:submit beforeNotifyTopics="/before" />
- *
- *
- *
- * <script type="text/javascript">
- * dojo.event.topic.subscribe("/after", function(data, request, widget){
- * alert('inside a topic event. after request');
- * //data : text returned from request(the html)
- * //request: XMLHttpRequest object
- * //widget: widget that published the topic
- * });
- * </script>
- *
- * <sx:submit afterNotifyTopics="/after" highlightColor="red" href="%{#ajaxTest}" />
- *
- *
- *
- * <script type="text/javascript">
- * dojo.event.topic.subscribe("/error", function(error, request, widget){
- * alert('inside a topic event. on error');
- * //error : error object (error.message has the error message)
- * //request: XMLHttpRequest object
- * //widget: widget that published the topic
- * });
- * </script>
- *
- * <img id="ind1" src="${pageContext.request.contextPath}/images/indicator.gif" style="display:none"/>
- * <sx:submit errorNotifyTopics="/error" indicator="ind1" href="%{#ajaxTest}" />
- *
- */
-@StrutsTag(name="submit", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.SubmitTag", description="Render a submit button")
-public class Submit extends FormButton implements RemoteBean {
-
- private static final Logger LOG = LoggerFactory.getLogger(Submit.class);
- private final static transient Random RANDOM = new Random();
-
- final public static String OPEN_TEMPLATE = "submit";
- final public static String TEMPLATE = "submit-close";
-
- protected String href;
- protected String errorText;
- protected String executeScripts;
- protected String loadingText;
- protected String listenTopics;
- protected String handler;
- protected String formId;
- protected String formFilter;
- protected String src;
- protected String notifyTopics;
- protected String showErrorTransportText;
- protected String indicator;
- protected String showLoadingText;
- protected String targets;
- protected String beforeNotifyTopics;
- protected String afterNotifyTopics;
- protected String errorNotifyTopics;
- protected String highlightColor;
- protected String highlightDuration;
- protected String validate;
- protected String ajaxAfterValidation;
- protected String separateScripts;
- protected String transport;
- protected String parseContent;
-
- public Submit(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
- super(stack, request, response);
- }
-
- protected String getDefaultTemplate() {
- return TEMPLATE;
- }
-
- @Override
- public String getDefaultOpenTemplate() {
- return OPEN_TEMPLATE;
- }
-
- public void evaluateParams() {
- if ((key == null) && (value == null)) {
- value = "Submit";
- }
-
- if (((key != null)) && (value == null)) {
- this.value = "%{getText('"+key +"')}";
- }
-
- super.evaluateParams();
- }
-
- public void evaluateExtraParams() {
- super.evaluateExtraParams();
-
- if (href != null)
- addParameter("href", findString(href));
- if (errorText != null)
- addParameter("errorText", findString(errorText));
- if (loadingText != null)
- addParameter("loadingText", findString(loadingText));
- if (executeScripts != null)
- addParameter("executeScripts", findValue(executeScripts, Boolean.class));
- if (listenTopics != null)
- addParameter("listenTopics", findString(listenTopics));
- if (notifyTopics != null)
- addParameter("notifyTopics", findString(notifyTopics));
- if (handler != null)
- addParameter("handler", findString(handler));
- if (formId != null)
- addParameter("formId", findString(formId));
- if (formFilter != null)
- addParameter("formFilter", findString(formFilter));
- if (src != null)
- addParameter("src", findString(src));
- if (indicator != null)
- addParameter("indicator", findString(indicator));
- if (targets != null)
- addParameter("targets", findString(targets));
- if (showLoadingText != null)
- addParameter("showLoadingText", findString(showLoadingText));
- if (showLoadingText != null)
- addParameter("showLoadingText", findString(showLoadingText));
- if (beforeNotifyTopics != null)
- addParameter("beforeNotifyTopics", findString(beforeNotifyTopics));
- if (afterNotifyTopics != null)
- addParameter("afterNotifyTopics", findString(afterNotifyTopics));
- if (errorNotifyTopics != null)
- addParameter("errorNotifyTopics", findString(errorNotifyTopics));
- if (highlightColor != null)
- addParameter("highlightColor", findString(highlightColor));
- if (highlightDuration != null)
- addParameter("highlightDuration", findString(highlightDuration));
- if (separateScripts != null)
- addParameter("separateScripts", findValue(separateScripts, Boolean.class));
- if (transport != null)
- addParameter("transport", findString(transport));
- if (parseContent != null)
- addParameter("parseContent", findValue(parseContent, Boolean.class));
-
- Boolean validateValue = false;
- if (validate != null) {
- validateValue = (Boolean) findValue(validate, Boolean.class);
- addParameter("validate", validateValue);
- }
-
- Form form = (Form) findAncestor(Form.class);
- if (form != null)
- addParameter("parentTheme", form.getTheme());
-
- if (ajaxAfterValidation != null)
- addParameter("ajaxAfterValidation", findValue(ajaxAfterValidation, Boolean.class));
-
- // generate a random ID if not explicitly set and not parsing the content
- Boolean parseContent = (Boolean)stack.getContext().get(Head.PARSE_CONTENT);
- boolean generateId = (parseContent != null ? !parseContent : true);
-
- addParameter("pushId", generateId);
- if ((this.id == null || this.id.length() == 0) && generateId) {
- // resolves Math.abs(Integer.MIN_VALUE) issue reported by FindBugs
- // http://findbugs.sourceforge.net/bugDescriptions.html#RV_ABSOLUTE_VALUE_OF_RANDOM_INT
- int nextInt = RANDOM.nextInt();
- nextInt = nextInt == Integer.MIN_VALUE ? Integer.MAX_VALUE : Math.abs(nextInt);
- this.id = "widget_" + String.valueOf(nextInt);
- addParameter("id", this.id);
- }
- }
-
- @Override
- @StrutsTagSkipInheritance
- public void setTheme(String theme) {
- super.setTheme(theme);
- }
-
- @Override
- public String getTheme() {
- return "ajax";
- }
-
- /**
- * Indicate whether the concrete button supports the type "image".
- *
- * @return true to indicate type image is supported.
- */
- protected boolean supportsImageType() {
- return true;
- }
-
- /**
- * Overrides to be able to render body in a template rather than always before the template
- */
- public boolean end(Writer writer, String body) {
- evaluateParams();
- try {
- addParameter("body", body);
-
- mergeTemplate(writer, buildTemplateName(template, getDefaultTemplate()));
- } catch (Exception e) {
- LOG.error("error when rendering", e);
- }
- finally {
- popComponentStack();
- }
-
- return false;
- }
-
- @StrutsTagAttribute(description="Topic that will trigger the remote call")
- public void setListenTopics(String listenTopics) {
- this.listenTopics = listenTopics;
- }
-
- @StrutsTagAttribute(description="The URL to call to obtain the content. Note: If used with ajax context, the value must be set as an url tag value.")
- public void setHref(String href) {
- this.href = href;
- }
-
- @StrutsTagAttribute(description="The text to display to the user if the is an error fetching the content")
- public void setErrorText(String errorText) {
- this.errorText = errorText;
- }
-
- @StrutsTagAttribute(description="Javascript code in the fetched content will be executed", type="Boolean", defaultValue="false")
- public void setExecuteScripts(String executeScripts) {
- this.executeScripts = executeScripts;
- }
-
- @StrutsTagAttribute(description="Text to be shown while content is being fetched", defaultValue="Loading...")
- public void setLoadingText(String loadingText) {
- this.loadingText = loadingText;
- }
-
- @StrutsTagAttribute(description="Javascript function name that will make the request")
- public void setHandler(String handler) {
- this.handler = handler;
- }
-
- @StrutsTagAttribute(description="Function name used to filter the fields of the form.")
- public void setFormFilter(String formFilter) {
- this.formFilter = formFilter;
- }
-
- @StrutsTagAttribute(description="Form id whose fields will be serialized and passed as parameters")
- public void setFormId(String formId) {
- this.formId = formId;
- }
-
- @StrutsTagAttribute(description="Supply an image src for image type submit button. Will have no effect for types input and button.")
- public void setSrc(String src) {
- this.src = src;
- }
-
- @StrutsTagAttribute(description="Comma delimited list of ids of the elements whose content will be updated")
- public void setTargets(String targets) {
- this.targets = targets;
- }
-
- @StrutsTagAttribute(description="Comma delimmited list of topics that will published before and after the request, and on errors")
- public void setNotifyTopics(String notifyTopics) {
- this.notifyTopics = notifyTopics;
- }
-
- @StrutsTagAttribute(description="Set whether errors will be shown or not", type="Boolean", defaultValue="true")
- public void setShowErrorTransportText(String showErrorTransportText) {
- this.showErrorTransportText = showErrorTransportText;
- }
-
- @StrutsTagAttribute(description="Set indicator")
- public void setIndicator(String indicator) {
- this.indicator = indicator;
- }
-
- @StrutsTagAttribute(description="Show loading text on targets", type="Boolean", defaultValue="false")
- public void setShowLoadingText(String showLoadingText) {
- this.showLoadingText = showLoadingText;
- }
-
- @StrutsTagAttribute(description="The css class to use for element")
- public void setCssClass(String cssClass) {
- super.setCssClass(cssClass);
- }
-
- @StrutsTagAttribute(description="The css style to use for element")
- public void setCssStyle(String cssStyle) {
- super.setCssStyle(cssStyle);
- }
-
- @StrutsTagAttribute(description="The id to use for the element")
- public void setId(String id) {
- super.setId(id);
- }
-
- @StrutsTagAttribute(description="The name to set for element")
- public void setName(String name) {
- super.setName(name);
- }
-
- @StrutsTagAttribute(description="The type of submit to use. Valid values are input, " +
- "button and image.", defaultValue="input")
- public void setType(String type) {
- super.setType(type);
- }
-
- @StrutsTagAttribute(description="Preset the value of input element.")
- public void setValue(String value) {
- super.setValue(value);
- }
-
- @StrutsTagAttribute(description="Label expression used for rendering a element specific label")
- public void setLabel(String label) {
- super.setLabel(label);
- }
-
- @StrutsTagAttribute(description="Comma delimmited list of topics that will published after the request(if the request succeeds)")
- public void setAfterNotifyTopics(String afterNotifyTopics) {
- this.afterNotifyTopics = afterNotifyTopics;
- }
-
- @StrutsTagAttribute(description="Comma delimmited list of topics that will published before the request")
- public void setBeforeNotifyTopics(String beforeNotifyTopics) {
- this.beforeNotifyTopics = beforeNotifyTopics;
- }
-
- @StrutsTagAttribute(description="Comma delimmited list of topics that will published after the request(if the request fails)")
- public void setErrorNotifyTopics(String errorNotifyTopics) {
- this.errorNotifyTopics = errorNotifyTopics;
- }
-
- @StrutsTagAttribute(description = "Color used to perform a highlight effect on the elements specified in the 'targets' attribute",
- defaultValue = "none")
- public void setHighlightColor(String highlightColor) {
- this.highlightColor = highlightColor;
- }
-
- @StrutsTagAttribute(description = "Duration of highlight effect in milliseconds. Only valid if 'highlightColor' attribute is set",
- defaultValue = "1000")
- public void setHighlightDuration(String highlightDuration) {
- this.highlightDuration = highlightDuration;
- }
-
- @StrutsTagAttribute(description = "Perform Ajax validation. 'ajaxValidation' interceptor must be applied to action", type="Boolean",
- defaultValue = "false")
- public void setValidate(String validate) {
- this.validate = validate;
- }
-
- @StrutsTagAttribute(description = "Make an asynchronous request if validation succeeds. Only valid if 'validate' is 'true'", type="Boolean",
- defaultValue = "false")
- public void setAjaxAfterValidation(String ajaxAfterValidation) {
- this.ajaxAfterValidation = ajaxAfterValidation;
- }
-
- @StrutsTagSkipInheritance
- public void setAction(String action) {
- super.setAction(action);
- }
-
- @StrutsTagAttribute(description="Run scripts in a separate scope, unique for each tag", defaultValue="true")
- public void setSeparateScripts(String separateScripts) {
- this.separateScripts = separateScripts;
- }
-
- @StrutsTagAttribute(description="Transport used by Dojo to make the request", defaultValue="XMLHTTPTransport")
- public void setTransport(String transport) {
- this.transport = transport;
- }
-
- @StrutsTagAttribute(description="Parse returned HTML for Dojo widgets", defaultValue="true", type="Boolean")
- public void setParseContent(String parseContent) {
- this.parseContent = parseContent;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/TabbedPanel.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/TabbedPanel.java
deleted file mode 100644
index c16cb6a43..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/TabbedPanel.java
+++ /dev/null
@@ -1,223 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.components;
-
-import com.opensymphony.xwork2.util.ValueStack;
-import org.apache.struts2.components.ClosingUIBean;
-import org.apache.struts2.views.annotations.StrutsTag;
-import org.apache.struts2.views.annotations.StrutsTagAttribute;
-import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-import java.util.Random;
-
-/**
- *
- * The tabbedpanel widget is primarily an AJAX component, where each tab can either be local content or remote
- * content (refreshed each time the user selects that tab).
- * If the useSelectedTabCookie attribute is set to true, the id of the selected tab is saved in a cookie on activation.
- * When coming back to this view, the cookie is read and the tab will be activated again, unless an actual value for the
- * selectedTab attribute is specified.
- * If you want to use the cookie feature, please be sure that you provide a unique id for your tabbedpanel component,
- * since this will also be the identifying name component of the stored cookie.
- *
- *
- * Examples
- *
- *
- *
- * <sx:head />
- * <sx:tabbedpanel id="test" >
- * <sx:div id="one" label="one" theme="ajax" labelposition="top" >
- * This is the first pane<br/>
- * <s:form>
- * <s:textfield name="tt" label="Test Text"/> <br/>
- * <s:textfield name="tt2" label="Test Text2"/>
- * </s:form>
- * </sx:div>
- * <sx:div id="three" label="remote" theme="ajax" href="/AjaxTest.action" >
- * This is the remote tab
- * </sx:div>
- * </sx:tabbedpanel>
- *
- *
- *
- * <sx:head />
- * <script type="text/javascript">
- * dojo.event.topic.subscribe("/beforeSelect", function(event, tab, tabContainer){
- * event.cancel = true;
- * });
- * </script>
- *
- * <sx:tabbedpanel id="test" beforeSelectTabNotifyTopics="/beforeSelect">
- * <sx:div id="three" label="remote" theme="ajax" href="/AjaxTest.action" >
- * One Tab
- * </sx:div>
- * <sx:div id="three" label="remote" theme="ajax" href="/AjaxTest.action" >
- * Another tab
- * </sx:div>
- * </sx:tabbedpanel>
- *
- */
-@StrutsTag(name="tabbedpanel", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.TabbedPanelTag", description="Render a tabbedPanel widget.")
-public class TabbedPanel extends ClosingUIBean {
- public static final String TEMPLATE = "tabbedpanel";
- public static final String TEMPLATE_CLOSE = "tabbedpanel-close";
- final private static String COMPONENT_NAME = TabbedPanel.class.getName();
- private final static transient Random RANDOM = new Random();
-
- protected String selectedTab;
- protected String closeButton;
- protected String doLayout ;
- protected String templateCssPath;
- protected String beforeSelectTabNotifyTopics;
- protected String afterSelectTabNotifyTopics;
- protected String disabledTabCssClass;
- protected String useSelectedTabCookie;
-
- public TabbedPanel(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
- super(stack, request, response);
- }
-
-
- protected void evaluateExtraParams() {
- super.evaluateExtraParams();
-
- if (selectedTab != null)
- addParameter("selectedTab", findString(selectedTab));
- if (closeButton != null)
- addParameter("closeButton", findString(closeButton));
- addParameter("doLayout", doLayout != null ? findValue(doLayout, Boolean.class) : Boolean.FALSE);
- if (labelPosition != null) {
- //dojo has some weird name for label positions
- if(labelPosition.equalsIgnoreCase("left"))
- labelPosition = "left-h";
- if(labelPosition.equalsIgnoreCase("right"))
- labelPosition = "right-h";
- addParameter("labelPosition", null);
- addParameter("labelPosition", labelPosition);
- }
- if (templateCssPath != null)
- addParameter("templateCssPath", findString(templateCssPath));
- if (beforeSelectTabNotifyTopics!= null)
- addParameter("beforeSelectTabNotifyTopics", findString(beforeSelectTabNotifyTopics));
- if (afterSelectTabNotifyTopics!= null)
- addParameter("afterSelectTabNotifyTopics", findString(afterSelectTabNotifyTopics));
- if (disabledTabCssClass!= null)
- addParameter("disabledTabCssClass", findString(disabledTabCssClass));
- if(useSelectedTabCookie != null) {
- addParameter("useSelectedTabCookie", findString(useSelectedTabCookie));
- }
-
- // generate a random ID if not explicitly set and not parsing the content
- Boolean parseContent = (Boolean)stack.getContext().get(Head.PARSE_CONTENT);
- boolean generateId = (parseContent != null ? !parseContent : true);
-
- addParameter("pushId", generateId);
- if ((this.id == null || this.id.length() == 0) && generateId) {
- // resolves Math.abs(Integer.MIN_VALUE) issue reported by FindBugs
- // http://findbugs.sourceforge.net/bugDescriptions.html#RV_ABSOLUTE_VALUE_OF_RANDOM_INT
- int nextInt = RANDOM.nextInt();
- nextInt = nextInt == Integer.MIN_VALUE ? Integer.MAX_VALUE : Math.abs(nextInt);
- this.id = "widget_" + String.valueOf(nextInt);
- addParameter("id", this.id);
- }
- }
-
- @Override
- @StrutsTagSkipInheritance
- public void setTheme(String theme) {
- super.setTheme(theme);
- }
-
- @Override
- public String getTheme() {
- return "ajax";
- }
-
- public String getDefaultOpenTemplate() {
- return TEMPLATE;
- }
-
- protected String getDefaultTemplate() {
- return TEMPLATE_CLOSE;
- }
-
- public String getComponentName() {
- return COMPONENT_NAME;
- }
-
- @StrutsTagAttribute(description="The id to assign to the component.", required=true)
- public void setId(String id) {
- // This is required to override tld generation attributes to required=true
- super.setId(id);
- }
-
-
- @StrutsTagAttribute(description=" The id of the tab that will be selected by default")
- public void setSelectedTab(String selectedTab) {
- this.selectedTab = selectedTab;
- }
-
- @StrutsTagAttribute(description="Deprecated. Use 'closable' on each div(tab)")
- public void setCloseButton(String closeButton) {
- this.closeButton = closeButton;
- }
-
- @StrutsTagAttribute(description="If doLayout is false, the tab container's height equals the height of the currently selected tab", type="Boolean", defaultValue="false")
- public void setDoLayout(String doLayout) {
- this.doLayout = doLayout;
- }
-
- @StrutsTagAttribute(description="Template css path")
- public void setTemplateCssPath(String templateCssPath) {
- this.templateCssPath = templateCssPath;
- }
-
-
- @StrutsTagAttribute(description="Comma separated list of topics to be published when a tab is clicked on (before it is selected)" +
- "The tab container widget will be passed as the first argument to the topic. The second parameter is the tab widget." +
- "The event can be cancelled setting to 'true' the 'cancel' property " +
- "of the third parameter passed to the topics.")
- public void setBeforeSelectTabNotifyTopics(String selectedTabNotifyTopics) {
- this.beforeSelectTabNotifyTopics = selectedTabNotifyTopics;
- }
-
- @StrutsTagAttribute(description="Comma separated list of topics to be published when a tab is clicked on (after it is selected)." +
- "The tab container widget will be passed as the first argument to the topic. The second parameter is the tab widget.")
- public void setAfterSelectTabNotifyTopics(String afterSelectTabNotifyTopics) {
- this.afterSelectTabNotifyTopics = afterSelectTabNotifyTopics;
- }
-
- @StrutsTagAttribute(description="Css class to be applied to the tab button of disabled tabs", defaultValue="strutsDisabledTab")
- public void setDisabledTabCssClass(String disabledTabCssClass) {
- this.disabledTabCssClass = disabledTabCssClass;
- }
-
- @StrutsTagAttribute(required = false, defaultValue = "false", description = "If set to true, the id of the last selected " +
- "tab will be stored in cookie. If the view is rendered, it will be tried to read this cookie and activate " +
- "the corresponding tab on success, unless overridden by the selectedTab attribute. The cookie name is \"Struts2TabbedPanel_selectedTab_\"+id.")
- public void setUseSelectedTabCookie( String useSelectedTabCookie ) {
- this.useSelectedTabCookie = useSelectedTabCookie;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/TextArea.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/TextArea.java
deleted file mode 100644
index c61dd70a4..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/TextArea.java
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.components;
-
-import java.util.Random;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.views.annotations.StrutsTag;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- *
- * Render Dojo Editor2 widget
- *
- *
- */
-@StrutsTag(name="textarea", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.TextareaTag", description="Renders Dojo Editor2 widget")
-public class TextArea extends org.apache.struts2.components.TextArea {
- private final static transient Random RANDOM = new Random();
-
- public TextArea(ValueStack stack, HttpServletRequest request,
- HttpServletResponse response) {
- super(stack, request, response);
- }
-
- public void evaluateExtraParams() {
- super.evaluateExtraParams();
-
- // generate a random ID if not explicitly set and not parsing the content
- Boolean parseContent = (Boolean)stack.getContext().get(Head.PARSE_CONTENT);
- boolean generateId = (parseContent != null ? !parseContent : true);
-
- addParameter("pushId", generateId);
- if ((this.id == null || this.id.length() == 0) && generateId) {
- // resolves Math.abs(Integer.MIN_VALUE) issue reported by FindBugs
- // http://findbugs.sourceforge.net/bugDescriptions.html#RV_ABSOLUTE_VALUE_OF_RANDOM_INT
- int nextInt = RANDOM.nextInt();
- nextInt = nextInt == Integer.MIN_VALUE ? Integer.MAX_VALUE : Math.abs(nextInt);
- this.id = "widget_" + String.valueOf(nextInt);
- addParameter("id", this.id);
- }
- }
-
- @Override
- public String getTheme() {
- return "ajax";
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Tree.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Tree.java
deleted file mode 100644
index 123a5c000..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/Tree.java
+++ /dev/null
@@ -1,551 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.components;
-
-import java.io.Writer;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Random;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.ClosingUIBean;
-import org.apache.struts2.views.annotations.StrutsTag;
-import org.apache.struts2.views.annotations.StrutsTagAttribute;
-import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- *
- *
- * Renders a tree widget with AJAX support.
- *
- * The "id "attribute is normally specified(recommended), such that it could be looked up using
- * javascript if necessary. The "id" attribute is required if the "selectedNotifyTopic" or the
- * "href" attributes are going to be used.
- *
- *
- *
- *
- * <s:tree id="..." label="...">
- * <s:treenode id="..." label="..." />
- * <s:treenode id="..." label="...">
- * <s:treenode id="..." label="..." />
- * <s:treenode id="..." label="..." />
- * </s:treenode>
- * <s:treenode id="..." label="..." />
- * </s:tree>
- *
- *
- *
- * <s:tree
- * id="..."
- * rootNode="..."
- * nodeIdProperty="..."
- * nodeTitleProperty="..."
- * childCollectionProperty="..." />
- *
- *
- *
- * <s:url id="nodesUrl" namespace="/nodecorate" action="getNodes" />
- * <div style="float:left; margin-right: 50px;">
- * <sx:tree id="tree" href="%{#nodesUrl}" />
- * </div>
- *
- * On this example the url specified on the "href" attibute will be called to load
- * the elements on the root. The response is expected to be a JSON array of objects like:
- * [
- * {
- * label: "Node 1",
- * hasChildren: false,
- * id: "Node1"
- * },
- * {
- * label: "Node 2",
- * hasChildren: true,
- * id: "Node2"
- * },
- * ]
- *
- * "label" is the text that will be displayed for the node. "hasChildren" marks the node has
- * having children or not (if true, a plus icon will be assigned to the node so it can be
- * expanded). The "id" attribute will be used to load the children of the node, when the node
- * is expanded. When a node is expanded a request will be made to the url in the "href" attribute
- * and the node's "id" will be passed in the parameter "nodeId".
- *
- * The children collection for a node will be loaded only once, to reload the children of a
- * node, use the "reload()" function of the treenode widget. To reload the children nodes of "Node1"
- * from the example above use the following javascript:
- *
- * dojo.widget.byId("Node1").reload();
- *
- */
-@StrutsTag(name="tree", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.TreeTag", description="Render a tree widget.")
-public class Tree extends ClosingUIBean {
-
- private static final String TEMPLATE = "tree-close";
- private static final String OPEN_TEMPLATE = "tree";
- private final static transient Random RANDOM = new Random();
-
- protected String toggle;
- protected String selectedNotifyTopics;
- protected String expandedNotifyTopics;
- protected String collapsedNotifyTopics;
- protected String rootNodeAttr;
- protected String childCollectionProperty;
- protected String nodeTitleProperty;
- protected String nodeIdProperty;
- protected String showRootGrid;
-
- protected String showGrid;
- protected String blankIconSrc;
- protected String gridIconSrcL;
- protected String gridIconSrcV;
- protected String gridIconSrcP;
- protected String gridIconSrcC;
- protected String gridIconSrcX;
- protected String gridIconSrcY;
- protected String expandIconSrcPlus;
- protected String expandIconSrcMinus;
- protected String iconWidth;
- protected String iconHeight;
- protected String toggleDuration;
- protected String templateCssPath;
- protected String href;
- protected String errorNotifyTopics;
-
- private List childrenIds;
-
- public Tree(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
- super(stack, request, response);
- }
-
- public boolean start(Writer writer) {
- boolean result = super.start(writer);
-
- if (this.label == null && (href == null)) {
- if ((rootNodeAttr == null)
- || (childCollectionProperty == null)
- || (nodeTitleProperty == null)
- || (nodeIdProperty == null)) {
- fieldError("label","The TreeTag requires either a value for 'label' or 'href' or ALL of 'rootNode', " +
- "'childCollectionProperty', 'nodeTitleProperty', and 'nodeIdProperty'", null);
- }
- }
- return result;
- }
-
- protected void evaluateExtraParams() {
- super.evaluateExtraParams();
-
- if (toggle != null) {
- addParameter("toggle", findString(toggle));
- } else {
- addParameter("toggle", "fade");
- }
-
- if (selectedNotifyTopics != null) {
- addParameter("selectedNotifyTopics", findString(selectedNotifyTopics));
- }
-
- if (expandedNotifyTopics != null) {
- addParameter("expandedNotifyTopics", findString(expandedNotifyTopics));
- }
-
- if (collapsedNotifyTopics != null) {
- addParameter("collapsedNotifyTopics", findString(collapsedNotifyTopics));
- }
-
- if (rootNodeAttr != null) {
- addParameter("rootNode", findValue(rootNodeAttr));
- }
-
- if (childCollectionProperty != null) {
- addParameter("childCollectionProperty", findString(childCollectionProperty));
- }
-
- if (nodeTitleProperty != null) {
- addParameter("nodeTitleProperty", findString(nodeTitleProperty));
- }
-
- if (nodeIdProperty != null) {
- addParameter("nodeIdProperty", findString(nodeIdProperty));
- }
-
- if (showRootGrid != null) {
- addParameter("showRootGrid", findValue(showRootGrid, Boolean.class));
- }
-
-
- if (showGrid != null) {
- addParameter("showGrid", findValue(showGrid, Boolean.class));
- }
-
- if (blankIconSrc != null) {
- addParameter("blankIconSrc", findString(blankIconSrc));
- }
-
- if (gridIconSrcL != null) {
- addParameter("gridIconSrcL", findString(gridIconSrcL));
- }
-
- if (gridIconSrcV != null) {
- addParameter("gridIconSrcV", findString(gridIconSrcV));
- }
-
- if (gridIconSrcP != null) {
- addParameter("gridIconSrcP", findString(gridIconSrcP));
- }
-
- if (gridIconSrcC != null) {
- addParameter("gridIconSrcC", findString(gridIconSrcC));
- }
-
- if (gridIconSrcX != null) {
- addParameter("gridIconSrcX", findString(gridIconSrcX));
- }
-
- if (gridIconSrcY != null) {
- addParameter("gridIconSrcY", findString(gridIconSrcY));
- }
-
- if (expandIconSrcPlus != null) {
- addParameter("expandIconSrcPlus", findString(expandIconSrcPlus));
- }
-
- if (expandIconSrcMinus != null) {
- addParameter("expandIconSrcMinus", findString(expandIconSrcMinus));
- }
-
- if (iconWidth != null) {
- addParameter("iconWidth", findValue(iconWidth, Integer.class));
- }
- if (iconHeight != null) {
- addParameter("iconHeight", findValue(iconHeight, Integer.class));
- }
- if (toggleDuration != null) {
- addParameter("toggleDuration", findValue(toggleDuration, Integer.class));
- }
- if (templateCssPath != null) {
- addParameter("templateCssPath", findString(templateCssPath));
- }
- if (href != null)
- addParameter("href", findString(href));
- if (errorNotifyTopics != null)
- addParameter("errorNotifyTopics", findString(errorNotifyTopics));
-
- // generate a random ID if not explicitly set and not parsing the content
- Boolean parseContent = (Boolean)stack.getContext().get(Head.PARSE_CONTENT);
- boolean generateId = (parseContent != null ? !parseContent : true);
-
- addParameter("pushId", generateId);
- if ((this.id == null || this.id.length() == 0) && generateId) {
- // resolves Math.abs(Integer.MIN_VALUE) issue reported by FindBugs
- // http://findbugs.sourceforge.net/bugDescriptions.html#RV_ABSOLUTE_VALUE_OF_RANDOM_INT
- int nextInt = RANDOM.nextInt();
- nextInt = nextInt == Integer.MIN_VALUE ? Integer.MAX_VALUE : Math.abs(nextInt);
- this.id = "widget_" + String.valueOf(nextInt);
- addParameter("id", this.id);
- }
-
- if (this.childrenIds != null)
- addParameter("childrenIds", this.childrenIds);
- }
-
- public void addChildrenId(String id) {
- if (this.childrenIds == null)
- this.childrenIds = new ArrayList();
- this.childrenIds.add(id);
- }
-
- @Override
- @StrutsTagSkipInheritance
- public void setTheme(String theme) {
- super.setTheme(theme);
- }
-
- @Override
- public String getTheme() {
- return "ajax";
- }
-
- public String getDefaultOpenTemplate() {
- return OPEN_TEMPLATE;
- }
-
- protected String getDefaultTemplate() {
- return TEMPLATE;
- }
-
- public String getToggle() {
- return toggle;
- }
-
- @StrutsTagAttribute(description="The toggle property (either 'explode' or 'fade')", defaultValue="fade")
- public void setToggle(String toggle) {
- this.toggle = toggle;
- }
-
- @StrutsTagAttribute(description="Deprecated. Use 'selectedNotifyTopics' instead.")
- public void setTreeSelectedTopic(String selectedNotifyTopic) {
- this.selectedNotifyTopics = selectedNotifyTopic;
- }
-
- @StrutsTagAttribute(description="Deprecated. Use 'expandedNotifyTopics' instead.")
- public void setTreeExpandedTopics(String expandedNotifyTopic) {
- this.expandedNotifyTopics = expandedNotifyTopic;
- }
-
- @StrutsTagAttribute(description="Deprecated. Use 'collapsedNotifyTopics' instead.")
- public void setTreeCollapsedTopics(String collapsedNotifyTopic) {
- this.collapsedNotifyTopics = collapsedNotifyTopic;
- }
-
- public String getRootNode() {
- return rootNodeAttr;
- }
-
- @StrutsTagAttribute(description="The rootNode property.")
- public void setRootNode(String rootNode) {
- this.rootNodeAttr = rootNode;
- }
-
- public String getChildCollectionProperty() {
- return childCollectionProperty;
- }
-
- @StrutsTagAttribute(description="The childCollectionProperty property.")
- public void setChildCollectionProperty(String childCollectionProperty) {
- this.childCollectionProperty = childCollectionProperty;
- }
-
- public String getNodeTitleProperty() {
- return nodeTitleProperty;
- }
-
- @StrutsTagAttribute(description="The nodeTitleProperty property.")
- public void setNodeTitleProperty(String nodeTitleProperty) {
- this.nodeTitleProperty = nodeTitleProperty;
- }
-
- public String getNodeIdProperty() {
- return nodeIdProperty;
- }
-
- @StrutsTagAttribute(description="The nodeIdProperty property.")
- public void setNodeIdProperty(String nodeIdProperty) {
- this.nodeIdProperty = nodeIdProperty;
- }
-
- @StrutsTagAttribute(description="The showRootGrid property (default true).")
- public void setShowRootGrid(String showRootGrid) {
- this.showRootGrid = showRootGrid;
- }
-
- public String getShowRootGrid() {
- return showRootGrid;
- }
-
- public String getBlankIconSrc() {
- return blankIconSrc;
- }
-
- @StrutsTagAttribute(description="Blank icon image source.")
- public void setBlankIconSrc(String blankIconSrc) {
- this.blankIconSrc = blankIconSrc;
- }
-
- public String getExpandIconSrcMinus() {
- return expandIconSrcMinus;
- }
-
- @StrutsTagAttribute(description="Expand icon (-) image source.")
- public void setExpandIconSrcMinus(String expandIconSrcMinus) {
- this.expandIconSrcMinus = expandIconSrcMinus;
- }
-
- public String getExpandIconSrcPlus() {
- return expandIconSrcPlus;
- }
-
- @StrutsTagAttribute(description="Expand Icon (+) image source.")
- public void setExpandIconSrcPlus(String expandIconSrcPlus) {
- this.expandIconSrcPlus = expandIconSrcPlus;
- }
-
- public String getGridIconSrcC() {
- return gridIconSrcC;
- }
-
- @StrutsTagAttribute(description="Image source for under child item child icons.")
- public void setGridIconSrcC(String gridIconSrcC) {
- this.gridIconSrcC = gridIconSrcC;
- }
-
- public String getGridIconSrcL() {
- return gridIconSrcL;
- }
-
-
- @StrutsTagAttribute(description=" Image source for last child grid.")
- public void setGridIconSrcL(String gridIconSrcL) {
- this.gridIconSrcL = gridIconSrcL;
- }
-
- public String getGridIconSrcP() {
- return gridIconSrcP;
- }
-
- @StrutsTagAttribute(description="Image source for under parent item child icons.")
- public void setGridIconSrcP(String gridIconSrcP) {
- this.gridIconSrcP = gridIconSrcP;
- }
-
- public String getGridIconSrcV() {
- return gridIconSrcV;
- }
-
- @StrutsTagAttribute(description="Image source for vertical line.")
- public void setGridIconSrcV(String gridIconSrcV) {
- this.gridIconSrcV = gridIconSrcV;
- }
-
- public String getGridIconSrcX() {
- return gridIconSrcX;
- }
-
- @StrutsTagAttribute(description="Image source for grid for sole root item.")
- public void setGridIconSrcX(String gridIconSrcX) {
- this.gridIconSrcX = gridIconSrcX;
- }
-
- public String getGridIconSrcY() {
- return gridIconSrcY;
- }
-
- @StrutsTagAttribute(description="Image source for grid for last root item.")
- public void setGridIconSrcY(String gridIconSrcY) {
- this.gridIconSrcY = gridIconSrcY;
- }
-
- public String getIconHeight() {
- return iconHeight;
- }
-
-
- @StrutsTagAttribute(description="Icon height", defaultValue="18px")
- public void setIconHeight(String iconHeight) {
- this.iconHeight = iconHeight;
- }
-
- public String getIconWidth() {
- return iconWidth;
- }
-
- @StrutsTagAttribute(description="Icon width", defaultValue="19px")
- public void setIconWidth(String iconWidth) {
- this.iconWidth = iconWidth;
- }
-
-
-
- public String getTemplateCssPath() {
- return templateCssPath;
- }
-
- @StrutsTagAttribute(description="Template css path", defaultValue="{contextPath}/struts/tree.css.")
- public void setTemplateCssPath(String templateCssPath) {
- this.templateCssPath = templateCssPath;
- }
-
- public String getToggleDuration() {
- return toggleDuration;
- }
-
- @StrutsTagAttribute(description="Toggle duration in milliseconds", defaultValue="150")
- public void setToggleDuration(String toggleDuration) {
- this.toggleDuration = toggleDuration;
- }
-
- public String getShowGrid() {
- return showGrid;
- }
-
- @StrutsTagAttribute(description="Show grid", type="Boolean", defaultValue="true")
- public void setShowGrid(String showGrid) {
- this.showGrid = showGrid;
- }
-
- @StrutsTagAttribute(description="The css class to use for element")
- public void setCssClass(String cssClass) {
- super.setCssClass(cssClass);
- }
-
- @StrutsTagAttribute(description="The css style to use for element")
- public void setCssStyle(String cssStyle) {
- super.setCssStyle(cssStyle);
- }
-
- @StrutsTagAttribute(description="The id to use for the element")
- public void setId(String id) {
- super.setId(id);
- }
-
- @StrutsTagAttribute(description="The name to set for element")
- public void setName(String name) {
- super.setName(name);
- }
-
- @StrutsTagAttribute(description="Comma separated lis of topics to be published when a node" +
- " is collapsed. An object with a 'node' property will be passed as parameter to the topics.")
- public void setCollapsedNotifyTopics(String collapsedNotifyTopics) {
- this.collapsedNotifyTopics = collapsedNotifyTopics;
- }
-
- @StrutsTagAttribute(description="Comma separated lis of topics to be published when a node" +
- " is expanded. An object with a 'node' property will be passed as parameter to the topics.")
- public void setExpandedNotifyTopics(String expandedNotifyTopics) {
- this.expandedNotifyTopics= expandedNotifyTopics;
- }
-
- @StrutsTagAttribute(description="Comma separated lis of topics to be published when a node" +
- " is selected. An object with a 'node' property will be passed as parameter to the topics.")
- public void setSelectedNotifyTopics(String selectedNotifyTopics) {
- this.selectedNotifyTopics = selectedNotifyTopics;
- }
-
- @StrutsTagAttribute(description="Url used to load the list of children nodes for an specific node, whose id will be " +
- "passed as a parameter named 'nodeId' (empty for root)")
- public void setHref(String href) {
- this.href = href;
- }
-
- @StrutsTagAttribute(description="Comma delimmited list of topics that will published after the request(if the request fails)." +
- "Only valid if 'href' is set")
- public void setErrorNotifyTopics(String errorNotifyTopics) {
- this.errorNotifyTopics = errorNotifyTopics;
- }
-}
-
-
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/TreeNode.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/TreeNode.java
deleted file mode 100644
index e65276952..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/components/TreeNode.java
+++ /dev/null
@@ -1,161 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.components;
-
-import java.util.Random;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.ClosingUIBean;
-import org.apache.struts2.views.annotations.StrutsTag;
-import org.apache.struts2.views.annotations.StrutsTagAttribute;
-import org.apache.struts2.views.annotations.StrutsTagSkipInheritance;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- *
- *
- * Renders a tree node within a tree widget with AJAX support.
- *
- * Either of the following combinations should be used depending on if the tree
- * is to be constructed dynamically or statically.
- *
- * Dynamically:
- *
- *
id - id of this tree node
- *
title - label to be displayed for this tree node
- *
- *
- * Statically:
- *
- *
rootNode - the parent node of which this tree is derived from
- *
nodeIdProperty - property to obtained this current tree node's id
- *
nodeTitleProperty - property to obtained this current tree node's title
- *
childCollectionProperty - property that returnds this current tree node's children
- *
- */
-@StrutsTag(name="treenode", tldTagClass="org.apache.struts2.dojo.views.jsp.ui.TreeNodeTag", description="Render a tree node within a tree widget.")
-public class TreeNode extends ClosingUIBean {
- private static final String TEMPLATE = "treenode-close";
- private static final String OPEN_TEMPLATE = "treenode";
- private final static transient Random RANDOM = new Random();
-
- public TreeNode(ValueStack stack, HttpServletRequest request, HttpServletResponse response) {
- super(stack, request, response);
- }
-
- @Override
- @StrutsTagSkipInheritance
- public void setTheme(String theme) {
- super.setTheme(theme);
- }
-
- @Override
- public String getTheme() {
- return "ajax";
- }
-
- public String getDefaultOpenTemplate() {
- return OPEN_TEMPLATE;
- }
-
- protected String getDefaultTemplate() {
- return TEMPLATE;
- }
-
- protected void evaluateExtraParams() {
- super.evaluateExtraParams();
-
- // generate a random ID if not explicitly set and not parsing the content
- Boolean parseContent = (Boolean)stack.getContext().get(Head.PARSE_CONTENT);
- boolean generateId = (parseContent != null ? !parseContent : true);
-
- addParameter("pushId", generateId);
- if ((this.id == null || this.id.length() == 0) && generateId) {
- // resolves Math.abs(Integer.MIN_VALUE) issue reported by FindBugs
- // http://findbugs.sourceforge.net/bugDescriptions.html#RV_ABSOLUTE_VALUE_OF_RANDOM_INT
- int nextInt = RANDOM.nextInt();
- nextInt = nextInt == Integer.MIN_VALUE ? Integer.MAX_VALUE : Math.abs(nextInt);
- this.id = "widget_" + String.valueOf(nextInt);
- addParameter("id", this.id);
- }
-
- Tree parentTree = (Tree) findAncestor(Tree.class);
- parentTree.addChildrenId(this.id);
- }
-
- @StrutsTagAttribute(description="Label expression used for rendering tree node label.", required=true)
- public void setLabel(String label) {
- super.setLabel(label);
- }
-
- @StrutsTagAttribute(description="The css class to use for element")
- public void setCssClass(String cssClass) {
- super.setCssClass(cssClass);
- }
-
- @StrutsTagAttribute(description="The css style to use for element")
- public void setCssStyle(String cssStyle) {
- super.setCssStyle(cssStyle);
- }
-
- @StrutsTagAttribute(description="The id to use for the element")
- public void setId(String id) {
- super.setId(id);
- }
-
- @StrutsTagAttribute(description="The name to set for element")
- public void setName(String name) {
- super.setName(name);
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/DojoTagLibrary.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/DojoTagLibrary.java
deleted file mode 100644
index a8439bf61..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/DojoTagLibrary.java
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views;
-
-import java.util.Arrays;
-import java.util.List;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.dojo.views.freemarker.tags.DojoModels;
-import org.apache.struts2.dojo.views.velocity.components.AnchorDirective;
-import org.apache.struts2.dojo.views.velocity.components.AutocompleterDirective;
-import org.apache.struts2.dojo.views.velocity.components.BindDirective;
-import org.apache.struts2.dojo.views.velocity.components.DateTimePickerDirective;
-import org.apache.struts2.dojo.views.velocity.components.DivDirective;
-import org.apache.struts2.dojo.views.velocity.components.HeadDirective;
-import org.apache.struts2.dojo.views.velocity.components.SubmitDirective;
-import org.apache.struts2.dojo.views.velocity.components.TabbedPanelDirective;
-import org.apache.struts2.dojo.views.velocity.components.TextAreaDirective;
-import org.apache.struts2.dojo.views.velocity.components.TreeDirective;
-import org.apache.struts2.dojo.views.velocity.components.TreeNodeDirective;
-import org.apache.struts2.views.TagLibraryDirectiveProvider;
-
-import com.opensymphony.xwork2.util.ValueStack;
-import org.apache.struts2.views.TagLibraryModelProvider;
-
-public class DojoTagLibrary implements TagLibraryDirectiveProvider, TagLibraryModelProvider {
-
- public Object getModels(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
-
- return new DojoModels(stack, req, res);
- }
-
- public List getDirectiveClasses() {
- Class[] directives = new Class[] {
- DateTimePickerDirective.class,
- DivDirective.class,
- AutocompleterDirective.class,
- AnchorDirective.class,
- SubmitDirective.class,
- TabbedPanelDirective.class,
- TreeDirective.class,
- TreeNodeDirective.class,
- HeadDirective.class,
- BindDirective.class,
- TextAreaDirective.class
- };
- return Arrays.asList(directives);
- }
-
-}
\ No newline at end of file
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/AnchorModel.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/AnchorModel.java
deleted file mode 100644
index 42dd5fb93..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/AnchorModel.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.freemarker.tags;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.Anchor;
-import org.apache.struts2.views.freemarker.tags.TagModel;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see Anchor
- */
-public class AnchorModel extends TagModel {
-
- public AnchorModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- super(stack, req, res);
- }
-
- @Override
- protected Component getBean() {
- return new Anchor(stack, req, res);
- }
-
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/AutocompleterModel.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/AutocompleterModel.java
deleted file mode 100644
index 69783d4b8..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/AutocompleterModel.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.freemarker.tags;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.Autocompleter;
-import org.apache.struts2.views.freemarker.tags.TagModel;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see Autocompleter
- */
-public class AutocompleterModel extends TagModel {
-
- public AutocompleterModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- super(stack, req, res);
- }
-
- protected Component getBean() {
- return new Autocompleter(stack, req, res);
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/BindModel.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/BindModel.java
deleted file mode 100644
index 9805b6f7a..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/BindModel.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.freemarker.tags;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.Bind;
-import org.apache.struts2.views.freemarker.tags.TagModel;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see Bind
- */
-public class BindModel extends TagModel {
- public BindModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- super(stack, req, res);
- }
-
- protected Component getBean() {
- return new Bind(stack, req, res);
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/DateTimePickerModel.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/DateTimePickerModel.java
deleted file mode 100644
index 0e748853b..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/DateTimePickerModel.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.freemarker.tags;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.DateTimePicker;
-import org.apache.struts2.views.freemarker.tags.TextFieldModel;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see DropdownDateTimePicker
- */
-public class DateTimePickerModel extends TextFieldModel {
-
- public DateTimePickerModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- super(stack, req, res);
- }
-
- protected Component getBean() {
- return new DateTimePicker(stack, req, res);
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/DivModel.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/DivModel.java
deleted file mode 100644
index 0d7d8afe1..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/DivModel.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.freemarker.tags;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.Div;
-import org.apache.struts2.views.freemarker.tags.TagModel;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-
-/**
- * @see Div
- */
-public class DivModel extends TagModel {
-
- public DivModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- super(stack, req, res);
- }
-
- @Override
- protected Component getBean() {
- return new Div(stack, req, res);
- }
-
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/DojoModels.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/DojoModels.java
deleted file mode 100644
index c094662c6..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/DojoModels.java
+++ /dev/null
@@ -1,137 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.freemarker.tags;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-public class DojoModels {
- protected DateTimePickerModel dateTimePicker;
- protected TabbedPanelModel tabbedPanel;
- protected TreeModel treeModel;
- protected TreeNodeModel treenodeModel;
- protected AutocompleterModel autocompleter;
- protected DivModel div;
- protected AnchorModel a;
- protected SubmitModel submit;
- protected BindModel bind;
- protected HeadModel head;
- protected TextAreaModel textarea;
-
- private ValueStack stack;
- private HttpServletRequest req;
- private HttpServletResponse res;
-
- public DojoModels(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- this.stack = stack;
- this.req = req;
- this.res = res;
- }
-
- public BindModel getBind() {
- if (bind == null) {
- bind = new BindModel(stack, req, res);
- }
-
- return bind;
- }
-
- public TextAreaModel getTextarea() {
- if (textarea == null) {
- textarea = new TextAreaModel(stack, req, res);
- }
-
- return textarea;
- }
-
- public HeadModel getHead() {
- if (head == null) {
- head = new HeadModel(stack, req, res);
- }
-
- return head;
- }
-
- public DateTimePickerModel getDatetimepicker() {
- if (dateTimePicker == null) {
- dateTimePicker = new DateTimePickerModel(stack, req, res);
- }
-
- return dateTimePicker;
- }
-
- public AutocompleterModel getAutocompleter() {
- if (autocompleter == null) {
- autocompleter = new AutocompleterModel(stack, req, res);
- }
-
- return autocompleter;
- }
-
- public TabbedPanelModel getTabbedpanel() {
- if (tabbedPanel == null) {
- tabbedPanel = new TabbedPanelModel(stack, req, res);
- }
-
- return tabbedPanel;
- }
-
- public TreeModel getTree() {
- if (treeModel == null) {
- treeModel = new TreeModel(stack,req, res);
- }
- return treeModel;
- }
-
- public TreeNodeModel getTreenode() {
- if (treenodeModel == null) {
- treenodeModel = new TreeNodeModel(stack, req, res);
- }
- return treenodeModel;
- }
-
- public DivModel getDiv() {
- if (div == null) {
- div = new DivModel(stack, req, res);
- }
-
- return div;
- }
-
- public AnchorModel getA() {
- if (a == null) {
- a = new AnchorModel(stack, req, res);
- }
-
- return a;
- }
-
- public SubmitModel getSubmit() {
- if (submit == null) {
- submit = new SubmitModel(stack, req, res);
- }
-
- return submit;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/HeadModel.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/HeadModel.java
deleted file mode 100644
index b5fdefeaf..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/HeadModel.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.freemarker.tags;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.Head;
-import org.apache.struts2.views.freemarker.tags.TagModel;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see Head
- */
-public class HeadModel extends TagModel {
- public HeadModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- super(stack, req, res);
- }
-
- protected Component getBean() {
- return new Head(stack, req, res);
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/SubmitModel.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/SubmitModel.java
deleted file mode 100644
index c295e10c5..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/SubmitModel.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.freemarker.tags;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.Submit;
-import org.apache.struts2.views.freemarker.tags.TagModel;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see Submit
- */
-public class SubmitModel extends TagModel {
-
- public SubmitModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- super(stack, req, res);
- }
-
- @Override
- protected Component getBean() {
- return new Submit(stack, req, res);
- }
-
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/TabbedPanelModel.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/TabbedPanelModel.java
deleted file mode 100644
index d597ee8f7..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/TabbedPanelModel.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.freemarker.tags;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.TabbedPanel;
-import org.apache.struts2.views.freemarker.tags.TagModel;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see TabbedPanel
- */
-public class TabbedPanelModel extends TagModel {
- public TabbedPanelModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- super(stack, req, res);
- }
-
- protected Component getBean() {
- return new TabbedPanel(stack, req, res);
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/TextAreaModel.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/TextAreaModel.java
deleted file mode 100644
index 703d3041e..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/TextAreaModel.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.freemarker.tags;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.TextArea;
-import org.apache.struts2.views.freemarker.tags.TagModel;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see TextArea
- */
-public class TextAreaModel extends TagModel {
- public TextAreaModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- super(stack, req, res);
- }
-
- protected Component getBean() {
- return new TextArea(stack, req, res);
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/TreeModel.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/TreeModel.java
deleted file mode 100644
index f3f69c1f1..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/TreeModel.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.freemarker.tags;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.Tree;
-import org.apache.struts2.views.freemarker.tags.TagModel;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * TreeModel
- * @see Tree
- *
- */
-public class TreeModel extends TagModel {
- public TreeModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- super(stack, req, res);
- }
-
- protected Component getBean() {
- return new Tree(stack,req,res);
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/TreeNodeModel.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/TreeNodeModel.java
deleted file mode 100644
index 773d77693..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/freemarker/tags/TreeNodeModel.java
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.freemarker.tags;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.TreeNode;
-import org.apache.struts2.views.freemarker.tags.TagModel;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * TreeNodeModel
- * @see TreeNode
- */
-public class TreeNodeModel extends TagModel {
- public TreeNodeModel(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- super(stack, req, res);
- }
-
- protected Component getBean() {
- return new TreeNode(stack,req,res);
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/AbstractRemoteTag.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/AbstractRemoteTag.java
deleted file mode 100644
index af11e04b8..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/AbstractRemoteTag.java
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.jsp.ui;
-
-import org.apache.struts2.dojo.components.RemoteBean;
-import org.apache.struts2.views.jsp.ui.AbstractClosingTag;
-
-public abstract class AbstractRemoteTag extends AbstractClosingTag {
-
- protected String href;
- protected String listenTopics;
- protected String notifyTopics;
- protected String loadingText;
- protected String errorText;
- protected String executeScripts;
- protected String handler;
- protected String formId;
- protected String formFilter;
- protected String showErrorTransportText;
- protected String indicator;
- protected String showLoadingText;
- protected String beforeNotifyTopics;
- protected String afterNotifyTopics;
- protected String errorNotifyTopics;
- protected String highlightColor;
- protected String highlightDuration;
- protected String separateScripts;
- protected String transport;
- protected String parseContent;
-
- protected void populateParams() {
- super.populateParams();
-
- RemoteBean remote = (RemoteBean) component;
- remote.setHref(href);
- remote.setListenTopics(listenTopics);
- remote.setLoadingText(loadingText);
- remote.setErrorText(errorText);
- remote.setExecuteScripts(executeScripts);
- remote.setHandler(handler);
- remote.setFormFilter(formFilter);
- remote.setFormId(formId);
- remote.setNotifyTopics(notifyTopics);
- remote.setShowErrorTransportText(showErrorTransportText);
- remote.setIndicator(indicator);
- remote.setShowLoadingText(showLoadingText);
- remote.setAfterNotifyTopics(afterNotifyTopics);
- remote.setBeforeNotifyTopics(beforeNotifyTopics);
- remote.setErrorNotifyTopics(errorNotifyTopics);
- remote.setHighlightColor(highlightColor);
- remote.setHighlightDuration(highlightDuration);
- remote.setSeparateScripts(separateScripts);
- remote.setTransport(transport);
- remote.setParseContent(parseContent);
- }
-
- public void setHref(String href) {
- this.href = href;
- }
-
- public void setErrorText(String errorText) {
- this.errorText = errorText;
- }
-
- public void setLoadingText(String loadingText) {
- this.loadingText = loadingText;
- }
-
- public void setListenTopics(String listenTopics) {
- this.listenTopics = listenTopics;
- }
-
- public void setExecuteScripts(String executeScripts) {
- this.executeScripts = executeScripts;
- }
-
- public void setHandler(String handler) {
- this.handler = handler;
- }
-
- public void setFormFilter(String formFilter) {
- this.formFilter = formFilter;
- }
-
- public void setFormId(String formId) {
- this.formId = formId;
- }
-
- public void setNotifyTopics(String notifyTopics) {
- this.notifyTopics = notifyTopics;
- }
-
- public void setShowErrorTransportText(String showErrorTransportText) {
- this.showErrorTransportText = showErrorTransportText;
- }
-
- public void setIndicator(String indicator) {
- this.indicator = indicator;
- }
-
- public void setShowLoadingText(String showLoadingText) {
- this.showLoadingText = showLoadingText;
- }
-
- public void setAfterNotifyTopics(String afterNotifyTopics) {
- this.afterNotifyTopics = afterNotifyTopics;
- }
-
- public void setBeforeNotifyTopics(String beforeNotifyTopics) {
- this.beforeNotifyTopics = beforeNotifyTopics;
- }
-
- public void setErrorNotifyTopics(String errorNotifyTopics) {
- this.errorNotifyTopics = errorNotifyTopics;
- }
-
- public void setHighlightColor(String highlightColor) {
- this.highlightColor = highlightColor;
- }
-
- public void setHighlightDuration(String highlightDuration) {
- this.highlightDuration = highlightDuration;
- }
-
- public void setSeparateScripts(String separateScripts) {
- this.separateScripts = separateScripts;
- }
-
- public void setTransport(String transport) {
- this.transport = transport;
- }
-
- public void setParseContent(String parseContent) {
- this.parseContent = parseContent;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/AbstractValidateTag.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/AbstractValidateTag.java
deleted file mode 100644
index 193fff836..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/AbstractValidateTag.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.jsp.ui;
-
-import org.apache.struts2.dojo.components.AbstractValidateBean;
-
-/**
- * @see AbstractValidateTag
- */
-public abstract class AbstractValidateTag extends AbstractRemoteTag {
- protected String validate;
- protected String ajaxAfterValidation;
-
- protected void populateParams() {
- super.populateParams();
-
- AbstractValidateBean validateBean = (AbstractValidateBean) component;
- validateBean.setValidate(validate);
- validateBean.setAjaxAfterValidation(ajaxAfterValidation);
- }
-
- public void setAjaxAfterValidation(String ajaxAfterValidation) {
- this.ajaxAfterValidation = ajaxAfterValidation;
- }
-
- public void setValidate(String validate) {
- this.validate = validate;
- }
-
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/AnchorTag.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/AnchorTag.java
deleted file mode 100644
index 9b95c431a..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/AnchorTag.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.jsp.ui;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.Anchor;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see Anchor
- */
-public class AnchorTag extends AbstractValidateTag {
-
- private static final long serialVersionUID = -1034616578492431113L;
-
- protected String targets;
-
- public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- return new Anchor(stack, req, res);
- }
-
- protected void populateParams() {
- super.populateParams();
-
- Anchor link = (Anchor) component;
- link.setTargets(targets);
- link.setValidate(validate);
- }
-
- public void setTargets(String targets) {
- this.targets = targets;
- }
-}
-
-
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/AutocompleterTag.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/AutocompleterTag.java
deleted file mode 100644
index 4f7667f59..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/AutocompleterTag.java
+++ /dev/null
@@ -1,221 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.jsp.ui;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.Autocompleter;
-import org.apache.struts2.views.jsp.ui.ComboBoxTag;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see Autocompleter
- */
-public class AutocompleterTag extends ComboBoxTag {
- private static final long serialVersionUID = -1112470447573172581L;
-
- protected String forceValidOption;
- protected String searchType;
- protected String autoComplete;
- protected String delay;
- protected String disabled;
- protected String href;
- protected String dropdownWidth;
- protected String dropdownHeight;
- protected String formId;
- protected String formFilter;
- protected String listenTopics;
- protected String notifyTopics;
- protected String indicator;
- protected String loadOnTextChange;
- protected String loadMinimumCount;
- protected String showDownArrow;
- protected String templateCssPath;
- protected String iconPath;
- protected String keyName;
- protected String dataFieldName;
- protected String beforeNotifyTopics;
- protected String afterNotifyTopics;
- protected String errorNotifyTopics;
- protected String valueNotifyTopics;
- protected String resultsLimit;
- protected String transport;
- protected String preload;
- protected String keyValue;
-
- public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- return new Autocompleter(stack, req, res);
- }
-
- protected void populateParams() {
- super.populateParams();
-
- Autocompleter autocompleter = (Autocompleter) component;
- autocompleter.setAutoComplete(autoComplete);
- autocompleter.setDisabled(disabled);
- autocompleter.setForceValidOption(forceValidOption);
- autocompleter.setHref(href);
- autocompleter.setDelay(delay);
- autocompleter.setSearchType(searchType);
- autocompleter.setDropdownHeight(dropdownHeight);
- autocompleter.setDropdownWidth(dropdownWidth);
- autocompleter.setFormFilter(formFilter);
- autocompleter.setFormId(formId);
- autocompleter.setListenTopics(listenTopics);
- autocompleter.setNotifyTopics(notifyTopics);
- autocompleter.setIndicator(indicator);
- autocompleter.setLoadMinimumCount(loadMinimumCount);
- autocompleter.setLoadOnTextChange(loadOnTextChange);
- autocompleter.setShowDownArrow(showDownArrow);
- autocompleter.setTemplateCssPath(templateCssPath);
- autocompleter.setIconPath(iconPath);
- autocompleter.setKeyName(keyName);
- autocompleter.setDataFieldName(dataFieldName);
- autocompleter.setAfterNotifyTopics(afterNotifyTopics);
- autocompleter.setBeforeNotifyTopics(beforeNotifyTopics);
- autocompleter.setErrorNotifyTopics(errorNotifyTopics);
- autocompleter.setValueNotifyTopics(valueNotifyTopics);
- autocompleter.setResultsLimit(resultsLimit);
- autocompleter.setTransport(transport);
- autocompleter.setPreload(preload);
- autocompleter.setKeyValue(keyValue);
- }
-
- public void setAutoComplete(String autoComplete) {
- this.autoComplete = autoComplete;
- }
-
- public void setDisabled(String disabled) {
- this.disabled = disabled;
- }
-
- public void setForceValidOption(String forceValidOption) {
- this.forceValidOption = forceValidOption;
- }
-
- public void setHref(String href) {
- this.href = href;
- }
-
- public void setDelay(String searchDelay) {
- this.delay = searchDelay;
- }
-
- public void setSearchType(String searchType) {
- this.searchType = searchType;
- }
-
- public void setDropdownHeight(String height) {
- this.dropdownHeight = height;
- }
-
- public void setDropdownWidth(String width) {
- this.dropdownWidth = width;
- }
-
- public void setFormFilter(String formFilter) {
- this.formFilter = formFilter;
- }
-
- public void setFormId(String formId) {
- this.formId = formId;
- }
-
- public void setListenTopics(String listenTopics) {
- this.listenTopics = listenTopics;
- }
-
- public void setNotifyTopics(String onValueChangedPublishTopic) {
- this.notifyTopics = onValueChangedPublishTopic;
- }
-
- public void setIndicator(String indicator) {
- this.indicator = indicator;
- }
-
- public void setLoadMinimumCount(String loadMinimumCount) {
- this.loadMinimumCount = loadMinimumCount;
- }
-
- public String getLoadMinimumCount() {
- return loadMinimumCount;
- }
-
- public void setLoadOnTextChange(String loadOnTextChange) {
- this.loadOnTextChange = loadOnTextChange;
- }
-
- public void setShowDownArrow(String showDownArrow) {
- this.showDownArrow = showDownArrow;
- }
-
- public void setTemplateCssPath(String templateCssPath) {
- this.templateCssPath = templateCssPath;
- }
-
- public void setIconPath(String iconPath) {
- this.iconPath = iconPath;
- }
-
- public void setKeyName(String keyName) {
- this.keyName = keyName;
- }
-
- public void setDataFieldName(String dataFieldName) {
- this.dataFieldName = dataFieldName;
- }
-
- public void setAfterNotifyTopics(String afterNotifyTopics) {
- this.afterNotifyTopics = afterNotifyTopics;
- }
-
- public void setBeforeNotifyTopics(String beforeNotifyTopics) {
- this.beforeNotifyTopics = beforeNotifyTopics;
- }
-
- public void setErrorNotifyTopics(String errorNotifyTopics) {
- this.errorNotifyTopics = errorNotifyTopics;
- }
-
- public void setValueNotifyTopics(String valueNotifyTopics) {
- this.valueNotifyTopics = valueNotifyTopics;
- }
-
- public void setResultsLimit(String resultsLimit) {
- this.resultsLimit = resultsLimit;
- }
-
- public void setTransport(String transport) {
- this.transport = transport;
- }
-
- public void setPreload(String preload) {
- this.preload = preload;
- }
-
- public void setKeyValue(String keyValue) {
- this.keyValue = keyValue;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/BindTag.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/BindTag.java
deleted file mode 100644
index e3bc988b9..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/BindTag.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.jsp.ui;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.Bind;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-public class BindTag extends AbstractValidateTag {
- protected String targets;
- protected String sources;
- protected String events;
-
- public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- return new Bind(stack, req, res);
- }
-
- protected void populateParams() {
- super.populateParams();
-
- Bind bind = (Bind) component;
- bind.setTargets(targets);
- bind.setSources(sources);
- bind.setEvents(events);
- }
-
- public void setEvents(String events) {
- this.events = events;
- }
-
- public void setSources(String sources) {
- this.sources = sources;
- }
-
- public void setTargets(String targets) {
- this.targets = targets;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/DateTimePickerTag.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/DateTimePickerTag.java
deleted file mode 100644
index 9d3c1f6be..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/DateTimePickerTag.java
+++ /dev/null
@@ -1,148 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.jsp.ui;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.DateTimePicker;
-import org.apache.struts2.views.jsp.ui.AbstractUITag;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see DateTimePicker
- */
-public class DateTimePickerTag extends AbstractUITag {
-
- private static final long serialVersionUID = 4054114507143447232L;
-
- protected String displayWeeks;
- protected String adjustWeeks;
- protected String startDate;
- protected String endDate;
- protected String weekStartsOn;
- protected String staticDisplay;
- protected String dayWidth;
- protected String language;
-
- protected String iconPath;
- protected String formatLength;
- protected String displayFormat;
- protected String toggleType;
- protected String toggleDuration;
- protected String type;
- protected String templateCssPath;
- protected String valueNotifyTopics;
-
- public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- return new DateTimePicker(stack, req, res);
- }
-
- protected void populateParams() {
- super.populateParams();
-
- final DateTimePicker dateTimePicker = (DateTimePicker) component;
- dateTimePicker.setAdjustWeeks(adjustWeeks);
- dateTimePicker.setDayWidth(dayWidth);
- dateTimePicker.setDisplayWeeks(displayWeeks);
- dateTimePicker.setEndDate(endDate);
- dateTimePicker.setStartDate(startDate);
- dateTimePicker.setStaticDisplay(staticDisplay);
- dateTimePicker.setWeekStartsOn(weekStartsOn);
- dateTimePicker.setLanguage(language);
- dateTimePicker.setIconPath(iconPath);
- dateTimePicker.setFormatLength(formatLength);
- dateTimePicker.setDisplayFormat(displayFormat);
- dateTimePicker.setToggleType(toggleType);
- dateTimePicker.setToggleDuration(toggleDuration);
- dateTimePicker.setType(type);
- dateTimePicker.setTemplateCssPath(templateCssPath);
- dateTimePicker.setValueNotifyTopics(valueNotifyTopics);
- dateTimePicker.setDisabled(disabled);
- }
-
- public void setAdjustWeeks(String adjustWeeks) {
- this.adjustWeeks = adjustWeeks;
- }
-
- public void setDayWidth(String dayWidth) {
- this.dayWidth = dayWidth;
- }
-
- public void setDisplayWeeks(String displayWeeks) {
- this.displayWeeks = displayWeeks;
- }
-
- public void setEndDate(String endDate) {
- this.endDate = endDate;
- }
-
- public void setStartDate(String startDate) {
- this.startDate = startDate;
- }
-
- public void setStaticDisplay(String staticDisplay) {
- this.staticDisplay = staticDisplay;
- }
-
- public void setWeekStartsOn(String weekStartsOn) {
- this.weekStartsOn = weekStartsOn;
- }
-
- public void setLanguage(String language) {
- this.language = language;
- }
-
- public void setDisplayFormat(String displayFormat) {
- this.displayFormat = displayFormat;
- }
-
- public void setFormatLength(String formatLength) {
- this.formatLength = formatLength;
- }
-
- public void setIconPath(String iconPath) {
- this.iconPath = iconPath;
- }
-
- public void setToggleDuration(String toggleDuration) {
- this.toggleDuration = toggleDuration;
- }
-
- public void setToggleType(String toggleType) {
- this.toggleType = toggleType;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public void setTemplateCssPath(String templateCssPath) {
- this.templateCssPath = templateCssPath;
- }
-
- public void setValueNotifyTopics(String valueNotifyTopics) {
- this.valueNotifyTopics = valueNotifyTopics;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/DivTag.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/DivTag.java
deleted file mode 100644
index 81244fb2b..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/DivTag.java
+++ /dev/null
@@ -1,100 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.jsp.ui;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.Div;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-public class DivTag extends AbstractRemoteTag {
-
- private static final long serialVersionUID = 5309231035916461758L;
-
- protected String updateFreq;
- protected String autoStart;
- protected String delay;
- protected String startTimerListenTopics;
- protected String stopTimerListenTopics;
- protected String refreshOnShow;
- protected String separateScripts;
- protected String closable;
- protected String preload;
-
- public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- return new Div(stack, req, res);
- }
-
- protected void populateParams() {
- super.populateParams();
-
- Div div = (Div) component;
- div.setUpdateFreq(updateFreq);
- div.setAutoStart(autoStart);
- div.setDelay(delay);
- div.setStartTimerListenTopics(startTimerListenTopics);
- div.setStopTimerListenTopics(stopTimerListenTopics);
- div.setRefreshOnShow(refreshOnShow);
- div.setSeparateScripts(separateScripts);
- div.setClosable(closable);
- div.setPreload(preload);
- }
-
- public void setAutoStart(String autoStart) {
- this.autoStart = autoStart;
- }
-
- public void setDelay(String delay) {
- this.delay = delay;
- }
-
- public void setUpdateFreq(String updateInterval) {
- this.updateFreq = updateInterval;
- }
-
- public void setStartTimerListenTopics(String startTimerListenTopic) {
- this.startTimerListenTopics = startTimerListenTopic;
- }
-
- public void setStopTimerListenTopics(String stopTimerListenTopic) {
- this.stopTimerListenTopics = stopTimerListenTopic;
- }
-
- public void setRefreshOnShow(String refreshOnShow) {
- this.refreshOnShow = refreshOnShow;
- }
-
- public void setSeparateScripts(String separateScripts) {
- this.separateScripts = separateScripts;
- }
-
- public void setClosable(String closable) {
- this.closable = closable;
- }
-
- public void setPreload(String preload) {
- this.preload = preload;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/HeadTag.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/HeadTag.java
deleted file mode 100644
index 05a7a8186..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/HeadTag.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.jsp.ui;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.Head;
-import org.apache.struts2.views.jsp.ui.AbstractUITag;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see Head
- */
-public class HeadTag extends AbstractUITag {
-
- private static final long serialVersionUID = 6876765769175246030L;
-
- private String debug;
- private String compressed;
- private String baseRelativePath;
- private String extraLocales;
- private String locale;
- private String cache;
- private String parseContent;
-
- public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- return new Head(stack, req, res);
- }
-
- protected void populateParams() {
- super.populateParams();
-
- Head head = (Head) component;
- head.setDebug(debug);
- head.setCompressed(compressed);
- head.setBaseRelativePath(baseRelativePath);
- head.setExtraLocales(extraLocales);
- head.setLocale(locale);
- head.setCache(cache);
- head.setParseContent(parseContent);
- }
-
- public void setDebug(String debug) {
- this.debug = debug;
- }
-
- public void setBaseRelativePath(String baseRelativePath) {
- this.baseRelativePath = baseRelativePath;
- }
-
- public void setCompressed(String compressed) {
- this.compressed = compressed;
- }
-
- public void setExtraLocales(String extraLocales) {
- this.extraLocales = extraLocales;
- }
-
- public void setLocale(String locale) {
- this.locale = locale;
- }
-
- public void setCache(String cache) {
- this.cache = cache;
- }
-
- public void setParseContent(String parseContent) {
- this.parseContent = parseContent;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/SubmitTag.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/SubmitTag.java
deleted file mode 100644
index f29b86a29..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/SubmitTag.java
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.jsp.ui;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.Submit;
-import org.apache.struts2.views.jsp.ui.AbstractUITag;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see Submit
- */
-public class SubmitTag extends AbstractUITag {
-
- private static final long serialVersionUID = 2179281109958301343L;
-
- protected String method;
- protected String align;
- protected String type;
- protected String href;
- protected String listenTopics;
- protected String notifyTopics;
- protected String loadingText;
- protected String errorText;
- protected String executeScripts;
- protected String handler;
- protected String formId;
- protected String formFilter;
- protected String src;
- protected String showErrorTransportText;
- protected String indicator;
- protected String showLoadingText;
- protected String targets;
- protected String beforeNotifyTopics;
- protected String afterNotifyTopics;
- protected String errorNotifyTopics;
- protected String highlightColor;
- protected String highlightDuration;
- protected String validate;
- protected String ajaxAfterValidation;
- protected String separateScripts;
- protected String transport;
- protected String parseContent;
-
- public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- return new Submit(stack, req, res);
- }
-
- protected void populateParams() {
- super.populateParams();
-
- Submit submit = ((Submit) component);
- submit.setMethod(method);
- submit.setAlign(align);
- submit.setType(type);
- submit.setHref(href);
- submit.setListenTopics(listenTopics);
- submit.setLoadingText(loadingText);
- submit.setErrorText(errorText);
- submit.setExecuteScripts(executeScripts);
- submit.setHandler(handler);
- submit.setFormFilter(formFilter);
- submit.setFormId(formId);
- submit.setSrc(src);
- submit.setTargets(targets);
- submit.setNotifyTopics(notifyTopics);
- submit.setShowErrorTransportText(showErrorTransportText);
- submit.setIndicator(indicator);
- submit.setShowLoadingText(showLoadingText);
- submit.setAfterNotifyTopics(afterNotifyTopics);
- submit.setBeforeNotifyTopics(beforeNotifyTopics);
- submit.setErrorNotifyTopics(errorNotifyTopics);
- submit.setHighlightColor(highlightColor);
- submit.setHighlightDuration(highlightDuration);
- submit.setValidate(validate);
- submit.setAjaxAfterValidation(ajaxAfterValidation);
- submit.setSeparateScripts(separateScripts);
- submit.setTransport(transport);
- submit.setParseContent(parseContent);
- }
-
- public void setMethod(String method) {
- this.method = method;
- }
-
- public void setAlign(String align) {
- this.align = align;
- }
-
- public String getType() {
- return type;
- }
-
- public void setType(String type) {
- this.type = type;
- }
-
- public void setHref(String href) {
- this.href = href;
- }
-
- public void setErrorText(String errorText) {
- this.errorText = errorText;
- }
-
- public void setLoadingText(String loadingText) {
- this.loadingText = loadingText;
- }
-
- public void setListenTopics(String listenTopics) {
- this.listenTopics = listenTopics;
- }
-
- public void setExecuteScripts(String executeScripts) {
- this.executeScripts = executeScripts;
- }
-
- public void setHandler(String handler) {
- this.handler = handler;
- }
-
- public void setFormFilter(String formFilter) {
- this.formFilter = formFilter;
- }
-
- public void setFormId(String formId) {
- this.formId = formId;
- }
-
- public void setSrc(String src) {
- this.src = src;
- }
-
- public void setTargets(String targets) {
- this.targets = targets;
- }
-
- public void setNotifyTopics(String notifyTopics) {
- this.notifyTopics = notifyTopics;
- }
-
- public void setShowErrorTransportText(String showErrorTransportText) {
- this.showErrorTransportText = showErrorTransportText;
- }
-
- public void setIndicator(String indicator) {
- this.indicator = indicator;
- }
-
- public void setShowLoadingText(String showLoadingText) {
- this.showLoadingText = showLoadingText;
- }
-
- public void setAfterNotifyTopics(String afterNotifyTopics) {
- this.afterNotifyTopics = afterNotifyTopics;
- }
-
- public void setBeforeNotifyTopics(String beforeNotifyTopics) {
- this.beforeNotifyTopics = beforeNotifyTopics;
- }
-
- public void setErrorNotifyTopics(String errorNotifyTopics) {
- this.errorNotifyTopics = errorNotifyTopics;
- }
-
- public void setHighlightColor(String highlightColor) {
- this.highlightColor = highlightColor;
- }
-
- public void setHighlightDuration(String highlightDuration) {
- this.highlightDuration = highlightDuration;
- }
-
- public void setValidate(String validate) {
- this.validate = validate;
- }
-
- public void setAjaxAfterValidation(String ajaxAfterValidation) {
- this.ajaxAfterValidation = ajaxAfterValidation;
- }
-
- public void setSeparateScripts(String separateScripts) {
- this.separateScripts = separateScripts;
- }
-
- public void setTransport(String transport) {
- this.transport = transport;
- }
-
- public void setParseContent(String parseContent) {
- this.parseContent = parseContent;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/TabbedPanelTag.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/TabbedPanelTag.java
deleted file mode 100644
index 098b40d85..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/TabbedPanelTag.java
+++ /dev/null
@@ -1,98 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.jsp.ui;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.TabbedPanel;
-import org.apache.struts2.views.jsp.ui.AbstractClosingTag;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see TabbedPanel
- */
-public class TabbedPanelTag extends AbstractClosingTag {
-
- private static final long serialVersionUID = -4719930205515386252L;
-
- private String selectedTab;
- private String closeButton;
- private String doLayout;
- private String templateCssPath;
- private String beforeSelectTabNotifyTopics;
- private String afterSelectTabNotifyTopics;
- private String disabledTabCssClass;
- private String useSelectedTabCookie;
-
- public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- return new TabbedPanel(stack, req, res);
- }
-
- protected void populateParams() {
- super.populateParams();
- TabbedPanel tabbedPanel = (TabbedPanel) component;
- tabbedPanel.setSelectedTab(selectedTab);
- tabbedPanel.setCloseButton(closeButton);
- tabbedPanel.setDoLayout(doLayout);
- tabbedPanel.setLabelposition(labelposition);
- tabbedPanel.setTemplateCssPath(templateCssPath);
- tabbedPanel.setBeforeSelectTabNotifyTopics(beforeSelectTabNotifyTopics);
- tabbedPanel.setAfterSelectTabNotifyTopics(afterSelectTabNotifyTopics);
- tabbedPanel.setDisabledTabCssClass(disabledTabCssClass);
- tabbedPanel.setUseSelectedTabCookie(useSelectedTabCookie);
- }
-
- public void setSelectedTab(String selectedTab) {
- this.selectedTab = selectedTab;
- }
-
- public void setCloseButton(String closeButton) {
- this.closeButton = closeButton;
- }
-
- public void setDoLayout(String doLayout) {
- this.doLayout = doLayout;
- }
-
- public void setTemplateCssPath(String templateCssPath) {
- this.templateCssPath = templateCssPath;
- }
-
- public void setBeforeSelectTabNotifyTopics(String beforeSelectTabNotifyTopics) {
- this.beforeSelectTabNotifyTopics = beforeSelectTabNotifyTopics;
- }
-
- public void setAfterSelectTabNotifyTopics(String afterSelectTabNotifyTopics) {
- this.afterSelectTabNotifyTopics = afterSelectTabNotifyTopics;
- }
-
- public void setDisabledTabCssClass(String disabledTabCssClass) {
- this.disabledTabCssClass = disabledTabCssClass;
- }
-
- public void setUseSelectedTabCookie( String useSelectedTabCookie ) {
- this.useSelectedTabCookie = useSelectedTabCookie;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/TextareaTag.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/TextareaTag.java
deleted file mode 100644
index 437ebd1fa..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/TextareaTag.java
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.jsp.ui;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.TextArea;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-
-/**
- * @see TextArea
- *
- */
-public class TextareaTag extends org.apache.struts2.views.jsp.ui.TextareaTag{
- public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- return new TextArea(stack, req, res);
- }
-
- protected void populateParams() {
- super.populateParams();
-
- TextArea textArea = ((TextArea) component);
- textArea.setCols(cols);
- textArea.setReadonly(readonly);
- textArea.setRows(rows);
- textArea.setWrap(wrap);
- }
-
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/TreeNodeTag.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/TreeNodeTag.java
deleted file mode 100644
index 291a2d442..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/TreeNodeTag.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.jsp.ui;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.TreeNode;
-import org.apache.struts2.views.jsp.ui.AbstractClosingTag;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see TreeNode
- */
-public class TreeNodeTag extends AbstractClosingTag {
-
- private static final long serialVersionUID = 7340746943017900803L;
-
-
- public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- return new TreeNode(stack,req,res);
- }
-
- public void setLabel(String label) {
- this.label = label;
- }
-
- // NOTE: not necessary, label property is inherited, will be populated
- // by super-class
- /*protected void populateParams() {
- if (label != null) {
- TreeNode treeNode = (TreeNode)component;
- treeNode.setLabel(label);
- }
- super.populateParams();
- }*/
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/TreeTag.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/TreeTag.java
deleted file mode 100644
index 79fef3956..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/jsp/ui/TreeTag.java
+++ /dev/null
@@ -1,298 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.jsp.ui;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.Tree;
-import org.apache.struts2.views.jsp.ui.AbstractClosingTag;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see Tree
- */
-public class TreeTag extends AbstractClosingTag {
-
- private static final long serialVersionUID = 2735218501058548013L;
-
- protected String toggle;
- protected String selectedNotifyTopics;
- protected String expandedNotifyTopics;
- protected String collapsedNotifyTopics;
- protected String rootNode;
- protected String childCollectionProperty;
- protected String nodeTitleProperty;
- protected String nodeIdProperty;
- protected String showRootGrid;
-
- protected String showGrid;
- protected String blankIconSrc;
- protected String gridIconSrcL;
- protected String gridIconSrcV;
- protected String gridIconSrcP;
- protected String gridIconSrcC;
- protected String gridIconSrcX;
- protected String gridIconSrcY;
- protected String expandIconSrcPlus;
- protected String expandIconSrcMinus;
- protected String iconWidth;
- protected String iconHeight;
- protected String toggleDuration;
- protected String templateCssPath;
- protected String href;
- protected String errorNotifyTopics;
-
- public Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- return new Tree(stack,req,res);
- }
-
- protected void populateParams() {
- super.populateParams();
-
- Tree tree = (Tree) component;
- tree.setChildCollectionProperty(childCollectionProperty);
- tree.setNodeIdProperty(nodeIdProperty);
- tree.setNodeTitleProperty(nodeTitleProperty);
- tree.setRootNode(rootNode);
- tree.setToggle(toggle);
- tree.setSelectedNotifyTopics(selectedNotifyTopics);
- tree.setExpandedNotifyTopics(expandedNotifyTopics);
- tree.setCollapsedNotifyTopics(collapsedNotifyTopics);
- tree.setShowRootGrid(showRootGrid);
-
- tree.setShowGrid(showGrid);
- tree.setBlankIconSrc(blankIconSrc);
- tree.setGridIconSrcL(gridIconSrcC);
- tree.setGridIconSrcV(gridIconSrcV);
- tree.setGridIconSrcP(gridIconSrcP);
- tree.setGridIconSrcC(gridIconSrcC);
- tree.setGridIconSrcX(gridIconSrcX);
- tree.setGridIconSrcY(gridIconSrcY);
- tree.setExpandIconSrcPlus(expandIconSrcPlus);
- tree.setExpandIconSrcMinus(expandIconSrcMinus);
- tree.setIconWidth(iconWidth);
- tree.setIconHeight(iconHeight);
- tree.setToggleDuration(toggleDuration);
- tree.setTemplateCssPath(templateCssPath);
- tree.setHref(href);
- tree.setErrorNotifyTopics(errorNotifyTopics);
- }
-
- public String getToggle() {
- return toggle;
- }
-
- public void setToggle(String toggle) {
- this.toggle = toggle;
- }
-
- @Deprecated
- public void setTreeSelectedTopic(String treeSelectedTopic) {
- this.selectedNotifyTopics = treeSelectedTopic;
- }
-
- @Deprecated
- public void setTreeExpandedTopic(String treeExpandedTopic) {
- this.expandedNotifyTopics = treeExpandedTopic;
- }
-
- @Deprecated
- public void setTreeCollapsedTopic(String treeCollapsedTopic) {
- this.collapsedNotifyTopics = treeCollapsedTopic;
- }
-
- public String getRootNode() {
- return rootNode;
- }
-
- public void setRootNode(String rootNode) {
- this.rootNode = rootNode;
- }
-
- public String getChildCollectionProperty() {
- return childCollectionProperty;
- }
-
- public void setChildCollectionProperty(String childCollectionProperty) {
- this.childCollectionProperty = childCollectionProperty;
- }
-
- public String getNodeTitleProperty() {
- return nodeTitleProperty;
- }
-
- public void setNodeTitleProperty(String nodeTitleProperty) {
- this.nodeTitleProperty = nodeTitleProperty;
- }
-
- public String getNodeIdProperty() {
- return nodeIdProperty;
- }
-
- public void setNodeIdProperty(String nodeIdProperty) {
- this.nodeIdProperty = nodeIdProperty;
- }
-
- public String getShowRootGrid() {
- return showRootGrid;
- }
-
- public void setShowRootGrid(String showRootGrid) {
- this.showRootGrid = showRootGrid;
- }
-
- public String getBlankIconSrc() {
- return blankIconSrc;
- }
-
- public void setBlankIconSrc(String blankIconSrc) {
- this.blankIconSrc = blankIconSrc;
- }
-
- public String getExpandIconSrcMinus() {
- return expandIconSrcMinus;
- }
-
- public void setExpandIconSrcMinus(String expandIconSrcMinus) {
- this.expandIconSrcMinus = expandIconSrcMinus;
- }
-
- public String getExpandIconSrcPlus() {
- return expandIconSrcPlus;
- }
-
- public void setExpandIconSrcPlus(String expandIconSrcPlus) {
- this.expandIconSrcPlus = expandIconSrcPlus;
- }
-
- public String getGridIconSrcC() {
- return gridIconSrcC;
- }
-
- public void setGridIconSrcC(String gridIconSrcC) {
- this.gridIconSrcC = gridIconSrcC;
- }
-
- public String getGridIconSrcL() {
- return gridIconSrcL;
- }
-
- public void setGridIconSrcL(String gridIconSrcL) {
- this.gridIconSrcL = gridIconSrcL;
- }
-
- public String getGridIconSrcP() {
- return gridIconSrcP;
- }
-
- public void setGridIconSrcP(String gridIconSrcP) {
- this.gridIconSrcP = gridIconSrcP;
- }
-
- public String getGridIconSrcV() {
- return gridIconSrcV;
- }
-
- public void setGridIconSrcV(String gridIconSrcV) {
- this.gridIconSrcV = gridIconSrcV;
- }
-
- public String getGridIconSrcX() {
- return gridIconSrcX;
- }
-
- public void setGridIconSrcX(String gridIconSrcX) {
- this.gridIconSrcX = gridIconSrcX;
- }
-
- public String getGridIconSrcY() {
- return gridIconSrcY;
- }
-
- public void setGridIconSrcY(String gridIconSrcY) {
- this.gridIconSrcY = gridIconSrcY;
- }
-
- public String getIconHeight() {
- return iconHeight;
- }
-
- public void setIconHeight(String iconHeight) {
- this.iconHeight = iconHeight;
- }
-
- public String getIconWidth() {
- return iconWidth;
- }
-
- public void setIconWidth(String iconWidth) {
- this.iconWidth = iconWidth;
- }
-
- public String getTemplateCssPath() {
- return templateCssPath;
- }
-
- public void setTemplateCssPath(String templateCssPath) {
- this.templateCssPath = templateCssPath;
- }
-
- public String getToggleDuration() {
- return toggleDuration;
- }
-
- public void setToggleDuration(String toggleDuration) {
- this.toggleDuration = toggleDuration;
- }
-
- public String getShowGrid() {
- return showGrid;
- }
-
- public void setShowGrid(String showGrid) {
- this.showGrid = showGrid;
- }
-
- public void setCollapsedNotifyTopics(String collapsedNotifyTopics) {
- this.collapsedNotifyTopics = collapsedNotifyTopics;
- }
-
- public void setExpandedNotifyTopics(String expandedNotifyTopics) {
- this.expandedNotifyTopics = expandedNotifyTopics;
- }
-
- public void setSelectedNotifyTopics(String selectedNotifyTopics) {
- this.selectedNotifyTopics = selectedNotifyTopics;
- }
-
- public void setHref(String href) {
- this.href = href;
- }
-
- public void setErrorNotifyTopics(String errorNotifyTopics) {
- this.errorNotifyTopics = errorNotifyTopics;
- }
-}
-
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/AnchorDirective.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/AnchorDirective.java
deleted file mode 100644
index deef0a340..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/AnchorDirective.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.velocity.components;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Anchor;
-import org.apache.struts2.components.Component;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see Anchor
- */
-public class AnchorDirective extends DojoAbstractDirective {
- public String getBeanName() {
- return "a";
- }
-
- protected Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- return new Anchor(stack, req, res);
- }
-
- public int getType() {
- return BLOCK;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/AutocompleterDirective.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/AutocompleterDirective.java
deleted file mode 100644
index 4297ec9cf..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/AutocompleterDirective.java
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.velocity.components;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.Autocompleter;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see Autocompleter
- */
-public class AutocompleterDirective extends DojoAbstractDirective {
-
- protected Component getBean(ValueStack stack, HttpServletRequest req,
- HttpServletResponse res) {
- return new Autocompleter(stack, req, res);
- }
-
- public String getBeanName() {
- return "autocompleter";
- }
-
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/BindDirective.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/BindDirective.java
deleted file mode 100644
index 0c774c10f..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/BindDirective.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.velocity.components;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.Bind;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see Bind
- */
-public class BindDirective extends DojoAbstractDirective {
- public String getBeanName() {
- return "bind";
- }
-
- protected Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- return new Bind(stack, req, res);
- }
-}
\ No newline at end of file
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/DateTimePickerDirective.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/DateTimePickerDirective.java
deleted file mode 100644
index 06a5bad1f..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/DateTimePickerDirective.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.velocity.components;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.DateTimePicker;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see DateTimePicker
- */
-public class DateTimePickerDirective extends DojoAbstractDirective {
-
- protected Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- return new DateTimePicker(stack, req, res);
- }
-
- public String getBeanName() {
- return "datetimepicker";
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/DivDirective.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/DivDirective.java
deleted file mode 100644
index 987e236e7..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/DivDirective.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.velocity.components;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.Div;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see Div
- */
-public class DivDirective extends DojoAbstractDirective {
- public String getBeanName() {
- return "div";
- }
-
- protected Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- return new Div(stack, req, res);
- }
-
- public int getType() {
- return BLOCK;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/DojoAbstractDirective.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/DojoAbstractDirective.java
deleted file mode 100644
index fe46811ec..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/DojoAbstractDirective.java
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.velocity.components;
-
-import org.apache.struts2.views.velocity.components.AbstractDirective;
-
-/**
- * Overwrite name prefix
- *
- */
-public abstract class DojoAbstractDirective extends AbstractDirective {
- public String getName() {
- return "sx" + getBeanName();
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/HeadDirective.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/HeadDirective.java
deleted file mode 100644
index b1cd7c9b9..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/HeadDirective.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.velocity.components;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.Head;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see Head
- */
-public class HeadDirective extends DojoAbstractDirective {
- protected Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- return new Head(stack, req, res);
- }
-
- public String getBeanName() {
- return "head";
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/SubmitDirective.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/SubmitDirective.java
deleted file mode 100644
index 135639fe8..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/SubmitDirective.java
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.velocity.components;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.components.Submit;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see Submit
- */
-public class SubmitDirective extends DojoAbstractDirective {
- public String getBeanName() {
- return "submit";
- }
-
- protected Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- return new Submit(stack, req, res);
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/TabbedPanelDirective.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/TabbedPanelDirective.java
deleted file mode 100644
index ca61c4a7b..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/TabbedPanelDirective.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.velocity.components;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.TabbedPanel;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see TabbedPanel
- */
-public class TabbedPanelDirective extends DojoAbstractDirective {
- public String getBeanName() {
- return "tabbedpanel";
- }
-
- protected Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- return new TabbedPanel(stack, req, res);
- }
-
- public int getType() {
- return BLOCK;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/TextAreaDirective.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/TextAreaDirective.java
deleted file mode 100644
index b13299a39..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/TextAreaDirective.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.velocity.components;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.TextArea;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * @see TextArea
- */
-public class TextAreaDirective extends DojoAbstractDirective {
- public String getBeanName() {
- return "textarea";
- }
-
- protected Component getBean(ValueStack stack, HttpServletRequest req,
- HttpServletResponse res) {
- return new TextArea(stack, req, res);
- }
-
- public int getType() {
- return BLOCK;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/TreeDirective.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/TreeDirective.java
deleted file mode 100644
index 79dd533e1..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/TreeDirective.java
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.velocity.components;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.Tree;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * TreeDirective
- * @see Tree
- */
-public class TreeDirective extends DojoAbstractDirective {
- public String getBeanName() {
- return "tree";
- }
-
- protected Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- return new Tree(stack, req, res);
- }
-
- public int getType() {
- return BLOCK;
- }
-}
diff --git a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/TreeNodeDirective.java b/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/TreeNodeDirective.java
deleted file mode 100644
index 3a52bd332..000000000
--- a/plugins/dojo/src/main/java/org/apache/struts2/dojo/views/velocity/components/TreeNodeDirective.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package org.apache.struts2.dojo.views.velocity.components;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.struts2.components.Component;
-import org.apache.struts2.dojo.components.TreeNode;
-
-import com.opensymphony.xwork2.util.ValueStack;
-
-/**
- * TreeNodeDirective
- * @see TreeNode
- */
-public class TreeNodeDirective extends DojoAbstractDirective {
- public String getBeanName() {
- return "treenode";
- }
-
- protected Component getBean(ValueStack stack, HttpServletRequest req, HttpServletResponse res) {
- return new TreeNode(stack, req, res);
- }
-
- public int getType() {
- return BLOCK;
- }
-}
-
diff --git a/plugins/dojo/src/main/resources/META-INF/README.txt b/plugins/dojo/src/main/resources/META-INF/README.txt
deleted file mode 100644
index 71cb1b7ed..000000000
--- a/plugins/dojo/src/main/resources/META-INF/README.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-TLD file is generated inside META-INF after compilation.
-If META-INF is empty, Maven will not copy it to the "target/classes" folder.
-Please do not remove META-INF, or this file.
\ No newline at end of file
diff --git a/plugins/dojo/src/main/resources/NOTICE.txt b/plugins/dojo/src/main/resources/NOTICE.txt
deleted file mode 100644
index 740b77fe3..000000000
--- a/plugins/dojo/src/main/resources/NOTICE.txt
+++ /dev/null
@@ -1,6 +0,0 @@
-Apache Struts
-Copyright 2000-2011 The Apache Software Foundation
-
-This product includes software developed by
-The Apache Software Foundation (http://www.apache.org/).
-Dojo (http://dojotoolkit.org/).
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/TabbedPanel.css b/plugins/dojo/src/main/resources/org/apache/struts2/static/TabbedPanel.css
deleted file mode 100644
index e93a8e861..000000000
--- a/plugins/dojo/src/main/resources/org/apache/struts2/static/TabbedPanel.css
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * $Id$
- *
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-.strutsDisabledTab div span {
- font-style: italic;
- color: #7986A1
-}
\ No newline at end of file
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/LICENSE b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/LICENSE
deleted file mode 100644
index 225d20c79..000000000
--- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/LICENSE
+++ /dev/null
@@ -1,195 +0,0 @@
-Dojo is availble under *either* the terms of the modified BSD license *or* the
-Academic Free License version 2.1. As a recipient of Dojo, you may choose which
-license to receive this code under (except as noted in per-module LICENSE
-files). Some modules may not be the copyright of the Dojo Foundation. These
-modules contain explicit declarations of copyright in both the LICENSE files in
-the directories in which they reside and in the code itself. No external
-contributions are allowed under licenses which are fundamentally incompatible
-with the AFL or BSD licenses that Dojo is distributed under.
-
-The text of the AFL and BSD licenses is reproduced below.
-
--------------------------------------------------------------------------------
-The "New" BSD License:
-**********************
-
-Copyright (c) 2005-2006, The Dojo Foundation
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
- * Neither the name of the Dojo Foundation nor the names of its contributors
- may be used to endorse or promote products derived from this software
- without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
-ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
-WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-
--------------------------------------------------------------------------------
-The Academic Free License, v. 2.1:
-**********************************
-
-This Academic Free License (the "License") applies to any original work of
-authorship (the "Original Work") whose owner (the "Licensor") has placed the
-following notice immediately following the copyright notice for the Original
-Work:
-
-Licensed under the Academic Free License version 2.1
-
-1) Grant of Copyright License. Licensor hereby grants You a world-wide,
-royalty-free, non-exclusive, perpetual, sublicenseable license to do the
-following:
-
-a) to reproduce the Original Work in copies;
-
-b) to prepare derivative works ("Derivative Works") based upon the Original
-Work;
-
-c) to distribute copies of the Original Work and Derivative Works to the
-public;
-
-d) to perform the Original Work publicly; and
-
-e) to display the Original Work publicly.
-
-2) Grant of Patent License. Licensor hereby grants You a world-wide,
-royalty-free, non-exclusive, perpetual, sublicenseable license, under patent
-claims owned or controlled by the Licensor that are embodied in the Original
-Work as furnished by the Licensor, to make, use, sell and offer for sale the
-Original Work and Derivative Works.
-
-3) Grant of Source Code License. The term "Source Code" means the preferred
-form of the Original Work for making modifications to it and all available
-documentation describing how to modify the Original Work. Licensor hereby
-agrees to provide a machine-readable copy of the Source Code of the Original
-Work along with each copy of the Original Work that Licensor distributes.
-Licensor reserves the right to satisfy this obligation by placing a
-machine-readable copy of the Source Code in an information repository
-reasonably calculated to permit inexpensive and convenient access by You for as
-long as Licensor continues to distribute the Original Work, and by publishing
-the address of that information repository in a notice immediately following
-the copyright notice that applies to the Original Work.
-
-4) Exclusions From License Grant. Neither the names of Licensor, nor the names
-of any contributors to the Original Work, nor any of their trademarks or
-service marks, may be used to endorse or promote products derived from this
-Original Work without express prior written permission of the Licensor. Nothing
-in this License shall be deemed to grant any rights to trademarks, copyrights,
-patents, trade secrets or any other intellectual property of Licensor except as
-expressly stated herein. No patent license is granted to make, use, sell or
-offer to sell embodiments of any patent claims other than the licensed claims
-defined in Section 2. No right is granted to the trademarks of Licensor even if
-such marks are included in the Original Work. Nothing in this License shall be
-interpreted to prohibit Licensor from licensing under different terms from this
-License any Original Work that Licensor otherwise would have a right to
-license.
-
-5) This section intentionally omitted.
-
-6) Attribution Rights. You must retain, in the Source Code of any Derivative
-Works that You create, all copyright, patent or trademark notices from the
-Source Code of the Original Work, as well as any notices of licensing and any
-descriptive text identified therein as an "Attribution Notice." You must cause
-the Source Code for any Derivative Works that You create to carry a prominent
-Attribution Notice reasonably calculated to inform recipients that You have
-modified the Original Work.
-
-7) Warranty of Provenance and Disclaimer of Warranty. Licensor warrants that
-the copyright in and to the Original Work and the patent rights granted herein
-by Licensor are owned by the Licensor or are sublicensed to You under the terms
-of this License with the permission of the contributor(s) of those copyrights
-and patent rights. Except as expressly stated in the immediately proceeding
-sentence, the Original Work is provided under this License on an "AS IS" BASIS
-and WITHOUT WARRANTY, either express or implied, including, without limitation,
-the warranties of NON-INFRINGEMENT, MERCHANTABILITY or FITNESS FOR A PARTICULAR
-PURPOSE. THE ENTIRE RISK AS TO THE QUALITY OF THE ORIGINAL WORK IS WITH YOU.
-This DISCLAIMER OF WARRANTY constitutes an essential part of this License. No
-license to Original Work is granted hereunder except under this disclaimer.
-
-8) Limitation of Liability. Under no circumstances and under no legal theory,
-whether in tort (including negligence), contract, or otherwise, shall the
-Licensor be liable to any person for any direct, indirect, special, incidental,
-or consequential damages of any character arising as a result of this License
-or the use of the Original Work including, without limitation, damages for loss
-of goodwill, work stoppage, computer failure or malfunction, or any and all
-other commercial damages or losses. This limitation of liability shall not
-apply to liability for death or personal injury resulting from Licensor's
-negligence to the extent applicable law prohibits such limitation. Some
-jurisdictions do not allow the exclusion or limitation of incidental or
-consequential damages, so this exclusion and limitation may not apply to You.
-
-9) Acceptance and Termination. If You distribute copies of the Original Work or
-a Derivative Work, You must make a reasonable effort under the circumstances to
-obtain the express assent of recipients to the terms of this License. Nothing
-else but this License (or another written agreement between Licensor and You)
-grants You permission to create Derivative Works based upon the Original Work
-or to exercise any of the rights granted in Section 1 herein, and any attempt
-to do so except under the terms of this License (or another written agreement
-between Licensor and You) is expressly prohibited by U.S. copyright law, the
-equivalent laws of other countries, and by international treaty. Therefore, by
-exercising any of the rights granted to You in Section 1 herein, You indicate
-Your acceptance of this License and all of its terms and conditions.
-
-10) Termination for Patent Action. This License shall terminate automatically
-and You may no longer exercise any of the rights granted to You by this License
-as of the date You commence an action, including a cross-claim or counterclaim,
-against Licensor or any licensee alleging that the Original Work infringes a
-patent. This termination provision shall not apply for an action alleging
-patent infringement by combinations of the Original Work with other software or
-hardware.
-
-11) Jurisdiction, Venue and Governing Law. Any action or suit relating to this
-License may be brought only in the courts of a jurisdiction wherein the
-Licensor resides or in which Licensor conducts its primary business, and under
-the laws of that jurisdiction excluding its conflict-of-law provisions. The
-application of the United Nations Convention on Contracts for the International
-Sale of Goods is expressly excluded. Any use of the Original Work outside the
-scope of this License or after its termination shall be subject to the
-requirements and penalties of the U.S. Copyright Act, 17 U.S.C. § 101 et
-seq., the equivalent laws of other countries, and international treaty. This
-section shall survive the termination of this License.
-
-12) Attorneys Fees. In any action to enforce the terms of this License or
-seeking damages relating thereto, the prevailing party shall be entitled to
-recover its costs and expenses, including, without limitation, reasonable
-attorneys' fees and costs incurred in connection with such action, including
-any appeal of such action. This section shall survive the termination of this
-License.
-
-13) Miscellaneous. This License represents the complete agreement concerning
-the subject matter hereof. If any provision of this License is held to be
-unenforceable, such provision shall be reformed only to the extent necessary to
-make it enforceable.
-
-14) Definition of "You" in This License. "You" throughout this License, whether
-in upper or lower case, means an individual or a legal entity exercising rights
-under, and complying with all of the terms of, this License. For legal
-entities, "You" includes any entity that controls, is controlled by, or is
-under common control with you. For purposes of this definition, "control" means
-(i) the power, direct or indirect, to cause the direction or management of such
-entity, whether by contract or otherwise, or (ii) ownership of fifty percent
-(50%) or more of the outstanding shares, or (iii) beneficial ownership of such
-entity.
-
-15) Right to Use. You may use the Original Work in all ways not otherwise
-restricted or conditioned by this License or by law, and Licensor promises not
-to interfere with or be responsible for such uses by You.
-
-This license is Copyright (C) 2003-2004 Lawrence E. Rosen. All rights reserved.
-Permission is hereby granted to copy and distribute this license without
-modification. This license may not be modified without the express written
-permission of its copyright owner.
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/README b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/README
deleted file mode 100644
index 2bb84eaf2..000000000
--- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/README
+++ /dev/null
@@ -1,176 +0,0 @@
-The Dojo Toolkit
-----------------
-
-Dojo is a portable JavaScript toolkit for web application developers and
-JavaScript professionals. Dojo solves real-world problems by providing powerful
-abstractions and solid, tested implementations.
-
-Getting Started
----------------
-
-To use Dojo in your application, download one of the pre-built editions from the
-Dojo website, http://dojotoolkit.org. Once you have downloaded the file you will
-need to unzip the archive in your website root. At a minimum, you will need to
-extract:
-
- src/ (folder)
- dojo.js
- iframe_history.html
-
-To begin using dojo, include dojo in your pages by using:
-
-
-
-Depending on the edition that you have downloaded, this base dojo.js file may or
-may not include the modules you wish to use in your application. The files which
-have been "baked in" to the dojo.js that is part of your distribution are listed
-in the file build.txt that is part of the top-level directory that is created
-when you unpack the archive. To ensure modules you wish to use are available,
-use dojo.require() to request them. A very rich application might include:
-
-
-
-
-Note that only those modules which are *not* already "baked in" to dojo.js by
-the edition's build process are requested by dojo.require(). This helps make
-your application faster without forcing you to use a build tool while in
-development. See "Building Dojo" and "Working From Source" for more details.
-
-
-Compatibility
--------------
-
-In addition to it's suite of unit-tests for core system components, Dojo has
-been tested on almost every modern browser, including:
-
- - IE 5.5+
- - Mozilla 1.5+, Firefox 1.0+
- - Safari 1.3.9+
- - Konqueror 3.4+
- - Opera 8.5+
-
-Note that some widgets and features may not perform exactly the same on every
-browser due to browser implementation differences.
-
-For those looking to use Dojo in non-browser environments, please see "Working
-From Source".
-
-
-Documentation and Getting Help
-------------------------------
-
-Articles outlining major Dojo systems are linked from:
-
- http://dojotoolkit.org/docs/
-
-Toolkit APIs are listed in outline form at:
-
- http://dojotoolkit.org/docs/apis/
-
-And documented in full at:
-
- http://manual.dojotoolkit.org/
-
-The project also maintains a JotSpot Wiki at:
-
- http://dojo.jot.com/
-
-A FAQ has been extracted from mailing list traffic:
-
- http://dojo.jot.com/FAQ
-
-And the main Dojo user mailing list is archived and made searchable at:
-
- http://news.gmane.org/gmane.comp.web.dojo.user/
-
-You can sign up for this list, which is a great place to ask questions, at:
-
- http://dojotoolkit.org/mailman/listinfo/dojo-interest
-
-The Dojo developers also tend to hang out in IRC and help people with Dojo
-problems. You're most likely to find them at:
-
- irc.freenode.net #dojo
-
-Note that 3PM Wed PST in #dojo-meeting is reserved for a weekly meeting between
-project developers, although anyone is welcome to participate.
-
-
-Working From Source
--------------------
-
-The core of Dojo is a powerful package system that allows developers to optimize
-Dojo for deployment while using *exactly the same* application code in
-development. Therefore, working from source is almost exactly like working from
-a pre-built edition. Pre-built editions are significantly faster to load than
-working from source, but are not as flexible when in development.
-
-There are multiple ways to get the source. Nightly snapshots of the Dojo source
-repository are available at:
-
- http://archive.dojotoolkit.org/nightly.tgz
-
-Anonymous Subversion access is also available:
-
- %> svn co http://svn.dojotoolkit.org/dojo/trunk/ dojo
-
-Each of these sources will include some extra directories not included in the
-pre-packaged editions, including command-line tests and build tools for
-constructing your own packages.
-
-Running the command-line unit test suite requires Ant 1.6. If it is installed
-and in your path, you can run the tests using:
-
- %> cd buildscripts
- %> ant test
-
-The command-line test harness makes use of Rhino, a JavaScript interpreter
-written in Java. Once you have a copy of Dojo's source tree, you have a copy of
-Rhino. From the root directory, you can use Rhino interactively to load Dojo:
-
- %> java -jar buildscripts/lib/js.jar
- Rhino 1.5 release 3 2002 01 27
- js> load("dojo.js");
- js> print(dojo);
- [object Object]
- js> quit();
-
-This environment is wonderful for testing raw JavaScript functionality in, or
-even for scripting your system. Since Rhino has full access to anything in
-Java's classpath, the sky is the limit!
-
-Building Dojo
--------------
-
-Dojo requires Ant 1.6.x in order to build correctly. While using Dojo from
-source does *NOT* require that you make a build, speeding up your application by
-constructing a custom profile build does.
-
-Once you have Ant and a source snapshot of Dojo, you can make your own profile
-build ("edition") which includes only those modules your application uses by
-customizing one of the files in:
-
- [dojo]/buildscripts/profiles/
-
-These files are named *.profile.js and each one contains a list of modules to
-include in a build. If we created a new profile called "test.profile.js", we
-could then make a profile build using it by doing:
-
- %> cd buildscripts
- %> ant -Dprofile=test -Ddocless=true release intern-strings
-
-If the build is successful, your newly minted and compressed profile build will
-be placed in [dojo]/release/dojo/
-
--------------------------------------------------------------------------------
-Copyright (c) 2004-2006, The Dojo Foundation, All Rights Reserved
-
-vim:ts=4:et:tw=80:shiftwidth=4:
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/Storage_version6.swf b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/Storage_version6.swf
deleted file mode 100644
index c97b14c92..000000000
Binary files a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/Storage_version6.swf and /dev/null differ
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/Storage_version8.swf b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/Storage_version8.swf
deleted file mode 100644
index 449da952b..000000000
Binary files a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/Storage_version8.swf and /dev/null differ
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/build.txt b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/build.txt
deleted file mode 100644
index e5fcdd4c1..000000000
--- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/build.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-Files baked into this build:
-
-dojo.js:
-dojoGuardStart.js
-../src/bootstrap1.js
-../src/loader.js
-dojoGuardEnd.js
-../src/hostenv_browser.js
-../src/string/common.js
-../src/string.js
-../src/lang/common.js
-../src/lang/extras.js
-../src/io/common.js
-../src/lang/array.js
-../src/lang/func.js
-../src/string/extras.js
-../src/dom.js
-../src/undo/browser.js
-../src/io/BrowserIO.js
-../src/io/cookie.js
-../src/io/__package__.js
-../src/event/common.js
-../src/event/topic.js
-../src/event/browser.js
-../src/event/__package__.js
-../src/gfx/color.js
-../src/lfx/Animation.js
-../src/html/common.js
-../src/uri/Uri.js
-../src/html/style.js
-../src/html/display.js
-../src/html/color.js
-../src/html/layout.js
-../src/lfx/html.js
-../src/lfx/__package__.js
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/dojo.js b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/dojo.js
deleted file mode 100644
index 862371a85..000000000
--- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/dojo.js
+++ /dev/null
@@ -1,6441 +0,0 @@
-/*
- Copyright (c) 2004-2006, The Dojo Foundation
- All Rights Reserved.
-
- Licensed under the Academic Free License version 2.1 or above OR the
- modified BSD license. For more information on Dojo licensing, see:
-
- http://dojotoolkit.org/community/licensing.shtml
-*/
-
-/*
- This is a compiled version of Dojo, built for deployment and not for
- development. To get an editable version, please visit:
-
- http://dojotoolkit.org
-
- for documentation and information on getting the source.
-*/
-
-if(typeof dojo=="undefined"){
-var dj_global=this;
-var dj_currentContext=this;
-function dj_undef(_1,_2){
-return (typeof (_2||dj_currentContext)[_1]=="undefined");
-}
-if(dj_undef("djConfig",this)){
-var djConfig={};
-}
-if(dj_undef("dojo",this)){
-var dojo={};
-}
-dojo.global=function(){
-return dj_currentContext;
-};
-dojo.locale=djConfig.locale;
-dojo.version={major:0,minor:4,patch:3,flag:"",revision:Number("$Rev$".match(/[0-9]+/)[0]),toString:function(){
-with(dojo.version){
-return major+"."+minor+"."+patch+flag+" ("+revision+")";
-}
-}};
-dojo.evalProp=function(_3,_4,_5){
-if((!_4)||(!_3)){
-return undefined;
-}
-if(!dj_undef(_3,_4)){
-return _4[_3];
-}
-return (_5?(_4[_3]={}):undefined);
-};
-dojo.parseObjPath=function(_6,_7,_8){
-var _9=(_7||dojo.global());
-var _a=_6.split(".");
-var _b=_a.pop();
-for(var i=0,l=_a.length;i1){
-dh.modulesLoadedListeners.push(function(){
-obj[_3d]();
-});
-}
-}
-if(dh.post_load_&&dh.inFlightCount==0&&!dh.loadNotifying){
-dh.callLoaded();
-}
-};
-dojo.addOnUnload=function(obj,_40){
-var dh=dojo.hostenv;
-if(arguments.length==1){
-dh.unloadListeners.push(obj);
-}else{
-if(arguments.length>1){
-dh.unloadListeners.push(function(){
-obj[_40]();
-});
-}
-}
-};
-dojo.hostenv.modulesLoaded=function(){
-if(this.post_load_){
-return;
-}
-if(this.loadUriStack.length==0&&this.getTextStack.length==0){
-if(this.inFlightCount>0){
-dojo.debug("files still in flight!");
-return;
-}
-dojo.hostenv.callLoaded();
-}
-};
-dojo.hostenv.callLoaded=function(){
-if(typeof setTimeout=="object"||(djConfig["useXDomain"]&&dojo.render.html.opera)){
-setTimeout("dojo.hostenv.loaded();",0);
-}else{
-dojo.hostenv.loaded();
-}
-};
-dojo.hostenv.getModuleSymbols=function(_42){
-var _43=_42.split(".");
-for(var i=_43.length;i>0;i--){
-var _45=_43.slice(0,i).join(".");
-if((i==1)&&!this.moduleHasPrefix(_45)){
-_43[0]="../"+_43[0];
-}else{
-var _46=this.getModulePrefix(_45);
-if(_46!=_45){
-_43.splice(0,i,_46);
-break;
-}
-}
-}
-return _43;
-};
-dojo.hostenv._global_omit_module_check=false;
-dojo.hostenv.loadModule=function(_47,_48,_49){
-if(!_47){
-return;
-}
-_49=this._global_omit_module_check||_49;
-var _4a=this.findModule(_47,false);
-if(_4a){
-return _4a;
-}
-if(dj_undef(_47,this.loading_modules_)){
-this.addedToLoadingCount.push(_47);
-}
-this.loading_modules_[_47]=1;
-var _4b=_47.replace(/\./g,"/")+".js";
-var _4c=_47.split(".");
-var _4d=this.getModuleSymbols(_47);
-var _4e=((_4d[0].charAt(0)!="/")&&!_4d[0].match(/^\w+:/));
-var _4f=_4d[_4d.length-1];
-var ok;
-if(_4f=="*"){
-_47=_4c.slice(0,-1).join(".");
-while(_4d.length){
-_4d.pop();
-_4d.push(this.pkgFileName);
-_4b=_4d.join("/")+".js";
-if(_4e&&_4b.charAt(0)=="/"){
-_4b=_4b.slice(1);
-}
-ok=this.loadPath(_4b,!_49?_47:null);
-if(ok){
-break;
-}
-_4d.pop();
-}
-}else{
-_4b=_4d.join("/")+".js";
-_47=_4c.join(".");
-var _51=!_49?_47:null;
-ok=this.loadPath(_4b,_51);
-if(!ok&&!_48){
-_4d.pop();
-while(_4d.length){
-_4b=_4d.join("/")+".js";
-ok=this.loadPath(_4b,_51);
-if(ok){
-break;
-}
-_4d.pop();
-_4b=_4d.join("/")+"/"+this.pkgFileName+".js";
-if(_4e&&_4b.charAt(0)=="/"){
-_4b=_4b.slice(1);
-}
-ok=this.loadPath(_4b,_51);
-if(ok){
-break;
-}
-}
-}
-if(!ok&&!_49){
-dojo.raise("Could not load '"+_47+"'; last tried '"+_4b+"'");
-}
-}
-if(!_49&&!this["isXDomain"]){
-_4a=this.findModule(_47,false);
-if(!_4a){
-dojo.raise("symbol '"+_47+"' is not defined after loading '"+_4b+"'");
-}
-}
-return _4a;
-};
-dojo.hostenv.startPackage=function(_52){
-var _53=String(_52);
-var _54=_53;
-var _55=_52.split(/\./);
-if(_55[_55.length-1]=="*"){
-_55.pop();
-_54=_55.join(".");
-}
-var _56=dojo.evalObjPath(_54,true);
-this.loaded_modules_[_53]=_56;
-this.loaded_modules_[_54]=_56;
-return _56;
-};
-dojo.hostenv.findModule=function(_57,_58){
-var lmn=String(_57);
-if(this.loaded_modules_[lmn]){
-return this.loaded_modules_[lmn];
-}
-if(_58){
-dojo.raise("no loaded module named '"+_57+"'");
-}
-return null;
-};
-dojo.kwCompoundRequire=function(_5a){
-var _5b=_5a["common"]||[];
-var _5c=_5a[dojo.hostenv.name_]?_5b.concat(_5a[dojo.hostenv.name_]||[]):_5b.concat(_5a["default"]||[]);
-for(var x=0;x<_5c.length;x++){
-var _5e=_5c[x];
-if(_5e.constructor==Array){
-dojo.hostenv.loadModule.apply(dojo.hostenv,_5e);
-}else{
-dojo.hostenv.loadModule(_5e);
-}
-}
-};
-dojo.require=function(_5f){
-dojo.hostenv.loadModule.apply(dojo.hostenv,arguments);
-};
-dojo.requireIf=function(_60,_61){
-var _62=arguments[0];
-if((_62===true)||(_62=="common")||(_62&&dojo.render[_62].capable)){
-var _63=[];
-for(var i=1;i0;i--){
-_74.push(_73.slice(0,i).join("-"));
-}
-_74.push(false);
-if(_71){
-_74.reverse();
-}
-for(var j=_74.length-1;j>=0;j--){
-var loc=_74[j]||"ROOT";
-var _78=_72(loc);
-if(_78){
-break;
-}
-}
-};
-dojo.hostenv.localesGenerated;
-dojo.hostenv.registerNlsPrefix=function(){
-dojo.registerModulePath("nls","nls");
-};
-dojo.hostenv.preloadLocalizations=function(){
-if(dojo.hostenv.localesGenerated){
-dojo.hostenv.registerNlsPrefix();
-function preload(_79){
-_79=dojo.hostenv.normalizeLocale(_79);
-dojo.hostenv.searchLocalePath(_79,true,function(loc){
-for(var i=0;i_84.length){
-_84=_85[i];
-}
-}
-}
-if(!_84){
-_84="ROOT";
-}
-}
-var _87=_81?_84:_82;
-var _88=dojo.hostenv.findModule(_83);
-var _89=null;
-if(_88){
-if(djConfig.localizationComplete&&_88._built){
-return;
-}
-var _8a=_87.replace("-","_");
-var _8b=_83+"."+_8a;
-_89=dojo.hostenv.findModule(_8b);
-}
-if(!_89){
-_88=dojo.hostenv.startPackage(_83);
-var _8c=dojo.hostenv.getModuleSymbols(_7e);
-var _8d=_8c.concat("nls").join("/");
-var _8e;
-dojo.hostenv.searchLocalePath(_87,_81,function(loc){
-var _90=loc.replace("-","_");
-var _91=_83+"."+_90;
-var _92=false;
-if(!dojo.hostenv.findModule(_91)){
-dojo.hostenv.startPackage(_91);
-var _93=[_8d];
-if(loc!="ROOT"){
-_93.push(loc);
-}
-_93.push(_7f);
-var _94=_93.join("/")+".js";
-_92=dojo.hostenv.loadPath(_94,null,function(_95){
-var _96=function(){
-};
-_96.prototype=_8e;
-_88[_90]=new _96();
-for(var j in _95){
-_88[_90][j]=_95[j];
-}
-});
-}else{
-_92=true;
-}
-if(_92&&_88[_90]){
-_8e=_88[_90];
-}else{
-_88[_90]=_8e;
-}
-if(_81){
-return true;
-}
-});
-}
-if(_81&&_82!=_84){
-_88[_82.replace("-","_")]=_88[_84.replace("-","_")];
-}
-};
-(function(){
-var _98=djConfig.extraLocale;
-if(_98){
-if(!_98 instanceof Array){
-_98=[_98];
-}
-var req=dojo.requireLocalization;
-dojo.requireLocalization=function(m,b,_9c,_9d){
-req(m,b,_9c,_9d);
-if(_9c){
-return;
-}
-for(var i=0;i<_98.length;i++){
-req(m,b,_98[i],_9d);
-}
-};
-}
-})();
-}
-if(typeof window!="undefined"){
-(function(){
-if(djConfig.allowQueryConfig){
-var _9f=document.location.toString();
-var _a0=_9f.split("?",2);
-if(_a0.length>1){
-var _a1=_a0[1];
-var _a2=_a1.split("&");
-for(var x in _a2){
-var sp=_a2[x].split("=");
-if((sp[0].length>9)&&(sp[0].substr(0,9)=="djConfig.")){
-var opt=sp[0].substr(9);
-try{
-djConfig[opt]=eval(sp[1]);
-}
-catch(e){
-djConfig[opt]=sp[1];
-}
-}
-}
-}
-}
-if(((djConfig["baseScriptUri"]=="")||(djConfig["baseRelativePath"]==""))&&(document&&document.getElementsByTagName)){
-var _a6=document.getElementsByTagName("script");
-var _a7=/(__package__|dojo|bootstrap1)\.js([\?\.]|$)/i;
-for(var i=0;i<_a6.length;i++){
-var src=_a6[i].getAttribute("src");
-if(!src){
-continue;
-}
-var m=src.match(_a7);
-if(m){
-var _ab=src.substring(0,m.index);
-if(src.indexOf("bootstrap1")>-1){
-_ab+="../";
-}
-if(!this["djConfig"]){
-djConfig={};
-}
-if(djConfig["baseScriptUri"]==""){
-djConfig["baseScriptUri"]=_ab;
-}
-if(djConfig["baseRelativePath"]==""){
-djConfig["baseRelativePath"]=_ab;
-}
-break;
-}
-}
-}
-var dr=dojo.render;
-var drh=dojo.render.html;
-var drs=dojo.render.svg;
-var dua=(drh.UA=navigator.userAgent);
-var dav=(drh.AV=navigator.appVersion);
-var t=true;
-var f=false;
-drh.capable=t;
-drh.support.builtin=t;
-dr.ver=parseFloat(drh.AV);
-dr.os.mac=dav.indexOf("Macintosh")>=0;
-dr.os.win=dav.indexOf("Windows")>=0;
-dr.os.linux=dav.indexOf("X11")>=0;
-drh.opera=dua.indexOf("Opera")>=0;
-drh.khtml=(dav.indexOf("Konqueror")>=0)||(dav.indexOf("Safari")>=0);
-drh.safari=dav.indexOf("Safari")>=0;
-var _b3=dua.indexOf("Gecko");
-drh.mozilla=drh.moz=(_b3>=0)&&(!drh.khtml);
-if(drh.mozilla){
-drh.geckoVersion=dua.substring(_b3+6,_b3+14);
-}
-drh.ie=(document.all)&&(!drh.opera);
-drh.ie50=drh.ie&&dav.indexOf("MSIE 5.0")>=0;
-drh.ie55=drh.ie&&dav.indexOf("MSIE 5.5")>=0;
-drh.ie60=drh.ie&&dav.indexOf("MSIE 6.0")>=0;
-drh.ie70=drh.ie&&dav.indexOf("MSIE 7.0")>=0;
-var cm=document["compatMode"];
-drh.quirks=(cm=="BackCompat")||(cm=="QuirksMode")||drh.ie55||drh.ie50;
-dojo.locale=dojo.locale||(drh.ie?navigator.userLanguage:navigator.language).toLowerCase();
-dr.vml.capable=drh.ie;
-drs.capable=f;
-drs.support.plugin=f;
-drs.support.builtin=f;
-var _b5=window["document"];
-var tdi=_b5["implementation"];
-if((tdi)&&(tdi["hasFeature"])&&(tdi.hasFeature("org.w3c.dom.svg","1.0"))){
-drs.capable=t;
-drs.support.builtin=t;
-drs.support.plugin=f;
-}
-if(drh.safari){
-var tmp=dua.split("AppleWebKit/")[1];
-var ver=parseFloat(tmp.split(" ")[0]);
-if(ver>=420){
-drs.capable=t;
-drs.support.builtin=t;
-drs.support.plugin=f;
-}
-}else{
-}
-})();
-dojo.hostenv.startPackage("dojo.hostenv");
-dojo.render.name=dojo.hostenv.name_="browser";
-dojo.hostenv.searchIds=[];
-dojo.hostenv._XMLHTTP_PROGIDS=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"];
-dojo.hostenv.getXmlhttpObject=function(){
-var _b9=null;
-var _ba=null;
-try{
-_b9=new XMLHttpRequest();
-}
-catch(e){
-}
-if(!_b9){
-for(var i=0;i<3;++i){
-var _bc=dojo.hostenv._XMLHTTP_PROGIDS[i];
-try{
-_b9=new ActiveXObject(_bc);
-}
-catch(e){
-_ba=e;
-}
-if(_b9){
-dojo.hostenv._XMLHTTP_PROGIDS=[_bc];
-break;
-}
-}
-}
-if(!_b9){
-return dojo.raise("XMLHTTP not available",_ba);
-}
-return _b9;
-};
-dojo.hostenv._blockAsync=false;
-dojo.hostenv.getText=function(uri,_be,_bf){
-if(!_be){
-this._blockAsync=true;
-}
-var _c0=this.getXmlhttpObject();
-function isDocumentOk(_c1){
-var _c2=_c1["status"];
-return Boolean((!_c2)||((200<=_c2)&&(300>_c2))||(_c2==304));
-}
-if(_be){
-var _c3=this,_c4=null,gbl=dojo.global();
-var xhr=dojo.evalObjPath("dojo.io.XMLHTTPTransport");
-_c0.onreadystatechange=function(){
-if(_c4){
-gbl.clearTimeout(_c4);
-_c4=null;
-}
-if(_c3._blockAsync||(xhr&&xhr._blockAsync)){
-_c4=gbl.setTimeout(function(){
-_c0.onreadystatechange.apply(this);
-},10);
-}else{
-if(4==_c0.readyState){
-if(isDocumentOk(_c0)){
-_be(_c0.responseText);
-}
-}
-}
-};
-}
-_c0.open("GET",uri,_be?true:false);
-try{
-_c0.send(null);
-if(_be){
-return null;
-}
-if(!isDocumentOk(_c0)){
-var err=Error("Unable to load "+uri+" status:"+_c0.status);
-err.status=_c0.status;
-err.responseText=_c0.responseText;
-throw err;
-}
-}
-catch(e){
-this._blockAsync=false;
-if((_bf)&&(!_be)){
-return null;
-}else{
-throw e;
-}
-}
-this._blockAsync=false;
-return _c0.responseText;
-};
-dojo.hostenv.defaultDebugContainerId="dojoDebug";
-dojo.hostenv._println_buffer=[];
-dojo.hostenv._println_safe=false;
-dojo.hostenv.println=function(_c8){
-if(!dojo.hostenv._println_safe){
-dojo.hostenv._println_buffer.push(_c8);
-}else{
-try{
-var _c9=document.getElementById(djConfig.debugContainerId?djConfig.debugContainerId:dojo.hostenv.defaultDebugContainerId);
-if(!_c9){
-_c9=dojo.body();
-}
-var div=document.createElement("div");
-div.appendChild(document.createTextNode(_c8));
-_c9.appendChild(div);
-}
-catch(e){
-try{
-document.write("
"+_c8+"
");
-}
-catch(e2){
-window.status=_c8;
-}
-}
-}
-};
-dojo.addOnLoad(function(){
-dojo.hostenv._println_safe=true;
-while(dojo.hostenv._println_buffer.length>0){
-dojo.hostenv.println(dojo.hostenv._println_buffer.shift());
-}
-});
-function dj_addNodeEvtHdlr(_cb,_cc,fp){
-var _ce=_cb["on"+_cc]||function(){
-};
-_cb["on"+_cc]=function(){
-fp.apply(_cb,arguments);
-_ce.apply(_cb,arguments);
-};
-return true;
-}
-dojo.hostenv._djInitFired=false;
-function dj_load_init(e){
-dojo.hostenv._djInitFired=true;
-var _d0=(e&&e.type)?e.type.toLowerCase():"load";
-if(arguments.callee.initialized||(_d0!="domcontentloaded"&&_d0!="load")){
-return;
-}
-arguments.callee.initialized=true;
-if(typeof (_timer)!="undefined"){
-clearInterval(_timer);
-delete _timer;
-}
-var _d1=function(){
-if(dojo.render.html.ie){
-dojo.hostenv.makeWidgets();
-}
-};
-if(dojo.hostenv.inFlightCount==0){
-_d1();
-dojo.hostenv.modulesLoaded();
-}else{
-dojo.hostenv.modulesLoadedListeners.unshift(_d1);
-}
-}
-if(document.addEventListener){
-if(dojo.render.html.opera||(dojo.render.html.moz&&(djConfig["enableMozDomContentLoaded"]===true))){
-document.addEventListener("DOMContentLoaded",dj_load_init,null);
-}
-window.addEventListener("load",dj_load_init,null);
-}
-if(dojo.render.html.ie&&dojo.render.os.win){
-document.attachEvent("onreadystatechange",function(e){
-if(document.readyState=="complete"){
-dj_load_init();
-}
-});
-}
-if(/(WebKit|khtml)/i.test(navigator.userAgent)){
-var _timer=setInterval(function(){
-if(/loaded|complete/.test(document.readyState)){
-dj_load_init();
-}
-},10);
-}
-if(dojo.render.html.ie){
-dj_addNodeEvtHdlr(window,"beforeunload",function(){
-dojo.hostenv._unloading=true;
-window.setTimeout(function(){
-dojo.hostenv._unloading=false;
-},0);
-});
-}
-dj_addNodeEvtHdlr(window,"unload",function(){
-dojo.hostenv.unloaded();
-if((!dojo.render.html.ie)||(dojo.render.html.ie&&dojo.hostenv._unloading)){
-dojo.hostenv.unloaded();
-}
-});
-dojo.hostenv.makeWidgets=function(){
-var _d3=[];
-if(djConfig.searchIds&&djConfig.searchIds.length>0){
-_d3=_d3.concat(djConfig.searchIds);
-}
-if(dojo.hostenv.searchIds&&dojo.hostenv.searchIds.length>0){
-_d3=_d3.concat(dojo.hostenv.searchIds);
-}
-if((djConfig.parseWidgets)||(_d3.length>0)){
-if(dojo.evalObjPath("dojo.widget.Parse")){
-var _d4=new dojo.xml.Parse();
-if(_d3.length>0){
-for(var x=0;x<_d3.length;x++){
-var _d6=document.getElementById(_d3[x]);
-if(!_d6){
-continue;
-}
-var _d7=_d4.parseElement(_d6,null,true);
-dojo.widget.getParser().createComponents(_d7);
-}
-}else{
-if(djConfig.parseWidgets){
-var _d7=_d4.parseElement(dojo.body(),null,true);
-dojo.widget.getParser().createComponents(_d7);
-}
-}
-}
-}
-};
-dojo.addOnLoad(function(){
-if(!dojo.render.html.ie){
-dojo.hostenv.makeWidgets();
-}
-});
-try{
-if(dojo.render.html.ie){
-document.namespaces.add("v","urn:schemas-microsoft-com:vml");
-document.createStyleSheet().addRule("v\\:*","behavior:url(#default#VML)");
-}
-}
-catch(e){
-}
-dojo.hostenv.writeIncludes=function(){
-};
-if(!dj_undef("document",this)){
-dj_currentDocument=this.document;
-}
-dojo.doc=function(){
-return dj_currentDocument;
-};
-dojo.body=function(){
-return dojo.doc().body||dojo.doc().getElementsByTagName("body")[0];
-};
-dojo.byId=function(id,doc){
-if((id)&&((typeof id=="string")||(id instanceof String))){
-if(!doc){
-doc=dj_currentDocument;
-}
-var ele=doc.getElementById(id);
-if(ele&&(ele.id!=id)&&doc.all){
-ele=null;
-eles=doc.all[id];
-if(eles){
-if(eles.length){
-for(var i=0;i0)?(/^\s+/):(wh<0)?(/\s+$/):(/^\s+|\s+$/g);
-return str.replace(re,"");
-};
-dojo.string.trimStart=function(str){
-return dojo.string.trim(str,1);
-};
-dojo.string.trimEnd=function(str){
-return dojo.string.trim(str,-1);
-};
-dojo.string.repeat=function(str,_f4,_f5){
-var out="";
-for(var i=0;i<_f4;i++){
-out+=str;
-if(_f5&&i<_f4-1){
-out+=_f5;
-}
-}
-return out;
-};
-dojo.string.pad=function(str,len,c,dir){
-var out=String(str);
-if(!c){
-c="0";
-}
-if(!dir){
-dir=1;
-}
-while(out.length0){
-out=c+out;
-}else{
-out+=c;
-}
-}
-return out;
-};
-dojo.string.padLeft=function(str,len,c){
-return dojo.string.pad(str,len,c,1);
-};
-dojo.string.padRight=function(str,len,c){
-return dojo.string.pad(str,len,c,-1);
-};
-dojo.provide("dojo.string");
-dojo.provide("dojo.lang.common");
-dojo.lang.inherits=function(_103,_104){
-if(!dojo.lang.isFunction(_104)){
-dojo.raise("dojo.inherits: superclass argument ["+_104+"] must be a function (subclass: ["+_103+"']");
-}
-_103.prototype=new _104();
-_103.prototype.constructor=_103;
-_103.superclass=_104.prototype;
-_103["super"]=_104.prototype;
-};
-dojo.lang._mixin=function(obj,_106){
-var tobj={};
-for(var x in _106){
-if((typeof tobj[x]=="undefined")||(tobj[x]!=_106[x])){
-obj[x]=_106[x];
-}
-}
-if(dojo.render.html.ie&&(typeof (_106["toString"])=="function")&&(_106["toString"]!=obj["toString"])&&(_106["toString"]!=tobj["toString"])){
-obj.toString=_106.toString;
-}
-return obj;
-};
-dojo.lang.mixin=function(obj,_10a){
-for(var i=1,l=arguments.length;i-1;
-};
-dojo.lang.isObject=function(it){
-if(typeof it=="undefined"){
-return false;
-}
-return (typeof it=="object"||it===null||dojo.lang.isArray(it)||dojo.lang.isFunction(it));
-};
-dojo.lang.isArray=function(it){
-return (it&&it instanceof Array||typeof it=="array");
-};
-dojo.lang.isArrayLike=function(it){
-if((!it)||(dojo.lang.isUndefined(it))){
-return false;
-}
-if(dojo.lang.isString(it)){
-return false;
-}
-if(dojo.lang.isFunction(it)){
-return false;
-}
-if(dojo.lang.isArray(it)){
-return true;
-}
-if((it.tagName)&&(it.tagName.toLowerCase()=="form")){
-return false;
-}
-if(dojo.lang.isNumber(it.length)&&isFinite(it.length)){
-return true;
-}
-return false;
-};
-dojo.lang.isFunction=function(it){
-return (it instanceof Function||typeof it=="function");
-};
-(function(){
-if((dojo.render.html.capable)&&(dojo.render.html["safari"])){
-dojo.lang.isFunction=function(it){
-if((typeof (it)=="function")&&(it=="[object NodeList]")){
-return false;
-}
-return (it instanceof Function||typeof it=="function");
-};
-}
-})();
-dojo.lang.isString=function(it){
-return (typeof it=="string"||it instanceof String);
-};
-dojo.lang.isAlien=function(it){
-if(!it){
-return false;
-}
-return !dojo.lang.isFunction(it)&&/\{\s*\[native code\]\s*\}/.test(String(it));
-};
-dojo.lang.isBoolean=function(it){
-return (it instanceof Boolean||typeof it=="boolean");
-};
-dojo.lang.isNumber=function(it){
-return (it instanceof Number||typeof it=="number");
-};
-dojo.lang.isUndefined=function(it){
-return ((typeof (it)=="undefined")&&(it==undefined));
-};
-dojo.provide("dojo.lang.extras");
-dojo.lang.setTimeout=function(func,_12a){
-var _12b=window,_12c=2;
-if(!dojo.lang.isFunction(func)){
-_12b=func;
-func=_12a;
-_12a=arguments[2];
-_12c++;
-}
-if(dojo.lang.isString(func)){
-func=_12b[func];
-}
-var args=[];
-for(var i=_12c;i=4){
-this.changeUrl=_142;
-}
-}
-};
-dojo.lang.extend(dojo.io.Request,{url:"",mimetype:"text/plain",method:"GET",content:undefined,transport:undefined,changeUrl:undefined,formNode:undefined,sync:false,bindSuccess:false,useCache:false,preventCache:false,jsonFilter:function(_143){
-if((this.mimetype=="text/json-comment-filtered")||(this.mimetype=="application/json-comment-filtered")){
-var _144=_143.indexOf("/*");
-var _145=_143.lastIndexOf("*/");
-if((_144==-1)||(_145==-1)){
-dojo.debug("your JSON wasn't comment filtered!");
-return "";
-}
-return _143.substring(_144+2,_145);
-}
-dojo.debug("please consider using a mimetype of text/json-comment-filtered to avoid potential security issues with JSON endpoints");
-return _143;
-},load:function(type,data,_148,_149){
-},error:function(type,_14b,_14c,_14d){
-},timeout:function(type,_14f,_150,_151){
-},handle:function(type,data,_154,_155){
-},timeoutSeconds:0,abort:function(){
-},fromKwArgs:function(_156){
-if(_156["url"]){
-_156.url=_156.url.toString();
-}
-if(_156["formNode"]){
-_156.formNode=dojo.byId(_156.formNode);
-}
-if(!_156["method"]&&_156["formNode"]&&_156["formNode"].method){
-_156.method=_156["formNode"].method;
-}
-if(!_156["handle"]&&_156["handler"]){
-_156.handle=_156.handler;
-}
-if(!_156["load"]&&_156["loaded"]){
-_156.load=_156.loaded;
-}
-if(!_156["changeUrl"]&&_156["changeURL"]){
-_156.changeUrl=_156.changeURL;
-}
-_156.encoding=dojo.lang.firstValued(_156["encoding"],djConfig["bindEncoding"],"");
-_156.sendTransport=dojo.lang.firstValued(_156["sendTransport"],djConfig["ioSendTransport"],false);
-var _157=dojo.lang.isFunction;
-for(var x=0;x0){
-dojo.io.bind(dojo.io._bindQueue.shift());
-}else{
-dojo.io._queueBindInFlight=false;
-}
-}
-};
-dojo.io._bindQueue=[];
-dojo.io._queueBindInFlight=false;
-dojo.io.argsFromMap=function(map,_16b,last){
-var enc=/utf/i.test(_16b||"")?encodeURIComponent:dojo.string.encodeAscii;
-var _16e=[];
-var _16f=new Object();
-for(var name in map){
-var _171=function(elt){
-var val=enc(name)+"="+enc(elt);
-_16e[(last==name)?"push":"unshift"](val);
-};
-if(!_16f[name]){
-var _174=map[name];
-if(dojo.lang.isArray(_174)){
-dojo.lang.forEach(_174,_171);
-}else{
-_171(_174);
-}
-}
-}
-return _16e.join("&");
-};
-dojo.io.setIFrameSrc=function(_175,src,_177){
-try{
-var r=dojo.render.html;
-if(!_177){
-if(r.safari){
-_175.location=src;
-}else{
-frames[_175.name].location=src;
-}
-}else{
-var idoc;
-if(r.ie){
-idoc=_175.contentWindow.document;
-}else{
-if(r.safari){
-idoc=_175.document;
-}else{
-idoc=_175.contentWindow;
-}
-}
-if(!idoc){
-_175.location=src;
-return;
-}else{
-idoc.location.replace(src);
-}
-}
-}
-catch(e){
-dojo.debug(e);
-dojo.debug("setIFrameSrc: "+e);
-}
-};
-dojo.provide("dojo.lang.array");
-dojo.lang.mixin(dojo.lang,{has:function(obj,name){
-try{
-return typeof obj[name]!="undefined";
-}
-catch(e){
-return false;
-}
-},isEmpty:function(obj){
-if(dojo.lang.isObject(obj)){
-var tmp={};
-var _17e=0;
-for(var x in obj){
-if(obj[x]&&(!tmp[x])){
-_17e++;
-break;
-}
-}
-return _17e==0;
-}else{
-if(dojo.lang.isArrayLike(obj)||dojo.lang.isString(obj)){
-return obj.length==0;
-}
-}
-},map:function(arr,obj,_182){
-var _183=dojo.lang.isString(arr);
-if(_183){
-arr=arr.split("");
-}
-if(dojo.lang.isFunction(obj)&&(!_182)){
-_182=obj;
-obj=dj_global;
-}else{
-if(dojo.lang.isFunction(obj)&&_182){
-var _184=obj;
-obj=_182;
-_182=_184;
-}
-}
-if(Array.map){
-var _185=Array.map(arr,_182,obj);
-}else{
-var _185=[];
-for(var i=0;i=3){
-dojo.raise("thisObject doesn't exist!");
-}
-_1a3=dj_global;
-}
-_1a5=[];
-for(var i=0;i/gm,">").replace(/"/gm,""");
-if(!_1e8){
-str=str.replace(/'/gm,"'");
-}
-return str;
-};
-dojo.string.escapeSql=function(str){
-return str.replace(/'/gm,"''");
-};
-dojo.string.escapeRegExp=function(str){
-return str.replace(/\\/gm,"\\\\").replace(/([\f\b\n\t\r[\^$|?*+(){}])/gm,"\\$1");
-};
-dojo.string.escapeJavaScript=function(str){
-return str.replace(/(["'\f\b\n\t\r])/gm,"\\$1");
-};
-dojo.string.escapeString=function(str){
-return ("\""+str.replace(/(["\\])/g,"\\$1")+"\"").replace(/[\f]/g,"\\f").replace(/[\b]/g,"\\b").replace(/[\n]/g,"\\n").replace(/[\t]/g,"\\t").replace(/[\r]/g,"\\r");
-};
-dojo.string.summary=function(str,len){
-if(!len||str.length<=len){
-return str;
-}
-return str.substring(0,len).replace(/\.+$/,"")+"...";
-};
-dojo.string.endsWith=function(str,end,_1f1){
-if(_1f1){
-str=str.toLowerCase();
-end=end.toLowerCase();
-}
-if((str.length-end.length)<0){
-return false;
-}
-return str.lastIndexOf(end)==str.length-end.length;
-};
-dojo.string.endsWithAny=function(str){
-for(var i=1;i-1){
-return true;
-}
-}
-return false;
-};
-dojo.string.normalizeNewlines=function(text,_1fc){
-if(_1fc=="\n"){
-text=text.replace(/\r\n/g,"\n");
-text=text.replace(/\r/g,"\n");
-}else{
-if(_1fc=="\r"){
-text=text.replace(/\r\n/g,"\r");
-text=text.replace(/\n/g,"\r");
-}else{
-text=text.replace(/([^\r])\n/g,"$1\r\n").replace(/\r([^\n])/g,"\r\n$1");
-}
-}
-return text;
-};
-dojo.string.splitEscaped=function(str,_1fe){
-var _1ff=[];
-for(var i=0,_201=0;i0){
-return _224[0];
-}
-node=node.parentNode;
-}
-if(_223){
-return null;
-}
-return _224;
-};
-dojo.dom.getAncestorsByTag=function(node,tag,_228){
-tag=tag.toLowerCase();
-return dojo.dom.getAncestors(node,function(el){
-return ((el.tagName)&&(el.tagName.toLowerCase()==tag));
-},_228);
-};
-dojo.dom.getFirstAncestorByTag=function(node,tag){
-return dojo.dom.getAncestorsByTag(node,tag,true);
-};
-dojo.dom.isDescendantOf=function(node,_22d,_22e){
-if(_22e&&node){
-node=node.parentNode;
-}
-while(node){
-if(node==_22d){
-return true;
-}
-node=node.parentNode;
-}
-return false;
-};
-dojo.dom.innerXML=function(node){
-if(node.innerXML){
-return node.innerXML;
-}else{
-if(node.xml){
-return node.xml;
-}else{
-if(typeof XMLSerializer!="undefined"){
-return (new XMLSerializer()).serializeToString(node);
-}
-}
-}
-};
-dojo.dom.createDocument=function(){
-var doc=null;
-var _231=dojo.doc();
-if(!dj_undef("ActiveXObject")){
-var _232=["MSXML2","Microsoft","MSXML","MSXML3"];
-for(var i=0;i<_232.length;i++){
-try{
-doc=new ActiveXObject(_232[i]+".XMLDOM");
-}
-catch(e){
-}
-if(doc){
-break;
-}
-}
-}else{
-if((_231.implementation)&&(_231.implementation.createDocument)){
-doc=_231.implementation.createDocument("","",null);
-}
-}
-return doc;
-};
-dojo.dom.createDocumentFromText=function(str,_235){
-if(!_235){
-_235="text/xml";
-}
-if(!dj_undef("DOMParser")){
-var _236=new DOMParser();
-return _236.parseFromString(str,_235);
-}else{
-if(!dj_undef("ActiveXObject")){
-var _237=dojo.dom.createDocument();
-if(_237){
-_237.async=false;
-_237.loadXML(str);
-return _237;
-}else{
-dojo.debug("toXml didn't work?");
-}
-}else{
-var _238=dojo.doc();
-if(_238.createElement){
-var tmp=_238.createElement("xml");
-tmp.innerHTML=str;
-if(_238.implementation&&_238.implementation.createDocument){
-var _23a=_238.implementation.createDocument("foo","",null);
-for(var i=0;i1){
-var _24f=dojo.doc();
-dojo.dom.replaceChildren(node,_24f.createTextNode(text));
-return text;
-}else{
-if(node.textContent!=undefined){
-return node.textContent;
-}
-var _250="";
-if(node==null){
-return _250;
-}
-for(var i=0;i");
-}
-}
-catch(e){
-}
-if(dojo.render.html.opera){
-dojo.debug("Opera is not supported with dojo.undo.browser, so back/forward detection will not work.");
-}
-dojo.undo.browser={initialHref:(!dj_undef("window"))?window.location.href:"",initialHash:(!dj_undef("window"))?window.location.hash:"",moveForward:false,historyStack:[],forwardStack:[],historyIframe:null,bookmarkAnchor:null,locationTimer:null,setInitialState:function(args){
-this.initialState=this._createState(this.initialHref,args,this.initialHash);
-},addToHistory:function(args){
-this.forwardStack=[];
-var hash=null;
-var url=null;
-if(!this.historyIframe){
-if(djConfig["useXDomain"]&&!djConfig["dojoIframeHistoryUrl"]){
-dojo.debug("dojo.undo.browser: When using cross-domain Dojo builds,"+" please save iframe_history.html to your domain and set djConfig.dojoIframeHistoryUrl"+" to the path on your domain to iframe_history.html");
-}
-this.historyIframe=window.frames["djhistory"];
-}
-if(!this.bookmarkAnchor){
-this.bookmarkAnchor=document.createElement("a");
-dojo.body().appendChild(this.bookmarkAnchor);
-this.bookmarkAnchor.style.display="none";
-}
-if(args["changeUrl"]){
-hash="#"+((args["changeUrl"]!==true)?args["changeUrl"]:(new Date()).getTime());
-if(this.historyStack.length==0&&this.initialState.urlHash==hash){
-this.initialState=this._createState(url,args,hash);
-return;
-}else{
-if(this.historyStack.length>0&&this.historyStack[this.historyStack.length-1].urlHash==hash){
-this.historyStack[this.historyStack.length-1]=this._createState(url,args,hash);
-return;
-}
-}
-this.changingUrl=true;
-setTimeout("window.location.href = '"+hash+"'; dojo.undo.browser.changingUrl = false;",1);
-this.bookmarkAnchor.href=hash;
-if(dojo.render.html.ie){
-url=this._loadIframeHistory();
-var _25f=args["back"]||args["backButton"]||args["handle"];
-var tcb=function(_261){
-if(window.location.hash!=""){
-setTimeout("window.location.href = '"+hash+"';",1);
-}
-_25f.apply(this,[_261]);
-};
-if(args["back"]){
-args.back=tcb;
-}else{
-if(args["backButton"]){
-args.backButton=tcb;
-}else{
-if(args["handle"]){
-args.handle=tcb;
-}
-}
-}
-var _262=args["forward"]||args["forwardButton"]||args["handle"];
-var tfw=function(_264){
-if(window.location.hash!=""){
-window.location.href=hash;
-}
-if(_262){
-_262.apply(this,[_264]);
-}
-};
-if(args["forward"]){
-args.forward=tfw;
-}else{
-if(args["forwardButton"]){
-args.forwardButton=tfw;
-}else{
-if(args["handle"]){
-args.handle=tfw;
-}
-}
-}
-}else{
-if(dojo.render.html.moz){
-if(!this.locationTimer){
-this.locationTimer=setInterval("dojo.undo.browser.checkLocation();",200);
-}
-}
-}
-}else{
-url=this._loadIframeHistory();
-}
-this.historyStack.push(this._createState(url,args,hash));
-},checkLocation:function(){
-if(!this.changingUrl){
-var hsl=this.historyStack.length;
-if((window.location.hash==this.initialHash||window.location.href==this.initialHref)&&(hsl==1)){
-this.handleBackButton();
-return;
-}
-if(this.forwardStack.length>0){
-if(this.forwardStack[this.forwardStack.length-1].urlHash==window.location.hash){
-this.handleForwardButton();
-return;
-}
-}
-if((hsl>=2)&&(this.historyStack[hsl-2])){
-if(this.historyStack[hsl-2].urlHash==window.location.hash){
-this.handleBackButton();
-return;
-}
-}
-}
-},iframeLoaded:function(evt,_267){
-if(!dojo.render.html.opera){
-var _268=this._getUrlQuery(_267.href);
-if(_268==null){
-if(this.historyStack.length==1){
-this.handleBackButton();
-}
-return;
-}
-if(this.moveForward){
-this.moveForward=false;
-return;
-}
-if(this.historyStack.length>=2&&_268==this._getUrlQuery(this.historyStack[this.historyStack.length-2].url)){
-this.handleBackButton();
-}else{
-if(this.forwardStack.length>0&&_268==this._getUrlQuery(this.forwardStack[this.forwardStack.length-1].url)){
-this.handleForwardButton();
-}
-}
-}
-},handleBackButton:function(){
-var _269=this.historyStack.pop();
-if(!_269){
-return;
-}
-var last=this.historyStack[this.historyStack.length-1];
-if(!last&&this.historyStack.length==0){
-last=this.initialState;
-}
-if(last){
-if(last.kwArgs["back"]){
-last.kwArgs["back"]();
-}else{
-if(last.kwArgs["backButton"]){
-last.kwArgs["backButton"]();
-}else{
-if(last.kwArgs["handle"]){
-last.kwArgs.handle("back");
-}
-}
-}
-}
-this.forwardStack.push(_269);
-},handleForwardButton:function(){
-var last=this.forwardStack.pop();
-if(!last){
-return;
-}
-if(last.kwArgs["forward"]){
-last.kwArgs.forward();
-}else{
-if(last.kwArgs["forwardButton"]){
-last.kwArgs.forwardButton();
-}else{
-if(last.kwArgs["handle"]){
-last.kwArgs.handle("forward");
-}
-}
-}
-this.historyStack.push(last);
-},_createState:function(url,args,hash){
-return {"url":url,"kwArgs":args,"urlHash":hash};
-},_getUrlQuery:function(url){
-var _270=url.split("?");
-if(_270.length<2){
-return null;
-}else{
-return _270[1];
-}
-},_loadIframeHistory:function(){
-var url=(djConfig["dojoIframeHistoryUrl"]||dojo.hostenv.getBaseScriptUri()+"iframe_history.html")+"?"+(new Date()).getTime();
-this.moveForward=true;
-dojo.io.setIFrameSrc(this.historyIframe,url,false);
-return url;
-}};
-dojo.provide("dojo.io.BrowserIO");
-if(!dj_undef("window")){
-dojo.io.checkChildrenForFile=function(node){
-var _273=false;
-var _274=node.getElementsByTagName("input");
-dojo.lang.forEach(_274,function(_275){
-if(_273){
-return;
-}
-if(_275.getAttribute("type")=="file"){
-_273=true;
-}
-});
-return _273;
-};
-dojo.io.formHasFile=function(_276){
-return dojo.io.checkChildrenForFile(_276);
-};
-dojo.io.updateNode=function(node,_278){
-node=dojo.byId(node);
-var args=_278;
-if(dojo.lang.isString(_278)){
-args={url:_278};
-}
-args.mimetype="text/html";
-args.load=function(t,d,e){
-while(node.firstChild){
-dojo.dom.destroyNode(node.firstChild);
-}
-node.innerHTML=d;
-};
-dojo.io.bind(args);
-};
-dojo.io.formFilter=function(node){
-var type=(node.type||"").toLowerCase();
-return !node.disabled&&node.name&&!dojo.lang.inArray(["file","submit","image","reset","button"],type);
-};
-dojo.io.encodeForm=function(_27f,_280,_281){
-if((!_27f)||(!_27f.tagName)||(!_27f.tagName.toLowerCase()=="form")){
-dojo.raise("Attempted to encode a non-form element.");
-}
-if(!_281){
-_281=dojo.io.formFilter;
-}
-var enc=/utf/i.test(_280||"")?encodeURIComponent:dojo.string.encodeAscii;
-var _283=[];
-for(var i=0;i<_27f.elements.length;i++){
-var elm=_27f.elements[i];
-if(!elm||elm.tagName.toLowerCase()=="fieldset"||!_281(elm)){
-continue;
-}
-var name=enc(elm.name);
-var type=elm.type.toLowerCase();
-if(type=="select-multiple"){
-for(var j=0;j=200)&&(http.status<300))||(http.status==304)||(http.status==1223)||(location.protocol=="file:"&&(http.status==0||http.status==undefined))||(location.protocol=="chrome:"&&(http.status==0||http.status==undefined))){
-var ret;
-if(_2aa.method.toLowerCase()=="head"){
-var _2b0=http.getAllResponseHeaders();
-ret={};
-ret.toString=function(){
-return _2b0;
-};
-var _2b1=_2b0.split(/[\r\n]+/g);
-for(var i=0;i<_2b1.length;i++){
-var pair=_2b1[i].match(/^([^:]+)\s*:\s*(.+)$/i);
-if(pair){
-ret[pair[1]]=pair[2];
-}
-}
-}else{
-if(_2aa.mimetype=="text/javascript"){
-try{
-ret=dj_eval(http.responseText);
-}
-catch(e){
-dojo.debug(e);
-dojo.debug(http.responseText);
-ret=null;
-}
-}else{
-if(_2aa.mimetype.substr(0,9)=="text/json"||_2aa.mimetype.substr(0,16)=="application/json"){
-try{
-ret=dj_eval("("+_2aa.jsonFilter(http.responseText)+")");
-}
-catch(e){
-dojo.debug(e);
-dojo.debug(http.responseText);
-ret=false;
-}
-}else{
-if((_2aa.mimetype=="application/xml")||(_2aa.mimetype=="text/xml")){
-ret=http.responseXML;
-if(!ret||typeof ret=="string"||!http.getResponseHeader("Content-Type")){
-ret=dojo.dom.createDocumentFromText(http.responseText);
-}
-}else{
-ret=http.responseText;
-}
-}
-}
-}
-if(_2ae){
-addToCache(url,_2ad,_2aa.method,http);
-}
-_2aa[(typeof _2aa.load=="function")?"load":"handle"]("load",ret,http,_2aa);
-}else{
-var _2b4=new dojo.io.Error("XMLHttpTransport Error: "+http.status+" "+http.statusText);
-_2aa[(typeof _2aa.error=="function")?"error":"handle"]("error",_2b4,http,_2aa);
-}
-}
-function setHeaders(http,_2b6){
-if(_2b6["headers"]){
-for(var _2b7 in _2b6["headers"]){
-if(_2b7.toLowerCase()=="content-type"&&!_2b6["contentType"]){
-_2b6["contentType"]=_2b6["headers"][_2b7];
-}else{
-http.setRequestHeader(_2b7,_2b6["headers"][_2b7]);
-}
-}
-}
-}
-this.inFlight=[];
-this.inFlightTimer=null;
-this.startWatchingInFlight=function(){
-if(!this.inFlightTimer){
-this.inFlightTimer=setTimeout("dojo.io.XMLHTTPTransport.watchInFlight();",10);
-}
-};
-this.watchInFlight=function(){
-var now=null;
-if(!dojo.hostenv._blockAsync&&!_29e._blockAsync){
-for(var x=this.inFlight.length-1;x>=0;x--){
-try{
-var tif=this.inFlight[x];
-if(!tif||tif.http._aborted||!tif.http.readyState){
-this.inFlight.splice(x,1);
-continue;
-}
-if(4==tif.http.readyState){
-this.inFlight.splice(x,1);
-doLoad(tif.req,tif.http,tif.url,tif.query,tif.useCache);
-}else{
-if(tif.startTime){
-if(!now){
-now=(new Date()).getTime();
-}
-if(tif.startTime+(tif.req.timeoutSeconds*1000)-1){
-dojo.debug("Warning: dojo.io.bind: stripping hash values from url:",url);
-url=url.split("#")[0];
-}
-if(_2bf["file"]){
-_2bf.method="post";
-}
-if(!_2bf["method"]){
-_2bf.method="get";
-}
-if(_2bf.method.toLowerCase()=="get"){
-_2bf.multipart=false;
-}else{
-if(_2bf["file"]){
-_2bf.multipart=true;
-}else{
-if(!_2bf["multipart"]){
-_2bf.multipart=false;
-}
-}
-}
-if(_2bf["backButton"]||_2bf["back"]||_2bf["changeUrl"]){
-dojo.undo.browser.addToHistory(_2bf);
-}
-var _2c4=_2bf["content"]||{};
-if(_2bf.sendTransport){
-_2c4["dojo.transport"]="xmlhttp";
-}
-do{
-if(_2bf.postContent){
-_2c1=_2bf.postContent;
-break;
-}
-if(_2c4){
-_2c1+=dojo.io.argsFromMap(_2c4,_2bf.encoding);
-}
-if(_2bf.method.toLowerCase()=="get"||!_2bf.multipart){
-break;
-}
-var t=[];
-if(_2c1.length){
-var q=_2c1.split("&");
-for(var i=0;i-1?"&":"?")+_2c1;
-}
-if(_2cb){
-_2d1+=(dojo.string.endsWithAny(_2d1,"?","&")?"":(_2d1.indexOf("?")>-1?"&":"?"))+"dojo.preventCache="+new Date().valueOf();
-}
-if(!_2bf.user){
-http.open(_2bf.method.toUpperCase(),_2d1,_2ca);
-}else{
-http.open(_2bf.method.toUpperCase(),_2d1,_2ca,_2bf.user,_2bf.password);
-}
-setHeaders(http,_2bf);
-try{
-http.send(null);
-}
-catch(e){
-if(typeof http.abort=="function"){
-http.abort();
-}
-doLoad(_2bf,{status:404},url,_2c1,_2cc);
-}
-}
-if(!_2ca){
-doLoad(_2bf,http,url,_2c1,_2cc);
-_29e._blockAsync=false;
-}
-_2bf.abort=function(){
-try{
-http._aborted=true;
-}
-catch(e){
-}
-return http.abort();
-};
-return;
-};
-dojo.io.transports.addTransport("XMLHTTPTransport");
-};
-}
-dojo.provide("dojo.io.cookie");
-dojo.io.cookie.setCookie=function(name,_2d3,days,path,_2d6,_2d7){
-var _2d8=-1;
-if((typeof days=="number")&&(days>=0)){
-var d=new Date();
-d.setTime(d.getTime()+(days*24*60*60*1000));
-_2d8=d.toGMTString();
-}
-_2d3=escape(_2d3);
-document.cookie=name+"="+_2d3+";"+(_2d8!=-1?" expires="+_2d8+";":"")+(path?"path="+path:"")+(_2d6?"; domain="+_2d6:"")+(_2d7?"; secure":"");
-};
-dojo.io.cookie.set=dojo.io.cookie.setCookie;
-dojo.io.cookie.getCookie=function(name){
-var idx=document.cookie.lastIndexOf(name+"=");
-if(idx==-1){
-return null;
-}
-var _2dc=document.cookie.substring(idx+name.length+1);
-var end=_2dc.indexOf(";");
-if(end==-1){
-end=_2dc.length;
-}
-_2dc=_2dc.substring(0,end);
-_2dc=unescape(_2dc);
-return _2dc;
-};
-dojo.io.cookie.get=dojo.io.cookie.getCookie;
-dojo.io.cookie.deleteCookie=function(name){
-dojo.io.cookie.setCookie(name,"-",0);
-};
-dojo.io.cookie.setObjectCookie=function(name,obj,days,path,_2e3,_2e4,_2e5){
-if(arguments.length==5){
-_2e5=_2e3;
-_2e3=null;
-_2e4=null;
-}
-var _2e6=[],_2e7,_2e8="";
-if(!_2e5){
-_2e7=dojo.io.cookie.getObjectCookie(name);
-}
-if(days>=0){
-if(!_2e7){
-_2e7={};
-}
-for(var prop in obj){
-if(obj[prop]==null){
-delete _2e7[prop];
-}else{
-if((typeof obj[prop]=="string")||(typeof obj[prop]=="number")){
-_2e7[prop]=obj[prop];
-}
-}
-}
-prop=null;
-for(var prop in _2e7){
-_2e6.push(escape(prop)+"="+escape(_2e7[prop]));
-}
-_2e8=_2e6.join("&");
-}
-dojo.io.cookie.setCookie(name,_2e8,days,path,_2e3,_2e4);
-};
-dojo.io.cookie.getObjectCookie=function(name){
-var _2eb=null,_2ec=dojo.io.cookie.getCookie(name);
-if(_2ec){
-_2eb={};
-var _2ed=_2ec.split("&");
-for(var i=0;i<_2ed.length;i++){
-var pair=_2ed[i].split("=");
-var _2f0=pair[1];
-if(isNaN(_2f0)){
-_2f0=unescape(pair[1]);
-}
-_2eb[unescape(pair[0])]=_2f0;
-}
-}
-return _2eb;
-};
-dojo.io.cookie.isSupported=function(){
-if(typeof navigator.cookieEnabled!="boolean"){
-dojo.io.cookie.setCookie("__TestingYourBrowserForCookieSupport__","CookiesAllowed",90,null);
-var _2f1=dojo.io.cookie.getCookie("__TestingYourBrowserForCookieSupport__");
-navigator.cookieEnabled=(_2f1=="CookiesAllowed");
-if(navigator.cookieEnabled){
-this.deleteCookie("__TestingYourBrowserForCookieSupport__");
-}
-}
-return navigator.cookieEnabled;
-};
-if(!dojo.io.cookies){
-dojo.io.cookies=dojo.io.cookie;
-}
-dojo.kwCompoundRequire({common:["dojo.io.common"],rhino:["dojo.io.RhinoIO"],browser:["dojo.io.BrowserIO","dojo.io.cookie"],dashboard:["dojo.io.BrowserIO","dojo.io.cookie"]});
-dojo.provide("dojo.io.*");
-dojo.provide("dojo.event.common");
-dojo.event=new function(){
-this._canTimeout=dojo.lang.isFunction(dj_global["setTimeout"])||dojo.lang.isAlien(dj_global["setTimeout"]);
-function interpolateArgs(args,_2f3){
-var dl=dojo.lang;
-var ao={srcObj:dj_global,srcFunc:null,adviceObj:dj_global,adviceFunc:null,aroundObj:null,aroundFunc:null,adviceType:(args.length>2)?args[0]:"after",precedence:"last",once:false,delay:null,rate:0,adviceMsg:false,maxCalls:-1};
-switch(args.length){
-case 0:
-return;
-case 1:
-return;
-case 2:
-ao.srcFunc=args[0];
-ao.adviceFunc=args[1];
-break;
-case 3:
-if((dl.isObject(args[0]))&&(dl.isString(args[1]))&&(dl.isString(args[2]))){
-ao.adviceType="after";
-ao.srcObj=args[0];
-ao.srcFunc=args[1];
-ao.adviceFunc=args[2];
-}else{
-if((dl.isString(args[1]))&&(dl.isString(args[2]))){
-ao.srcFunc=args[1];
-ao.adviceFunc=args[2];
-}else{
-if((dl.isObject(args[0]))&&(dl.isString(args[1]))&&(dl.isFunction(args[2]))){
-ao.adviceType="after";
-ao.srcObj=args[0];
-ao.srcFunc=args[1];
-var _2f6=dl.nameAnonFunc(args[2],ao.adviceObj,_2f3);
-ao.adviceFunc=_2f6;
-}else{
-if((dl.isFunction(args[0]))&&(dl.isObject(args[1]))&&(dl.isString(args[2]))){
-ao.adviceType="after";
-ao.srcObj=dj_global;
-var _2f6=dl.nameAnonFunc(args[0],ao.srcObj,_2f3);
-ao.srcFunc=_2f6;
-ao.adviceObj=args[1];
-ao.adviceFunc=args[2];
-}
-}
-}
-}
-break;
-case 4:
-if((dl.isObject(args[0]))&&(dl.isObject(args[2]))){
-ao.adviceType="after";
-ao.srcObj=args[0];
-ao.srcFunc=args[1];
-ao.adviceObj=args[2];
-ao.adviceFunc=args[3];
-}else{
-if((dl.isString(args[0]))&&(dl.isString(args[1]))&&(dl.isObject(args[2]))){
-ao.adviceType=args[0];
-ao.srcObj=dj_global;
-ao.srcFunc=args[1];
-ao.adviceObj=args[2];
-ao.adviceFunc=args[3];
-}else{
-if((dl.isString(args[0]))&&(dl.isFunction(args[1]))&&(dl.isObject(args[2]))){
-ao.adviceType=args[0];
-ao.srcObj=dj_global;
-var _2f6=dl.nameAnonFunc(args[1],dj_global,_2f3);
-ao.srcFunc=_2f6;
-ao.adviceObj=args[2];
-ao.adviceFunc=args[3];
-}else{
-if((dl.isString(args[0]))&&(dl.isObject(args[1]))&&(dl.isString(args[2]))&&(dl.isFunction(args[3]))){
-ao.srcObj=args[1];
-ao.srcFunc=args[2];
-var _2f6=dl.nameAnonFunc(args[3],dj_global,_2f3);
-ao.adviceObj=dj_global;
-ao.adviceFunc=_2f6;
-}else{
-if(dl.isObject(args[1])){
-ao.srcObj=args[1];
-ao.srcFunc=args[2];
-ao.adviceObj=dj_global;
-ao.adviceFunc=args[3];
-}else{
-if(dl.isObject(args[2])){
-ao.srcObj=dj_global;
-ao.srcFunc=args[1];
-ao.adviceObj=args[2];
-ao.adviceFunc=args[3];
-}else{
-ao.srcObj=ao.adviceObj=ao.aroundObj=dj_global;
-ao.srcFunc=args[1];
-ao.adviceFunc=args[2];
-ao.aroundFunc=args[3];
-}
-}
-}
-}
-}
-}
-break;
-case 6:
-ao.srcObj=args[1];
-ao.srcFunc=args[2];
-ao.adviceObj=args[3];
-ao.adviceFunc=args[4];
-ao.aroundFunc=args[5];
-ao.aroundObj=dj_global;
-break;
-default:
-ao.srcObj=args[1];
-ao.srcFunc=args[2];
-ao.adviceObj=args[3];
-ao.adviceFunc=args[4];
-ao.aroundObj=args[5];
-ao.aroundFunc=args[6];
-ao.once=args[7];
-ao.delay=args[8];
-ao.rate=args[9];
-ao.adviceMsg=args[10];
-ao.maxCalls=(!isNaN(parseInt(args[11])))?args[11]:-1;
-break;
-}
-if(dl.isFunction(ao.aroundFunc)){
-var _2f6=dl.nameAnonFunc(ao.aroundFunc,ao.aroundObj,_2f3);
-ao.aroundFunc=_2f6;
-}
-if(dl.isFunction(ao.srcFunc)){
-ao.srcFunc=dl.getNameInObj(ao.srcObj,ao.srcFunc);
-}
-if(dl.isFunction(ao.adviceFunc)){
-ao.adviceFunc=dl.getNameInObj(ao.adviceObj,ao.adviceFunc);
-}
-if((ao.aroundObj)&&(dl.isFunction(ao.aroundFunc))){
-ao.aroundFunc=dl.getNameInObj(ao.aroundObj,ao.aroundFunc);
-}
-if(!ao.srcObj){
-dojo.raise("bad srcObj for srcFunc: "+ao.srcFunc);
-}
-if(!ao.adviceObj){
-dojo.raise("bad adviceObj for adviceFunc: "+ao.adviceFunc);
-}
-if(!ao.adviceFunc){
-dojo.debug("bad adviceFunc for srcFunc: "+ao.srcFunc);
-dojo.debugShallow(ao);
-}
-return ao;
-}
-this.connect=function(){
-if(arguments.length==1){
-var ao=arguments[0];
-}else{
-var ao=interpolateArgs(arguments,true);
-}
-if(dojo.lang.isString(ao.srcFunc)&&(ao.srcFunc.toLowerCase()=="onkey")){
-if(dojo.render.html.ie){
-ao.srcFunc="onkeydown";
-this.connect(ao);
-}
-ao.srcFunc="onkeypress";
-}
-if(dojo.lang.isArray(ao.srcObj)&&ao.srcObj!=""){
-var _2f8={};
-for(var x in ao){
-_2f8[x]=ao[x];
-}
-var mjps=[];
-dojo.lang.forEach(ao.srcObj,function(src){
-if((dojo.render.html.capable)&&(dojo.lang.isString(src))){
-src=dojo.byId(src);
-}
-_2f8.srcObj=src;
-mjps.push(dojo.event.connect.call(dojo.event,_2f8));
-});
-return mjps;
-}
-var mjp=dojo.event.MethodJoinPoint.getForMethod(ao.srcObj,ao.srcFunc);
-if(ao.adviceFunc){
-var mjp2=dojo.event.MethodJoinPoint.getForMethod(ao.adviceObj,ao.adviceFunc);
-}
-mjp.kwAddAdvice(ao);
-return mjp;
-};
-this.log=function(a1,a2){
-var _300;
-if((arguments.length==1)&&(typeof a1=="object")){
-_300=a1;
-}else{
-_300={srcObj:a1,srcFunc:a2};
-}
-_300.adviceFunc=function(){
-var _301=[];
-for(var x=0;x=this.jp_.around.length){
-return this.jp_.object[this.jp_.methodname].apply(this.jp_.object,this.args);
-}else{
-var ti=this.jp_.around[this.around_index];
-var mobj=ti[0]||dj_global;
-var meth=ti[1];
-return mobj[meth].call(mobj,this);
-}
-};
-dojo.event.MethodJoinPoint=function(obj,_319){
-this.object=obj||dj_global;
-this.methodname=_319;
-this.methodfunc=this.object[_319];
-this.squelch=false;
-};
-dojo.event.MethodJoinPoint.getForMethod=function(obj,_31b){
-if(!obj){
-obj=dj_global;
-}
-var ofn=obj[_31b];
-if(!ofn){
-ofn=obj[_31b]=function(){
-};
-if(!obj[_31b]){
-dojo.raise("Cannot set do-nothing method on that object "+_31b);
-}
-}else{
-if((typeof ofn!="function")&&(!dojo.lang.isFunction(ofn))&&(!dojo.lang.isAlien(ofn))){
-return null;
-}
-}
-var _31d=_31b+"$joinpoint";
-var _31e=_31b+"$joinpoint$method";
-var _31f=obj[_31d];
-if(!_31f){
-var _320=false;
-if(dojo.event["browser"]){
-if((obj["attachEvent"])||(obj["nodeType"])||(obj["addEventListener"])){
-_320=true;
-dojo.event.browser.addClobberNodeAttrs(obj,[_31d,_31e,_31b]);
-}
-}
-var _321=ofn.length;
-obj[_31e]=ofn;
-_31f=obj[_31d]=new dojo.event.MethodJoinPoint(obj,_31e);
-if(!_320){
-obj[_31b]=function(){
-return _31f.run.apply(_31f,arguments);
-};
-}else{
-obj[_31b]=function(){
-var args=[];
-if(!arguments.length){
-var evt=null;
-try{
-if(obj.ownerDocument){
-evt=obj.ownerDocument.parentWindow.event;
-}else{
-if(obj.documentElement){
-evt=obj.documentElement.ownerDocument.parentWindow.event;
-}else{
-if(obj.event){
-evt=obj.event;
-}else{
-evt=window.event;
-}
-}
-}
-}
-catch(e){
-evt=window.event;
-}
-if(evt){
-args.push(dojo.event.browser.fixEvent(evt,this));
-}
-}else{
-for(var x=0;x-1){
-if(_330==0){
-return;
-}
-marr[7]--;
-}
-var _331;
-var to={args:[],jp_:this,object:obj,proceed:function(){
-return _32b[_32c].apply(_32b,to.args);
-}};
-to.args=_327;
-var _333=parseInt(marr[4]);
-var _334=((!isNaN(_333))&&(marr[4]!==null)&&(typeof marr[4]!="undefined"));
-if(marr[5]){
-var rate=parseInt(marr[5]);
-var cur=new Date();
-var _337=false;
-if((marr["last"])&&((cur-marr.last)<=rate)){
-if(dojo.event._canTimeout){
-if(marr["delayTimer"]){
-clearTimeout(marr.delayTimer);
-}
-var tod=parseInt(rate*2);
-var mcpy=dojo.lang.shallowCopy(marr);
-marr.delayTimer=setTimeout(function(){
-mcpy[5]=0;
-_329(mcpy);
-},tod);
-}
-return;
-}else{
-marr.last=cur;
-}
-}
-if(_32e){
-_32d[_32e].call(_32d,to);
-}else{
-if((_334)&&((dojo.render.html)||(dojo.render.svg))){
-dj_global["setTimeout"](function(){
-if(msg){
-_32b[_32c].call(_32b,to);
-}else{
-_32b[_32c].apply(_32b,args);
-}
-},_333);
-}else{
-if(msg){
-_32b[_32c].call(_32b,to);
-}else{
-_32b[_32c].apply(_32b,args);
-}
-}
-}
-};
-var _33a=function(){
-if(this.squelch){
-try{
-return _329.apply(this,arguments);
-}
-catch(e){
-dojo.debug(e);
-}
-}else{
-return _329.apply(this,arguments);
-}
-};
-if((this["before"])&&(this.before.length>0)){
-dojo.lang.forEach(this.before.concat(new Array()),_33a);
-}
-var _33b;
-try{
-if((this["around"])&&(this.around.length>0)){
-var mi=new dojo.event.MethodInvocation(this,obj,args);
-_33b=mi.proceed();
-}else{
-if(this.methodfunc){
-_33b=this.object[this.methodname].apply(this.object,args);
-}
-}
-}
-catch(e){
-if(!this.squelch){
-dojo.debug(e,"when calling",this.methodname,"on",this.object,"with arguments",args);
-dojo.raise(e);
-}
-}
-if((this["after"])&&(this.after.length>0)){
-dojo.lang.forEach(this.after.concat(new Array()),_33a);
-}
-return (this.methodfunc)?_33b:null;
-},getArr:function(kind){
-var type="after";
-if((typeof kind=="string")&&(kind.indexOf("before")!=-1)){
-type="before";
-}else{
-if(kind=="around"){
-type="around";
-}
-}
-if(!this[type]){
-this[type]=[];
-}
-return this[type];
-},kwAddAdvice:function(args){
-this.addAdvice(args["adviceObj"],args["adviceFunc"],args["aroundObj"],args["aroundFunc"],args["adviceType"],args["precedence"],args["once"],args["delay"],args["rate"],args["adviceMsg"],args["maxCalls"]);
-},addAdvice:function(_340,_341,_342,_343,_344,_345,once,_347,rate,_349,_34a){
-var arr=this.getArr(_344);
-if(!arr){
-dojo.raise("bad this: "+this);
-}
-var ao=[_340,_341,_342,_343,_347,rate,_349,_34a];
-if(once){
-if(this.hasAdvice(_340,_341,_344,arr)>=0){
-return;
-}
-}
-if(_345=="first"){
-arr.unshift(ao);
-}else{
-arr.push(ao);
-}
-},hasAdvice:function(_34d,_34e,_34f,arr){
-if(!arr){
-arr=this.getArr(_34f);
-}
-var ind=-1;
-for(var x=0;x=0;i=i-1){
-var el=na[i];
-try{
-if(el&&el["__clobberAttrs__"]){
-for(var j=0;j=65&&_3a1<=90&&evt.shiftKey==false){
-_3a1+=32;
-}
-if(_3a1>=1&&_3a1<=26&&evt.ctrlKey){
-_3a1+=96;
-}
-evt.key=String.fromCharCode(_3a1);
-}
-}
-}else{
-if(evt["type"]=="keypress"){
-if(dojo.render.html.opera){
-if(evt.which==0){
-evt.key=evt.keyCode;
-}else{
-if(evt.which>0){
-switch(evt.which){
-case evt.KEY_SHIFT:
-case evt.KEY_CTRL:
-case evt.KEY_ALT:
-case evt.KEY_CAPS_LOCK:
-case evt.KEY_NUM_LOCK:
-case evt.KEY_SCROLL_LOCK:
-break;
-case evt.KEY_PAUSE:
-case evt.KEY_TAB:
-case evt.KEY_BACKSPACE:
-case evt.KEY_ENTER:
-case evt.KEY_ESCAPE:
-evt.key=evt.which;
-break;
-default:
-var _3a1=evt.which;
-if((evt.ctrlKey||evt.altKey||evt.metaKey)&&(evt.which>=65&&evt.which<=90&&evt.shiftKey==false)){
-_3a1+=32;
-}
-evt.key=String.fromCharCode(_3a1);
-}
-}
-}
-}else{
-if(dojo.render.html.ie){
-if(!evt.ctrlKey&&!evt.altKey&&evt.keyCode>=evt.KEY_SPACE){
-evt.key=String.fromCharCode(evt.keyCode);
-}
-}else{
-if(dojo.render.html.safari){
-switch(evt.keyCode){
-case 25:
-evt.key=evt.KEY_TAB;
-evt.shift=true;
-break;
-case 63232:
-evt.key=evt.KEY_UP_ARROW;
-break;
-case 63233:
-evt.key=evt.KEY_DOWN_ARROW;
-break;
-case 63234:
-evt.key=evt.KEY_LEFT_ARROW;
-break;
-case 63235:
-evt.key=evt.KEY_RIGHT_ARROW;
-break;
-case 63236:
-evt.key=evt.KEY_F1;
-break;
-case 63237:
-evt.key=evt.KEY_F2;
-break;
-case 63238:
-evt.key=evt.KEY_F3;
-break;
-case 63239:
-evt.key=evt.KEY_F4;
-break;
-case 63240:
-evt.key=evt.KEY_F5;
-break;
-case 63241:
-evt.key=evt.KEY_F6;
-break;
-case 63242:
-evt.key=evt.KEY_F7;
-break;
-case 63243:
-evt.key=evt.KEY_F8;
-break;
-case 63244:
-evt.key=evt.KEY_F9;
-break;
-case 63245:
-evt.key=evt.KEY_F10;
-break;
-case 63246:
-evt.key=evt.KEY_F11;
-break;
-case 63247:
-evt.key=evt.KEY_F12;
-break;
-case 63250:
-evt.key=evt.KEY_PAUSE;
-break;
-case 63272:
-evt.key=evt.KEY_DELETE;
-break;
-case 63273:
-evt.key=evt.KEY_HOME;
-break;
-case 63275:
-evt.key=evt.KEY_END;
-break;
-case 63276:
-evt.key=evt.KEY_PAGE_UP;
-break;
-case 63277:
-evt.key=evt.KEY_PAGE_DOWN;
-break;
-case 63302:
-evt.key=evt.KEY_INSERT;
-break;
-case 63248:
-case 63249:
-case 63289:
-break;
-default:
-evt.key=evt.charCode>=evt.KEY_SPACE?String.fromCharCode(evt.charCode):evt.keyCode;
-}
-}else{
-evt.key=evt.charCode>0?String.fromCharCode(evt.charCode):evt.keyCode;
-}
-}
-}
-}
-}
-}
-if(dojo.render.html.ie){
-if(!evt.target){
-evt.target=evt.srcElement;
-}
-if(!evt.currentTarget){
-evt.currentTarget=(_39f?_39f:evt.srcElement);
-}
-if(!evt.layerX){
-evt.layerX=evt.offsetX;
-}
-if(!evt.layerY){
-evt.layerY=evt.offsetY;
-}
-var doc=(evt.srcElement&&evt.srcElement.ownerDocument)?evt.srcElement.ownerDocument:document;
-var _3a3=((dojo.render.html.ie55)||(doc["compatMode"]=="BackCompat"))?doc.body:doc.documentElement;
-if(!evt.pageX){
-evt.pageX=evt.clientX+(_3a3.scrollLeft||0);
-}
-if(!evt.pageY){
-evt.pageY=evt.clientY+(_3a3.scrollTop||0);
-}
-if(evt.type=="mouseover"){
-evt.relatedTarget=evt.fromElement;
-}
-if(evt.type=="mouseout"){
-evt.relatedTarget=evt.toElement;
-}
-this.currentEvent=evt;
-evt.callListener=this.callListener;
-evt.stopPropagation=this._stopPropagation;
-evt.preventDefault=this._preventDefault;
-}
-return evt;
-};
-this.stopEvent=function(evt){
-if(window.event){
-evt.cancelBubble=true;
-evt.returnValue=false;
-}else{
-evt.preventDefault();
-evt.stopPropagation();
-}
-};
-};
-dojo.kwCompoundRequire({common:["dojo.event.common","dojo.event.topic"],browser:["dojo.event.browser"],dashboard:["dojo.event.browser"]});
-dojo.provide("dojo.event.*");
-dojo.provide("dojo.gfx.color");
-dojo.gfx.color.Color=function(r,g,b,a){
-if(dojo.lang.isArray(r)){
-this.r=r[0];
-this.g=r[1];
-this.b=r[2];
-this.a=r[3]||1;
-}else{
-if(dojo.lang.isString(r)){
-var rgb=dojo.gfx.color.extractRGB(r);
-this.r=rgb[0];
-this.g=rgb[1];
-this.b=rgb[2];
-this.a=g||1;
-}else{
-if(r instanceof dojo.gfx.color.Color){
-this.r=r.r;
-this.b=r.b;
-this.g=r.g;
-this.a=r.a;
-}else{
-this.r=r;
-this.g=g;
-this.b=b;
-this.a=a;
-}
-}
-}
-};
-dojo.gfx.color.Color.fromArray=function(arr){
-return new dojo.gfx.color.Color(arr[0],arr[1],arr[2],arr[3]);
-};
-dojo.extend(dojo.gfx.color.Color,{toRgb:function(_3ab){
-if(_3ab){
-return this.toRgba();
-}else{
-return [this.r,this.g,this.b];
-}
-},toRgba:function(){
-return [this.r,this.g,this.b,this.a];
-},toHex:function(){
-return dojo.gfx.color.rgb2hex(this.toRgb());
-},toCss:function(){
-return "rgb("+this.toRgb().join()+")";
-},toString:function(){
-return this.toHex();
-},blend:function(_3ac,_3ad){
-var rgb=null;
-if(dojo.lang.isArray(_3ac)){
-rgb=_3ac;
-}else{
-if(_3ac instanceof dojo.gfx.color.Color){
-rgb=_3ac.toRgb();
-}else{
-rgb=new dojo.gfx.color.Color(_3ac).toRgb();
-}
-}
-return dojo.gfx.color.blend(this.toRgb(),rgb,_3ad);
-}});
-dojo.gfx.color.named={white:[255,255,255],black:[0,0,0],red:[255,0,0],green:[0,255,0],lime:[0,255,0],blue:[0,0,255],navy:[0,0,128],gray:[128,128,128],silver:[192,192,192]};
-dojo.gfx.color.blend=function(a,b,_3b1){
-if(typeof a=="string"){
-return dojo.gfx.color.blendHex(a,b,_3b1);
-}
-if(!_3b1){
-_3b1=0;
-}
-_3b1=Math.min(Math.max(-1,_3b1),1);
-_3b1=((_3b1+1)/2);
-var c=[];
-for(var x=0;x<3;x++){
-c[x]=parseInt(b[x]+((a[x]-b[x])*_3b1));
-}
-return c;
-};
-dojo.gfx.color.blendHex=function(a,b,_3b6){
-return dojo.gfx.color.rgb2hex(dojo.gfx.color.blend(dojo.gfx.color.hex2rgb(a),dojo.gfx.color.hex2rgb(b),_3b6));
-};
-dojo.gfx.color.extractRGB=function(_3b7){
-var hex="0123456789abcdef";
-_3b7=_3b7.toLowerCase();
-if(_3b7.indexOf("rgb")==0){
-var _3b9=_3b7.match(/rgba*\((\d+), *(\d+), *(\d+)/i);
-var ret=_3b9.splice(1,3);
-return ret;
-}else{
-var _3bb=dojo.gfx.color.hex2rgb(_3b7);
-if(_3bb){
-return _3bb;
-}else{
-return dojo.gfx.color.named[_3b7]||[255,255,255];
-}
-}
-};
-dojo.gfx.color.hex2rgb=function(hex){
-var _3bd="0123456789ABCDEF";
-var rgb=new Array(3);
-if(hex.indexOf("#")==0){
-hex=hex.substring(1);
-}
-hex=hex.toUpperCase();
-if(hex.replace(new RegExp("["+_3bd+"]","g"),"")!=""){
-return null;
-}
-if(hex.length==3){
-rgb[0]=hex.charAt(0)+hex.charAt(0);
-rgb[1]=hex.charAt(1)+hex.charAt(1);
-rgb[2]=hex.charAt(2)+hex.charAt(2);
-}else{
-rgb[0]=hex.substring(0,2);
-rgb[1]=hex.substring(2,4);
-rgb[2]=hex.substring(4);
-}
-for(var i=0;i0){
-this.duration=_3de;
-}
-if(_3e1){
-this.repeatCount=_3e1;
-}
-if(rate){
-this.rate=rate;
-}
-if(_3dd){
-dojo.lang.forEach(["handler","beforeBegin","onBegin","onEnd","onPlay","onStop","onAnimate"],function(item){
-if(_3dd[item]){
-this.connect(item,_3dd[item]);
-}
-},this);
-}
-if(_3e0&&dojo.lang.isFunction(_3e0)){
-this.easing=_3e0;
-}
-};
-dojo.inherits(dojo.lfx.Animation,dojo.lfx.IAnimation);
-dojo.lang.extend(dojo.lfx.Animation,{_startTime:null,_endTime:null,_timer:null,_percent:0,_startRepeatCount:0,play:function(_3e4,_3e5){
-if(_3e5){
-clearTimeout(this._timer);
-this._active=false;
-this._paused=false;
-this._percent=0;
-}else{
-if(this._active&&!this._paused){
-return this;
-}
-}
-this.fire("handler",["beforeBegin"]);
-this.fire("beforeBegin");
-if(_3e4>0){
-setTimeout(dojo.lang.hitch(this,function(){
-this.play(null,_3e5);
-}),_3e4);
-return this;
-}
-this._startTime=new Date().valueOf();
-if(this._paused){
-this._startTime-=(this.duration*this._percent/100);
-}
-this._endTime=this._startTime+this.duration;
-this._active=true;
-this._paused=false;
-var step=this._percent/100;
-var _3e7=this.curve.getValue(step);
-if(this._percent==0){
-if(!this._startRepeatCount){
-this._startRepeatCount=this.repeatCount;
-}
-this.fire("handler",["begin",_3e7]);
-this.fire("onBegin",[_3e7]);
-}
-this.fire("handler",["play",_3e7]);
-this.fire("onPlay",[_3e7]);
-this._cycle();
-return this;
-},pause:function(){
-clearTimeout(this._timer);
-if(!this._active){
-return this;
-}
-this._paused=true;
-var _3e8=this.curve.getValue(this._percent/100);
-this.fire("handler",["pause",_3e8]);
-this.fire("onPause",[_3e8]);
-return this;
-},gotoPercent:function(pct,_3ea){
-clearTimeout(this._timer);
-this._active=true;
-this._paused=true;
-this._percent=pct;
-if(_3ea){
-this.play();
-}
-return this;
-},stop:function(_3eb){
-clearTimeout(this._timer);
-var step=this._percent/100;
-if(_3eb){
-step=1;
-}
-var _3ed=this.curve.getValue(step);
-this.fire("handler",["stop",_3ed]);
-this.fire("onStop",[_3ed]);
-this._active=false;
-this._paused=false;
-return this;
-},status:function(){
-if(this._active){
-return this._paused?"paused":"playing";
-}else{
-return "stopped";
-}
-return this;
-},_cycle:function(){
-clearTimeout(this._timer);
-if(this._active){
-var curr=new Date().valueOf();
-var step=(curr-this._startTime)/(this._endTime-this._startTime);
-if(step>=1){
-step=1;
-this._percent=100;
-}else{
-this._percent=step*100;
-}
-if((this.easing)&&(dojo.lang.isFunction(this.easing))){
-step=this.easing(step);
-}
-var _3f0=this.curve.getValue(step);
-this.fire("handler",["animate",_3f0]);
-this.fire("onAnimate",[_3f0]);
-if(step<1){
-this._timer=setTimeout(dojo.lang.hitch(this,"_cycle"),this.rate);
-}else{
-this._active=false;
-this.fire("handler",["end"]);
-this.fire("onEnd");
-if(this.repeatCount>0){
-this.repeatCount--;
-this.play(null,true);
-}else{
-if(this.repeatCount==-1){
-this.play(null,true);
-}else{
-if(this._startRepeatCount){
-this.repeatCount=this._startRepeatCount;
-this._startRepeatCount=0;
-}
-}
-}
-}
-}
-return this;
-}});
-dojo.lfx.Combine=function(_3f1){
-dojo.lfx.IAnimation.call(this);
-this._anims=[];
-this._animsEnded=0;
-var _3f2=arguments;
-if(_3f2.length==1&&(dojo.lang.isArray(_3f2[0])||dojo.lang.isArrayLike(_3f2[0]))){
-_3f2=_3f2[0];
-}
-dojo.lang.forEach(_3f2,function(anim){
-this._anims.push(anim);
-anim.connect("onEnd",dojo.lang.hitch(this,"_onAnimsEnded"));
-},this);
-};
-dojo.inherits(dojo.lfx.Combine,dojo.lfx.IAnimation);
-dojo.lang.extend(dojo.lfx.Combine,{_animsEnded:0,play:function(_3f4,_3f5){
-if(!this._anims.length){
-return this;
-}
-this.fire("beforeBegin");
-if(_3f4>0){
-setTimeout(dojo.lang.hitch(this,function(){
-this.play(null,_3f5);
-}),_3f4);
-return this;
-}
-if(_3f5||this._anims[0].percent==0){
-this.fire("onBegin");
-}
-this.fire("onPlay");
-this._animsCall("play",null,_3f5);
-return this;
-},pause:function(){
-this.fire("onPause");
-this._animsCall("pause");
-return this;
-},stop:function(_3f6){
-this.fire("onStop");
-this._animsCall("stop",_3f6);
-return this;
-},_onAnimsEnded:function(){
-this._animsEnded++;
-if(this._animsEnded>=this._anims.length){
-this.fire("onEnd");
-}
-return this;
-},_animsCall:function(_3f7){
-var args=[];
-if(arguments.length>1){
-for(var i=1;i0){
-setTimeout(dojo.lang.hitch(this,function(){
-this.play(null,_403);
-}),_402);
-return this;
-}
-if(_404){
-if(this._currAnim==0){
-this.fire("handler",["begin",this._currAnim]);
-this.fire("onBegin",[this._currAnim]);
-}
-this.fire("onPlay",[this._currAnim]);
-_404.play(null,_403);
-}
-return this;
-},pause:function(){
-if(this._anims[this._currAnim]){
-this._anims[this._currAnim].pause();
-this.fire("onPause",[this._currAnim]);
-}
-return this;
-},playPause:function(){
-if(this._anims.length==0){
-return this;
-}
-if(this._currAnim==-1){
-this._currAnim=0;
-}
-var _405=this._anims[this._currAnim];
-if(_405){
-if(!_405._active||_405._paused){
-this.play();
-}else{
-this.pause();
-}
-}
-return this;
-},stop:function(){
-var _406=this._anims[this._currAnim];
-if(_406){
-_406.stop();
-this.fire("onStop",[this._currAnim]);
-}
-return _406;
-},_playNext:function(){
-if(this._currAnim==-1||this._anims.length==0){
-return this;
-}
-this._currAnim++;
-if(this._anims[this._currAnim]){
-this._anims[this._currAnim].play(null,true);
-}
-return this;
-}});
-dojo.lfx.combine=function(_407){
-var _408=arguments;
-if(dojo.lang.isArray(arguments[0])){
-_408=arguments[0];
-}
-if(_408.length==1){
-return _408[0];
-}
-return new dojo.lfx.Combine(_408);
-};
-dojo.lfx.chain=function(_409){
-var _40a=arguments;
-if(dojo.lang.isArray(arguments[0])){
-_40a=arguments[0];
-}
-if(_40a.length==1){
-return _40a[0];
-}
-return new dojo.lfx.Chain(_40a);
-};
-dojo.provide("dojo.html.common");
-dojo.lang.mixin(dojo.html,dojo.dom);
-dojo.html.body=function(){
-dojo.deprecated("dojo.html.body() moved to dojo.body()","0.5");
-return dojo.body();
-};
-dojo.html.getEventTarget=function(evt){
-if(!evt){
-evt=dojo.global().event||{};
-}
-var t=(evt.srcElement?evt.srcElement:(evt.target?evt.target:null));
-while((t)&&(t.nodeType!=1)){
-t=t.parentNode;
-}
-return t;
-};
-dojo.html.getViewport=function(){
-var _40d=dojo.global();
-var _40e=dojo.doc();
-var w=0;
-var h=0;
-if(dojo.render.html.mozilla){
-w=_40e.documentElement.clientWidth;
-h=_40d.innerHeight;
-}else{
-if(!dojo.render.html.opera&&_40d.innerWidth){
-w=_40d.innerWidth;
-h=_40d.innerHeight;
-}else{
-if(!dojo.render.html.opera&&dojo.exists(_40e,"documentElement.clientWidth")){
-var w2=_40e.documentElement.clientWidth;
-if(!w||w2&&w2_436)){
-loc=dojo.hostenv.getBaseScriptUri()+loc;
-}
-return new dojo.uri.Uri(loc,uri);
-};
-this.Uri=function(){
-var uri=arguments[0];
-for(var i=1;i0&&!(j==1&&segs[0]=="")&&segs[j]==".."&&segs[j-1]!=".."){
-if(j==segs.length-1){
-segs.splice(j,1);
-segs[j-1]="";
-}else{
-segs.splice(j-1,2);
-j-=2;
-}
-}
-}
-}
-_439.path=segs.join("/");
-}
-}
-}
-}
-uri="";
-if(_439.scheme!=null){
-uri+=_439.scheme+":";
-}
-if(_439.authority!=null){
-uri+="//"+_439.authority;
-}
-uri+=_439.path;
-if(_439.query!=null){
-uri+="?"+_439.query;
-}
-if(_439.fragment!=null){
-uri+="#"+_439.fragment;
-}
-}
-this.uri=uri.toString();
-var _43e="^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$";
-var r=this.uri.match(new RegExp(_43e));
-this.scheme=r[2]||(r[1]?"":null);
-this.authority=r[4]||(r[3]?"":null);
-this.path=r[5];
-this.query=r[7]||(r[6]?"":null);
-this.fragment=r[9]||(r[8]?"":null);
-if(this.authority!=null){
-_43e="^((([^:]+:)?([^@]+))@)?([^:]*)(:([0-9]+))?$";
-r=this.authority.match(new RegExp(_43e));
-this.user=r[3]||null;
-this.password=r[4]||null;
-this.host=r[5];
-this.port=r[7]||null;
-}
-this.toString=function(){
-return this.uri;
-};
-};
-};
-dojo.provide("dojo.html.style");
-dojo.html.getClass=function(node){
-node=dojo.byId(node);
-if(!node){
-return "";
-}
-var cs="";
-if(node.className){
-cs=node.className;
-}else{
-if(dojo.html.hasAttribute(node,"class")){
-cs=dojo.html.getAttribute(node,"class");
-}
-}
-return cs.replace(/^\s+|\s+$/g,"");
-};
-dojo.html.getClasses=function(node){
-var c=dojo.html.getClass(node);
-return (c=="")?[]:c.split(/\s+/g);
-};
-dojo.html.hasClass=function(node,_445){
-return (new RegExp("(^|\\s+)"+_445+"(\\s+|$)")).test(dojo.html.getClass(node));
-};
-dojo.html.prependClass=function(node,_447){
-_447+=" "+dojo.html.getClass(node);
-return dojo.html.setClass(node,_447);
-};
-dojo.html.addClass=function(node,_449){
-if(dojo.html.hasClass(node,_449)){
-return false;
-}
-_449=(dojo.html.getClass(node)+" "+_449).replace(/^\s+|\s+$/g,"");
-return dojo.html.setClass(node,_449);
-};
-dojo.html.setClass=function(node,_44b){
-node=dojo.byId(node);
-var cs=new String(_44b);
-try{
-if(typeof node.className=="string"){
-node.className=cs;
-}else{
-if(node.setAttribute){
-node.setAttribute("class",_44b);
-node.className=cs;
-}else{
-return false;
-}
-}
-}
-catch(e){
-dojo.debug("dojo.html.setClass() failed",e);
-}
-return true;
-};
-dojo.html.removeClass=function(node,_44e,_44f){
-try{
-if(!_44f){
-var _450=dojo.html.getClass(node).replace(new RegExp("(^|\\s+)"+_44e+"(\\s+|$)"),"$1$2");
-}else{
-var _450=dojo.html.getClass(node).replace(_44e,"");
-}
-dojo.html.setClass(node,_450);
-}
-catch(e){
-dojo.debug("dojo.html.removeClass() failed",e);
-}
-return true;
-};
-dojo.html.replaceClass=function(node,_452,_453){
-dojo.html.removeClass(node,_453);
-dojo.html.addClass(node,_452);
-};
-dojo.html.classMatchType={ContainsAll:0,ContainsAny:1,IsOnly:2};
-dojo.html.getElementsByClass=function(_454,_455,_456,_457,_458){
-_458=false;
-var _459=dojo.doc();
-_455=dojo.byId(_455)||_459;
-var _45a=_454.split(/\s+/g);
-var _45b=[];
-if(_457!=1&&_457!=2){
-_457=0;
-}
-var _45c=new RegExp("(\\s|^)(("+_45a.join(")|(")+"))(\\s|$)");
-var _45d=_45a.join(" ").length;
-var _45e=[];
-if(!_458&&_459.evaluate){
-var _45f=".//"+(_456||"*")+"[contains(";
-if(_457!=dojo.html.classMatchType.ContainsAny){
-_45f+="concat(' ',@class,' '), ' "+_45a.join(" ') and contains(concat(' ',@class,' '), ' ")+" ')";
-if(_457==2){
-_45f+=" and string-length(@class)="+_45d+"]";
-}else{
-_45f+="]";
-}
-}else{
-_45f+="concat(' ',@class,' '), ' "+_45a.join(" ') or contains(concat(' ',@class,' '), ' ")+" ')]";
-}
-var _460=_459.evaluate(_45f,_455,null,XPathResult.ANY_TYPE,null);
-var _461=_460.iterateNext();
-while(_461){
-try{
-_45e.push(_461);
-_461=_460.iterateNext();
-}
-catch(e){
-break;
-}
-}
-return _45e;
-}else{
-if(!_456){
-_456="*";
-}
-_45e=_455.getElementsByTagName(_456);
-var node,i=0;
-outer:
-while(node=_45e[i++]){
-var _464=dojo.html.getClasses(node);
-if(_464.length==0){
-continue outer;
-}
-var _465=0;
-for(var j=0;j<_464.length;j++){
-if(_45c.test(_464[j])){
-if(_457==dojo.html.classMatchType.ContainsAny){
-_45b.push(node);
-continue outer;
-}else{
-_465++;
-}
-}else{
-if(_457==dojo.html.classMatchType.IsOnly){
-continue outer;
-}
-}
-}
-if(_465==_45a.length){
-if((_457==dojo.html.classMatchType.IsOnly)&&(_465==_464.length)){
-_45b.push(node);
-}else{
-if(_457==dojo.html.classMatchType.ContainsAll){
-_45b.push(node);
-}
-}
-}
-}
-return _45b;
-}
-};
-dojo.html.getElementsByClassName=dojo.html.getElementsByClass;
-dojo.html.toCamelCase=function(_467){
-var arr=_467.split("-"),cc=arr[0];
-for(var i=1;i=1){
-if(h.ie){
-dojo.html.clearOpacity(node);
-return;
-}else{
-_4d7=0.999999;
-}
-}else{
-if(_4d7<0){
-_4d7=0;
-}
-}
-}
-if(h.ie){
-if(node.nodeName.toLowerCase()=="tr"){
-var tds=node.getElementsByTagName("td");
-for(var x=0;x=0.999999?1:Number(opac);
-};
-dojo.provide("dojo.html.color");
-dojo.html.getBackgroundColor=function(node){
-node=dojo.byId(node);
-var _4e3;
-do{
-_4e3=dojo.html.getStyle(node,"background-color");
-if(_4e3.toLowerCase()=="rgba(0, 0, 0, 0)"){
-_4e3="transparent";
-}
-if(node==document.getElementsByTagName("body")[0]){
-node=null;
-break;
-}
-node=node.parentNode;
-}while(node&&dojo.lang.inArray(["transparent",""],_4e3));
-if(_4e3=="transparent"){
-_4e3=[255,255,255,0];
-}else{
-_4e3=dojo.gfx.color.extractRGB(_4e3);
-}
-return _4e3;
-};
-dojo.provide("dojo.html.layout");
-dojo.html.sumAncestorProperties=function(node,prop){
-node=dojo.byId(node);
-if(!node){
-return 0;
-}
-var _4e6=0;
-while(node){
-if(dojo.html.getComputedStyle(node,"position")=="fixed"){
-return 0;
-}
-var val=node[prop];
-if(val){
-_4e6+=val-0;
-if(node==dojo.body()){
-break;
-}
-}
-node=node.parentNode;
-}
-return _4e6;
-};
-dojo.html.setStyleAttributes=function(node,_4e9){
-node=dojo.byId(node);
-var _4ea=_4e9.replace(/(;)?\s*$/,"").split(";");
-for(var i=0;i<_4ea.length;i++){
-var _4ec=_4ea[i].split(":");
-var name=_4ec[0].replace(/\s*$/,"").replace(/^\s*/,"").toLowerCase();
-var _4ee=_4ec[1].replace(/\s*$/,"").replace(/^\s*/,"");
-switch(name){
-case "opacity":
-dojo.html.setOpacity(node,_4ee);
-break;
-case "content-height":
-dojo.html.setContentBox(node,{height:_4ee});
-break;
-case "content-width":
-dojo.html.setContentBox(node,{width:_4ee});
-break;
-case "outer-height":
-dojo.html.setMarginBox(node,{height:_4ee});
-break;
-case "outer-width":
-dojo.html.setMarginBox(node,{width:_4ee});
-break;
-default:
-node.style[dojo.html.toCamelCase(name)]=_4ee;
-}
-}
-};
-dojo.html.boxSizing={MARGIN_BOX:"margin-box",BORDER_BOX:"border-box",PADDING_BOX:"padding-box",CONTENT_BOX:"content-box"};
-dojo.html.getAbsolutePosition=dojo.html.abs=function(node,_4f0,_4f1){
-node=dojo.byId(node,node.ownerDocument);
-var ret={x:0,y:0};
-var bs=dojo.html.boxSizing;
-if(!_4f1){
-_4f1=bs.CONTENT_BOX;
-}
-var _4f4=2;
-var _4f5;
-switch(_4f1){
-case bs.MARGIN_BOX:
-_4f5=3;
-break;
-case bs.BORDER_BOX:
-_4f5=2;
-break;
-case bs.PADDING_BOX:
-default:
-_4f5=1;
-break;
-case bs.CONTENT_BOX:
-_4f5=0;
-break;
-}
-var h=dojo.render.html;
-var db=document["body"]||document["documentElement"];
-if(h.ie){
-with(node.getBoundingClientRect()){
-ret.x=left-2;
-ret.y=top-2;
-}
-}else{
-if(document.getBoxObjectFor){
-_4f4=1;
-try{
-var bo=document.getBoxObjectFor(node);
-ret.x=bo.x-dojo.html.sumAncestorProperties(node,"scrollLeft");
-ret.y=bo.y-dojo.html.sumAncestorProperties(node,"scrollTop");
-}
-catch(e){
-}
-}else{
-if(node["offsetParent"]){
-var _4f9;
-if((h.safari)&&(node.style.getPropertyValue("position")=="absolute")&&(node.parentNode==db)){
-_4f9=db;
-}else{
-_4f9=db.parentNode;
-}
-if(node.parentNode!=db){
-var nd=node;
-if(dojo.render.html.opera){
-nd=db;
-}
-ret.x-=dojo.html.sumAncestorProperties(nd,"scrollLeft");
-ret.y-=dojo.html.sumAncestorProperties(nd,"scrollTop");
-}
-var _4fb=node;
-do{
-var n=_4fb["offsetLeft"];
-if(!h.opera||n>0){
-ret.x+=isNaN(n)?0:n;
-}
-var m=_4fb["offsetTop"];
-ret.y+=isNaN(m)?0:m;
-_4fb=_4fb.offsetParent;
-}while((_4fb!=_4f9)&&(_4fb!=null));
-}else{
-if(node["x"]&&node["y"]){
-ret.x+=isNaN(node.x)?0:node.x;
-ret.y+=isNaN(node.y)?0:node.y;
-}
-}
-}
-}
-if(_4f0){
-var _4fe=dojo.html.getScroll();
-ret.y+=_4fe.top;
-ret.x+=_4fe.left;
-}
-var _4ff=[dojo.html.getPaddingExtent,dojo.html.getBorderExtent,dojo.html.getMarginExtent];
-if(_4f4>_4f5){
-for(var i=_4f5;i<_4f4;++i){
-ret.y+=_4ff[i](node,"top");
-ret.x+=_4ff[i](node,"left");
-}
-}else{
-if(_4f4<_4f5){
-for(var i=_4f5;i>_4f4;--i){
-ret.y-=_4ff[i-1](node,"top");
-ret.x-=_4ff[i-1](node,"left");
-}
-}
-}
-ret.top=ret.y;
-ret.left=ret.x;
-return ret;
-};
-dojo.html.isPositionAbsolute=function(node){
-return (dojo.html.getComputedStyle(node,"position")=="absolute");
-};
-dojo.html._sumPixelValues=function(node,_503,_504){
-var _505=0;
-for(var x=0;x<_503.length;x++){
-_505+=dojo.html.getPixelValue(node,_503[x],_504);
-}
-return _505;
-};
-dojo.html.getMargin=function(node){
-return {width:dojo.html._sumPixelValues(node,["margin-left","margin-right"],(dojo.html.getComputedStyle(node,"position")=="absolute")),height:dojo.html._sumPixelValues(node,["margin-top","margin-bottom"],(dojo.html.getComputedStyle(node,"position")=="absolute"))};
-};
-dojo.html.getBorder=function(node){
-return {width:dojo.html.getBorderExtent(node,"left")+dojo.html.getBorderExtent(node,"right"),height:dojo.html.getBorderExtent(node,"top")+dojo.html.getBorderExtent(node,"bottom")};
-};
-dojo.html.getBorderExtent=function(node,side){
-return (dojo.html.getStyle(node,"border-"+side+"-style")=="none"?0:dojo.html.getPixelValue(node,"border-"+side+"-width"));
-};
-dojo.html.getMarginExtent=function(node,side){
-return dojo.html._sumPixelValues(node,["margin-"+side],dojo.html.isPositionAbsolute(node));
-};
-dojo.html.getPaddingExtent=function(node,side){
-return dojo.html._sumPixelValues(node,["padding-"+side],true);
-};
-dojo.html.getPadding=function(node){
-return {width:dojo.html._sumPixelValues(node,["padding-left","padding-right"],true),height:dojo.html._sumPixelValues(node,["padding-top","padding-bottom"],true)};
-};
-dojo.html.getPadBorder=function(node){
-var pad=dojo.html.getPadding(node);
-var _512=dojo.html.getBorder(node);
-return {width:pad.width+_512.width,height:pad.height+_512.height};
-};
-dojo.html.getBoxSizing=function(node){
-var h=dojo.render.html;
-var bs=dojo.html.boxSizing;
-if(((h.ie)||(h.opera))&&node.nodeName.toLowerCase()!="img"){
-var cm=document["compatMode"];
-if((cm=="BackCompat")||(cm=="QuirksMode")){
-return bs.BORDER_BOX;
-}else{
-return bs.CONTENT_BOX;
-}
-}else{
-if(arguments.length==0){
-node=document.documentElement;
-}
-var _517;
-if(!h.ie){
-_517=dojo.html.getStyle(node,"-moz-box-sizing");
-if(!_517){
-_517=dojo.html.getStyle(node,"box-sizing");
-}
-}
-return (_517?_517:bs.CONTENT_BOX);
-}
-};
-dojo.html.isBorderBox=function(node){
-return (dojo.html.getBoxSizing(node)==dojo.html.boxSizing.BORDER_BOX);
-};
-dojo.html.getBorderBox=function(node){
-node=dojo.byId(node);
-return {width:node.offsetWidth,height:node.offsetHeight};
-};
-dojo.html.getPaddingBox=function(node){
-var box=dojo.html.getBorderBox(node);
-var _51c=dojo.html.getBorder(node);
-return {width:box.width-_51c.width,height:box.height-_51c.height};
-};
-dojo.html.getContentBox=function(node){
-node=dojo.byId(node);
-var _51e=dojo.html.getPadBorder(node);
-return {width:node.offsetWidth-_51e.width,height:node.offsetHeight-_51e.height};
-};
-dojo.html.setContentBox=function(node,args){
-node=dojo.byId(node);
-var _521=0;
-var _522=0;
-var isbb=dojo.html.isBorderBox(node);
-var _524=(isbb?dojo.html.getPadBorder(node):{width:0,height:0});
-var ret={};
-if(typeof args.width!="undefined"){
-_521=args.width+_524.width;
-ret.width=dojo.html.setPositivePixelValue(node,"width",_521);
-}
-if(typeof args.height!="undefined"){
-_522=args.height+_524.height;
-ret.height=dojo.html.setPositivePixelValue(node,"height",_522);
-}
-return ret;
-};
-dojo.html.getMarginBox=function(node){
-var _527=dojo.html.getBorderBox(node);
-var _528=dojo.html.getMargin(node);
-return {width:_527.width+_528.width,height:_527.height+_528.height};
-};
-dojo.html.setMarginBox=function(node,args){
-node=dojo.byId(node);
-var _52b=0;
-var _52c=0;
-var isbb=dojo.html.isBorderBox(node);
-var _52e=(!isbb?dojo.html.getPadBorder(node):{width:0,height:0});
-var _52f=dojo.html.getMargin(node);
-var ret={};
-if(typeof args.width!="undefined"){
-_52b=args.width-_52e.width;
-_52b-=_52f.width;
-ret.width=dojo.html.setPositivePixelValue(node,"width",_52b);
-}
-if(typeof args.height!="undefined"){
-_52c=args.height-_52e.height;
-_52c-=_52f.height;
-ret.height=dojo.html.setPositivePixelValue(node,"height",_52c);
-}
-return ret;
-};
-dojo.html.getElementBox=function(node,type){
-var bs=dojo.html.boxSizing;
-switch(type){
-case bs.MARGIN_BOX:
-return dojo.html.getMarginBox(node);
-case bs.BORDER_BOX:
-return dojo.html.getBorderBox(node);
-case bs.PADDING_BOX:
-return dojo.html.getPaddingBox(node);
-case bs.CONTENT_BOX:
-default:
-return dojo.html.getContentBox(node);
-}
-};
-dojo.html.toCoordinateObject=dojo.html.toCoordinateArray=function(_534,_535,_536){
-if(_534 instanceof Array||typeof _534=="array"){
-dojo.deprecated("dojo.html.toCoordinateArray","use dojo.html.toCoordinateObject({left: , top: , width: , height: }) instead","0.5");
-while(_534.length<4){
-_534.push(0);
-}
-while(_534.length>4){
-_534.pop();
-}
-var ret={left:_534[0],top:_534[1],width:_534[2],height:_534[3]};
-}else{
-if(!_534.nodeType&&!(_534 instanceof String||typeof _534=="string")&&("width" in _534||"height" in _534||"left" in _534||"x" in _534||"top" in _534||"y" in _534)){
-var ret={left:_534.left||_534.x||0,top:_534.top||_534.y||0,width:_534.width||0,height:_534.height||0};
-}else{
-var node=dojo.byId(_534);
-var pos=dojo.html.abs(node,_535,_536);
-var _53a=dojo.html.getMarginBox(node);
-var ret={left:pos.left,top:pos.top,width:_53a.width,height:_53a.height};
-}
-}
-ret.x=ret.left;
-ret.y=ret.top;
-return ret;
-};
-dojo.html.setMarginBoxWidth=dojo.html.setOuterWidth=function(node,_53c){
-return dojo.html._callDeprecated("setMarginBoxWidth","setMarginBox",arguments,"width");
-};
-dojo.html.setMarginBoxHeight=dojo.html.setOuterHeight=function(){
-return dojo.html._callDeprecated("setMarginBoxHeight","setMarginBox",arguments,"height");
-};
-dojo.html.getMarginBoxWidth=dojo.html.getOuterWidth=function(){
-return dojo.html._callDeprecated("getMarginBoxWidth","getMarginBox",arguments,null,"width");
-};
-dojo.html.getMarginBoxHeight=dojo.html.getOuterHeight=function(){
-return dojo.html._callDeprecated("getMarginBoxHeight","getMarginBox",arguments,null,"height");
-};
-dojo.html.getTotalOffset=function(node,type,_53f){
-return dojo.html._callDeprecated("getTotalOffset","getAbsolutePosition",arguments,null,type);
-};
-dojo.html.getAbsoluteX=function(node,_541){
-return dojo.html._callDeprecated("getAbsoluteX","getAbsolutePosition",arguments,null,"x");
-};
-dojo.html.getAbsoluteY=function(node,_543){
-return dojo.html._callDeprecated("getAbsoluteY","getAbsolutePosition",arguments,null,"y");
-};
-dojo.html.totalOffsetLeft=function(node,_545){
-return dojo.html._callDeprecated("totalOffsetLeft","getAbsolutePosition",arguments,null,"left");
-};
-dojo.html.totalOffsetTop=function(node,_547){
-return dojo.html._callDeprecated("totalOffsetTop","getAbsolutePosition",arguments,null,"top");
-};
-dojo.html.getMarginWidth=function(node){
-return dojo.html._callDeprecated("getMarginWidth","getMargin",arguments,null,"width");
-};
-dojo.html.getMarginHeight=function(node){
-return dojo.html._callDeprecated("getMarginHeight","getMargin",arguments,null,"height");
-};
-dojo.html.getBorderWidth=function(node){
-return dojo.html._callDeprecated("getBorderWidth","getBorder",arguments,null,"width");
-};
-dojo.html.getBorderHeight=function(node){
-return dojo.html._callDeprecated("getBorderHeight","getBorder",arguments,null,"height");
-};
-dojo.html.getPaddingWidth=function(node){
-return dojo.html._callDeprecated("getPaddingWidth","getPadding",arguments,null,"width");
-};
-dojo.html.getPaddingHeight=function(node){
-return dojo.html._callDeprecated("getPaddingHeight","getPadding",arguments,null,"height");
-};
-dojo.html.getPadBorderWidth=function(node){
-return dojo.html._callDeprecated("getPadBorderWidth","getPadBorder",arguments,null,"width");
-};
-dojo.html.getPadBorderHeight=function(node){
-return dojo.html._callDeprecated("getPadBorderHeight","getPadBorder",arguments,null,"height");
-};
-dojo.html.getBorderBoxWidth=dojo.html.getInnerWidth=function(){
-return dojo.html._callDeprecated("getBorderBoxWidth","getBorderBox",arguments,null,"width");
-};
-dojo.html.getBorderBoxHeight=dojo.html.getInnerHeight=function(){
-return dojo.html._callDeprecated("getBorderBoxHeight","getBorderBox",arguments,null,"height");
-};
-dojo.html.getContentBoxWidth=dojo.html.getContentWidth=function(){
-return dojo.html._callDeprecated("getContentBoxWidth","getContentBox",arguments,null,"width");
-};
-dojo.html.getContentBoxHeight=dojo.html.getContentHeight=function(){
-return dojo.html._callDeprecated("getContentBoxHeight","getContentBox",arguments,null,"height");
-};
-dojo.html.setContentBoxWidth=dojo.html.setContentWidth=function(node,_551){
-return dojo.html._callDeprecated("setContentBoxWidth","setContentBox",arguments,"width");
-};
-dojo.html.setContentBoxHeight=dojo.html.setContentHeight=function(node,_553){
-return dojo.html._callDeprecated("setContentBoxHeight","setContentBox",arguments,"height");
-};
-dojo.provide("dojo.lfx.html");
-dojo.lfx.html._byId=function(_554){
-if(!_554){
-return [];
-}
-if(dojo.lang.isArrayLike(_554)){
-if(!_554.alreadyChecked){
-var n=[];
-dojo.lang.forEach(_554,function(node){
-n.push(dojo.byId(node));
-});
-n.alreadyChecked=true;
-return n;
-}else{
-return _554;
-}
-}else{
-var n=[];
-n.push(dojo.byId(_554));
-n.alreadyChecked=true;
-return n;
-}
-};
-dojo.lfx.html.propertyAnimation=function(_557,_558,_559,_55a,_55b){
-_557=dojo.lfx.html._byId(_557);
-var _55c={"propertyMap":_558,"nodes":_557,"duration":_559,"easing":_55a||dojo.lfx.easeDefault};
-var _55d=function(args){
-if(args.nodes.length==1){
-var pm=args.propertyMap;
-if(!dojo.lang.isArray(args.propertyMap)){
-var parr=[];
-for(var _561 in pm){
-pm[_561].property=_561;
-parr.push(pm[_561]);
-}
-pm=args.propertyMap=parr;
-}
-dojo.lang.forEach(pm,function(prop){
-if(dj_undef("start",prop)){
-if(prop.property!="opacity"){
-prop.start=parseInt(dojo.html.getComputedStyle(args.nodes[0],prop.property));
-}else{
-prop.start=dojo.html.getOpacity(args.nodes[0]);
-}
-}
-});
-}
-};
-var _563=function(_564){
-var _565=[];
-dojo.lang.forEach(_564,function(c){
-_565.push(Math.round(c));
-});
-return _565;
-};
-var _567=function(n,_569){
-n=dojo.byId(n);
-if(!n||!n.style){
-return;
-}
-for(var s in _569){
-try{
-if(s=="opacity"){
-dojo.html.setOpacity(n,_569[s]);
-}else{
-n.style[s]=_569[s];
-}
-}
-catch(e){
-dojo.debug(e);
-}
-}
-};
-var _56b=function(_56c){
-this._properties=_56c;
-this.diffs=new Array(_56c.length);
-dojo.lang.forEach(_56c,function(prop,i){
-if(dojo.lang.isFunction(prop.start)){
-prop.start=prop.start(prop,i);
-}
-if(dojo.lang.isFunction(prop.end)){
-prop.end=prop.end(prop,i);
-}
-if(dojo.lang.isArray(prop.start)){
-this.diffs[i]=null;
-}else{
-if(prop.start instanceof dojo.gfx.color.Color){
-prop.startRgb=prop.start.toRgb();
-prop.endRgb=prop.end.toRgb();
-}else{
-this.diffs[i]=prop.end-prop.start;
-}
-}
-},this);
-this.getValue=function(n){
-var ret={};
-dojo.lang.forEach(this._properties,function(prop,i){
-var _573=null;
-if(dojo.lang.isArray(prop.start)){
-}else{
-if(prop.start instanceof dojo.gfx.color.Color){
-_573=(prop.units||"rgb")+"(";
-for(var j=0;j3){
-_5e8.pop();
-}
-var rgb=new dojo.gfx.color.Color(_5e2);
-var _5ed=new dojo.gfx.color.Color(_5e8);
-var anim=dojo.lfx.propertyAnimation(node,{"background-color":{start:rgb,end:_5ed}},_5e3,_5e4,{"beforeBegin":function(){
-if(_5ea){
-node.style.backgroundImage="none";
-}
-node.style.backgroundColor="rgb("+rgb.toRgb().join(",")+")";
-},"onEnd":function(){
-if(_5ea){
-node.style.backgroundImage=_5ea;
-}
-if(_5eb){
-node.style.backgroundColor="transparent";
-}
-if(_5e5){
-_5e5(node,anim);
-}
-}});
-_5e6.push(anim);
-});
-return dojo.lfx.combine(_5e6);
-};
-dojo.lfx.html.unhighlight=function(_5ef,_5f0,_5f1,_5f2,_5f3){
-_5ef=dojo.lfx.html._byId(_5ef);
-var _5f4=[];
-dojo.lang.forEach(_5ef,function(node){
-var _5f6=new dojo.gfx.color.Color(dojo.html.getBackgroundColor(node));
-var rgb=new dojo.gfx.color.Color(_5f0);
-var _5f8=dojo.html.getStyle(node,"background-image");
-var anim=dojo.lfx.propertyAnimation(node,{"background-color":{start:_5f6,end:rgb}},_5f1,_5f2,{"beforeBegin":function(){
-if(_5f8){
-node.style.backgroundImage="none";
-}
-node.style.backgroundColor="rgb("+_5f6.toRgb().join(",")+")";
-},"onEnd":function(){
-if(_5f3){
-_5f3(node,anim);
-}
-}});
-_5f4.push(anim);
-});
-return dojo.lfx.combine(_5f4);
-};
-dojo.lang.mixin(dojo.lfx,dojo.lfx.html);
-dojo.kwCompoundRequire({browser:["dojo.lfx.html"],dashboard:["dojo.lfx.html"]});
-dojo.provide("dojo.lfx.*");
-
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/dojo.js.uncompressed.js b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/dojo.js.uncompressed.js
deleted file mode 100644
index eb451b283..000000000
--- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/dojo.js.uncompressed.js
+++ /dev/null
@@ -1,9865 +0,0 @@
-/*
- Copyright (c) 2004-2006, The Dojo Foundation
- All Rights Reserved.
-
- Licensed under the Academic Free License version 2.1 or above OR the
- modified BSD license. For more information on Dojo licensing, see:
-
- http://dojotoolkit.org/community/licensing.shtml
-*/
-
-if(typeof dojo == "undefined"){
-
-// TODOC: HOW TO DOC THE BELOW?
-// @global: djConfig
-// summary:
-// Application code can set the global 'djConfig' prior to loading
-// the library to override certain global settings for how dojo works.
-// description: The variables that can be set are as follows:
-// - isDebug: false
-// - allowQueryConfig: false
-// - baseScriptUri: ""
-// - baseRelativePath: ""
-// - libraryScriptUri: ""
-// - iePreventClobber: false
-// - ieClobberMinimal: true
-// - locale: undefined
-// - extraLocale: undefined
-// - preventBackButtonFix: true
-// - searchIds: []
-// - parseWidgets: true
-// TODOC: HOW TO DOC THESE VARIABLES?
-// TODOC: IS THIS A COMPLETE LIST?
-// note:
-// 'djConfig' does not exist under 'dojo.*' so that it can be set before the
-// 'dojo' variable exists.
-// note:
-// Setting any of these variables *after* the library has loaded does nothing at all.
-// TODOC: is this still true? Release notes for 0.3 indicated they could be set after load.
-//
-
-
-//TODOC: HOW TO DOC THIS?
-// @global: dj_global
-// summary:
-// an alias for the top-level global object in the host environment
-// (e.g., the window object in a browser).
-// description:
-// Refer to 'dj_global' rather than referring to window to ensure your
-// code runs correctly in contexts other than web browsers (eg: Rhino on a server).
-var dj_global = this;
-
-//TODOC: HOW TO DOC THIS?
-// @global: dj_currentContext
-// summary:
-// Private global context object. Where 'dj_global' always refers to the boot-time
-// global context, 'dj_currentContext' can be modified for temporary context shifting.
-// dojo.global() returns dj_currentContext.
-// description:
-// Refer to dojo.global() rather than referring to dj_global to ensure your
-// code runs correctly in managed contexts.
-var dj_currentContext = this;
-
-
-// ****************************************************************
-// global public utils
-// TODOC: DO WE WANT TO NOTE THAT THESE ARE GLOBAL PUBLIC UTILS?
-// ****************************************************************
-
-function dj_undef(/*String*/ name, /*Object?*/ object){
- //summary: Returns true if 'name' is defined on 'object' (or globally if 'object' is null).
- //description: Note that 'defined' and 'exists' are not the same concept.
- return (typeof (object || dj_currentContext)[name] == "undefined"); // Boolean
-}
-
-// make sure djConfig is defined
-if(dj_undef("djConfig", this)){
- var djConfig = {};
-}
-
-//TODOC: HOW TO DOC THIS?
-// dojo is the root variable of (almost all) our public symbols -- make sure it is defined.
-if(dj_undef("dojo", this)){
- var dojo = {};
-}
-
-dojo.global = function(){
- // summary:
- // return the current global context object
- // (e.g., the window object in a browser).
- // description:
- // Refer to 'dojo.global()' rather than referring to window to ensure your
- // code runs correctly in contexts other than web browsers (eg: Rhino on a server).
- return dj_currentContext;
-}
-
-// Override locale setting, if specified
-dojo.locale = djConfig.locale;
-
-//TODOC: HOW TO DOC THIS?
-dojo.version = {
- // summary: version number of this instance of dojo.
- major: 0, minor: 4, patch: 3, flag: "",
- revision: Number("$Rev$".match(/[0-9]+/)[0]),
- toString: function(){
- with(dojo.version){
- return major + "." + minor + "." + patch + flag + " (" + revision + ")"; // String
- }
- }
-}
-
-dojo.evalProp = function(/*String*/ name, /*Object*/ object, /*Boolean?*/ create){
- // summary: Returns 'object[name]'. If not defined and 'create' is true, will return a new Object.
- // description:
- // Returns null if 'object[name]' is not defined and 'create' is not true.
- // Note: 'defined' and 'exists' are not the same concept.
- if((!object)||(!name)) return undefined; // undefined
- if(!dj_undef(name, object)) return object[name]; // mixed
- return (create ? (object[name]={}) : undefined); // mixed
-}
-
-dojo.parseObjPath = function(/*String*/ path, /*Object?*/ context, /*Boolean?*/ create){
- // summary: Parse string path to an object, and return corresponding object reference and property name.
- // description:
- // Returns an object with two properties, 'obj' and 'prop'.
- // 'obj[prop]' is the reference indicated by 'path'.
- // path: Path to an object, in the form "A.B.C".
- // context: Object to use as root of path. Defaults to 'dojo.global()'.
- // create: If true, Objects will be created at any point along the 'path' that is undefined.
- var object = (context || dojo.global());
- var names = path.split('.');
- var prop = names.pop();
- for (var i=0,l=names.length;i 1) {
- dh.modulesLoadedListeners.push(function() {
- obj[functionName]();
- });
- }
-
- //Added for xdomain loading. dojo.addOnLoad is used to
- //indicate callbacks after doing some dojo.require() statements.
- //In the xdomain case, if all the requires are loaded (after initial
- //page load), then immediately call any listeners.
- if(dh.post_load_ && dh.inFlightCount == 0 && !dh.loadNotifying){
- dh.callLoaded();
- }
-}
-
-dojo.addOnUnload = function(/*Object?*/obj, /*String|Function?*/functionName){
-// summary: registers a function to be triggered when the page unloads
-//
-// usage:
-// dojo.addOnLoad(functionPointer)
-// dojo.addOnLoad(object, "functionName")
- var dh = dojo.hostenv;
- if(arguments.length == 1){
- dh.unloadListeners.push(obj);
- } else if(arguments.length > 1) {
- dh.unloadListeners.push(function() {
- obj[functionName]();
- });
- }
-}
-
-dojo.hostenv.modulesLoaded = function(){
- if(this.post_load_){ return; }
- if(this.loadUriStack.length==0 && this.getTextStack.length==0){
- if(this.inFlightCount > 0){
- dojo.debug("files still in flight!");
- return;
- }
- dojo.hostenv.callLoaded();
- }
-}
-
-dojo.hostenv.callLoaded = function(){
- //The "object" check is for IE, and the other opera check fixes an issue
- //in Opera where it could not find the body element in some widget test cases.
- //For 0.9, maybe route all browsers through the setTimeout (need protection
- //still for non-browser environments though). This might also help the issue with
- //FF 2.0 and freezing issues where we try to do sync xhr while background css images
- //are being loaded (trac #2572)? Consider for 0.9.
- if(typeof setTimeout == "object" || (djConfig["useXDomain"] && dojo.render.html.opera)){
- setTimeout("dojo.hostenv.loaded();", 0);
- }else{
- dojo.hostenv.loaded();
- }
-}
-
-dojo.hostenv.getModuleSymbols = function(/*String*/modulename){
-// summary:
-// Converts a module name in dotted JS notation to an array representing the path in the source tree
- var syms = modulename.split(".");
- for(var i = syms.length; i>0; i--){
- var parentModule = syms.slice(0, i).join(".");
- if((i==1) && !this.moduleHasPrefix(parentModule)){
- // Support default module directory (sibling of dojo) for top-level modules
- syms[0] = "../" + syms[0];
- }else{
- var parentModulePath = this.getModulePrefix(parentModule);
- if(parentModulePath != parentModule){
- syms.splice(0, i, parentModulePath);
- break;
- }
- }
- }
- return syms; // Array
-}
-
-dojo.hostenv._global_omit_module_check = false;
-dojo.hostenv.loadModule = function(/*String*/moduleName, /*Boolean?*/exactOnly, /*Boolean?*/omitModuleCheck){
-// summary:
-// loads a Javascript module from the appropriate URI
-//
-// description:
-// loadModule("A.B") first checks to see if symbol A.B is defined.
-// If it is, it is simply returned (nothing to do).
-//
-// If it is not defined, it will look for "A/B.js" in the script root directory,
-// followed by "A.js".
-//
-// It throws if it cannot find a file to load, or if the symbol A.B is not
-// defined after loading.
-//
-// It returns the object A.B.
-//
-// This does nothing about importing symbols into the current package.
-// It is presumed that the caller will take care of that. For example, to import
-// all symbols:
-//
-// with (dojo.hostenv.loadModule("A.B")) {
-// ...
-// }
-//
-// And to import just the leaf symbol:
-//
-// var B = dojo.hostenv.loadModule("A.B");
-// ...
-//
-// dj_load is an alias for dojo.hostenv.loadModule
-
- if(!moduleName){ return; }
- omitModuleCheck = this._global_omit_module_check || omitModuleCheck;
- var module = this.findModule(moduleName, false);
- if(module){
- return module;
- }
-
- // protect against infinite recursion from mutual dependencies
- if(dj_undef(moduleName, this.loading_modules_)){
- this.addedToLoadingCount.push(moduleName);
- }
- this.loading_modules_[moduleName] = 1;
-
- // convert periods to slashes
- var relpath = moduleName.replace(/\./g, '/') + '.js';
-
- var nsyms = moduleName.split(".");
-
- // this line allowed loading of a module manifest as if it were a namespace
- // it's an interesting idea, but shouldn't be combined with 'namespaces' proper
- // and leads to unwanted dependencies
- // the effect can be achieved in other (albeit less-flexible) ways now, so I am
- // removing this pending further design work
- // perhaps we can explicitly define this idea of a 'module manifest', and subclass
- // 'namespace manifest' from that
- //dojo.getNamespace(nsyms[0]);
-
- var syms = this.getModuleSymbols(moduleName);
- var startedRelative = ((syms[0].charAt(0) != '/') && !syms[0].match(/^\w+:/));
- var last = syms[syms.length - 1];
- var ok;
- // figure out if we're looking for a full package, if so, we want to do
- // things slightly diffrently
- if(last=="*"){
- moduleName = nsyms.slice(0, -1).join('.');
- while(syms.length){
- syms.pop();
- syms.push(this.pkgFileName);
- relpath = syms.join("/") + '.js';
- if(startedRelative && relpath.charAt(0)=="/"){
- relpath = relpath.slice(1);
- }
- ok = this.loadPath(relpath, !omitModuleCheck ? moduleName : null);
- if(ok){ break; }
- syms.pop();
- }
- }else{
- relpath = syms.join("/") + '.js';
- moduleName = nsyms.join('.');
- var modArg = !omitModuleCheck ? moduleName : null;
- ok = this.loadPath(relpath, modArg);
- if(!ok && !exactOnly){
- syms.pop();
- while(syms.length){
- relpath = syms.join('/') + '.js';
- ok = this.loadPath(relpath, modArg);
- if(ok){ break; }
- syms.pop();
- relpath = syms.join('/') + '/'+this.pkgFileName+'.js';
- if(startedRelative && relpath.charAt(0)=="/"){
- relpath = relpath.slice(1);
- }
- ok = this.loadPath(relpath, modArg);
- if(ok){ break; }
- }
- }
-
- if(!ok && !omitModuleCheck){
- dojo.raise("Could not load '" + moduleName + "'; last tried '" + relpath + "'");
- }
- }
-
- // check that the symbol was defined
- //Don't bother if we're doing xdomain (asynchronous) loading.
- if(!omitModuleCheck && !this["isXDomain"]){
- // pass in false so we can give better error
- module = this.findModule(moduleName, false);
- if(!module){
- dojo.raise("symbol '" + moduleName + "' is not defined after loading '" + relpath + "'");
- }
- }
-
- return module;
-}
-
-dojo.hostenv.startPackage = function(/*String*/packageName){
-// summary:
-// Creates a JavaScript package
-//
-// description:
-// startPackage("A.B") follows the path, and at each level creates a new empty
-// object or uses what already exists. It returns the result.
-//
-// packageName: the package to be created as a String in dot notation
-
- //Make sure we have a string.
- var fullPkgName = String(packageName);
- var strippedPkgName = fullPkgName;
-
- var syms = packageName.split(/\./);
- if(syms[syms.length-1]=="*"){
- syms.pop();
- strippedPkgName = syms.join(".");
- }
- var evaledPkg = dojo.evalObjPath(strippedPkgName, true);
- this.loaded_modules_[fullPkgName] = evaledPkg;
- this.loaded_modules_[strippedPkgName] = evaledPkg;
-
- return evaledPkg; // Object
-}
-
-dojo.hostenv.findModule = function(/*String*/moduleName, /*Boolean?*/mustExist){
-// summary:
-// Returns the Object representing the module, if it exists, otherwise null.
-//
-// moduleName A fully qualified module including package name, like 'A.B'.
-// mustExist Optional, default false. throw instead of returning null
-// if the module does not currently exist.
-
- var lmn = String(moduleName);
-
- if(this.loaded_modules_[lmn]){
- return this.loaded_modules_[lmn]; // Object
- }
-
- if(mustExist){
- dojo.raise("no loaded module named '" + moduleName + "'");
- }
- return null; // null
-}
-
-//Start of old bootstrap2:
-
-dojo.kwCompoundRequire = function(/*Object containing Arrays*/modMap){
-// description:
-// This method taks a "map" of arrays which one can use to optionally load dojo
-// modules. The map is indexed by the possible dojo.hostenv.name_ values, with
-// two additional values: "default" and "common". The items in the "default"
-// array will be loaded if none of the other items have been choosen based on
-// the hostenv.name_ item. The items in the "common" array will _always_ be
-// loaded, regardless of which list is chosen. Here's how it's normally
-// called:
-//
-// dojo.kwCompoundRequire({
-// browser: [
-// ["foo.bar.baz", true, true], // an example that passes multiple args to loadModule()
-// "foo.sample.*",
-// "foo.test,
-// ],
-// default: [ "foo.sample.*" ],
-// common: [ "really.important.module.*" ]
-// });
-
- var common = modMap["common"]||[];
- var result = modMap[dojo.hostenv.name_] ? common.concat(modMap[dojo.hostenv.name_]||[]) : common.concat(modMap["default"]||[]);
-
- for(var x=0; x,
- // relative to Dojo root. For example, module acme is mapped to ../acme.
- // If you want to use a different module name, use dojo.registerModulePath.
- return dojo.hostenv.setModulePrefix(module, prefix);
-}
-
-if(djConfig["modulePaths"]){
- for(var param in djConfig["modulePaths"]){
- dojo.registerModulePath(param, djConfig["modulePaths"][param]);
- }
-}
-
-dojo.setModulePrefix = function(/*String*/module, /*String*/prefix){
- // summary: maps a module name to a path
- dojo.deprecated('dojo.setModulePrefix("' + module + '", "' + prefix + '")', "replaced by dojo.registerModulePath", "0.5");
- return dojo.registerModulePath(module, prefix);
-}
-
-dojo.exists = function(/*Object*/obj, /*String*/name){
- // summary: determine if an object supports a given method
- // description: useful for longer api chains where you have to test each object in the chain
- var p = name.split(".");
- for(var i = 0; i < p.length; i++){
- if(!obj[p[i]]){ return false; } // Boolean
- obj = obj[p[i]];
- }
- return true; // Boolean
-}
-
-// Localization routines
-
-dojo.hostenv.normalizeLocale = function(/*String?*/locale){
-// summary:
-// Returns canonical form of locale, as used by Dojo. All variants are case-insensitive and are separated by '-'
-// as specified in RFC 3066. If no locale is specified, the user agent's default is returned.
-
- var result = locale ? locale.toLowerCase() : dojo.locale;
- if(result == "root"){
- result = "ROOT";
- }
- return result;// String
-};
-
-dojo.hostenv.searchLocalePath = function(/*String*/locale, /*Boolean*/down, /*Function*/searchFunc){
-// summary:
-// A helper method to assist in searching for locale-based resources. Will iterate through
-// the variants of a particular locale, either up or down, executing a callback function.
-// For example, "en-us" and true will try "en-us" followed by "en" and finally "ROOT".
-
- locale = dojo.hostenv.normalizeLocale(locale);
-
- var elements = locale.split('-');
- var searchlist = [];
- for(var i = elements.length; i > 0; i--){
- searchlist.push(elements.slice(0, i).join('-'));
- }
- searchlist.push(false);
- if(down){searchlist.reverse();}
-
- for(var j = searchlist.length - 1; j >= 0; j--){
- var loc = searchlist[j] || "ROOT";
- var stop = searchFunc(loc);
- if(stop){ break; }
- }
-}
-
-//These two functions are placed outside of preloadLocalizations
-//So that the xd loading can use/override them.
-dojo.hostenv.localesGenerated /***BUILD:localesGenerated***/; // value will be inserted here at build time, if necessary
-
-dojo.hostenv.registerNlsPrefix = function(){
-// summary:
-// Register module "nls" to point where Dojo can find pre-built localization files
- dojo.registerModulePath("nls","nls");
-}
-
-dojo.hostenv.preloadLocalizations = function(){
-// summary:
-// Load built, flattened resource bundles, if available for all locales used in the page.
-// Execute only once. Note that this is a no-op unless there is a build.
-
- if(dojo.hostenv.localesGenerated){
- dojo.hostenv.registerNlsPrefix();
-
- function preload(locale){
- locale = dojo.hostenv.normalizeLocale(locale);
- dojo.hostenv.searchLocalePath(locale, true, function(loc){
- for(var i=0; i bestLocale.length){
- bestLocale = flatLocales[i];
- }
- }
- }
- if(!bestLocale){
- bestLocale = "ROOT";
- }
- }
-
- //See if the desired locale is already loaded.
- var tempLocale = availableFlatLocales ? bestLocale : targetLocale;
- var bundle = dojo.hostenv.findModule(bundlePackage);
- var localizedBundle = null;
- if(bundle){
- if(djConfig.localizationComplete && bundle._built){return;}
- var jsLoc = tempLocale.replace('-', '_');
- var translationPackage = bundlePackage+"."+jsLoc;
- localizedBundle = dojo.hostenv.findModule(translationPackage);
- }
-
- if(!localizedBundle){
- bundle = dojo.hostenv.startPackage(bundlePackage);
- var syms = dojo.hostenv.getModuleSymbols(moduleName);
- var modpath = syms.concat("nls").join("/");
- var parent;
-
- dojo.hostenv.searchLocalePath(tempLocale, availableFlatLocales, function(loc){
- var jsLoc = loc.replace('-', '_');
- var translationPackage = bundlePackage + "." + jsLoc;
- var loaded = false;
- if(!dojo.hostenv.findModule(translationPackage)){
- // Mark loaded whether it's found or not, so that further load attempts will not be made
- dojo.hostenv.startPackage(translationPackage);
- var module = [modpath];
- if(loc != "ROOT"){module.push(loc);}
- module.push(bundleName);
- var filespec = module.join("/") + '.js';
- loaded = dojo.hostenv.loadPath(filespec, null, function(hash){
- // Use singleton with prototype to point to parent bundle, then mix-in result from loadPath
- var clazz = function(){};
- clazz.prototype = parent;
- bundle[jsLoc] = new clazz();
- for(var j in hash){ bundle[jsLoc][j] = hash[j]; }
- });
- }else{
- loaded = true;
- }
- if(loaded && bundle[jsLoc]){
- parent = bundle[jsLoc];
- }else{
- bundle[jsLoc] = parent;
- }
-
- if(availableFlatLocales){
- //Stop the locale path searching if we know the availableFlatLocales, since
- //the first call to this function will load the only bundle that is needed.
- return true;
- }
- });
- }
-
- //Save the best locale bundle as the target locale bundle when we know the
- //the available bundles.
- if(availableFlatLocales && targetLocale != bestLocale){
- bundle[targetLocale.replace('-', '_')] = bundle[bestLocale.replace('-', '_')];
- }
-};
-
-(function(){
- // If other locales are used, dojo.requireLocalization should load them as well, by default.
- // Override dojo.requireLocalization to do load the default bundle, then iterate through the
- // extraLocale list and load those translations as well, unless a particular locale was requested.
-
- var extra = djConfig.extraLocale;
- if(extra){
- if(!extra instanceof Array){
- extra = [extra];
- }
-
- var req = dojo.requireLocalization;
- dojo.requireLocalization = function(m, b, locale, availableFlatLocales){
- req(m,b,locale, availableFlatLocales);
- if(locale){return;}
- for(var i=0; i 1){
- var paramStr = params[1];
- var pairs = paramStr.split("&");
- for(var x in pairs){
- var sp = pairs[x].split("=");
- // FIXME: is this eval dangerous?
- if((sp[0].length > 9)&&(sp[0].substr(0, 9) == "djConfig.")){
- var opt = sp[0].substr(9);
- try{
- djConfig[opt]=eval(sp[1]);
- }catch(e){
- djConfig[opt]=sp[1];
- }
- }
- }
- }
- }
-
- if(
- ((djConfig["baseScriptUri"] == "")||(djConfig["baseRelativePath"] == "")) &&
- (document && document.getElementsByTagName)
- ){
- var scripts = document.getElementsByTagName("script");
- var rePkg = /(__package__|dojo|bootstrap1)\.js([\?\.]|$)/i;
- for(var i = 0; i < scripts.length; i++) {
- var src = scripts[i].getAttribute("src");
- if(!src) { continue; }
- var m = src.match(rePkg);
- if(m) {
- var root = src.substring(0, m.index);
- if(src.indexOf("bootstrap1") > -1) { root += "../"; }
- if(!this["djConfig"]) { djConfig = {}; }
- if(djConfig["baseScriptUri"] == "") { djConfig["baseScriptUri"] = root; }
- if(djConfig["baseRelativePath"] == "") { djConfig["baseRelativePath"] = root; }
- break;
- }
- }
- }
-
- // fill in the rendering support information in dojo.render.*
- var dr = dojo.render;
- var drh = dojo.render.html;
- var drs = dojo.render.svg;
- var dua = (drh.UA = navigator.userAgent);
- var dav = (drh.AV = navigator.appVersion);
- var t = true;
- var f = false;
- drh.capable = t;
- drh.support.builtin = t;
-
- dr.ver = parseFloat(drh.AV);
- dr.os.mac = dav.indexOf("Macintosh") >= 0;
- dr.os.win = dav.indexOf("Windows") >= 0;
- // could also be Solaris or something, but it's the same browser
- dr.os.linux = dav.indexOf("X11") >= 0;
-
- drh.opera = dua.indexOf("Opera") >= 0;
- drh.khtml = (dav.indexOf("Konqueror") >= 0)||(dav.indexOf("Safari") >= 0);
- drh.safari = dav.indexOf("Safari") >= 0;
- var geckoPos = dua.indexOf("Gecko");
- drh.mozilla = drh.moz = (geckoPos >= 0)&&(!drh.khtml);
- if (drh.mozilla) {
- // gecko version is YYYYMMDD
- drh.geckoVersion = dua.substring(geckoPos + 6, geckoPos + 14);
- }
- drh.ie = (document.all)&&(!drh.opera);
- drh.ie50 = drh.ie && dav.indexOf("MSIE 5.0")>=0;
- drh.ie55 = drh.ie && dav.indexOf("MSIE 5.5")>=0;
- drh.ie60 = drh.ie && dav.indexOf("MSIE 6.0")>=0;
- drh.ie70 = drh.ie && dav.indexOf("MSIE 7.0")>=0;
-
- var cm = document["compatMode"];
- drh.quirks = (cm == "BackCompat")||(cm == "QuirksMode")||drh.ie55||drh.ie50;
-
- // TODO: is the HTML LANG attribute relevant?
- dojo.locale = dojo.locale || (drh.ie ? navigator.userLanguage : navigator.language).toLowerCase();
-
- dr.vml.capable=drh.ie;
- drs.capable = f;
- drs.support.plugin = f;
- drs.support.builtin = f;
- var tdoc = window["document"];
- var tdi = tdoc["implementation"];
-
- if((tdi)&&(tdi["hasFeature"])&&(tdi.hasFeature("org.w3c.dom.svg", "1.0"))){
- drs.capable = t;
- drs.support.builtin = t;
- drs.support.plugin = f;
- }
- // webkits after 420 support SVG natively. The test string is "AppleWebKit/420+"
- if(drh.safari){
- var tmp = dua.split("AppleWebKit/")[1];
- var ver = parseFloat(tmp.split(" ")[0]);
- if(ver >= 420){
- drs.capable = t;
- drs.support.builtin = t;
- drs.support.plugin = f;
- }
- }else{
- }
- })();
-
- dojo.hostenv.startPackage("dojo.hostenv");
-
- dojo.render.name = dojo.hostenv.name_ = 'browser';
- dojo.hostenv.searchIds = [];
-
- // These are in order of decreasing likelihood; this will change in time.
- dojo.hostenv._XMLHTTP_PROGIDS = ['Msxml2.XMLHTTP', 'Microsoft.XMLHTTP', 'Msxml2.XMLHTTP.4.0'];
-
- dojo.hostenv.getXmlhttpObject = function(){
- // summary: does the work of portably generating a new XMLHTTPRequest object.
- var http = null;
- var last_e = null;
- try{ http = new XMLHttpRequest(); }catch(e){}
- if(!http){
- for(var i=0; i<3; ++i){
- var progid = dojo.hostenv._XMLHTTP_PROGIDS[i];
- try{
- http = new ActiveXObject(progid);
- }catch(e){
- last_e = e;
- }
-
- if(http){
- dojo.hostenv._XMLHTTP_PROGIDS = [progid]; // so faster next time
- break;
- }
- }
-
- /*if(http && !http.toString) {
- http.toString = function() { "[object XMLHttpRequest]"; }
- }*/
- }
-
- if(!http){
- return dojo.raise("XMLHTTP not available", last_e);
- }
-
- return http; // XMLHTTPRequest instance
- }
-
- dojo.hostenv._blockAsync = false;
- dojo.hostenv.getText = function(uri, async_cb, fail_ok){
- // summary: Read the contents of the specified uri and return those contents.
- // uri:
- // A relative or absolute uri. If absolute, it still must be in
- // the same "domain" as we are.
- // async_cb:
- // If not specified, load synchronously. If specified, load
- // asynchronously, and use async_cb as the progress handler which
- // takes the xmlhttp object as its argument. If async_cb, this
- // function returns null.
- // fail_ok:
- // Default false. If fail_ok and !async_cb and loading fails,
- // return null instead of throwing.
-
- // need to block async callbacks from snatching this thread as the result
- // of an async callback might call another sync XHR, this hangs khtml forever
- // hostenv._blockAsync must also be checked in BrowserIO's watchInFlight()
- // NOTE: must be declared before scope switches ie. this.getXmlhttpObject()
- if(!async_cb){ this._blockAsync = true; }
-
- var http = this.getXmlhttpObject();
-
- function isDocumentOk(http){
- var stat = http["status"];
- // allow a 304 use cache, needed in konq (is this compliant with the http spec?)
- return Boolean((!stat)||((200 <= stat)&&(300 > stat))||(stat==304));
- }
-
- if(async_cb){
- var _this = this, timer = null, gbl = dojo.global();
- var xhr = dojo.evalObjPath("dojo.io.XMLHTTPTransport");
- http.onreadystatechange = function(){
- if(timer){ gbl.clearTimeout(timer); timer = null; }
- if(_this._blockAsync || (xhr && xhr._blockAsync)){
- timer = gbl.setTimeout(function () { http.onreadystatechange.apply(this); }, 10);
- }else{
- if(4==http.readyState){
- if(isDocumentOk(http)){
- // dojo.debug("LOADED URI: "+uri);
- async_cb(http.responseText);
- }
- }
- }
- }
- }
-
- http.open('GET', uri, async_cb ? true : false);
- try{
- http.send(null);
- if(async_cb){
- return null;
- }
- if(!isDocumentOk(http)){
- var err = Error("Unable to load "+uri+" status:"+ http.status);
- err.status = http.status;
- err.responseText = http.responseText;
- throw err;
- }
- }catch(e){
- this._blockAsync = false;
- if((fail_ok)&&(!async_cb)){
- return null;
- }else{
- throw e;
- }
- }
-
- this._blockAsync = false;
- return http.responseText; // String
- }
-
- dojo.hostenv.defaultDebugContainerId = 'dojoDebug';
- dojo.hostenv._println_buffer = [];
- dojo.hostenv._println_safe = false;
- dojo.hostenv.println = function(/*String*/line){
- // summary:
- // prints the provided line to whatever logging container is
- // available. If the page isn't loaded yet, the line may be added
- // to a buffer for printing later.
- if(!dojo.hostenv._println_safe){
- dojo.hostenv._println_buffer.push(line);
- }else{
- try {
- var console = document.getElementById(djConfig.debugContainerId ?
- djConfig.debugContainerId : dojo.hostenv.defaultDebugContainerId);
- if(!console) { console = dojo.body(); }
-
- var div = document.createElement("div");
- div.appendChild(document.createTextNode(line));
- console.appendChild(div);
- } catch (e) {
- try{
- // safari needs the output wrapped in an element for some reason
- document.write("
" + line + "
");
- }catch(e2){
- window.status = line;
- }
- }
- }
- }
-
- dojo.addOnLoad(function(){
- dojo.hostenv._println_safe = true;
- while(dojo.hostenv._println_buffer.length > 0){
- dojo.hostenv.println(dojo.hostenv._println_buffer.shift());
- }
- });
-
- function dj_addNodeEvtHdlr(/*DomNode*/node, /*String*/evtName, /*Function*/fp){
- // summary:
- // non-destructively adds the specified function to the node's
- // evtName handler.
- // node: the DomNode to add the handler to
- // evtName: should be in the form "click" for "onclick" handlers
- var oldHandler = node["on"+evtName] || function(){};
- node["on"+evtName] = function(){
- fp.apply(node, arguments);
- oldHandler.apply(node, arguments);
- }
- return true;
- }
-
- dojo.hostenv._djInitFired = false;
- // BEGIN DOMContentLoaded, from Dean Edwards (http://dean.edwards.name/weblog/2006/06/again/)
- function dj_load_init(e){
- dojo.hostenv._djInitFired = true;
- // allow multiple calls, only first one will take effect
- // A bug in khtml calls events callbacks for document for event which isnt supported
- // for example a created contextmenu event calls DOMContentLoaded, workaround
- var type = (e && e.type) ? e.type.toLowerCase() : "load";
- if(arguments.callee.initialized || (type!="domcontentloaded" && type!="load")){ return; }
- arguments.callee.initialized = true;
- if(typeof(_timer) != 'undefined'){
- clearInterval(_timer);
- delete _timer;
- }
-
- var initFunc = function(){
- //perform initialization
- if(dojo.render.html.ie){
- dojo.hostenv.makeWidgets();
- }
- };
-
- if(dojo.hostenv.inFlightCount == 0){
- initFunc();
- dojo.hostenv.modulesLoaded();
- }else{
- //This else case should be xdomain loading.
- //Make sure this is the first thing in the load listener array.
- //Part of the dojo.addOnLoad guarantee is that when the listeners are notified,
- //It means the DOM (or page) has loaded and that widgets have been parsed.
- dojo.hostenv.modulesLoadedListeners.unshift(initFunc);
- }
- }
-
- // START DOMContentLoaded
- // Mozilla and Opera 9 expose the event we could use
- if(document.addEventListener){
- // NOTE:
- // due to a threading issue in Firefox 2.0, we can't enable
- // DOMContentLoaded on that platform. For more information, see:
- // http://trac.dojotoolkit.org/ticket/1704
- if(dojo.render.html.opera || (dojo.render.html.moz && (djConfig["enableMozDomContentLoaded"] === true))){
- document.addEventListener("DOMContentLoaded", dj_load_init, null);
- }
-
- // mainly for Opera 8.5, won't be fired if DOMContentLoaded fired already.
- // also used for Mozilla because of trac #1640
- window.addEventListener("load", dj_load_init, null);
- }
-
- // for Internet Explorer. readyState will not be achieved on init call, but dojo doesn't need it
- // however, we'll include it because we don't know if there are other functions added that might.
- // Note that this has changed because the build process strips all comments--including conditional
- // ones.
- if(dojo.render.html.ie && dojo.render.os.win){
- document.attachEvent("onreadystatechange", function(e){
- if(document.readyState == "complete"){
- dj_load_init();
- }
- });
- }
-
- if (/(WebKit|khtml)/i.test(navigator.userAgent)) { // sniff
- var _timer = setInterval(function() {
- if (/loaded|complete/.test(document.readyState)) {
- dj_load_init(); // call the onload handler
- }
- }, 10);
- }
- // END DOMContentLoaded
-
- // IE WebControl hosted in an application can fire "beforeunload" and "unload"
- // events when control visibility changes, causing Dojo to unload too soon. The
- // following code fixes the problem
- // Reference: http://support.microsoft.com/default.aspx?scid=kb;en-us;199155
- if(dojo.render.html.ie){
- dj_addNodeEvtHdlr(window, "beforeunload", function(){
- dojo.hostenv._unloading = true;
- window.setTimeout(function() {
- dojo.hostenv._unloading = false;
- }, 0);
- });
- }
-
- dj_addNodeEvtHdlr(window, "unload", function(){
- dojo.hostenv.unloaded();
- if((!dojo.render.html.ie)||(dojo.render.html.ie && dojo.hostenv._unloading)){
- dojo.hostenv.unloaded();
- }
- });
-
- dojo.hostenv.makeWidgets = function(){
- // you can put searchIds in djConfig and dojo.hostenv at the moment
- // we should probably eventually move to one or the other
- var sids = [];
- if(djConfig.searchIds && djConfig.searchIds.length > 0) {
- sids = sids.concat(djConfig.searchIds);
- }
- if(dojo.hostenv.searchIds && dojo.hostenv.searchIds.length > 0) {
- sids = sids.concat(dojo.hostenv.searchIds);
- }
-
- if((djConfig.parseWidgets)||(sids.length > 0)){
- if(dojo.evalObjPath("dojo.widget.Parse")){
- // we must do this on a delay to avoid:
- // http://www.shaftek.org/blog/archives/000212.html
- // (IE bug)
- var parser = new dojo.xml.Parse();
- if(sids.length > 0){
- for(var x=0; x 0, trim from start, if wh < 0, trim from end, else both
- if(!str.replace){ return str; }
- if(!str.length){ return str; }
- var re = (wh > 0) ? (/^\s+/) : (wh < 0) ? (/\s+$/) : (/^\s+|\s+$/g);
- return str.replace(re, ""); // string
-}
-
-dojo.string.trimStart = function(/* string */str) {
- // summary
- // Trim whitespace at the beginning of 'str'
- return dojo.string.trim(str, 1); // string
-}
-
-dojo.string.trimEnd = function(/* string */str) {
- // summary
- // Trim whitespace at the end of 'str'
- return dojo.string.trim(str, -1);
-}
-
-dojo.string.repeat = function(/* string */str, /* integer */count, /* string? */separator) {
- // summary
- // Return 'str' repeated 'count' times, optionally placing 'separator' between each rep
- var out = "";
- for(var i = 0; i < count; i++) {
- out += str;
- if(separator && i < count - 1) {
- out += separator;
- }
- }
- return out; // string
-}
-
-dojo.string.pad = function(/* string */str, /* integer */len/*=2*/, /* string */ c/*='0'*/, /* integer */dir/*=1*/) {
- // summary
- // Pad 'str' to guarantee that it is at least 'len' length with the character 'c' at either the
- // start (dir=1) or end (dir=-1) of the string
- var out = String(str);
- if(!c) {
- c = '0';
- }
- if(!dir) {
- dir = 1;
- }
- while(out.length < len) {
- if(dir > 0) {
- out = c + out;
- } else {
- out += c;
- }
- }
- return out; // string
-}
-
-dojo.string.padLeft = function(/* string */str, /* integer */len, /* string */c) {
- // summary
- // same as dojo.string.pad(str, len, c, 1)
- return dojo.string.pad(str, len, c, 1); // string
-}
-
-dojo.string.padRight = function(/* string */str, /* integer */len, /* string */c) {
- // summary
- // same as dojo.string.pad(str, len, c, -1)
- return dojo.string.pad(str, len, c, -1); // string
-}
-
-dojo.provide("dojo.string");
-
-
-dojo.provide("dojo.lang.common");
-
-dojo.lang.inherits = function(/*Function*/subclass, /*Function*/superclass){
- // summary: Set up inheritance between two classes.
- if(!dojo.lang.isFunction(superclass)){
- dojo.raise("dojo.inherits: superclass argument ["+superclass+"] must be a function (subclass: ["+subclass+"']");
- }
- subclass.prototype = new superclass();
- subclass.prototype.constructor = subclass;
- subclass.superclass = superclass.prototype;
- // DEPRECATED: super is a reserved word, use 'superclass'
- subclass['super'] = superclass.prototype;
-}
-
-dojo.lang._mixin = function(/*Object*/ obj, /*Object*/ props){
- // summary:
- // Adds all properties and methods of props to obj. This addition is
- // "prototype extension safe", so that instances of objects will not
- // pass along prototype defaults.
- var tobj = {};
- for(var x in props){
- // the "tobj" condition avoid copying properties in "props"
- // inherited from Object.prototype. For example, if obj has a custom
- // toString() method, don't overwrite it with the toString() method
- // that props inherited from Object.protoype
- if((typeof tobj[x] == "undefined") || (tobj[x] != props[x])){
- obj[x] = props[x];
- }
- }
- // IE doesn't recognize custom toStrings in for..in
- if(dojo.render.html.ie
- && (typeof(props["toString"]) == "function")
- && (props["toString"] != obj["toString"])
- && (props["toString"] != tobj["toString"]))
- {
- obj.toString = props.toString;
- }
- return obj; // Object
-}
-
-dojo.lang.mixin = function(/*Object*/obj, /*Object...*/props){
- // summary: Adds all properties and methods of props to obj.
- for(var i=1, l=arguments.length; i -1; // boolean
-}
-
-/**
- * Partial implmentation of is* functions from
- * http://www.crockford.com/javascript/recommend.html
- * NOTE: some of these may not be the best thing to use in all situations
- * as they aren't part of core JS and therefore can't work in every case.
- * See WARNING messages inline for tips.
- *
- * The following is* functions are fairly "safe"
- */
-
-dojo.lang.isObject = function(/*anything*/ it){
- // summary: Return true if it is an Object, Array or Function.
- if(typeof it == "undefined"){ return false; }
- return (typeof it == "object" || it === null || dojo.lang.isArray(it) || dojo.lang.isFunction(it)); // Boolean
-}
-
-dojo.lang.isArray = function(/*anything*/ it){
- // summary: Return true if it is an Array.
- return (it && it instanceof Array || typeof it == "array"); // Boolean
-}
-
-dojo.lang.isArrayLike = function(/*anything*/ it){
- // summary:
- // Return true if it can be used as an array (i.e. is an object with
- // an integer length property).
- if((!it)||(dojo.lang.isUndefined(it))){ return false; }
- if(dojo.lang.isString(it)){ return false; }
- if(dojo.lang.isFunction(it)){ return false; } // keeps out built-in constructors (Number, String, ...) which have length properties
- if(dojo.lang.isArray(it)){ return true; }
- // form node itself is ArrayLike, but not always iterable. Use form.elements instead.
- if((it.tagName)&&(it.tagName.toLowerCase()=='form')){ return false; }
- if(dojo.lang.isNumber(it.length) && isFinite(it.length)){ return true; }
- return false; // Boolean
-}
-
-dojo.lang.isFunction = function(/*anything*/ it){
- // summary: Return true if it is a Function.
- return (it instanceof Function || typeof it == "function"); // Boolean
-};
-
-(function(){
- // webkit treats NodeList as a function, which is bad
- if((dojo.render.html.capable)&&(dojo.render.html["safari"])){
- dojo.lang.isFunction = function(/*anything*/ it){
- if((typeof(it) == "function") && (it == "[object NodeList]")) { return false; }
- return (it instanceof Function || typeof it == "function"); // Boolean
- }
- }
-})();
-
-dojo.lang.isString = function(/*anything*/ it){
- // summary: Return true if it is a String.
- return (typeof it == "string" || it instanceof String);
-}
-
-dojo.lang.isAlien = function(/*anything*/ it){
- // summary: Return true if it is not a built-in function. False if not.
- if(!it){ return false; }
- return !dojo.lang.isFunction(it) && /\{\s*\[native code\]\s*\}/.test(String(it)); // Boolean
-}
-
-dojo.lang.isBoolean = function(/*anything*/ it){
- // summary: Return true if it is a Boolean.
- return (it instanceof Boolean || typeof it == "boolean"); // Boolean
-}
-
-/**
- * The following is***() functions are somewhat "unsafe". Fortunately,
- * there are workarounds the the language provides and are mentioned
- * in the WARNING messages.
- *
- */
-dojo.lang.isNumber = function(/*anything*/ it){
- // summary: Return true if it is a number.
- // description:
- // WARNING - In most cases, isNaN(it) is sufficient to determine whether or not
- // something is a number or can be used as such. For example, a number or string
- // can be used interchangably when accessing array items (array["1"] is the same as
- // array[1]) and isNaN will return false for both values ("1" and 1). However,
- // isNumber("1") will return false, which is generally not too useful.
- // Also, isNumber(NaN) returns true, again, this isn't generally useful, but there
- // are corner cases (like when you want to make sure that two things are really
- // the same type of thing). That is really where isNumber "shines".
- //
- // Recommendation - Use isNaN(it) when possible
-
- return (it instanceof Number || typeof it == "number"); // Boolean
-}
-
-/*
- * FIXME: Should isUndefined go away since it is error prone?
- */
-dojo.lang.isUndefined = function(/*anything*/ it){
- // summary: Return true if it is not defined.
- // description:
- // WARNING - In some cases, isUndefined will not behave as you
- // might expect. If you do isUndefined(foo) and there is no earlier
- // reference to foo, an error will be thrown before isUndefined is
- // called. It behaves correctly if you scope yor object first, i.e.
- // isUndefined(foo.bar) where foo is an object and bar isn't a
- // property of the object.
- //
- // Recommendation - Use typeof foo == "undefined" when possible
-
- return ((typeof(it) == "undefined")&&(it == undefined)); // Boolean
-}
-
-// end Crockford functions
-
-dojo.provide("dojo.lang.extras");
-
-
-
-dojo.lang.setTimeout = function(/*Function*/func, /*int*/delay /*, ...*/){
- // summary:
- // Sets a timeout in milliseconds to execute a function in a given
- // context with optional arguments.
- // usage:
- // dojo.lang.setTimeout(Object context, function func, number delay[, arg1[, ...]]);
- // dojo.lang.setTimeout(function func, number delay[, arg1[, ...]]);
-
- var context = window, argsStart = 2;
- if(!dojo.lang.isFunction(func)){
- context = func;
- func = delay;
- delay = arguments[2];
- argsStart++;
- }
-
- if(dojo.lang.isString(func)){
- func = context[func];
- }
-
- var args = [];
- for (var i = argsStart; i < arguments.length; i++){
- args.push(arguments[i]);
- }
- return dojo.global().setTimeout(function(){ func.apply(context, args); }, delay); // int
-}
-
-dojo.lang.clearTimeout = function(/*int*/timer){
- // summary: clears timer by number from the execution queue
-
- // FIXME:
- // why do we have this function? It's not portable outside of browser
- // environments and it's a stupid wrapper on something that browsers
- // provide anyway.
- dojo.global().clearTimeout(timer);
-}
-
-dojo.lang.getNameInObj = function(/*Object*/ns, /*unknown*/item){
- // summary:
- // looks for a value in the object ns with a value matching item and
- // returns the property name
- // ns: if null, dj_global is used
- // item: value to return a name for
- if(!ns){ ns = dj_global; }
-
- for(var x in ns){
- if(ns[x] === item){
- return new String(x); // String
- }
- }
- return null; // null
-}
-
-dojo.lang.shallowCopy = function(/*Object*/obj, /*Boolean?*/deep){
- // summary:
- // copies object obj one level deep, or full depth if deep is true
- var i, ret;
-
- if(obj === null){ /*obj: null*/ return null; } // null
-
- if(dojo.lang.isObject(obj)){
- // obj: Object
- ret = new obj.constructor();
- for(i in obj){
- if(dojo.lang.isUndefined(ret[i])){
- ret[i] = deep ? dojo.lang.shallowCopy(obj[i], deep) : obj[i];
- }
- }
- }else if(dojo.lang.isArray(obj)){
- // obj: Array
- ret = [];
- for(i=0; i hacks:
- * iframe document hacks allow browsers to communicate asynchronously
- * with a server via HTTP POST and GET operations. With significant
- * effort and server cooperation, low-latency data transit between
- * client and server can be acheived via iframe mechanisms (repubsub).
- *
- * SVG:
- * Adobe's SVG viewer implements helpful primitives for XML-based
- * requests, but receipt of arbitrary text data seems unlikely w/o
- * sections.
- *
- *
- * A discussion between Dylan, Mark, Tom, and Alex helped to lay down a lot
- * the IO API interface. A transcript of it can be found at:
- * http://dojotoolkit.org/viewcvs/viewcvs.py/documents/irc/irc_io_api_log.txt?rev=307&view=auto
- *
- * Also referenced in the design of the API was the DOM 3 L&S spec:
- * http://www.w3.org/TR/2004/REC-DOM-Level-3-LS-20040407/load-save.html
- ******************************************************************************/
-
-// a map of the available transport options. Transports should add themselves
-// by calling add(name)
-dojo.io.transports = [];
-dojo.io.hdlrFuncNames = [ "load", "error", "timeout" ]; // we're omitting a progress() event for now
-
-dojo.io.Request = function(/*String*/ url, /*String*/ mimetype, /*String*/ transport, /*String or Boolean*/ changeUrl){
-// summary:
-// Constructs a Request object that is used by dojo.io.bind().
-// description:
-// dojo.io.bind() will create one of these for you if
-// you call dojo.io.bind() with an plain object containing the bind parameters.
-// This method can either take the arguments specified, or an Object containing all of the parameters that you
-// want to use to create the dojo.io.Request (similar to how dojo.io.bind() is called.
-// The named parameters to this constructor represent the minimum set of parameters need
- if((arguments.length == 1)&&(arguments[0].constructor == Object)){
- this.fromKwArgs(arguments[0]);
- }else{
- this.url = url;
- if(mimetype){ this.mimetype = mimetype; }
- if(transport){ this.transport = transport; }
- if(arguments.length >= 4){ this.changeUrl = changeUrl; }
- }
-}
-
-dojo.lang.extend(dojo.io.Request, {
-
- /** The URL to hit */
- url: "",
-
- /** The mime type used to interrpret the response body */
- mimetype: "text/plain",
-
- /** The HTTP method to use */
- method: "GET",
-
- /** An Object containing key-value pairs to be included with the request */
- content: undefined, // Object
-
- /** The transport medium to use */
- transport: undefined, // String
-
- /** If defined the URL of the page is physically changed */
- changeUrl: undefined, // String
-
- /** A form node to use in the request */
- formNode: undefined, // HTMLFormElement
-
- /** Whether the request should be made synchronously */
- sync: false,
-
- bindSuccess: false,
-
- /** Cache/look for the request in the cache before attempting to request?
- * NOTE: this isn't a browser cache, this is internal and would only cache in-page
- */
- useCache: false,
-
- /** Prevent the browser from caching this by adding a query string argument to the URL */
- preventCache: false,
-
- jsonFilter: function(value){
- if( (this.mimetype == "text/json-comment-filtered")||
- (this.mimetype == "application/json-comment-filtered")
- ){
- var cStartIdx = value.indexOf("\/*");
- var cEndIdx = value.lastIndexOf("*\/");
- if((cStartIdx == -1)||(cEndIdx == -1)){
- dojo.debug("your JSON wasn't comment filtered!"); // FIXME: throw exception instead?
- return "";
- }
- return value.substring(cStartIdx+2, cEndIdx);
- }
- dojo.debug("please consider using a mimetype of text/json-comment-filtered to avoid potential security issues with JSON endpoints");
- return value;
- },
-
- // events stuff
- load: function(/*String*/type, /*Object*/data, /*Object*/transportImplementation, /*Object*/kwArgs){
- // summary:
- // Called on successful completion of a bind.
- // type: String
- // A string with value "load"
- // data: Object
- // The object representing the result of the bind. The actual structure
- // of the data object will depend on the mimetype that was given to bind
- // in the bind arguments.
- // transportImplementation: Object
- // The object that implements a particular transport. Structure is depedent
- // on the transport. For XMLHTTPTransport (dojo.io.BrowserIO), it will be the
- // XMLHttpRequest object from the browser.
- // kwArgs: Object
- // Object that contains the request parameters that were given to the
- // bind call. Useful for storing and retrieving state from when bind
- // was called.
- },
- error: function(/*String*/type, /*Object*/error, /*Object*/transportImplementation, /*Object*/kwArgs){
- // summary:
- // Called when there is an error with a bind.
- // type: String
- // A string with value "error"
- // error: Object
- // The error object. Should be a dojo.io.Error object, but not guaranteed.
- // transportImplementation: Object
- // The object that implements a particular transport. Structure is depedent
- // on the transport. For XMLHTTPTransport (dojo.io.BrowserIO), it will be the
- // XMLHttpRequest object from the browser.
- // kwArgs: Object
- // Object that contains the request parameters that were given to the
- // bind call. Useful for storing and retrieving state from when bind
- // was called.
- },
- timeout: function(/*String*/type, /*Object*/empty, /*Object*/transportImplementation, /*Object*/kwArgs){
- // summary:
- // Called when there is an error with a bind. Only implemented in certain transports at this time.
- // type: String
- // A string with value "timeout"
- // empty: Object
- // Should be null. Just a spacer argument so that load, error, timeout and handle have the
- // same signatures.
- // transportImplementation: Object
- // The object that implements a particular transport. Structure is depedent
- // on the transport. For XMLHTTPTransport (dojo.io.BrowserIO), it will be the
- // XMLHttpRequest object from the browser. May be null for the timeout case for
- // some transports.
- // kwArgs: Object
- // Object that contains the request parameters that were given to the
- // bind call. Useful for storing and retrieving state from when bind
- // was called.
- },
- handle: function(/*String*/type, /*Object*/data, /*Object*/transportImplementation, /*Object*/kwArgs){
- // summary:
- // The handle method can be defined instead of defining separate load, error and timeout
- // callbacks.
- // type: String
- // A string with the type of callback: "load", "error", or "timeout".
- // data: Object
- // See the above callbacks for what this parameter could be.
- // transportImplementation: Object
- // The object that implements a particular transport. Structure is depedent
- // on the transport. For XMLHTTPTransport (dojo.io.BrowserIO), it will be the
- // XMLHttpRequest object from the browser.
- // kwArgs: Object
- // Object that contains the request parameters that were given to the
- // bind call. Useful for storing and retrieving state from when bind
- // was called.
- },
-
- //FIXME: change IframeIO.js to use timeouts?
- // The number of seconds to wait until firing a timeout callback.
- // If it is zero, that means, don't do a timeout check.
- timeoutSeconds: 0,
-
- // the abort method needs to be filled in by the transport that accepts the
- // bind() request
- abort: function(){ },
-
- // backButton: function(){ },
- // forwardButton: function(){ },
-
- fromKwArgs: function(/*Object*/ kwArgs){
- // summary:
- // Creates a dojo.io.Request from a simple object (kwArgs object).
-
- // normalize args
- if(kwArgs["url"]){ kwArgs.url = kwArgs.url.toString(); }
- if(kwArgs["formNode"]) { kwArgs.formNode = dojo.byId(kwArgs.formNode); }
- if(!kwArgs["method"] && kwArgs["formNode"] && kwArgs["formNode"].method) {
- kwArgs.method = kwArgs["formNode"].method;
- }
-
- // backwards compatibility
- if(!kwArgs["handle"] && kwArgs["handler"]){ kwArgs.handle = kwArgs.handler; }
- if(!kwArgs["load"] && kwArgs["loaded"]){ kwArgs.load = kwArgs.loaded; }
- if(!kwArgs["changeUrl"] && kwArgs["changeURL"]) { kwArgs.changeUrl = kwArgs.changeURL; }
-
- // encoding fun!
- kwArgs.encoding = dojo.lang.firstValued(kwArgs["encoding"], djConfig["bindEncoding"], "");
-
- kwArgs.sendTransport = dojo.lang.firstValued(kwArgs["sendTransport"], djConfig["ioSendTransport"], false);
-
- var isFunction = dojo.lang.isFunction;
- for(var x=0; x 0){
- dojo.io.bind(dojo.io._bindQueue.shift());
- }else{
- dojo.io._queueBindInFlight = false;
- }
- }
-}
-dojo.io._bindQueue = [];
-dojo.io._queueBindInFlight = false;
-
-dojo.io.argsFromMap = function(/*Object*/map, /*String?*/encoding, /*String?*/last){
- // summary:
- // Converts name/values pairs in the map object to an URL-encoded string
- // with format of name1=value1&name2=value2...
- // map: Object
- // Object that has the contains the names and values.
- // encoding: String?
- // String to specify how to encode the name and value. If the encoding string
- // contains "utf" (case-insensitive), then encodeURIComponent is used. Otherwise
- // dojo.string.encodeAscii is used.
- // last: String?
- // The last parameter in the list. Helps with final string formatting?
- var enc = /utf/i.test(encoding||"") ? encodeURIComponent : dojo.string.encodeAscii;
- var mapped = [];
- var control = new Object();
- for(var name in map){
- var domap = function(elt){
- var val = enc(name)+"="+enc(elt);
- mapped[(last == name) ? "push" : "unshift"](val);
- }
- if(!control[name]){
- var value = map[name];
- // FIXME: should be isArrayLike?
- if (dojo.lang.isArray(value)){
- dojo.lang.forEach(value, domap);
- }else{
- domap(value);
- }
- }
- }
- return mapped.join("&"); //String
-}
-
-dojo.io.setIFrameSrc = function(/*DOMNode*/ iframe, /*String*/ src, /*Boolean*/ replace){
- //summary:
- // Sets the URL that is loaded in an IFrame. The replace parameter indicates whether
- // location.replace() should be used when changing the location of the iframe.
- try{
- var r = dojo.render.html;
- // dojo.debug(iframe);
- if(!replace){
- if(r.safari){
- iframe.location = src;
- }else{
- frames[iframe.name].location = src;
- }
- }else{
- // Fun with DOM 0 incompatibilities!
- var idoc;
- if(r.ie){
- idoc = iframe.contentWindow.document;
- }else if(r.safari){
- idoc = iframe.document;
- }else{ // if(r.moz){
- idoc = iframe.contentWindow;
- }
-
- //For Safari (at least 2.0.3) and Opera, if the iframe
- //has just been created but it doesn't have content
- //yet, then iframe.document may be null. In that case,
- //use iframe.location and return.
- if(!idoc){
- iframe.location = src;
- return;
- }else{
- idoc.location.replace(src);
- }
- }
- }catch(e){
- dojo.debug(e);
- dojo.debug("setIFrameSrc: "+e);
- }
-}
-
-/*
-dojo.io.sampleTranport = new function(){
- this.canHandle = function(kwArgs){
- // canHandle just tells dojo.io.bind() if this is a good transport to
- // use for the particular type of request.
- if(
- (
- (kwArgs["mimetype"] == "text/plain") ||
- (kwArgs["mimetype"] == "text/html") ||
- (kwArgs["mimetype"] == "text/javascript")
- )&&(
- (kwArgs["method"] == "get") ||
- ( (kwArgs["method"] == "post") && (!kwArgs["formNode"]) )
- )
- ){
- return true;
- }
-
- return false;
- }
-
- this.bind = function(kwArgs){
- var hdlrObj = {};
-
- // set up a handler object
- for(var x=0; x1; });
- // // returns false
- // dojo.lang.every([1, 2, 3, 4], function(item){ return item>0; });
- // // returns true
- return this._everyOrSome(true, arr, callback, thisObject); // Boolean
- },
-
- some: function(/*Array*/arr, /*Function*/callback, /*Object?*/thisObject){
- // summary:
- // determines whether or not any item in the array satisfies the
- // condition implemented by callback. thisObject may be used to
- // scope the call to callback. The function signature is derived
- // from the JavaScript 1.6 Array.some() function. More
- // information on this can be found here:
- // http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:some
- // examples:
- // dojo.lang.some([1, 2, 3, 4], function(item){ return item>1; });
- // // returns true
- // dojo.lang.some([1, 2, 3, 4], function(item){ return item<1; });
- // // returns false
- return this._everyOrSome(false, arr, callback, thisObject); // Boolean
- },
-
- filter: function(/*Array*/arr, /*Function*/callback, /*Object?*/thisObject){
- // summary:
- // returns a new Array with those items from arr that match the
- // condition implemented by callback.thisObject may be used to
- // scope the call to callback. The function signature is derived
- // from the JavaScript 1.6 Array.filter() function, although
- // special accomidation is made in our implementation for strings.
- // More information on the JS 1.6 API can be found here:
- // http://developer.mozilla.org/en/docs/Core_JavaScript_1.5_Reference:Global_Objects:Array:filter
- // examples:
- // dojo.lang.some([1, 2, 3, 4], function(item){ return item>1; });
- // // returns [2, 3, 4]
- var isString = dojo.lang.isString(arr);
- if(isString){ /*arr: String*/arr = arr.split(""); }
- var outArr;
- if(Array.filter){
- outArr = Array.filter(arr, callback, thisObject);
- }else{
- if(!thisObject){
- if(arguments.length >= 3){ dojo.raise("thisObject doesn't exist!"); }
- thisObject = dj_global;
- }
-
- outArr = [];
- for(var i = 0; i < arr.length; i++){
- if(callback.call(thisObject, arr[i], i, arr)){
- outArr.push(arr[i]);
- }
- }
- }
- if(isString){
- return outArr.join(""); // String
- } else {
- return outArr; // Array
- }
- },
-
- unnest: function(/* ... */){
- // summary:
- // Creates a 1-D array out of all the arguments passed,
- // unravelling any array-like objects in the process
- // usage:
- // unnest(1, 2, 3) ==> [1, 2, 3]
- // unnest(1, [2, [3], [[[4]]]]) ==> [1, 2, 3, 4]
-
- var out = [];
- for(var i = 0; i < arguments.length; i++){
- if(dojo.lang.isArrayLike(arguments[i])){
- var add = dojo.lang.unnest.apply(this, arguments[i]);
- out = out.concat(add);
- }else{
- out.push(arguments[i]);
- }
- }
- return out; // Array
- },
-
- toArray: function(/*Object*/arrayLike, /*Number*/startOffset){
- // summary:
- // Converts an array-like object (i.e. arguments, DOMCollection)
- // to an array. Returns a new Array object.
- var array = [];
- for(var i = startOffset||0; i < arrayLike.length; i++){
- array.push(arrayLike[i]);
- }
- return array; // Array
- }
-});
-
-dojo.provide("dojo.lang.func");
-
-
-dojo.lang.hitch = function(/*Object*/thisObject, /*Function|String*/method /*, ...*/){
- // summary:
- // Returns a function that will only ever execute in the a given scope
- // (thisObject). This allows for easy use of object member functions
- // in callbacks and other places in which the "this" keyword may
- // otherwise not reference the expected scope. Any number of default
- // positional arguments may be passed as parameters beyond "method".
- // Each of these values will be used to "placehold" (similar to curry)
- // for the hitched function. Note that the order of arguments may be
- // reversed in a future version.
- // thisObject: the scope to run the method in
- // method:
- // a function to be "bound" to thisObject or the name of the method in
- // thisObject to be used as the basis for the binding
- // usage:
- // dojo.lang.hitch(foo, "bar")(); // runs foo.bar() in the scope of foo
- // dojo.lang.hitch(foo, myFunction); // returns a function that runs myFunction in the scope of foo
-
- var args = [];
- for(var x=2; x"'
-// Optionally skips escapes for single quotes
-
- str = str.replace(/&/gm, "&").replace(//gm, ">").replace(/"/gm, """);
- if(!noSingleQuotes){ str = str.replace(/'/gm, "'"); }
- return str; // string
-}
-
-dojo.string.escapeSql = function(/*string*/str){
-//summary:
-// Adds escape sequences for single quotes in SQL expressions
-
- return str.replace(/'/gm, "''"); //string
-}
-
-dojo.string.escapeRegExp = function(/*string*/str){
-//summary:
-// Adds escape sequences for special characters in regular expressions
-
- return str.replace(/\\/gm, "\\\\").replace(/([\f\b\n\t\r[\^$|?*+(){}])/gm, "\\$1"); // string
-}
-
-//FIXME: should this one also escape backslash?
-dojo.string.escapeJavaScript = function(/*string*/str){
-//summary:
-// Adds escape sequences for single and double quotes as well
-// as non-visible characters in JavaScript string literal expressions
-
- return str.replace(/(["'\f\b\n\t\r])/gm, "\\$1"); // string
-}
-
-//FIXME: looks a lot like escapeJavaScript, just adds quotes? deprecate one?
-dojo.string.escapeString = function(/*string*/str){
-//summary:
-// Adds escape sequences for non-visual characters, double quote and backslash
-// and surrounds with double quotes to form a valid string literal.
- return ('"' + str.replace(/(["\\])/g, '\\$1') + '"'
- ).replace(/[\f]/g, "\\f"
- ).replace(/[\b]/g, "\\b"
- ).replace(/[\n]/g, "\\n"
- ).replace(/[\t]/g, "\\t"
- ).replace(/[\r]/g, "\\r"); // string
-}
-
-// TODO: make an HTML version
-dojo.string.summary = function(/*string*/str, /*number*/len){
-// summary:
-// Truncates 'str' after 'len' characters and appends periods as necessary so that it ends with "..."
-
- if(!len || str.length <= len){
- return str; // string
- }
-
- return str.substring(0, len).replace(/\.+$/, "") + "..."; // string
-}
-
-dojo.string.endsWith = function(/*string*/str, /*string*/end, /*boolean*/ignoreCase){
-// summary:
-// Returns true if 'str' ends with 'end'
-
- if(ignoreCase){
- str = str.toLowerCase();
- end = end.toLowerCase();
- }
- if((str.length - end.length) < 0){
- return false; // boolean
- }
- return str.lastIndexOf(end) == str.length - end.length; // boolean
-}
-
-dojo.string.endsWithAny = function(/*string*/str /* , ... */){
-// summary:
-// Returns true if 'str' ends with any of the arguments[2 -> n]
-
- for(var i = 1; i < arguments.length; i++) {
- if(dojo.string.endsWith(str, arguments[i])) {
- return true; // boolean
- }
- }
- return false; // boolean
-}
-
-dojo.string.startsWith = function(/*string*/str, /*string*/start, /*boolean*/ignoreCase){
-// summary:
-// Returns true if 'str' starts with 'start'
-
- if(ignoreCase) {
- str = str.toLowerCase();
- start = start.toLowerCase();
- }
- return str.indexOf(start) == 0; // boolean
-}
-
-dojo.string.startsWithAny = function(/*string*/str /* , ... */){
-// summary:
-// Returns true if 'str' starts with any of the arguments[2 -> n]
-
- for(var i = 1; i < arguments.length; i++) {
- if(dojo.string.startsWith(str, arguments[i])) {
- return true; // boolean
- }
- }
- return false; // boolean
-}
-
-dojo.string.has = function(/*string*/str /* , ... */) {
-// summary:
-// Returns true if 'str' contains any of the arguments 2 -> n
-
- for(var i = 1; i < arguments.length; i++) {
- if(str.indexOf(arguments[i]) > -1){
- return true; // boolean
- }
- }
- return false; // boolean
-}
-
-dojo.string.normalizeNewlines = function(/*string*/text, /*string? (\n or \r)*/newlineChar){
-// summary:
-// Changes occurences of CR and LF in text to CRLF, or if newlineChar is provided as '\n' or '\r',
-// substitutes newlineChar for occurrences of CR/LF and CRLF
-
- if (newlineChar == "\n"){
- text = text.replace(/\r\n/g, "\n");
- text = text.replace(/\r/g, "\n");
- } else if (newlineChar == "\r"){
- text = text.replace(/\r\n/g, "\r");
- text = text.replace(/\n/g, "\r");
- }else{
- text = text.replace(/([^\r])\n/g, "$1\r\n").replace(/\r([^\n])/g, "\r\n$1");
- }
- return text; // string
-}
-
-dojo.string.splitEscaped = function(/*string*/str, /*string of length=1*/charac){
-// summary:
-// Splits 'str' into an array separated by 'charac', but skips characters escaped with a backslash
-
- var components = [];
- for (var i = 0, prevcomma = 0; i < str.length; i++){
- if (str.charAt(i) == '\\'){ i++; continue; }
- if (str.charAt(i) == charac){
- components.push(str.substring(prevcomma, i));
- prevcomma = i + 1;
- }
- }
- components.push(str.substr(prevcomma));
- return components; // array
-}
-
-dojo.provide("dojo.dom");
-
-dojo.dom.ELEMENT_NODE = 1;
-dojo.dom.ATTRIBUTE_NODE = 2;
-dojo.dom.TEXT_NODE = 3;
-dojo.dom.CDATA_SECTION_NODE = 4;
-dojo.dom.ENTITY_REFERENCE_NODE = 5;
-dojo.dom.ENTITY_NODE = 6;
-dojo.dom.PROCESSING_INSTRUCTION_NODE = 7;
-dojo.dom.COMMENT_NODE = 8;
-dojo.dom.DOCUMENT_NODE = 9;
-dojo.dom.DOCUMENT_TYPE_NODE = 10;
-dojo.dom.DOCUMENT_FRAGMENT_NODE = 11;
-dojo.dom.NOTATION_NODE = 12;
-
-dojo.dom.dojoml = "http://www.dojotoolkit.org/2004/dojoml";
-
-/**
- * comprehensive list of XML namespaces
-**/
-dojo.dom.xmlns = {
- // summary
- // aliases for various common XML namespaces
- svg : "http://www.w3.org/2000/svg",
- smil : "http://www.w3.org/2001/SMIL20/",
- mml : "http://www.w3.org/1998/Math/MathML",
- cml : "http://www.xml-cml.org",
- xlink : "http://www.w3.org/1999/xlink",
- xhtml : "http://www.w3.org/1999/xhtml",
- xul : "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
- xbl : "http://www.mozilla.org/xbl",
- fo : "http://www.w3.org/1999/XSL/Format",
- xsl : "http://www.w3.org/1999/XSL/Transform",
- xslt : "http://www.w3.org/1999/XSL/Transform",
- xi : "http://www.w3.org/2001/XInclude",
- xforms : "http://www.w3.org/2002/01/xforms",
- saxon : "http://icl.com/saxon",
- xalan : "http://xml.apache.org/xslt",
- xsd : "http://www.w3.org/2001/XMLSchema",
- dt: "http://www.w3.org/2001/XMLSchema-datatypes",
- xsi : "http://www.w3.org/2001/XMLSchema-instance",
- rdf : "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
- rdfs : "http://www.w3.org/2000/01/rdf-schema#",
- dc : "http://purl.org/dc/elements/1.1/",
- dcq: "http://purl.org/dc/qualifiers/1.0",
- "soap-env" : "http://schemas.xmlsoap.org/soap/envelope/",
- wsdl : "http://schemas.xmlsoap.org/wsdl/",
- AdobeExtensions : "http://ns.adobe.com/AdobeSVGViewerExtensions/3.0/"
-};
-
-dojo.dom.isNode = function(/* object */wh){
- // summary:
- // checks to see if wh is actually a node.
- if(typeof Element == "function") {
- try {
- return wh instanceof Element; // boolean
- } catch(e) {}
- } else {
- // best-guess
- return wh && !isNaN(wh.nodeType); // boolean
- }
-}
-
-dojo.dom.getUniqueId = function(){
- // summary:
- // returns a unique string for use with any DOM element
- var _document = dojo.doc();
- do {
- var id = "dj_unique_" + (++arguments.callee._idIncrement);
- }while(_document.getElementById(id));
- return id; // string
-}
-dojo.dom.getUniqueId._idIncrement = 0;
-
-dojo.dom.firstElement = dojo.dom.getFirstChildElement = function(/* Element */parentNode, /* string? */tagName){
- // summary:
- // returns the first child element matching tagName
- var node = parentNode.firstChild;
- while(node && node.nodeType != dojo.dom.ELEMENT_NODE){
- node = node.nextSibling;
- }
- if(tagName && node && node.tagName && node.tagName.toLowerCase() != tagName.toLowerCase()) {
- node = dojo.dom.nextElement(node, tagName);
- }
- return node; // Element
-}
-
-dojo.dom.lastElement = dojo.dom.getLastChildElement = function(/* Element */parentNode, /* string? */tagName){
- // summary:
- // returns the last child element matching tagName
- var node = parentNode.lastChild;
- while(node && node.nodeType != dojo.dom.ELEMENT_NODE) {
- node = node.previousSibling;
- }
- if(tagName && node && node.tagName && node.tagName.toLowerCase() != tagName.toLowerCase()) {
- node = dojo.dom.prevElement(node, tagName);
- }
- return node; // Element
-}
-
-dojo.dom.nextElement = dojo.dom.getNextSiblingElement = function(/* Node */node, /* string? */tagName){
- // summary:
- // returns the next sibling element matching tagName
- if(!node) { return null; }
- do {
- node = node.nextSibling;
- } while(node && node.nodeType != dojo.dom.ELEMENT_NODE);
-
- if(node && tagName && tagName.toLowerCase() != node.tagName.toLowerCase()) {
- return dojo.dom.nextElement(node, tagName);
- }
- return node; // Element
-}
-
-dojo.dom.prevElement = dojo.dom.getPreviousSiblingElement = function(/* Node */node, /* string? */tagName){
- // summary:
- // returns the previous sibling element matching tagName
- if(!node) { return null; }
- if(tagName) { tagName = tagName.toLowerCase(); }
- do {
- node = node.previousSibling;
- } while(node && node.nodeType != dojo.dom.ELEMENT_NODE);
-
- if(node && tagName && tagName.toLowerCase() != node.tagName.toLowerCase()) {
- return dojo.dom.prevElement(node, tagName);
- }
- return node; // Element
-}
-
-// TODO: hmph
-/*this.forEachChildTag = function(node, unaryFunc) {
- var child = this.getFirstChildTag(node);
- while(child) {
- if(unaryFunc(child) == "break") { break; }
- child = this.getNextSiblingTag(child);
- }
-}*/
-
-dojo.dom.moveChildren = function(/*Element*/srcNode, /*Element*/destNode, /*boolean?*/trim){
- // summary:
- // Moves children from srcNode to destNode and returns the count of
- // children moved; will trim off text nodes if trim == true
- var count = 0;
- if(trim) {
- while(srcNode.hasChildNodes() &&
- srcNode.firstChild.nodeType == dojo.dom.TEXT_NODE) {
- srcNode.removeChild(srcNode.firstChild);
- }
- while(srcNode.hasChildNodes() &&
- srcNode.lastChild.nodeType == dojo.dom.TEXT_NODE) {
- srcNode.removeChild(srcNode.lastChild);
- }
- }
- while(srcNode.hasChildNodes()){
- destNode.appendChild(srcNode.firstChild);
- count++;
- }
- return count; // number
-}
-
-dojo.dom.copyChildren = function(/*Element*/srcNode, /*Element*/destNode, /*boolean?*/trim){
- // summary:
- // Copies children from srcNde to destNode and returns the count of
- // children copied; will trim off text nodes if trim == true
- var clonedNode = srcNode.cloneNode(true);
- return this.moveChildren(clonedNode, destNode, trim); // number
-}
-
-dojo.dom.replaceChildren = function(/*Element*/node, /*Node*/newChild){
- // summary:
- // Removes all children of node and appends newChild. All the existing
- // children will be destroyed.
- // FIXME: what if newChild is an array-like object?
- var nodes = [];
- if(dojo.render.html.ie){
- for(var i=0;i 0){
- return ancestors[0]; // Node
- }
-
- node = node.parentNode;
- }
- if(returnFirstHit){ return null; }
- return ancestors; // array
-}
-
-dojo.dom.getAncestorsByTag = function(/*Node*/node, /*String*/tag, /*boolean?*/returnFirstHit){
- // summary:
- // returns all ancestors matching tag (as tagName), will only return
- // first one if returnFirstHit
- tag = tag.toLowerCase();
- return dojo.dom.getAncestors(node, function(el){
- return ((el.tagName)&&(el.tagName.toLowerCase() == tag));
- }, returnFirstHit); // Node || array
-}
-
-dojo.dom.getFirstAncestorByTag = function(/*Node*/node, /*string*/tag){
- // summary:
- // Returns first ancestor of node with tag tagName
- return dojo.dom.getAncestorsByTag(node, tag, true); // Node
-}
-
-dojo.dom.isDescendantOf = function(/* Node */node, /* Node */ancestor, /* boolean? */guaranteeDescendant){
- // summary
- // Returns boolean if node is a descendant of ancestor
- // guaranteeDescendant allows us to be a "true" isDescendantOf function
- if(guaranteeDescendant && node) { node = node.parentNode; }
- while(node) {
- if(node == ancestor){
- return true; // boolean
- }
- node = node.parentNode;
- }
- return false; // boolean
-}
-
-dojo.dom.innerXML = function(/*Node*/node){
- // summary:
- // Implementation of MS's innerXML function.
- if(node.innerXML){
- return node.innerXML; // string
- }else if (node.xml){
- return node.xml; // string
- }else if(typeof XMLSerializer != "undefined"){
- return (new XMLSerializer()).serializeToString(node); // string
- }
-}
-
-dojo.dom.createDocument = function(){
- // summary:
- // cross-browser implementation of creating an XML document object.
- var doc = null;
- var _document = dojo.doc();
-
- if(!dj_undef("ActiveXObject")){
- var prefixes = [ "MSXML2", "Microsoft", "MSXML", "MSXML3" ];
- for(var i = 0; i1) {
- var _document = dojo.doc();
- dojo.dom.replaceChildren(node, _document.createTextNode(text));
- return text; // string
- } else {
- if(node.textContent != undefined){ //FF 1.5
- return node.textContent; // string
- }
- var _result = "";
- if (node == null) { return _result; }
- for (var i = 0; i < node.childNodes.length; i++) {
- switch (node.childNodes[i].nodeType) {
- case 1: // ELEMENT_NODE
- case 5: // ENTITY_REFERENCE_NODE
- _result += dojo.dom.textContent(node.childNodes[i]);
- break;
- case 3: // TEXT_NODE
- case 2: // ATTRIBUTE_NODE
- case 4: // CDATA_SECTION_NODE
- _result += node.childNodes[i].nodeValue;
- break;
- default:
- break;
- }
- }
- return _result; // string
- }
-}
-
-dojo.dom.hasParent = function(/*Node*/node){
- // summary:
- // returns whether or not node is a child of another node.
- return Boolean(node && node.parentNode && dojo.dom.isNode(node.parentNode)); // boolean
-}
-
-/**
- * Examples:
- *
- * myFooNode =
- * isTag(myFooNode, "foo"); // returns "foo"
- * isTag(myFooNode, "bar"); // returns ""
- * isTag(myFooNode, "FOO"); // returns ""
- * isTag(myFooNode, "hey", "foo", "bar"); // returns "foo"
-**/
-dojo.dom.isTag = function(/* Node */node /* ... */){
- // summary:
- // determines if node has any of the provided tag names and returns
- // the tag name that matches, empty string otherwise.
- if(node && node.tagName) {
- for(var i=1; i");
- }
-}catch(e){/* squelch */}
-
-if(dojo.render.html.opera){
- dojo.debug("Opera is not supported with dojo.undo.browser, so back/forward detection will not work.");
-}
-
-dojo.undo.browser = {
- initialHref: (!dj_undef("window")) ? window.location.href : "",
- initialHash: (!dj_undef("window")) ? window.location.hash : "",
-
- moveForward: false,
- historyStack: [],
- forwardStack: [],
- historyIframe: null,
- bookmarkAnchor: null,
- locationTimer: null,
-
- /**
- *
- */
- setInitialState: function(/*Object*/args){
- //summary: Sets the state object and back callback for the very first page that is loaded.
- //description: It is recommended that you call this method as part of an event listener that is registered via
- //dojo.addOnLoad().
- //args: Object
- // See the addToHistory() function for the list of valid args properties.
- this.initialState = this._createState(this.initialHref, args, this.initialHash);
- },
-
- //FIXME: Would like to support arbitrary back/forward jumps. Have to rework iframeLoaded among other things.
- //FIXME: is there a slight race condition in moz using change URL with the timer check and when
- // the hash gets set? I think I have seen a back/forward call in quick succession, but not consistent.
- addToHistory: function(args){
- //summary: adds a state object (args) to the history list. You must set
- //djConfig.preventBackButtonFix = false to use dojo.undo.browser.
-
- //args: Object
- // args can have the following properties:
- // To support getting back button notifications, the object argument should implement a
- // function called either "back", "backButton", or "handle". The string "back" will be
- // passed as the first and only argument to this callback.
- // - To support getting forward button notifications, the object argument should implement a
- // function called either "forward", "forwardButton", or "handle". The string "forward" will be
- // passed as the first and only argument to this callback.
- // - If you want the browser location string to change, define "changeUrl" on the object. If the
- // value of "changeUrl" is true, then a unique number will be appended to the URL as a fragment
- // identifier (http://some.domain.com/path#uniquenumber). If it is any other value that does
- // not evaluate to false, that value will be used as the fragment identifier. For example,
- // if changeUrl: 'page1', then the URL will look like: http://some.domain.com/path#page1
- // Full example:
- // dojo.undo.browser.addToHistory({
- // back: function() { alert('back pressed'); },
- // forward: function() { alert('forward pressed'); },
- // changeUrl: true
- // });
- //
- // BROWSER NOTES:
- // Safari 1.2:
- // back button "works" fine, however it's not possible to actually
- // DETECT that you've moved backwards by inspecting window.location.
- // Unless there is some other means of locating.
- // FIXME: perhaps we can poll on history.length?
- // Safari 2.0.3+ (and probably 1.3.2+):
- // works fine, except when changeUrl is used. When changeUrl is used,
- // Safari jumps all the way back to whatever page was shown before
- // the page that uses dojo.undo.browser support.
- // IE 5.5 SP2:
- // back button behavior is macro. It does not move back to the
- // previous hash value, but to the last full page load. This suggests
- // that the iframe is the correct way to capture the back button in
- // these cases.
- // Don't test this page using local disk for MSIE. MSIE will not create
- // a history list for iframe_history.html if served from a file: URL.
- // The XML served back from the XHR tests will also not be properly
- // created if served from local disk. Serve the test pages from a web
- // server to test in that browser.
- // IE 6.0:
- // same behavior as IE 5.5 SP2
- // Firefox 1.0+:
- // the back button will return us to the previous hash on the same
- // page, thereby not requiring an iframe hack, although we do then
- // need to run a timer to detect inter-page movement.
-
- //If addToHistory is called, then that means we prune the
- //forward stack -- the user went back, then wanted to
- //start a new forward path.
- this.forwardStack = [];
-
- var hash = null;
- var url = null;
- if(!this.historyIframe){
- if(djConfig["useXDomain"] && !djConfig["dojoIframeHistoryUrl"]){
- dojo.debug("dojo.undo.browser: When using cross-domain Dojo builds,"
- + " please save iframe_history.html to your domain and set djConfig.dojoIframeHistoryUrl"
- + " to the path on your domain to iframe_history.html");
- }
- this.historyIframe = window.frames["djhistory"];
- }
- if(!this.bookmarkAnchor){
- this.bookmarkAnchor = document.createElement("a");
- dojo.body().appendChild(this.bookmarkAnchor);
- this.bookmarkAnchor.style.display = "none";
- }
- if(args["changeUrl"]){
- hash = "#"+ ((args["changeUrl"]!==true) ? args["changeUrl"] : (new Date()).getTime());
-
- //If the current hash matches the new one, just replace the history object with
- //this new one. It doesn't make sense to track different state objects for the same
- //logical URL. This matches the browser behavior of only putting in one history
- //item no matter how many times you click on the same #hash link, at least in Firefox
- //and Safari, and there is no reliable way in those browsers to know if a #hash link
- //has been clicked on multiple times. So making this the standard behavior in all browsers
- //so that dojo.undo.browser's behavior is the same in all browsers.
- if(this.historyStack.length == 0 && this.initialState.urlHash == hash){
- this.initialState = this._createState(url, args, hash);
- return;
- }else if(this.historyStack.length > 0 && this.historyStack[this.historyStack.length - 1].urlHash == hash){
- this.historyStack[this.historyStack.length - 1] = this._createState(url, args, hash);
- return;
- }
-
- this.changingUrl = true;
- setTimeout("window.location.href = '"+hash+"'; dojo.undo.browser.changingUrl = false;", 1);
- this.bookmarkAnchor.href = hash;
-
- if(dojo.render.html.ie){
- url = this._loadIframeHistory();
-
- var oldCB = args["back"]||args["backButton"]||args["handle"];
-
- //The function takes handleName as a parameter, in case the
- //callback we are overriding was "handle". In that case,
- //we will need to pass the handle name to handle.
- var tcb = function(handleName){
- if(window.location.hash != ""){
- setTimeout("window.location.href = '"+hash+"';", 1);
- }
- //Use apply to set "this" to args, and to try to avoid memory leaks.
- oldCB.apply(this, [handleName]);
- }
-
- //Set interceptor function in the right place.
- if(args["back"]){
- args.back = tcb;
- }else if(args["backButton"]){
- args.backButton = tcb;
- }else if(args["handle"]){
- args.handle = tcb;
- }
-
- var oldFW = args["forward"]||args["forwardButton"]||args["handle"];
-
- //The function takes handleName as a parameter, in case the
- //callback we are overriding was "handle". In that case,
- //we will need to pass the handle name to handle.
- var tfw = function(handleName){
- if(window.location.hash != ""){
- window.location.href = hash;
- }
- if(oldFW){ // we might not actually have one
- //Use apply to set "this" to args, and to try to avoid memory leaks.
- oldFW.apply(this, [handleName]);
- }
- }
-
- //Set interceptor function in the right place.
- if(args["forward"]){
- args.forward = tfw;
- }else if(args["forwardButton"]){
- args.forwardButton = tfw;
- }else if(args["handle"]){
- args.handle = tfw;
- }
-
- }else if(dojo.render.html.moz){
- // start the timer
- if(!this.locationTimer){
- this.locationTimer = setInterval("dojo.undo.browser.checkLocation();", 200);
- }
- }
- }else{
- url = this._loadIframeHistory();
- }
-
- this.historyStack.push(this._createState(url, args, hash));
- },
-
- checkLocation: function(){
- //summary: private method. Do not call this directly.
- if (!this.changingUrl){
- var hsl = this.historyStack.length;
-
- if((window.location.hash == this.initialHash||window.location.href == this.initialHref)&&(hsl == 1)){
- // FIXME: could this ever be a forward button?
- // we can't clear it because we still need to check for forwards. Ugg.
- // clearInterval(this.locationTimer);
- this.handleBackButton();
- return;
- }
-
- // first check to see if we could have gone forward. We always halt on
- // a no-hash item.
- if(this.forwardStack.length > 0){
- if(this.forwardStack[this.forwardStack.length-1].urlHash == window.location.hash){
- this.handleForwardButton();
- return;
- }
- }
-
- // ok, that didn't work, try someplace back in the history stack
- if((hsl >= 2)&&(this.historyStack[hsl-2])){
- if(this.historyStack[hsl-2].urlHash==window.location.hash){
- this.handleBackButton();
- return;
- }
- }
- }
- },
-
- iframeLoaded: function(evt, ifrLoc){
- //summary: private method. Do not call this directly.
- if(!dojo.render.html.opera){
- var query = this._getUrlQuery(ifrLoc.href);
- if(query == null){
- // alert("iframeLoaded");
- // we hit the end of the history, so we should go back
- if(this.historyStack.length == 1){
- this.handleBackButton();
- }
- return;
- }
- if(this.moveForward){
- // we were expecting it, so it's not either a forward or backward movement
- this.moveForward = false;
- return;
- }
-
- //Check the back stack first, since it is more likely.
- //Note that only one step back or forward is supported.
- if(this.historyStack.length >= 2 && query == this._getUrlQuery(this.historyStack[this.historyStack.length-2].url)){
- this.handleBackButton();
- }
- else if(this.forwardStack.length > 0 && query == this._getUrlQuery(this.forwardStack[this.forwardStack.length-1].url)){
- this.handleForwardButton();
- }
- }
- },
-
- handleBackButton: function(){
- //summary: private method. Do not call this directly.
-
- //The "current" page is always at the top of the history stack.
- var current = this.historyStack.pop();
- if(!current){ return; }
- var last = this.historyStack[this.historyStack.length-1];
- if(!last && this.historyStack.length == 0){
- last = this.initialState;
- }
- if (last){
- if(last.kwArgs["back"]){
- last.kwArgs["back"]();
- }else if(last.kwArgs["backButton"]){
- last.kwArgs["backButton"]();
- }else if(last.kwArgs["handle"]){
- last.kwArgs.handle("back");
- }
- }
- this.forwardStack.push(current);
- },
-
- handleForwardButton: function(){
- //summary: private method. Do not call this directly.
-
- var last = this.forwardStack.pop();
- if(!last){ return; }
- if(last.kwArgs["forward"]){
- last.kwArgs.forward();
- }else if(last.kwArgs["forwardButton"]){
- last.kwArgs.forwardButton();
- }else if(last.kwArgs["handle"]){
- last.kwArgs.handle("forward");
- }
- this.historyStack.push(last);
- },
-
- _createState: function(url, args, hash){
- //summary: private method. Do not call this directly.
-
- return {"url": url, "kwArgs": args, "urlHash": hash}; //Object
- },
-
- _getUrlQuery: function(url){
- //summary: private method. Do not call this directly.
- var segments = url.split("?");
- if (segments.length < 2){
- return null; //null
- }
- else{
- return segments[1]; //String
- }
- },
-
- _loadIframeHistory: function(){
- //summary: private method. Do not call this directly.
- var url = (djConfig["dojoIframeHistoryUrl"] || dojo.hostenv.getBaseScriptUri()+'iframe_history.html')
- + "?" + (new Date()).getTime();
- this.moveForward = true;
- dojo.io.setIFrameSrc(this.historyIframe, url, false);
- return url; //String
- }
-}
-
-dojo.provide("dojo.io.BrowserIO");
-
-
-
-
-
-
-
-
-if(!dj_undef("window")) {
-
-dojo.io.checkChildrenForFile = function(/*DOMNode*/node){
- //summary: Checks any child nodes of node for an input type="file" element.
- var hasFile = false;
- var inputs = node.getElementsByTagName("input");
- dojo.lang.forEach(inputs, function(input){
- if(hasFile){ return; }
- if(input.getAttribute("type")=="file"){
- hasFile = true;
- }
- });
- return hasFile; //boolean
-}
-
-dojo.io.formHasFile = function(/*DOMNode*/formNode){
- //summary: Just calls dojo.io.checkChildrenForFile().
- return dojo.io.checkChildrenForFile(formNode); //boolean
-}
-
-dojo.io.updateNode = function(/*DOMNode*/node, /*String or Object*/urlOrArgs){
- //summary: Updates a DOMnode with the result of a dojo.io.bind() call.
- //node: DOMNode
- //urlOrArgs: String or Object
- // Either a String that has an URL, or an object containing dojo.io.bind()
- // arguments.
- node = dojo.byId(node);
- var args = urlOrArgs;
- if(dojo.lang.isString(urlOrArgs)){
- args = { url: urlOrArgs };
- }
- args.mimetype = "text/html";
- args.load = function(t, d, e){
- while(node.firstChild){
- dojo.dom.destroyNode(node.firstChild);
- }
- node.innerHTML = d;
- };
- dojo.io.bind(args);
-}
-
-dojo.io.formFilter = function(/*DOMNode*/node) {
- //summary: Returns true if the node is an input element that is enabled, has
- //a name, and whose type is one of the following values: ["file", "submit", "image", "reset", "button"]
- var type = (node.type||"").toLowerCase();
- return !node.disabled && node.name
- && !dojo.lang.inArray(["file", "submit", "image", "reset", "button"], type); //boolean
-}
-
-// TODO: Move to htmlUtils
-dojo.io.encodeForm = function(/*DOMNode*/formNode, /*String?*/encoding, /*Function?*/formFilter){
- //summary: Converts the names and values of form elements into an URL-encoded
- //string (name=value&name=value...).
- //formNode: DOMNode
- //encoding: String?
- // The encoding to use for the values. Specify a string that starts with
- // "utf" (for instance, "utf8"), to use encodeURIComponent() as the encoding
- // function. Otherwise, dojo.string.encodeAscii will be used.
- //formFilter: Function?
- // A function used to filter out form elements. The element node will be passed
- // to the formFilter function, and a boolean result is expected (true indicating
- // indicating that the element should have its name/value included in the output).
- // If no formFilter is specified, then dojo.io.formFilter() will be used.
- if((!formNode)||(!formNode.tagName)||(!formNode.tagName.toLowerCase() == "form")){
- dojo.raise("Attempted to encode a non-form element.");
- }
- if(!formFilter) { formFilter = dojo.io.formFilter; }
- var enc = /utf/i.test(encoding||"") ? encodeURIComponent : dojo.string.encodeAscii;
- var values = [];
-
- for(var i = 0; i < formNode.elements.length; i++){
- var elm = formNode.elements[i];
- if(!elm || elm.tagName.toLowerCase() == "fieldset" || !formFilter(elm)) { continue; }
- var name = enc(elm.name);
- var type = elm.type.toLowerCase();
-
- if(type == "select-multiple"){
- for(var j = 0; j < elm.options.length; j++){
- if(elm.options[j].selected) {
- values.push(name + "=" + enc(elm.options[j].value));
- }
- }
- }else if(dojo.lang.inArray(["radio", "checkbox"], type)){
- if(elm.checked){
- values.push(name + "=" + enc(elm.value));
- }
- }else{
- values.push(name + "=" + enc(elm.value));
- }
- }
-
- // now collect input type="image", which doesn't show up in the elements array
- var inputs = formNode.getElementsByTagName("input");
- for(var i = 0; i < inputs.length; i++) {
- var input = inputs[i];
- if(input.type.toLowerCase() == "image" && input.form == formNode
- && formFilter(input)) {
- var name = enc(input.name);
- values.push(name + "=" + enc(input.value));
- values.push(name + ".x=0");
- values.push(name + ".y=0");
- }
- }
- return values.join("&") + "&"; //String
-}
-
-dojo.io.FormBind = function(/*DOMNode or Object*/args) {
- //summary: constructor for a dojo.io.FormBind object. See the Dojo Book for
- //some information on usage: http://manual.dojotoolkit.org/WikiHome/DojoDotBook/Book23
- //args: DOMNode or Object
- // args can either be the DOMNode for a form element, or an object containing
- // dojo.io.bind() arguments, one of which should be formNode with the value of
- // a form element DOMNode.
- this.bindArgs = {};
-
- if(args && args.formNode) {
- this.init(args);
- } else if(args) {
- this.init({formNode: args});
- }
-}
-dojo.lang.extend(dojo.io.FormBind, {
- form: null,
-
- bindArgs: null,
-
- clickedButton: null,
-
- init: function(/*DOMNode or Object*/args) {
- //summary: Internal function called by the dojo.io.FormBind() constructor
- //do not call this method directly.
- var form = dojo.byId(args.formNode);
-
- if(!form || !form.tagName || form.tagName.toLowerCase() != "form") {
- throw new Error("FormBind: Couldn't apply, invalid form");
- } else if(this.form == form) {
- return;
- } else if(this.form) {
- throw new Error("FormBind: Already applied to a form");
- }
-
- dojo.lang.mixin(this.bindArgs, args);
- this.form = form;
-
- this.connect(form, "onsubmit", "submit");
-
- for(var i = 0; i < form.elements.length; i++) {
- var node = form.elements[i];
- if(node && node.type && dojo.lang.inArray(["submit", "button"], node.type.toLowerCase())) {
- this.connect(node, "onclick", "click");
- }
- }
-
- var inputs = form.getElementsByTagName("input");
- for(var i = 0; i < inputs.length; i++) {
- var input = inputs[i];
- if(input.type.toLowerCase() == "image" && input.form == form) {
- this.connect(input, "onclick", "click");
- }
- }
- },
-
- onSubmit: function(/*DOMNode*/form) {
- //summary: Function used to verify that the form is OK to submit.
- //Override this function if you want specific form validation done.
- return true; //boolean
- },
-
- submit: function(/*Event*/e) {
- //summary: internal function that is connected as a listener to the
- //form's onsubmit event.
- e.preventDefault();
- if(this.onSubmit(this.form)) {
- dojo.io.bind(dojo.lang.mixin(this.bindArgs, {
- formFilter: dojo.lang.hitch(this, "formFilter")
- }));
- }
- },
-
- click: function(/*Event*/e) {
- //summary: internal method that is connected as a listener to the
- //form's elements whose click event can submit a form.
- var node = e.currentTarget;
- if(node.disabled) { return; }
- this.clickedButton = node;
- },
-
- formFilter: function(/*DOMNode*/node) {
- //summary: internal function used to know which form element values to include
- // in the dojo.io.bind() request.
- var type = (node.type||"").toLowerCase();
- var accept = false;
- if(node.disabled || !node.name) {
- accept = false;
- } else if(dojo.lang.inArray(["submit", "button", "image"], type)) {
- if(!this.clickedButton) { this.clickedButton = node; }
- accept = node == this.clickedButton;
- } else {
- accept = !dojo.lang.inArray(["file", "submit", "reset", "button"], type);
- }
- return accept; //boolean
- },
-
- // in case you don't have dojo.event.* pulled in
- connect: function(/*Object*/srcObj, /*Function*/srcFcn, /*Function*/targetFcn) {
- //summary: internal function used to connect event listeners to form elements
- //that trigger events. Used in case dojo.event is not loaded.
- if(dojo.evalObjPath("dojo.event.connect")) {
- dojo.event.connect(srcObj, srcFcn, this, targetFcn);
- } else {
- var fcn = dojo.lang.hitch(this, targetFcn);
- srcObj[srcFcn] = function(e) {
- if(!e) { e = window.event; }
- if(!e.currentTarget) { e.currentTarget = e.srcElement; }
- if(!e.preventDefault) { e.preventDefault = function() { window.event.returnValue = false; } }
- fcn(e);
- }
- }
- }
-});
-
-dojo.io.XMLHTTPTransport = new function(){
- //summary: The object that implements the dojo.io.bind transport for XMLHttpRequest.
- var _this = this;
-
- var _cache = {}; // FIXME: make this public? do we even need to?
- this.useCache = false; // if this is true, we'll cache unless kwArgs.useCache = false
- this.preventCache = false; // if this is true, we'll always force GET requests to cache
-
- // FIXME: Should this even be a function? or do we just hard code it in the next 2 functions?
- function getCacheKey(url, query, method) {
- return url + "|" + query + "|" + method.toLowerCase();
- }
-
- function addToCache(url, query, method, http) {
- _cache[getCacheKey(url, query, method)] = http;
- }
-
- function getFromCache(url, query, method) {
- return _cache[getCacheKey(url, query, method)];
- }
-
- this.clearCache = function() {
- _cache = {};
- }
-
- // moved successful load stuff here
- function doLoad(kwArgs, http, url, query, useCache) {
- if( ((http.status>=200)&&(http.status<300))|| // allow any 2XX response code
- (http.status==304)|| // get it out of the cache
- (http.status==1223)|| // Internet Explorer mangled the status code
- (location.protocol=="file:" && (http.status==0 || http.status==undefined))||
- (location.protocol=="chrome:" && (http.status==0 || http.status==undefined))
- ){
- var ret;
- if(kwArgs.method.toLowerCase() == "head"){
- var headers = http.getAllResponseHeaders();
- ret = {};
- ret.toString = function(){ return headers; }
- var values = headers.split(/[\r\n]+/g);
- for(var i = 0; i < values.length; i++) {
- var pair = values[i].match(/^([^:]+)\s*:\s*(.+)$/i);
- if(pair) {
- ret[pair[1]] = pair[2];
- }
- }
- }else if(kwArgs.mimetype == "text/javascript"){
- try{
- ret = dj_eval(http.responseText);
- }catch(e){
- dojo.debug(e);
- dojo.debug(http.responseText);
- ret = null;
- }
- }else if(kwArgs.mimetype.substr(0, 9) == "text/json" || kwArgs.mimetype.substr(0, 16) == "application/json"){
- try{
- ret = dj_eval("("+kwArgs.jsonFilter(http.responseText)+")");
- }catch(e){
- dojo.debug(e);
- dojo.debug(http.responseText);
- ret = false;
- }
- }else if((kwArgs.mimetype == "application/xml")||
- (kwArgs.mimetype == "text/xml")){
- ret = http.responseXML;
- if(!ret || typeof ret == "string" || !http.getResponseHeader("Content-Type")) {
- ret = dojo.dom.createDocumentFromText(http.responseText);
- }
- }else{
- ret = http.responseText;
- }
-
- if(useCache){ // only cache successful responses
- addToCache(url, query, kwArgs.method, http);
- }
- kwArgs[(typeof kwArgs.load == "function") ? "load" : "handle"]("load", ret, http, kwArgs);
- }else{
- var errObj = new dojo.io.Error("XMLHttpTransport Error: "+http.status+" "+http.statusText);
- kwArgs[(typeof kwArgs.error == "function") ? "error" : "handle"]("error", errObj, http, kwArgs);
- }
- }
-
- // set headers (note: Content-Type will get overriden if kwArgs.contentType is set)
- function setHeaders(http, kwArgs){
- if(kwArgs["headers"]) {
- for(var header in kwArgs["headers"]) {
- if(header.toLowerCase() == "content-type" && !kwArgs["contentType"]) {
- kwArgs["contentType"] = kwArgs["headers"][header];
- } else {
- http.setRequestHeader(header, kwArgs["headers"][header]);
- }
- }
- }
- }
-
- this.inFlight = [];
- this.inFlightTimer = null;
-
- this.startWatchingInFlight = function(){
- //summary: internal method used to trigger a timer to watch all inflight
- //XMLHttpRequests.
- if(!this.inFlightTimer){
- // setInterval broken in mozilla x86_64 in some circumstances, see
- // https://bugzilla.mozilla.org/show_bug.cgi?id=344439
- // using setTimeout instead
- this.inFlightTimer = setTimeout("dojo.io.XMLHTTPTransport.watchInFlight();", 10);
- }
- }
-
- this.watchInFlight = function(){
- //summary: internal method that checks each inflight XMLHttpRequest to see
- //if it has completed or if the timeout situation applies.
- var now = null;
- // make sure sync calls stay thread safe, if this callback is called during a sync call
- // and this results in another sync call before the first sync call ends the browser hangs
- if(!dojo.hostenv._blockAsync && !_this._blockAsync){
- for(var x=this.inFlight.length-1; x>=0; x--){
- try{
- var tif = this.inFlight[x];
- if(!tif || tif.http._aborted || !tif.http.readyState){
- this.inFlight.splice(x, 1); continue;
- }
- if(4==tif.http.readyState){
- // remove it so we can clean refs
- this.inFlight.splice(x, 1);
- doLoad(tif.req, tif.http, tif.url, tif.query, tif.useCache);
- }else if (tif.startTime){
- //See if this is a timeout case.
- if(!now){
- now = (new Date()).getTime();
- }
- if(tif.startTime + (tif.req.timeoutSeconds * 1000) < now){
- //Stop the request.
- if(typeof tif.http.abort == "function"){
- tif.http.abort();
- }
-
- // remove it so we can clean refs
- this.inFlight.splice(x, 1);
- tif.req[(typeof tif.req.timeout == "function") ? "timeout" : "handle"]("timeout", null, tif.http, tif.req);
- }
- }
- }catch(e){
- try{
- var errObj = new dojo.io.Error("XMLHttpTransport.watchInFlight Error: " + e);
- tif.req[(typeof tif.req.error == "function") ? "error" : "handle"]("error", errObj, tif.http, tif.req);
- }catch(e2){
- dojo.debug("XMLHttpTransport error callback failed: " + e2);
- }
- }
- }
- }
-
- clearTimeout(this.inFlightTimer);
- if(this.inFlight.length == 0){
- this.inFlightTimer = null;
- return;
- }
- this.inFlightTimer = setTimeout("dojo.io.XMLHTTPTransport.watchInFlight();", 10);
- }
-
- var hasXmlHttp = dojo.hostenv.getXmlhttpObject() ? true : false;
- this.canHandle = function(/*dojo.io.Request*/kwArgs){
- //summary: Tells dojo.io.bind() if this is a good transport to
- //use for the particular type of request. This type of transport cannot
- //handle forms that have an input type="file" element.
-
- // FIXME: we need to determine when form values need to be
- // multi-part mime encoded and avoid using this transport for those
- // requests.
- var mlc = kwArgs["mimetype"].toLowerCase()||"";
- return hasXmlHttp
- && (
- (
- dojo.lang.inArray([
- "text/plain", "text/html", "application/xml",
- "text/xml", "text/javascript"
- ], mlc
- )
- ) || (
- mlc.substr(0, 9) == "text/json" || mlc.substr(0, 16) == "application/json"
- )
- )
- && !( kwArgs["formNode"] && dojo.io.formHasFile(kwArgs["formNode"]) ); //boolean
- }
-
- this.multipartBoundary = "45309FFF-BD65-4d50-99C9-36986896A96F"; // unique guid as a boundary value for multipart posts
-
- this.bind = function(/*dojo.io.Request*/kwArgs){
- //summary: function that sends the request to the server.
-
- //This function will attach an abort() function to the kwArgs dojo.io.Request object,
- //so if you need to abort the request, you can call that method on the request object.
- //The following are acceptable properties in kwArgs (in addition to the
- //normal dojo.io.Request object properties).
- //url: String: URL the server URL to use for the request.
- //method: String: the HTTP method to use (GET, POST, etc...).
- //mimetype: Specifies what format the result data should be given to the load/handle callback. Valid values are:
- // text/javascript, text/json, application/json, application/xml, text/xml. Any other mimetype will give back a text
- // string.
- //transport: String: specify "XMLHTTPTransport" to force the use of this XMLHttpRequest transport.
- //headers: Object: The object property names and values will be sent as HTTP request header
- // names and values.
- //sendTransport: boolean: If true, then dojo.transport=xmlhttp will be added to the request.
- //encoding: String: The type of encoding to use when dealing with the content kwArgs property.
- //content: Object: The content object is converted into a name=value&name=value string, by
- // using dojo.io.argsFromMap(). The encoding kwArgs property is passed to dojo.io.argsFromMap()
- // for use in encoding the names and values. The resulting string is added to the request.
- //formNode: DOMNode: a form element node. This should not normally be used. Use new dojo.io.FormBind() instead.
- // If formNode is used, then the names and values of the form elements will be converted
- // to a name=value&name=value string and added to the request. The encoding kwArgs property is used
- // to encode the names and values.
- //postContent: String: Raw name=value&name=value string to be included as part of the request.
- //back or backButton: Function: A function to be called if the back button is pressed. If this kwArgs property
- // is used, then back button support via dojo.undo.browser will be used. See notes for dojo.undo.browser on usage.
- // You need to set djConfig.preventBackButtonFix = false to enable back button support.
- //changeUrl: boolean or String: Used as part of back button support. See notes for dojo.undo.browser on usage.
- //user: String: The user name. Used in conjuction with password. Passed to XMLHttpRequest.open().
- //password: String: The user's password. Used in conjuction with user. Passed to XMLHttpRequest.open().
- //file: Object or Array of Objects: an object simulating a file to be uploaded. file objects should have the following properties:
- // name or fileName: the name of the file
- // contentType: the MIME content type for the file.
- // content: the actual content of the file.
- //multipart: boolean: indicates whether this should be a multipart mime request. If kwArgs.file exists, then this
- // property is set to true automatically.
- //sync: boolean: if true, then a synchronous XMLHttpRequest call is done,
- // if false (the default), then an asynchronous call is used.
- //preventCache: boolean: If true, then a cache busting parameter is added to the request URL.
- // default value is false.
- //useCache: boolean: If true, then XMLHttpTransport will keep an internal cache of the server
- // response and use that response if a similar request is done again.
- // A similar request is one that has the same URL, query string and HTTP method value.
- // default is false.
- if(!kwArgs["url"]){
- // are we performing a history action?
- if( !kwArgs["formNode"]
- && (kwArgs["backButton"] || kwArgs["back"] || kwArgs["changeUrl"] || kwArgs["watchForURL"])
- && (!djConfig.preventBackButtonFix)) {
- dojo.deprecated("Using dojo.io.XMLHTTPTransport.bind() to add to browser history without doing an IO request",
- "Use dojo.undo.browser.addToHistory() instead.", "0.4");
- dojo.undo.browser.addToHistory(kwArgs);
- return true;
- }
- }
-
- // build this first for cache purposes
- var url = kwArgs.url;
- var query = "";
- if(kwArgs["formNode"]){
- var ta = kwArgs.formNode.getAttribute("action");
- if((ta)&&(!kwArgs["url"])){ url = ta; }
- var tp = kwArgs.formNode.getAttribute("method");
- if((tp)&&(!kwArgs["method"])){ kwArgs.method = tp; }
- query += dojo.io.encodeForm(kwArgs.formNode, kwArgs.encoding, kwArgs["formFilter"]);
- }
-
- if(url.indexOf("#") > -1) {
- dojo.debug("Warning: dojo.io.bind: stripping hash values from url:", url);
- url = url.split("#")[0];
- }
-
- if(kwArgs["file"]){
- // force post for file transfer
- kwArgs.method = "post";
- }
-
- if(!kwArgs["method"]){
- kwArgs.method = "get";
- }
-
- // guess the multipart value
- if(kwArgs.method.toLowerCase() == "get"){
- // GET cannot use multipart
- kwArgs.multipart = false;
- }else{
- if(kwArgs["file"]){
- // enforce multipart when sending files
- kwArgs.multipart = true;
- }else if(!kwArgs["multipart"]){
- // default
- kwArgs.multipart = false;
- }
- }
-
- if(kwArgs["backButton"] || kwArgs["back"] || kwArgs["changeUrl"]){
- dojo.undo.browser.addToHistory(kwArgs);
- }
-
- var content = kwArgs["content"] || {};
-
- if(kwArgs.sendTransport) {
- content["dojo.transport"] = "xmlhttp";
- }
-
- do { // break-block
- if(kwArgs.postContent){
- query = kwArgs.postContent;
- break;
- }
-
- if(content) {
- query += dojo.io.argsFromMap(content, kwArgs.encoding);
- }
-
- if(kwArgs.method.toLowerCase() == "get" || !kwArgs.multipart){
- break;
- }
-
- var t = [];
- if(query.length){
- var q = query.split("&");
- for(var i = 0; i < q.length; ++i){
- if(q[i].length){
- var p = q[i].split("=");
- t.push( "--" + this.multipartBoundary,
- "Content-Disposition: form-data; name=\"" + p[0] + "\"",
- "",
- p[1]);
- }
- }
- }
-
- if(kwArgs.file){
- if(dojo.lang.isArray(kwArgs.file)){
- for(var i = 0; i < kwArgs.file.length; ++i){
- var o = kwArgs.file[i];
- t.push( "--" + this.multipartBoundary,
- "Content-Disposition: form-data; name=\"" + o.name + "\"; filename=\"" + ("fileName" in o ? o.fileName : o.name) + "\"",
- "Content-Type: " + ("contentType" in o ? o.contentType : "application/octet-stream"),
- "",
- o.content);
- }
- }else{
- var o = kwArgs.file;
- t.push( "--" + this.multipartBoundary,
- "Content-Disposition: form-data; name=\"" + o.name + "\"; filename=\"" + ("fileName" in o ? o.fileName : o.name) + "\"",
- "Content-Type: " + ("contentType" in o ? o.contentType : "application/octet-stream"),
- "",
- o.content);
- }
- }
-
- if(t.length){
- t.push("--"+this.multipartBoundary+"--", "");
- query = t.join("\r\n");
- }
- }while(false);
-
- // kwArgs.Connection = "close";
-
- var async = kwArgs["sync"] ? false : true;
-
- var preventCache = kwArgs["preventCache"] ||
- (this.preventCache == true && kwArgs["preventCache"] != false);
- var useCache = kwArgs["useCache"] == true ||
- (this.useCache == true && kwArgs["useCache"] != false );
-
- // preventCache is browser-level (add query string junk), useCache
- // is for the local cache. If we say preventCache, then don't attempt
- // to look in the cache, but if useCache is true, we still want to cache
- // the response
- if(!preventCache && useCache){
- var cachedHttp = getFromCache(url, query, kwArgs.method);
- if(cachedHttp){
- doLoad(kwArgs, cachedHttp, url, query, false);
- return;
- }
- }
-
- // much of this is from getText, but reproduced here because we need
- // more flexibility
- var http = dojo.hostenv.getXmlhttpObject(kwArgs);
- var received = false;
-
- // build a handler function that calls back to the handler obj
- if(async){
- var startTime =
- // FIXME: setting up this callback handler leaks on IE!!!
- this.inFlight.push({
- "req": kwArgs,
- "http": http,
- "url": url,
- "query": query,
- "useCache": useCache,
- "startTime": kwArgs.timeoutSeconds ? (new Date()).getTime() : 0
- });
- this.startWatchingInFlight();
- }else{
- // block async callbacks until sync is in, needed in khtml, others?
- _this._blockAsync = true;
- }
-
- if(kwArgs.method.toLowerCase() == "post"){
- // FIXME: need to hack in more flexible Content-Type setting here!
- if (!kwArgs.user) {
- http.open("POST", url, async);
- }else{
- http.open("POST", url, async, kwArgs.user, kwArgs.password);
- }
- setHeaders(http, kwArgs);
- http.setRequestHeader("Content-Type", kwArgs.multipart ? ("multipart/form-data; boundary=" + this.multipartBoundary) :
- (kwArgs.contentType || "application/x-www-form-urlencoded"));
- try{
- http.send(query);
- }catch(e){
- if(typeof http.abort == "function"){
- http.abort();
- }
- doLoad(kwArgs, {status: 404}, url, query, useCache);
- }
- }else{
- var tmpUrl = url;
- if(query != "") {
- tmpUrl += (tmpUrl.indexOf("?") > -1 ? "&" : "?") + query;
- }
- if(preventCache) {
- tmpUrl += (dojo.string.endsWithAny(tmpUrl, "?", "&")
- ? "" : (tmpUrl.indexOf("?") > -1 ? "&" : "?")) + "dojo.preventCache=" + new Date().valueOf();
- }
- if (!kwArgs.user) {
- http.open(kwArgs.method.toUpperCase(), tmpUrl, async);
- }else{
- http.open(kwArgs.method.toUpperCase(), tmpUrl, async, kwArgs.user, kwArgs.password);
- }
- setHeaders(http, kwArgs);
- try {
- http.send(null);
- }catch(e) {
- if(typeof http.abort == "function"){
- http.abort();
- }
- doLoad(kwArgs, {status: 404}, url, query, useCache);
- }
- }
-
- if( !async ) {
- doLoad(kwArgs, http, url, query, useCache);
- _this._blockAsync = false;
- }
-
- kwArgs.abort = function(){
- try{// khtml doesent reset readyState on abort, need this workaround
- http._aborted = true;
- }catch(e){/*squelsh*/}
- return http.abort();
- }
-
- return;
- }
- dojo.io.transports.addTransport("XMLHTTPTransport");
-}
-
-}
-
-dojo.provide("dojo.io.cookie");
-
-dojo.io.cookie.setCookie = function(/*String*/name, /*String*/value,
- /*Number?*/days, /*String?*/path,
- /*String?*/domain, /*boolean?*/secure){
- //summary: sets a cookie.
- var expires = -1;
- if((typeof days == "number")&&(days >= 0)){
- var d = new Date();
- d.setTime(d.getTime()+(days*24*60*60*1000));
- expires = d.toGMTString();
- }
- value = escape(value);
- document.cookie = name + "=" + value + ";"
- + (expires != -1 ? " expires=" + expires + ";" : "")
- + (path ? "path=" + path : "")
- + (domain ? "; domain=" + domain : "")
- + (secure ? "; secure" : "");
-}
-
-dojo.io.cookie.set = dojo.io.cookie.setCookie;
-
-dojo.io.cookie.getCookie = function(/*String*/name){
- //summary: Gets a cookie with the given name.
-
- // FIXME: Which cookie should we return?
- // If there are cookies set for different sub domains in the current
- // scope there could be more than one cookie with the same name.
- // I think taking the last one in the list takes the one from the
- // deepest subdomain, which is what we're doing here.
- var idx = document.cookie.lastIndexOf(name+'=');
- if(idx == -1) { return null; }
- var value = document.cookie.substring(idx+name.length+1);
- var end = value.indexOf(';');
- if(end == -1) { end = value.length; }
- value = value.substring(0, end);
- value = unescape(value);
- return value; //String
-}
-
-dojo.io.cookie.get = dojo.io.cookie.getCookie;
-
-dojo.io.cookie.deleteCookie = function(/*String*/name){
- //summary: Deletes a cookie with the given name.
- dojo.io.cookie.setCookie(name, "-", 0);
-}
-
-dojo.io.cookie.setObjectCookie = function( /*String*/name, /*Object*/obj,
- /*Number?*/days, /*String?*/path,
- /*String?*/domain, /*boolean?*/secure,
- /*boolean?*/clearCurrent){
- //summary: Takes an object, serializes it to a cookie value, and either
- //sets a cookie with the serialized value.
- //description: If clearCurrent is true, then any current cookie value
- //for this object will be replaced with the the new serialized object value.
- //If clearCurrent is false, then the existing cookie value will be modified
- //with any changes from the new object value.
- //Objects must be simple name/value pairs where the value is either a string
- //or a number. Any other value will be ignored.
- if(arguments.length == 5){ // for backwards compat
- clearCurrent = domain;
- domain = null;
- secure = null;
- }
- var pairs = [], cookie, value = "";
- if(!clearCurrent){
- cookie = dojo.io.cookie.getObjectCookie(name);
- }
- if(days >= 0){
- if(!cookie){ cookie = {}; }
- for(var prop in obj){
- if(obj[prop] == null){
- delete cookie[prop];
- }else if((typeof obj[prop] == "string")||(typeof obj[prop] == "number")){
- cookie[prop] = obj[prop];
- }
- }
- prop = null;
- for(var prop in cookie){
- pairs.push(escape(prop) + "=" + escape(cookie[prop]));
- }
- value = pairs.join("&");
- }
- dojo.io.cookie.setCookie(name, value, days, path, domain, secure);
-}
-
-dojo.io.cookie.getObjectCookie = function(/*String*/name){
- //summary: Gets an object value for the given cookie name. The complement of
- //dojo.io.cookie.setObjectCookie().
- var values = null, cookie = dojo.io.cookie.getCookie(name);
- if(cookie){
- values = {};
- var pairs = cookie.split("&");
- for(var i = 0; i < pairs.length; i++){
- var pair = pairs[i].split("=");
- var value = pair[1];
- if( isNaN(value) ){ value = unescape(pair[1]); }
- values[ unescape(pair[0]) ] = value;
- }
- }
- return values;
-}
-
-dojo.io.cookie.isSupported = function(){
- //summary: Tests the browser to see if cookies are enabled.
- if(typeof navigator.cookieEnabled != "boolean"){
- dojo.io.cookie.setCookie("__TestingYourBrowserForCookieSupport__",
- "CookiesAllowed", 90, null);
- var cookieVal = dojo.io.cookie.getCookie("__TestingYourBrowserForCookieSupport__");
- navigator.cookieEnabled = (cookieVal == "CookiesAllowed");
- if(navigator.cookieEnabled){
- // FIXME: should we leave this around?
- this.deleteCookie("__TestingYourBrowserForCookieSupport__");
- }
- }
- return navigator.cookieEnabled; //boolean
-}
-
-// need to leave this in for backwards-compat from 0.1 for when it gets pulled in by dojo.io.*
-if(!dojo.io.cookies){ dojo.io.cookies = dojo.io.cookie; }
-
-dojo.kwCompoundRequire({
- common: ["dojo.io.common"],
- rhino: ["dojo.io.RhinoIO"],
- browser: ["dojo.io.BrowserIO", "dojo.io.cookie"],
- dashboard: ["dojo.io.BrowserIO", "dojo.io.cookie"]
-});
-dojo.provide("dojo.io.*");
-
-dojo.provide("dojo.event.common");
-
-
-
-
-
-// TODO: connection filter functions
-// these are functions that accept a method invocation (like around
-// advice) and return a boolean based on it. That value determines
-// whether or not the connection proceeds. It could "feel" like around
-// advice for those who know what it is (calling proceed() or not),
-// but I think presenting it as a "filter" and/or calling it with the
-// function args and not the MethodInvocation might make it more
-// palletable to "normal" users than around-advice currently is
-// TODO: execution scope mangling
-// YUI's event facility by default executes listeners in the context
-// of the source object. This is very odd, but should probably be
-// supported as an option (both for the source and for the dest). It
-// can be thought of as a connection-specific hitch().
-// TODO: more resiliency for 4+ arguments to connect()
-
-dojo.event = new function(){
- this._canTimeout = dojo.lang.isFunction(dj_global["setTimeout"])||dojo.lang.isAlien(dj_global["setTimeout"]);
-
- // FIXME: where should we put this method (not here!)?
- function interpolateArgs(args, searchForNames){
- var dl = dojo.lang;
- var ao = {
- srcObj: dj_global,
- srcFunc: null,
- adviceObj: dj_global,
- adviceFunc: null,
- aroundObj: null,
- aroundFunc: null,
- adviceType: (args.length>2) ? args[0] : "after",
- precedence: "last",
- once: false,
- delay: null,
- rate: 0,
- adviceMsg: false,
- maxCalls: -1
- };
-
- switch(args.length){
- case 0: return;
- case 1: return;
- case 2:
- ao.srcFunc = args[0];
- ao.adviceFunc = args[1];
- break;
- case 3:
- if((dl.isObject(args[0]))&&(dl.isString(args[1]))&&(dl.isString(args[2]))){
- ao.adviceType = "after";
- ao.srcObj = args[0];
- ao.srcFunc = args[1];
- ao.adviceFunc = args[2];
- }else if((dl.isString(args[1]))&&(dl.isString(args[2]))){
- ao.srcFunc = args[1];
- ao.adviceFunc = args[2];
- }else if((dl.isObject(args[0]))&&(dl.isString(args[1]))&&(dl.isFunction(args[2]))){
- ao.adviceType = "after";
- ao.srcObj = args[0];
- ao.srcFunc = args[1];
- var tmpName = dl.nameAnonFunc(args[2], ao.adviceObj, searchForNames);
- ao.adviceFunc = tmpName;
- }else if((dl.isFunction(args[0]))&&(dl.isObject(args[1]))&&(dl.isString(args[2]))){
- ao.adviceType = "after";
- ao.srcObj = dj_global;
- var tmpName = dl.nameAnonFunc(args[0], ao.srcObj, searchForNames);
- ao.srcFunc = tmpName;
- ao.adviceObj = args[1];
- ao.adviceFunc = args[2];
- }
- break;
- case 4:
- if((dl.isObject(args[0]))&&(dl.isObject(args[2]))){
- // we can assume that we've got an old-style "connect" from
- // the sigslot school of event attachment. We therefore
- // assume after-advice.
- ao.adviceType = "after";
- ao.srcObj = args[0];
- ao.srcFunc = args[1];
- ao.adviceObj = args[2];
- ao.adviceFunc = args[3];
- }else if((dl.isString(args[0]))&&(dl.isString(args[1]))&&(dl.isObject(args[2]))){
- ao.adviceType = args[0];
- ao.srcObj = dj_global;
- ao.srcFunc = args[1];
- ao.adviceObj = args[2];
- ao.adviceFunc = args[3];
- }else if((dl.isString(args[0]))&&(dl.isFunction(args[1]))&&(dl.isObject(args[2]))){
- ao.adviceType = args[0];
- ao.srcObj = dj_global;
- var tmpName = dl.nameAnonFunc(args[1], dj_global, searchForNames);
- ao.srcFunc = tmpName;
- ao.adviceObj = args[2];
- ao.adviceFunc = args[3];
- }else if((dl.isString(args[0]))&&(dl.isObject(args[1]))&&(dl.isString(args[2]))&&(dl.isFunction(args[3]))){
- ao.srcObj = args[1];
- ao.srcFunc = args[2];
- var tmpName = dl.nameAnonFunc(args[3], dj_global, searchForNames);
- ao.adviceObj = dj_global;
- ao.adviceFunc = tmpName;
- }else if(dl.isObject(args[1])){
- ao.srcObj = args[1];
- ao.srcFunc = args[2];
- ao.adviceObj = dj_global;
- ao.adviceFunc = args[3];
- }else if(dl.isObject(args[2])){
- ao.srcObj = dj_global;
- ao.srcFunc = args[1];
- ao.adviceObj = args[2];
- ao.adviceFunc = args[3];
- }else{
- ao.srcObj = ao.adviceObj = ao.aroundObj = dj_global;
- ao.srcFunc = args[1];
- ao.adviceFunc = args[2];
- ao.aroundFunc = args[3];
- }
- break;
- case 6:
- ao.srcObj = args[1];
- ao.srcFunc = args[2];
- ao.adviceObj = args[3]
- ao.adviceFunc = args[4];
- ao.aroundFunc = args[5];
- ao.aroundObj = dj_global;
- break;
- default:
- ao.srcObj = args[1];
- ao.srcFunc = args[2];
- ao.adviceObj = args[3]
- ao.adviceFunc = args[4];
- ao.aroundObj = args[5];
- ao.aroundFunc = args[6];
- ao.once = args[7];
- ao.delay = args[8];
- ao.rate = args[9];
- ao.adviceMsg = args[10];
- ao.maxCalls = (!isNaN(parseInt(args[11]))) ? args[11] : -1;
- break;
- }
-
- if(dl.isFunction(ao.aroundFunc)){
- var tmpName = dl.nameAnonFunc(ao.aroundFunc, ao.aroundObj, searchForNames);
- ao.aroundFunc = tmpName;
- }
-
- if(dl.isFunction(ao.srcFunc)){
- ao.srcFunc = dl.getNameInObj(ao.srcObj, ao.srcFunc);
- }
-
- if(dl.isFunction(ao.adviceFunc)){
- ao.adviceFunc = dl.getNameInObj(ao.adviceObj, ao.adviceFunc);
- }
-
- if((ao.aroundObj)&&(dl.isFunction(ao.aroundFunc))){
- ao.aroundFunc = dl.getNameInObj(ao.aroundObj, ao.aroundFunc);
- }
-
- if(!ao.srcObj){
- dojo.raise("bad srcObj for srcFunc: "+ao.srcFunc);
- }
- if(!ao.adviceObj){
- dojo.raise("bad adviceObj for adviceFunc: "+ao.adviceFunc);
- }
-
- if(!ao.adviceFunc){
- dojo.debug("bad adviceFunc for srcFunc: "+ao.srcFunc);
- dojo.debugShallow(ao);
- }
-
- return ao;
- }
-
- this.connect = function(/*...*/){
- // summary:
- // dojo.event.connect is the glue that holds most Dojo-based
- // applications together. Most combinations of arguments are
- // supported, with the connect() method attempting to disambiguate
- // the implied types of positional parameters. The following will
- // all work:
- // dojo.event.connect("globalFunctionName1", "globalFunctionName2");
- // dojo.event.connect(functionReference1, functionReference2);
- // dojo.event.connect("globalFunctionName1", functionReference2);
- // dojo.event.connect(functionReference1, "globalFunctionName2");
- // dojo.event.connect(scope1, "functionName1", "globalFunctionName2");
- // dojo.event.connect("globalFunctionName1", scope2, "functionName2");
- // dojo.event.connect(scope1, "functionName1", scope2, "functionName2");
- // dojo.event.connect("after", scope1, "functionName1", scope2, "functionName2");
- // dojo.event.connect("before", scope1, "functionName1", scope2, "functionName2");
- // dojo.event.connect("around", scope1, "functionName1",
- // scope2, "functionName2",
- // aroundFunctionReference);
- // dojo.event.connect("around", scope1, "functionName1",
- // scope2, "functionName2",
- // scope3, "aroundFunctionName");
- // dojo.event.connect("before-around", scope1, "functionName1",
- // scope2, "functionName2",
- // aroundFunctionReference);
- // dojo.event.connect("after-around", scope1, "functionName1",
- // scope2, "functionName2",
- // aroundFunctionReference);
- // dojo.event.connect("after-around", scope1, "functionName1",
- // scope2, "functionName2",
- // scope3, "aroundFunctionName");
- // dojo.event.connect("around", scope1, "functionName1",
- // scope2, "functionName2",
- // scope3, "aroundFunctionName", true, 30);
- // dojo.event.connect("around", scope1, "functionName1",
- // scope2, "functionName2",
- // scope3, "aroundFunctionName", null, null, 10);
- // adviceType:
- // Optional. String. One of "before", "after", "around",
- // "before-around", or "after-around". FIXME
- // srcObj:
- // the scope in which to locate/execute the named srcFunc. Along
- // with srcFunc, this creates a way to dereference the function to
- // call. So if the function in question is "foo.bar", the
- // srcObj/srcFunc pair would be foo and "bar", where "bar" is a
- // string and foo is an object reference.
- // srcFunc:
- // the name of the function to connect to. When it is executed,
- // the listener being registered with this call will be called.
- // The adviceType defines the call order between the source and
- // the target functions.
- // adviceObj:
- // the scope in which to locate/execute the named adviceFunc.
- // adviceFunc:
- // the name of the function being conected to srcObj.srcFunc
- // aroundObj:
- // the scope in which to locate/execute the named aroundFunc.
- // aroundFunc:
- // the name of, or a reference to, the function that will be used
- // to mediate the advice call. Around advice requires a special
- // unary function that will be passed a "MethodInvocation" object.
- // These objects have several important properties, namely:
- // - args
- // a mutable array of arguments to be passed into the
- // wrapped function
- // - proceed
- // a function that "continues" the invocation. The result
- // of this function is the return of the wrapped function.
- // You can then manipulate this return before passing it
- // back out (or take further action based on it).
- // once:
- // boolean that determines whether or not this connect() will
- // create a new connection if an identical connect() has already
- // been made. Defaults to "false".
- // delay:
- // an optional delay (in ms), as an integer, for dispatch of a
- // listener after the source has been fired.
- // rate:
- // an optional rate throttling parameter (integer, in ms). When
- // specified, this particular connection will not fire more than
- // once in the interval specified by the rate
- // adviceMsg:
- // boolean. Should the listener have all the parameters passed in
- // as a single argument?
-
- /*
- ao.adviceType = args[0];
- ao.srcObj = args[1];
- ao.srcFunc = args[2];
- ao.adviceObj = args[3]
- ao.adviceFunc = args[4];
- ao.aroundObj = args[5];
- ao.aroundFunc = args[6];
- ao.once = args[7];
- ao.delay = args[8];
- ao.rate = args[9];
- ao.adviceMsg = args[10];
- ao.maxCalls = args[11];
- */
- if(arguments.length == 1){
- var ao = arguments[0];
- }else{
- var ao = interpolateArgs(arguments, true);
- }
- if(dojo.lang.isString(ao.srcFunc) && (ao.srcFunc.toLowerCase() == "onkey") ){
- if(dojo.render.html.ie){
- ao.srcFunc = "onkeydown";
- this.connect(ao);
- }
- ao.srcFunc = "onkeypress";
- }
-
- if(dojo.lang.isArray(ao.srcObj) && ao.srcObj!=""){
- var tmpAO = {};
- for(var x in ao){
- tmpAO[x] = ao[x];
- }
- var mjps = [];
- dojo.lang.forEach(ao.srcObj, function(src){
- if((dojo.render.html.capable)&&(dojo.lang.isString(src))){
- src = dojo.byId(src);
- // dojo.debug(src);
- }
- tmpAO.srcObj = src;
- // dojo.debug(tmpAO.srcObj, tmpAO.srcFunc);
- // dojo.debug(tmpAO.adviceObj, tmpAO.adviceFunc);
- mjps.push(dojo.event.connect.call(dojo.event, tmpAO));
- });
- return mjps;
- }
-
- // FIXME: just doing a "getForMethod()" seems to be enough to put this into infinite recursion!!
- var mjp = dojo.event.MethodJoinPoint.getForMethod(ao.srcObj, ao.srcFunc);
- if(ao.adviceFunc){
- var mjp2 = dojo.event.MethodJoinPoint.getForMethod(ao.adviceObj, ao.adviceFunc);
- }
-
- mjp.kwAddAdvice(ao);
-
- // advanced users might want to fsck w/ the join point manually
- return mjp; // a MethodJoinPoint object
- }
-
- this.log = function(/*object or funcName*/ a1, /*funcName*/ a2){
- // summary:
- // a function that will wrap and log all calls to the specified
- // a1.a2() function. If only a1 is passed, it'll be used as a
- // function or function name on the global context. Logging will
- // be sent to dojo.debug
- // a1:
- // if a2 is passed, this should be an object. If not, it can be a
- // function or function name.
- // a2:
- // a function name
- var kwArgs;
- if((arguments.length == 1)&&(typeof a1 == "object")){
- kwArgs = a1;
- }else{
- kwArgs = {
- srcObj: a1,
- srcFunc: a2
- };
- }
- kwArgs.adviceFunc = function(){
- var argsStr = [];
- for(var x=0; x= this.jp_.around.length){
- return this.jp_.object[this.jp_.methodname].apply(this.jp_.object, this.args);
- // return this.jp_.run_before_after(this.object, this.args);
- }else{
- var ti = this.jp_.around[this.around_index];
- var mobj = ti[0]||dj_global;
- var meth = ti[1];
- return mobj[meth].call(mobj, this);
- }
-}
-
-
-dojo.event.MethodJoinPoint = function(/*Object*/obj, /*String*/funcName){
- this.object = obj||dj_global;
- this.methodname = funcName;
- this.methodfunc = this.object[funcName];
- this.squelch = false;
- // this.before = [];
- // this.after = [];
- // this.around = [];
-}
-
-dojo.event.MethodJoinPoint.getForMethod = function(/*Object*/obj, /*String*/funcName){
- // summary:
- // "static" class function for returning a MethodJoinPoint from a
- // scoped function. If one doesn't exist, one is created.
- // obj:
- // the scope to search for the function in
- // funcName:
- // the name of the function to return a MethodJoinPoint for
- if(!obj){ obj = dj_global; }
- var ofn = obj[funcName];
- if(!ofn){
- // supply a do-nothing method implementation
- ofn = obj[funcName] = function(){};
- if(!obj[funcName]){
- // e.g. cannot add to inbuilt objects in IE6
- dojo.raise("Cannot set do-nothing method on that object "+funcName);
- }
- }else if((typeof ofn != "function")&&(!dojo.lang.isFunction(ofn))&&(!dojo.lang.isAlien(ofn))){
- // FIXME: should we throw an exception here instead?
- return null;
- }
- // we hide our joinpoint instance in obj[funcName + '$joinpoint']
- var jpname = funcName + "$joinpoint";
- var jpfuncname = funcName + "$joinpoint$method";
- var joinpoint = obj[jpname];
- if(!joinpoint){
- var isNode = false;
- if(dojo.event["browser"]){
- if( (obj["attachEvent"])||
- (obj["nodeType"])||
- (obj["addEventListener"]) ){
- isNode = true;
- dojo.event.browser.addClobberNodeAttrs(obj, [jpname, jpfuncname, funcName]);
- }
- }
- var origArity = ofn.length;
- obj[jpfuncname] = ofn;
- // joinpoint = obj[jpname] = new dojo.event.MethodJoinPoint(obj, funcName);
- joinpoint = obj[jpname] = new dojo.event.MethodJoinPoint(obj, jpfuncname);
-
- if(!isNode){
- obj[funcName] = function(){
- // var args = [];
- // for(var x=0; x -1){
- if(maxCount == 0){
- return;
- }
- marr[7]--;
- }
- var undef;
-
- var to = {
- args: [],
- jp_: this,
- object: obj,
- proceed: function(){
- return callObj[callFunc].apply(callObj, to.args);
- }
- };
- to.args = aargs;
-
- var delay = parseInt(marr[4]);
- var hasDelay = ((!isNaN(delay))&&(marr[4]!==null)&&(typeof marr[4] != "undefined"));
- if(marr[5]){
- var rate = parseInt(marr[5]);
- var cur = new Date();
- var timerSet = false;
- if((marr["last"])&&((cur-marr.last)<=rate)){
- if(dojo.event._canTimeout){
- if(marr["delayTimer"]){
- clearTimeout(marr.delayTimer);
- }
- var tod = parseInt(rate*2); // is rate*2 naive?
- var mcpy = dojo.lang.shallowCopy(marr);
- marr.delayTimer = setTimeout(function(){
- // FIXME: on IE at least, event objects from the
- // browser can go out of scope. How (or should?) we
- // deal with it?
- mcpy[5] = 0;
- unrollAdvice(mcpy);
- }, tod);
- }
- return;
- }else{
- marr.last = cur;
- }
- }
-
- // FIXME: need to enforce rates for a connection here!
-
- if(aroundFunc){
- // NOTE: around advice can't delay since we might otherwise depend
- // on execution order!
- aroundObj[aroundFunc].call(aroundObj, to);
- }else{
- // var tmjp = dojo.event.MethodJoinPoint.getForMethod(obj, methname);
- if((hasDelay)&&((dojo.render.html)||(dojo.render.svg))){ // FIXME: the render checks are grotty!
- dj_global["setTimeout"](function(){
- if(msg){
- callObj[callFunc].call(callObj, to);
- }else{
- callObj[callFunc].apply(callObj, args);
- }
- }, delay);
- }else{ // many environments can't support delay!
- if(msg){
- callObj[callFunc].call(callObj, to);
- }else{
- callObj[callFunc].apply(callObj, args);
- }
- }
- }
- };
-
- var unRollSquelch = function(){
- if(this.squelch){
- try{
- return unrollAdvice.apply(this, arguments);
- }catch(e){
- dojo.debug(e);
- }
- }else{
- return unrollAdvice.apply(this, arguments);
- }
- };
-
- if((this["before"])&&(this.before.length>0)){
- // pass a cloned array, if this event disconnects this event forEach on this.before wont work
- dojo.lang.forEach(this.before.concat(new Array()), unRollSquelch);
- }
-
- var result;
- try{
- if((this["around"])&&(this.around.length>0)){
- var mi = new dojo.event.MethodInvocation(this, obj, args);
- result = mi.proceed();
- }else if(this.methodfunc){
- result = this.object[this.methodname].apply(this.object, args);
- }
- }catch(e){
- if(!this.squelch){
- dojo.debug(e,"when calling",this.methodname,"on",this.object,"with arguments",args);
- dojo.raise(e);
- }
- }
-
- if((this["after"])&&(this.after.length>0)){
- // see comment on this.before above
- dojo.lang.forEach(this.after.concat(new Array()), unRollSquelch);
- }
-
- return (this.methodfunc) ? result : null;
- },
-
- getArr: function(/*String*/kind){
- // summary: return a list of listeners of the past "kind"
- // kind:
- // can be one of: "before", "after", "around", "before-around", or
- // "after-around"
- var type = "after";
- // FIXME: we should be able to do this through props or Array.in()
- if((typeof kind == "string")&&(kind.indexOf("before")!=-1)){
- type = "before";
- }else if(kind=="around"){
- type = "around";
- }
- if(!this[type]){ this[type] = []; }
- return this[type]; // Array
- },
-
- kwAddAdvice: function(/*Object*/args){
- // summary:
- // adds advice to the joinpoint with arguments in a map
- // args:
- // An object that can have the following properties:
- // - adviceType
- // - adviceObj
- // - adviceFunc
- // - aroundObj
- // - aroundFunc
- // - once
- // - delay
- // - rate
- // - adviceMsg
- // - maxCalls
- this.addAdvice( args["adviceObj"], args["adviceFunc"],
- args["aroundObj"], args["aroundFunc"],
- args["adviceType"], args["precedence"],
- args["once"], args["delay"], args["rate"],
- args["adviceMsg"], args["maxCalls"]);
- },
-
- addAdvice: function( thisAdviceObj, thisAdvice,
- thisAroundObj, thisAround,
- adviceType, precedence,
- once, delay, rate, asMessage,
- maxCalls){
- // summary:
- // add advice to this joinpoint using positional parameters
- // thisAdviceObj:
- // the scope in which to locate/execute the named adviceFunc.
- // thisAdviceFunc:
- // the name of the function being conected
- // thisAroundObj:
- // the scope in which to locate/execute the named aroundFunc.
- // thisAroundFunc:
- // the name of the function that will be used to mediate the
- // advice call.
- // adviceType:
- // Optional. String. One of "before", "after", "around",
- // "before-around", or "after-around". FIXME
- // once:
- // boolean that determines whether or not this advice will create
- // a new connection if an identical advice set has already been
- // provided. Defaults to "false".
- // delay:
- // an optional delay (in ms), as an integer, for dispatch of a
- // listener after the source has been fired.
- // rate:
- // an optional rate throttling parameter (integer, in ms). When
- // specified, this particular connection will not fire more than
- // once in the interval specified by the rate
- // adviceMsg:
- // boolean. Should the listener have all the parameters passed in
- // as a single argument?
- // maxCalls:
- // Integer. The maximum number of times this connection can be
- // used before being auto-disconnected. -1 signals that the
- // connection should never be disconnected.
- var arr = this.getArr(adviceType);
- if(!arr){
- dojo.raise("bad this: " + this);
- }
-
- var ao = [thisAdviceObj, thisAdvice, thisAroundObj, thisAround, delay, rate, asMessage, maxCalls];
-
- if(once){
- if(this.hasAdvice(thisAdviceObj, thisAdvice, adviceType, arr) >= 0){
- return;
- }
- }
-
- if(precedence == "first"){
- arr.unshift(ao);
- }else{
- arr.push(ao);
- }
- },
-
- hasAdvice: function(thisAdviceObj, thisAdvice, adviceType, arr){
- // summary:
- // returns the array index of the first existing connection
- // betweened the passed advice and this joinpoint. Will be -1 if
- // none exists.
- // thisAdviceObj:
- // the scope in which to locate/execute the named adviceFunc.
- // thisAdviceFunc:
- // the name of the function being conected
- // adviceType:
- // Optional. String. One of "before", "after", "around",
- // "before-around", or "after-around". FIXME
- // arr:
- // Optional. The list of advices to search. Will be found via
- // adviceType if not passed
- if(!arr){ arr = this.getArr(adviceType); }
- var ind = -1;
- for(var x=0; x=0; i=i-1){
- var el = na[i];
- try{
- if(el && el["__clobberAttrs__"]){
- for(var j=0; j= 65 && unifiedCharCode <= 90 && evt.shiftKey == false){
- unifiedCharCode += 32;
- }
- if(unifiedCharCode >= 1 && unifiedCharCode <= 26 && evt.ctrlKey){
- unifiedCharCode += 96; // 001-032 = ctrl+[a-z]
- }
- evt.key = String.fromCharCode(unifiedCharCode);
- }
- }
- } else if(evt["type"] == "keypress"){
- if(dojo.render.html.opera){
- if(evt.which == 0){
- evt.key = evt.keyCode;
- }else if(evt.which > 0){
- switch(evt.which){
- case evt.KEY_SHIFT:
- case evt.KEY_CTRL:
- case evt.KEY_ALT:
- case evt.KEY_CAPS_LOCK:
- case evt.KEY_NUM_LOCK:
- case evt.KEY_SCROLL_LOCK:
- break;
- case evt.KEY_PAUSE:
- case evt.KEY_TAB:
- case evt.KEY_BACKSPACE:
- case evt.KEY_ENTER:
- case evt.KEY_ESCAPE:
- evt.key = evt.which;
- break;
- default:
- var unifiedCharCode = evt.which;
- if((evt.ctrlKey || evt.altKey || evt.metaKey) && (evt.which >= 65 && evt.which <= 90 && evt.shiftKey == false)){
- unifiedCharCode += 32;
- }
- evt.key = String.fromCharCode(unifiedCharCode);
- }
- }
- }else if(dojo.render.html.ie){ // catch some IE keys that are hard to get in keyDown
- // key combinations were handled in onKeyDown
- if(!evt.ctrlKey && !evt.altKey && evt.keyCode >= evt.KEY_SPACE){
- evt.key = String.fromCharCode(evt.keyCode);
- }
- }else if(dojo.render.html.safari){
- switch(evt.keyCode){
- case 25: evt.key = evt.KEY_TAB; evt.shift = true;break;
- case 63232: evt.key = evt.KEY_UP_ARROW; break;
- case 63233: evt.key = evt.KEY_DOWN_ARROW; break;
- case 63234: evt.key = evt.KEY_LEFT_ARROW; break;
- case 63235: evt.key = evt.KEY_RIGHT_ARROW; break;
- case 63236: evt.key = evt.KEY_F1; break;
- case 63237: evt.key = evt.KEY_F2; break;
- case 63238: evt.key = evt.KEY_F3; break;
- case 63239: evt.key = evt.KEY_F4; break;
- case 63240: evt.key = evt.KEY_F5; break;
- case 63241: evt.key = evt.KEY_F6; break;
- case 63242: evt.key = evt.KEY_F7; break;
- case 63243: evt.key = evt.KEY_F8; break;
- case 63244: evt.key = evt.KEY_F9; break;
- case 63245: evt.key = evt.KEY_F10; break;
- case 63246: evt.key = evt.KEY_F11; break;
- case 63247: evt.key = evt.KEY_F12; break;
- case 63250: evt.key = evt.KEY_PAUSE; break;
- case 63272: evt.key = evt.KEY_DELETE; break;
- case 63273: evt.key = evt.KEY_HOME; break;
- case 63275: evt.key = evt.KEY_END; break;
- case 63276: evt.key = evt.KEY_PAGE_UP; break;
- case 63277: evt.key = evt.KEY_PAGE_DOWN; break;
- case 63302: evt.key = evt.KEY_INSERT; break;
- case 63248://prtscr
- case 63249://scrolllock
- case 63289://numlock
- break;
- default:
- evt.key = evt.charCode >= evt.KEY_SPACE ? String.fromCharCode(evt.charCode) : evt.keyCode;
- }
- }else{
- evt.key = evt.charCode > 0 ? String.fromCharCode(evt.charCode) : evt.keyCode;
- }
- }
- }
- if(dojo.render.html.ie){
- if(!evt.target){ evt.target = evt.srcElement; }
- if(!evt.currentTarget){ evt.currentTarget = (sender ? sender : evt.srcElement); }
- if(!evt.layerX){ evt.layerX = evt.offsetX; }
- if(!evt.layerY){ evt.layerY = evt.offsetY; }
- // FIXME: scroll position query is duped from dojo.html to avoid dependency on that entire module
- // DONOT replace the following to use dojo.body(), in IE, document.documentElement should be used
- // here rather than document.body
- var doc = (evt.srcElement && evt.srcElement.ownerDocument) ? evt.srcElement.ownerDocument : document;
- var docBody = ((dojo.render.html.ie55)||(doc["compatMode"] == "BackCompat")) ? doc.body : doc.documentElement;
- if(!evt.pageX){ evt.pageX = evt.clientX + (docBody.scrollLeft || 0) }
- if(!evt.pageY){ evt.pageY = evt.clientY + (docBody.scrollTop || 0) }
- // mouseover
- if(evt.type == "mouseover"){ evt.relatedTarget = evt.fromElement; }
- // mouseout
- if(evt.type == "mouseout"){ evt.relatedTarget = evt.toElement; }
- this.currentEvent = evt;
- evt.callListener = this.callListener;
- evt.stopPropagation = this._stopPropagation;
- evt.preventDefault = this._preventDefault;
- }
- return evt; // Event
- }
-
- this.stopEvent = function(/*Event*/evt){
- // summary:
- // prevents propigation and clobbers the default action of the
- // passed event
- // evt: Optional for IE. The native event object.
- if(window.event){
- evt.cancelBubble = true;
- evt.returnValue = false;
- }else{
- evt.preventDefault();
- evt.stopPropagation();
- }
- }
-}
-
-dojo.kwCompoundRequire({
- common: ["dojo.event.common", "dojo.event.topic"],
- browser: ["dojo.event.browser"],
- dashboard: ["dojo.event.browser"]
-});
-dojo.provide("dojo.event.*");
-
-dojo.provide("dojo.gfx.color");
-
-
-
-// TODO: rewrite the "x2y" methods to take advantage of the parsing
-// abilities of the Color object. Also, beef up the Color
-// object (as possible) to parse most common formats
-
-// takes an r, g, b, a(lpha) value, [r, g, b, a] array, "rgb(...)" string, hex string (#aaa, #aaaaaa, aaaaaaa)
-dojo.gfx.color.Color = function(r, g, b, a) {
- // dojo.debug("r:", r[0], "g:", r[1], "b:", r[2]);
- if(dojo.lang.isArray(r)){
- this.r = r[0];
- this.g = r[1];
- this.b = r[2];
- this.a = r[3]||1.0;
- }else if(dojo.lang.isString(r)){
- var rgb = dojo.gfx.color.extractRGB(r);
- this.r = rgb[0];
- this.g = rgb[1];
- this.b = rgb[2];
- this.a = g||1.0;
- }else if(r instanceof dojo.gfx.color.Color){
- // why does this create a new instance if we were passed one?
- this.r = r.r;
- this.b = r.b;
- this.g = r.g;
- this.a = r.a;
- }else{
- this.r = r;
- this.g = g;
- this.b = b;
- this.a = a;
- }
-}
-
-dojo.gfx.color.Color.fromArray = function(arr) {
- return new dojo.gfx.color.Color(arr[0], arr[1], arr[2], arr[3]);
-}
-
-dojo.extend(dojo.gfx.color.Color, {
- toRgb: function(includeAlpha) {
- if(includeAlpha) {
- return this.toRgba();
- } else {
- return [this.r, this.g, this.b];
- }
- },
- toRgba: function() {
- return [this.r, this.g, this.b, this.a];
- },
- toHex: function() {
- return dojo.gfx.color.rgb2hex(this.toRgb());
- },
- toCss: function() {
- return "rgb(" + this.toRgb().join() + ")";
- },
- toString: function() {
- return this.toHex(); // decent default?
- },
- blend: function(color, weight){
- var rgb = null;
- if(dojo.lang.isArray(color)){
- rgb = color;
- }else if(color instanceof dojo.gfx.color.Color){
- rgb = color.toRgb();
- }else{
- rgb = new dojo.gfx.color.Color(color).toRgb();
- }
- return dojo.gfx.color.blend(this.toRgb(), rgb, weight);
- }
-});
-
-dojo.gfx.color.named = {
- white: [255,255,255],
- black: [0,0,0],
- red: [255,0,0],
- green: [0,255,0],
- lime: [0,255,0],
- blue: [0,0,255],
- navy: [0,0,128],
- gray: [128,128,128],
- silver: [192,192,192]
-};
-
-dojo.gfx.color.blend = function(a, b, weight){
- // summary:
- // blend colors a and b (both as RGB array or hex strings) with weight
- // from -1 to +1, 0 being a 50/50 blend
- if(typeof a == "string"){
- return dojo.gfx.color.blendHex(a, b, weight);
- }
- if(!weight){
- weight = 0;
- }
- weight = Math.min(Math.max(-1, weight), 1);
-
- // alex: this interface blows.
- // map -1 to 1 to the range 0 to 1
- weight = ((weight + 1)/2);
-
- var c = [];
-
- // var stop = (1000*weight);
- for(var x = 0; x < 3; x++){
- c[x] = parseInt( b[x] + ( (a[x] - b[x]) * weight) );
- }
- return c;
-}
-
-// very convenient blend that takes and returns hex values
-// (will get called automatically by blend when blend gets strings)
-dojo.gfx.color.blendHex = function(a, b, weight) {
- return dojo.gfx.color.rgb2hex(dojo.gfx.color.blend(dojo.gfx.color.hex2rgb(a), dojo.gfx.color.hex2rgb(b), weight));
-}
-
-// get RGB array from css-style color declarations
-dojo.gfx.color.extractRGB = function(color) {
- var hex = "0123456789abcdef";
- color = color.toLowerCase();
- if( color.indexOf("rgb") == 0 ) {
- var matches = color.match(/rgba*\((\d+), *(\d+), *(\d+)/i);
- var ret = matches.splice(1, 3);
- return ret;
- } else {
- var colors = dojo.gfx.color.hex2rgb(color);
- if(colors) {
- return colors;
- } else {
- // named color (how many do we support?)
- return dojo.gfx.color.named[color] || [255, 255, 255];
- }
- }
-}
-
-dojo.gfx.color.hex2rgb = function(hex) {
- var hexNum = "0123456789ABCDEF";
- var rgb = new Array(3);
- if( hex.indexOf("#") == 0 ) { hex = hex.substring(1); }
- hex = hex.toUpperCase();
- if(hex.replace(new RegExp("["+hexNum+"]", "g"), "") != "") {
- return null;
- }
- if( hex.length == 3 ) {
- rgb[0] = hex.charAt(0) + hex.charAt(0)
- rgb[1] = hex.charAt(1) + hex.charAt(1)
- rgb[2] = hex.charAt(2) + hex.charAt(2);
- } else {
- rgb[0] = hex.substring(0, 2);
- rgb[1] = hex.substring(2, 4);
- rgb[2] = hex.substring(4);
- }
- for(var i = 0; i < rgb.length; i++) {
- rgb[i] = hexNum.indexOf(rgb[i].charAt(0)) * 16 + hexNum.indexOf(rgb[i].charAt(1));
- }
- return rgb;
-}
-
-dojo.gfx.color.rgb2hex = function(r, g, b) {
- if(dojo.lang.isArray(r)) {
- g = r[1] || 0;
- b = r[2] || 0;
- r = r[0] || 0;
- }
- var ret = dojo.lang.map([r, g, b], function(x) {
- x = new Number(x);
- var s = x.toString(16);
- while(s.length < 2) { s = "0" + s; }
- return s;
- });
- ret.unshift("#");
- return ret.join("");
-}
-
-dojo.provide("dojo.lfx.Animation");
-
-
-
-/*
- Animation package based on Dan Pupius' work: http://pupius.co.uk/js/Toolkit.Drawing.js
-*/
-dojo.lfx.Line = function(/*int*/ start, /*int*/ end){
- // summary: dojo.lfx.Line is the object used to generate values
- // from a start value to an end value
- this.start = start;
- this.end = end;
- if(dojo.lang.isArray(start)){
- /* start: Array
- end: Array
- pId: a */
- var diff = [];
- dojo.lang.forEach(this.start, function(s,i){
- diff[i] = this.end[i] - s;
- }, this);
-
- this.getValue = function(/*float*/ n){
- var res = [];
- dojo.lang.forEach(this.start, function(s, i){
- res[i] = (diff[i] * n) + s;
- }, this);
- return res; // Array
- }
- }else{
- var diff = end - start;
-
- this.getValue = function(/*float*/ n){
- // summary: returns the point on the line
- // n: a floating point number greater than 0 and less than 1
- return (diff * n) + this.start; // Decimal
- }
- }
-}
-
-if((dojo.render.html.khtml)&&(!dojo.render.html.safari)){
- // the cool kids are obviously not using konqueror...
- // found a very wierd bug in floats constants, 1.5 evals as 1
- // seems somebody mixed up ints and floats in 3.5.4 ??
- // FIXME: investigate more and post a KDE bug (Fredrik)
- dojo.lfx.easeDefault = function(/*Decimal?*/ n){
- // summary: Returns the point for point n on a sin wave.
- return (parseFloat("0.5")+((Math.sin( (n+parseFloat("1.5")) * Math.PI))/2));
- }
-}else{
- dojo.lfx.easeDefault = function(/*Decimal?*/ n){
- return (0.5+((Math.sin( (n+1.5) * Math.PI))/2));
- }
-}
-
-dojo.lfx.easeIn = function(/*Decimal?*/ n){
- // summary: returns the point on an easing curve
- // n: a floating point number greater than 0 and less than 1
- return Math.pow(n, 3);
-}
-
-dojo.lfx.easeOut = function(/*Decimal?*/ n){
- // summary: returns the point on the line
- // n: a floating point number greater than 0 and less than 1
- return ( 1 - Math.pow(1 - n, 3) );
-}
-
-dojo.lfx.easeInOut = function(/*Decimal?*/ n){
- // summary: returns the point on the line
- // n: a floating point number greater than 0 and less than 1
- return ( (3 * Math.pow(n, 2)) - (2 * Math.pow(n, 3)) );
-}
-
-dojo.lfx.IAnimation = function(){
- // summary: dojo.lfx.IAnimation is an interface that implements
- // commonly used functions of animation objects
-}
-dojo.lang.extend(dojo.lfx.IAnimation, {
- // public properties
- curve: null,
- duration: 1000,
- easing: null,
- repeatCount: 0,
- rate: 10,
-
- // events
- handler: null,
- beforeBegin: null,
- onBegin: null,
- onAnimate: null,
- onEnd: null,
- onPlay: null,
- onPause: null,
- onStop: null,
-
- // public methods
- play: null,
- pause: null,
- stop: null,
-
- connect: function(/*Event*/ evt, /*Object*/ scope, /*Function*/ newFunc){
- // summary: Convenience function. Quickly connect to an event
- // of this object and save the old functions connected to it.
- // evt: The name of the event to connect to.
- // scope: the scope in which to run newFunc.
- // newFunc: the function to run when evt is fired.
- if(!newFunc){
- /* scope: Function
- newFunc: null
- pId: f */
- newFunc = scope;
- scope = this;
- }
- newFunc = dojo.lang.hitch(scope, newFunc);
- var oldFunc = this[evt]||function(){};
- this[evt] = function(){
- var ret = oldFunc.apply(this, arguments);
- newFunc.apply(this, arguments);
- return ret;
- }
- return this; // dojo.lfx.IAnimation
- },
-
- fire: function(/*Event*/ evt, /*Array*/ args){
- // summary: Convenience function. Fire event "evt" and pass it
- // the arguments specified in "args".
- // evt: The event to fire.
- // args: The arguments to pass to the event.
- if(this[evt]){
- this[evt].apply(this, (args||[]));
- }
- return this; // dojo.lfx.IAnimation
- },
-
- repeat: function(/*int*/ count){
- // summary: Set the repeat count of this object.
- // count: How many times to repeat the animation.
- this.repeatCount = count;
- return this; // dojo.lfx.IAnimation
- },
-
- // private properties
- _active: false,
- _paused: false
-});
-
-dojo.lfx.Animation = function( /*Object*/ handlers,
- /*int*/ duration,
- /*dojo.lfx.Line*/ curve,
- /*function*/ easing,
- /*int*/ repeatCount,
- /*int*/ rate){
- // summary
- // a generic animation object that fires callbacks into it's handlers
- // object at various states
- // handlers: { handler: Function?, onstart: Function?, onstop: Function?, onanimate: Function? }
- dojo.lfx.IAnimation.call(this);
- if(dojo.lang.isNumber(handlers)||(!handlers && duration.getValue)){
- // no handlers argument:
- rate = repeatCount;
- repeatCount = easing;
- easing = curve;
- curve = duration;
- duration = handlers;
- handlers = null;
- }else if(handlers.getValue||dojo.lang.isArray(handlers)){
- // no handlers or duration:
- rate = easing;
- repeatCount = curve;
- easing = duration;
- curve = handlers;
- duration = null;
- handlers = null;
- }
- if(dojo.lang.isArray(curve)){
- /* curve: Array
- pId: a */
- this.curve = new dojo.lfx.Line(curve[0], curve[1]);
- }else{
- this.curve = curve;
- }
- if(duration != null && duration > 0){ this.duration = duration; }
- if(repeatCount){ this.repeatCount = repeatCount; }
- if(rate){ this.rate = rate; }
- if(handlers){
- dojo.lang.forEach([
- "handler", "beforeBegin", "onBegin",
- "onEnd", "onPlay", "onStop", "onAnimate"
- ], function(item){
- if(handlers[item]){
- this.connect(item, handlers[item]);
- }
- }, this);
- }
- if(easing && dojo.lang.isFunction(easing)){
- this.easing=easing;
- }
-}
-dojo.inherits(dojo.lfx.Animation, dojo.lfx.IAnimation);
-dojo.lang.extend(dojo.lfx.Animation, {
- // "private" properties
- _startTime: null,
- _endTime: null,
- _timer: null,
- _percent: 0,
- _startRepeatCount: 0,
-
- // public methods
- play: function(/*int?*/ delay, /*bool?*/ gotoStart){
- // summary: Start the animation.
- // delay: How many milliseconds to delay before starting.
- // gotoStart: If true, starts the animation from the beginning; otherwise,
- // starts it from its current position.
- if(gotoStart){
- clearTimeout(this._timer);
- this._active = false;
- this._paused = false;
- this._percent = 0;
- }else if(this._active && !this._paused){
- return this; // dojo.lfx.Animation
- }
-
- this.fire("handler", ["beforeBegin"]);
- this.fire("beforeBegin");
-
- if(delay > 0){
- setTimeout(dojo.lang.hitch(this, function(){ this.play(null, gotoStart); }), delay);
- return this; // dojo.lfx.Animation
- }
-
- this._startTime = new Date().valueOf();
- if(this._paused){
- this._startTime -= (this.duration * this._percent / 100);
- }
- this._endTime = this._startTime + this.duration;
-
- this._active = true;
- this._paused = false;
-
- var step = this._percent / 100;
- var value = this.curve.getValue(step);
- if(this._percent == 0 ){
- if(!this._startRepeatCount){
- this._startRepeatCount = this.repeatCount;
- }
- this.fire("handler", ["begin", value]);
- this.fire("onBegin", [value]);
- }
-
- this.fire("handler", ["play", value]);
- this.fire("onPlay", [value]);
-
- this._cycle();
- return this; // dojo.lfx.Animation
- },
-
- pause: function(){
- // summary: Pauses a running animation.
- clearTimeout(this._timer);
- if(!this._active){ return this; /*dojo.lfx.Animation*/}
- this._paused = true;
- var value = this.curve.getValue(this._percent / 100);
- this.fire("handler", ["pause", value]);
- this.fire("onPause", [value]);
- return this; // dojo.lfx.Animation
- },
-
- gotoPercent: function(/*Decimal*/ pct, /*bool?*/ andPlay){
- // summary: Sets the progress of the animation.
- // pct: A percentage in decimal notation (between and including 0.0 and 1.0).
- // andPlay: If true, play the animation after setting the progress.
- clearTimeout(this._timer);
- this._active = true;
- this._paused = true;
- this._percent = pct;
- if(andPlay){ this.play(); }
- return this; // dojo.lfx.Animation
- },
-
- stop: function(/*bool?*/ gotoEnd){
- // summary: Stops a running animation.
- // gotoEnd: If true, the animation will end.
- clearTimeout(this._timer);
- var step = this._percent / 100;
- if(gotoEnd){
- step = 1;
- }
- var value = this.curve.getValue(step);
- this.fire("handler", ["stop", value]);
- this.fire("onStop", [value]);
- this._active = false;
- this._paused = false;
- return this; // dojo.lfx.Animation
- },
-
- status: function(){
- // summary: Returns a string representation of the status of
- // the animation.
- if(this._active){
- return this._paused ? "paused" : "playing"; // String
- }else{
- return "stopped"; // String
- }
- return this;
- },
-
- // "private" methods
- _cycle: function(){
- clearTimeout(this._timer);
- if(this._active){
- var curr = new Date().valueOf();
- var step = (curr - this._startTime) / (this._endTime - this._startTime);
-
- if(step >= 1){
- step = 1;
- this._percent = 100;
- }else{
- this._percent = step * 100;
- }
-
- // Perform easing
- if((this.easing)&&(dojo.lang.isFunction(this.easing))){
- step = this.easing(step);
- }
-
- var value = this.curve.getValue(step);
- this.fire("handler", ["animate", value]);
- this.fire("onAnimate", [value]);
-
- if( step < 1 ){
- this._timer = setTimeout(dojo.lang.hitch(this, "_cycle"), this.rate);
- }else{
- this._active = false;
- this.fire("handler", ["end"]);
- this.fire("onEnd");
-
- if(this.repeatCount > 0){
- this.repeatCount--;
- this.play(null, true);
- }else if(this.repeatCount == -1){
- this.play(null, true);
- }else{
- if(this._startRepeatCount){
- this.repeatCount = this._startRepeatCount;
- this._startRepeatCount = 0;
- }
- }
- }
- }
- return this; // dojo.lfx.Animation
- }
-});
-
-dojo.lfx.Combine = function(/*dojo.lfx.IAnimation...*/ animations){
- // summary: An animation object to play animations passed to it at the same time.
- dojo.lfx.IAnimation.call(this);
- this._anims = [];
- this._animsEnded = 0;
-
- var anims = arguments;
- if(anims.length == 1 && (dojo.lang.isArray(anims[0]) || dojo.lang.isArrayLike(anims[0]))){
- /* animations: dojo.lfx.IAnimation[]
- pId: a */
- anims = anims[0];
- }
-
- dojo.lang.forEach(anims, function(anim){
- this._anims.push(anim);
- anim.connect("onEnd", dojo.lang.hitch(this, "_onAnimsEnded"));
- }, this);
-}
-dojo.inherits(dojo.lfx.Combine, dojo.lfx.IAnimation);
-dojo.lang.extend(dojo.lfx.Combine, {
- // private members
- _animsEnded: 0,
-
- // public methods
- play: function(/*int?*/ delay, /*bool?*/ gotoStart){
- // summary: Start the animations.
- // delay: How many milliseconds to delay before starting.
- // gotoStart: If true, starts the animations from the beginning; otherwise,
- // starts them from their current position.
- if( !this._anims.length ){ return this; /*dojo.lfx.Combine*/}
-
- this.fire("beforeBegin");
-
- if(delay > 0){
- setTimeout(dojo.lang.hitch(this, function(){ this.play(null, gotoStart); }), delay);
- return this; // dojo.lfx.Combine
- }
-
- if(gotoStart || this._anims[0].percent == 0){
- this.fire("onBegin");
- }
- this.fire("onPlay");
- this._animsCall("play", null, gotoStart);
- return this; // dojo.lfx.Combine
- },
-
- pause: function(){
- // summary: Pauses the running animations.
- this.fire("onPause");
- this._animsCall("pause");
- return this; // dojo.lfx.Combine
- },
-
- stop: function(/*bool?*/ gotoEnd){
- // summary: Stops the running animations.
- // gotoEnd: If true, the animations will end.
- this.fire("onStop");
- this._animsCall("stop", gotoEnd);
- return this; // dojo.lfx.Combine
- },
-
- // private methods
- _onAnimsEnded: function(){
- this._animsEnded++;
- if(this._animsEnded >= this._anims.length){
- this.fire("onEnd");
- }
- return this; // dojo.lfx.Combine
- },
-
- _animsCall: function(/*String*/ funcName){
- var args = [];
- if(arguments.length > 1){
- for(var i = 1 ; i < arguments.length ; i++){
- args.push(arguments[i]);
- }
- }
- var _this = this;
- dojo.lang.forEach(this._anims, function(anim){
- anim[funcName](args);
- }, _this);
- return this; // dojo.lfx.Combine
- }
-});
-
-dojo.lfx.Chain = function(/*dojo.lfx.IAnimation...*/ animations) {
- // summary: An animation object to play animations passed to it
- // one after another.
- dojo.lfx.IAnimation.call(this);
- this._anims = [];
- this._currAnim = -1;
-
- var anims = arguments;
- if(anims.length == 1 && (dojo.lang.isArray(anims[0]) || dojo.lang.isArrayLike(anims[0]))){
- /* animations: dojo.lfx.IAnimation[]
- pId: a */
- anims = anims[0];
- }
-
- var _this = this;
- dojo.lang.forEach(anims, function(anim, i, anims_arr){
- this._anims.push(anim);
- if(i < anims_arr.length - 1){
- anim.connect("onEnd", dojo.lang.hitch(this, "_playNext") );
- }else{
- anim.connect("onEnd", dojo.lang.hitch(this, function(){ this.fire("onEnd"); }) );
- }
- }, this);
-}
-dojo.inherits(dojo.lfx.Chain, dojo.lfx.IAnimation);
-dojo.lang.extend(dojo.lfx.Chain, {
- // private members
- _currAnim: -1,
-
- // public methods
- play: function(/*int?*/ delay, /*bool?*/ gotoStart){
- // summary: Start the animation sequence.
- // delay: How many milliseconds to delay before starting.
- // gotoStart: If true, starts the sequence from the beginning; otherwise,
- // starts it from its current position.
- if( !this._anims.length ) { return this; /*dojo.lfx.Chain*/}
- if( gotoStart || !this._anims[this._currAnim] ) {
- this._currAnim = 0;
- }
-
- var currentAnimation = this._anims[this._currAnim];
-
- this.fire("beforeBegin");
- if(delay > 0){
- setTimeout(dojo.lang.hitch(this, function(){ this.play(null, gotoStart); }), delay);
- return this; // dojo.lfx.Chain
- }
-
- if(currentAnimation){
- if(this._currAnim == 0){
- this.fire("handler", ["begin", this._currAnim]);
- this.fire("onBegin", [this._currAnim]);
- }
- this.fire("onPlay", [this._currAnim]);
- currentAnimation.play(null, gotoStart);
- }
- return this; // dojo.lfx.Chain
- },
-
- pause: function(){
- // summary: Pauses the running animation sequence.
- if( this._anims[this._currAnim] ) {
- this._anims[this._currAnim].pause();
- this.fire("onPause", [this._currAnim]);
- }
- return this; // dojo.lfx.Chain
- },
-
- playPause: function(){
- // summary: If the animation sequence is playing, pause it; otherwise,
- // play it.
- if(this._anims.length == 0){ return this; }
- if(this._currAnim == -1){ this._currAnim = 0; }
- var currAnim = this._anims[this._currAnim];
- if( currAnim ) {
- if( !currAnim._active || currAnim._paused ) {
- this.play();
- } else {
- this.pause();
- }
- }
- return this; // dojo.lfx.Chain
- },
-
- stop: function(){
- // summary: Stops the running animations.
- var currAnim = this._anims[this._currAnim];
- if(currAnim){
- currAnim.stop();
- this.fire("onStop", [this._currAnim]);
- }
- return currAnim; // dojo.lfx.IAnimation
- },
-
- // private methods
- _playNext: function(){
- if( this._currAnim == -1 || this._anims.length == 0 ) { return this; }
- this._currAnim++;
- if( this._anims[this._currAnim] ){
- this._anims[this._currAnim].play(null, true);
- }
- return this; // dojo.lfx.Chain
- }
-});
-
-dojo.lfx.combine = function(/*dojo.lfx.IAnimation...*/ animations){
- // summary: Convenience function. Returns a dojo.lfx.Combine created
- // using the animations passed in.
- var anims = arguments;
- if(dojo.lang.isArray(arguments[0])){
- /* animations: dojo.lfx.IAnimation[]
- pId: a */
- anims = arguments[0];
- }
- if(anims.length == 1){ return anims[0]; }
- return new dojo.lfx.Combine(anims); // dojo.lfx.Combine
-}
-
-dojo.lfx.chain = function(/*dojo.lfx.IAnimation...*/ animations){
- // summary: Convenience function. Returns a dojo.lfx.Chain created
- // using the animations passed in.
- var anims = arguments;
- if(dojo.lang.isArray(arguments[0])){
- /* animations: dojo.lfx.IAnimation[]
- pId: a */
- anims = arguments[0];
- }
- if(anims.length == 1){ return anims[0]; }
- return new dojo.lfx.Chain(anims); // dojo.lfx.Combine
-}
-
-dojo.provide("dojo.html.common");
-
-
-
-dojo.lang.mixin(dojo.html, dojo.dom);
-
-dojo.html.body = function(){
- dojo.deprecated("dojo.html.body() moved to dojo.body()", "0.5");
- return dojo.body();
-}
-
-// FIXME: we are going to assume that we can throw any and every rendering
-// engine into the IE 5.x box model. In Mozilla, we do this w/ CSS.
-// Need to investigate for KHTML and Opera
-
-dojo.html.getEventTarget = function(/* DOMEvent */evt){
- // summary
- // Returns the target of an event
- if(!evt) { evt = dojo.global().event || {} };
- var t = (evt.srcElement ? evt.srcElement : (evt.target ? evt.target : null));
- while((t)&&(t.nodeType!=1)){ t = t.parentNode; }
- return t; // HTMLElement
-}
-
-dojo.html.getViewport = function(){
- // summary
- // Returns the dimensions of the viewable area of a browser window
- var _window = dojo.global();
- var _document = dojo.doc();
- var w = 0;
- var h = 0;
-
- if(dojo.render.html.mozilla){
- // mozilla
- w = _document.documentElement.clientWidth;
- h = _window.innerHeight;
- }else if(!dojo.render.html.opera && _window.innerWidth){
- //in opera9, dojo.body().clientWidth should be used, instead
- //of window.innerWidth/document.documentElement.clientWidth
- //so we have to check whether it is opera
- w = _window.innerWidth;
- h = _window.innerHeight;
- } else if (!dojo.render.html.opera && dojo.exists(_document, "documentElement.clientWidth")){
- // IE6 Strict
- var w2 = _document.documentElement.clientWidth;
- // this lets us account for scrollbars
- if(!w || w2 && w2 < w) {
- w = w2;
- }
- h = _document.documentElement.clientHeight;
- } else if (dojo.body().clientWidth){
- // IE, Opera
- w = dojo.body().clientWidth;
- h = dojo.body().clientHeight;
- }
- return { width: w, height: h }; // object
-}
-
-dojo.html.getScroll = function(){
- // summary
- // Returns the scroll position of the document
- var _window = dojo.global();
- var _document = dojo.doc();
- var top = _window.pageYOffset || _document.documentElement.scrollTop || dojo.body().scrollTop || 0;
- var left = _window.pageXOffset || _document.documentElement.scrollLeft || dojo.body().scrollLeft || 0;
- return {
- top: top,
- left: left,
- offset:{ x: left, y: top } // note the change, NOT an Array with added properties.
- }; // object
-}
-
-dojo.html.getParentByType = function(/* HTMLElement */node, /* string */type) {
- // summary
- // Returns the first ancestor of node with tagName type.
- var _document = dojo.doc();
- var parent = dojo.byId(node);
- type = type.toLowerCase();
- while((parent)&&(parent.nodeName.toLowerCase()!=type)){
- if(parent==(_document["body"]||_document["documentElement"])){
- return null;
- }
- parent = parent.parentNode;
- }
- return parent; // HTMLElement
-}
-
-dojo.html.getAttribute = function(/* HTMLElement */node, /* string */attr){
- // summary
- // Returns the value of attribute attr from node.
- node = dojo.byId(node);
- // FIXME: need to add support for attr-specific accessors
- if((!node)||(!node.getAttribute)){
- // if(attr !== 'nwType'){
- // alert("getAttr of '" + attr + "' with bad node");
- // }
- return null;
- }
- var ta = typeof attr == 'string' ? attr : new String(attr);
-
- // first try the approach most likely to succeed
- var v = node.getAttribute(ta.toUpperCase());
- if((v)&&(typeof v == 'string')&&(v!="")){
- return v; // string
- }
-
- // try returning the attributes value, if we couldn't get it as a string
- if(v && v.value){
- return v.value; // string
- }
-
- // this should work on Opera 7, but it's a little on the crashy side
- if((node.getAttributeNode)&&(node.getAttributeNode(ta))){
- return (node.getAttributeNode(ta)).value; // string
- }else if(node.getAttribute(ta)){
- return node.getAttribute(ta); // string
- }else if(node.getAttribute(ta.toLowerCase())){
- return node.getAttribute(ta.toLowerCase()); // string
- }
- return null; // string
-}
-
-dojo.html.hasAttribute = function(/* HTMLElement */node, /* string */attr){
- // summary
- // Determines whether or not the specified node carries a value for the attribute in question.
- return dojo.html.getAttribute(dojo.byId(node), attr) ? true : false; // boolean
-}
-
-dojo.html.getCursorPosition = function(/* DOMEvent */e){
- // summary
- // Returns the mouse position relative to the document (not the viewport).
- // For example, if you have a document that is 10000px tall,
- // but your browser window is only 100px tall,
- // if you scroll to the bottom of the document and call this function it
- // will return {x: 0, y: 10000}
- // NOTE: for events delivered via dojo.event.connect() and/or dojoAttachEvent (for widgets),
- // you can just access evt.pageX and evt.pageY, rather than calling this function.
- e = e || dojo.global().event;
- var cursor = {x:0, y:0};
- if(e.pageX || e.pageY){
- cursor.x = e.pageX;
- cursor.y = e.pageY;
- }else{
- var de = dojo.doc().documentElement;
- var db = dojo.body();
- cursor.x = e.clientX + ((de||db)["scrollLeft"]) - ((de||db)["clientLeft"]);
- cursor.y = e.clientY + ((de||db)["scrollTop"]) - ((de||db)["clientTop"]);
- }
- return cursor; // object
-}
-
-dojo.html.isTag = function(/* HTMLElement */node) {
- // summary
- // Like dojo.dom.isTag, except case-insensitive
- node = dojo.byId(node);
- if(node && node.tagName) {
- for (var i=1; i,
- //which will be treated as an external javascript file in IE
- var xscript = dojo.doc().createElement('script');
- xscript.src = "javascript:'dojo.html.createExternalElement=function(doc, tag){ return doc.createElement(tag); }'";
- dojo.doc().getElementsByTagName("head")[0].appendChild(xscript);
- })();
- }
-}else{
- //for other browsers, simply use document.createElement
- //is enough
- dojo.html.createExternalElement = function(/* HTMLDocument */doc, /* string */tag){
- // summary
- // Creates an element in the HTML document, here for ActiveX activation workaround.
- return doc.createElement(tag); // HTMLElement
- }
-}
-
-dojo.html._callDeprecated = function(inFunc, replFunc, args, argName, retValue){
- dojo.deprecated("dojo.html." + inFunc,
- "replaced by dojo.html." + replFunc + "(" + (argName ? "node, {"+ argName + ": " + argName + "}" : "" ) + ")" + (retValue ? "." + retValue : ""), "0.5");
- var newArgs = [];
- if(argName){ var argsIn = {}; argsIn[argName] = args[1]; newArgs.push(args[0]); newArgs.push(argsIn); }
- else { newArgs = args }
- var ret = dojo.html[replFunc].apply(dojo.html, args);
- if(retValue){ return ret[retValue]; }
- else { return ret; }
-}
-
-dojo.html.getViewportWidth = function(){
- return dojo.html._callDeprecated("getViewportWidth", "getViewport", arguments, null, "width");
-}
-dojo.html.getViewportHeight = function(){
- return dojo.html._callDeprecated("getViewportHeight", "getViewport", arguments, null, "height");
-}
-dojo.html.getViewportSize = function(){
- return dojo.html._callDeprecated("getViewportSize", "getViewport", arguments);
-}
-dojo.html.getScrollTop = function(){
- return dojo.html._callDeprecated("getScrollTop", "getScroll", arguments, null, "top");
-}
-dojo.html.getScrollLeft = function(){
- return dojo.html._callDeprecated("getScrollLeft", "getScroll", arguments, null, "left");
-}
-dojo.html.getScrollOffset = function(){
- return dojo.html._callDeprecated("getScrollOffset", "getScroll", arguments, null, "offset");
-}
-
-dojo.provide("dojo.uri.Uri");
-
-dojo.uri = new function() {
- this.dojoUri = function (/*dojo.uri.Uri||String*/uri) {
- // summary: returns a Uri object resolved relative to the dojo root
- return new dojo.uri.Uri(dojo.hostenv.getBaseScriptUri(), uri);
- }
-
- this.moduleUri = function(/*String*/module, /*dojo.uri.Uri||String*/uri){
- // summary: returns a Uri object relative to a module
- // description: Examples: dojo.uri.moduleUri("dojo.widget","templates/template.html"), or dojo.uri.moduleUri("acme","images/small.png")
- var loc = dojo.hostenv.getModuleSymbols(module).join('/');
- if(!loc){
- return null;
- }
- if(loc.lastIndexOf("/") != loc.length-1){
- loc += "/";
- }
-
- //If the path is an absolute path (starts with a / or is on another domain/xdomain)
- //then don't add the baseScriptUri.
- var colonIndex = loc.indexOf(":");
- var slashIndex = loc.indexOf("/");
- if(loc.charAt(0) != "/" && (colonIndex == -1 || colonIndex > slashIndex)){
- loc = dojo.hostenv.getBaseScriptUri() + loc;
- }
-
- return new dojo.uri.Uri(loc,uri);
- }
-
- this.Uri = function (/*dojo.uri.Uri||String...*/) {
- // summary: Constructor to create an object representing a URI.
- // description:
- // Each argument is evaluated in order relative to the next until
- // a canonical uri is produced. To get an absolute Uri relative
- // to the current document use
- // new dojo.uri.Uri(document.baseURI, uri)
-
- // TODO: support for IPv6, see RFC 2732
-
- // resolve uri components relative to each other
- var uri = arguments[0];
- for (var i = 1; i < arguments.length; i++) {
- if(!arguments[i]) { continue; }
-
- // Safari doesn't support this.constructor so we have to be explicit
- var relobj = new dojo.uri.Uri(arguments[i].toString());
- var uriobj = new dojo.uri.Uri(uri.toString());
-
- if ((relobj.path=="")&&(relobj.scheme==null)&&(relobj.authority==null)&&(relobj.query==null)) {
- if (relobj.fragment != null) { uriobj.fragment = relobj.fragment; }
- relobj = uriobj;
- } else if (relobj.scheme == null) {
- relobj.scheme = uriobj.scheme;
-
- if (relobj.authority == null) {
- relobj.authority = uriobj.authority;
-
- if (relobj.path.charAt(0) != "/") {
- var path = uriobj.path.substring(0,
- uriobj.path.lastIndexOf("/") + 1) + relobj.path;
-
- var segs = path.split("/");
- for (var j = 0; j < segs.length; j++) {
- if (segs[j] == ".") {
- if (j == segs.length - 1) { segs[j] = ""; }
- else { segs.splice(j, 1); j--; }
- } else if (j > 0 && !(j == 1 && segs[0] == "") &&
- segs[j] == ".." && segs[j-1] != "..") {
-
- if (j == segs.length - 1) { segs.splice(j, 1); segs[j - 1] = ""; }
- else { segs.splice(j - 1, 2); j -= 2; }
- }
- }
- relobj.path = segs.join("/");
- }
- }
- }
-
- uri = "";
- if (relobj.scheme != null) { uri += relobj.scheme + ":"; }
- if (relobj.authority != null) { uri += "//" + relobj.authority; }
- uri += relobj.path;
- if (relobj.query != null) { uri += "?" + relobj.query; }
- if (relobj.fragment != null) { uri += "#" + relobj.fragment; }
- }
-
- this.uri = uri.toString();
-
- // break the uri into its main components
- var regexp = "^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$";
- var r = this.uri.match(new RegExp(regexp));
-
- this.scheme = r[2] || (r[1] ? "" : null);
- this.authority = r[4] || (r[3] ? "" : null);
- this.path = r[5]; // can never be undefined
- this.query = r[7] || (r[6] ? "" : null);
- this.fragment = r[9] || (r[8] ? "" : null);
-
- if (this.authority != null) {
- // server based naming authority
- regexp = "^((([^:]+:)?([^@]+))@)?([^:]*)(:([0-9]+))?$";
- r = this.authority.match(new RegExp(regexp));
-
- this.user = r[3] || null;
- this.password = r[4] || null;
- this.host = r[5];
- this.port = r[7] || null;
- }
-
- this.toString = function(){ return this.uri; }
- }
-};
-
-dojo.provide("dojo.html.style");
-
-
-
-dojo.html.getClass = function(/* HTMLElement */node){
- // summary
- // Returns the string value of the list of CSS classes currently assigned directly
- // to the node in question. Returns an empty string if no class attribute is found;
- node = dojo.byId(node);
- if(!node){ return ""; }
- var cs = "";
- if(node.className){
- cs = node.className;
- }else if(dojo.html.hasAttribute(node, "class")){
- cs = dojo.html.getAttribute(node, "class");
- }
- return cs.replace(/^\s+|\s+$/g, ""); // string
-}
-
-dojo.html.getClasses = function(/* HTMLElement */node) {
- // summary
- // Returns an array of CSS classes currently assigned directly to the node in question.
- // Returns an empty array if no classes are found;
- var c = dojo.html.getClass(node);
- return (c == "") ? [] : c.split(/\s+/g); // array
-}
-
-dojo.html.hasClass = function(/* HTMLElement */node, /* string */classname){
- // summary
- // Returns whether or not the specified classname is a portion of the
- // class list currently applied to the node. Does not cover cascaded
- // styles, only classes directly applied to the node.
- return (new RegExp('(^|\\s+)'+classname+'(\\s+|$)')).test(dojo.html.getClass(node)) // boolean
-}
-
-dojo.html.prependClass = function(/* HTMLElement */node, /* string */classStr){
- // summary
- // Adds the specified class to the beginning of the class list on the
- // passed node. This gives the specified class the highest precidence
- // when style cascading is calculated for the node. Returns true or
- // false; indicating success or failure of the operation, respectively.
- classStr += " " + dojo.html.getClass(node);
- return dojo.html.setClass(node, classStr); // boolean
-}
-
-dojo.html.addClass = function(/* HTMLElement */node, /* string */classStr){
- // summary
- // Adds the specified class to the end of the class list on the
- // passed &node;. Returns &true; or &false; indicating success or failure.
- if (dojo.html.hasClass(node, classStr)) {
- return false;
- }
- classStr = (dojo.html.getClass(node) + " " + classStr).replace(/^\s+|\s+$/g,"");
- return dojo.html.setClass(node, classStr); // boolean
-}
-
-dojo.html.setClass = function(/* HTMLElement */node, /* string */classStr){
- // summary
- // Clobbers the existing list of classes for the node, replacing it with
- // the list given in the 2nd argument. Returns true or false
- // indicating success or failure.
- node = dojo.byId(node);
- var cs = new String(classStr);
- try{
- if(typeof node.className == "string"){
- node.className = cs;
- }else if(node.setAttribute){
- node.setAttribute("class", classStr);
- node.className = cs;
- }else{
- return false;
- }
- }catch(e){
- dojo.debug("dojo.html.setClass() failed", e);
- }
- return true;
-}
-
-dojo.html.removeClass = function(/* HTMLElement */node, /* string */classStr, /* boolean? */allowPartialMatches){
- // summary
- // Removes the className from the node;. Returns true or false indicating success or failure.
- try{
- if (!allowPartialMatches) {
- var newcs = dojo.html.getClass(node).replace(new RegExp('(^|\\s+)'+classStr+'(\\s+|$)'), "$1$2");
- } else {
- var newcs = dojo.html.getClass(node).replace(classStr,'');
- }
- dojo.html.setClass(node, newcs);
- }catch(e){
- dojo.debug("dojo.html.removeClass() failed", e);
- }
- return true; // boolean
-}
-
-dojo.html.replaceClass = function(/* HTMLElement */node, /* string */newClass, /* string */oldClass) {
- // summary
- // Replaces 'oldClass' and adds 'newClass' to node
- dojo.html.removeClass(node, oldClass);
- dojo.html.addClass(node, newClass);
-}
-
-// Enum type for getElementsByClass classMatchType arg:
-dojo.html.classMatchType = {
- ContainsAll : 0, // all of the classes are part of the node's class (default)
- ContainsAny : 1, // any of the classes are part of the node's class
- IsOnly : 2 // only all of the classes are part of the node's class
-}
-
-
-dojo.html.getElementsByClass = function(
- /* string */classStr,
- /* HTMLElement? */parent,
- /* string? */nodeType,
- /* integer? */classMatchType,
- /* boolean? */useNonXpath
-){
- // summary
- // Returns an array of nodes for the given classStr, children of a
- // parent, and optionally of a certain nodeType
- // FIXME: temporarily set to false because of several dojo tickets related
- // to the xpath version not working consistently in firefox.
- useNonXpath = false;
- var _document = dojo.doc();
- parent = dojo.byId(parent) || _document;
- var classes = classStr.split(/\s+/g);
- var nodes = [];
- if( classMatchType != 1 && classMatchType != 2 ) classMatchType = 0; // make it enum
- var reClass = new RegExp("(\\s|^)((" + classes.join(")|(") + "))(\\s|$)");
- var srtLength = classes.join(" ").length;
- var candidateNodes = [];
-
- if(!useNonXpath && _document.evaluate) { // supports dom 3 xpath
- var xpath = ".//" + (nodeType || "*") + "[contains(";
- if(classMatchType != dojo.html.classMatchType.ContainsAny){
- xpath += "concat(' ',@class,' '), ' " +
- classes.join(" ') and contains(concat(' ',@class,' '), ' ") +
- " ')";
- if (classMatchType == 2) {
- xpath += " and string-length(@class)="+srtLength+"]";
- }else{
- xpath += "]";
- }
- }else{
- xpath += "concat(' ',@class,' '), ' " +
- classes.join(" ') or contains(concat(' ',@class,' '), ' ") +
- " ')]";
- }
- var xpathResult = _document.evaluate(xpath, parent, null, XPathResult.ANY_TYPE, null);
- var result = xpathResult.iterateNext();
- while(result){
- try{
- candidateNodes.push(result);
- result = xpathResult.iterateNext();
- }catch(e){ break; }
- }
- return candidateNodes; // NodeList
- }else{
- if(!nodeType){
- nodeType = "*";
- }
- candidateNodes = parent.getElementsByTagName(nodeType);
-
- var node, i = 0;
- outer:
- while(node = candidateNodes[i++]){
- var nodeClasses = dojo.html.getClasses(node);
- if(nodeClasses.length == 0){ continue outer; }
- var matches = 0;
-
- for(var j = 0; j < nodeClasses.length; j++){
- if(reClass.test(nodeClasses[j])){
- if(classMatchType == dojo.html.classMatchType.ContainsAny){
- nodes.push(node);
- continue outer;
- }else{
- matches++;
- }
- }else{
- if(classMatchType == dojo.html.classMatchType.IsOnly){
- continue outer;
- }
- }
- }
-
- if(matches == classes.length){
- if( (classMatchType == dojo.html.classMatchType.IsOnly)&&
- (matches == nodeClasses.length)){
- nodes.push(node);
- }else if(classMatchType == dojo.html.classMatchType.ContainsAll){
- nodes.push(node);
- }
- }
- }
- return nodes; // NodeList
- }
-}
-dojo.html.getElementsByClassName = dojo.html.getElementsByClass;
-
-dojo.html.toCamelCase = function(/* string */selector){
- // summary
- // Translates a CSS selector string to a camel-cased one.
- var arr = selector.split('-'), cc = arr[0];
- for(var i = 1; i < arr.length; i++) {
- cc += arr[i].charAt(0).toUpperCase() + arr[i].substring(1);
- }
- return cc; // string
-}
-
-dojo.html.toSelectorCase = function(/* string */selector){
- // summary
- // Translates a camel cased string to a selector cased one.
- return selector.replace(/([A-Z])/g, "-$1" ).toLowerCase(); // string
-}
-
-if (dojo.render.html.ie) {
- // IE branch
- dojo.html.getComputedStyle = function(/*HTMLElement|String*/node, /*String*/property, /*String*/value) {
- // summary
- // Get the computed style value for style "property" on "node" (IE).
- node = dojo.byId(node); // FIXME: remove ability to access nodes by id for this time-critical function
- if(!node || !node.currentStyle){return value;}
- // FIXME: standardize on camel-case input to improve speed
- return node.currentStyle[dojo.html.toCamelCase(property)]; // String
- }
- // SJM: getComputedStyle should be abandoned and replaced with the below function.
- // All our supported browsers can return CSS2 compliant CssStyleDeclaration objects
- // which can be queried directly for multiple styles.
- dojo.html.getComputedStyles = function(/*HTMLElement*/node) {
- // summary
- // Get a style object containing computed styles for HTML Element node (IE).
- return node.currentStyle; // CSSStyleDeclaration
- }
-} else {
- // non-IE branch
- dojo.html.getComputedStyle = function(/*HTMLElement|String*/node, /*String*/property, /*Any*/value) {
- // summary
- // Get the computed style value for style "property" on "node" (non-IE).
- node = dojo.byId(node);
- if(!node || !node.style){return value;}
- var s = document.defaultView.getComputedStyle(node, null);
- // s may be null on Safari
- return (s&&s[dojo.html.toCamelCase(property)])||''; // String
- }
- // SJM: getComputedStyle should be abandoned and replaced with the below function.
- // All our supported browsers can return CSS2 compliant CssStyleDeclaration objects
- // which can be queried directly for multiple styles.
- dojo.html.getComputedStyles = function(node) {
- // summary
- // Get a style object containing computed styles for HTML Element node (non-IE).
- return document.defaultView.getComputedStyle(node, null); // CSSStyleDeclaration
- }
-}
-
-dojo.html.getStyleProperty = function(/* HTMLElement */node, /* string */cssSelector){
- // summary
- // Returns the value of the passed style
- node = dojo.byId(node);
- return (node && node.style ? node.style[dojo.html.toCamelCase(cssSelector)] : undefined); // string
-}
-
-dojo.html.getStyle = function(/* HTMLElement */node, /* string */cssSelector){
- // summary
- // Returns the computed value of the passed style
- var value = dojo.html.getStyleProperty(node, cssSelector);
- return (value ? value : dojo.html.getComputedStyle(node, cssSelector)); // string || integer
-}
-
-dojo.html.setStyle = function(/* HTMLElement */node, /* string */cssSelector, /* string */value){
- // summary
- // Set the value of passed style on node
- node = dojo.byId(node);
- if(node && node.style){
- var camelCased = dojo.html.toCamelCase(cssSelector);
- node.style[camelCased] = value;
- }
-}
-
-dojo.html.setStyleText = function (/* HTMLElement */target, /* string */text) {
- // summary
- // Try to set the entire cssText property of the passed target; equiv of setting style attribute.
- try {
- target.style.cssText = text;
- } catch (e) {
- target.setAttribute("style", text);
- }
-}
-
-dojo.html.copyStyle = function(/* HTMLElement */target, /* HTMLElement */source){
- // summary
- // work around for opera which doesn't have cssText, and for IE which fails on setAttribute
- if(!source.style.cssText){
- target.setAttribute("style", source.getAttribute("style"));
- }else{
- target.style.cssText = source.style.cssText;
- }
- dojo.html.addClass(target, dojo.html.getClass(source));
-}
-
-dojo.html.getUnitValue = function(/* HTMLElement */node, /* string */cssSelector, /* boolean? */autoIsZero){
- // summary
- // Get the value of passed selector, with the specific units used
- var s = dojo.html.getComputedStyle(node, cssSelector);
- if((!s)||((s == 'auto')&&(autoIsZero))){
- return { value: 0, units: 'px' }; // object
- }
- // FIXME: is regex inefficient vs. parseInt or some manual test?
- var match = s.match(/(\-?[\d.]+)([a-z%]*)/i);
- if (!match){return dojo.html.getUnitValue.bad;}
- return { value: Number(match[1]), units: match[2].toLowerCase() }; // object
-}
-dojo.html.getUnitValue.bad = { value: NaN, units: '' };
-
-if (dojo.render.html.ie) {
- // IE branch
- dojo.html.toPixelValue = function(/* HTMLElement */element, /* String */styleValue){
- // summary
- // Extract value in pixels from styleValue (IE version).
- // If a value cannot be extracted, zero is returned.
- if(!styleValue){return 0;}
- if(styleValue.slice(-2) == 'px'){return parseFloat(styleValue);}
- var pixelValue = 0;
- with(element){
- var sLeft = style.left;
- var rsLeft = runtimeStyle.left;
- runtimeStyle.left = currentStyle.left;
- try {
- style.left = styleValue || 0;
- pixelValue = style.pixelLeft;
- style.left = sLeft;
- runtimeStyle.left = rsLeft;
- }catch(e){
- // FIXME: it's possible for styleValue to be incompatible with
- // style.left. In particular, border width values of
- // "thick", "medium", or "thin" will provoke an exception.
- }
- }
- return pixelValue; // Number
- }
-} else {
- // non-IE branch
- dojo.html.toPixelValue = function(/* HTMLElement */element, /* String */styleValue){
- // summary
- // Extract value in pixels from styleValue (non-IE version).
- // If a value cannot be extracted, zero is returned.
- return (styleValue && (styleValue.slice(-2)=='px') ? parseFloat(styleValue) : 0); // Number
- }
-}
-
-dojo.html.getPixelValue = function(/* HTMLElement */node, /* string */styleProperty, /* boolean? */autoIsZero){
- // summary
- // Get a computed style value, in pixels.
- // node: HTMLElement
- // Node to interrogate
- // styleProperty: String
- // Style property to query, in either css-selector or camelCase (property) format.
- // autoIsZero: Boolean
- // Deprecated. Any value that cannot be converted to pixels is returned as zero.
- //
- // summary
- // Get the value of passed selector in pixels.
- //
- return dojo.html.toPixelValue(node, dojo.html.getComputedStyle(node, styleProperty));
-}
-
-dojo.html.setPositivePixelValue = function(/* HTMLElement */node, /* string */selector, /* integer */value){
- // summary
- // Attempt to set the value of selector on node as a positive pixel value.
- if(isNaN(value)){return false;}
- node.style[selector] = Math.max(0, value) + 'px';
- return true; // boolean
-}
-
-dojo.html.styleSheet = null;
-
-// FIXME: this is a really basic stub for adding and removing cssRules, but
-// it assumes that you know the index of the cssRule that you want to add
-// or remove, making it less than useful. So we need something that can
-// search for the selector that you you want to remove.
-dojo.html.insertCssRule = function(/* string */selector, /* string */declaration, /* integer? */index) {
- // summary
- // Attempt to insert declaration as selector on the internal stylesheet; if index try to set it there.
- if (!dojo.html.styleSheet) {
- if (document.createStyleSheet) { // IE
- dojo.html.styleSheet = document.createStyleSheet();
- } else if (document.styleSheets[0]) { // rest
- // FIXME: should create a new style sheet here
- // fall back on an exsiting style sheet
- dojo.html.styleSheet = document.styleSheets[0];
- } else {
- return null; // integer
- } // fail
- }
-
- if (arguments.length < 3) { // index may == 0
- if (dojo.html.styleSheet.cssRules) { // W3
- index = dojo.html.styleSheet.cssRules.length;
- } else if (dojo.html.styleSheet.rules) { // IE
- index = dojo.html.styleSheet.rules.length;
- } else {
- return null; // integer
- } // fail
- }
-
- if (dojo.html.styleSheet.insertRule) { // W3
- var rule = selector + " { " + declaration + " }";
- return dojo.html.styleSheet.insertRule(rule, index); // integer
- } else if (dojo.html.styleSheet.addRule) { // IE
- return dojo.html.styleSheet.addRule(selector, declaration, index); // integer
- } else {
- return null; // integer
- } // fail
-}
-
-dojo.html.removeCssRule = function(/* integer? */index){
- // summary
- // Attempt to remove the rule at index.
- if(!dojo.html.styleSheet){
- dojo.debug("no stylesheet defined for removing rules");
- return false;
- }
- if(dojo.render.html.ie){
- if(!index){
- index = dojo.html.styleSheet.rules.length;
- dojo.html.styleSheet.removeRule(index);
- }
- }else if(document.styleSheets[0]){
- if(!index){
- index = dojo.html.styleSheet.cssRules.length;
- }
- dojo.html.styleSheet.deleteRule(index);
- }
- return true; // boolean
-}
-
-dojo.html._insertedCssFiles = []; // cache container needed because IE reformats cssText when added to DOM
-dojo.html.insertCssFile = function(/* string */URI, /* HTMLDocument? */doc, /* boolean? */checkDuplicates, /* boolean */fail_ok){
- // summary
- // calls css by XmlHTTP and inserts it into DOM as
- if(!URI){ return; }
- if(!doc){ doc = document; }
- var cssStr = dojo.hostenv.getText(URI, false, fail_ok);
- if(cssStr===null){ return; }
- cssStr = dojo.html.fixPathsInCssText(cssStr, URI);
-
- if(checkDuplicates){
- var idx = -1, node, ent = dojo.html._insertedCssFiles;
- for(var i = 0; i < ent.length; i++){
- if((ent[i].doc == doc) && (ent[i].cssText == cssStr)){
- idx = i; node = ent[i].nodeRef;
- break;
- }
- }
- // make sure we havent deleted our node
- if(node){
- var styles = doc.getElementsByTagName("style");
- for(var i = 0; i < styles.length; i++){
- if(styles[i] == node){
- return;
- }
- }
- // delete this entry
- dojo.html._insertedCssFiles.shift(idx, 1);
- }
- }
-
- var style = dojo.html.insertCssText(cssStr, doc);
- dojo.html._insertedCssFiles.push({'doc': doc, 'cssText': cssStr, 'nodeRef': style});
-
- // insert custom attribute ex dbgHref="../foo.css" usefull when debugging in DOM inspectors, no?
- if(style && djConfig.isDebug){
- style.setAttribute("dbgHref", URI);
- }
- return style; // HTMLStyleElement
-}
-
-dojo.html.insertCssText = function(/* string */cssStr, /* HTMLDocument? */doc, /* string? */URI){
- // summary
- // Attempt to insert CSS rules into the document through inserting a style element
- // DomNode Style = insertCssText(String ".dojoMenu {color: green;}"[, DomDoc document, dojo.uri.Uri Url ])
- if(!cssStr){
- return; // HTMLStyleElement
- }
- if(!doc){ doc = document; }
- if(URI){// fix paths in cssStr
- cssStr = dojo.html.fixPathsInCssText(cssStr, URI);
- }
- var style = doc.createElement("style");
- style.setAttribute("type", "text/css");
- // IE is b0rken enough to require that we add the element to the doc
- // before changing it's properties
- var head = doc.getElementsByTagName("head")[0];
- if(!head){ // must have a head tag
- dojo.debug("No head tag in document, aborting styles");
- return; // HTMLStyleElement
- }else{
- head.appendChild(style);
- }
- if(style.styleSheet){// IE
- var setFunc = function(){
- try{
- style.styleSheet.cssText = cssStr;
- }catch(e){ dojo.debug(e); }
- };
- if(style.styleSheet.disabled){
- setTimeout(setFunc, 10);
- }else{
- setFunc();
- }
- }else{ // w3c
- var cssText = doc.createTextNode(cssStr);
- style.appendChild(cssText);
- }
- return style; // HTMLStyleElement
-}
-
-dojo.html.fixPathsInCssText = function(/* string */cssStr, /* string */URI){
- // summary
- // usage: cssText comes from dojoroot/src/widget/templates/Foobar.css
- // it has .dojoFoo { background-image: url(images/bar.png);} then uri should point to dojoroot/src/widget/templates/
- if(!cssStr || !URI){ return; }
- var match, str = "", url = "", urlChrs = "[\\t\\s\\w\\(\\)\\/\\.\\\\'\"-:#=&?~]+";
- var regex = new RegExp('url\\(\\s*('+urlChrs+')\\s*\\)');
- var regexProtocol = /(file|https?|ftps?):\/\//;
- regexTrim = new RegExp("^[\\s]*(['\"]?)("+urlChrs+")\\1[\\s]*?$");
- if(dojo.render.html.ie55 || dojo.render.html.ie60){
- var regexIe = new RegExp("AlphaImageLoader\\((.*)src\=['\"]("+urlChrs+")['\"]");
- // TODO: need to decide how to handle relative paths and AlphaImageLoader see #1441
- // current implementation breaks on build with intern_strings
- while(match = regexIe.exec(cssStr)){
- url = match[2].replace(regexTrim, "$2");
- if(!regexProtocol.exec(url)){
- url = (new dojo.uri.Uri(URI, url).toString());
- }
- str += cssStr.substring(0, match.index) + "AlphaImageLoader(" + match[1] + "src='" + url + "'";
- cssStr = cssStr.substr(match.index + match[0].length);
- }
- cssStr = str + cssStr;
- str = "";
- }
-
- while(match = regex.exec(cssStr)){
- url = match[1].replace(regexTrim, "$2");
- if(!regexProtocol.exec(url)){
- url = (new dojo.uri.Uri(URI, url).toString());
- }
- str += cssStr.substring(0, match.index) + "url(" + url + ")";
- cssStr = cssStr.substr(match.index + match[0].length);
- }
- return str + cssStr; // string
-}
-
-dojo.html.setActiveStyleSheet = function(/* string */title){
- // summary
- // Activate style sheet with specified title.
- var i = 0, a, els = dojo.doc().getElementsByTagName("link");
- while (a = els[i++]) {
- if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")){
- a.disabled = true;
- if (a.getAttribute("title") == title) { a.disabled = false; }
- }
- }
-}
-
-dojo.html.getActiveStyleSheet = function(){
- // summary
- // return the title of the currently active stylesheet
- var i = 0, a, els = dojo.doc().getElementsByTagName("link");
- while (a = els[i++]) {
- if (a.getAttribute("rel").indexOf("style") != -1
- && a.getAttribute("title")
- && !a.disabled
- ){
- return a.getAttribute("title"); // string
- }
- }
- return null; // string
-}
-
-dojo.html.getPreferredStyleSheet = function(){
- // summary
- // Return the preferred stylesheet title (i.e. link without alt attribute)
- var i = 0, a, els = dojo.doc().getElementsByTagName("link");
- while (a = els[i++]) {
- if(a.getAttribute("rel").indexOf("style") != -1
- && a.getAttribute("rel").indexOf("alt") == -1
- && a.getAttribute("title")
- ){
- return a.getAttribute("title"); // string
- }
- }
- return null; // string
-}
-
-dojo.html.applyBrowserClass = function(/* HTMLElement */node){
- // summary
- // Applies pre-set class names based on browser & version to the passed node.
- // Modified version of Morris' CSS hack.
- var drh=dojo.render.html;
- var classes = {
- dj_ie: drh.ie,
- dj_ie55: drh.ie55,
- dj_ie6: drh.ie60,
- dj_ie7: drh.ie70,
- dj_iequirks: drh.ie && drh.quirks,
- dj_opera: drh.opera,
- dj_opera8: drh.opera && (Math.floor(dojo.render.version)==8),
- dj_opera9: drh.opera && (Math.floor(dojo.render.version)==9),
- dj_khtml: drh.khtml,
- dj_safari: drh.safari,
- dj_gecko: drh.mozilla
- }; // no dojo unsupported browsers
- for(var p in classes){
- if(classes[p]){
- dojo.html.addClass(node, p);
- }
- }
-};
-
-dojo.provide("dojo.html.display");
-
-
-dojo.html._toggle = function(node, tester, setter){
- node = dojo.byId(node);
- setter(node, !tester(node));
- return tester(node);
-}
-
-dojo.html.show = function(/* HTMLElement */node){
- // summary
- // Show the passed element by reverting display property set by dojo.html.hide
- node = dojo.byId(node);
- if(dojo.html.getStyleProperty(node, 'display')=='none'){
- dojo.html.setStyle(node, 'display', (node.dojoDisplayCache||''));
- node.dojoDisplayCache = undefined; // cannot use delete on a node in IE6
- }
-}
-
-dojo.html.hide = function(/* HTMLElement */node){
- // summary
- // Hide the passed element by setting display:none
- node = dojo.byId(node);
- if(typeof node["dojoDisplayCache"] == "undefined"){ // it could == '', so we cannot say !node.dojoDisplayCount
- var d = dojo.html.getStyleProperty(node, 'display')
- if(d!='none'){
- node.dojoDisplayCache = d;
- }
- }
- dojo.html.setStyle(node, 'display', 'none');
-}
-
-dojo.html.setShowing = function(/* HTMLElement */node, /* boolean? */showing){
- // summary
- // Calls show() if showing is true, hide() otherwise
- dojo.html[(showing ? 'show' : 'hide')](node);
-}
-
-dojo.html.isShowing = function(/* HTMLElement */node){
- // summary
- // Returns whether the element is displayed or not.
- // FIXME: returns true if node is bad, isHidden would be easier to make correct
- return (dojo.html.getStyleProperty(node, 'display') != 'none'); // boolean
-}
-
-dojo.html.toggleShowing = function(/* HTMLElement */node){
- // summary
- // Call setShowing() on node with the complement of isShowing(), then return the new value of isShowing()
- return dojo.html._toggle(node, dojo.html.isShowing, dojo.html.setShowing); // boolean
-}
-
-// Simple mapping of tag names to display values
-// FIXME: simplistic
-dojo.html.displayMap = { tr: '', td: '', th: '', img: 'inline', span: 'inline', input: 'inline', button: 'inline' };
-
-dojo.html.suggestDisplayByTagName = function(/* HTMLElement */node){
- // summary
- // Suggest a value for the display property that will show 'node' based on it's tag
- node = dojo.byId(node);
- if(node && node.tagName){
- var tag = node.tagName.toLowerCase();
- return (tag in dojo.html.displayMap ? dojo.html.displayMap[tag] : 'block'); // string
- }
-}
-
-dojo.html.setDisplay = function(/* HTMLElement */node, /* string */display){
- // summary
- // Sets the value of style.display to value of 'display' parameter if it is a string.
- // Otherwise, if 'display' is false, set style.display to 'none'.
- // Finally, set 'display' to a suggested display value based on the node's tag
- dojo.html.setStyle(node, 'display', ((display instanceof String || typeof display == "string") ? display : (display ? dojo.html.suggestDisplayByTagName(node) : 'none')));
-}
-
-dojo.html.isDisplayed = function(/* HTMLElement */node){
- // summary
- // Is true if the the computed display style for node is not 'none'
- // FIXME: returns true if node is bad, isNotDisplayed would be easier to make correct
- return (dojo.html.getComputedStyle(node, 'display') != 'none'); // boolean
-}
-
-dojo.html.toggleDisplay = function(/* HTMLElement */node){
- // summary
- // Call setDisplay() on node with the complement of isDisplayed(), then
- // return the new value of isDisplayed()
- return dojo.html._toggle(node, dojo.html.isDisplayed, dojo.html.setDisplay); // boolean
-}
-
-dojo.html.setVisibility = function(/* HTMLElement */node, /* string */visibility){
- // summary
- // Sets the value of style.visibility to value of 'visibility' parameter if it is a string.
- // Otherwise, if 'visibility' is false, set style.visibility to 'hidden'. Finally, set style.visibility to 'visible'.
- dojo.html.setStyle(node, 'visibility', ((visibility instanceof String || typeof visibility == "string") ? visibility : (visibility ? 'visible' : 'hidden')));
-}
-
-dojo.html.isVisible = function(/* HTMLElement */node){
- // summary
- // Returns true if the the computed visibility style for node is not 'hidden'
- // FIXME: returns true if node is bad, isInvisible would be easier to make correct
- return (dojo.html.getComputedStyle(node, 'visibility') != 'hidden'); // boolean
-}
-
-dojo.html.toggleVisibility = function(node){
- // summary
- // Call setVisibility() on node with the complement of isVisible(), then return the new value of isVisible()
- return dojo.html._toggle(node, dojo.html.isVisible, dojo.html.setVisibility); // boolean
-}
-
-dojo.html.setOpacity = function(/* HTMLElement */node, /* float */opacity, /* boolean? */dontFixOpacity){
- // summary
- // Sets the opacity of node in a cross-browser way.
- // float between 0.0 (transparent) and 1.0 (opaque)
- node = dojo.byId(node);
- var h = dojo.render.html;
- if(!dontFixOpacity){
- if( opacity >= 1.0){
- if(h.ie){
- dojo.html.clearOpacity(node);
- return;
- }else{
- opacity = 0.999999;
- }
- }else if( opacity < 0.0){ opacity = 0; }
- }
- if(h.ie){
- if(node.nodeName.toLowerCase() == "tr"){
- // FIXME: is this too naive? will we get more than we want?
- var tds = node.getElementsByTagName("td");
- for(var x=0; x= 0.999999 ? 1.0 : Number(opac); // float
-}
-
-
-dojo.provide("dojo.html.color");
-
-
-
-
-dojo.html.getBackgroundColor = function(/* HTMLElement */node){
- // summary
- // returns the background color of the passed node as a 32-bit color (RGBA)
- node = dojo.byId(node);
- var color;
- do{
- color = dojo.html.getStyle(node, "background-color");
- // Safari doesn't say "transparent"
- if(color.toLowerCase() == "rgba(0, 0, 0, 0)") { color = "transparent"; }
- if(node == document.getElementsByTagName("body")[0]) { node = null; break; }
- node = node.parentNode;
- }while(node && dojo.lang.inArray(["transparent", ""], color));
- if(color == "transparent"){
- color = [255, 255, 255, 0];
- }else{
- color = dojo.gfx.color.extractRGB(color);
- }
- return color; // array
-}
-
-dojo.provide("dojo.html.layout");
-
-
-
-
-
-dojo.html.sumAncestorProperties = function(/* HTMLElement */node, /* string */prop){
- // summary
- // Returns the sum of the passed property on all ancestors of node.
- node = dojo.byId(node);
- if(!node){ return 0; } // FIXME: throw an error?
-
- var retVal = 0;
- while(node){
- if(dojo.html.getComputedStyle(node, 'position') == 'fixed'){
- return 0;
- }
- var val = node[prop];
- if(val){
- retVal += val - 0;
- if(node==dojo.body()){ break; }// opera and khtml #body & #html has the same values, we only need one value
- }
- node = node.parentNode;
- }
- return retVal; // integer
-}
-
-dojo.html.setStyleAttributes = function(/* HTMLElement */node, /* string */attributes) {
- // summary
- // allows a dev to pass a string similar to what you'd pass in style="", and apply it to a node.
- node = dojo.byId(node);
- var splittedAttribs=attributes.replace(/(;)?\s*$/, "").split(";");
- for(var i=0; i0){
- ret.x += isNaN(n) ? 0 : n;
- }
- var m = curnode["offsetTop"];
- ret.y += isNaN(m) ? 0 : m;
- curnode = curnode.offsetParent;
- }while((curnode != endNode)&&(curnode != null));
- }else if(node["x"]&&node["y"]){
- ret.x += isNaN(node.x) ? 0 : node.x;
- ret.y += isNaN(node.y) ? 0 : node.y;
- }
- }
-
- // account for document scrolling!
- if(includeScroll){
- var scroll = dojo.html.getScroll();
- ret.y += scroll.top;
- ret.x += scroll.left;
- }
-
- var extentFuncArray=[dojo.html.getPaddingExtent, dojo.html.getBorderExtent, dojo.html.getMarginExtent];
- if(nativeBoxType > targetBoxType){
- for(var i=targetBoxType;inativeBoxType;--i){
- ret.y -= extentFuncArray[i-1](node, 'top');
- ret.x -= extentFuncArray[i-1](node, 'left');
- }
- }
- ret.top = ret.y;
- ret.left = ret.x;
- return ret; // object
-}
-
-dojo.html.isPositionAbsolute = function(/* HTMLElement */node){
- // summary
- // Returns true if the element is absolutely positioned.
- return (dojo.html.getComputedStyle(node, 'position') == 'absolute'); // boolean
-}
-
-dojo.html._sumPixelValues = function(/* HTMLElement */node, selectors, autoIsZero){
- var total = 0;
- for(var x=0; x 4 ) { coords.pop(); }
- var ret = {
- left: coords[0],
- top: coords[1],
- width: coords[2],
- height: coords[3]
- };
- }else if(!coords.nodeType && !(coords instanceof String || typeof coords == "string") &&
- ('width' in coords || 'height' in coords || 'left' in coords ||
- 'x' in coords || 'top' in coords || 'y' in coords)){
- // coords is a coordinate object or at least part of one
- var ret = {
- left: coords.left||coords.x||0,
- top: coords.top||coords.y||0,
- width: coords.width||0,
- height: coords.height||0
- };
- }else{
- // coords is an dom object (or dom object id); return it's coordinates
- var node = dojo.byId(coords);
- var pos = dojo.html.abs(node, includeScroll, boxtype);
- var marginbox = dojo.html.getMarginBox(node);
- var ret = {
- left: pos.left,
- top: pos.top,
- width: marginbox.width,
- height: marginbox.height
- };
- }
- ret.x = ret.left;
- ret.y = ret.top;
- return ret; // object
-}
-
-dojo.html.setMarginBoxWidth = dojo.html.setOuterWidth = function(node, width){
- return dojo.html._callDeprecated("setMarginBoxWidth", "setMarginBox", arguments, "width");
-}
-dojo.html.setMarginBoxHeight = dojo.html.setOuterHeight = function(){
- return dojo.html._callDeprecated("setMarginBoxHeight", "setMarginBox", arguments, "height");
-}
-dojo.html.getMarginBoxWidth = dojo.html.getOuterWidth = function(){
- return dojo.html._callDeprecated("getMarginBoxWidth", "getMarginBox", arguments, null, "width");
-}
-dojo.html.getMarginBoxHeight = dojo.html.getOuterHeight = function(){
- return dojo.html._callDeprecated("getMarginBoxHeight", "getMarginBox", arguments, null, "height");
-}
-dojo.html.getTotalOffset = function(node, type, includeScroll){
- return dojo.html._callDeprecated("getTotalOffset", "getAbsolutePosition", arguments, null, type);
-}
-dojo.html.getAbsoluteX = function(node, includeScroll){
- return dojo.html._callDeprecated("getAbsoluteX", "getAbsolutePosition", arguments, null, "x");
-}
-dojo.html.getAbsoluteY = function(node, includeScroll){
- return dojo.html._callDeprecated("getAbsoluteY", "getAbsolutePosition", arguments, null, "y");
-}
-dojo.html.totalOffsetLeft = function(node, includeScroll){
- return dojo.html._callDeprecated("totalOffsetLeft", "getAbsolutePosition", arguments, null, "left");
-}
-dojo.html.totalOffsetTop = function(node, includeScroll){
- return dojo.html._callDeprecated("totalOffsetTop", "getAbsolutePosition", arguments, null, "top");
-}
-dojo.html.getMarginWidth = function(node){
- return dojo.html._callDeprecated("getMarginWidth", "getMargin", arguments, null, "width");
-}
-dojo.html.getMarginHeight = function(node){
- return dojo.html._callDeprecated("getMarginHeight", "getMargin", arguments, null, "height");
-}
-dojo.html.getBorderWidth = function(node){
- return dojo.html._callDeprecated("getBorderWidth", "getBorder", arguments, null, "width");
-}
-dojo.html.getBorderHeight = function(node){
- return dojo.html._callDeprecated("getBorderHeight", "getBorder", arguments, null, "height");
-}
-dojo.html.getPaddingWidth = function(node){
- return dojo.html._callDeprecated("getPaddingWidth", "getPadding", arguments, null, "width");
-}
-dojo.html.getPaddingHeight = function(node){
- return dojo.html._callDeprecated("getPaddingHeight", "getPadding", arguments, null, "height");
-}
-dojo.html.getPadBorderWidth = function(node){
- return dojo.html._callDeprecated("getPadBorderWidth", "getPadBorder", arguments, null, "width");
-}
-dojo.html.getPadBorderHeight = function(node){
- return dojo.html._callDeprecated("getPadBorderHeight", "getPadBorder", arguments, null, "height");
-}
-dojo.html.getBorderBoxWidth = dojo.html.getInnerWidth = function(){
- return dojo.html._callDeprecated("getBorderBoxWidth", "getBorderBox", arguments, null, "width");
-}
-dojo.html.getBorderBoxHeight = dojo.html.getInnerHeight = function(){
- return dojo.html._callDeprecated("getBorderBoxHeight", "getBorderBox", arguments, null, "height");
-}
-dojo.html.getContentBoxWidth = dojo.html.getContentWidth = function(){
- return dojo.html._callDeprecated("getContentBoxWidth", "getContentBox", arguments, null, "width");
-}
-dojo.html.getContentBoxHeight = dojo.html.getContentHeight = function(){
- return dojo.html._callDeprecated("getContentBoxHeight", "getContentBox", arguments, null, "height");
-}
-dojo.html.setContentBoxWidth = dojo.html.setContentWidth = function(node, width){
- return dojo.html._callDeprecated("setContentBoxWidth", "setContentBox", arguments, "width");
-}
-dojo.html.setContentBoxHeight = dojo.html.setContentHeight = function(node, height){
- return dojo.html._callDeprecated("setContentBoxHeight", "setContentBox", arguments, "height");
-}
-
-dojo.provide("dojo.lfx.html");
-
-
-
-
-
-
-
-
-dojo.lfx.html._byId = function(nodes){
- if(!nodes){ return []; }
- if(dojo.lang.isArrayLike(nodes)){
- if(!nodes.alreadyChecked){
- var n = [];
- dojo.lang.forEach(nodes, function(node){
- n.push(dojo.byId(node));
- });
- n.alreadyChecked = true;
- return n;
- }else{
- return nodes;
- }
- }else{
- var n = [];
- n.push(dojo.byId(nodes));
- n.alreadyChecked = true;
- return n;
- }
-}
-
-dojo.lfx.html.propertyAnimation = function( /*DOMNode[]*/ nodes,
- /*Object[]*/ propertyMap,
- /*int*/ duration,
- /*function*/ easing,
- /*Object*/ handlers){
- // summary: Returns an animation that will transition the properties of "nodes"
- // depending how they are defined in "propertyMap".
- // nodes: An array of DOMNodes or one DOMNode.
- // propertyMap: { property: String, start: Decimal?, end: Decimal?, units: String? }
- // An array of objects defining properties to change.
- // duration: Duration of the animation in milliseconds.
- // easing: An easing function.
- // handlers: { handler: Function?, onstart: Function?, onstop: Function?, onanimate: Function? }
- nodes = dojo.lfx.html._byId(nodes);
-
- var targs = {
- "propertyMap": propertyMap,
- "nodes": nodes,
- "duration": duration,
- "easing": easing||dojo.lfx.easeDefault
- };
-
- var setEmUp = function(args){
- if(args.nodes.length==1){
- // FIXME: we're only supporting start-value filling when one node is
- // passed
-
- var pm = args.propertyMap;
- if(!dojo.lang.isArray(args.propertyMap)){
- // it's stupid to have to pack an array with a set of objects
- // when you can just pass in an object list
- var parr = [];
- for(var pname in pm){
- pm[pname].property = pname;
- parr.push(pm[pname]);
- }
- pm = args.propertyMap = parr;
- }
- dojo.lang.forEach(pm, function(prop){
- if(dj_undef("start", prop)){
- if(prop.property != "opacity"){
- prop.start = parseInt(dojo.html.getComputedStyle(args.nodes[0], prop.property));
- }else{
- prop.start = dojo.html.getOpacity(args.nodes[0]);
- }
- }
- });
- }
- }
-
- var coordsAsInts = function(coords){
- var cints = [];
- dojo.lang.forEach(coords, function(c){
- cints.push(Math.round(c));
- });
- return cints;
- }
-
- var setStyle = function(n, style){
- n = dojo.byId(n);
- if(!n || !n.style){ return; }
- for(var s in style){
- try{
- if(s == "opacity"){
- dojo.html.setOpacity(n, style[s]);
- }else{
- n.style[s] = style[s];
- }
- }catch(e){ dojo.debug(e); }
- }
- }
-
- var propLine = function(properties){
- this._properties = properties;
- this.diffs = new Array(properties.length);
- dojo.lang.forEach(properties, function(prop, i){
- // calculate the end - start to optimize a bit
- if(dojo.lang.isFunction(prop.start)){
- prop.start = prop.start(prop, i);
- }
- if(dojo.lang.isFunction(prop.end)){
- prop.end = prop.end(prop, i);
- }
- if(dojo.lang.isArray(prop.start)){
- // don't loop through the arrays
- this.diffs[i] = null;
- }else if(prop.start instanceof dojo.gfx.color.Color){
- // save these so we don't have to call toRgb() every getValue() call
- prop.startRgb = prop.start.toRgb();
- prop.endRgb = prop.end.toRgb();
- }else{
- this.diffs[i] = prop.end - prop.start;
- }
- }, this);
-
- this.getValue = function(n){
- var ret = {};
- dojo.lang.forEach(this._properties, function(prop, i){
- var value = null;
- if(dojo.lang.isArray(prop.start)){
- // FIXME: what to do here?
- }else if(prop.start instanceof dojo.gfx.color.Color){
- value = (prop.units||"rgb") + "(";
- for(var j = 0 ; j < prop.startRgb.length ; j++){
- value += Math.round(((prop.endRgb[j] - prop.startRgb[j]) * n) + prop.startRgb[j]) + (j < prop.startRgb.length - 1 ? "," : "");
- }
- value += ")";
- }else{
- value = ((this.diffs[i]) * n) + prop.start + (prop.property != "opacity" ? prop.units||"px" : "");
- }
- ret[dojo.html.toCamelCase(prop.property)] = value;
- }, this);
- return ret;
- }
- }
-
- var anim = new dojo.lfx.Animation({
- beforeBegin: function(){
- setEmUp(targs);
- anim.curve = new propLine(targs.propertyMap);
- },
- onAnimate: function(propValues){
- dojo.lang.forEach(targs.nodes, function(node){
- setStyle(node, propValues);
- });
- }
- },
- targs.duration,
- null,
- targs.easing
- );
- if(handlers){
- for(var x in handlers){
- if(dojo.lang.isFunction(handlers[x])){
- anim.connect(x, anim, handlers[x]);
- }
- }
- }
-
- return anim; // dojo.lfx.Animation
-}
-
-dojo.lfx.html._makeFadeable = function(nodes){
- var makeFade = function(node){
- if(dojo.render.html.ie){
- // only set the zoom if the "tickle" value would be the same as the
- // default
- if( (node.style.zoom.length == 0) &&
- (dojo.html.getStyle(node, "zoom") == "normal") ){
- // make sure the node "hasLayout"
- // NOTE: this has been tested with larger and smaller user-set text
- // sizes and works fine
- node.style.zoom = "1";
- // node.style.zoom = "normal";
- }
- // don't set the width to auto if it didn't already cascade that way.
- // We don't want to f anyones designs
- if( (node.style.width.length == 0) &&
- (dojo.html.getStyle(node, "width") == "auto") ){
- node.style.width = "auto";
- }
- }
- }
- if(dojo.lang.isArrayLike(nodes)){
- dojo.lang.forEach(nodes, makeFade);
- }else{
- makeFade(nodes);
- }
-}
-
-dojo.lfx.html.fade = function(/*DOMNode[]*/ nodes,
- /*Object*/values,
- /*int?*/ duration,
- /*Function?*/ easing,
- /*Function?*/ callback){
- // summary:Returns an animation that will fade the "nodes" from the start to end values passed.
- // nodes: An array of DOMNodes or one DOMNode.
- // values: { start: Decimal?, end: Decimal? }
- // duration: Duration of the animation in milliseconds.
- // easing: An easing function.
- // callback: Function to run at the end of the animation.
- nodes = dojo.lfx.html._byId(nodes);
- var props = { property: "opacity" };
- if(!dj_undef("start", values)){
- props.start = values.start;
- }else{
- props.start = function(){ return dojo.html.getOpacity(nodes[0]); };
- }
-
- if(!dj_undef("end", values)){
- props.end = values.end;
- }else{
- dojo.raise("dojo.lfx.html.fade needs an end value");
- }
-
- var anim = dojo.lfx.propertyAnimation(nodes, [ props ], duration, easing);
- anim.connect("beforeBegin", function(){
- dojo.lfx.html._makeFadeable(nodes);
- });
- if(callback){
- anim.connect("onEnd", function(){ callback(nodes, anim); });
- }
-
- return anim; // dojo.lfx.Animation
-}
-
-dojo.lfx.html.fadeIn = function(/*DOMNode[]*/ nodes, /*int?*/ duration, /*Function?*/ easing, /*Function?*/ callback){
- // summary: Returns an animation that will fade "nodes" from its current opacity to fully opaque.
- // nodes: An array of DOMNodes or one DOMNode.
- // duration: Duration of the animation in milliseconds.
- // easing: An easing function.
- // callback: Function to run at the end of the animation.
- return dojo.lfx.html.fade(nodes, { end: 1 }, duration, easing, callback); // dojo.lfx.Animation
-}
-
-dojo.lfx.html.fadeOut = function(/*DOMNode[]*/ nodes, /*int?*/ duration, /*Function?*/ easing, /*Function?*/ callback){
- // summary: Returns an animation that will fade "nodes" from its current opacity to fully transparent.
- // nodes: An array of DOMNodes or one DOMNode.
- // duration: Duration of the animation in milliseconds.
- // easing: An easing function.
- // callback: Function to run at the end of the animation.
- return dojo.lfx.html.fade(nodes, { end: 0 }, duration, easing, callback); // dojo.lfx.Animation
-}
-
-dojo.lfx.html.fadeShow = function(/*DOMNode[]*/ nodes, /*int?*/ duration, /*Function?*/ easing, /*Function?*/ callback){
- // summary: Returns an animation that will fade "nodes" from transparent to opaque and shows
- // "nodes" at the end if it is hidden.
- // nodes: An array of DOMNodes or one DOMNode.
- // duration: Duration of the animation in milliseconds.
- // easing: An easing function.
- // callback: Function to run at the end of the animation.
- nodes=dojo.lfx.html._byId(nodes);
- dojo.lang.forEach(nodes, function(node){
- dojo.html.setOpacity(node, 0.0);
- });
-
- var anim = dojo.lfx.html.fadeIn(nodes, duration, easing, callback);
- anim.connect("beforeBegin", function(){
- if(dojo.lang.isArrayLike(nodes)){
- dojo.lang.forEach(nodes, dojo.html.show);
- }else{
- dojo.html.show(nodes);
- }
- });
-
- return anim; // dojo.lfx.Animation
-}
-
-dojo.lfx.html.fadeHide = function(/*DOMNode[]*/ nodes, /*int?*/ duration, /*Function?*/ easing, /*Function?*/ callback){
- // summary: Returns an animation that will fade "nodes" from its current opacity to opaque and hides
- // "nodes" at the end.
- // nodes: An array of DOMNodes or one DOMNode.
- // duration: Duration of the animation in milliseconds.
- // easing: An easing function.
- // callback: Function to run at the end of the animation.
- var anim = dojo.lfx.html.fadeOut(nodes, duration, easing, function(){
- if(dojo.lang.isArrayLike(nodes)){
- dojo.lang.forEach(nodes, dojo.html.hide);
- }else{
- dojo.html.hide(nodes);
- }
- if(callback){ callback(nodes, anim); }
- });
-
- return anim; // dojo.lfx.Animation
-}
-
-dojo.lfx.html.wipeIn = function(/*DOMNode[]*/ nodes, /*int?*/ duration, /*Function?*/ easing, /*Function?*/ callback){
- // summary: Returns an animation that will show and wipe in "nodes".
- // nodes: An array of DOMNodes or one DOMNode.
- // duration: Duration of the animation in milliseconds.
- // easing: An easing function.
- // callback: Function to run at the end of the animation.
- nodes = dojo.lfx.html._byId(nodes);
- var anims = [];
-
- dojo.lang.forEach(nodes, function(node){
- var oprop = { }; // old properties of node (before we mucked w/them)
-
- // get node height, either it's natural height or it's height specified via style or class attributes
- // (for FF, the node has to be (temporarily) rendered to measure height)
- // TODO: should this offscreen code be part of dojo.html, so that getBorderBox() works on hidden nodes?
- var origTop, origLeft, origPosition;
- with(node.style){
- origTop=top; origLeft=left; origPosition=position;
- top="-9999px"; left="-9999px"; position="absolute";
- display="";
- }
- var nodeHeight = dojo.html.getBorderBox(node).height;
- with(node.style){
- top=origTop; left=origLeft; position=origPosition;
- display="none";
- }
-
- var anim = dojo.lfx.propertyAnimation(node,
- { "height": {
- start: 1, // 0 causes IE to display the whole panel
- end: function(){ return nodeHeight; }
- }
- },
- duration,
- easing);
-
- anim.connect("beforeBegin", function(){
- oprop.overflow = node.style.overflow;
- oprop.height = node.style.height;
- with(node.style){
- overflow = "hidden";
- height = "1px"; // 0 causes IE to display the whole panel
- }
- dojo.html.show(node);
- });
-
- anim.connect("onEnd", function(){
- with(node.style){
- overflow = oprop.overflow;
- height = oprop.height;
- }
- if(callback){ callback(node, anim); }
- });
- anims.push(anim);
- });
-
- return dojo.lfx.combine(anims); // dojo.lfx.Combine
-}
-
-dojo.lfx.html.wipeOut = function(/*DOMNode[]*/ nodes, /*int?*/ duration, /*Function?*/ easing, /*Function?*/ callback){
- // summary: Returns an animation that will wipe out and hide "nodes".
- // nodes: An array of DOMNodes or one DOMNode.
- // duration: Duration of the animation in milliseconds.
- // easing: An easing function.
- // callback: Function to run at the end of the animation.
- nodes = dojo.lfx.html._byId(nodes);
- var anims = [];
-
- dojo.lang.forEach(nodes, function(node){
- var oprop = { }; // old properties of node (before we mucked w/them)
- var anim = dojo.lfx.propertyAnimation(node,
- { "height": {
- start: function(){ return dojo.html.getContentBox(node).height; },
- end: 1 // 0 causes IE to display the whole panel
- }
- },
- duration,
- easing,
- {
- "beforeBegin": function(){
- oprop.overflow = node.style.overflow;
- oprop.height = node.style.height;
- with(node.style){
- overflow = "hidden";
- }
- dojo.html.show(node);
- },
-
- "onEnd": function(){
- dojo.html.hide(node);
- with(node.style){
- overflow = oprop.overflow;
- height = oprop.height;
- }
- if(callback){ callback(node, anim); }
- }
- }
- );
- anims.push(anim);
- });
-
- return dojo.lfx.combine(anims); // dojo.lfx.Combine
-}
-
-dojo.lfx.html.slideTo = function(/*DOMNode*/ nodes,
- /*Object*/ coords,
- /*int?*/ duration,
- /*Function?*/ easing,
- /*Function?*/ callback){
- // summary: Returns an animation that will slide "nodes" from its current position to
- // the position defined in "coords".
- // nodes: An array of DOMNodes or one DOMNode.
- // coords: { top: Decimal?, left: Decimal? }
- // duration: Duration of the animation in milliseconds.
- // easing: An easing function.
- // callback: Function to run at the end of the animation.
- nodes = dojo.lfx.html._byId(nodes);
- var anims = [];
- var compute = dojo.html.getComputedStyle;
-
- if(dojo.lang.isArray(coords)){
- /* coords: Array
- pId: a */
- dojo.deprecated('dojo.lfx.html.slideTo(node, array)', 'use dojo.lfx.html.slideTo(node, {top: value, left: value});', '0.5');
- coords = { top: coords[0], left: coords[1] };
- }
- dojo.lang.forEach(nodes, function(node){
- var top = null;
- var left = null;
-
- var init = (function(){
- var innerNode = node;
- return function(){
- var pos = compute(innerNode, 'position');
- top = (pos == 'absolute' ? node.offsetTop : parseInt(compute(node, 'top')) || 0);
- left = (pos == 'absolute' ? node.offsetLeft : parseInt(compute(node, 'left')) || 0);
-
- if (!dojo.lang.inArray(['absolute', 'relative'], pos)) {
- var ret = dojo.html.abs(innerNode, true);
- dojo.html.setStyleAttributes(innerNode, "position:absolute;top:"+ret.y+"px;left:"+ret.x+"px;");
- top = ret.y;
- left = ret.x;
- }
- }
- })();
- init();
-
- var anim = dojo.lfx.propertyAnimation(node,
- { "top": { start: top, end: (coords.top||0) },
- "left": { start: left, end: (coords.left||0) }
- },
- duration,
- easing,
- { "beforeBegin": init }
- );
-
- if(callback){
- anim.connect("onEnd", function(){ callback(nodes, anim); });
- }
-
- anims.push(anim);
- });
-
- return dojo.lfx.combine(anims); // dojo.lfx.Combine
-}
-
-dojo.lfx.html.slideBy = function(/*DOMNode*/ nodes, /*Object*/ coords, /*int?*/ duration, /*Function?*/ easing, /*Function?*/ callback){
- // summary: Returns an animation that will slide "nodes" from its current position
- // to its current position plus the numbers defined in "coords".
- // nodes: An array of DOMNodes or one DOMNode.
- // coords: { top: Decimal?, left: Decimal? }
- // duration: Duration of the animation in milliseconds.
- // easing: An easing function.
- // callback: Function to run at the end of the animation.
- nodes = dojo.lfx.html._byId(nodes);
- var anims = [];
- var compute = dojo.html.getComputedStyle;
-
- if(dojo.lang.isArray(coords)){
- /* coords: Array
- pId: a */
- dojo.deprecated('dojo.lfx.html.slideBy(node, array)', 'use dojo.lfx.html.slideBy(node, {top: value, left: value});', '0.5');
- coords = { top: coords[0], left: coords[1] };
- }
-
- dojo.lang.forEach(nodes, function(node){
- var top = null;
- var left = null;
-
- var init = (function(){
- var innerNode = node;
- return function(){
- var pos = compute(innerNode, 'position');
- top = (pos == 'absolute' ? node.offsetTop : parseInt(compute(node, 'top')) || 0);
- left = (pos == 'absolute' ? node.offsetLeft : parseInt(compute(node, 'left')) || 0);
-
- if (!dojo.lang.inArray(['absolute', 'relative'], pos)) {
- var ret = dojo.html.abs(innerNode, true);
- dojo.html.setStyleAttributes(innerNode, "position:absolute;top:"+ret.y+"px;left:"+ret.x+"px;");
- top = ret.y;
- left = ret.x;
- }
- }
- })();
- init();
-
- var anim = dojo.lfx.propertyAnimation(node,
- {
- "top": { start: top, end: top+(coords.top||0) },
- "left": { start: left, end: left+(coords.left||0) }
- },
- duration,
- easing).connect("beforeBegin", init);
-
- if(callback){
- anim.connect("onEnd", function(){ callback(nodes, anim); });
- }
-
- anims.push(anim);
- });
-
- return dojo.lfx.combine(anims); // dojo.lfx.Combine
-}
-
-dojo.lfx.html.explode = function(/*DOMNode*/ start,
- /*DOMNode*/ endNode,
- /*int?*/ duration,
- /*Function?*/ easing,
- /*Function?*/ callback){
- // summary: Returns an animation that will
- // start:
- // endNode:
- // duration: Duration of the animation in milliseconds.
- // easing: An easing function.
- // callback: Function to run at the end of the animation.
- var h = dojo.html;
- start = dojo.byId(start);
- endNode = dojo.byId(endNode);
- var startCoords = h.toCoordinateObject(start, true);
- var outline = document.createElement("div");
- h.copyStyle(outline, endNode);
- if(endNode.explodeClassName){ outline.className = endNode.explodeClassName; }
- with(outline.style){
- position = "absolute";
- display = "none";
- // border = "1px solid black";
- var backgroundStyle = h.getStyle(start, "background-color");
- backgroundColor = backgroundStyle ? backgroundStyle.toLowerCase() : "transparent";
- backgroundColor = (backgroundColor == "transparent") ? "rgb(221, 221, 221)" : backgroundColor;
- }
- dojo.body().appendChild(outline);
-
- with(endNode.style){
- visibility = "hidden";
- display = "block";
- }
- var endCoords = h.toCoordinateObject(endNode, true);
- with(endNode.style){
- display = "none";
- visibility = "visible";
- }
-
- var props = { opacity: { start: 0.5, end: 1.0 } };
- dojo.lang.forEach(["height", "width", "top", "left"], function(type){
- props[type] = { start: startCoords[type], end: endCoords[type] }
- });
-
- var anim = new dojo.lfx.propertyAnimation(outline,
- props,
- duration,
- easing,
- {
- "beforeBegin": function(){
- h.setDisplay(outline, "block");
- },
- "onEnd": function(){
- h.setDisplay(endNode, "block");
- outline.parentNode.removeChild(outline);
- }
- }
- );
-
- if(callback){
- anim.connect("onEnd", function(){ callback(endNode, anim); });
- }
- return anim; // dojo.lfx.Animation
-}
-
-dojo.lfx.html.implode = function(/*DOMNode*/ startNode,
- /*DOMNode*/ end,
- /*int?*/ duration,
- /*Function?*/ easing,
- /*Function?*/ callback){
- // summary: Returns an animation that will
- // startNode:
- // end:
- // duration: Duration of the animation in milliseconds.
- // easing: An easing function.
- // callback: Function to run at the end of the animation.
- var h = dojo.html;
- startNode = dojo.byId(startNode);
- end = dojo.byId(end);
- var startCoords = dojo.html.toCoordinateObject(startNode, true);
- var endCoords = dojo.html.toCoordinateObject(end, true);
-
- var outline = document.createElement("div");
- dojo.html.copyStyle(outline, startNode);
- if (startNode.explodeClassName) { outline.className = startNode.explodeClassName; }
- dojo.html.setOpacity(outline, 0.3);
- with(outline.style){
- position = "absolute";
- display = "none";
- backgroundColor = h.getStyle(startNode, "background-color").toLowerCase();
- }
- dojo.body().appendChild(outline);
-
- var props = { opacity: { start: 1.0, end: 0.5 } };
- dojo.lang.forEach(["height", "width", "top", "left"], function(type){
- props[type] = { start: startCoords[type], end: endCoords[type] }
- });
-
- var anim = new dojo.lfx.propertyAnimation(outline,
- props,
- duration,
- easing,
- {
- "beforeBegin": function(){
- dojo.html.hide(startNode);
- dojo.html.show(outline);
- },
- "onEnd": function(){
- outline.parentNode.removeChild(outline);
- }
- }
- );
-
- if(callback){
- anim.connect("onEnd", function(){ callback(startNode, anim); });
- }
- return anim; // dojo.lfx.Animation
-}
-
-dojo.lfx.html.highlight = function(/*DOMNode[]*/ nodes,
- /*dojo.gfx.color.Color*/ startColor,
- /*int?*/ duration,
- /*Function?*/ easing,
- /*Function?*/ callback){
- // summary: Returns an animation that will set the background color
- // of "nodes" to startColor and transition it to "nodes"
- // original color.
- // startColor: Color to transition from.
- // duration: Duration of the animation in milliseconds.
- // easing: An easing function.
- // callback: Function to run at the end of the animation.
- nodes = dojo.lfx.html._byId(nodes);
- var anims = [];
-
- dojo.lang.forEach(nodes, function(node){
- var color = dojo.html.getBackgroundColor(node);
- var bg = dojo.html.getStyle(node, "background-color").toLowerCase();
- var bgImage = dojo.html.getStyle(node, "background-image");
- var wasTransparent = (bg == "transparent" || bg == "rgba(0, 0, 0, 0)");
- while(color.length > 3) { color.pop(); }
-
- var rgb = new dojo.gfx.color.Color(startColor);
- var endRgb = new dojo.gfx.color.Color(color);
-
- var anim = dojo.lfx.propertyAnimation(node,
- { "background-color": { start: rgb, end: endRgb } },
- duration,
- easing,
- {
- "beforeBegin": function(){
- if(bgImage){
- node.style.backgroundImage = "none";
- }
- node.style.backgroundColor = "rgb(" + rgb.toRgb().join(",") + ")";
- },
- "onEnd": function(){
- if(bgImage){
- node.style.backgroundImage = bgImage;
- }
- if(wasTransparent){
- node.style.backgroundColor = "transparent";
- }
- if(callback){
- callback(node, anim);
- }
- }
- }
- );
-
- anims.push(anim);
- });
- return dojo.lfx.combine(anims); // dojo.lfx.Combine
-}
-
-dojo.lfx.html.unhighlight = function(/*DOMNode[]*/ nodes,
- /*dojo.gfx.color.Color*/ endColor,
- /*int?*/ duration,
- /*Function?*/ easing,
- /*Function?*/ callback){
- // summary: Returns an animation that will transition "nodes" background color
- // from its current color to "endColor".
- // endColor: Color to transition to.
- // duration: Duration of the animation in milliseconds.
- // easing: An easing function.
- // callback: Function to run at the end of the animation.
- nodes = dojo.lfx.html._byId(nodes);
- var anims = [];
-
- dojo.lang.forEach(nodes, function(node){
- var color = new dojo.gfx.color.Color(dojo.html.getBackgroundColor(node));
- var rgb = new dojo.gfx.color.Color(endColor);
-
- var bgImage = dojo.html.getStyle(node, "background-image");
-
- var anim = dojo.lfx.propertyAnimation(node,
- { "background-color": { start: color, end: rgb } },
- duration,
- easing,
- {
- "beforeBegin": function(){
- if(bgImage){
- node.style.backgroundImage = "none";
- }
- node.style.backgroundColor = "rgb(" + color.toRgb().join(",") + ")";
- },
- "onEnd": function(){
- if(callback){
- callback(node, anim);
- }
- }
- }
- );
- anims.push(anim);
- });
- return dojo.lfx.combine(anims); // dojo.lfx.Combine
-}
-
-dojo.lang.mixin(dojo.lfx, dojo.lfx.html);
-
-dojo.kwCompoundRequire({
- browser: ["dojo.lfx.html"],
- dashboard: ["dojo.lfx.html"]
-});
-dojo.provide("dojo.lfx.*");
-
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/flash6_gateway.swf b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/flash6_gateway.swf
deleted file mode 100644
index c452d92be..000000000
Binary files a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/flash6_gateway.swf and /dev/null differ
diff --git a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/iframe_history.html b/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/iframe_history.html
deleted file mode 100644
index 54309f2de..000000000
--- a/plugins/dojo/src/main/resources/org/apache/struts2/static/dojo/iframe_history.html
+++ /dev/null
@@ -1,84 +0,0 @@
-
-
-
-
-
-
-
-
-
-