Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
core
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
minerva
core
Commits
42085912
Commit
42085912
authored
7 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
formatting
parent
6572b43c
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!93
Resolve "export should use API"
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend-js/src/main/js/GuiConnector.js
+28
-27
28 additions, 27 deletions
frontend-js/src/main/js/GuiConnector.js
frontend-js/src/main/js/ServerConnector.js
+324
-324
324 additions, 324 deletions
frontend-js/src/main/js/ServerConnector.js
with
352 additions
and
351 deletions
frontend-js/src/main/js/GuiConnector.js
+
28
−
27
View file @
42085912
...
...
@@ -26,11 +26,11 @@ GuiConnector.yPos = 0;
* List of GET params passed via url.
*/
GuiConnector
.
init
=
function
()
{
GuiConnector
.
init
=
function
()
{
var
self
=
this
;
if
(
!
String
.
prototype
.
endsWith
)
{
String
.
prototype
.
endsWith
=
function
(
pattern
)
{
String
.
prototype
.
endsWith
=
function
(
pattern
)
{
var
d
=
this
.
length
-
pattern
.
length
;
return
d
>=
0
&&
this
.
lastIndexOf
(
pattern
)
===
d
;
};
...
...
@@ -41,7 +41,7 @@ GuiConnector.init = function() {
alert
(
"
This webpage works well with Chrome, Firefox and Safari.
"
);
}
// bootstrap tab initialization
$
(
"
ul.nav-tabs a
"
).
click
(
function
(
e
)
{
$
(
"
ul.nav-tabs a
"
).
click
(
function
(
e
)
{
e
.
preventDefault
();
$
(
this
).
tab
(
'
show
'
);
});
...
...
@@ -49,16 +49,17 @@ GuiConnector.init = function() {
self
.
getParams
=
[];
// find GuiConnector.getParams
window
.
location
.
search
.
replace
(
/
\??(?:([^
=
]
+
)
=
([^
&
]
*
)
&
?)
/g
,
function
()
{
window
.
location
.
search
.
replace
(
/
\??(?:([^
=
]
+
)
=
([^
&
]
*
)
&
?)
/g
,
function
()
{
function
decode
(
s
)
{
return
decodeURIComponent
(
s
.
split
(
"
+
"
).
join
(
"
"
));
}
GuiConnector
.
getParams
[
decode
(
arguments
[
1
])]
=
decode
(
arguments
[
2
]);
});
// forser browser to update mouse coordinates whenever mouse move
jQuery
(
document
).
ready
(
function
()
{
$
(
document
).
mousemove
(
function
(
e
)
{
jQuery
(
document
).
ready
(
function
()
{
$
(
document
).
mousemove
(
function
(
e
)
{
GuiConnector
.
updateMouseCoordinates
(
e
.
pageX
,
e
.
pageY
);
});
});
...
...
@@ -70,7 +71,7 @@ GuiConnector.init = function() {
self
.
addWindowResizeEvent
(
window
.
onresize
);
}
window
.
onresize
=
function
()
{
window
.
onresize
=
function
()
{
for
(
var
i
=
0
;
i
<
self
.
_windowResizeEvents
.
length
;
i
++
)
{
self
.
_windowResizeEvents
[
i
]();
}
...
...
@@ -78,18 +79,18 @@ GuiConnector.init = function() {
}
};
GuiConnector
.
addWindowResizeEvent
=
function
(
handler
)
{
GuiConnector
.
addWindowResizeEvent
=
function
(
handler
)
{
this
.
_windowResizeEvents
.
push
(
handler
);
};
/**
* Returns name of the file with LCSB logo.
*
*
* @param bigLogo
* {@link Boolean} value determining if we want to have big logo or
* small one
*/
GuiConnector
.
getLcsbLogoImg
=
function
(
bigLogo
)
{
GuiConnector
.
getLcsbLogoImg
=
function
(
bigLogo
)
{
if
(
bigLogo
)
{
return
'
lcsb_logo_mid.png
'
;
}
else
{
...
...
@@ -101,26 +102,26 @@ GuiConnector.getLcsbLogoImg = function(bigLogo) {
* Returns name of the file with image that should be presented when we are
* wainting for data to be loaded.
*/
GuiConnector
.
getLoadingImg
=
function
()
{
GuiConnector
.
getLoadingImg
=
function
()
{
return
"
icons/ajax-loader.gif
"
;
};
/**
* Returns home directory for images in the application.
*/
GuiConnector
.
getImgPrefix
=
function
()
{
GuiConnector
.
getImgPrefix
=
function
()
{
return
"
resources/images/
"
;
};
/**
* Updates coordinates of the mouse in the browser.
*/
GuiConnector
.
updateMouseCoordinates
=
function
(
x
,
y
)
{
GuiConnector
.
updateMouseCoordinates
=
function
(
x
,
y
)
{
this
.
xPos
=
x
;
this
.
yPos
=
y
;
};
GuiConnector
.
showProcessing
=
function
(
messageText
)
{
GuiConnector
.
showProcessing
=
function
(
messageText
)
{
var
self
=
GuiConnector
;
if
(
self
.
_processingDialog
===
undefined
)
{
self
.
_processingDialog
=
document
.
createElement
(
"
div
"
);
...
...
@@ -128,11 +129,11 @@ GuiConnector.showProcessing = function(messageText) {
self
.
_processingDialog
.
appendChild
(
self
.
_errorDialogContent
);
document
.
body
.
appendChild
(
self
.
_processingDialog
);
$
(
self
.
_processingDialog
).
dialog
({
modal
:
true
,
title
:
"
PROCESSING
"
,
width
:
"
150px
"
,
closeOnEscape
:
false
,
open
:
function
(
event
,
ui
)
{
modal
:
true
,
title
:
"
PROCESSING
"
,
width
:
"
150px
"
,
closeOnEscape
:
false
,
open
:
function
(
event
,
ui
)
{
$
(
"
.ui-dialog-titlebar-close
"
,
ui
).
hide
();
},
});
...
...
@@ -141,8 +142,8 @@ GuiConnector.showProcessing = function(messageText) {
messageText
=
"
PROCESSING
"
;
}
var
messageImg
=
Functions
.
createElement
({
type
:
"
img
"
,
src
:
'
resources/images/icons/ajax-loader.gif
'
,
type
:
"
img
"
,
src
:
'
resources/images/icons/ajax-loader.gif
'
,
});
self
.
_errorDialogContent
.
innerHTML
=
""
;
self
.
_errorDialogContent
.
style
.
textAlign
=
"
center
"
;
...
...
@@ -153,12 +154,12 @@ GuiConnector.showProcessing = function(messageText) {
$
(
self
.
_processingDialog
).
dialog
(
"
open
"
);
};
GuiConnector
.
hideProcessing
=
function
()
{
GuiConnector
.
hideProcessing
=
function
()
{
var
self
=
GuiConnector
;
$
(
self
.
_processingDialog
).
dialog
(
"
close
"
);
};
GuiConnector
.
alert
=
function
(
error
)
{
GuiConnector
.
alert
=
function
(
error
)
{
var
self
=
GuiConnector
;
logger
.
error
(
error
);
if
(
self
.
_errorDialog
===
undefined
)
{
...
...
@@ -167,11 +168,11 @@ GuiConnector.alert = function(error) {
self
.
_errorDialog
.
appendChild
(
self
.
_errorDialogContent
);
document
.
body
.
appendChild
(
self
.
_errorDialog
);
$
(
self
.
_errorDialog
).
dialog
({
classes
:
{
"
ui-dialog
"
:
"
ui-state-error
"
classes
:
{
"
ui-dialog
"
:
"
ui-state-error
"
},
modal
:
true
,
title
:
"
ERROR
"
modal
:
true
,
title
:
"
ERROR
"
}).
siblings
(
'
.ui-dialog-titlebar
'
).
css
(
"
background
"
,
"
red
"
);
}
var
message
=
error
;
...
...
This diff is collapsed.
Click to expand it.
frontend-js/src/main/js/ServerConnector.js
+
324
−
324
View file @
42085912
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