tapestry-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hls...@apache.org
Subject tapestry-5 git commit: TAP5-2312: Add Ok and Cancel button label parameters to Confirm Mixin
Date Mon, 01 Jun 2015 23:43:27 GMT
Repository: tapestry-5
Updated Branches:
  refs/heads/master d256ab54b -> 20d7d83d9


TAP5-2312: Add Ok and Cancel button label parameters to Confirm Mixin


Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/20d7d83d
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/20d7d83d
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/20d7d83d

Branch: refs/heads/master
Commit: 20d7d83d9c3294482284e691e043f3f7b15c9028
Parents: d256ab5
Author: Howard M. Lewis Ship <hlship@apache.org>
Authored: Mon Jun 1 16:43:20 2015 -0700
Committer: Howard M. Lewis Ship <hlship@apache.org>
Committed: Mon Jun 1 16:43:20 2015 -0700

----------------------------------------------------------------------
 .../META-INF/modules/t5/core/confirm-click.coffee |  5 +++--
 .../apache/tapestry5/corelib/mixins/Confirm.java  | 18 ++++++++++++++++--
 .../org/apache/tapestry5/core.properties          |  4 +++-
 3 files changed, 22 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/20d7d83d/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/confirm-click.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/confirm-click.coffee
b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/confirm-click.coffee
index 013ecac..45652f2 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/confirm-click.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/confirm-click.coffee
@@ -70,7 +70,8 @@ define ["jquery", "./events", "./dom", "bootstrap/modal"],
       runDialog
         title: $this.attr "data-confirm-title"
         message: $this.attr "data-confirm-message"
-        okLabel: $this.attr "data-confirm-label"
+        okLabel: $this.attr "data-confirm-label-ok"
+        cancelLabel: $this.attr "data-confirm-label-cancel"
         ok: ->
           $this.attr "data-confirm-state", "confirmed"
           # In the case of an Ajax update, or a button, this is enough. In the case of a
simple link,
@@ -94,4 +95,4 @@ define ["jquery", "./events", "./dom", "bootstrap/modal"],
 
     # Exports:
 
-    { runDialog }
\ No newline at end of file
+    { runDialog }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/20d7d83d/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/Confirm.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/Confirm.java
b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/Confirm.java
index 0a746ef..8319ccc 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/Confirm.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/Confirm.java
@@ -22,7 +22,7 @@ import org.apache.tapestry5.services.javascript.JavaScriptSupport;
 /**
  * A mixin that can be placed on a clickable component, such as {@link org.apache.tapestry5.corelib.components.LinkSubmit},
  * and will raise a confirmation dialog when the element is clicked.
- * 
+ *
  * Due to conflicts between jQuery (as used by Bootstrap's JavaScript library) and Prototype,
this mixin does not operate
  * when the {@linkplain org.apache.tapestry5.SymbolConstants#JAVASCRIPT_INFRASTRUCTURE_PROVIDER
JavaScript infrastructure provider}
  * is "prototype".
@@ -54,6 +54,18 @@ public class Confirm
     @Environmental
     private JavaScriptSupport javaScriptSupport;
 
+    /**
+     * The label for the ok button.
+     */
+    @Parameter(value = "message:private-default-confirm-ok", defaultPrefix = BindingConstants.LITERAL)
+    private String ok;
+
+    /**
+     * The label for the ok button.
+     */
+    @Parameter(value = "message:private-default-confirm-cancel", defaultPrefix = BindingConstants.LITERAL)
+    private String cancel;
+
     void beginRender(MarkupWriter writer)
     {
         if (!disabled)
@@ -61,7 +73,9 @@ public class Confirm
             javaScriptSupport.require("t5/core/confirm-click");
 
             writer.attributes("data-confirm-title", title,
-                    "data-confirm-message", message);
+                    "data-confirm-message", message,
+                    "data-confirm-label-ok", ok,
+                    "data-confirm-label-cancel", cancel);
         }
     }
 }

http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/20d7d83d/tapestry-core/src/main/resources/org/apache/tapestry5/core.properties
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/core.properties b/tapestry-core/src/main/resources/org/apache/tapestry5/core.properties
index 2601000..17281ca 100644
--- a/tapestry-core/src/main/resources/org/apache/tapestry5/core.properties
+++ b/tapestry-core/src/main/resources/org/apache/tapestry5/core.properties
@@ -125,9 +125,11 @@ private-core-alerts-show-dismiss-all=true
 
 private-default-confirm-message=Are you sure you want to continue?
 private-default-confirm-title=Confirm
+private-default-confirm-ok=Ok
+private-default-confirm-cancel=Cancel
 
 # See the LocalDate component
 private-default-localdate-format=lll
 
 # see ComponentLibraries page
-not-informed=Not informed
\ No newline at end of file
+not-informed=Not informed


Mime
View raw message