Swapped out tagsManager with selectivity for licensing purposes
Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/d5805c42 Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/d5805c42 Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/d5805c42 Branch: refs/heads/blur-0.2.4-parcel Commit: d5805c422efeb57eb2bcb1c4370865f7bd61a1e9 Parents: 6f0523a Author: Chris Rohr <rohr.ch...@gmail.com> Authored: Wed Jul 29 19:38:30 2015 -0400 Committer: Chris Rohr <rohr.ch...@gmail.com> Committed: Wed Jul 29 19:38:30 2015 -0400 ---------------------------------------------------------------------- LICENSE | 16 +- blur-console/src/main/webapp/Gruntfile.js | 3 +- .../src/main/webapp/js/blurconsole.facets.js | 17 +- .../src/main/webapp/less/blurconsole.less | 2 +- .../src/main/webapp/less/selectivity-full.css | 214 + .../src/main/webapp/less/tagmanager.less | 195 - .../webapp/libs/selectivity/selectivity-full.js | 4694 ++++++++++++++++++ .../main/webapp/libs/tagmanager/tagmanager.js | 514 -- 8 files changed, 4926 insertions(+), 729 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d5805c42/LICENSE ---------------------------------------------------------------------- diff --git a/LICENSE b/LICENSE index 401ee55..4924c2e 100644 --- a/LICENSE +++ b/LICENSE @@ -200,7 +200,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. - + ========================================================================== The Apache License, Version 2.0 applies to the following libraries: @@ -370,6 +370,13 @@ moment.js ./blur-console/src/main/webapp/libs/moment/moment.js Copyright (c) 2011-2014 Tim Wood, Iskren Chernev, Moment.js contributors +selectivity.js +./blur-console/src/main/webapp/libs/selectivity/selectivity-full.js +./blur-console/src/main/webapp/less/selectivity-full.css +Copyright (c) 2014-2015 Arend van Beelen jr. + (c) 2015 Speakap BV +https://github.com/arendjr/selectivity/blob/master/LICENSE + ========================================================================== The following license applies to the following libraries: d3 ./blur-gui/src/main/webapp/js/d3.v2.js @@ -402,10 +409,3 @@ 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. -=========================================================================== -The following license applies to the following libraries: tagmanager -./blur-console/src/main/webapp/libs/tagmanager/tagmanager.js ---------------------------------------------------------------------------- -Copyright 2012 MaxFavilli.com -Licensed under the Mozilla Public License, Version 2.0 - http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d5805c42/blur-console/src/main/webapp/Gruntfile.js ---------------------------------------------------------------------- diff --git a/blur-console/src/main/webapp/Gruntfile.js b/blur-console/src/main/webapp/Gruntfile.js index 1c6f70c..b3e6eb3 100644 --- a/blur-console/src/main/webapp/Gruntfile.js +++ b/blur-console/src/main/webapp/Gruntfile.js @@ -43,7 +43,7 @@ module.exports = function (grunt) { 'libs/flot/jquery.flot.categories.js', 'libs/flot/jquery.flot.stack.js', 'libs/typeahead/typeahead.jquery.js', - 'libs/tagmanager/tagmanager.js', + 'libs/selectivity/selectivity-full.js', 'libs/moment/moment.js', 'js/blurconsole.js', 'js/*\.js' @@ -203,6 +203,7 @@ module.exports = function (grunt) { main: { files: [ {expand: true, src: ['index.html','img/*','views/*'], dest: 'public/'}, + {expand: true, flatten: true, src: ['less/*.css'], dest: 'public/css'}, {expand: true, flatten: true, src: ['libs/modernizr/modernizr.js'], dest: 'public/js'}, {expand: true, flatten: true, src: ['libs/bootstrap/fonts/*'], dest: 'public/css/fonts'} ] http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d5805c42/blur-console/src/main/webapp/js/blurconsole.facets.js ---------------------------------------------------------------------- diff --git a/blur-console/src/main/webapp/js/blurconsole.facets.js b/blur-console/src/main/webapp/js/blurconsole.facets.js index a512505..4eb9e0f 100644 --- a/blur-console/src/main/webapp/js/blurconsole.facets.js +++ b/blur-console/src/main/webapp/js/blurconsole.facets.js @@ -44,8 +44,9 @@ blurconsole.facets = (function () { + '</div>' + '<div class="col-md-6">' + '<div class="form-group">' - + '<label for="facetTerms">Terms</label>' - + '<input type="text" name="facetTerms" class="form-control tm-input" id="facetTerms" autocomplete="off"/>' + + '<label>Terms</label>' + + '<span id="facetTerms"></span>' + // + '<input type="text" name="facetTerms" class="form-control tm-input" id="facetTerms" autocomplete="off"/>' + '<div class="facetTermList"></div>' + '</div>' + '<div class="form-group">' @@ -101,8 +102,9 @@ blurconsole.facets = (function () { jqueryMap.facetResults = $('.facetResults', jqueryMap.modal); jqueryMap.terms = $('#facetTerms', jqueryMap.modal); - jqueryMap.terms.tagsManager({ - tagsContainer: $('.facetTermList', jqueryMap.modal) + jqueryMap.terms.selectivity({ + inputType: 'Email', + placeholder: 'Enter in terms' }); $('#facetSubmit', jqueryMap.modal).on('click', _runFacetCounts); @@ -142,12 +144,7 @@ blurconsole.facets = (function () { function _runFacetCounts() { var family = jqueryMap.familyChooser.val(); var column = jqueryMap.columnChooser.val(); - var terms = jqueryMap.terms.tagsManager('tags'); - - if (jqueryMap.terms.val()) { - jqueryMap.terms.tagsManager('pushTag', jqueryMap.terms.val()); - terms = jqueryMap.terms.tagsManager('tags'); - } + var terms = jqueryMap.terms.selectivity('value'); if (family && column && terms.length > 0) { $('.facetWarning', jqueryMap.modal).hide(); http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d5805c42/blur-console/src/main/webapp/less/blurconsole.less ---------------------------------------------------------------------- diff --git a/blur-console/src/main/webapp/less/blurconsole.less b/blur-console/src/main/webapp/less/blurconsole.less index 226a549..31c878e 100644 --- a/blur-console/src/main/webapp/less/blurconsole.less +++ b/blur-console/src/main/webapp/less/blurconsole.less @@ -30,4 +30,4 @@ under the License. @import 'blurconsole.queries.less'; @import 'blurconsole.search.less'; @import 'typeahead'; -@import 'tagmanager'; +@import 'selectivity-full.css'; http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d5805c42/blur-console/src/main/webapp/less/selectivity-full.css ---------------------------------------------------------------------- diff --git a/blur-console/src/main/webapp/less/selectivity-full.css b/blur-console/src/main/webapp/less/selectivity-full.css new file mode 100644 index 0000000..a153458 --- /dev/null +++ b/blur-console/src/main/webapp/less/selectivity-full.css @@ -0,0 +1,214 @@ +/** + * All CSS that comes with Selectivity.js can be used as is, or tweaked to your heart's content :) + * + * Please realize though there is no "API contract" regarding styling of CSS classes, meaning that + * any customized CSS made may need to be updated without warning if you want to upgrade the + * Selectivity version you use. You can mitigate this problem by using your own templates instead of + * those defined in selectivity-templates.js, since templates will at the very least continue + * working across patch versions and any changes necessary to templates will be documented in the + * changelog. + */ +.selectivity-clearfix { + clear: both; } + +.selectivity-input { + display: inline-block; + width: 250px; } + .selectivity-input select { + display: none; } + +.selectivity-placeholder { + color: #999; } + +/** + * Backdrop + */ +.selectivity-backdrop { + background: transparent; + position: fixed; + z-index: 9998; + top: 0; + right: 0; + bottom: 0; + left: 0; } + +/** + * Dropdown + */ +.selectivity-dropdown { + background: #fff; + border-radius: 4px; + box-shadow: 0 1px 5px 1px rgba(0, 0, 0, 0.15), 0 10px 16px 0 rgba(0, 0, 0, 0.2); + position: absolute; + z-index: 9999; } + +.selectivity-search-input-container { + border-bottom: 1px solid #eee; } + +.selectivity-search-input { + background: transparent; + border: 0; + outline: 0; + width: 100%; } + +.selectivity-results-container { + max-height: 28em; + overflow: auto; + position: relative; } + +.selectivity-load-more, +.selectivity-result-item { + cursor: pointer; + padding: 7px; } + +.selectivity-result-children .selectivity-result-item { + padding-left: 17px; } + +.selectivity-load-more.highlight, +.selectivity-result-item.highlight { + background: #4484c7; + color: #fff; } + +.selectivity-result-item:first-child { + border-radius: 4px 4px 0 0; } + +.selectivity-dropdown.has-search-input .selectivity-result-item:first-child { + border-radius: 0; } + +.selectivity-result-label { + font-weight: bold; } + +.selectivity-load-more, +.selectivity-result-item:last-child, +.selectivity-result-children:last-child .selectivity-result-item:last-child { + border-radius: 0 0 4px 4px; } + +.selectivity-result-children .selectivity-result-item:last-child { + border-radius: 0; } + +.selectivity-error, +.selectivity-loading, +.selectivity-search-input-container, +.selectivity-result-label { + padding: 7px; } + +/** + * Multi-selection input + */ +.selectivity-multiple-input-container { + background: #eee; + border-radius: 2px; + cursor: text; + max-height: 10em; + min-height: -webkit-calc(2em + 4px); + min-height: calc(2em + 4px); + overflow: auto; + padding: 5px; } + +.selectivity-multiple-input-container .selectivity-placeholder { + height: -webkit-calc(2em + 4px); + height: calc(2em + 4px); + line-height: -webkit-calc(2em + 4px); + line-height: calc(2em + 4px); } + +.selectivity-multiple-input, +input[type='text'].selectivity-multiple-input { + background-color: transparent; + border: none; + float: left; + height: -webkit-calc(2em + 4px); + height: calc(2em + 4px); + max-width: 100%; + outline: 0; + padding: 0; } + .selectivity-multiple-input:focus, + input[type='text'].selectivity-multiple-input:focus { + background-color: transparent; + box-shadow: none; + outline: none; } + +.selectivity-multiple-input::-ms-clear { + display: none; } + +.selectivity-multiple-input.selectivity-width-detector { + position: absolute; + top: -10000px; + left: 0; + white-space: pre; } + +.selectivity-multiple-selected-item { + background: #4484c7; + border-radius: 3px; + color: #fff; + cursor: default; + float: left; + line-height: 2em; + margin: 2px; + padding-right: 5px; + position: relative; + -moz-user-select: none; + -ms-user-select: none; + -webkit-user-select: none; + user-select: none; + white-space: nowrap; } + .selectivity-multiple-selected-item.highlighted { + background-color: #ccc; } + +.selectivity-multiple-selected-item-remove { + color: #fff; + cursor: pointer; + padding: 5px; } + +/** + * Single-selection input + */ +.selectivity-single-select { + background: #eee; + border-radius: 2px; + cursor: pointer; + min-height: 2em; + padding: 5px; + position: relative; + box-sizing: content-box; } + +.selectivity-single-select-input { + opacity: 0; } + +.selectivity-single-result-container { + position: absolute; + top: 0.8em; + right: 15px; + left: 5px; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; } + +.selectivity-single-selected-item { + color: #000; } + +.selectivity-single-selected-item-remove { + color: #000; + float: right; + padding: 0 5px; } + +.selectivity-caret { + position: absolute; + right: 5px; + top: 0.7em; } + +@media only screen and (max-device-width: 480px) { + .selectivity-single-select { + background: #eee; + border-radius: 2px; } + + .selectivity-single-result-container { + right: 5px; } + + .selectivity-caret { + display: none; } } +/** + * Submenu + */ +.selectivity-submenu-icon { + position: absolute; + right: 4px; } http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/d5805c42/blur-console/src/main/webapp/less/tagmanager.less ---------------------------------------------------------------------- diff --git a/blur-console/src/main/webapp/less/tagmanager.less b/blur-console/src/main/webapp/less/tagmanager.less deleted file mode 100644 index 76aad99..0000000 --- a/blur-console/src/main/webapp/less/tagmanager.less +++ /dev/null @@ -1,195 +0,0 @@ -// -// Bootstrap TagManager -// -------------------------------------------------- - -// Tag Variables -// -------------------------------------------------- - -// Colors -// ------------------------- - -@white: #ffffff; -@black: #000000; -@gray: #555555; -@grayDark: #333333; - -@textColor: @grayDark; - -@tagText: @gray; -@tagBackground: #f5f5f5; -@tagBorder: #bbb; - -@tagWarningText: #945203; -@tagWarningBackground: #f2c889; -@tagWarningBorder: #f0a12f; - -@tagErrorText: #84212e; -@tagErrorBackground: #e69ca6; -@tagErrorBorder: #d24a5d; - -@tagSuccessText: #638421; -@tagSuccessBackground: #cde69c; -@tagSuccessBorder: #a5d24a; - -@tagInfoText: #4594b5; -@tagInfoBackground: #c5eefa; -@tagInfoBorder: #5dc8f7; - -@tagInverseText: #ccc; -@tagInverseBackground: @gray; -@tagInverseBorder: @grayDark; - -@tagDisabledText: #aaa; -@tagDisabledBackground: #e6e6e6; -@tagDisabledBorder: #ccc; - -// Sizing -// ------------------------- - -@tagFontSize: 13px; -@tagFontSizeLarge: @tagFontSize * 1.25; // ~16px -@tagFontSizeSmall: @tagFontSize * 0.85; // ~11px -@tagFontSizeMini: @tagFontSize * 0.75; // ~10px - -@tagPadding: 4px; -@tagMargin: 5px; - -@borderRadiusSmall: 3px; -@baseBorderRadius: 4px; - -@baseLineHeight: 20px; - -// Tag Classes -// -------------------------------------------------- - -// Fonts -// -------------------------------------------------- - -@sansFontFamily: "Helvetica Neue", Helvetica, Arial, sans-serif; - -// Base tag class -// ------------------------- - -.tm-tag { - color: @tagText; - background-color: @tagBackground; - border: @tagBorder 1px solid; - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.075) inset; - display: inline-block; - border-radius: @borderRadiusSmall; - font-family: @sansFontFamily; - font-size: @tagFontSize; - margin: 0 @tagMargin @tagMargin 0; - padding: @tagPadding; - text-decoration: none; - transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s; - -moz-transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s; - -webkit-transition: border 0.2s linear 0s, box-shadow 0.2s linear 0s; - vertical-align: middle; - - // Remove button - // ------------------------- - - .tm-tag-remove { - color: @black; - font-weight: bold; - margin-left: @tagPadding; - opacity: 0.2; - &:hover { - color: @black; - text-decoration: none; - opacity: 0.4; - } - } - - // Semantic Colors - // ------------------------- - - &.tm-tag-warning { - color: @tagWarningText; - background-color: @tagWarningBackground; - border-color: @tagWarningBorder; - } - &.tm-tag-error { - color: @tagErrorText; - background-color: @tagErrorBackground; - border-color: @tagErrorBorder; - } - &.tm-tag-success { - color: @tagSuccessText; - background-color: @tagSuccessBackground; - border-color: @tagSuccessBorder; - } - &.tm-tag-info { - color: @tagInfoText; - background-color: @tagInfoBackground; - border-color: @tagInfoBorder; - } - &.tm-tag-inverse { - color: @tagInverseText; - background-color: @tagInverseBackground; - border-color: @tagInverseBorder; - box-shadow: 0 1px 1px rgba(0, 0, 0, 0.2) inset; - .tm-tag-remove { - color: @white; - } - } - - // Sizes - // ------------------------- - - &.tm-tag-large { - font-size: @tagFontSizeLarge; - border-radius: @baseBorderRadius; - padding: 11px 7px; - } - &.tm-tag-small { - font-size: @tagFontSizeSmall; - border-radius: @borderRadiusSmall; - padding: 2px 4px; - } - &.tm-tag-mini { - font-size: @tagFontSizeMini; - border-radius: 2px; - padding: 0px 2px; - } - - // Miscellaneous Styles - // ------------------------- - - &.tm-tag-plain { - color: @textColor; - box-shadow: none; - background: none; - border: none; - } - &.tm-tag-disabled { - color: @tagDisabledText; - background-color: @tagDisabledBackground; - border-color: @tagDisabledBorder; - box-shadow: none; - .tm-tag-remove { - display: none; - } - } -} - -// Forms -// -------------------------------------------------- - -// Input style (Recommended) -// ------------------------- - -input[type="text"].tm-input { - margin-bottom: @tagMargin; -} - -// Form wrappers (Optional) -// ------------------------- - -.control-group.tm-group { - margin-bottom: (@baseLineHeight / 2) - @tagMargin; -} -.form-horizontal .control-group.tm-group { - margin-bottom: @baseLineHeight - @tagMargin; -}