Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
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
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Main
Synchronet
Commits
019deb30
Commit
019deb30
authored
5 years ago
by
echicken
Browse files
Options
Downloads
Patches
Plain Diff
Move navbar related functions into navbar component file.
parent
a3e912e9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
web/components/.examples/navbar.xjs
+34
-0
34 additions, 0 deletions
web/components/.examples/navbar.xjs
web/root/index.xjs
+2
-33
2 additions, 33 deletions
web/root/index.xjs
with
36 additions
and
33 deletions
web/components/.examples/navbar.xjs
+
34
−
0
View file @
019deb30
<?xjs function _subMenu(obj, title, path) { ?>
<li class="dropdown<?xjs if (path.match(/\//g).length > 1) write('-submenu'); ?>">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
<?xjs write(title.replace(/^.*\-/, '')); ?>
<span class="caret"></span>
</a>
<ul class="dropdown-menu">
<?xjs _menu(obj.list, path); ?>
</ul>
</li>
<?xjs } ?>
<?xjs
function _menu(obj, path) {
Object.keys(obj).forEach(function (e) {
if (obj[e].type == 'list') {
_subMenu(obj[e], e, (path || '') + e + '/');
} else {
?>
<li>
<?xjs if (obj[e].type == 'link') { ?>
<a class="dropdown-item" href="./?page=<?xjs write(obj[e].page); ?>" target="_blank">
<?xjs } else { ?>
<a class="dropdown-item" href="./?page=<?xjs write((path || '') + obj[e].page); ?>">
<?xjs } ?>
<? write(e); ?>
</a>
</li>
<?xjs
}
});
}
?>
<nav class="navbar navbar-default navbar-fixed-top">
<div class="container<?xjs if (settings.layout_full_width) write('-fluid'); ?>">
<div class="navbar-header">
...
...
This diff is collapsed.
Click to expand it.
web/root/index.xjs
+
2
−
33
View file @
019deb30
...
...
@@ -19,42 +19,11 @@
var page_ctrl = getCtrlLine(settings.web_pages + page);
?>
<?xjs function _subMenu(obj, title, path) { ?>
<li
class=
"dropdown<?xjs if (path.match(/\//g).length > 1) write('-submenu'); ?>"
>
<a
href=
"#"
class=
"dropdown-toggle"
data-toggle=
"dropdown"
role=
"button"
aria-haspopup=
"true"
aria-expanded=
"false"
>
<?xjs write(title.replace(/^.*\-/, '')); ?>
<span
class=
"caret"
></span>
</a>
<ul
class=
"dropdown-menu"
>
<?xjs _menu(obj.list, path); ?>
</ul>
</li>
<?xjs } ?>
<?xjs
function _menu(obj, path) {
Object.keys(obj).forEach(function (e) {
if (obj[e].type == 'list') {
_subMenu(obj[e], e, (path || '') + e + '/');
} else {
?>
<li>
<?xjs if (obj[e].type == 'link') { ?>
<a
class=
"dropdown-item"
href=
"./?page=<?xjs write(obj[e].page); ?>"
target=
"_blank"
>
<?xjs } else { ?>
<a
class=
"dropdown-item"
href=
"./?page=<?xjs write((path || '') + obj[e].page); ?>"
>
<?xjs } ?>
<?xjs write(e); ?>
</a>
</li>
<?xjs }});} ?>
<?xjs function _sidebar() {
function _sidebar() {
if (settings.layout_sidebar_off || page_ctrl.options.no_sidebar) return;
?>
<div
class=
"col-xs-6 col-sm-3 sidebar-offcanvas"
id=
"sidebar"
>
<?xjs writeSidebarModules(); ?>
</div>
<div
class=
"col-xs-6 col-sm-3 sidebar-offcanvas"
id=
"sidebar"
>
<? writeSidebarModules(); ?>
</div>
<?xjs } ?>
<!DOCTYPE html>
...
...
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