-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'drmartin/ss4'
# Conflicts: # .editorconfig # code-of-conduct.md # composer.json # src/Fields/SliderField.php
- Loading branch information
Showing
19 changed files
with
14,002 additions
and
107 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
comment: false |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/node_modules/ | ||
/**/*.js.map | ||
/**/*.css.map |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
<?php | ||
|
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 |
---|---|---|
@@ -1,6 +1,6 @@ | ||
--- | ||
Name: sliderfieldconfig | ||
--- | ||
SliderField: | ||
TractorCow\SliderField\SliderField: | ||
default_minimum: 0 | ||
default_maximum: 100 |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 @@ | ||
.ui-slider-range{padding:0}.slide-controller{margin:5px;max-width:500px} |
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,45 @@ | ||
|
||
import jQuery from 'jquery'; | ||
|
||
jQuery.entwine('ss', ($) => { | ||
$('input.slider').entwine({ | ||
getMin() { | ||
return this.data('min'); | ||
}, | ||
getMax() { | ||
return this.data('max'); | ||
}, | ||
getOrientation() { | ||
return this.data('orientation'); | ||
}, | ||
limitValue() { | ||
let val = parseInt(this.val(), 10); | ||
if (isNaN(val)) val = 0; | ||
val = Math.max(this.getMin(), Math.min(this.getMax(), val)); | ||
this.val(val); | ||
return val; | ||
}, | ||
onmatch() { | ||
const _that = this; | ||
const val = _that.limitValue(); | ||
// setup slider controller | ||
$("<div class='slide-controller'></div>") | ||
.insertAfter(this) | ||
.slider({ | ||
orientation: _that.getOrientation(), | ||
range: 'min', | ||
value: val, | ||
min: _that.getMin(), | ||
max: _that.getMax(), | ||
slide: (event, ui) => { | ||
_that.val(ui.value); | ||
} | ||
}); | ||
}, | ||
onchange() { | ||
this | ||
.siblings('.slide-controller') | ||
.slider('value', this.limitValue()); | ||
} | ||
}); | ||
}); |
0
css/SliderField.css → client/src/styles/sliderfield.scss
100644 → 100755
File renamed without changes.
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 @@ | ||
comment: false |
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 |
---|---|---|
@@ -1,26 +1,37 @@ | ||
{ | ||
"name": "tractorcow/silverstripe-sliderfield", | ||
"description": "Simple slider field for Silverstripe", | ||
"type": "silverstripe-module", | ||
"keywords": ["silverstripe", "slider", "jqueryui"], | ||
"license": "BSD-3-Clause", | ||
"authors": [ | ||
{ | ||
"name": "Damian Mooyman", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"support": { | ||
"issues": "https://github.com/tractorcow/silverstripe-sliderfield/issues" | ||
}, | ||
"require": { | ||
"silverstripe/framework": "3.*", | ||
"composer/installers": "*" | ||
}, | ||
"extra": { | ||
"installer-name": "sliderfield", | ||
"name": "tractorcow/silverstripe-sliderfield", | ||
"description": "Simple slider field for Silverstripe", | ||
"type": "silverstripe-vendormodule", | ||
"keywords": [ | ||
"silverstripe", | ||
"slider", | ||
"jqueryui" | ||
], | ||
"license": "BSD-3-Clause", | ||
"authors": [ | ||
{ | ||
"name": "Damian Mooyman", | ||
"email": "[email protected]" | ||
} | ||
], | ||
"support": { | ||
"issues": "https://github.com/tractorcow/silverstripe-sliderfield/issues" | ||
}, | ||
"require": { | ||
"silverstripe/vendor-plugin": "^1.0", | ||
"silverstripe/cms": "^4.0" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
"TractorCow\\Sliderfield\\": "src/" | ||
} | ||
}, | ||
"extra": { | ||
"branch-alias": { | ||
"dev-master": "4.x-dev" | ||
} | ||
}, | ||
"expose": [ | ||
"client/dist" | ||
] | ||
} | ||
} |
This file was deleted.
Oops, something went wrong.
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,12 @@ | ||
Copyright (c) 2016, Damian Mooyman | ||
All rights reserved. | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
Oops, something went wrong.