You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tapestry.apache.org by hl...@apache.org on 2013/09/04 02:23:56 UTC
git commit: TAP5-2163: Adapt DateField style to Bootstrap 3
Updated Branches:
refs/heads/master 3ae1187eb -> 2cef4982e
TAP5-2163: Adapt DateField style to Bootstrap 3
Project: http://git-wip-us.apache.org/repos/asf/tapestry-5/repo
Commit: http://git-wip-us.apache.org/repos/asf/tapestry-5/commit/2cef4982
Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/2cef4982
Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/2cef4982
Branch: refs/heads/master
Commit: 2cef4982e017acaf3e6e0fc774db5fc19e49ca03
Parents: 3ae1187
Author: Howard M. Lewis Ship <hl...@apache.org>
Authored: Tue Sep 3 17:23:44 2013 -0700
Committer: Howard M. Lewis Ship <hl...@apache.org>
Committed: Tue Sep 3 17:23:44 2013 -0700
----------------------------------------------------------------------
.../META-INF/modules/t5/core/datefield.coffee | 4 +--
.../tapestry5/corelib/components/DateField.java | 2 +-
.../tapestry5/datepicker_106/css/datepicker.css | 36 ++------------------
.../tapestry5/datepicker_106/js/datepicker.js | 16 ++++++---
.../META-INF/assets/tapestry5/tapestry.css | 2 +-
5 files changed, 19 insertions(+), 41 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2cef4982/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/datefield.coffee
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/datefield.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/datefield.coffee
index a1b1bfd..20a9782 100644
--- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/datefield.coffee
+++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/datefield.coffee
@@ -114,7 +114,7 @@ define ["./dom", "./events", "./messages", "./ajax", "underscore", "./fields"],
createPopup: ->
@datePicker = new DatePicker()
@datePicker.setFirstWeekDay datePickerFirstDay
- @popup = dom.create("div", { class: "datefield-popup"}).append @datePicker.create()
+ @popup = dom.create("div", { class: "datefield-popup well"}).append @datePicker.create()
@container.insertAfter @popup
@datePicker.onselect = _.bind @onSelect, this
@@ -160,4 +160,4 @@ define ["./dom", "./events", "./messages", "./ajax", "underscore", "./fields"],
dom.onDocument events.zone.didUpdate, -> scan this
# Exports nothing.
- return null
\ No newline at end of file
+ return null
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2cef4982/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/DateField.java
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/DateField.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/DateField.java
index 99676de..96db67d 100644
--- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/DateField.java
+++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/DateField.java
@@ -246,7 +246,7 @@ public class DateField extends AbstractField
writer.element("button",
"type", "button",
- "class", "btn",
+ "class", "btn btn-default",
"alt", "[Show]");
writer.element("span", "class", "glyphicon glyphicon-calendar");
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2cef4982/tapestry-core/src/main/resources/META-INF/assets/tapestry5/datepicker_106/css/datepicker.css
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/META-INF/assets/tapestry5/datepicker_106/css/datepicker.css b/tapestry-core/src/main/resources/META-INF/assets/tapestry5/datepicker_106/css/datepicker.css
index fb4cdaf..46794b8 100644
--- a/tapestry-core/src/main/resources/META-INF/assets/tapestry5/datepicker_106/css/datepicker.css
+++ b/tapestry-core/src/main/resources/META-INF/assets/tapestry5/datepicker_106/css/datepicker.css
@@ -1,8 +1,5 @@
.datePicker {
- border: 1px solid WindowText;
- background: Window;
- width: 170px;
- padding: 0px;
+ width: 180px;
cursor: default;
-moz-user-focus: normal;
}
@@ -11,7 +8,6 @@
font: smallcaption;
font: small-caption;
text-align: center;
- color: WindowText;
cursor: default;
font-weight: normal !important;
-moz-user-select: none;
@@ -23,7 +19,6 @@
}
.datePicker .header {
- background: Window;
padding: 3px;
border-bottom: 1px solid WindowText;
}
@@ -90,35 +85,10 @@
width: 100%;
}
-.datePicker button {
- border-width: 1px;
- font: Caption;
- font-weight: normal !important;
- display: block;
-}
-
-.datePicker button.btn {
- font-size: x-small;
-}
-
-.datePicker .previousButton {
- background: buttonface url("../images/arrow.left.png") no-repeat center center;
-}
-
-.datePicker .nextButton {
- background: buttonface url("../images/arrow.right.png") no-repeat center center;
-}
-
-.datePicker .previousButton,
-.datePicker .nextButton {
- width: 14px;
- height: 14px;
-}
-
.datePicker .labelPopup {
position: absolute;
min-width: 130px;
- background: Window;
+ background: white;
border: 1px solid WindowText;
padding: 1px;
}
@@ -126,7 +96,7 @@
.datePicker .labelPopup a {
width: 100%;
display: block;
- color: WindowText;
+ color: inherit;
text-decoration: none;
white-space: nowrap;
}
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2cef4982/tapestry-core/src/main/resources/META-INF/assets/tapestry5/datepicker_106/js/datepicker.js
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/META-INF/assets/tapestry5/datepicker_106/js/datepicker.js b/tapestry-core/src/main/resources/META-INF/assets/tapestry5/datepicker_106/js/datepicker.js
index eeec75a..a0b6321 100644
--- a/tapestry-core/src/main/resources/META-INF/assets/tapestry5/datepicker_106/js/datepicker.js
+++ b/tapestry-core/src/main/resources/META-INF/assets/tapestry5/datepicker_106/js/datepicker.js
@@ -49,6 +49,7 @@
| | onselect when clicking "today" (and/or "none") |
| 2012-11-11 | Minor changes to integrate into a page with Twitter Bootstrap, |
| | and to support localizing the Today/None buttons. |
+| 2013-08-29 | More changes to adapt to Bootstrap 3 style |
|-----------------------------------------------------------------------------|
| Created 2001-10-?? | All changes are in the log above. | Updated 2006-05-28 |
\----------------------------------------------------------------------------*/
@@ -141,8 +142,11 @@ DatePicker.prototype.create = function (doc)
var td = doc.createElement("td");
this._previousMonth = doc.createElement("button");
- this._previousMonth.className = "previousButton";
+ this._previousMonth.className = "btn btn-default btn-xs previousButton";
this._previousMonth.setAttribute("type", "button");
+ var icon = doc.createElement("span");
+ icon.className = "glyphicon glyphicon-chevron-left";
+ this._previousMonth.appendChild(icon);
td.appendChild(this._previousMonth);
tr.appendChild(td);
@@ -162,8 +166,12 @@ DatePicker.prototype.create = function (doc)
td = doc.createElement("td");
this._nextMonth = doc.createElement("button");
- this._nextMonth.className = "nextButton";
+ this._nextMonth.className = "btn btn-default btn-xs nextButton";
this._nextMonth.setAttribute("type", "button");
+ icon = doc.createElement("span");
+ icon.className = "glyphicon glyphicon-chevron-right";
+ this._nextMonth.appendChild(icon);
+
td.appendChild(this._nextMonth);
tr.appendChild(td);
@@ -191,7 +199,7 @@ DatePicker.prototype.create = function (doc)
td = doc.createElement("td");
this._todayButton = doc.createElement("button");
- this._todayButton.className = "btn";
+ this._todayButton.className = "btn btn-default btn-xs";
this._todayButton.setAttribute("type", "button");
this._todayButton.appendChild(doc.createTextNode(DatePicker.TODAY));
td.appendChild(this._todayButton);
@@ -204,7 +212,7 @@ DatePicker.prototype.create = function (doc)
td = doc.createElement("td");
this._noneButton = doc.createElement("button");
- this._noneButton.className = "btn";
+ this._noneButton.className = "btn btn-default btn-xs";
this._noneButton.setAttribute("type", "button");
this._noneButton.appendChild(doc.createTextNode(DatePicker.NONE));
td.appendChild(this._noneButton);
http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/2cef4982/tapestry-core/src/main/resources/META-INF/assets/tapestry5/tapestry.css
----------------------------------------------------------------------
diff --git a/tapestry-core/src/main/resources/META-INF/assets/tapestry5/tapestry.css b/tapestry-core/src/main/resources/META-INF/assets/tapestry5/tapestry.css
index 373beae..ed89c9d 100644
--- a/tapestry-core/src/main/resources/META-INF/assets/tapestry5/tapestry.css
+++ b/tapestry-core/src/main/resources/META-INF/assets/tapestry5/tapestry.css
@@ -24,7 +24,7 @@ th[data-grid-column-sort=descending] a {
/* Some support for the built-in DateField component. */
-div.datefield-popup {
+div.datefield-popup.well {
position: absolute;
z-index: 1000;
margin-top: 2px;