Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
dariah
search-commons-webresources
Commits
4fb648dd
Commit
4fb648dd
authored
Feb 14, 2018
by
Gradl, Tobias
Browse files
987: Collection wordclouds only work for oai_dc based collections
Task-Url:
https://pm.winseda.de/issues/987
parent
6460eeca
Changes
3
Hide whitespace changes
Inline
Side-by-side
css/application.css
View file @
4fb648dd
...
...
@@ -370,6 +370,7 @@ a:active i {
.wordcloud
{
text-align
:
center
;
margin-top
:
10px
;
}
.wordcloud
text
:hover
{
...
...
js/home.js
View file @
4fb648dd
...
...
@@ -25,7 +25,7 @@ var Home = function(options) {
};
Home
.
prototype
.
handleTagTextClicked
=
function
(
tag
)
{
$
(
"
#expression
"
).
val
(
tag
.
coun
t
);
$
(
"
#expression
"
).
val
(
tag
.
tex
t
);
$
(
"
#search-form
"
).
submit
();
};
...
...
js/search/search.js
View file @
4fb648dd
...
...
@@ -26,6 +26,7 @@ $(document).ready(function() {
var
clouds
=
[];
queryHandler
.
loadPlaceholderTagcloud
();
/*queryHandler.assignEventHandlers();
queryHandler.updateDisplayedCollections();
...
...
@@ -89,6 +90,57 @@ var QueryHandler = function(options) {
}
};
QueryHandler
.
prototype
.
loadPlaceholderTagcloud
=
function
()
{
var
_this
=
this
;
$
.
ajax
({
url
:
__util
.
getBaseUrl
()
+
(
_this
.
options
.
customSearch
!=
null
?
(
"
/custom/
"
+
_this
.
options
.
customSearch
)
:
""
)
+
"
/tags?analyzer=Wordcloud&size=100
"
,
type
:
"
GET
"
,
dataType
:
"
json
"
,
success
:
function
(
data
)
{
var
tags
=
[];
for
(
var
i
=
0
;
i
<
data
.
length
;
i
++
)
{
tags
.
push
({
text
:
data
[
i
].
term
,
size
:
(
data
[
i
].
weight
*
80
)
+
7
,
title
:
data
[
i
].
count
+
"
occurences
"
});
}
tagCloud
=
new
TagCloud
({
tags
:
tags
,
containerSelector
:
"
#wordcloud-placeholder
"
,
animateFontSize
:
true
,
w
:
600
,
h
:
400
,
textClickEvent
:
function
(
tag
)
{
_this
.
expandSearch
(
tag
.
text
);
}
});
}
});
};
QueryHandler
.
prototype
.
expandSearch
=
function
(
expression
)
{
if
(
expression
==
null
||
expression
===
""
)
{
return
;
}
var
_this
=
this
;
if
(
$
(
"
#expression
"
).
length
>
0
)
{
if
(
$
(
"
#expression
"
).
val
().
length
>
0
)
{
$
(
"
#expression
"
).
val
(
$
(
"
#expression
"
).
val
()
+
"
"
+
expression
);
}
else
{
$
(
"
#expression
"
).
val
(
expression
);
}
this
.
doSearch
();
}
else
if
(
"
#facet-selection-container
"
.
length
>
0
)
{
this
.
addSearchFacet
(
function
(
facetElement
)
{
$
(
facetElement
).
find
(
"
.search-facet-expression
"
).
val
(
expression
);
//_this.doSearch();
});
}
};
QueryHandler
.
prototype
.
selectFacetingSchema
=
function
()
{
this
.
schemaId
=
$
(
"
#schemaId
"
).
val
();
var
container
=
$
(
"
#facet-schema-info
"
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment