Update to Suggest 4.3 - fixes #762
This commit is contained in:
parent
77f86617ee
commit
4fd20f1b4e
@ -384,7 +384,7 @@ function init() {
|
|||||||
"externals/jquery-1.7.2.min.js",
|
"externals/jquery-1.7.2.min.js",
|
||||||
"externals/jquery.cookie.js",
|
"externals/jquery.cookie.js",
|
||||||
"externals/jquery.eventstack-0.3.js",
|
"externals/jquery.eventstack-0.3.js",
|
||||||
"externals/suggest/suggest-4_2.js",
|
"externals/suggest/suggest-4_3.min.js",
|
||||||
"externals/jquery-ui/jquery-ui-1.8.20.custom.min.js",
|
"externals/jquery-ui/jquery-ui-1.8.20.custom.min.js",
|
||||||
"externals/imgareaselect/jquery.imgareaselect.js",
|
"externals/imgareaselect/jquery.imgareaselect.js",
|
||||||
"externals/date.js",
|
"externals/date.js",
|
||||||
@ -450,7 +450,7 @@ function init() {
|
|||||||
"project/styles",
|
"project/styles",
|
||||||
module,
|
module,
|
||||||
[
|
[
|
||||||
"externals/suggest/css/suggest-4_2.css",
|
"externals/suggest/css/suggest-4_3.min.css",
|
||||||
"externals/jquery-ui/css/ui-lightness/jquery-ui-1.8.20.custom.css",
|
"externals/jquery-ui/css/ui-lightness/jquery-ui-1.8.20.custom.css",
|
||||||
"externals/imgareaselect/css/imgareaselect-default.css",
|
"externals/imgareaselect/css/imgareaselect-default.css",
|
||||||
|
|
||||||
@ -490,7 +490,7 @@ function init() {
|
|||||||
[
|
[
|
||||||
"externals/jquery-1.7.2.min.js",
|
"externals/jquery-1.7.2.min.js",
|
||||||
"externals/jquery.cookie.js",
|
"externals/jquery.cookie.js",
|
||||||
"externals/suggest/suggest-4_2.js",
|
"externals/suggest/suggest-4_3.min.js",
|
||||||
"externals/jquery-ui/jquery-ui-1.8.20.custom.min.js",
|
"externals/jquery-ui/jquery-ui-1.8.20.custom.min.js",
|
||||||
"externals/imgareaselect/jquery.imgareaselect.js",
|
"externals/imgareaselect/jquery.imgareaselect.js",
|
||||||
"externals/date.js",
|
"externals/date.js",
|
||||||
@ -502,7 +502,7 @@ function init() {
|
|||||||
"preferences/styles",
|
"preferences/styles",
|
||||||
module,
|
module,
|
||||||
[
|
[
|
||||||
"externals/suggest/css/suggest-4_2.css",
|
"externals/suggest/css/suggest-4_3.min.css",
|
||||||
"externals/jquery-ui/css/ui-lightness/jquery-ui-1.8.20.custom.css",
|
"externals/jquery-ui/css/ui-lightness/jquery-ui-1.8.20.custom.css",
|
||||||
"styles/jquery-ui-overrides.less",
|
"styles/jquery-ui-overrides.less",
|
||||||
"styles/common.less",
|
"styles/common.less",
|
||||||
|
573
main/webapp/modules/core/externals/suggest/css/suggest-4_3.css
vendored
Normal file
573
main/webapp/modules/core/externals/suggest/css/suggest-4_3.css
vendored
Normal file
@ -0,0 +1,573 @@
|
|||||||
|
/*
|
||||||
|
=======================================================
|
||||||
|
|
||||||
|
FREEBASE SUGGEST
|
||||||
|
|
||||||
|
This file is part of the freebase-suggest jQuery plugin.
|
||||||
|
|
||||||
|
It is maintained by Metaweb Technologies, Inc. and
|
||||||
|
available for use under a Creative Commons License.
|
||||||
|
|
||||||
|
Author: Kai Conragan (kai@metaweb.com)
|
||||||
|
|
||||||
|
GLOSSARY
|
||||||
|
|
||||||
|
.fbs-pane : Outermost container for result list <div>
|
||||||
|
.fbs-subpane : Inner container for result list <div>
|
||||||
|
.fbs-list : Contained by .fbs-subpane, this is the actual results list <ul>
|
||||||
|
.fbs-item : Individual item in results list <li>
|
||||||
|
.fbs-flyout-pane : Outermost container for flyout on specific object <div>
|
||||||
|
|
||||||
|
=======================================================
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------
|
||||||
|
Freebase Suggest Reset
|
||||||
|
-------------------------------------------------------
|
||||||
|
|
||||||
|
reset all Freebase Suggest elements to insure consisten cross-browser rendering
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
.fbs-reset,
|
||||||
|
.fbs-reset h1,
|
||||||
|
.fbs-reset h2,
|
||||||
|
.fbs-reset h3,
|
||||||
|
.fbs-reset h4,
|
||||||
|
.fbs-reset h5,
|
||||||
|
.fbs-reset h6,
|
||||||
|
.fbs-reset p,
|
||||||
|
.fbs-reset img,
|
||||||
|
.fbs-reset dl,
|
||||||
|
.fbs-reset dt,
|
||||||
|
.fbs-reset dd,
|
||||||
|
.fbs-reset ol,
|
||||||
|
.fbs-reset ul,
|
||||||
|
.fbs-reset li {
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
border: 0;
|
||||||
|
outline: 0;
|
||||||
|
font-weight: inherit;
|
||||||
|
font-style: inherit;
|
||||||
|
font-size: 100%;
|
||||||
|
font-family: inherit;
|
||||||
|
vertical-align: baseline;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------
|
||||||
|
Freebase Suggest Chrome
|
||||||
|
-------------------------------------------------------
|
||||||
|
|
||||||
|
You can change the colors of Freebase Suggest by overriding
|
||||||
|
the following rules. We recommended that you copy/paste the
|
||||||
|
below rules into your own stylesheet to customize.
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
.fbs-pane,
|
||||||
|
.fbs-flyout-pane,
|
||||||
|
li.fbs-nomatch,
|
||||||
|
a.fbs-more-link,
|
||||||
|
li.fbs-selected,
|
||||||
|
.fbs-flyout-images,
|
||||||
|
#fbs-topic-image {
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.fbs-suggestnew {
|
||||||
|
color: #444;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-pane,
|
||||||
|
.fbs-flyout-pane,
|
||||||
|
.fbs-flyout-subtitle,
|
||||||
|
.fbs-topic-properties strong {
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
h3.fbs-topic-properties,
|
||||||
|
.fbs-flyout-pane p {
|
||||||
|
color: #444;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-item-name,
|
||||||
|
li.fbs-help-on-focus,
|
||||||
|
li.fbs-nomatch,
|
||||||
|
.fbs-nomatch-text,
|
||||||
|
.fbs-flyout-pane h3,
|
||||||
|
.fbs-properties-header {
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-pane,
|
||||||
|
.fbs-flyout-pane {
|
||||||
|
border: 1px solid #bbb;
|
||||||
|
padding: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-flyout-pane {
|
||||||
|
border-color: #ccc;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-list,
|
||||||
|
.fbs-list-icons,
|
||||||
|
.fbs-flyout-content,
|
||||||
|
.fbs-attribution,
|
||||||
|
.fbs-header {
|
||||||
|
background-color: #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-header { background: #fefefe; }
|
||||||
|
|
||||||
|
li.fbs-help-on-focus,
|
||||||
|
li.fbs-nomatch {
|
||||||
|
border-bottom: 1px solid #dae3e9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-item-name {
|
||||||
|
border: 1px solid #f5f5f5;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1#fbs-flyout-title,
|
||||||
|
li.fbs-selected .fbs-item-name {
|
||||||
|
color: #f60;
|
||||||
|
}
|
||||||
|
|
||||||
|
li.fbs-selected .fbs-item-name {
|
||||||
|
border-color: #f60;
|
||||||
|
background: #fff;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.fbs-nomatch-text {
|
||||||
|
border-bottom: 1px solid #dae3e9;
|
||||||
|
background: #f8f8f8;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-suggestnew {
|
||||||
|
background: #eeeeee;
|
||||||
|
border-top: 1px solid #dae3e9;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
#fbs-flyout-title .fbs-flyout-label {
|
||||||
|
color: #aaa;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-citation {
|
||||||
|
white-space: nowrap;
|
||||||
|
color: #999;
|
||||||
|
font-size: 11px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* topic image */
|
||||||
|
#fbs-topic-image,
|
||||||
|
.fbs-flyout-images {
|
||||||
|
border: 1px solid #a9a9a9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-suggestnew-button,
|
||||||
|
.fbs-flyout-pane {
|
||||||
|
border: 1px solid #9a9a9a;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-suggestnew-button {
|
||||||
|
color: #444444;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.fbs-list,
|
||||||
|
.fbs-flyout-content,
|
||||||
|
.fbs-attribution,
|
||||||
|
.fbs-header {
|
||||||
|
border: 1px solid #dae3e9;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-header { border-bottom: 0; }
|
||||||
|
|
||||||
|
li.fbs-item {
|
||||||
|
border-bottom: 1px solid #dae3e9;
|
||||||
|
list-style-type: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-attribution {
|
||||||
|
border-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------
|
||||||
|
Freebase Suggest Typography
|
||||||
|
-------------------------------------------------------
|
||||||
|
|
||||||
|
establish base typography size by:
|
||||||
|
1. Setting parent div to font-size 16px;
|
||||||
|
2. Setting inner div to font-size 62.5%, giving us a 10px baseline
|
||||||
|
3. Setting global style rules
|
||||||
|
*/
|
||||||
|
|
||||||
|
.fbs-pane,
|
||||||
|
.fbs-flyout-pane {
|
||||||
|
font-size: 16px;
|
||||||
|
font-family: Helvetica Neue, Arial, Helvetica, sans-serif;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.fbs-list,
|
||||||
|
.fbs-flyout-content,
|
||||||
|
.fbs-attribution,
|
||||||
|
div.fbs-header {
|
||||||
|
font-size: 62.5%;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* insure <strong> displays bold */
|
||||||
|
.fbs-pane strong,
|
||||||
|
.fbs-flyout-pane strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------
|
||||||
|
Freebase Suggest Structure
|
||||||
|
-------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
.fbs-flyout-content,
|
||||||
|
.fbs-attribution {
|
||||||
|
margin: 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-flyout-content { margin-bottom: 0; }
|
||||||
|
.fbs-attribution { margin-top: 0; }
|
||||||
|
|
||||||
|
.fbs-pane { width: 325px; } /* results list container */
|
||||||
|
.fbs-flyout-pane { width: 319px; margin-left: 3px; } /* flyout container, 3px narrower on each side to create drawer appearance */
|
||||||
|
|
||||||
|
ul.fbs-list {
|
||||||
|
max-height: 320px;
|
||||||
|
overflow: auto;
|
||||||
|
overflow-x: hidden;
|
||||||
|
border-bottom: 0;
|
||||||
|
border-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-flyout-content,
|
||||||
|
.fbs-attribution {
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-flyout-content:after {
|
||||||
|
content: ".";
|
||||||
|
display: block;
|
||||||
|
height: 0;
|
||||||
|
clear: both;
|
||||||
|
visibility: hidden;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------
|
||||||
|
Freebase Suggest Results List
|
||||||
|
-------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* each .fbs-item is a single returned result */
|
||||||
|
li.fbs-help-on-focus,
|
||||||
|
li.fbs-nomatch {
|
||||||
|
padding: 6px 8px 7px 6px;
|
||||||
|
font-size: 1.4em;
|
||||||
|
line-height: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* show more results */
|
||||||
|
li.fbs-more { padding: 0; background: transparent;}
|
||||||
|
|
||||||
|
a.fbs-more-link {
|
||||||
|
display: block;
|
||||||
|
padding: 4px;
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 12px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-more .fbs-help {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-header {
|
||||||
|
font-weight: bold;
|
||||||
|
padding: 4px 6px;
|
||||||
|
margin: 2px 2px -2px 2px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-item-name label {
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.fbs-item-type,
|
||||||
|
.fbs-item-name label {
|
||||||
|
display: block;
|
||||||
|
overflow: hidden;
|
||||||
|
white-space: nowrap;
|
||||||
|
/* text-overflow:ellipsis;*/
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-item-name {
|
||||||
|
padding: 2px 8px 1px 6px;
|
||||||
|
font-size: 1.4em;
|
||||||
|
line-height: 1.4em;
|
||||||
|
background: #f4f8fb;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* result name */
|
||||||
|
.fbs-item-name strong {
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-item-type {
|
||||||
|
color: #777;
|
||||||
|
float: right;
|
||||||
|
font-size: 0.7em;
|
||||||
|
max-width: 40%;
|
||||||
|
padding-left: 0.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* hover state of .fbs-item */
|
||||||
|
li.fbs-selected {
|
||||||
|
cursor: pointer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------
|
||||||
|
Freebase Suggest Status
|
||||||
|
-------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
.fbs-status {
|
||||||
|
border: 1px solid #dae3e9;
|
||||||
|
padding: 4px 5px;
|
||||||
|
color: #000;
|
||||||
|
font-size: 0.7em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------
|
||||||
|
Freebase Suggest No Results
|
||||||
|
-------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
li.fbs-nomatch {
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-nomatch-text {
|
||||||
|
display: block;
|
||||||
|
font-weight: bold;
|
||||||
|
line-height: 1;
|
||||||
|
font-size: .9em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-nomatch-text,
|
||||||
|
.fbs-nomatch h3,
|
||||||
|
ul.fbs-search-tips {
|
||||||
|
padding: 6px 8px 7px 6px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-nomatch h3 {
|
||||||
|
font-weight: bold;
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
|
||||||
|
ul.fbs-search-tips li {
|
||||||
|
list-style: disc;
|
||||||
|
margin-left: 1.6em;
|
||||||
|
margin-bottom: 0.3em;
|
||||||
|
font-size: 0.9em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------
|
||||||
|
Freebase Suggest Create New
|
||||||
|
-------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* suggest new container */
|
||||||
|
.fbs-suggestnew {
|
||||||
|
padding: 0.4em 0.3em 0.5em 8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-suggestnew-button {
|
||||||
|
cursor: pointer;
|
||||||
|
padding: 0.2em 0.3em;
|
||||||
|
margin-left: 0px !important;
|
||||||
|
max-width: 17em;
|
||||||
|
font-size: .8em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-suggestnew-description {
|
||||||
|
margin-bottom: 0.6em;
|
||||||
|
font-size: 0.7em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* (Shift + Enter) */
|
||||||
|
.fbs-more-shortcut,
|
||||||
|
.fbs-suggestnew-shortcut {
|
||||||
|
margin-left: 0.4em;
|
||||||
|
font-size: 70%;
|
||||||
|
color: #999999;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** placeholder text **/
|
||||||
|
.fbs-placeholder {
|
||||||
|
color: #99a;
|
||||||
|
font-style: italic;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------
|
||||||
|
Freebase Suggest Flyout Elements
|
||||||
|
-------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
.fbs-flyout-id {
|
||||||
|
color: #999 !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* the object title */
|
||||||
|
h1#fbs-flyout-title {
|
||||||
|
font-size: 1.2em;
|
||||||
|
font-weight: bold;
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
margin-top: 0.3em;
|
||||||
|
}
|
||||||
|
|
||||||
|
h1#fbs-flyout-title .fbs-flyout-template-label {
|
||||||
|
color: #999999;
|
||||||
|
font-size: 0.8em;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* denotes topic, type, view, base, etc. */
|
||||||
|
#fbs-flyout-title .fbs-flyout-label {
|
||||||
|
font-weight: normal;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Image for single topic result */
|
||||||
|
#fbs-topic-image {
|
||||||
|
float: left;
|
||||||
|
padding: 1px;
|
||||||
|
margin-right: 5px;
|
||||||
|
margin-bottom: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* Image pair for views/base/etc. */
|
||||||
|
.fbs-flyout-images {
|
||||||
|
float: left;
|
||||||
|
margin: 0 10px 0 0;
|
||||||
|
padding: 1px 0 1px 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-flyout-images img {
|
||||||
|
float: left;
|
||||||
|
margin-right: 1px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-flyout-subtitle {
|
||||||
|
font-size: 1.1em;
|
||||||
|
margin-bottom: 0.5em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-flyout-pane h3 {
|
||||||
|
font-size: 1em;
|
||||||
|
line-height: 1.4;
|
||||||
|
margin-bottom: 0.25em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-properties-header {
|
||||||
|
font-size: 1em;
|
||||||
|
font-weight: bold;
|
||||||
|
margin: 0.5em 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
h3.fbs-topic-properties {
|
||||||
|
font-size: 1.2em;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-topic-properties strong {
|
||||||
|
display: inline;
|
||||||
|
font-size: 0.8em;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-flyout-pane p {
|
||||||
|
font-size: 1.2em;
|
||||||
|
line-height: 1.4;
|
||||||
|
max-height: 10em;
|
||||||
|
overflow: auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* this class is applied with fbs-topic-flyout when a thumbnail is present
|
||||||
|
in order to provide a fixed margin on text to prevent poor text wrapping
|
||||||
|
around thumbnail
|
||||||
|
*/
|
||||||
|
p.fbs-flyout-image-true,
|
||||||
|
h3.fbs-flyout-image-true,
|
||||||
|
h1.fbs-flyout-image-true { margin-left: 85px; }
|
||||||
|
|
||||||
|
.fbs-meta-info { margin-left: 110px; }
|
||||||
|
#fbs-user-flyout li {
|
||||||
|
margin-left: 100px;
|
||||||
|
}
|
||||||
|
#fbs-domain-flyout .fbs-meta-info { margin-left: 145px;}
|
||||||
|
|
||||||
|
/* generic flyout list */
|
||||||
|
.fbs-flyout-list li {
|
||||||
|
font-size: 1em;
|
||||||
|
margin-left: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
#fbs-domain-flyout #fbs-flyout-title { margin-bottom: 0.5em; }
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------
|
||||||
|
Freebase Suggest Attribution
|
||||||
|
-------------------------------------------------------
|
||||||
|
*/
|
||||||
|
|
||||||
|
.fbs-attribution {
|
||||||
|
padding-right: 72px; /* accommodate attribution background image */
|
||||||
|
background-image: url(//www.gstatic.com/freebase/img/freebase-cc-by-61x23.png);
|
||||||
|
background-repeat: no-repeat;
|
||||||
|
background-position: center right;
|
||||||
|
min-height: 15px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.fbs-flyout-types {
|
||||||
|
font-style: italic;
|
||||||
|
line-height: 1;
|
||||||
|
font-size: 1.2em;
|
||||||
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
-------------------------------------------------------
|
||||||
|
Freebase SuggestIE Hacks
|
||||||
|
-------------------------------------------------------
|
||||||
|
We can't use conditional comments so we have to resort
|
||||||
|
to inline Internet Explor fixes
|
||||||
|
|
||||||
|
*/
|
||||||
|
|
||||||
|
* html .fbs-list,
|
||||||
|
* html .fbs-list-icons { height: expression( this.scrollHeight > 410 ? "410" : "auto" ); /* sets max-height for IE */ }
|
||||||
|
|
||||||
|
* html .fbs-item-name {
|
||||||
|
width : 253px !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
* html .fbs-item-name{ width: 100%; }
|
||||||
|
|
||||||
|
* html .fbs-flyout-content:after { height: 1px; }
|
||||||
|
|
36
main/webapp/modules/core/externals/suggest/css/suggest-4_3.min.css
vendored
Normal file
36
main/webapp/modules/core/externals/suggest/css/suggest-4_3.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
1952
main/webapp/modules/core/externals/suggest/suggest-4_3.js
vendored
Normal file
1952
main/webapp/modules/core/externals/suggest/suggest-4_3.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
83
main/webapp/modules/core/externals/suggest/suggest-4_3.min.js
vendored
Normal file
83
main/webapp/modules/core/externals/suggest/suggest-4_3.min.js
vendored
Normal file
@ -0,0 +1,83 @@
|
|||||||
|
|
||||||
|
/*
|
||||||
|
* Copyright 2012, Google Inc.
|
||||||
|
* All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without
|
||||||
|
* modification, are permitted provided that the following conditions are
|
||||||
|
* met:
|
||||||
|
*
|
||||||
|
* * Redistributions of source code must retain the above copyright
|
||||||
|
* notice, this list of conditions and the following disclaimer.
|
||||||
|
* * 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.
|
||||||
|
* * Neither the name of Google Inc. 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
|
||||||
|
* OWNER 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.
|
||||||
|
*
|
||||||
|
* Additional Licenses for Third Party components can be found here:
|
||||||
|
* http://wiki.freebase.com/wiki/Freebase_Site_License
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
(function(b,v){if(!("console"in window)){var p=window.console={};p.log=p.warn=p.error=p.debug=function(){}}b(function(){var a=b("<div>");b(document.body).append(a);var c=setTimeout(function(){if(b.cleanData){var a=b.cleanData;b.cleanData=function(c){for(var d=0,g;null!=(g=c[d]);d++)b(g).triggerHandler("remove");a(c)}}else{var c=b.fn.remove;b.fn.remove=function(a,d){return this.each(function(){d||(!a||b.filter(a,[this]).length)&&b("*",this).add([this]).each(function(){b(this).triggerHandler("remove")});
|
||||||
|
return c.call(b(this),a,d)})}}},1);a.bind("remove",function(){clearTimeout(c)});a.remove()});var u={key:1,filter:1,spell:1,exact:1,lang:1,scoring:1,prefixed:1,stemmed:1,format:1,mql_output:1,output:1};b.suggest=function(a,c){b.fn[a]=function(c){this.length||console.warn("Suggest: invoked on empty element set");return this.each(function(){this.nodeName&&("INPUT"===this.nodeName.toUpperCase()?this.type&&"TEXT"!==this.type.toUpperCase()&&console.warn("Suggest: unsupported INPUT type: "+this.type):console.warn("Suggest: unsupported DOM element: "+
|
||||||
|
this.nodeName));var g=b.data(this,a);g&&g._destroy();b.data(this,a,new b.suggest[a](this,c))._init()})};b.suggest[a]=function(c,g){var f=this,d=this.options=b.extend(!0,{},b.suggest.defaults,b.suggest[a].defaults,g),i=d.css_prefix=d.css_prefix||"",h=d.css;this.name=a;b.each(h,function(a){h[a]=i+h[a]});d.ac_param={};b.each(u,function(a){var c=d[a];null===c||""===c||(d.ac_param[a]=c)});d.flyout_lang=null;if(d.ac_param.lang){var j=d.ac_param.lang;b.isArray(j)&&j.length&&(j=j.join(","));j&&(d.flyout_lang=
|
||||||
|
j)}this._status={START:"",LOADING:"",SELECT:"",ERROR:""};d.status&&(d.status instanceof Array&&3<=d.status.length)&&(this._status.START=d.status[0]||"",this._status.LOADING=d.status[1]||"",this._status.SELECT=d.status[2]||"",4===d.status.length&&(this._status.ERROR=d.status[3]||""));var j=this.status=b('<div style="display:none;">').addClass(h.status),m=this.list=b("<ul>").addClass(h.list),l=this.pane=b('<div style="display:none;" class="fbs-reset">').addClass(h.pane);l.append(j).append(m);d.parent?
|
||||||
|
b(d.parent).append(l):(l.css("position","absolute"),d.zIndex&&l.css("z-index",d.zIndex),b(document.body).append(l));l.bind("mousedown",function(a){f.input.data("dont_hide",true);a.stopPropagation()}).bind("mouseup",function(a){f.input.data("dont_hide")&&f.input.focus();f.input.removeData("dont_hide");a.stopPropagation()}).bind("click",function(a){a.stopPropagation();if(a=f.get_selected()){f.onselect(a,true);f.hide_all()}});m.hover(function(a){f.hoverover_list(a)},function(a){f.hoverout_list(a)});
|
||||||
|
this.input=b(c).attr("autocomplete","off").unbind(".suggest").bind("remove.suggest",function(){f._destroy()}).bind("keydown.suggest",function(a){f.keydown(a)}).bind("keypress.suggest",function(a){f.keypress(a)}).bind("keyup.suggest",function(a){f.keyup(a)}).bind("blur.suggest",function(a){f.blur(a)}).bind("textchange.suggest",function(){f.textchange()}).bind("focus.suggest",function(a){f.focus(a)}).bind(b.browser.msie?"paste.suggest":"input.suggest",function(){clearTimeout(f.paste_timeout);f.paste_timeout=
|
||||||
|
setTimeout(function(){f.textchange()},0)});this.onresize=function(){f.invalidate_position();if(l.is(":visible")){f.position();if(d.flyout&&f.flyoutpane&&f.flyoutpane.is(":visible")){var a=f.get_selected();a&&f.flyout_position(a)}}};b(window).bind("resize.suggest",this.onresize).bind("scroll.suggest",this.onresize)};b.suggest[a].prototype=b.extend({},b.suggest.prototype,c)};b.suggest.prototype={_init:function(){},_destroy:function(){this.pane.remove();this.list.remove();this.input.unbind(".suggest");
|
||||||
|
b(window).unbind("resize.suggest",this.onresize).unbind("scroll.suggest",this.onresize);this.input.removeData("data.suggest")},invalidate_position:function(){self._position=null},status_start:function(){this.hide_all();this.status.siblings().hide();this._status.START&&(this.status.text(this._status.START).show(),this.pane.is(":visible")||(this.position(),this.pane_show()));this._status.LOADING&&this.status.removeClass("loading")},status_loading:function(){this.status.siblings().show();this._status.LOADING?
|
||||||
|
(this.status.addClass("loading").text(this._status.LOADING).show(),this.pane.is(":visible")||(this.position(),this.pane_show())):this.status.hide()},status_select:function(){this.status.siblings().show();this._status.SELECT?this.status.text(this._status.SELECT).show():this.status.hide();this._status.LOADING&&this.status.removeClass("loading")},status_error:function(){this.status.siblings().show();this._status.ERROR?this.status.text(this._status.ERROR).show():this.status.hide();this._status.LOADING&&
|
||||||
|
this.status.removeClass("loading")},focus:function(a){""===this.input.val()?this.status_start():this.focus_hook(a)},focus_hook:function(){!this.input.data("data.suggest")&&(!this.pane.is(":visible")&&b("."+this.options.css.item,this.list).length)&&(this.position(),this.pane_show())},keydown:function(a){var c=a.keyCode;if(9===c)this.tab(a);else if(38===c||40===c)a.shiftKey||a.preventDefault()},keypress:function(a){var c=a.keyCode;38===c||40===c?a.shiftKey||a.preventDefault():13===c&&this.enter(a)},
|
||||||
|
keyup:function(a){var c=a.keyCode;if(38===c)a.preventDefault(),this.up(a);else if(40===c)a.preventDefault(),this.down(a);else if(a.ctrlKey&&77===c)b(".fbs-more-link",this.pane).click();else if(b.suggest.is_char(a)){clearTimeout(this.keypress.timeout);var e=this;this.keypress.timeout=setTimeout(function(){e.textchange()},0)}else 27===c&&this.escape(a);return!0},blur:function(){this.input.data("dont_hide")||(this.input.data("data.suggest"),this.hide_all())},tab:function(a){if(!a.shiftKey&&!a.metaKey&&
|
||||||
|
!a.ctrlKey){var a=this.options,a=this.pane.is(":visible")&&b("."+a.css.item,this.list).length,c=this.get_selected();a&&c&&(this.onselect(c),this.hide_all())}},enter:function(a){var c=this.options;if(this.pane.is(":visible")){if(a.shiftKey){this.shift_enter(a);a.preventDefault();return}if(b("."+c.css.item,this.list).length){var e=this.get_selected();if(e){this.onselect(e);this.hide_all();a.preventDefault();return}if(!c.soft&&(this.input.data("data.suggest"),b("."+this.options.css.item+":visible",this.list).length)){this.updown(!1);
|
||||||
|
a.preventDefault();return}}}c.soft?this.soft_enter():a.preventDefault()},soft_enter:function(){},shift_enter:function(){},escape:function(){this.hide_all()},up:function(a){this.updown(!0,a.ctrlKey||a.shiftKey)},down:function(a){this.updown(!1,null,a.ctrlKey||a.shiftKey)},updown:function(a,c,e){var g=this.options.css,f=this.list;if(this.pane.is(":visible")){var d=b("."+g.item+":visible",f);if(d.length){var f=b(d[0]),d=b(d[d.length-1]),i=this.get_selected()||[];clearTimeout(this.ignore_mouseover.timeout);
|
||||||
|
this._ignore_mouseover=!1;a?c?this._goto(f):i.length?i[0]==f[0]?(f.removeClass(g.selected),this.input.val(this.input.data("original.suggest")),this.hoverout_list()):(a=i.prevAll("."+g.item+":visible:first"),this._goto(a)):this._goto(d):e?this._goto(d):i.length?i[0]==d[0]?(d.removeClass(g.selected),this.input.val(this.input.data("original.suggest")),this.hoverout_list()):(a=i.nextAll("."+g.item+":visible:first"),this._goto(a)):this._goto(f)}}else a||this.textchange()},_goto:function(a){a.trigger("mouseover.suggest");
|
||||||
|
var c=a.data("data.suggest");this.input.val(c?c.name:this.input.data("original.suggest"));this.scroll_to(a)},scroll_to:function(a){var c=this.list,b=c.scrollTop(),g=b+c.innerHeight(),f=a.outerHeight(),a=a.prevAll().length*f,f=a+f;a<b?(this.ignore_mouseover(),c.scrollTop(a)):f>g&&(this.ignore_mouseover(),c.scrollTop(b+f-g))},textchange:function(){this.input.removeData("data.suggest");this.input.trigger("fb-textchange",this);var a=this.input.val();""===a?this.status_start():(this.status_loading(),this.request(a))},
|
||||||
|
request:function(){},response:function(a){if(a&&("cost"in a&&this.trackEvent(this.name,"response","cost",a.cost),this.check_response(a))){var c=[];b.isArray(a)?c=a:"result"in a&&(c=a.result);var e=b.map(arguments,function(a){return a});this.response_hook.apply(this,e);var g=null,f=this,d=this.options;b.each(c,function(c,b){if(!b.id&&b.mid)b.id=b.mid;var d=f.create_item(b,a).bind("mouseover.suggest",function(a){f.mouseover_item(a)});d.data("data.suggest",b);f.list.append(d);c===0&&(g=d)});this.input.data("original.suggest",
|
||||||
|
this.input.val());if(0===b("."+d.css.item,this.list).length&&d.nomatch){c=b('<li class="fbs-nomatch">');if("string"===typeof d.nomatch)c.text(d.nomatch);else if(d.nomatch.title&&c.append(b('<em class="fbs-nomatch-text">').text(d.nomatch.title)),d.nomatch.heading&&c.append(b("<h3>").text(d.nomatch.heading)),(d=d.nomatch.tips)&&d.length){var i=b('<ul class="fbs-search-tips">');b.each(d,function(a,c){i.append(b("<li>").text(c))});c.append(i)}c.bind("click.suggest",function(a){a.stopPropagation()});this.list.append(c)}e.push(g);
|
||||||
|
this.show_hook.apply(this,e);this.position();this.pane_show()}},pane_show:function(){var a=!1;b("> li",this.list).length&&(a=!0);a||this.pane.children(":not(."+this.options.css.list+")").each(function(){if("none"!=b(this).css("display"))return a=!0,!1});if(a)if(this.options.animate){var c=this;this.pane.slideDown("fast",function(){c.input.trigger("fb-pane-show",c)})}else this.pane.show(),this.input.trigger("fb-pane-show",this);else this.pane.hide(),this.input.trigger("fb-pane-hide",this)},create_item:function(a){var c=
|
||||||
|
this.options.css,e=b("<li>").addClass(c.item),a=b("<label>").text(a.name);e.append(b("<div>").addClass(c.item_name).append(a));return e},mouseover_item:function(a){if(!this._ignore_mouseover){a=a.target;"li"!==a.nodeName.toLowerCase()&&(a=b(a).parents("li:first"));var c=b(a),e=this.options.css;b("."+e.item,this.list).each(function(){this!==c[0]&&b(this).removeClass(e.selected)});c.hasClass(e.selected)||(c.addClass(e.selected),this.mouseover_item_hook(c))}},mouseover_item_hook:function(){},hoverover_list:function(){},
|
||||||
|
hoverout_list:function(){},check_response:function(){return!0},response_hook:function(){this.list.empty()},show_hook:function(){this.status_select()},position:function(){var a=this.pane,c=this.options;if(!c.parent){if(!self._position){var e=this.input,g=e.offset(),f=e.outerWidth(!0),d=e.outerHeight(!0);g.top+=d;var i=a.outerWidth(),h=a.outerHeight(),j=g.top+h/2,m=b(window).scrollLeft(),e=b(window).scrollTop(),l=b(window).width(),n=b(window).height()+e,k=!0;"left"==c.align?k=!0:"right"==c.align?k=
|
||||||
|
!1:g.left>m+l/2&&(k=!1);k||(k=g.left-(i-f),k>m&&(g.left=k));j>n&&(c=g.top-d-h,c>e&&(g.top=c));this._position=g}a.css({top:this._position.top,left:this._position.left})}},ignore_mouseover:function(){this._ignore_mouseover=!0;var a=this;this.ignore_mouseover.timeout=setTimeout(function(){a.ignore_mouseover_reset()},1E3)},ignore_mouseover_reset:function(){this._ignore_mouseover=!1},get_selected:function(){var a=null,c=this.options.css.selected;b("li",this.list).each(function(){var e=b(this);if(e.hasClass(c)&&
|
||||||
|
e.is(":visible"))return a=e,!1});return a},onselect:function(a){var c=a.data("data.suggest");c&&(this.input.val(c.name).data("data.suggest",c).trigger("fb-select",c),this.trackEvent(this.name,"fb-select","index",a.prevAll().length))},trackEvent:function(a,c,b,g){this.input.trigger("fb-track-event",{category:a,action:c,label:b,value:g})},hide_all:function(){this.pane.hide();this.input.trigger("fb-pane-hide",this)}};b.extend(b.suggest,{defaults:{status:["Start typing to get suggestions...","Searching...",
|
||||||
|
"Select an item from the list:","Sorry, something went wrong. Please try again later"],soft:!1,nomatch:"no matches",css:{pane:"fbs-pane",list:"fbs-list",item:"fbs-item",item_name:"fbs-item-name",selected:"fbs-selected",status:"fbs-status"},css_prefix:null,parent:null,animate:!1,zIndex:null},strongify:function(a,c){var e,g=a.toLowerCase().indexOf(c.toLowerCase());if(0<=g){var f=c.length;e=document.createTextNode(a.substring(0,g));var d=b("<strong>").text(a.substring(g,g+f)),g=document.createTextNode(a.substring(g+
|
||||||
|
f));e=b("<div>").append(e).append(d).append(g)}else e=b("<div>").text(a);return e},keyCode:{CAPS_LOCK:20,CONTROL:17,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,NUMPAD_ENTER:108,PAGE_DOWN:34,PAGE_UP:33,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,OPTION:18,APPLE:224},is_char:function(a){if("keypress"===a.type){if((a.metaKey||a.ctrlKey)&&118===a.charCode)return!0;if("isChar"in a)return a.isChar}else{var c=b.suggest.keyCode.not_char;c||(c={},b.each(b.suggest.keyCode,function(a,b){c[""+b]=1}),
|
||||||
|
b.suggest.keyCode.not_char=c);return!(""+a.keyCode in c)}},parse_input:function(a){for(var c=/(\S+)\:(?:\"([^\"]+)\"|(\S+))/g,e=a,g=[],f={},d=c.exec(a);d;)d[1]in u?f[d[1]]=b.isEmptyObject(d[2])?d[3]:d[2]:g.push(d[0]),e=e.replace(d[0],""),d=c.exec(a);e=b.trim(e.replace(/\s+/g," "));return[e,g,f]},mqlkey_fast:/^[_A-Za-z0-9][A-Za-z0-9_-]*$/,mqlkey_slow:/^(?:[A-Za-z0-9]|\$[A-F0-9]{4})(?:[A-Za-z0-9_-]|\$[A-F0-9]{4})*$/,check_mql_key:function(a){return b.suggest.mqlkey_fast.test(a)||b.suggest.mqlkey_slow.test(a)?
|
||||||
|
!0:!1},check_mql_id:function(a){if(0===a.indexOf("/")){a=a.split("/");a.shift();if(!(1==a.length&&""===a[0]))for(var c=0,e=a.length;c<e;c++)if(!b.suggest.check_mql_key(a[c]))return!1;return!0}return!1},is_system_type:function(a){return null==a?!1:0===a.indexOf("/type/")}});var w=b.suggest.prototype._destroy,x=b.suggest.prototype.show_hook;b.suggest("suggest",{_init:function(){var a=this,c=this.options;null==c.flyout_service_url&&(c.flyout_service_url=c.service_url);this.flyout_url=c.flyout_service_url;
|
||||||
|
c.flyout_service_path&&(this.flyout_url+=c.flyout_service_path);this.flyout_url=this.flyout_url.replace(/\$\{key\}/g,c.key);null==c.flyout_image_service_url&&(c.flyout_image_service_url=c.service_url);this.flyout_image_url=c.flyout_image_service_url;c.flyout_image_service_path&&(this.flyout_image_url+=c.flyout_image_service_path);this.flyout_image_url=this.flyout_image_url.replace(/\$\{key\}/g,c.key);b.suggest.cache||(b.suggest.cache={});if(c.flyout&&(this.flyoutpane=b('<div style="display:none;" class="fbs-reset">').addClass(c.css.flyoutpane),
|
||||||
|
c.flyout_parent?b(c.flyout_parent).append(this.flyoutpane):(this.flyoutpane.css("position","absolute"),c.zIndex&&this.flyoutpane.css("z-index",c.zIndex),b(document.body).append(this.flyoutpane)),this.flyoutpane.hover(function(b){a.hoverover_list(b)},function(b){a.hoverout_list(b)}).bind("mousedown.suggest",function(b){b.stopPropagation();a.pane.click()}),b.suggest.flyout||(b.suggest.flyout={}),!b.suggest.flyout.cache))b.suggest.flyout.cache={}},_destroy:function(){w.call(this);this.flyoutpane&&this.flyoutpane.remove();
|
||||||
|
this.input.removeData("request.count.suggest");this.input.removeData("flyout.request.count.suggest")},shift_enter:function(){this.options.suggest_new&&(this.suggest_new(),this.hide_all())},hide_all:function(){this.pane.hide();this.flyoutpane&&this.flyoutpane.hide();this.input.trigger("fb-pane-hide",this);this.input.trigger("fb-flyoutpane-hide",this)},request:function(a,c){var e=this,g=this.options,f=a,d=g.ac_param.filter||[],i=null;"string"===b.type(d)&&(d=[d]);d=d.slice();if(g.advanced){var h=b.suggest.parse_input(f),
|
||||||
|
f=h[0];h[1].length&&d.push("(all "+h[1].join(" ")+")");i=h[2];b.suggest.check_mql_id(f)&&(d.push('(any alias{start}:"'+f+'" mid:"'+f+'")'),i.prefixed=!0,f="")}h={};h[g.query_param_name]=f;c&&(h.cursor=c);b.extend(h,g.ac_param,i);d.length&&(h.filter=d);var j=g.service_url+g.service_path+"?"+b.param(h,!0);if(f=b.suggest.cache[j])this.response(f,c?c:-1,!0);else{clearTimeout(this.request.timeout);var m={url:g.service_url+g.service_path,data:h,traditional:!0,beforeSend:function(){var a=e.input.data("request.count.suggest")||
|
||||||
|
0;a||e.trackEvent(e.name,"start_session");a=a+1;e.trackEvent(e.name,"request","count",a);e.input.data("request.count.suggest",a)},success:function(d){b.suggest.cache[j]=d;d.prefix=a;e.response(d,c?c:-1)},error:function(a){e.status_error();e.trackEvent(e.name,"request","error",{url:this.url,response:a?a.responseText:""});e.input.trigger("fb-error",Array.prototype.slice.call(arguments))},complete:function(a){a&&e.trackEvent(e.name,"request","tid",a.getResponseHeader("X-Metaweb-TID"))},dataType:"jsonp",
|
||||||
|
cache:!0};this.request.timeout=setTimeout(function(){b.ajax(m)},g.xhr_delay)}},create_item:function(a,c){var e=this.options.css,g=b("<li>").addClass(e.item),f=b("<label>").append(b.suggest.strongify(a.name||a.id,c.prefix)),d=b("<div>").addClass(e.item_name).append(f),i=a.notable;a.under&&b(":first",f).append(b("<small>").text(" ("+a.under+")"));(null!=i&&b.suggest.is_system_type(i.id)||null!=this.options.scoring&&"SCHEMA"===this.options.scoring.toUpperCase())&&b(":first",f).append(b("<small>").text(" ("+
|
||||||
|
a.id+")"));g.append(d);e=b("<div>").addClass(e.item_type);i&&i.name?e.text(i.name):this.options.show_id&&a.id&&e.text(a.id);d.prepend(e);return g},mouseover_item_hook:function(a){a=a.data("data.suggest");this.options.flyout&&a&&this.flyout_request(a)},check_response:function(a){return a.prefix===this.input.val()},response_hook:function(a,c){this.flyoutpane&&this.flyoutpane.hide();0<c?b(".fbs-more",this.pane).remove():this.list.empty()},show_hook:function(a,c,e){x.apply(this,[a]);var g=this.options,
|
||||||
|
f=this,d=this.pane,i=this.list,h=a.result,j=b(".fbs-more",d),m=b(".fbs-suggestnew",d);b(".fbs-status",d);var l=a.correction;if(l&&l.length){var n=b('<a class="fbs-spell-link" href="#">').append(l[0]).bind("click.suggest",function(a){a.preventDefault();a.stopPropagation();f.input.val(l[0]).trigger("textchange")});f.status.empty().append("Search instead for ").append(n).show()}h&&h.length&&"cursor"in a?(j.length||(h=b('<a class="fbs-more-link" href="#" title="(Ctrl+m)">view more</a>'),j=b('<div class="fbs-more">').append(h),
|
||||||
|
h.bind("click.suggest",function(a){a.preventDefault();a.stopPropagation();a=b(this).parent(".fbs-more");f.more(a.data("cursor.suggest"))}),i.after(j)),j.data("cursor.suggest",a.cursor),j.show()):j.remove();g.suggest_new?(m.length||(a=b('<button class="fbs-suggestnew-button">'),a.text(g.suggest_new),m=b('<div class="fbs-suggestnew">').append('<div class="fbs-suggestnew-description">Your item not in the list?</div>').append(a).append('<span class="fbs-suggestnew-shortcut">(Shift+Enter)</span>').bind("click.suggest",
|
||||||
|
function(a){a.stopPropagation();f.suggest_new(a)}),d.append(m)),m.show()):m.remove();e&&(e.length&&0<c)&&(c=e.prevAll().length*e.outerHeight(),i.scrollTop(),i.animate({scrollTop:c},"slow",function(){e.trigger("mouseover.suggest")}))},suggest_new:function(){var a=this.input.val();""!==a&&(this.input.data("data.suggest",a).trigger("fb-select-new",a),this.trackEvent(this.name,"fb-select-new","index","new"),this.hide_all())},more:function(a){if(a){var b=this.input.data("original.suggest");null!==b&&this.input.val(b);
|
||||||
|
this.request(this.input.val(),a);this.trackEvent(this.name,"more","cursor",a)}return!1},flyout_request:function(a){var c=this,e=this.options,g=this.flyoutpane.data("data.suggest");if(g&&a.id===g.id)this.flyoutpane.is(":visible")||(a=this.get_selected(),this.flyout_position(a),this.flyoutpane.show(),this.input.trigger("fb-flyoutpane-show",this));else if((g=b.suggest.flyout.cache[a.id])&&g.id&&g.html)this.flyout_response(g);else{var f=a.id,d={url:this.flyout_url.replace(/\$\{id\}/g,a.id),traditional:!0,
|
||||||
|
beforeSend:function(){var a=c.input.data("flyout.request.count.suggest")||0,a=a+1;c.trackEvent(c.name,"flyout.request","count",a);c.input.data("flyout.request.count.suggest",a)},success:function(a){a["req:id"]=f;a.result&&a.result.length&&(a.html=b.suggest.suggest.create_flyout(a.result[0],c.flyout_image_url));b.suggest.flyout.cache[f]=a;c.flyout_response(a)},error:function(a){c.trackEvent(c.name,"flyout","error",{url:this.url,response:a?a.responseText:""})},complete:function(a){a&&c.trackEvent(c.name,
|
||||||
|
"flyout","tid",a.getResponseHeader("X-Metaweb-TID"))},dataType:"jsonp",cache:!0};e.flyout_lang&&(d.data={lang:e.flyout_lang});clearTimeout(this.flyout_request.timeout);this.flyout_request.timeout=setTimeout(function(){b.ajax(d)},e.xhr_delay);this.input.trigger("fb-request-flyout",d)}},flyout_response:function(a){var b=this.pane,e=this.get_selected()||[];if(b.is(":visible")&&e.length&&(b=e.data("data.suggest"))&&a["req:id"]===b.id&&a.html)this.flyoutpane.html(a.html),this.flyout_position(e),this.flyoutpane.show().data("data.suggest",
|
||||||
|
b),this.input.trigger("fb-flyoutpane-show",this)},flyout_position:function(a){if(!this.options.flyout_parent){var c=this.pane,e=this.flyoutpane,g=this.options.css,f=v,d=parseInt(e.css("top"),10),i=parseInt(e.css("left"),10),h=c.offset(),j=c.outerWidth(),m=e.outerHeight(),l=e.outerWidth();if("bottom"===this.options.flyout)f=h,j=this.input.offset(),f.top=h.top<j.top?f.top-m:f.top+c.outerHeight(),e.addClass(g.flyoutpane+"-bottom");else{f=a.offset();a=a.outerHeight();f.left+=j;var n=f.left+l,c=b(document.body).scrollLeft(),
|
||||||
|
k=b(window).width()+c;f.top=f.top+a-m;f.top<h.top&&(f.top=h.top);n>k&&(h=f.left-(j+l),h>c&&(f.left=h));e.removeClass(g.flyoutpane+"-bottom")}f.top===d&&f.left===i||e.css({top:f.top,left:f.left})}},hoverout_list:function(){this.flyoutpane&&!this.get_selected()&&this.flyoutpane.hide()}});b.extend(b.suggest.suggest,{defaults:{filter:null,spell:"always",exact:!1,scoring:null,lang:null,key:null,prefixed:!0,stemmed:null,format:null,advanced:!0,show_id:!0,query_param_name:"query",service_url:"https://www.googleapis.com/freebase/v1",
|
||||||
|
service_path:"/search",align:null,flyout:!0,flyout_service_url:null,flyout_service_path:"/search?filter=(all mid:${id})&output=(notable:/client/summary (description citation provenance) type)&key=${key}",flyout_image_service_url:null,flyout_image_service_path:"/image${id}?maxwidth=75&key=${key}&errorid=/freebase/no_image_png",flyout_parent:null,suggest_new:null,nomatch:{title:"No suggested matches",heading:"Tips on getting better suggestions:",tips:["Enter more or fewer characters","Add words related to your original search",
|
||||||
|
"Try alternate spellings","Check your spelling"]},css:{item_type:"fbs-item-type",flyoutpane:"fbs-flyout-pane"},xhr_delay:200},get_value_by_keys:function(a,c){for(var e=b.isArray(c)?c:Array.prototype.slice.call(arguments,1),g=0;g<e.length&&!(a=a[e[g]],null==a);g++);return a},get_value:function(a,c,e){if(null==a||null==c||0==c.length)return null;b.isArray(c)||(c=[c]);a=b.suggest.suggest.get_value_by_keys(a,c);if(e){if(null==a)return[];b.isArray(a)||(a=[a]);var g=[];b.each(a,function(a,c){if("object"===
|
||||||
|
b.type(c))if(null!=c.name)c=c.name;else if(c.id||c.mid)c=c.id||c.mid;else if(null!=c.value){var e=[];b.each(c,function(a,b){"value"!==a&&e.push(b)});c=c.value;e.length&&(c+=" ("+e.join(", ")+")")}b.isArray(c)&&c.length&&(c=c[0].value);null!=c&&g.push(c)});return g}return null==a?null:a},is_commons_id:function(a){return/^\/base\//.test(a)||/^\/user\//.test(a)?!1:!0},create_flyout:function(a,c){var e=b.suggest.suggest.get_value_by_keys,g=b.suggest.suggest.get_value,f=b.suggest.is_system_type,d=a.name,
|
||||||
|
i=null,h=null,j=[],m=[],l={};if((i=g(a,"notable"))&&i.name)m.push(i.name),l[i.name]=!0;i&&f(i.id)?i=a.id:(i=a.mid,h=c.replace(/\$\{id\}/g,i));var n=null,k=f=null,r=null,s=e(a,"output","description","/common/topic/description")||[];if(s.length){var o=s[0];b.each(s,function(a,b){if(e(b,"citation",0,"mid")=="/m/0d07ph"){o=b;return false}return true});n=b.isArray(o.value)&&o.value.length?o.value[0].value:o.value;if("REQUIRES_CITATION"==e(o,"provenance",0,"restrictions",0)){f=e(o,"provenance",0,"source",
|
||||||
|
0);if((k=e(o,"citation","provider",0,"name"))&&b.isArray(k)&&k.length)k=k[0].value;if((r=e(o,"citation","statement",0))&&r.value)r=r.value}}else b.each(["wikipedia","freebase"],function(b,c){if((s=g(a,["output","description",c],true))&&s.length){n=s[0];k=c;return false}return true});var p=g(a,["output","notable:/client/summary"]);if(p){var t=g(p,"/common/topic/notable_paths");t&&t.length&&b.each(t,function(a,b){var c=g(p,b,true);if(c&&c.length){var c=c.slice(0,3),d=b.split("/").pop();j.push([d,c.join(", ")])}})}(t=
|
||||||
|
g(a,["output","type","/type/object/type"],!0))&&t.length&&b.each(t,function(a,b){if(!l[b]){m.push(b);l[b]=true}});var q=b('<div class="fbs-flyout-content">');d&&q.append(b('<h1 id="fbs-flyout-title">').text(d));q.append(b('<h3 class="fbs-topic-properties fbs-flyout-id">').text(i));j=j.slice(0,3);b.each(j,function(a,c){q.append(b('<h3 class="fbs-topic-properties">').append(b("<strong>").text(c[0]+": ")).append(document.createTextNode(c[1])))});n&&(d=b('<p class="fbs-topic-article">'),k&&(f?d.append(b('<a class="fbs-citation">').attr("href",
|
||||||
|
f).attr("title",r||k).text("["+k+"]")):d.append(b('<em class="fbs-citation">').attr("title",r||k).text("["+k+"] "))),d.append(document.createTextNode(" "+n)),q.append(d));h&&(q.children().addClass("fbs-flyout-image-true"),q.prepend(b('<img id="fbs-topic-image" class="fbs-flyout-image-true" src="'+h+'">')));h=b('<span class="fbs-flyout-types">').text(m.slice(0,3).join(", "));h=b('<div class="fbs-attribution">').append(h);return b("<div>").append(q).append(h).html()}});document.createElement("input")})(jQuery);
|
Loading…
Reference in New Issue
Block a user