You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@continuum.apache.org by ol...@apache.org on 2008/12/15 22:51:01 UTC
svn commit: r726819 [1/4] - in /continuum/trunk/continuum-webapp/src/main:
resources/template/default/ webapp/WEB-INF/jsp/admin/
webapp/WEB-INF/jsp/decorators/ webapp/struts/ webapp/struts/dojo/
webapp/struts/dojo/debug/ webapp/struts/dojo/event/ webap...
Author: olamy
Date: Mon Dec 15 13:50:59 2008
New Revision: 726819
URL: http://svn.apache.org/viewvc?rev=726819&view=rev
Log:
[CONTINUUM-2017] Unable to add build definitions to a template
Added:
continuum/trunk/continuum-webapp/src/main/webapp/struts/
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/AdapterRegistry.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/Firebug.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/arrow_hide.gif (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/arrow_show.gif (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/console.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/deep.html (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/spacer.gif (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/dojo.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/dom.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/event/
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/event/__package__.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/event/browser.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/event/common.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/event/topic.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/string/
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/string/Builder.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/string/__package__.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/string/common.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/string/extras.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/text/
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/text/__package__.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/text/textDirectory.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/validate/
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/validate.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/validate/__package__.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/validate/check.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/validate/common.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/validate/creditCard.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/validate/datetime.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/validate/de.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/validate/jp.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/validate/us.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/validate/web.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/dojoRequire.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/optiontransferselect.js (with props)
continuum/trunk/continuum-webapp/src/main/webapp/struts/validation.js (with props)
Modified:
continuum/trunk/continuum-webapp/src/main/resources/template/default/form-validate.ftl
continuum/trunk/continuum-webapp/src/main/resources/template/default/head.ftl
continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildDefinitionTemplate.jsp
continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp
Modified: continuum/trunk/continuum-webapp/src/main/resources/template/default/form-validate.ftl
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/template/default/form-validate.ftl?rev=726819&r1=726818&r2=726819&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/template/default/form-validate.ftl (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/template/default/form-validate.ftl Mon Dec 15 13:50:59 2008
@@ -1,5 +1,5 @@
<#if parameters.validate?default(false) == true>
- <script src="${base}/template/validation.js"></script>
+ <script src="${base}/struts/validation.js"></script>
<#if parameters.onsubmit?exists>
${tag.addParameter('onsubmit', "${parameters.onsubmit}; customOnsubmit(); return validateForm_${parameters.id}();")}
<#else>
Modified: continuum/trunk/continuum-webapp/src/main/resources/template/default/head.ftl
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/resources/template/default/head.ftl?rev=726819&r1=726818&r2=726819&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/resources/template/default/head.ftl (original)
+++ continuum/trunk/continuum-webapp/src/main/resources/template/default/head.ftl Mon Dec 15 13:50:59 2008
@@ -1,2 +1,34 @@
-<link rel="stylesheet" href="<@s.url value='/webwork/xhtml/styles.css' encode='false' />" type="text/css"/>
-<#include "/${parameters.templateDir}/simple/head.ftl" />
+<#--
+/*
+ *
+ * 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.
+ */
+-->
+<script type="text/javascript">
+ // Dojo configuration
+ djConfig = {
+ baseRelativePath: "<@s.url includeParams='none' value='/struts/dojo' includeParams="none" encode='false'/>",
+ isDebug: ${parameters.debug?default(false)},
+ bindEncoding: "${parameters.encoding}",
+ debugAtAllCosts: true // not needed, but allows the Venkman debugger to work with the includes
+ };
+</script>
+<script type="text/javascript"
+ src="<@s.url includeParams='none' value='/struts/dojo/dojo.js' includeParams="none" encode='false'/>"></script>
+<script type="text/javascript"
+ src="<@s.url includeParams='none' value='/struts/dojoRequire.js' includeParams="none" encode='false'/>"></script>
\ No newline at end of file
Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildDefinitionTemplate.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildDefinitionTemplate.jsp?rev=726819&r1=726818&r2=726819&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildDefinitionTemplate.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/admin/editBuildDefinitionTemplate.jsp Mon Dec 15 13:50:59 2008
@@ -30,8 +30,7 @@
<h3><s:text name="buildDefinition.template.section.title"/></h3>
<div class="axial">
- <s:form action="saveBuildDefinitionTemplate" method="post" validate="true" name="buildDefinitionTemplate"
- onsubmit="customOnsubmit_saveBuildDefinitionTemplate();">
+ <s:form action="saveBuildDefinitionTemplate" method="post" name="buildDefinitionTemplate" validate="false">
<c:choose>
<c:when test="${!empty actionErrors}">
@@ -81,4 +80,10 @@
</div>
</body>
</s:i18n>
+ <script type="text/javascript">
+ customOnsubmit = function(){
+ // no op
+ }
+ </script>
</html>
+
Modified: continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp?rev=726819&r1=726818&r2=726819&view=diff
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp (original)
+++ continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp Mon Dec 15 13:50:59 2008
@@ -32,19 +32,19 @@
<link rel="stylesheet" type="text/css" href="<s:url value="/css/extremecomponents.css" includeParams="none"/>" media="screen"/>
<link rel="shortcut icon" href="<s:url value="/favicon.ico" includeParams="none"/>" type="image/x-icon"/>
<script type="text/javascript" src="<s:url value="/js/prototype.js" includeParams="none"/>"></script>
-
+ <s:head/>
<decorator:head/>
</head>
<body onload="<decorator:getProperty property="body.onload" />" marginwidth="0" marginheight="0" class="composite">
-<%@ include file="/WEB-INF/jsp/navigations/DefaultTop.jsp" %>
+<s:include value="/WEB-INF/jsp/navigations/DefaultTop.jsp"/>
<table id="main" border="0" cellpadding="4" cellspacing="0" width="100%">
<tbody>
<tr valign="top">
<td id="leftcol" width="180">
<br/> <br/>
- <%@ include file="/WEB-INF/jsp/navigations/Menu.jsp" %>
+ <s:include value="/WEB-INF/jsp/navigations/Menu.jsp"/>
</td>
<td width="86%">
<br/>
Added: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/AdapterRegistry.js
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/AdapterRegistry.js?rev=726819&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/AdapterRegistry.js (added)
+++ continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/AdapterRegistry.js Mon Dec 15 13:50:59 2008
@@ -0,0 +1,89 @@
+/*
+ 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
+*/
+
+dojo.provide("dojo.AdapterRegistry");
+dojo.require("dojo.lang.func");
+
+dojo.AdapterRegistry = function(/*boolean, optional*/returnWrappers){
+ // summary:
+ // A registry to make contextual calling/searching easier.
+ // description:
+ // Objects of this class keep list of arrays in the form [name, check,
+ // wrap, directReturn] that are used to determine what the contextual
+ // result of a set of checked arguments is. All check/wrap functions
+ // in this registry should be of the same arity.
+ this.pairs = [];
+ this.returnWrappers = returnWrappers || false;
+}
+
+dojo.lang.extend(dojo.AdapterRegistry, {
+ register: function( /*string*/ name, /*function*/ check, /*function*/ wrap,
+ /*boolean, optional*/ directReturn,
+ /*boolean, optional*/ override){
+ // summary:
+ // register a check function to determine if the wrap function or
+ // object gets selected
+ // name: a way to identify this matcher.
+ // check:
+ // a function that arguments are passed to from the adapter's
+ // match() function. The check function should return true if the
+ // given arguments are appropriate for the wrap function.
+ // directReturn:
+ // If directReturn is true, the value passed in for wrap will be
+ // returned instead of being called. Alternately, the
+ // AdapterRegistry can be set globally to "return not call" using
+ // the returnWrappers property. Either way, this behavior allows
+ // the registry to act as a "search" function instead of a
+ // function interception library.
+ // override:
+ // If override is given and true, the check function will be given
+ // highest priority. Otherwise, it will be the lowest priority
+ // adapter.
+
+ var type = (override) ? "unshift" : "push";
+ this.pairs[type]([name, check, wrap, directReturn]);
+ },
+
+ match: function(/* ... */){
+ // summary:
+ // Find an adapter for the given arguments. If no suitable adapter
+ // is found, throws an exception. match() accepts any number of
+ // arguments, all of which are passed to all matching functions
+ // from the registered pairs.
+ for(var i = 0; i < this.pairs.length; i++){
+ var pair = this.pairs[i];
+ if(pair[1].apply(this, arguments)){
+ if((pair[3])||(this.returnWrappers)){
+ return pair[2];
+ }else{
+ return pair[2].apply(this, arguments);
+ }
+ }
+ }
+ throw new Error("No match found");
+ // dojo.raise("No match found");
+ },
+
+ unregister: function(name){
+ // summary: Remove a named adapter from the registry
+
+ // FIXME: this is kind of a dumb way to handle this. On a large
+ // registry this will be slow-ish and we can use the name as a lookup
+ // should we choose to trade memory for speed.
+ for(var i = 0; i < this.pairs.length; i++){
+ var pair = this.pairs[i];
+ if(pair[0] == name){
+ this.pairs.splice(i, 1);
+ return true;
+ }
+ }
+ return false;
+ }
+});
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/AdapterRegistry.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/AdapterRegistry.js
------------------------------------------------------------------------------
svn:executable = *
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/AdapterRegistry.js
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug.js
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug.js?rev=726819&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug.js (added)
+++ continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug.js Mon Dec 15 13:50:59 2008
@@ -0,0 +1,91 @@
+/*
+ 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
+*/
+
+dojo.debug = function(/*...*/){
+ // summary:
+ // Produce a line of debug output. Does nothing unless
+ // djConfig.isDebug is true. Accepts any nubmer of args, joined with
+ // '' to produce a single line of debugging output. Caller should not
+ // supply a trailing "\n".
+ if (!djConfig.isDebug) { return; }
+ var args = arguments;
+ if(dj_undef("println", dojo.hostenv)){
+ dojo.raise("dojo.debug not available (yet?)");
+ }
+ var isJUM = dj_global["jum"] && !dj_global["jum"].isBrowser;
+ var s = [(isJUM ? "": "DEBUG: ")];
+ for(var i=0;i<args.length;++i){
+ if(!false && args[i] && args[i] instanceof Error){
+ var msg = "[" + args[i].name + ": " + dojo.errorToString(args[i]) +
+ (args[i].fileName ? ", file: " + args[i].fileName : "") +
+ (args[i].lineNumber ? ", line: " + args[i].lineNumber : "") + "]";
+ } else {
+ try {
+ var msg = String(args[i]);
+ } catch(e) {
+ if(dojo.render.html.ie) {
+ var msg = "[ActiveXObject]";
+ } else {
+ var msg = "[unknown]";
+ }
+ }
+ }
+ s.push(msg);
+ }
+
+ dojo.hostenv.println(s.join(" "));
+}
+
+/**
+ * this is really hacky for now - just
+ * display the properties of the object
+**/
+
+dojo.debugShallow = function(/*Object*/obj){
+ // summary:
+ // outputs a "name: value" style listing of all enumerable properties
+ // in obj. Does nothing if djConfig.isDebug == false.
+ // obj: the object to be enumerated
+ if (!djConfig.isDebug) { return; }
+ dojo.debug('------------------------------------------------------------');
+ dojo.debug('Object: '+obj);
+ var props = [];
+ for(var prop in obj){
+ try {
+ props.push(prop + ': ' + obj[prop]);
+ } catch(E) {
+ props.push(prop + ': ERROR - ' + E.message);
+ }
+ }
+ props.sort();
+ for(var i = 0; i < props.length; i++) {
+ dojo.debug(props[i]);
+ }
+ dojo.debug('------------------------------------------------------------');
+}
+
+dojo.debugDeep = function(/*Object*/obj){
+ // summary:
+ // provides an "object explorer" view of the passed obj in a popup
+ // window.
+ // obj: the object to be examined
+ if (!djConfig.isDebug) { return; }
+ if (!dojo.uri || !dojo.uri.dojoUri){ return dojo.debug("You'll need to load dojo.uri.* for deep debugging - sorry!"); }
+ if (!window.open){ return dojo.debug('Deep debugging is only supported in host environments with window.open'); }
+ var idx = dojo.debugDeep.debugVars.length;
+ dojo.debugDeep.debugVars.push(obj);
+ // dojo.undo.browser back and forward breaks relpaths
+ var url = new dojo.uri.Uri(location, dojo.uri.dojoUri("src/debug/deep.html?var="+idx)).toString();
+ var win = window.open(url, '_blank', 'width=600, height=400, resizable=yes, scrollbars=yes, status=yes');
+ try{
+ win.debugVar = obj;
+ }catch(e){}
+}
+dojo.debugDeep.debugVars = [];
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug.js
------------------------------------------------------------------------------
svn:executable = *
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug.js
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/Firebug.js
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/Firebug.js?rev=726819&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/Firebug.js (added)
+++ continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/Firebug.js Mon Dec 15 13:50:59 2008
@@ -0,0 +1,62 @@
+/*
+ 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
+*/
+
+dojo.provide("dojo.debug.Firebug");
+dojo.deprecated("dojo.debug.Firebug is slated for removal in 0.5; use dojo.debug.console instead.", "0.5");
+
+// summary
+// Firebug Console logger.
+// This package redirects the normal dojo debugging output to the firebug console. It does
+// so by sending the entire object to the console, rather than just overriding dojo.hostenv.println
+// so that firebugs object inspector can be taken advantage of.
+
+if (dojo.render.html.moz) {
+ if (console && console.log) {
+ var consoleLog = function() {
+ if (!djConfig.isDebug) { return ; }
+
+ var args = dojo.lang.toArray(arguments);
+ args.splice(0,0, "DEBUG: ");
+ console.log.apply(console, args);
+ }
+
+ dojo.debug = consoleLog;
+
+ dojo.debugDeep=consoleLog;
+
+ dojo.debugShallow=function(obj) {
+ if (!djConfig.isDebug) { return; }
+
+ if (dojo.lang.isArray(obj)) {
+ console.log('Array: ', obj);
+ for (var i=0; x<obj.length; i++) {
+ console.log(' ', '['+i+']', obj[i]);
+ }
+ } else {
+ console.log('Object: ', obj);
+ var propNames = [];
+ for (var prop in obj) {
+ propNames.push(prop);
+ }
+ propNames.sort();
+ dojo.lang.forEach(propNames, function(prop) {
+ try {
+ console.log(' ', prop, obj[prop]);
+ } catch(e) {
+ console.log(' ', prop, 'ERROR', e.message, e);
+ }
+ });
+ }
+ }
+
+ } else {
+ dojo.debug("dojo.debug.Firebug requires Firebug > 0.4");
+ }
+}
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/Firebug.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/Firebug.js
------------------------------------------------------------------------------
svn:executable = *
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/Firebug.js
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/arrow_hide.gif
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/arrow_hide.gif?rev=726819&view=auto
==============================================================================
Binary file - no diff available.
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/arrow_hide.gif
------------------------------------------------------------------------------
svn:executable = *
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/arrow_hide.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/arrow_show.gif
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/arrow_show.gif?rev=726819&view=auto
==============================================================================
Binary file - no diff available.
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/arrow_show.gif
------------------------------------------------------------------------------
svn:executable = *
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/arrow_show.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/console.js
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/console.js?rev=726819&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/console.js (added)
+++ continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/console.js Mon Dec 15 13:50:59 2008
@@ -0,0 +1,115 @@
+/*
+ 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
+*/
+
+dojo.provide("dojo.debug.console");
+dojo.require("dojo.logging.ConsoleLogger");
+
+// summary:
+// Console logger, for use with FireFox Firebug, Safari and Opera's consoles.
+// description:
+// This package redirects the normal dojo debugging output to the console log in modern browsers.
+// When using Firebug, it does this by sending the entire object to the console,
+// rather than just overriding dojo.hostenv.println, so that Firebug's interactive
+// object inspector is available.
+// see: http://www.joehewitt.com/software/firebug/docs.php
+
+if (window.console) {
+ if (console.info != null) {
+ // using a later version of Firebug -- lots of fun stuff!
+
+ dojo.hostenv.println = function() {
+ // summary: Write all of the arguments to the Firebug console
+ // description: Uses console.info() so that the (i) icon prints next to the debug line
+ // rather than munging the arguments by adding "DEBUG:" in front of them.
+ // This allows us to use Firebug's string handling to do interesting things
+ if (!djConfig.isDebug) { return; }
+ console.info.apply(console, arguments);
+ }
+ dojo.debug=dojo.hostenv.println;
+ dojo.debugDeep = dojo.debug;
+
+ dojo.debugShallow = function(/*Object*/ obj, /*Boolean?*/showMethods, /*Boolean?*/sort) {
+ // summary: Write first-level properties of obj to the console.
+ // obj: Object or Array to debug
+ // showMethods: Pass false to skip outputing methods of object, any other value will output them.
+ // sort: Pass false to skip sorting properties, any other value will sort.
+ if (!djConfig.isDebug) { return; }
+
+ showMethods = (showMethods != false);
+ sort = (sort != false);
+
+ // handle null or something without a constructor (in which case we don't know the type)
+ if (obj == null || obj.constructor == null) {
+ return dojo.debug(obj);
+ }
+
+ // figure out type via a standard constructor (Object, String, Date, etc)
+ var type = obj.declaredClass;
+ if (type == null) {
+ type = obj.constructor.toString().match(/function\s*(.*)\(/);
+ if (type) { type = type[1] };
+ }
+ // if we got a viable type, use Firebug's interactive property dump feature
+ if (type) {
+ if (type == "String" || type == "Number") {
+ return dojo.debug(type+": ", obj);
+ }
+ if (showMethods && !sort) {
+ var sortedObj = obj;
+ } else {
+ var propNames = [];
+ if (showMethods) {
+ for (var prop in obj) {
+ propNames.push(prop);
+ }
+ } else {
+ for (var prop in obj) {
+ if (typeof obj[prop] != "function") { propNames.push(prop); }
+ else dojo.debug(prop);
+ }
+ }
+ if (sort) propNames.sort();
+ var sortedObj = {};
+ dojo.lang.forEach(propNames, function(prop) {
+ sortedObj[prop] = obj[prop];
+ });
+ }
+
+ return dojo.debug(type+": %o\n%2.o",obj,sortedObj);
+ }
+
+ // otherwise just output the constructor + object,
+ // which is nice for a DOM element, etc
+ return dojo.debug(obj.constructor + ": ", obj);
+ }
+
+ } else if (console.log != null) {
+ // using Safari or an old version of Firebug
+ dojo.hostenv.println=function() {
+ if (!djConfig.isDebug) { return ; }
+ // make sure we're only writing a single string to Safari's console
+ var args = dojo.lang.toArray(arguments);
+ console.log("DEBUG: " + args.join(" "));
+ }
+ dojo.debug=dojo.hostenv.println;
+ } else {
+ // not supported
+ dojo.debug("dojo.debug.console requires Firebug > 0.4");
+ }
+} else if (dojo.render.html.opera) {
+ // using Opera 8.0 or later
+ if (opera && opera.postError) {
+ dojo.hostenv.println=opera.postError;
+ // summary: hook debugging up to Opera's postError routine
+ } else {
+ dojo.debug("dojo.debug.Opera requires Opera > 8.0");
+ }
+}
+
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/console.js
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/console.js
------------------------------------------------------------------------------
svn:executable = *
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/console.js
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/deep.html
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/deep.html?rev=726819&view=auto
==============================================================================
--- continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/deep.html (added)
+++ continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/deep.html Mon Dec 15 13:50:59 2008
@@ -0,0 +1,362 @@
+<html>
+<head>
+<title>Deep Debugger</title>
+<script>
+
+var tableRows = {};
+var tableCels = {};
+var tableObjs = {};
+var tablesBuilt = {};
+var tableShows = {};
+var tableHides = {};
+
+// IE: nodes w/id need to be redeclared or getElementById is b0rked
+var frame = null;
+
+window.onload = function(){
+ // if IE loads this page too quickly (instantly) then
+ // window.debugVar might not have been set
+ window.setTimeout(startMeUp, 100);
+}
+
+function startMeUp(){
+ frame = document.getElementById('frame');
+ // GET string
+ var index = location.search.split("=").pop();
+ var debugObj = window.opener.dojo.debugDeep;
+ var debugVar = debugObj.debugVars[index] || window.debugVar;
+ buildTable('root', frame, debugVar);
+}
+
+function buildTable(path, parent, obj){
+ var keys = [];
+ var vals = [];
+ for(var prop in obj){
+ keys.push(prop);
+ try {
+ vals[prop] = obj[prop];
+ } catch(E) {
+ vals[prop] = 'ERROR: ' + E.message;
+ }
+ }
+ keys.sort(keySorter);
+
+ if (!keys.length){
+
+ var div = document.createElement('div');
+ div.appendChild(document.createTextNode('Object has no properties.'));
+
+ parent.appendChild(div);
+ return;
+ }
+
+
+ var t = document.createElement('table');
+ t.border = "1";
+
+ var tb = document.createElement('tbody');
+ t.appendChild(tb);
+
+
+ for(var i = 0; i < keys.length; i++) {
+ buildTableRow(path+'-'+keys[i], tb, keys[i], vals[keys[i]]);
+ }
+
+ if (path == 'root'){
+ //t.style.width = '90%';
+ }
+ t.style.width = '100%';
+
+ parent.appendChild(t);
+
+ tablesBuilt[path] = true;
+}
+
+function buildTableRow(path, tb, name, value) {
+
+ var simpleType = typeof(value);
+ var createSubrow = (simpleType == 'object');
+ var complexType = simpleType;
+
+ if (simpleType == 'object'){
+ var cls = getConstructorClass(value);
+ if (cls){
+ if (cls == 'Object'){
+ }else if (cls == 'Array'){
+ complexType = 'array';
+ }else{
+ complexType += ' ('+cls+')';
+ }
+ }
+ }
+
+/*var tr1 = document.createElement('tr');
+ var td1 = document.createElement('td');
+ var td2 = document.createElement('td');
+ var td3 = document.createElement('td');
+ var td4 = document.createElement('td');*/
+
+ var row = tb.rows.length;
+ var tr1 = tb.insertRow(row++);
+ var td1 = tr1.insertCell(0);
+ var td2 = tr1.insertCell(1);
+ var td3 = tr1.insertCell(2);
+ var td4 = tr1.insertCell(3);
+
+ tr1.style.verticalAlign = 'top';
+ td1.style.verticalAlign = 'middle';
+
+ td1.className = 'propPlus';
+ td2.className = 'propName';
+ td3.className = 'propType';
+ td4.className = 'propVal';
+
+ //tr1.appendChild(td1);
+ //tr1.appendChild(td2);
+ //tr1.appendChild(td3);
+ //tr1.appendChild(td4);
+
+ if (createSubrow){
+ var img1 = document.createElement('img');
+ img1.width = 9;
+ img1.height = 9;
+ img1.src = 'arrow_show.gif';
+ var a1 = document.createElement('a');
+ a1.appendChild(img1);
+ a1.href = '#';
+ a1.onclick = function(){ showTableRow(path); return false; };
+
+ var img2 = document.createElement('img');
+ img2.width = 9;
+ img2.height = 9;
+ img2.src = 'arrow_hide.gif';
+ var a2 = document.createElement('a');
+ a2.appendChild(img2);
+ a2.href = '#';
+ a2.onclick = function(){ hideTableRow(path); return false; };
+ a2.style.display = 'none';
+
+ tableShows[path] = a1;
+ tableHides[path] = a2;
+
+ td1.appendChild(a1);
+ td1.appendChild(a2);
+ }else{
+ var img = document.createElement('img');
+ img.width = 9;
+ img.height = 9;
+ img.src = 'spacer.gif';
+
+ td1.appendChild(img);
+ }
+
+ td2.appendChild(document.createTextNode(name));
+ td3.appendChild(document.createTextNode(complexType));
+ td4.appendChild(buildPreBlock(value));
+
+ //tb.appendChild(tr1);
+
+ if (createSubrow){
+ var tr2 = tb.insertRow(row++);
+ var td5 = tr2.insertCell(0);
+ var td6 = tr2.insertCell(1);
+
+ //var tr2 = document.createElement('tr');
+ //var td5 = document.createElement('td');
+ //var td6 = document.createElement('td');
+
+ td5.innerHTML = ' ';
+ //td6.innerHTML = ' ';
+
+ td6.colSpan = '3';
+
+ tr2.appendChild(td5);
+ tr2.appendChild(td6);
+
+ tr2.style.display = 'none';
+
+ tb.appendChild(tr2);
+
+ tableRows[path] = tr2;
+ tableCels[path] = td6;
+ tableObjs[path] = value;
+ }
+}
+
+function showTableRow(path){
+
+ var tr = tableRows[path];
+ var td = tableCels[path];
+ var a1 = tableShows[path];
+ var a2 = tableHides[path];
+
+ if (!tablesBuilt[path]){
+
+ //alert('building table for '+path);
+ buildTable(path, td, tableObjs[path]);
+ }
+
+ tr.style.display = 'table-row';
+
+ a1.style.display = 'none';
+ a2.style.display = 'inline';
+}
+
+function hideTableRow(path){
+
+ var tr = tableRows[path];
+ var a1 = tableShows[path];
+ var a2 = tableHides[path];
+
+ tr.style.display = 'none';
+
+ a1.style.display = 'inline';
+ a2.style.display = 'none';
+}
+
+function buildPreBlock(value){
+
+ //
+ // how many lines ?
+ //
+
+ var s = ''+value;
+ s = s.replace("\r\n", "\n");
+ s = s.replace("\r", "");
+ var lines = s.split("\n");
+
+
+ if (lines.length < 2){
+
+ if (lines[0].length < 60){
+
+ var pre = document.createElement('pre');
+ pre.appendChild(document.createTextNode(s));
+ return pre;
+ }
+ }
+
+
+ //
+ // multiple lines :(
+ //
+
+ var preview = lines[0].substr(0, 60) + ' ...';
+
+ var pre1 = document.createElement('pre');
+ pre1.appendChild(document.createTextNode(preview));
+ pre1.className = 'clicky';
+
+ var pre2 = document.createElement('pre');
+ pre2.appendChild(document.createTextNode(s));
+ pre2.style.display = 'none';
+ pre2.className = 'clicky';
+
+ pre1.onclick = function(){
+ pre1.style.display = 'none';
+ pre2.style.display = 'block';
+ }
+
+ pre2.onclick = function(){
+ pre1.style.display = 'block';
+ pre2.style.display = 'none';
+ }
+
+ var pre = document.createElement('div');
+
+ pre.appendChild(pre1);
+ pre.appendChild(pre2);
+
+ return pre;
+}
+
+function getConstructorClass(obj){
+
+ if (!obj.constructor || !obj.constructor.toString) return;
+
+ var m = obj.constructor.toString().match(/function\s*(\w+)/);
+
+ if (m && m.length == 2) return m[1];
+
+ return null;
+}
+
+function keySorter(a, b){
+
+ if (a == parseInt(a) && b == parseInt(b)){
+
+ return (parseInt(a) > parseInt(b)) ? 1 : ((parseInt(a) < parseInt(b)) ? -1 : 0);
+ }
+
+ // sort by lowercase string
+
+ var a2 = String(a).toLowerCase();
+ var b2 = String(b).toLowerCase();
+
+ return (a2 > b2) ? 1 : ((a2 < b2) ? -1 : 0);
+}
+
+</script>
+<style>
+
+body {
+ font-family: arial, helvetica, sans-serif;
+}
+
+table {
+ border-width: 0px;
+ border-spacing: 1px;
+ border-collapse: separate;
+}
+
+td {
+ border-width: 0px;
+ padding: 2px;
+}
+
+img {
+ border: 0;
+}
+
+pre {
+ margin: 0;
+ padding: 0;
+ white-space: -moz-pre-wrap; /* Mozilla, supported since 1999 */
+ white-space: -pre-wrap; /* Opera 4 - 6 */
+ white-space: -o-pre-wrap; /* Opera 7 */
+ white-space: pre-wrap; /* CSS3 - Text module (Candidate Recommendation) http://www.w3.org/TR/css3-text/#white-space */
+ word-wrap: break-word; /* IE 5.5+ */
+}
+
+pre.clicky {
+ cursor: hand;
+ cursor: pointer;
+}
+
+td.propPlus {
+ width: 9px;
+ background-color: #ddd;
+}
+
+td.propName {
+ background-color: #ddd;
+}
+
+td.propType {
+ background-color: #ddd;
+}
+
+td.propVal {
+ background-color: #ddd;
+}
+
+</style>
+</head>
+<body>
+
+<h2>Javascript Object Browser</h2>
+
+<div id="frame"></div>
+
+</body>
+</html>
\ No newline at end of file
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/deep.html
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/deep.html
------------------------------------------------------------------------------
svn:executable = *
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/deep.html
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Added: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/spacer.gif
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/spacer.gif?rev=726819&view=auto
==============================================================================
Binary file - no diff available.
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/spacer.gif
------------------------------------------------------------------------------
svn:executable = *
Propchange: continuum/trunk/continuum-webapp/src/main/webapp/struts/dojo/debug/spacer.gif
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream