Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MetaGer
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor 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
open-source
MetaGer
Commits
0917088a
Commit
0917088a
authored
5 years ago
by
Dominik Hebeler
Browse files
Options
Downloads
Patches
Plain Diff
switched position for savedfoki
parent
6a176993
No related branches found
Branches containing commit
No related tags found
2 merge requests
!1551
Development
,
!1550
Resolve "Load Quicktips in an IFrame"
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
resources/js/result-saver.js
+11
-11
11 additions, 11 deletions
resources/js/result-saver.js
with
11 additions
and
11 deletions
resources/js/result-saver.js
+
11
−
11
View file @
0917088a
...
...
@@ -16,7 +16,7 @@ $(document).ready(function () {
* Load all saved results and sort them
* @param {String} sort The type of sorting function to call for these results
*/
function
Results
()
{
function
Results
()
{
if
(
!
localStorage
)
return
;
this
.
prefix
=
'
result_
'
;
this
.
sort
=
'
chronological
'
;
...
...
@@ -29,8 +29,8 @@ function Results () {
*/
Results
.
prototype
.
addResult
=
function
(
result
)
{
if
(
this
.
results
.
every
(
function
(
val
)
{
return
val
.
hash
!==
result
.
hash
;
}))
{
return
val
.
hash
!==
result
.
hash
;
}))
{
this
.
results
.
push
(
result
);
}
};
...
...
@@ -120,7 +120,7 @@ Results.prototype.updateResultPageInterface = function () {
<h1>
'
+
t
(
'
result-saver.title
'
)
+
'
</h1>
\
</div>
\
'
);
$
(
'
#additions-container
'
).
a
ppend
(
tabPanel
);
$
(
'
#additions-container
'
).
p
re
pend
(
tabPanel
);
}
else
{
// If there already is a savedFoki element, get it
$
(
'
#savedFoki
'
).
html
(
''
);
...
...
@@ -178,7 +178,7 @@ Results.prototype.addToContainer = function (container) {
if
(
html
.
toLowerCase
().
indexOf
(
search
.
toLowerCase
())
===
-
1
)
{
// hide entire result block
$
(
value
).
parent
().
addClass
(
'
hidden
'
);
}
else
{
}
else
{
// show entire result block
$
(
value
).
parent
().
removeClass
(
'
hidden
'
);
}
...
...
@@ -218,7 +218,7 @@ Results.prototype.addToContainer = function (container) {
* @param {int} rank The rank of this result
* @param {int} hash The hash value for this result
*/
function
Result
(
title
,
link
,
hosterName
,
hosterLink
,
anzeigeLink
,
description
,
anonym
,
index
,
hash
)
{
function
Result
(
title
,
link
,
hosterName
,
hosterLink
,
anzeigeLink
,
description
,
anonym
,
index
,
hash
)
{
// Set prefix for localstorage
this
.
prefix
=
'
result_
'
;
...
...
@@ -313,7 +313,7 @@ Result.prototype.save = function () {
* Convert a string into base64 format
* @param {String} str The string to convert
*/
function
b64EncodeUnicode
(
str
)
{
function
b64EncodeUnicode
(
str
)
{
return
btoa
(
encodeURIComponent
(
str
).
replace
(
/%
([
0-9A-F
]{2})
/g
,
function
(
match
,
p1
)
{
return
String
.
fromCharCode
(
'
0x
'
+
p1
);
}));
...
...
@@ -323,7 +323,7 @@ function b64EncodeUnicode (str) {
* Convert a base64 string into normal format
* @param {String} str The string to convert
*/
function
b64DecodeUnicode
(
str
)
{
function
b64DecodeUnicode
(
str
)
{
return
decodeURIComponent
(
Array
.
prototype
.
map
.
call
(
atob
(
str
),
function
(
c
)
{
return
'
%
'
+
(
'
00
'
+
c
.
charCodeAt
(
0
).
toString
(
16
)).
slice
(
-
2
);
}).
join
(
''
));
...
...
@@ -389,7 +389,7 @@ Result.prototype.toHtml = function () {
</div>
'
);
// Add a click listener to the remover, that removes the result on click
$
(
result
).
find
(
'
.remover
'
).
click
({
caller
:
this
},
function
(
event
)
{
$
(
result
).
find
(
'
.remover
'
).
click
({
caller
:
this
},
function
(
event
)
{
event
.
data
.
caller
.
remove
();
});
...
...
@@ -400,7 +400,7 @@ Result.prototype.toHtml = function () {
* Saves the result at the given index
* @param {int} index The index of the result to save
*/
function
resultSaver
(
index
)
{
function
resultSaver
(
index
)
{
// Remember the original result element
var
original
=
$
(
'
.result[data-count=
'
+
index
+
'
]
'
);
...
...
@@ -428,6 +428,6 @@ function resultSaver (index) {
// Animate the result transfer to the saved results
var
transferTarget
=
$
(
'
.saved-result[data-count=
'
+
index
+
'
]
'
);
if
(
original
.
length
>
0
&&
transferTarget
.
length
>
0
)
{
$
(
original
).
transfer
({
to
:
transferTarget
,
duration
:
1000
});
$
(
original
).
transfer
({
to
:
transferTarget
,
duration
:
1000
});
}
}
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