Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
Imldeployment
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
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
IML Open Source
Imldeployment
Commits
870bc33e
Commit
870bc33e
authored
1 year ago
by
Hahn Axel (hahn)
Browse files
Options
Downloads
Patches
Plain Diff
add winbox functions
parent
3d8c3264
No related branches found
No related tags found
1 merge request
!62
V2.0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
public_html/deployment/js/functions.js
+150
-125
150 additions, 125 deletions
public_html/deployment/js/functions.js
with
150 additions
and
125 deletions
public_html/deployment/js/functions.js
+
150
−
125
View file @
870bc33e
// ----------------------------------------------------------------------
// VARS
// ----------------------------------------------------------------------
var
aWinBoxes
=
{};
var
WINBOX_background
=
"
#456
"
;
// ----------------------------------------------------------------------
// FUNCTIONS
// ----------------------------------------------------------------------
/**
/**
* initialize soft scrolling for links with css class "scroll-link"
* initialize soft scrolling for links with css class "scroll-link"
...
@@ -22,28 +32,45 @@ function initSoftscroll(){
...
@@ -22,28 +32,45 @@ function initSoftscroll(){
});
});
}
}
/**
* Shows a modal message by setting the inner HTML of div#divmodalmessage
* to the given message, and showing div#divmodal.
*
* @param {string} sMessage - The message to display in the modal
*/
function
showModalMessage
(
sMessage
)
{
function
showModalMessage
(
sMessage
)
{
$
(
'
#divmodalmessage
'
).
html
(
sMessage
);
$
(
'
#divmodalmessage
'
).
html
(
sMessage
);
$
(
'
#divmodal
'
).
show
();
$
(
'
#divmodal
'
).
show
();
}
}
function
showIdAsModalMessage
(
sId
,
sTitle
){
/**
* Hide modal message box
*/
function
hideModalMessage
()
{
$
(
'
#divmodal
'
).
hide
();
return
false
;
}
var
o
=
$
(
'
#
'
+
sId
);
var
sHtml
=
'
<a href="#" onclick="return hideModalMessage()" class="btn btn-danger" style="float:right"> X </a>
'
+
o
.
html
()
+
'
<hr><a href="#" onclick="return hideModalMessage()" class="btn btn-primary"><i class="fa fa-check"></i> OK </a>
'
;
$
(
'
#divmodalmessage
'
).
html
(
sHtml
);
$
(
'
#divmodal
'
).
show
();
/*
/**
* show a window displaying the content of a given dom id using Winbox
*
* @param {string} sId dom id of a div to show
* @param {string} sTitle title for the winbox window
* @returns
*/
function
showIdAsModalMessage
(
sId
,
sTitle
)
{
if
(
aWinBoxes
[
sId
])
{
return
true
;
}
var
oWrapper
=
document
.
getElementById
(
sId
);
var
oWrapper
=
document
.
getElementById
(
sId
);
new
WinBox({
aWinBoxes
[
sId
]
=
WinBox
({
title
:
sTitle
,
title
:
sTitle
,
id
:
'
winbox-
'
+
sId
,
id
:
'
winbox-
'
+
sId
,
border
:
5
,
border
:
5
,
background:
"#628"
,
background
:
WINBOX_background
,
class
:
[
"
no-min
"
,
"
no-max
"
,
"
no-full
"
,
"
ciwinboxinfos
"
],
class
:
[
"
no-min
"
,
"
no-max
"
,
"
no-full
"
,
"
ciwinboxinfos
"
],
// modal: true, // collides with bootsrap3 .modal.less
// modal: true, // collides with bootsrap3 .modal.less
...
@@ -60,23 +87,19 @@ function showIdAsModalMessage(sId, sTitle){
...
@@ -60,23 +87,19 @@ function showIdAsModalMessage(sId, sTitle){
bottom
:
20
,
bottom
:
20
,
left
:
20
,
left
:
20
,
// take content from existing div
// take content from existing div
// mount: oWrapper
// mount: oWrapper
html: oWrapper.innerHTML
// mount: document.getElementById(sId).cloneNode(true),
// html: 'hello'
html
:
oWrapper
.
innerHTML
,
});
*/
onclose
:
function
()
{
return
false
;
delete
aWinBoxes
[
sId
]
;
}
}
});
function
hideModalMessage
(){
$
(
'
#divmodal
'
).
hide
();
return
false
;
return
false
;
}
}
var
aWinBoxes
=
{};
/**
/**
* shellcmd plugin ... toggle output window
* shellcmd plugin ... toggle output window
* @param {string} isPluginOutputDiv id of the wrapper
* @param {string} isPluginOutputDiv id of the wrapper
...
@@ -92,7 +115,7 @@ function toggleShellWindow(isPluginOutputDiv, oLink){
...
@@ -92,7 +115,7 @@ function toggleShellWindow(isPluginOutputDiv, oLink){
id
:
'
winbox-
'
+
isPluginOutputDiv
,
id
:
'
winbox-
'
+
isPluginOutputDiv
,
border
:
5
,
border
:
5
,
/*background: "#628",*/
/*background: "#628",*/
background
:
"
#478
"
,
background
:
WINBOX_background
,
class
:
[
"
no-min
"
,
"
no-max
"
,
/* "no-full", "no-resize", "no-move"*/
"
ciwinbox
"
],
class
:
[
"
no-min
"
,
"
no-max
"
,
/* "no-full", "no-resize", "no-move"*/
"
ciwinbox
"
],
// position + size
// position + size
...
@@ -378,3 +401,5 @@ function generateSecret(length){
...
@@ -378,3 +401,5 @@ function generateSecret(length){
}
}
return
result
;
return
result
;
}
}
// ----------------------------------------------------------------------
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