Rename modules from "bootstrap-xxx" to "bootstrap/xxx", which is more natural Several other updates related to conversion from Bootstrap 2 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/f3993acb Tree: http://git-wip-us.apache.org/repos/asf/tapestry-5/tree/f3993acb Diff: http://git-wip-us.apache.org/repos/asf/tapestry-5/diff/f3993acb Branch: refs/heads/master Commit: f3993acb01721176b470d95c6f91f0c6e596fc56 Parents: 2d41653 Author: Howard M. Lewis Ship <[email protected]> Authored: Wed Sep 4 15:46:48 2013 -0700 Committer: Howard M. Lewis Ship <[email protected]> Committed: Wed Sep 4 15:46:48 2013 -0700 ---------------------------------------------------------------------- 54_RELEASE_NOTES.txt | 14 ++++--- .../META-INF/modules/t5/core/events.coffee | 8 ++-- .../META-INF/modules/t5/core/fields.coffee | 2 +- .../tapestry5/corelib/components/Errors.java | 4 +- .../tapestry5/corelib/mixins/FormGroup.java | 4 +- .../tapestry5/modules/JavaScriptModule.java | 6 +-- .../resources/META-INF/assets/core/Palette.css | 3 +- .../corelib/components/AjaxFormLoop.tml | 7 ++-- .../src/test/app1/DateFieldAjaxFormLoop.tml | 16 ++++---- .../src/test/app1/FormInjectorDemo.tml | 16 ++++---- tapestry-core/src/test/app1/PaletteDemo.tml | 39 ++++++++----------- .../integration/app1/components/Border.java | 2 +- .../integration/app1/pages/ValidForm.tml | 40 +++++++------------- .../t5/webresources/components/Layout.groovy | 2 +- 14 files changed, 71 insertions(+), 92 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f3993acb/54_RELEASE_NOTES.txt ---------------------------------------------------------------------- diff --git a/54_RELEASE_NOTES.txt b/54_RELEASE_NOTES.txt index c0416f2..0b05bd4 100644 --- a/54_RELEASE_NOTES.txt +++ b/54_RELEASE_NOTES.txt @@ -196,21 +196,25 @@ http://getbootstrap.com/css/#forms You may also use the new FormGroup mixin for most fields. +Bootstrap's JavaScript has been broken into multiple "shimmed" JavaScript modules; e.g., "bootstrap/modal" to +enable the JavaScript to support Bootstrap's modal dialogs. These modules do not export any value, but they +do establish dependencies: to Bootstrap's "transition" module to enable animations, and ultimately to "jquery". + ## Form element components TextField, PasswordField, TextArea, and Select now render the CSS class attribute "form-control"; you may add additional -CSS class names with the `class` informal parameter. Generally, you will want to add Bootstrap `col-md-x` class names -to control the size of the element (otherwise it will stretch to 100% of the available width). +CSS class names with the `class` informal parameter. Generally, you will want to add an enclosing element with +`col-md-x` CSS class control the size of the element (otherwise it will stretch to 100% of the available width). ## LabelComponent -The Label component now renders the CSS class attribute as "control-label"; additional CSS class names may be provided -using the `class` informal parameter. +The Label component now renders the CSS class attribute as "control-label"; you may add additional CSS class names +with the `class` informal parameter. ## BeanEditor / BeanEditForm The property edit blocks contributed to the BeanBlockSource service should expect to be nested inside a -div.control-group, which is provided around the editor for each property. +div.form-group, which is provided around the editor for each property. ## ClientBehaviorSupport http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f3993acb/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/events.coffee ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/events.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/events.coffee index 684c51c..7a8aa55 100644 --- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/events.coffee +++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/events.coffee @@ -99,13 +99,13 @@ define # Clears and hides the element used to display validation error messages. There is no memo for # this event. The p.help-block for the field is located (if it exists) and empties and hidden. - # The containing .control-group element (if it exists) has its "error" class name removed. + # The containing .form-group element (if it exists) has its "has-error" class name removed. clearValidationError: "t5:field:clear-validation-error" # Presents a validation error for a field. The event memo should have a `message` key; the message to present # (as a string, or even as a detached DOM element). The help block for the field will be located or created, - # made visible, and have its content updated to `memo.message`. If a containing element has the class ".control-group", - # then the class "error" will be added. + # made visible, and have its content updated to `memo.message`. If a containing element has the class ".form-group", + # then the class "has-error" will be added. # # The rules for locating the help block: # @@ -120,7 +120,7 @@ define # # * The element is created as `p.help-block` with `data-error-block-for` attribute set to the # field's id. The field will be assigned an id if necesary. - # * Normally, the block is inserted after the field + # * Normally, the block is inserted immediately after the field # * If the field's immediate container has class "input-group", then the block is inserted after the container showValidationError: "t5:field:show-validation-error" http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f3993acb/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/fields.coffee ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/fields.coffee b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/fields.coffee index d89a49c..8930754 100644 --- a/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/fields.coffee +++ b/tapestry-core/src/main/coffeescript/META-INF/modules/t5/core/fields.coffee @@ -48,7 +48,7 @@ define ["underscore", "./events", "./dom", "./utils", "./forms"], fieldId = ensureFieldId field # Not found by id, but see if an empty placeholder was provided within - # the same .control-group. + # the same .form-group. group = field.findParent ".form-group" http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f3993acb/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.java index 3861701..5138fce 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/components/Errors.java @@ -32,7 +32,7 @@ import java.util.List; * @tapestrydoc * @see Form */ -@Import(module = "bootstrap-alert") +@Import(module = "bootstrap/alert") public class Errors { /** @@ -47,7 +47,7 @@ public class Errors * The CSS class for the div element rendered by the component. The default value is "alert alert-error alert-block". */ @Parameter(name = "class") - private String className = "alert alert-error"; + private String className = "alert alert-danger"; // Allow null so we can generate a better error message if missing @Environmental(false) http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f3993acb/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/FormGroup.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/FormGroup.java b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/FormGroup.java index 2f86675..d75d046 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/FormGroup.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/corelib/mixins/FormGroup.java @@ -25,9 +25,7 @@ import org.apache.tapestry5.dom.Element; /** * Applied to a {@link org.apache.tapestry5.Field}, this provides the outer layers of markup to correctly * render text fields, selects, and textareas using Bootstrap: - * an outer {@code <div class="field-group">}, a {@code <label>}, and a - * {@code <div class="controls">} around the field itself. This control is not appropriate - * for radio buttons or check boxes, as those want to have the label element directly around the control. + * an outer {@code <div class="field-group">} containing a {@code <label class="control-label">} and the field itself. * As with the {@link org.apache.tapestry5.corelib.components.Label} component, the {@code for} attribute is set (after the field itself * renders). * <p/> http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f3993acb/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java b/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java index 79ca7d9..bd09290 100644 --- a/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java +++ b/tapestry-core/src/main/java/org/apache/tapestry5/modules/JavaScriptModule.java @@ -245,7 +245,7 @@ public class JavaScriptModule configuration.add("jquery", new JavaScriptModuleConfiguration(jqueryShim)); configuration.add("prototype", new JavaScriptModuleConfiguration(prototype)); - configuration.add("bootstrap-transition", new JavaScriptModuleConfiguration(transition).dependsOn("jquery")); + configuration.add("bootstrap/transition", new JavaScriptModuleConfiguration(transition).dependsOn("jquery")); for (String name : new String[]{"affix", "alert", "button", "carousel", "collapse", "dropdown", "modal", "scrollspy", "tab", "tooltip"}) @@ -253,12 +253,12 @@ public class JavaScriptModule Resource lib = transition.forFile(name + ".js"); - configuration.add("bootstrap-" + name, new JavaScriptModuleConfiguration(lib).dependsOn("bootstrap-transition")); + configuration.add("bootstrap/" + name, new JavaScriptModuleConfiguration(lib).dependsOn("bootstrap/transition")); } Resource popover = transition.forFile("popover.js"); - configuration.add("bootstrap-popover", new JavaScriptModuleConfiguration(popover).dependsOn("bootstrap-tooltip")); + configuration.add("bootstrap/popover", new JavaScriptModuleConfiguration(popover).dependsOn("bootstrap/tooltip")); configuration.add("t5/core/typeahead", new JavaScriptModuleConfiguration(typeahead).dependsOn("jquery")); http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f3993acb/tapestry-core/src/main/resources/META-INF/assets/core/Palette.css ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/resources/META-INF/assets/core/Palette.css b/tapestry-core/src/main/resources/META-INF/assets/core/Palette.css index fad5e15..75d7283 100644 --- a/tapestry-core/src/main/resources/META-INF/assets/core/Palette.css +++ b/tapestry-core/src/main/resources/META-INF/assets/core/Palette.css @@ -1,5 +1,6 @@ DIV.palette { - display: inline; + display: inline-block; + vertical-align: text-top; } DIV.palette SELECT { http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f3993acb/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/AjaxFormLoop.tml ---------------------------------------------------------------------- diff --git a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/AjaxFormLoop.tml b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/AjaxFormLoop.tml index 7f08c26..b34c1d7 100644 --- a/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/AjaxFormLoop.tml +++ b/tapestry-core/src/main/resources/org/apache/tapestry5/corelib/components/AjaxFormLoop.tml @@ -15,9 +15,10 @@ </t:block> <t:block id="defaultAddRow"> - <div class="controls"> - <t:addrowlink class="btn"><i class="icon-plus-sign"/> Add row</t:addrowlink> - </div> + <t:addrowlink class="btn btn-default btn-sm"> + <t:glyphicon name="plus-sign"/> + Add row + </t:addrowlink> </t:block> <t:block id="ajaxResponse"> http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f3993acb/tapestry-core/src/test/app1/DateFieldAjaxFormLoop.tml ---------------------------------------------------------------------- diff --git a/tapestry-core/src/test/app1/DateFieldAjaxFormLoop.tml b/tapestry-core/src/test/app1/DateFieldAjaxFormLoop.tml index f02ef58..f7f53db 100644 --- a/tapestry-core/src/test/app1/DateFieldAjaxFormLoop.tml +++ b/tapestry-core/src/test/app1/DateFieldAjaxFormLoop.tml @@ -5,18 +5,16 @@ <t:form class="form-horizontal"> <div t:type="ajaxformloop" t:id="loop" source="dateHolders" value="current" encoder="dateHolderEncoder" - class="control-group"> - - <div class="controls"> - <t:datefield value="current.date"/> - <t:removerowlink class="btn btn-warning btn-mini"><i class="icon-minus-sign"/> Remove</t:removerowlink> - </div> + class="form-group"> + <t:datefield value="current.date"/> + <t:removerowlink class="btn btn-warning btn-mini"> + <t:glyphicon name="minus-sign"/> + Remove + </t:removerowlink> </div> - <div class="form-actions"> - <input type="submit" value="Go" class="btn btn-primary"/> - </div> + <input type="submit" value="Go" class="btn btn-primary"/> </t:form> http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f3993acb/tapestry-core/src/test/app1/FormInjectorDemo.tml ---------------------------------------------------------------------- diff --git a/tapestry-core/src/test/app1/FormInjectorDemo.tml b/tapestry-core/src/test/app1/FormInjectorDemo.tml index 99ab2e9..1a23729 100644 --- a/tapestry-core/src/test/app1/FormInjectorDemo.tml +++ b/tapestry-core/src/test/app1/FormInjectorDemo.tml @@ -8,24 +8,22 @@ encoder="doubleItemEncoder" context="demoContextValue"> <t:submitnotifier> - <div class="control-group"> - <div class="controls"> - <div class="input-append"> - <t:textfield t:id="value" value="item.value"/> - <t:removerowlink class="btn btn-warning addon">remove</t:removerowlink> + <div class="form-group"> + <div class="input-group"> + <t:textfield t:id="value" value="item.value"/> + <div class="input-group-addon"> + <t:removerowlink class="btn btn-warning btn-xs">remove</t:removerowlink> </div> </div> </div> </t:submitnotifier> <t:parameter name="addRow"> - <t:addrowlink class="btn btn-mini">Add another value</t:addrowlink> + <t:addrowlink class="btn btn-default btn-xs">Add another value</t:addrowlink> </t:parameter> </div> - <div class="form-actions"> - <input type="submit" class="btn btn-primary" value="Sum up the values"/> - </div> + <input type="submit" class="btn btn-primary" value="Sum up the values"/> </t:form> http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f3993acb/tapestry-core/src/test/app1/PaletteDemo.tml ---------------------------------------------------------------------- diff --git a/tapestry-core/src/test/app1/PaletteDemo.tml b/tapestry-core/src/test/app1/PaletteDemo.tml index 4d06d78..b0ca8b4 100644 --- a/tapestry-core/src/test/app1/PaletteDemo.tml +++ b/tapestry-core/src/test/app1/PaletteDemo.tml @@ -4,38 +4,29 @@ <t:form t:id="demo" class="form-horizontal"> - <div class="control-group"> - <div class="controls"> - - <label class="checkbox"> - <t:checkbox t:id="reorder"/> - Enable Reorder - </label> - </div> - + <div class="checkbox"> + <label> + <t:checkbox t:id="reorder"/> + Enable Reorder + </label> </div> - <div class="control-group"> + <div class="form-group"> <t:label for="languages"/> - <div class="controls"> - - <t:palette t:id="languages" model="languageModel" reorder="reorder" encoder="languageEncoder" - availableLabel="Languages Offered" validate="required"> - <t:parameter name="selectedLabel" xml:space="default"> - <t:if test="reorder" else="Selected">Ranked - </t:if> - Languages - </t:parameter> - </t:palette> - </div> + <t:palette t:id="languages" model="languageModel" reorder="reorder" encoder="languageEncoder" + availableLabel="Languages Offered" validate="required"> + <t:parameter name="selectedLabel" xml:space="default"> + <t:if test="reorder" else="Selected">Ranked + </t:if> + Languages + </t:parameter> + </t:palette> </div> - <div class="form-actions"> - <input type="submit" class="btn btn-primary"/> - </div> + <input type="submit" class="btn btn-primary"/> </t:form> http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f3993acb/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java ---------------------------------------------------------------------- diff --git a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java index b76bb2e..404f46c 100644 --- a/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java +++ b/tapestry-core/src/test/java/org/apache/tapestry5/integration/app1/components/Border.java @@ -24,7 +24,7 @@ import org.apache.tapestry5.services.Request; * Here's a component with a template, including a t:body element. Really should rename this to "Layout" as that's the * T5 naming. */ -@Import(stylesheet = "context:css/app.css", module = "bootstrap-collapse") +@Import(stylesheet = "context:css/app.css", module = "bootstrap/collapse") public class Border { @Inject http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f3993acb/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/ValidForm.tml ---------------------------------------------------------------------- diff --git a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/ValidForm.tml b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/ValidForm.tml index 7a29179..a81c1d8 100644 --- a/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/ValidForm.tml +++ b/tapestry-core/src/test/resources/org/apache/tapestry5/integration/app1/pages/ValidForm.tml @@ -5,39 +5,27 @@ <t:form clientValidation="none" class="form-horizontal"> <t:errors/> - <div class="control-group"> + <div class="form-group"> <t:label for="email">This isn't used</t:label> - <div class="controls"> - <input t:type="TextField" t:id="email" - value="incident.email" size="50" t:validate="required"/> - </div> + <input t:type="TextField" t:id="email" + value="incident.email" size="50" t:validate="required"/> </div> - <div class="control-group"> + <div class="form-group"> <t:label for="message"/> - <div class="controls"> - <textarea t:type="TextArea" t:id="message" - t:label="Incident Message" value="incident.message" cols="50" rows="10"> You can put text - here, but it isn't used. </textarea> - - </div> + <textarea t:type="TextArea" t:id="message" + t:label="Incident Message" value="incident.message" cols="50" rows="10"> You can put text + here, but it isn't used. </textarea> </div> - <div class="control-group"> - <div class="controls"> - <input t:type="Checkbox" t:id="urgent" value="incident.urgent"/> - <t:label for="urgent"/> - </div> + <div class="form-group"> + <input t:type="Checkbox" t:id="urgent" value="incident.urgent"/> + <t:label for="urgent"/> </div> - <div class="control-group"> + <div class="form-group"> <t:label for="hours"/> - <div class="controls"> - <input t:type="TextField" t:id="hours" - value="incident.hours" size="10" t:validate="required"/> - - </div> - </div> - <div class="form-actions"> - <input type="submit" class="btn btn-primary"/> + <input t:type="TextField" t:id="hours" + value="incident.hours" size="10" t:validate="required"/> </div> + <input type="submit" class="btn btn-primary"/> </t:form> http://git-wip-us.apache.org/repos/asf/tapestry-5/blob/f3993acb/tapestry-webresources/src/test/groovy/t5/webresources/components/Layout.groovy ---------------------------------------------------------------------- diff --git a/tapestry-webresources/src/test/groovy/t5/webresources/components/Layout.groovy b/tapestry-webresources/src/test/groovy/t5/webresources/components/Layout.groovy index d2d6493..fd57ba3 100644 --- a/tapestry-webresources/src/test/groovy/t5/webresources/components/Layout.groovy +++ b/tapestry-webresources/src/test/groovy/t5/webresources/components/Layout.groovy @@ -4,7 +4,7 @@ import org.apache.tapestry5.annotations.Import import org.apache.tapestry5.ioc.annotations.Inject import org.apache.tapestry5.services.ComponentClassResolver -@Import(stack="core", module = "bootstrap-dropdown") +@Import(stack="core", module = "bootstrap/dropdown") class Layout { @Inject
