-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1293 from scireum/feature/sbi/OX-10453
Tycho: Adds a color picker input component
- Loading branch information
Showing
7 changed files
with
96 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/main/resources/default/assets/tycho/libs/bootstrap-colorpicker/LICENSE.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
boostrap-colorpicker - MIT License | ||
|
||
Copyright (c) 2017 Javi Aguilar | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
10 changes: 10 additions & 0 deletions
10
...sources/default/assets/tycho/libs/bootstrap-colorpicker/css/bootstrap-colorpicker.min.css
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
10 changes: 10 additions & 0 deletions
10
...resources/default/assets/tycho/libs/bootstrap-colorpicker/js/bootstrap-colorpicker.min.js
Large diffs are not rendered by default.
Oops, something went wrong.
51 changes: 51 additions & 0 deletions
51
src/main/resources/default/taglib/t/colorpicker.html.pasta
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
<i:arg name="class" type="String" default="" description="Lists additional CSS classes to apply to the field."/> | ||
<i:arg name="fieldClass" type="String" default="" description="Lists additional CSS classes to apply to the field."/> | ||
<i:arg name="labelClass" type="String" default="" description="Lists additional CSS classes to apply to the label."/> | ||
<i:arg name="name" type="String" default=""/> | ||
<i:arg name="fieldName" type="String" default="@name"/> | ||
<i:arg name="value" type="String"/> | ||
<i:arg name="labelKey" type="String" default=""/> | ||
<i:arg name="label" type="String" default="@i18n(labelKey)"/> | ||
<i:arg name="forceLabel" type="boolean" default="false"/> | ||
<i:arg name="helpKey" type="String" default=""/> | ||
<i:arg name="help" type="String" default="@i18n(helpKey)"/> | ||
<i:arg name="id" type="String" default="@generateId('colorpicker-%s')"/> | ||
<i:arg name="placeholder" type="String" default=""/> | ||
<i:arg name="tabIndex" type="String" default=""/> | ||
|
||
<i:pragma name="description" value="Renders a color picker within a Tycho template"/> | ||
|
||
<div class="form-group @UserContext.get().signalFieldError(name) @class"> | ||
<i:if test="isFilled(label) || forceLabel"> | ||
<label><span class="@labelClass">@label</span></label> | ||
</i:if> | ||
|
||
<div class="input-group"> | ||
<input @if(isFilled(fieldName)) { name="@fieldName" } | ||
@if(isFilled(id)) { id="@id" } | ||
type="text" | ||
value="@UserContext.get().getFieldValue(name, value)" | ||
class="form-control input-block-level @fieldClass" | ||
@if (isFilled(placeholder)) { placeholder="@placeholder" } | ||
@if (isFilled(tabIndex)) { tabindex="@tabIndex" }/> | ||
<span class="input-group-append"> | ||
<span class="input-group-text colorpicker-input-addon"><i></i></span> | ||
</span> | ||
</div> | ||
|
||
<i:if test="isFilled(help)"> | ||
<small class="form-text text-muted"> | ||
<i:raw>@expandMessage(help)</i:raw> | ||
</small> | ||
</i:if> | ||
<i:if test="UserContext.get().hasError(name)"> | ||
<small class="error-block form-text">@UserContext.get().getFieldErrorMessage(name)</small> | ||
</i:if> | ||
<script> | ||
$(function () { | ||
$('#@id').parent().colorpicker({ | ||
format: 'hex' | ||
}); | ||
}); | ||
</script> | ||
</div> |