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
1f6d418d
Commit
1f6d418d
authored
6 years ago
by
Piotr Gawron
Browse files
Options
Downloads
Patches
Plain Diff
export uses guiUtils tab implementation
parent
12e85568
No related branches found
No related tags found
1 merge request
!369
Resolve "Functionality to update Terms of Service"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
frontend-js/src/main/js/Export.js
+43
-109
43 additions, 109 deletions
frontend-js/src/main/js/Export.js
frontend-js/src/test/js/Export-test.js
+2
-1
2 additions, 1 deletion
frontend-js/src/test/js/Export-test.js
with
45 additions
and
110 deletions
frontend-js/src/main/js/Export.js
+
43
−
109
View file @
1f6d418d
...
@@ -4,27 +4,29 @@
...
@@ -4,27 +4,29 @@
var
Promise
=
require
(
"
bluebird
"
);
var
Promise
=
require
(
"
bluebird
"
);
var
AbstractGuiElement
=
require
(
'
./gui/AbstractGuiElement
'
);
var
CustomMapOptions
=
require
(
'
./map/CustomMapOptions
'
);
var
CustomMapOptions
=
require
(
'
./map/CustomMapOptions
'
);
var
ElementExportPanel
=
require
(
'
./gui/export/ElementExportPanel
'
);
var
ElementExportPanel
=
require
(
'
./gui/export/ElementExportPanel
'
);
var
GraphicsExportPanel
=
require
(
'
./gui/export/GraphicsExportPanel
'
);
var
GraphicsExportPanel
=
require
(
'
./gui/export/GraphicsExportPanel
'
);
var
NetworkExportPanel
=
require
(
'
./gui/export/NetworkExportPanel
'
);
var
NetworkExportPanel
=
require
(
'
./gui/export/NetworkExportPanel
'
);
var
Header
=
require
(
'
./gui/Header
'
);
var
Header
=
require
(
'
./gui/Header
'
);
var
ObjectWithListeners
=
require
(
'
./ObjectWithListeners
'
);
// noinspection JSUnusedLocalSymbols
var
logger
=
require
(
'
./logger
'
);
var
logger
=
require
(
'
./logger
'
);
var
Functions
=
require
(
'
./Functions
'
);
var
Functions
=
require
(
'
./Functions
'
);
var
GuiUtils
=
require
(
'
./gui/leftPanel/GuiUtils
'
);
/**
/**
* Default constructor.
* Default constructor.
*
*
* @param options
* @param
{CustomMapOptions}
options
* CustomMapOptions object representing all parameters needed for map
* CustomMapOptions object representing all parameters needed for map
* creation
* creation
* @constructor
*/
*/
function
Export
(
options
)
{
function
Export
(
options
)
{
var
self
=
this
;
var
self
=
this
;
self
.
_panels
=
[];
self
.
_tabIdCount
=
0
;
if
(
!
(
options
instanceof
CustomMapOptions
))
{
if
(
!
(
options
instanceof
CustomMapOptions
))
{
options
=
new
CustomMapOptions
(
options
);
options
=
new
CustomMapOptions
(
options
);
}
}
...
@@ -32,124 +34,53 @@ function Export(options) {
...
@@ -32,124 +34,53 @@ function Export(options) {
self
.
setElement
(
options
.
getElement
());
self
.
setElement
(
options
.
getElement
());
self
.
setConfiguration
(
options
.
getConfiguration
());
self
.
setConfiguration
(
options
.
getConfiguration
());
self
.
setServerConnector
(
options
.
getServerConnector
());
self
.
_createGui
();
self
.
_createGui
();
}
}
Export
.
prototype
=
Object
.
create
(
ObjectWithListeners
.
prototype
);
Export
.
prototype
=
Object
.
create
(
AbstractGuiElement
.
prototype
);
Export
.
prototype
.
constructor
=
ObjectWithListeners
;
Export
.
prototype
.
constructor
=
AbstractGuiElement
;
Export
.
prototype
.
_createGui
=
function
()
{
/**
*
* @private
*/
Export
.
prototype
.
_createGui
=
function
()
{
var
self
=
this
;
var
self
=
this
;
self
.
getElement
().
innerHTML
=
""
;
self
.
getElement
().
innerHTML
=
""
;
var
headerDiv
=
Functions
.
createElement
({
var
headerDiv
=
Functions
.
createElement
({
type
:
"
div
"
type
:
"
div
"
});
});
new
Header
({
new
Header
({
element
:
headerDiv
,
element
:
headerDiv
,
customMap
:
null
,
customMap
:
null
,
project
:
self
.
getProject
()
project
:
self
.
getProject
()
});
});
self
.
getElement
().
appendChild
(
headerDiv
);
self
.
getElement
().
appendChild
(
headerDiv
);
var
panels
=
[
{
var
panels
=
[{
name
:
"
ELEMENTS
"
,
name
:
"
ELEMENTS
"
,
panelClass
:
ElementExportPanel
panelClass
:
ElementExportPanel
},
{
},
{
name
:
"
NETWORK
"
,
name
:
"
NETWORK
"
,
panelClass
:
NetworkExportPanel
panelClass
:
NetworkExportPanel
},
{
},
{
name
:
"
GRAPHICS
"
,
name
:
"
GRAPHICS
"
,
panelClass
:
GraphicsExportPanel
panelClass
:
GraphicsExportPanel
}
];
}];
var
tabDiv
=
Functions
.
createElement
({
self
.
getGuiUtils
().
initTabContent
(
self
);
type
:
"
div
"
,
name
:
"
tabView
"
,
className
:
"
tabbable boxed parentTabs
"
});
self
.
getElement
().
appendChild
(
tabDiv
);
var
tabMenuDiv
=
Functions
.
createElement
({
type
:
"
ul
"
,
className
:
"
nav nav-tabs
"
});
tabDiv
.
appendChild
(
tabMenuDiv
);
var
tabContentDiv
=
Functions
.
createElement
({
type
:
"
div
"
,
className
:
"
tab-content
"
});
tabDiv
.
appendChild
(
tabContentDiv
);
for
(
var
i
=
0
;
i
<
panels
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
panels
.
length
;
i
++
)
{
self
.
addTab
(
panels
[
i
],
tabMenuDiv
,
tabContentDiv
);
self
.
getGuiUtils
().
addTab
(
self
,
panels
[
i
]);
}
};
Export
.
prototype
.
addTab
=
function
(
params
,
navElement
,
contentElement
)
{
var
self
=
this
;
var
name
=
params
.
name
;
var
tabId
=
"
export_panel_tab_
"
+
this
.
_tabIdCount
;
self
.
_tabIdCount
++
;
var
navClass
=
''
;
var
contentClass
=
'
tab-pane
'
;
if
(
navElement
.
children
.
length
===
0
)
{
navClass
=
"
active
"
;
contentClass
=
"
tab-pane active
"
;
}
var
navLi
=
document
.
createElement
(
"
li
"
);
navLi
.
className
=
navClass
;
var
navLink
=
document
.
createElement
(
"
a
"
);
navLink
.
href
=
"
#
"
+
tabId
;
if
(
name
!==
undefined
)
{
if
(
name
.
length
>
12
)
{
name
=
name
.
substring
(
0
,
10
)
+
"
...
"
;
}
navLink
.
innerHTML
=
name
;
}
}
navLink
.
onclick
=
function
()
{
$
(
this
).
tab
(
'
show
'
);
};
navLi
.
appendChild
(
navLink
);
if
(
name
!==
undefined
)
{
navLink
.
innerHTML
=
name
;
}
navElement
.
appendChild
(
navLi
);
var
contentDiv
=
document
.
createElement
(
"
div
"
);
contentDiv
.
style
.
height
=
"
100%
"
;
contentDiv
.
className
=
contentClass
;
contentDiv
.
id
=
tabId
;
contentElement
.
appendChild
(
contentDiv
);
this
.
_panels
.
push
(
new
params
.
panelClass
({
element
:
contentDiv
,
project
:
self
.
getProject
(),
configuration
:
self
.
getConfiguration
()
}));
};
Export
.
prototype
.
setProject
=
function
(
project
)
{
this
.
_project
=
project
;
};
Export
.
prototype
.
getProject
=
function
()
{
return
this
.
_project
;
};
Export
.
prototype
.
setElement
=
function
(
element
)
{
this
.
_element
=
element
;
};
Export
.
prototype
.
getElement
=
function
()
{
return
this
.
_element
;
};
};
Export
.
prototype
.
init
=
function
()
{
/**
*
* @returns {Promise}
*/
Export
.
prototype
.
init
=
function
()
{
var
promises
=
[];
var
promises
=
[];
for
(
var
i
=
0
;
i
<
this
.
_panels
.
length
;
i
++
)
{
for
(
var
i
=
0
;
i
<
this
.
_panels
.
length
;
i
++
)
{
promises
.
push
(
this
.
_panels
[
i
].
init
());
promises
.
push
(
this
.
_panels
[
i
].
init
());
...
@@ -157,12 +88,15 @@ Export.prototype.init = function() {
...
@@ -157,12 +88,15 @@ Export.prototype.init = function() {
return
Promise
.
all
(
promises
);
return
Promise
.
all
(
promises
);
};
};
Export
.
prototype
.
setConfiguration
=
function
(
configuration
)
{
/**
this
.
_configuration
=
configuration
;
* @returns {GuiUtils}
};
*/
Export
.
prototype
.
getGuiUtils
=
function
()
{
Export
.
prototype
.
getConfiguration
=
function
()
{
var
self
=
this
;
return
this
.
_configuration
;
if
(
self
.
_guiUtils
===
undefined
)
{
self
.
_guiUtils
=
new
GuiUtils
(
self
.
getConfiguration
());
}
return
self
.
_guiUtils
;
};
};
module
.
exports
=
Export
;
module
.
exports
=
Export
;
This diff is collapsed.
Click to expand it.
frontend-js/src/test/js/Export-test.js
+
2
−
1
View file @
1f6d418d
...
@@ -23,7 +23,8 @@ describe('Export', function () {
...
@@ -23,7 +23,8 @@ describe('Export', function () {
exportObject
=
new
Export
({
exportObject
=
new
Export
({
element
:
testDiv
,
element
:
testDiv
,
project
:
project
,
project
:
project
,
configuration
:
configuration
configuration
:
configuration
,
serverConnector
:
ServerConnector
});
});
return
exportObject
.
init
();
return
exportObject
.
init
();
}).
then
(
function
()
{
}).
then
(
function
()
{
...
...
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