Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
U
UNL_Search
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Digital Experience Group
UNL_Search
Commits
6c1f01c2
Commit
6c1f01c2
authored
13 years ago
by
Brett Bieber
Browse files
Options
Downloads
Patches
Plain Diff
Move from the deprecated WebSearch api to the CustomSearchControl api.
parent
ea6382c3
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
www/searchFunc.js
+10
-17
10 additions, 17 deletions
www/searchFunc.js
with
10 additions
and
17 deletions
www/searchFunc.js
+
10
−
17
View file @
6c1f01c2
...
...
@@ -21,29 +21,22 @@ function searchInit() {
}
}
UNL_Search
.
unl_search
=
new
google
.
search
.
WebSearch
();
//Apply the Custom Search Engine
UNL_Search
.
unl_search
.
setSiteRestriction
(
"
015236299699564929946:nk1siew10ie
"
);
UNL_Search
.
unl_search
.
setResultSetSize
(
GSearch
.
LARGE_RESULTSET
)
UNL_Search
.
unl_search
.
setSearchCompleteCallback
(
UNL_Search
,
UNL_Search
.
handleUNLResults
)
UNL_Search
.
unl_search
.
setLinkTarget
(
GSearch
.
LINK_TARGET_SELF
);
UNL_Search
.
unl_search
=
new
google
.
search
.
CustomSearchControl
(
"
015236299699564929946:nk1siew10ie
"
);
UNL_Search
.
unl_search
.
setResultSetSize
(
google
.
search
.
Search
.
FILTERED_CSE_RESULTSET
);
UNL_Search
.
unl_search
.
setSearchCompleteCallback
(
UNL_Search
.
handleUNLResults
)
UNL_Search
.
unl_search
.
draw
(
'
unl_results
'
);
if
(
UNL_Search
.
do_local_search
)
{
UNL_Search
.
local_search
=
new
google
.
search
.
WebSearch
();
//Apply the Custom Search Engine
UNL_Search
.
local_search
.
setSiteRestriction
(
UNL_Search
.
local_search_context
);
//UNL_Search.local_search.setSiteRestriction('000150017203523626721:-1etga1qfci');
UNL_Search
.
local_search
.
setResultSetSize
(
GSearch
.
SMALL_RESULTSET
)
UNL_Search
.
local_search
.
setSearchCompleteCallback
(
UNL_Search
,
UNL_Search
.
handleLocalResults
)
UNL_Search
.
local_search
.
setLinkTarget
(
GSearch
.
LINK_TARGET_SELF
);
UNL_Search
.
local_search
=
new
google
.
search
.
CustomSearchControl
(
UNL_Search
.
local_search_context
);
UNL_Search
.
local_search
.
setResultSetSize
(
'
small
'
)
UNL_Search
.
local_search
.
setSearchCompleteCallback
(
UNL_Search
.
handleLocalResults
)
UNL_Search
.
local_search
.
draw
(
'
local_results
'
);
}
var
gSearchForm
=
new
GSearchForm
(
false
,
document
.
getElementById
(
"
searchform
"
));
gSearchForm
.
setOnSubmitCallback
(
UNL_Search
,
UNL_Search
.
doQuery
);
gSearchForm
.
input
.
value
=
(
UNL_Search
.
query
?
UNL_Search
.
query
:
""
);
// Execute an inital search
if
(
UNL_Search
.
query
&&
UNL_Search
.
query
!=
""
)
{
UNL_Search
.
unl_search
.
execute
(
UNL_Search
.
query
);
...
...
@@ -55,7 +48,7 @@ function searchInit() {
}
//Attach search initializer to onLoad
google
.
setOnLoadCallback
(
searchInit
);
google
.
setOnLoadCallback
(
searchInit
,
true
);
//
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment