You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by hl...@apache.org on 2012/12/31 01:53:46 UTC
[2/3] git commit: Move a number of assets into proper folders under
META-INF/assets
Move a number of assets into proper folders under META-INF/assets
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/2f3babe0
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/2f3babe0
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/2f3babe0
Branch: refs/heads/master
Commit: 2f3babe0a950ff2dc1ec2096fff76dfdfb19506d
Parents: fe46ace
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Sun Dec 30 16:52:01 2012 -0800
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Sun Dec 30 16:52:01 2012 -0800
----------------------------------------------------------------------
.../META-INF/assets/core/ServiceStatus.css | 12 ++++++
.../resources/META-INF/assets/core/deselect.png | Bin 0 -> 1837 bytes
.../resources/META-INF/assets/core/move_down.png | Bin 0 -> 1338 bytes
.../resources/META-INF/assets/core/move_up.png | Bin 0 -> 1319 bytes
.../main/resources/META-INF/assets/core/select.png | Bin 0 -> 1885 bytes
.../resources/META-INF/assets/core/sort-asc.png | Bin 0 -> 799 bytes
.../resources/META-INF/assets/core/sort-desc.png | Bin 0 -> 800 bytes
.../resources/META-INF/assets/core/sortable.png | Bin 0 -> 827 bytes
.../tapestry5/corelib/components/deselect.png | Bin 1837 -> 0 bytes
.../tapestry5/corelib/components/move_down.png | Bin 1338 -> 0 bytes
.../tapestry5/corelib/components/move_up.png | Bin 1319 -> 0 bytes
.../apache/tapestry5/corelib/components/select.png | Bin 1885 -> 0 bytes
.../tapestry5/corelib/components/sort-asc.png | Bin 799 -> 0 bytes
.../tapestry5/corelib/components/sort-desc.png | Bin 800 -> 0 bytes
.../tapestry5/corelib/components/sortable.png | Bin 827 -> 0 bytes
.../tapestry5/corelib/pages/ServiceStatus.css | 12 ------
.../tapestry5/kaptcha/services/KaptchaModule.java | 4 +-
.../resources/META-INF/assets/core/kaptcha.css | 5 ++
.../tapestry5/kaptcha/components/kaptcha.css | 5 --
.../apache/tapestry5/upload/components/Upload.java | 15 ++++---
.../META-INF/modules/t5/core/injected-upload.js | 30 +++++++++++++++
21 files changed, 58 insertions(+), 25 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-core/src/main/resources/META-INF/assets/core/ServiceStatus.css
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/META-INF/assets/core/ServiceStatus.css b/tapestry-core/src/main/resources/META-INF/assets/core/ServiceStatus.css
new file mode 100644
index 0000000..15a1db7
--- /dev/null
+++ b/tapestry-core/src/main/resources/META-INF/assets/core/ServiceStatus.css
@@ -0,0 +1,12 @@
+TR.DEFINED {
+ color: #666666;
+ font-style: italic;
+}
+
+TR.VIRTUAL {
+ color: blue;
+}
+
+TR.REAL {
+ color: green;
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-core/src/main/resources/META-INF/assets/core/deselect.png
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/META-INF/assets/core/deselect.png b/tapestry-core/src/main/resources/META-INF/assets/core/deselect.png
new file mode 100644
index 0000000..97473a6
Binary files /dev/null and b/tapestry-core/src/main/resources/META-INF/assets/core/deselect.png differ
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-core/src/main/resources/META-INF/assets/core/move_down.png
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/META-INF/assets/core/move_down.png b/tapestry-core/src/main/resources/META-INF/assets/core/move_down.png
new file mode 100644
index 0000000..1f5c72a
Binary files /dev/null and b/tapestry-core/src/main/resources/META-INF/assets/core/move_down.png differ
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-core/src/main/resources/META-INF/assets/core/move_up.png
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/META-INF/assets/core/move_up.png b/tapestry-core/src/main/resources/META-INF/assets/core/move_up.png
new file mode 100644
index 0000000..05a447b
Binary files /dev/null and b/tapestry-core/src/main/resources/META-INF/assets/core/move_up.png differ
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-core/src/main/resources/META-INF/assets/core/select.png
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/META-INF/assets/core/select.png b/tapestry-core/src/main/resources/META-INF/assets/core/select.png
new file mode 100644
index 0000000..78c78a4
Binary files /dev/null and b/tapestry-core/src/main/resources/META-INF/assets/core/select.png differ
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-core/src/main/resources/META-INF/assets/core/sort-asc.png
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/META-INF/assets/core/sort-asc.png b/tapestry-core/src/main/resources/META-INF/assets/core/sort-asc.png
new file mode 100644
index 0000000..8a539c5
Binary files /dev/null and b/tapestry-core/src/main/resources/META-INF/assets/core/sort-asc.png differ
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-core/src/main/resources/META-INF/assets/core/sort-desc.png
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/META-INF/assets/core/sort-desc.png b/tapestry-core/src/main/resources/META-INF/assets/core/sort-desc.png
new file mode 100644
index 0000000..b150dbb
Binary files /dev/null and b/tapestry-core/src/main/resources/META-INF/assets/core/sort-desc.png differ
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-core/src/main/resources/META-INF/assets/core/sortable.png
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/META-INF/assets/core/sortable.png b/tapestry-core/src/main/resources/META-INF/assets/core/sortable.png
new file mode 100644
index 0000000..1e301ee
Binary files /dev/null and b/tapestry-core/src/main/resources/META-INF/assets/core/sortable.png differ
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/deselect.png
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/deselect.png b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/deselect.png
deleted file mode 100644
index 97473a6..0000000
Binary files a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/deselect.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/move_down.png
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/move_down.png b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/move_down.png
deleted file mode 100644
index 1f5c72a..0000000
Binary files a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/move_down.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/move_up.png
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/move_up.png b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/move_up.png
deleted file mode 100644
index 05a447b..0000000
Binary files a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/move_up.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/select.png
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/select.png b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/select.png
deleted file mode 100644
index 78c78a4..0000000
Binary files a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/select.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/sort-asc.png
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/sort-asc.png b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/sort-asc.png
deleted file mode 100644
index 8a539c5..0000000
Binary files a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/sort-asc.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/sort-desc.png
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/sort-desc.png b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/sort-desc.png
deleted file mode 100644
index b150dbb..0000000
Binary files a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/sort-desc.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/sortable.png
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/sortable.png b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/sortable.png
deleted file mode 100644
index 1e301ee..0000000
Binary files a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/sortable.png and /dev/null differ
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ServiceStatus.css
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ServiceStatus.css b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ServiceStatus.css
deleted file mode 100644
index 15a1db7..0000000
--- a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/pages/ServiceStatus.css
+++ /dev/null
@@ -1,12 +0,0 @@
-TR.DEFINED {
- color: #666666;
- font-style: italic;
-}
-
-TR.VIRTUAL {
- color: blue;
-}
-
-TR.REAL {
- color: green;
-}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-kaptcha/src/main/java/org/apache/tapestry5/kaptcha/services/KaptchaModule.java
----------------------------------------------------------------------
diff --git a/tapestry-kaptcha/src/main/java/org/apache/tapestry5/kaptcha/services/KaptchaModule.java b/tapestry-kaptcha/src/main/java/org/apache/tapestry5/kaptcha/services/KaptchaModule.java
index 4e2dd1f..69d8205 100644
--- a/tapestry-kaptcha/src/main/java/org/apache/tapestry5/kaptcha/services/KaptchaModule.java
+++ b/tapestry-kaptcha/src/main/java/org/apache/tapestry5/kaptcha/services/KaptchaModule.java
@@ -55,9 +55,9 @@ public class KaptchaModule
public static void provideLibraryMessages(
OrderedConfiguration<Resource> configuration,
@Value("classpath:org/apache/tapestry5/kaptcha/tapestry-kaptcha.properties")
- Resource coreCatalog)
+ Resource kaptchaCatalog)
{
- configuration.add("TapestryKaptcha", coreCatalog, "before:AppCatalog");
+ configuration.add("TapestryKaptcha", kaptchaCatalog, "before:AppCatalog");
}
public static void contributeDataTypeAnalyzer(OrderedConfiguration<DataTypeAnalyzer> configuration)
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-kaptcha/src/main/resources/META-INF/assets/core/kaptcha.css
----------------------------------------------------------------------
diff --git a/tapestry-kaptcha/src/main/resources/META-INF/assets/core/kaptcha.css b/tapestry-kaptcha/src/main/resources/META-INF/assets/core/kaptcha.css
new file mode 100644
index 0000000..6060210
--- /dev/null
+++ b/tapestry-kaptcha/src/main/resources/META-INF/assets/core/kaptcha.css
@@ -0,0 +1,5 @@
+.t-kaptcha-field {
+ margin-left: 250px;
+ padding: 4px 0 0 3px
+}
+
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-kaptcha/src/main/resources/org/apache/tapestry5/kaptcha/components/kaptcha.css
----------------------------------------------------------------------
diff --git a/tapestry-kaptcha/src/main/resources/org/apache/tapestry5/kaptcha/components/kaptcha.css b/tapestry-kaptcha/src/main/resources/org/apache/tapestry5/kaptcha/components/kaptcha.css
deleted file mode 100644
index 6060210..0000000
--- a/tapestry-kaptcha/src/main/resources/org/apache/tapestry5/kaptcha/components/kaptcha.css
+++ /dev/null
@@ -1,5 +0,0 @@
-.t-kaptcha-field {
- margin-left: 250px;
- padding: 4px 0 0 3px
-}
-
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-upload/src/main/java/org/apache/tapestry5/upload/components/Upload.java
----------------------------------------------------------------------
diff --git a/tapestry-upload/src/main/java/org/apache/tapestry5/upload/components/Upload.java b/tapestry-upload/src/main/java/org/apache/tapestry5/upload/components/Upload.java
index 6021baf..9047587 100755
--- a/tapestry-upload/src/main/java/org/apache/tapestry5/upload/components/Upload.java
+++ b/tapestry-upload/src/main/java/org/apache/tapestry5/upload/components/Upload.java
@@ -86,7 +86,10 @@ public class Upload extends AbstractField
ComponentResources resources, FieldValidationSupport fieldValidationSupport)
{
this.value = value;
- if (validate != null) this.validate = validate;
+ if (validate != null)
+ {
+ this.validate = validate;
+ }
this.decoder = decoder;
this.validationTracker = tracker;
this.resources = resources;
@@ -99,9 +102,9 @@ public class Upload extends AbstractField
{
UploadedFile uploaded = decoder.getFileUpload(controlName);
- if (uploaded != null)
+ if (uploaded != null && (uploaded.getFileName() == null || uploaded.getFileName().length() == 0))
{
- if (uploaded.getFileName() == null || uploaded.getFileName().length() == 0) uploaded = null;
+ uploaded = null;
}
try
@@ -118,7 +121,8 @@ public class Upload extends AbstractField
/**
* Render the upload tags.
*
- * @param writer Writer to output markup
+ * @param writer
+ * Writer to output markup
*/
protected void beginRender(MarkupWriter writer)
{
@@ -135,8 +139,7 @@ public class Upload extends AbstractField
// TAPESTRY-2453
if (request.isXHR())
{
- javaScriptSupport.importJavaScriptLibrary(uploadScript);
- javaScriptSupport.addInitializerCall("injectedUpload", getClientId());
+ javaScriptSupport.require("t5/core/injected-uploader").with(getClientId());
}
}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2f3babe0/tapestry-upload/src/main/resources/META-INF/modules/t5/core/injected-upload.js
----------------------------------------------------------------------
diff --git a/tapestry-upload/src/main/resources/META-INF/modules/t5/core/injected-upload.js b/tapestry-upload/src/main/resources/META-INF/modules/t5/core/injected-upload.js
new file mode 100644
index 0000000..d7b94be
--- /dev/null
+++ b/tapestry-upload/src/main/resources/META-INF/modules/t5/core/injected-upload.js
@@ -0,0 +1,30 @@
+// Copyright 2012 The Apache Software Foundation
+//
+// Licensed 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.
+
+/**
+ * Ensures that the encoding type of the containing form is multipart/form-data when an Upload
+ * component is dynamically added to the form via Ajax.
+ */
+define(["./dom"],
+ function (dom) {
+
+ return function (elementId) {
+ var form = dom(elementId).findContainer("form");
+
+ if (form) {
+ form.element.enctype = "multipart/form-data";
+ form.element.encoding = "multipart/form-data";
+ }
+ }
+ });