Skip to content
Browse files

Fixing #25: Adding placeholder option. See for example, but it's pret…

…ty self-explanatory.
  • Loading branch information...
1 parent fe6aa8c commit aa7e38cac4951ccbc506ab0b01485d80f63ca528 @samuelclay samuelclay committed Jan 27, 2013
View
2 build-min/visualsearch-datauri.css
@@ -1 +1 @@
-.VS-search .VS-icon{background-repeat:no-repeat;background-position:center center;vertical-align:middle;width:16px;height:16px}.VS-search .VS-icon-cancel{width:11px;height:11px;background-position:center 0;background-image:url("data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAWCAYAAAAW5GZjAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAb9JREFUeNqUUr1qAkEQ3j0khQp6kihaeGgEEa18gTQR0iRY+BaBSMDGwidIEUKqFL6BopgqBAJ5AMFGjUU0d4WHEvwJarvZ77gRIzGYgb1hZr+Z75vZ40IIzqTNZrPj8Xicn0wmmcViEXS73aaqqq+BQODG6/W+A8MBNk3zfDAY3C6Xy0O2ZS6X6zMSiVwHg8FHLjtq7Xb7RQKj7BeTzVCgJ5PJU2U0GhUk7REuMpkMi8fjFggeMeecrVYrFRId0CgTAgDDMFg4HLbA8IjJgHNgGEr0er0fQIphUmZAwdSUADUB4RFDsz3oSMF6CLzZkQqgGebz+Z75dDqNdTqdp13bgDmdTj2VSp0oWHg0Gr2UNH2Z/9o+yMv7K4/HY/C/XhDUfr//jl7QQVT9fp/V63VWqVRYt9tliUSCZbPZg1wux9Lp9PqFeK1Wu9A0DdXz7YM87i0FrVZLs4Fi1wmFQh/NZjOmVKvVgq7rR/QflMtlixGedjwcDlUpMQ9tbzalkAAB2/R297mNW+sT2wUbUnA//V/nYrH4QOBNABUQuFQq3TNMuc82sDVrz41G42yvPeODAwZQ0QzwiJEnzLcAAwBJ6WXlwoBgZAAAAABJRU5ErkJggg==");cursor:pointer}.VS-search .VS-icon-cancel:hover{background-position:center -11px}.VS-search .VS-icon-search{width:12px;height:12px;background-image:url("data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAUZJREFUeNpUUM2qgmAQzS8NiUgLzTIXLZQW1QuI9AY9QPSW9gQ9QiriwpJQEBVrVWT2d7p2L9xZzDdzZs7M+YYqy/J8Ptu2vd/v4zgeDAaqqk4mE47jar9GnU6nzWbjOA5FUa/Xq0Jns9l8Pud5vkpp58cwAOzhcBhFkeu6GNztdg3D+Db5vo9nOp2iiWGYTqdDCMFe4LquI0aVpGmKR9M0lmUbjQY8YiBJklTb4YkoilBzOBzq9TogeMQIJEmqmlAlo9EIyXa7tSyrKAp4xEBkWUb5q2k8Hh+PR8/zwjCEgufz+aESstvtoKnVan2GgY31kBkEAfT1ej1FUZDiNIIgrFYr9H1ug3teLpfH43G/3/FBUJGu1+s8z8FZLpc0mmiabrfbf5fEumazuVgsTNO8Xq+3242qRNT+G0CMz7IMzH6//xZgAA60tj6rqzxpAAAAAElFTkSuQmCC")}.VS-search div,.VS-search span,.VS-search a,.VS-search img,.VS-search ul,.VS-search li,.VS-search form,.VS-search label,.VS-interface ul,.VS-interface li,.VS-interface{margin:0;padding:0;border:0;outline:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline}.VS-search :focus{outline:0}.VS-search{line-height:1;color:black}.VS-search ol,.VS-search ul{list-style:none}.VS-search{font-family:Arial,sans-serif;color:#373737;font-size:12px}.VS-search input{display:block;border:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;outline:none;margin:0;padding:4px;background:transparent;font-size:16px;line-height:20px;width:100%}.VS-interface,.VS-search .dialog,.VS-search input{font-family:"Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,sans-serif!important;line-height:1.1em}.VS-search .VS-search-box{cursor:text;position:relative;background:transparent;border:2px solid #ccc;border-radius:16px;-webkit-border-radius:16px;-moz-border-radius:16px;background-color:#fafafa;-webkit-box-shadow:inset 0 0 3px #ccc;-moz-box-shadow:inset 0 0 3px #ccc;box-shadow:inset 0 0 3px #ccc;min-height:28px;height:auto}.VS-search .VS-search-box.VS-focus{border-color:#acf;-webkit-box-shadow:inset 0 0 3px #acf;-moz-box-shadow:inset 0 0 3px #acf;box-shadow:inset 0 0 3px #acf}.VS-search .VS-search-inner{position:relative;margin:0 20px 0 22px;overflow:hidden}.VS-search input{width:100px}.VS-search input,.VS-search .VS-input-width-tester{padding:6px 0;float:left;color:#808080;font:13px/17px Helvetica,Arial}.VS-search.VS-focus input{color:#606060}.VS-search .VS-icon-search{position:absolute;left:9px;top:8px}.VS-search .VS-icon-cancel{position:absolute;right:9px;top:8px}.VS-search .search_facet{float:left;margin:0;padding:0 0 0 14px;position:relative;border:1px solid transparent;height:20px;margin:3px -3px 3px 0}.VS-search .search_facet.is_selected{margin-left:-3px;-webkit-border-radius:16px;-moz-border-radius:16px;border-radius:16px;background-color:#d2e6fd;background-image:-moz-linear-gradient(top,#d2e6fd,#b0d1f9);background-image:-webkit-gradient(linear,left top,left bottom,from(#d2e6fd),to(#b0d1f9));background-image:linear-gradient(top,#d2e6fd,#b0d1f9);border:1px solid #6eadf5}.VS-search .search_facet .category{float:left;text-transform:uppercase;font-weight:bold;font-size:10px;color:#808080;padding:8px 0 5px;line-height:13px;cursor:pointer;padding:4px 0 0}.VS-search .search_facet.is_selected .category{margin-left:3px}.VS-search .search_facet .search_facet_input_container{float:left}.VS-search .search_facet input{margin:0;padding:0;color:#000;font-size:13px;line-height:16px;padding:5px 0 5px 4px;height:16px;width:auto;z-index:100;position:relative;padding-top:1px;padding-bottom:2px;padding-right:3px}.VS-search .search_facet.is_editing input,.VS-search .search_facet.is_selected input{color:#000}.VS-search .search_facet .search_facet_remove{position:absolute;left:0;top:4px}.VS-search .search_facet.is_selected .search_facet_remove{opacity:.4;left:3px;filter:alpha(opacity=40);background-position:center -11px}.VS-search .search_facet .search_facet_remove:hover{opacity:1}.VS-search .search_facet.is_editing .category,.VS-search .search_facet.is_selected .category{color:#000}.VS-search .search_facet.search_facet_maybe_delete .category,.VS-search .search_facet.search_facet_maybe_delete input{color:darkred}.VS-search .search_input{height:28px;float:left;margin-left:-1px}.VS-search .search_input input{padding:6px 3px 6px 2px;line-height:10px;height:22px;margin-top:-4px;width:10px;z-index:100;min-width:4px;position:relative}.VS-search .search_input.is_editing input{color:#202020}.ui-helper-hidden-accessible{display:none}.VS-interface.ui-autocomplete{position:absolute;border:1px solid #c0c0c0;border-top:1px solid #d9d9d9;background-color:#f6f6f6;cursor:pointer;z-index:10000;padding:0;margin:0;width:auto;min-width:80px;max-width:220px;max-height:240px;overflow-y:auto;overflow-x:hidden;font-size:13px;top:5px;opacity:.97;box-shadow:3px 4px 5px -2px rgba(0,0,0,0.5);-webkit-box-shadow:3px 4px 5px -2px rgba(0,0,0,0.5);-moz-box-shadow:3px 4px 5px -2px rgba(0,0,0,0.5)}.VS-interface.ui-autocomplete .ui-autocomplete-category{text-transform:capitalize;font-size:11px;padding:4px 4px 4px;border-top:1px solid #a2a2a2;border-bottom:1px solid #a2a2a2;background-color:#b7b7b7;text-shadow:0 -1px 0 #999;font-weight:bold;color:white;cursor:default}.VS-interface.ui-autocomplete .ui-menu-item{float:none}.VS-interface.ui-autocomplete .ui-menu-item a{color:#000;outline:none;display:block;padding:3px 4px 5px;border-radius:none;line-height:1;background-color:#f8f8f8;background-image:-moz-linear-gradient(top,#f8f8f8,#f3f3f3);background-image:-webkit-gradient(linear,left top,left bottom,from(#f8f8f8),to(#f3f3f3));background-image:linear-gradient(top,#f8f8f8,#f3f3f3);border-top:1px solid #fafafa;border-bottom:1px solid #f0f0f0}.VS-interface.ui-autocomplete .ui-menu-item a:active{outline:none}.VS-interface.ui-autocomplete .ui-menu-item .ui-state-hover,.VS-interface.ui-autocomplete .ui-menu-item .ui-state-focus{background-color:#6483f7;background-image:-moz-linear-gradient(top,#648bf5,#2465f3);background-image:-webkit-gradient(linear,left top,left bottom,from(#648bf5),to(#2465f3));background-image:linear-gradient(top,#648bf5,#2465f3);border-top:1px solid #5b83ec;border-bottom:1px solid #1459e9;border-left:none;border-right:none;color:white;margin:0}.VS-interface.ui-autocomplete .ui-corner-all{border-radius:0}.VS-interface.ui-autocomplete li{list-style:none;width:auto}
+.VS-search .VS-icon{background-repeat:no-repeat;background-position:center center;vertical-align:middle;width:16px;height:16px}.VS-search .VS-icon-cancel{width:11px;height:11px;background-position:center 0;background-image:url("data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAAAsAAAAWCAYAAAAW5GZjAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAb9JREFUeNqUUr1qAkEQ3j0khQp6kihaeGgEEa18gTQR0iRY+BaBSMDGwidIEUKqFL6BopgqBAJ5AMFGjUU0d4WHEvwJarvZ77gRIzGYgb1hZr+Z75vZ40IIzqTNZrPj8Xicn0wmmcViEXS73aaqqq+BQODG6/W+A8MBNk3zfDAY3C6Xy0O2ZS6X6zMSiVwHg8FHLjtq7Xb7RQKj7BeTzVCgJ5PJU2U0GhUk7REuMpkMi8fjFggeMeecrVYrFRId0CgTAgDDMFg4HLbA8IjJgHNgGEr0er0fQIphUmZAwdSUADUB4RFDsz3oSMF6CLzZkQqgGebz+Z75dDqNdTqdp13bgDmdTj2VSp0oWHg0Gr2UNH2Z/9o+yMv7K4/HY/C/XhDUfr//jl7QQVT9fp/V63VWqVRYt9tliUSCZbPZg1wux9Lp9PqFeK1Wu9A0DdXz7YM87i0FrVZLs4Fi1wmFQh/NZjOmVKvVgq7rR/QflMtlixGedjwcDlUpMQ9tbzalkAAB2/R297mNW+sT2wUbUnA//V/nYrH4QOBNABUQuFQq3TNMuc82sDVrz41G42yvPeODAwZQ0QzwiJEnzLcAAwBJ6WXlwoBgZAAAAABJRU5ErkJggg==");cursor:pointer}.VS-search .VS-icon-cancel:hover{background-position:center -11px}.VS-search .VS-icon-search{width:12px;height:12px;background-image:url("data:image/png;charset=utf-8;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAUZJREFUeNpUUM2qgmAQzS8NiUgLzTIXLZQW1QuI9AY9QPSW9gQ9QiriwpJQEBVrVWT2d7p2L9xZzDdzZs7M+YYqy/J8Ptu2vd/v4zgeDAaqqk4mE47jar9GnU6nzWbjOA5FUa/Xq0Jns9l8Pud5vkpp58cwAOzhcBhFkeu6GNztdg3D+Db5vo9nOp2iiWGYTqdDCMFe4LquI0aVpGmKR9M0lmUbjQY8YiBJklTb4YkoilBzOBzq9TogeMQIJEmqmlAlo9EIyXa7tSyrKAp4xEBkWUb5q2k8Hh+PR8/zwjCEgufz+aESstvtoKnVan2GgY31kBkEAfT1ej1FUZDiNIIgrFYr9H1ug3teLpfH43G/3/FBUJGu1+s8z8FZLpc0mmiabrfbf5fEumazuVgsTNO8Xq+3242qRNT+G0CMz7IMzH6//xZgAA60tj6rqzxpAAAAAElFTkSuQmCC")}.VS-search div,.VS-search span,.VS-search a,.VS-search img,.VS-search ul,.VS-search li,.VS-search form,.VS-search label,.VS-interface ul,.VS-interface li,.VS-interface{margin:0;padding:0;border:0;outline:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline}.VS-search :focus{outline:0}.VS-search{line-height:1;color:black}.VS-search ol,.VS-search ul{list-style:none}.VS-search{font-family:Arial,sans-serif;color:#373737;font-size:12px}.VS-search input{display:block;border:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;outline:none;margin:0;padding:4px;background:transparent;font-size:16px;line-height:20px;width:100%}.VS-interface,.VS-search .dialog,.VS-search input{font-family:"Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,sans-serif!important;line-height:1.1em}.VS-search .VS-search-box{cursor:text;position:relative;background:transparent;border:2px solid #ccc;border-radius:16px;-webkit-border-radius:16px;-moz-border-radius:16px;background-color:#fafafa;-webkit-box-shadow:inset 0 0 3px #ccc;-moz-box-shadow:inset 0 0 3px #ccc;box-shadow:inset 0 0 3px #ccc;min-height:28px;height:auto}.VS-search .VS-search-box.VS-focus{border-color:#acf;-webkit-box-shadow:inset 0 0 3px #acf;-moz-box-shadow:inset 0 0 3px #acf;box-shadow:inset 0 0 3px #acf}.VS-search .VS-placeholder{position:relative;margin:0 20px 0 22px;color:#808080}.VS-search .VS-search-box.VS-focus .VS-placeholder{display:none}.VS-search .VS-search-inner{position:relative;margin:0 20px 0 22px;overflow:hidden}.VS-search input{width:100px}.VS-search input,.VS-search .VS-input-width-tester{padding:6px 0;float:left;color:#808080;font:13px/17px Helvetica,Arial}.VS-search.VS-focus input{color:#606060}.VS-search .VS-icon-search{position:absolute;left:9px;top:8px}.VS-search .VS-icon-cancel{position:absolute;right:9px;top:8px}.VS-search .search_facet{float:left;margin:0;padding:0 0 0 14px;position:relative;border:1px solid transparent;height:20px;margin:3px -3px 3px 0}.VS-search .search_facet.is_selected{margin-left:-3px;-webkit-border-radius:16px;-moz-border-radius:16px;border-radius:16px;background-color:#d2e6fd;background-image:-moz-linear-gradient(top,#d2e6fd,#b0d1f9);background-image:-webkit-gradient(linear,left top,left bottom,from(#d2e6fd),to(#b0d1f9));background-image:linear-gradient(top,#d2e6fd,#b0d1f9);border:1px solid #6eadf5}.VS-search .search_facet .category{float:left;text-transform:uppercase;font-weight:bold;font-size:10px;color:#808080;padding:8px 0 5px;line-height:13px;cursor:pointer;padding:4px 0 0}.VS-search .search_facet.is_selected .category{margin-left:3px}.VS-search .search_facet .search_facet_input_container{float:left}.VS-search .search_facet input{margin:0;padding:0;color:#000;font-size:13px;line-height:16px;padding:5px 0 5px 4px;height:16px;width:auto;z-index:100;position:relative;padding-top:1px;padding-bottom:2px;padding-right:3px}.VS-search .search_facet.is_editing input,.VS-search .search_facet.is_selected input{color:#000}.VS-search .search_facet .search_facet_remove{position:absolute;left:0;top:4px}.VS-search .search_facet.is_selected .search_facet_remove{opacity:.4;left:3px;filter:alpha(opacity=40);background-position:center -11px}.VS-search .search_facet .search_facet_remove:hover{opacity:1}.VS-search .search_facet.is_editing .category,.VS-search .search_facet.is_selected .category{color:#000}.VS-search .search_facet.search_facet_maybe_delete .category,.VS-search .search_facet.search_facet_maybe_delete input{color:darkred}.VS-search .search_input{height:28px;float:left;margin-left:-1px}.VS-search .search_input input{padding:6px 3px 6px 2px;line-height:10px;height:22px;margin-top:-4px;width:10px;z-index:100;min-width:4px;position:relative}.VS-search .search_input.is_editing input{color:#202020}.ui-helper-hidden-accessible{display:none}.VS-interface.ui-autocomplete{position:absolute;border:1px solid #c0c0c0;border-top:1px solid #d9d9d9;background-color:#f6f6f6;cursor:pointer;z-index:10000;padding:0;margin:0;width:auto;min-width:80px;max-width:220px;max-height:240px;overflow-y:auto;overflow-x:hidden;font-size:13px;top:5px;opacity:.97;box-shadow:3px 4px 5px -2px rgba(0,0,0,0.5);-webkit-box-shadow:3px 4px 5px -2px rgba(0,0,0,0.5);-moz-box-shadow:3px 4px 5px -2px rgba(0,0,0,0.5)}.VS-interface.ui-autocomplete .ui-autocomplete-category{text-transform:capitalize;font-size:11px;padding:4px 4px 4px;border-top:1px solid #a2a2a2;border-bottom:1px solid #a2a2a2;background-color:#b7b7b7;text-shadow:0 -1px 0 #999;font-weight:bold;color:white;cursor:default}.VS-interface.ui-autocomplete .ui-menu-item{float:none}.VS-interface.ui-autocomplete .ui-menu-item a{color:#000;outline:none;display:block;padding:3px 4px 5px;border-radius:none;line-height:1;background-color:#f8f8f8;background-image:-moz-linear-gradient(top,#f8f8f8,#f3f3f3);background-image:-webkit-gradient(linear,left top,left bottom,from(#f8f8f8),to(#f3f3f3));background-image:linear-gradient(top,#f8f8f8,#f3f3f3);border-top:1px solid #fafafa;border-bottom:1px solid #f0f0f0}.VS-interface.ui-autocomplete .ui-menu-item a:active{outline:none}.VS-interface.ui-autocomplete .ui-menu-item .ui-state-hover,.VS-interface.ui-autocomplete .ui-menu-item .ui-state-focus{background-color:#6483f7;background-image:-moz-linear-gradient(top,#648bf5,#2465f3);background-image:-webkit-gradient(linear,left top,left bottom,from(#648bf5),to(#2465f3));background-image:linear-gradient(top,#648bf5,#2465f3);border-top:1px solid #5b83ec;border-bottom:1px solid #1459e9;border-left:none;border-right:none;color:white;margin:0}.VS-interface.ui-autocomplete .ui-corner-all{border-radius:0}.VS-interface.ui-autocomplete li{list-style:none;width:auto}
View
BIN build-min/visualsearch-datauri.css.gz
Binary file not shown.
View
2 build-min/visualsearch.css
@@ -1 +1 @@
-.VS-search .VS-icon{background-repeat:no-repeat;background-position:center center;vertical-align:middle;width:16px;height:16px}.VS-search .VS-icon-cancel{width:11px;height:11px;background-position:center 0;background-image:url(../images/embed/icons/cancel_search.png?1311104738);cursor:pointer}.VS-search .VS-icon-cancel:hover{background-position:center -11px}.VS-search .VS-icon-search{width:12px;height:12px;background-image:url(../images/embed/icons/search_glyph.png?1311104738)}.VS-search div,.VS-search span,.VS-search a,.VS-search img,.VS-search ul,.VS-search li,.VS-search form,.VS-search label,.VS-interface ul,.VS-interface li,.VS-interface{margin:0;padding:0;border:0;outline:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline}.VS-search :focus{outline:0}.VS-search{line-height:1;color:black}.VS-search ol,.VS-search ul{list-style:none}.VS-search{font-family:Arial,sans-serif;color:#373737;font-size:12px}.VS-search input{display:block;border:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;outline:none;margin:0;padding:4px;background:transparent;font-size:16px;line-height:20px;width:100%}.VS-interface,.VS-search .dialog,.VS-search input{font-family:"Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,sans-serif!important;line-height:1.1em}.VS-search .VS-search-box{cursor:text;position:relative;background:transparent;border:2px solid #ccc;border-radius:16px;-webkit-border-radius:16px;-moz-border-radius:16px;background-color:#fafafa;-webkit-box-shadow:inset 0 0 3px #ccc;-moz-box-shadow:inset 0 0 3px #ccc;box-shadow:inset 0 0 3px #ccc;min-height:28px;height:auto}.VS-search .VS-search-box.VS-focus{border-color:#acf;-webkit-box-shadow:inset 0 0 3px #acf;-moz-box-shadow:inset 0 0 3px #acf;box-shadow:inset 0 0 3px #acf}.VS-search .VS-search-inner{position:relative;margin:0 20px 0 22px;overflow:hidden}.VS-search input{width:100px}.VS-search input,.VS-search .VS-input-width-tester{padding:6px 0;float:left;color:#808080;font:13px/17px Helvetica,Arial}.VS-search.VS-focus input{color:#606060}.VS-search .VS-icon-search{position:absolute;left:9px;top:8px}.VS-search .VS-icon-cancel{position:absolute;right:9px;top:8px}.VS-search .search_facet{float:left;margin:0;padding:0 0 0 14px;position:relative;border:1px solid transparent;height:20px;margin:3px -3px 3px 0}.VS-search .search_facet.is_selected{margin-left:-3px;-webkit-border-radius:16px;-moz-border-radius:16px;border-radius:16px;background-color:#d2e6fd;background-image:-moz-linear-gradient(top,#d2e6fd,#b0d1f9);background-image:-webkit-gradient(linear,left top,left bottom,from(#d2e6fd),to(#b0d1f9));background-image:linear-gradient(top,#d2e6fd,#b0d1f9);border:1px solid #6eadf5}.VS-search .search_facet .category{float:left;text-transform:uppercase;font-weight:bold;font-size:10px;color:#808080;padding:8px 0 5px;line-height:13px;cursor:pointer;padding:4px 0 0}.VS-search .search_facet.is_selected .category{margin-left:3px}.VS-search .search_facet .search_facet_input_container{float:left}.VS-search .search_facet input{margin:0;padding:0;color:#000;font-size:13px;line-height:16px;padding:5px 0 5px 4px;height:16px;width:auto;z-index:100;position:relative;padding-top:1px;padding-bottom:2px;padding-right:3px}.VS-search .search_facet.is_editing input,.VS-search .search_facet.is_selected input{color:#000}.VS-search .search_facet .search_facet_remove{position:absolute;left:0;top:4px}.VS-search .search_facet.is_selected .search_facet_remove{opacity:.4;left:3px;filter:alpha(opacity=40);background-position:center -11px}.VS-search .search_facet .search_facet_remove:hover{opacity:1}.VS-search .search_facet.is_editing .category,.VS-search .search_facet.is_selected .category{color:#000}.VS-search .search_facet.search_facet_maybe_delete .category,.VS-search .search_facet.search_facet_maybe_delete input{color:darkred}.VS-search .search_input{height:28px;float:left;margin-left:-1px}.VS-search .search_input input{padding:6px 3px 6px 2px;line-height:10px;height:22px;margin-top:-4px;width:10px;z-index:100;min-width:4px;position:relative}.VS-search .search_input.is_editing input{color:#202020}.ui-helper-hidden-accessible{display:none}.VS-interface.ui-autocomplete{position:absolute;border:1px solid #c0c0c0;border-top:1px solid #d9d9d9;background-color:#f6f6f6;cursor:pointer;z-index:10000;padding:0;margin:0;width:auto;min-width:80px;max-width:220px;max-height:240px;overflow-y:auto;overflow-x:hidden;font-size:13px;top:5px;opacity:.97;box-shadow:3px 4px 5px -2px rgba(0,0,0,0.5);-webkit-box-shadow:3px 4px 5px -2px rgba(0,0,0,0.5);-moz-box-shadow:3px 4px 5px -2px rgba(0,0,0,0.5)}.VS-interface.ui-autocomplete .ui-autocomplete-category{text-transform:capitalize;font-size:11px;padding:4px 4px 4px;border-top:1px solid #a2a2a2;border-bottom:1px solid #a2a2a2;background-color:#b7b7b7;text-shadow:0 -1px 0 #999;font-weight:bold;color:white;cursor:default}.VS-interface.ui-autocomplete .ui-menu-item{float:none}.VS-interface.ui-autocomplete .ui-menu-item a{color:#000;outline:none;display:block;padding:3px 4px 5px;border-radius:none;line-height:1;background-color:#f8f8f8;background-image:-moz-linear-gradient(top,#f8f8f8,#f3f3f3);background-image:-webkit-gradient(linear,left top,left bottom,from(#f8f8f8),to(#f3f3f3));background-image:linear-gradient(top,#f8f8f8,#f3f3f3);border-top:1px solid #fafafa;border-bottom:1px solid #f0f0f0}.VS-interface.ui-autocomplete .ui-menu-item a:active{outline:none}.VS-interface.ui-autocomplete .ui-menu-item .ui-state-hover,.VS-interface.ui-autocomplete .ui-menu-item .ui-state-focus{background-color:#6483f7;background-image:-moz-linear-gradient(top,#648bf5,#2465f3);background-image:-webkit-gradient(linear,left top,left bottom,from(#648bf5),to(#2465f3));background-image:linear-gradient(top,#648bf5,#2465f3);border-top:1px solid #5b83ec;border-bottom:1px solid #1459e9;border-left:none;border-right:none;color:white;margin:0}.VS-interface.ui-autocomplete .ui-corner-all{border-radius:0}.VS-interface.ui-autocomplete li{list-style:none;width:auto}
+.VS-search .VS-icon{background-repeat:no-repeat;background-position:center center;vertical-align:middle;width:16px;height:16px}.VS-search .VS-icon-cancel{width:11px;height:11px;background-position:center 0;background-image:url(../images/embed/icons/cancel_search.png?1311104738);cursor:pointer}.VS-search .VS-icon-cancel:hover{background-position:center -11px}.VS-search .VS-icon-search{width:12px;height:12px;background-image:url(../images/embed/icons/search_glyph.png?1311104738)}.VS-search div,.VS-search span,.VS-search a,.VS-search img,.VS-search ul,.VS-search li,.VS-search form,.VS-search label,.VS-interface ul,.VS-interface li,.VS-interface{margin:0;padding:0;border:0;outline:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline}.VS-search :focus{outline:0}.VS-search{line-height:1;color:black}.VS-search ol,.VS-search ul{list-style:none}.VS-search{font-family:Arial,sans-serif;color:#373737;font-size:12px}.VS-search input{display:block;border:none;-moz-box-shadow:none;-webkit-box-shadow:none;box-shadow:none;outline:none;margin:0;padding:4px;background:transparent;font-size:16px;line-height:20px;width:100%}.VS-interface,.VS-search .dialog,.VS-search input{font-family:"Lucida Grande","Lucida Sans Unicode",Helvetica,Arial,sans-serif!important;line-height:1.1em}.VS-search .VS-search-box{cursor:text;position:relative;background:transparent;border:2px solid #ccc;border-radius:16px;-webkit-border-radius:16px;-moz-border-radius:16px;background-color:#fafafa;-webkit-box-shadow:inset 0 0 3px #ccc;-moz-box-shadow:inset 0 0 3px #ccc;box-shadow:inset 0 0 3px #ccc;min-height:28px;height:auto}.VS-search .VS-search-box.VS-focus{border-color:#acf;-webkit-box-shadow:inset 0 0 3px #acf;-moz-box-shadow:inset 0 0 3px #acf;box-shadow:inset 0 0 3px #acf}.VS-search .VS-placeholder{position:relative;margin:0 20px 0 22px;color:#808080}.VS-search .VS-search-box.VS-focus .VS-placeholder{display:none}.VS-search .VS-search-inner{position:relative;margin:0 20px 0 22px;overflow:hidden}.VS-search input{width:100px}.VS-search input,.VS-search .VS-input-width-tester{padding:6px 0;float:left;color:#808080;font:13px/17px Helvetica,Arial}.VS-search.VS-focus input{color:#606060}.VS-search .VS-icon-search{position:absolute;left:9px;top:8px}.VS-search .VS-icon-cancel{position:absolute;right:9px;top:8px}.VS-search .search_facet{float:left;margin:0;padding:0 0 0 14px;position:relative;border:1px solid transparent;height:20px;margin:3px -3px 3px 0}.VS-search .search_facet.is_selected{margin-left:-3px;-webkit-border-radius:16px;-moz-border-radius:16px;border-radius:16px;background-color:#d2e6fd;background-image:-moz-linear-gradient(top,#d2e6fd,#b0d1f9);background-image:-webkit-gradient(linear,left top,left bottom,from(#d2e6fd),to(#b0d1f9));background-image:linear-gradient(top,#d2e6fd,#b0d1f9);border:1px solid #6eadf5}.VS-search .search_facet .category{float:left;text-transform:uppercase;font-weight:bold;font-size:10px;color:#808080;padding:8px 0 5px;line-height:13px;cursor:pointer;padding:4px 0 0}.VS-search .search_facet.is_selected .category{margin-left:3px}.VS-search .search_facet .search_facet_input_container{float:left}.VS-search .search_facet input{margin:0;padding:0;color:#000;font-size:13px;line-height:16px;padding:5px 0 5px 4px;height:16px;width:auto;z-index:100;position:relative;padding-top:1px;padding-bottom:2px;padding-right:3px}.VS-search .search_facet.is_editing input,.VS-search .search_facet.is_selected input{color:#000}.VS-search .search_facet .search_facet_remove{position:absolute;left:0;top:4px}.VS-search .search_facet.is_selected .search_facet_remove{opacity:.4;left:3px;filter:alpha(opacity=40);background-position:center -11px}.VS-search .search_facet .search_facet_remove:hover{opacity:1}.VS-search .search_facet.is_editing .category,.VS-search .search_facet.is_selected .category{color:#000}.VS-search .search_facet.search_facet_maybe_delete .category,.VS-search .search_facet.search_facet_maybe_delete input{color:darkred}.VS-search .search_input{height:28px;float:left;margin-left:-1px}.VS-search .search_input input{padding:6px 3px 6px 2px;line-height:10px;height:22px;margin-top:-4px;width:10px;z-index:100;min-width:4px;position:relative}.VS-search .search_input.is_editing input{color:#202020}.ui-helper-hidden-accessible{display:none}.VS-interface.ui-autocomplete{position:absolute;border:1px solid #c0c0c0;border-top:1px solid #d9d9d9;background-color:#f6f6f6;cursor:pointer;z-index:10000;padding:0;margin:0;width:auto;min-width:80px;max-width:220px;max-height:240px;overflow-y:auto;overflow-x:hidden;font-size:13px;top:5px;opacity:.97;box-shadow:3px 4px 5px -2px rgba(0,0,0,0.5);-webkit-box-shadow:3px 4px 5px -2px rgba(0,0,0,0.5);-moz-box-shadow:3px 4px 5px -2px rgba(0,0,0,0.5)}.VS-interface.ui-autocomplete .ui-autocomplete-category{text-transform:capitalize;font-size:11px;padding:4px 4px 4px;border-top:1px solid #a2a2a2;border-bottom:1px solid #a2a2a2;background-color:#b7b7b7;text-shadow:0 -1px 0 #999;font-weight:bold;color:white;cursor:default}.VS-interface.ui-autocomplete .ui-menu-item{float:none}.VS-interface.ui-autocomplete .ui-menu-item a{color:#000;outline:none;display:block;padding:3px 4px 5px;border-radius:none;line-height:1;background-color:#f8f8f8;background-image:-moz-linear-gradient(top,#f8f8f8,#f3f3f3);background-image:-webkit-gradient(linear,left top,left bottom,from(#f8f8f8),to(#f3f3f3));background-image:linear-gradient(top,#f8f8f8,#f3f3f3);border-top:1px solid #fafafa;border-bottom:1px solid #f0f0f0}.VS-interface.ui-autocomplete .ui-menu-item a:active{outline:none}.VS-interface.ui-autocomplete .ui-menu-item .ui-state-hover,.VS-interface.ui-autocomplete .ui-menu-item .ui-state-focus{background-color:#6483f7;background-image:-moz-linear-gradient(top,#648bf5,#2465f3);background-image:-webkit-gradient(linear,left top,left bottom,from(#648bf5),to(#2465f3));background-image:linear-gradient(top,#648bf5,#2465f3);border-top:1px solid #5b83ec;border-bottom:1px solid #1459e9;border-left:none;border-right:none;color:white;margin:0}.VS-interface.ui-autocomplete .ui-corner-all{border-radius:0}.VS-interface.ui-autocomplete li{list-style:none;width:auto}
View
BIN build-min/visualsearch.css.gz
Binary file not shown.
View
24 build-min/visualsearch.js
@@ -11,17 +11,17 @@ this.searchBox=new VS.ui.SearchBox({app:this,showFacets:this.options.showFacets}
this.app.searchQuery.bind("reset",this.renderFacets).bind("add",this.addedFacet).bind("remove",this.removedFacet).bind("change",this.changedFacet);c(document).bind("keydown",this._maybeDisableFacets)},render:function(){c(this.el).append(JST.search_box({}));c(document.body).setMode("no","search");return this},value:function(a){return null==a?this.serialize():this.setQuery(a)},serialize:function(){var a=[],b=this.inputViews.length;this.app.searchQuery.each(_.bind(function(b,c){a.push(this.inputViews[c].value());
a.push(b.serialize())},this));b&&a.push(this.inputViews[b-1].value());return _.compact(a).join(" ")},selected:function(){return _.select(this.facetViews,function(a){return"is"==a.modes.editing||"is"==a.modes.selected})},selectedModels:function(){return _.pluck(this.selected(),"model")},setQuery:function(a){this.currentQuery=a;VS.app.SearchParser.parse(this.app,a)},viewPosition:function(a){a=_.indexOf("facet"==a.type?this.facetViews:this.inputViews,a);-1==a&&(a=0);return a},searchEvent:function(a){var b=
this.value();this.focusSearch(a);this.value(b);this.app.options.callbacks.search(b,this.app.searchQuery)},addFacet:function(a,b,c){a=VS.utils.inflector.trim(a);b=VS.utils.inflector.trim(b||"");a&&this.app.searchQuery.add(new VS.model.SearchFacet({category:a,value:b||"",app:this.app}),{at:c})},addedFacet:function(a){this.renderFacets();var b=_.detect(this.facetViews,function(b){if(b.model==a)return!0});_.defer(function(){b.enableEdit()})},changedFacet:function(){this.renderFacets()},removedFacet:function(){},
-renderFacets:function(){this.facetViews=[];this.inputViews=[];this.$(".VS-search-inner").empty();this.app.searchQuery.each(_.bind(this.renderFacet,this));this.renderSearchInput()},renderFacet:function(a,b){var c=new VS.ui.SearchFacet({app:this.app,model:a,order:b});this.renderSearchInput();this.facetViews.push(c);this.$(".VS-search-inner").children().eq(2*b).after(c.render().el);c.calculateSize();_.defer(_.bind(c.calculateSize,c));return c},renderSearchInput:function(){var a=new VS.ui.SearchInput({position:this.inputViews.length,
-app:this.app,showFacets:this.options.showFacets});this.$(".VS-search-inner").append(a.render().el);this.inputViews.push(a)},clearSearch:function(a){var b=_.bind(function(){this.disableFacets();this.value("");this.flags.allSelected=!1;this.searchEvent(a);this.focusSearch(a)},this);this.app.options.callbacks.clearSearch?this.app.options.callbacks.clearSearch(b):b()},selectAllFacets:function(){this.flags.allSelected=!0;c(document).one("click.selectAllFacets",this.deselectAllFacets);_.each(this.facetViews,
-function(a){a.selectFacet()});_.each(this.inputViews,function(a){a.selectText()})},allSelected:function(a){a&&(this.flags.allSelected=!1);return this.flags.allSelected},deselectAllFacets:function(a){this.disableFacets();if(this.$(a.target).is(".category,input")){var b=c(a.target).closest(".search_facet,.search_input"),g=_.detect(this.facetViews.concat(this.inputViews),function(a){return a.el==b[0]});"facet"==g.type?g.selectFacet():"input"==g.type&&_.defer(function(){g.enableEdit(!0)})}},disableFacets:function(a){_.each(this.inputViews,
-function(b){b&&b!=a&&("is"==b.modes.editing||"is"==b.modes.selected)&&b.disableEdit()});_.each(this.facetViews,function(b){if(b&&b!=a&&("is"==b.modes.editing||"is"==b.modes.selected))b.disableEdit(),b.deselectFacet()});this.flags.allSelected=!1;this.removeFocus();c(document).unbind("click.selectAllFacets")},resizeFacets:function(a){_.each(this.facetViews,function(b){(!a||b==a)&&b.resize()})},_maybeDisableFacets:function(a){if(this.flags.allSelected&&"backspace"==VS.app.hotkeys.key(a))return a.preventDefault(),
-this.clearSearch(a),!1;this.flags.allSelected&&VS.app.hotkeys.printable(a)&&this.clearSearch(a)},focusNextFacet:function(a,b,c){var c=c||{},e=this.facetViews.length,d=c.viewPosition||this.viewPosition(a);c.skipToFacet?c.skipToFacet&&"text"==a.type&&e==d&&0<=b&&(b=d=0):("text"==a.type&&0<b&&(b-=1),"facet"==a.type&&0>b&&(b+=1));var f,d=Math.min(e,d+b);"text"==a.type?(0<=d&&d<e?f=this.facetViews[d]:d==e&&(f=this.inputViews[this.inputViews.length-1]),f&&c.selectFacet&&"facet"==f.type?f.selectFacet():
-f&&(f.enableEdit(),f.setCursorAtEnd(b||c.startAtEnd))):"facet"==a.type&&(c.skipToFacet?d>=e||0>d?(f=_.last(this.inputViews),f.enableEdit()):(f=this.facetViews[d],f.enableEdit(),f.setCursorAtEnd(b||c.startAtEnd)):(f=this.inputViews[d],f.enableEdit()));c.selectText&&f.selectText();this.resizeFacets()},maybeFocusSearch:function(a){(c(a.target).is(".VS-search-box")||c(a.target).is(".VS-search-inner")||"keydown"==a.type)&&this.focusSearch(a)},focusSearch:function(a,b){var c=this.inputViews[this.inputViews.length-
-1];c.enableEdit(b);b||c.setCursorAtEnd(-1);"keydown"==a.type&&(c.keydown(a),c.box.trigger("keydown"));_.defer(_.bind(function(){this.$("input:focus").length||c.enableEdit(b)},this))},highlightSearch:function(a){if(c(a.target).is(".VS-search-box")||c(a.target).is(".VS-search-inner")||"keydown"==a.type)this.inputViews[this.inputViews.length-1].startTripleClickTimer(),this.focusSearch(a,!0)},maybeTripleClick:function(a){return this.inputViews[this.inputViews.length-1].maybeTripleClick(a)},addFocus:function(){this.app.options.callbacks.focus();
-this.$(".VS-search-box").addClass("VS-focus")},removeFocus:function(){this.app.options.callbacks.blur();_.any(this.facetViews.concat(this.inputViews),function(a){return a.isFocused()})||this.$(".VS-search-box").removeClass("VS-focus")},showFacetCategoryMenu:function(a){a.preventDefault();a.stopPropagation();if(this.facetCategoryMenu&&"is"==this.facetCategoryMenu.modes.open)return this.facetCategoryMenu.close();a=[{title:"Account",onClick:_.bind(this.addFacet,this,"account","")},{title:"Project",onClick:_.bind(this.addFacet,
-this,"project","")},{title:"Filter",onClick:_.bind(this.addFacet,this,"filter","")},{title:"Access",onClick:_.bind(this.addFacet,this,"access","")}];a=this.facetCategoryMenu||(this.facetCategoryMenu=new dc.ui.Menu({items:a,standalone:!0}));this.$(".VS-icon-search").after(a.render().open().content);return!1}})})();
+renderFacets:function(){this.facetViews=[];this.inputViews=[];this.$(".VS-search-inner").empty();this.app.searchQuery.each(_.bind(this.renderFacet,this));this.renderSearchInput();this.app.searchQuery.length?this.$(".VS-placeholder").hide():this.$(".VS-placeholder").show().text(this.app.options.placeholder)},renderFacet:function(a,b){var c=new VS.ui.SearchFacet({app:this.app,model:a,order:b});this.renderSearchInput();this.facetViews.push(c);this.$(".VS-search-inner").children().eq(2*b).after(c.render().el);
+c.calculateSize();_.defer(_.bind(c.calculateSize,c));return c},renderSearchInput:function(){var a=new VS.ui.SearchInput({position:this.inputViews.length,app:this.app,showFacets:this.options.showFacets});this.$(".VS-search-inner").append(a.render().el);this.inputViews.push(a)},clearSearch:function(a){var b=_.bind(function(){this.disableFacets();this.value("");this.flags.allSelected=!1;this.searchEvent(a);this.focusSearch(a)},this);this.app.options.callbacks.clearSearch?this.app.options.callbacks.clearSearch(b):
+b()},selectAllFacets:function(){this.flags.allSelected=!0;c(document).one("click.selectAllFacets",this.deselectAllFacets);_.each(this.facetViews,function(a){a.selectFacet()});_.each(this.inputViews,function(a){a.selectText()})},allSelected:function(a){a&&(this.flags.allSelected=!1);return this.flags.allSelected},deselectAllFacets:function(a){this.disableFacets();if(this.$(a.target).is(".category,input")){var b=c(a.target).closest(".search_facet,.search_input"),g=_.detect(this.facetViews.concat(this.inputViews),
+function(a){return a.el==b[0]});"facet"==g.type?g.selectFacet():"input"==g.type&&_.defer(function(){g.enableEdit(!0)})}},disableFacets:function(a){_.each(this.inputViews,function(b){b&&b!=a&&("is"==b.modes.editing||"is"==b.modes.selected)&&b.disableEdit()});_.each(this.facetViews,function(b){if(b&&b!=a&&("is"==b.modes.editing||"is"==b.modes.selected))b.disableEdit(),b.deselectFacet()});this.flags.allSelected=!1;this.removeFocus();c(document).unbind("click.selectAllFacets")},resizeFacets:function(a){_.each(this.facetViews,
+function(b){(!a||b==a)&&b.resize()})},_maybeDisableFacets:function(a){if(this.flags.allSelected&&"backspace"==VS.app.hotkeys.key(a))return a.preventDefault(),this.clearSearch(a),!1;this.flags.allSelected&&VS.app.hotkeys.printable(a)&&this.clearSearch(a)},focusNextFacet:function(a,b,c){var c=c||{},e=this.facetViews.length,d=c.viewPosition||this.viewPosition(a);c.skipToFacet?c.skipToFacet&&"text"==a.type&&e==d&&0<=b&&(b=d=0):("text"==a.type&&0<b&&(b-=1),"facet"==a.type&&0>b&&(b+=1));var f,d=Math.min(e,
+d+b);"text"==a.type?(0<=d&&d<e?f=this.facetViews[d]:d==e&&(f=this.inputViews[this.inputViews.length-1]),f&&c.selectFacet&&"facet"==f.type?f.selectFacet():f&&(f.enableEdit(),f.setCursorAtEnd(b||c.startAtEnd))):"facet"==a.type&&(c.skipToFacet?d>=e||0>d?(f=_.last(this.inputViews),f.enableEdit()):(f=this.facetViews[d],f.enableEdit(),f.setCursorAtEnd(b||c.startAtEnd)):(f=this.inputViews[d],f.enableEdit()));c.selectText&&f.selectText();this.resizeFacets()},maybeFocusSearch:function(a){(c(a.target).is(".VS-search-box")||
+c(a.target).is(".VS-search-inner")||"keydown"==a.type)&&this.focusSearch(a)},focusSearch:function(a,b){var c=this.inputViews[this.inputViews.length-1];c.enableEdit(b);b||c.setCursorAtEnd(-1);"keydown"==a.type&&(c.keydown(a),c.box.trigger("keydown"));_.defer(_.bind(function(){this.$("input:focus").length||c.enableEdit(b)},this))},highlightSearch:function(a){if(c(a.target).is(".VS-search-box")||c(a.target).is(".VS-search-inner")||"keydown"==a.type)this.inputViews[this.inputViews.length-1].startTripleClickTimer(),
+this.focusSearch(a,!0)},maybeTripleClick:function(a){return this.inputViews[this.inputViews.length-1].maybeTripleClick(a)},addFocus:function(){this.app.options.callbacks.focus();this.$(".VS-search-box").addClass("VS-focus")},removeFocus:function(){this.app.options.callbacks.blur();_.any(this.facetViews.concat(this.inputViews),function(a){return a.isFocused()})||this.$(".VS-search-box").removeClass("VS-focus")},showFacetCategoryMenu:function(a){a.preventDefault();a.stopPropagation();if(this.facetCategoryMenu&&
+"is"==this.facetCategoryMenu.modes.open)return this.facetCategoryMenu.close();a=[{title:"Account",onClick:_.bind(this.addFacet,this,"account","")},{title:"Project",onClick:_.bind(this.addFacet,this,"project","")},{title:"Filter",onClick:_.bind(this.addFacet,this,"filter","")},{title:"Access",onClick:_.bind(this.addFacet,this,"access","")}];a=this.facetCategoryMenu||(this.facetCategoryMenu=new dc.ui.Menu({items:a,standalone:!0}));this.$(".VS-icon-search").after(a.render().open().content);return!1}})})();
(function(){var c=jQuery;VS.ui.SearchFacet=Backbone.View.extend({type:"facet",className:"search_facet",events:{"click .category":"selectFacet","keydown input":"keydown","mousedown input":"enableEdit","mouseover .VS-icon-cancel":"showDelete","mouseout .VS-icon-cancel":"hideDelete","click .VS-icon-cancel":"remove"},initialize:function(){this.flags={canClose:!1};_.bindAll(this,"set","keydown","deselectFacet","deferDisableEdit")},render:function(){c(this.el).html(JST.search_facet({model:this.model}));
-this.setMode("not","editing");this.setMode("not","selected");this.box=this.$("input");this.box.val(this.model.get("value"));this.box.bind("blur",this.deferDisableEdit);this.box.bind("input propertychange",this.keydown);this.setupAutocomplete();return this},calculateSize:function(){this.box.autoGrowInput();this.box.unbind("updated.autogrow");this.box.bind("updated.autogrow",_.bind(this.moveAutocomplete,this))},resize:function(a){this.box.trigger("resize.autogrow",a)},setupAutocomplete:function(){this.box.autocomplete({source:_.bind(this.autocompleteValues,
+this.setMode("not","editing");this.setMode("not","selected");this.box=this.$("input");console.log(["model",this.model]);this.box.val(this.model.label());this.box.bind("blur",this.deferDisableEdit);this.box.bind("input propertychange",this.keydown);this.setupAutocomplete();return this},calculateSize:function(){this.box.autoGrowInput();this.box.unbind("updated.autogrow");this.box.bind("updated.autogrow",_.bind(this.moveAutocomplete,this))},resize:function(a){this.box.trigger("resize.autogrow",a)},setupAutocomplete:function(){this.box.autocomplete({source:_.bind(this.autocompleteValues,
this),minLength:0,delay:0,autoFocus:!0,position:{offset:"0 5"},create:_.bind(function(){c(this.el).find(".ui-autocomplete-input").css("z-index","auto")},this),select:_.bind(function(a,b){a.preventDefault();var c=this.model.get("value");this.set(b.item.value);if(c!=b.item.value||this.box.val()!=b.item.value)this.options.app.options.autosearch?this.search(a):(this.options.app.searchBox.renderFacets(),this.options.app.searchBox.focusNextFacet(this,1,{viewPosition:this.options.order}));return!1},this),
open:_.bind(function(){var a=this.box;this.box.autocomplete("widget").find(".ui-menu-item").each(function(){var b=c(this);(b.data("item.autocomplete")||b.data("ui-autocomplete-item")).value==a.val()&&a.data("uiAutocomplete").menu.activate&&a.data("uiAutocomplete").menu.activate(new c.Event("mouseover"),b)})},this)});this.box.autocomplete("widget").addClass("VS-interface")},moveAutocomplete:function(){var a=this.box.data("uiAutocomplete");a&&a.menu.element.position({my:"left top",at:"left bottom",
of:this.box.data("uiAutocomplete").element,collision:"flip",offset:"0 5"})},searchAutocomplete:function(){var a=this.box.data("uiAutocomplete");if(a){var b=a.menu.element;a.search();b.outerWidth(Math.max(b.width("").outerWidth(),a.element.outerWidth()))}},closeAutocomplete:function(){var a=this.box.data("uiAutocomplete");a&&a.close()},autocompleteValues:function(a,b){var g=this.model.get("category"),e=this.model.get("value"),d=a.term;this.options.app.options.callbacks.valueMatches(g,d,function(a,
@@ -59,8 +59,8 @@ if(e)return a=a.createTextRange(),b=a.duplicate(),a.moveToBookmark(e.getBookmark
""))):-1==f.indexOf(":")&&(e=c.options.remainder,d=f,a=VS.utils.inflector.trim(a.replace(d,""))):(e=c.options.remainder,d=this._extractSearchText(a),a=VS.utils.inflector.trim(a.replace(d,"")));e&&d&&(f=new VS.model.SearchFacet({category:e,value:VS.utils.inflector.trim(d),app:c}),b.push(f));if(g==a)break}return b},_extractNextField:function(c){var a=c.match(/^\s*(\S+)\s+(?=('[^']+'|"[^"]+")('[^']+'|"[^"]+"|[^'"\s]\S*))/);return a&&1<=a.length?a[1]:this._extractFirstField(c)},_extractFirstField:function(c){return(c=
c.match(this.ALL_FIELDS))&&c.length&&c[0]},_extractSearchText:function(c){return VS.utils.inflector.trim((c||"").replace(this.ALL_FIELDS,""))}}})();
(function(){VS.model.SearchFacet=Backbone.Model.extend({serialize:function(){var c=this.quoteCategory(this.get("category")),a=VS.utils.inflector.trim(this.get("value")),b=this.get("app").options.remainder;if(!a)return"";if(!_.contains(this.get("app").options.unquotable||[],c)&&c!=b)a=this.quoteValue(a);return(c!=b?c+": ":"")+a},quoteCategory:function(c){var a=/"/.test(c),b=/'/.test(c),g=/\s/.test(c);return a&&!b?"'"+c+"'":g||b&&!a?'"'+c+'"':c},quoteValue:function(c){var a=/"/.test(c),b=/'/.test(c);
-return a&&!b?"'"+c+"'":'"'+c+'"'}})})();
+return a&&!b?"'"+c+"'":'"'+c+'"'},label:function(){return this.get("label")||this.get("value")}})})();
(function(){VS.model.SearchQuery=Backbone.Collection.extend({model:VS.model.SearchFacet,serialize:function(){return this.map(function(c){return c.serialize()}).join(" ")},facets:function(){return this.map(function(c){var a={};a[c.get("category")]=c.get("value");return a})},find:function(c){var a=this.detect(function(a){return a.get("category").toLowerCase()==c.toLowerCase()});return a&&a.get("value")},count:function(c){return this.select(function(a){return a.get("category").toLowerCase()==c.toLowerCase()}).length},
values:function(c){var a=this.select(function(a){return a.get("category").toLowerCase()==c.toLowerCase()});return _.map(a,function(a){return a.get("value")})},has:function(c,a){return this.any(function(b){var g=b.get("category").toLowerCase()==c.toLowerCase();return!a?g:g&&b.get("value")==a})},withoutCategory:function(){var c=_.map(_.toArray(arguments),function(a){return a.toLowerCase()});return this.map(function(a){if(!_.include(c,a.get("category").toLowerCase()))return a.serialize()}).join(" ")}})})();
-(function(){window.JST=window.JST||{};window.JST.search_box=_.template('<div class="VS-search">\n <div class="VS-search-box-wrapper VS-search-box">\n <div class="VS-icon VS-icon-search"></div>\n <div class="VS-search-inner"></div>\n <div class="VS-icon VS-icon-cancel VS-cancel-search-box" title="clear search"></div>\n </div>\n</div>');window.JST.search_facet=_.template('<% if (model.has(\'category\')) { %>\n <div class="category"><%= model.get(\'category\') %>:</div>\n<% } %>\n\n<div class="search_facet_input_container">\n <input type="text" class="search_facet_input ui-menu VS-interface" value="" />\n</div>\n\n<div class="search_facet_remove VS-icon VS-icon-cancel"></div>');
+(function(){window.JST=window.JST||{};window.JST.search_box=_.template('<div class="VS-search">\n <div class="VS-search-box-wrapper VS-search-box">\n <div class="VS-icon VS-icon-search"></div>\n <div class="VS-placeholder"></div>\n <div class="VS-search-inner"></div>\n <div class="VS-icon VS-icon-cancel VS-cancel-search-box" title="clear search"></div>\n </div>\n</div>');window.JST.search_facet=_.template('<% if (model.has(\'category\')) { %>\n <div class="category"><%= model.get(\'category\') %>:</div>\n<% } %>\n\n<div class="search_facet_input_container">\n <input type="text" class="search_facet_input ui-menu VS-interface" value="" />\n</div>\n\n<div class="search_facet_remove VS-icon VS-icon-cancel"></div>');
window.JST.search_input=_.template('<input type="text" class="ui-menu" />')})();
View
BIN build-min/visualsearch.js.gz
Binary file not shown.
View
2 build-min/visualsearch_templates.js
@@ -1,2 +1,2 @@
-(function(){window.JST=window.JST||{};window.JST.search_box=_.template('<div class="VS-search">\n <div class="VS-search-box-wrapper VS-search-box">\n <div class="VS-icon VS-icon-search"></div>\n <div class="VS-search-inner"></div>\n <div class="VS-icon VS-icon-cancel VS-cancel-search-box" title="clear search"></div>\n </div>\n</div>');window.JST.search_facet=_.template('<% if (model.has(\'category\')) { %>\n <div class="category"><%= model.get(\'category\') %>:</div>\n<% } %>\n\n<div class="search_facet_input_container">\n <input type="text" class="search_facet_input ui-menu VS-interface" value="" />\n</div>\n\n<div class="search_facet_remove VS-icon VS-icon-cancel"></div>');
+(function(){window.JST=window.JST||{};window.JST.search_box=_.template('<div class="VS-search">\n <div class="VS-search-box-wrapper VS-search-box">\n <div class="VS-icon VS-icon-search"></div>\n <div class="VS-placeholder"></div>\n <div class="VS-search-inner"></div>\n <div class="VS-icon VS-icon-cancel VS-cancel-search-box" title="clear search"></div>\n </div>\n</div>');window.JST.search_facet=_.template('<% if (model.has(\'category\')) { %>\n <div class="category"><%= model.get(\'category\') %>:</div>\n<% } %>\n\n<div class="search_facet_input_container">\n <input type="text" class="search_facet_input ui-menu VS-interface" value="" />\n</div>\n\n<div class="search_facet_remove VS-icon VS-icon-cancel"></div>');
window.JST.search_input=_.template('<input type="text" class="ui-menu" />')})();
View
BIN build-min/visualsearch_templates.js.gz
Binary file not shown.
View
8 build/visualsearch-datauri.css
@@ -99,6 +99,14 @@ Source: http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/
-moz-box-shadow: inset 0px 0px 3px #acf;
box-shadow: inset 0px 0px 3px #acf;
}
+ .VS-search .VS-placeholder {
+ position: relative;
+ margin: 0 20px 0 22px;
+ color: #808080;
+ }
+ .VS-search .VS-search-box.VS-focus .VS-placeholder {
+ display: none;
+ }
.VS-search .VS-search-inner {
position: relative;
margin: 0 20px 0 22px;
View
8 build/visualsearch.css
@@ -99,6 +99,14 @@ Source: http://meyerweb.com/eric/thoughts/2007/05/01/reset-reloaded/
-moz-box-shadow: inset 0px 0px 3px #acf;
box-shadow: inset 0px 0px 3px #acf;
}
+ .VS-search .VS-placeholder {
+ position: relative;
+ margin: 0 20px 0 22px;
+ color: #808080;
+ }
+ .VS-search .VS-search-box.VS-focus .VS-placeholder {
+ display: none;
+ }
.VS-search .VS-search-inner {
position: relative;
margin: 0 20px 0 22px;
View
16 build/visualsearch.js
@@ -233,6 +233,12 @@ VS.ui.SearchBox = Backbone.View.extend({
// Add on an n+1 empty search input on the very end.
this.renderSearchInput();
+
+ if (this.app.searchQuery.length) {
+ this.$('.VS-placeholder').hide();
+ } else {
+ this.$('.VS-placeholder').show().text(this.app.options.placeholder);
+ }
},
// Render a single facet, using its category and query value.
@@ -549,7 +555,8 @@ VS.ui.SearchFacet = Backbone.View.extend({
this.setMode('not', 'editing');
this.setMode('not', 'selected');
this.box = this.$('input');
- this.box.val(this.model.get('value'));
+ console.log(["model", this.model]);
+ this.box.val(this.model.label());
this.box.bind('blur', this.deferDisableEdit);
// Handle paste events with `propertychange`
this.box.bind('input propertychange', this.keydown);
@@ -1822,6 +1829,11 @@ VS.model.SearchFacet = Backbone.Model.extend({
} else {
return '"' + value + '"';
}
+ },
+
+ // If provided, use a custom label instead of the raw value.
+ label : function() {
+ return this.get('label') || this.get('value');
}
});
@@ -1900,7 +1912,7 @@ VS.model.SearchQuery = Backbone.Collection.extend({
(function(){
window.JST = window.JST || {};
-window.JST['search_box'] = _.template('<div class="VS-search">\n <div class="VS-search-box-wrapper VS-search-box">\n <div class="VS-icon VS-icon-search"></div>\n <div class="VS-search-inner"></div>\n <div class="VS-icon VS-icon-cancel VS-cancel-search-box" title="clear search"></div>\n </div>\n</div>');
+window.JST['search_box'] = _.template('<div class="VS-search">\n <div class="VS-search-box-wrapper VS-search-box">\n <div class="VS-icon VS-icon-search"></div>\n <div class="VS-placeholder"></div>\n <div class="VS-search-inner"></div>\n <div class="VS-icon VS-icon-cancel VS-cancel-search-box" title="clear search"></div>\n </div>\n</div>');
window.JST['search_facet'] = _.template('<% if (model.has(\'category\')) { %>\n <div class="category"><%= model.get(\'category\') %>:</div>\n<% } %>\n\n<div class="search_facet_input_container">\n <input type="text" class="search_facet_input ui-menu VS-interface" value="" />\n</div>\n\n<div class="search_facet_remove VS-icon VS-icon-cancel"></div>');
window.JST['search_input'] = _.template('<input type="text" class="ui-menu" />');
})();
View
21 demo.html
@@ -186,7 +186,7 @@ <h2 id="demo">Demo <span class="demo-hint"><i>Try searching for: <b>account</b>,
$(document).ready(function() {
window.visualSearch = VS.init({
container : $('#search_box_container'),
- query : 'country: "South Africa" account: 5-samuel "U.S. State": California',
+ query : 'country: "United States" account: 5-samuel "U.S. State": California',
showFacets : true,
unquotable : [
'text',
@@ -293,17 +293,22 @@ <h2 id="demo">Demo <span class="demo-hint"><i>Try searching for: <b>account</b>,
"Togo", "Libya", "Jordan", "Paraguay", "Laos",
"El Salvador", "Sierra Leone", "Nicaragua", "Kyrgyzstan", "Denmark",
"Slovakia", "Finland", "Eritrea", "Turkmenistan"
- ], {preserveOrder: true});
+ ], {
+ preserveOrder: true // Otherwise the selected value is brought to the top
+ });
break;
}
},
facetMatches : function(callback) {
callback([
- 'account', 'filter', 'access', 'title',
- { label: 'city', category: 'location' },
- { label: 'address', category: 'location' },
- { label: 'country', category: 'location' },
- { label: 'U.S. State', category: 'location' },
+ 'account',
+ 'filter',
+ 'access',
+ 'title',
+ { label: 'city', category: 'location' },
+ { label: 'address', category: 'location' },
+ { label: 'country', category: 'location' },
+ { label: 'U.S. State', category: 'location' },
]);
}
}
@@ -329,9 +334,9 @@ <h2 id="demo">Demo <span class="demo-hint"><i>Try searching for: <b>account</b>,
'filter',
'access'
],
+ placeholder : "Search for your documents...",
callbacks : {
search : function(query, searchCollection) {
- console.log(["query", searchCollection.facets(), query]);
var $query = $('#search_query2');
$query.stop().animate({opacity : 1}, {duration: 300, queue: false});
$query.html('<span class="raquo">&raquo;</span> You searched for: <b>' + searchCollection.serialize() + '</b>');
View
12 lib/css/workspace.css
@@ -48,6 +48,18 @@
-moz-box-shadow: inset 0px 0px 3px #acf;
box-shadow: inset 0px 0px 3px #acf;
}
+ .VS-search .VS-placeholder {
+ position: absolute;
+ top: 7px;
+ left: 4px;
+ margin: 0 20px 0 22px;
+ color: #808080;
+ font-size: 14px;
+ }
+ .VS-search .VS-search-box.VS-focus .VS-placeholder,
+ .VS-search .VS-search-box .VS-placeholder.VS-hidden {
+ display: none;
+ }
.VS-search .VS-search-inner {
position: relative;
margin: 0 20px 0 22px;
View
5 lib/js/models/search_facets.js
@@ -55,6 +55,11 @@ VS.model.SearchFacet = Backbone.Model.extend({
} else {
return '"' + value + '"';
}
+ },
+
+ // If provided, use a custom label instead of the raw value.
+ label : function() {
+ return this.get('label') || this.get('value');
}
});
View
1 lib/js/templates/search_box.jst
@@ -1,6 +1,7 @@
<div class="VS-search">
<div class="VS-search-box-wrapper VS-search-box">
<div class="VS-icon VS-icon-search"></div>
+ <div class="VS-placeholder"></div>
<div class="VS-search-inner"></div>
<div class="VS-icon VS-icon-cancel VS-cancel-search-box" title="clear search"></div>
</div>
View
2 lib/js/templates/templates.js
@@ -1,7 +1,7 @@
(function(){
window.JST = window.JST || {};
-window.JST['search_box'] = _.template('<div class="VS-search">\n <div class="VS-search-box-wrapper VS-search-box">\n <div class="VS-icon VS-icon-search"></div>\n <div class="VS-search-inner"></div>\n <div class="VS-icon VS-icon-cancel VS-cancel-search-box" title="clear search"></div>\n </div>\n</div>');
+window.JST['search_box'] = _.template('<div class="VS-search">\n <div class="VS-search-box-wrapper VS-search-box">\n <div class="VS-icon VS-icon-search"></div>\n <div class="VS-placeholder"></div>\n <div class="VS-search-inner"></div>\n <div class="VS-icon VS-icon-cancel VS-cancel-search-box" title="clear search"></div>\n </div>\n</div>');
window.JST['search_facet'] = _.template('<% if (model.has(\'category\')) { %>\n <div class="category"><%= model.get(\'category\') %>:</div>\n<% } %>\n\n<div class="search_facet_input_container">\n <input type="text" class="search_facet_input ui-menu VS-interface" value="" />\n</div>\n\n<div class="search_facet_remove VS-icon VS-icon-cancel"></div>');
window.JST['search_input'] = _.template('<input type="text" class="ui-menu" />');
})();
View
12 lib/js/views/search_box.js
@@ -155,6 +155,7 @@ VS.ui.SearchBox = Backbone.View.extend({
// Add on an n+1 empty search input on the very end.
this.renderSearchInput();
+ this.renderPlaceholder();
},
// Render a single facet, using its category and query value.
@@ -186,6 +187,17 @@ VS.ui.SearchBox = Backbone.View.extend({
this.$('.VS-search-inner').append(input.render().el);
this.inputViews.push(input);
},
+
+ // Handles showing/hiding the placeholder text
+ renderPlaceholder : function() {
+ var $placeholder = this.$('.VS-placeholder');
+ if (this.app.searchQuery.length) {
+ $placeholder.addClass("VS-hidden");
+ } else {
+ $placeholder.removeClass("VS-hidden")
+ .text(this.app.options.placeholder);
+ }
+ },
// # Modifying Facets #
View
3 lib/js/views/search_facet.js
@@ -36,7 +36,8 @@ VS.ui.SearchFacet = Backbone.View.extend({
this.setMode('not', 'editing');
this.setMode('not', 'selected');
this.box = this.$('input');
- this.box.val(this.model.get('value'));
+ console.log(["model", this.model]);
+ this.box.val(this.model.label());
this.box.bind('blur', this.deferDisableEdit);
// Handle paste events with `propertychange`
this.box.bind('input propertychange', this.keydown);

0 comments on commit aa7e38c

Please sign in to comment.
Something went wrong with that request. Please try again.