File tree Expand file tree Collapse file tree 4 files changed +38
-3
lines changed
Expand file tree Collapse file tree 4 files changed +38
-3
lines changed Original file line number Diff line number Diff line change 1818 *
1919 * @var string
2020 */
21- define ('MPG_APP_VERSION ' , '1.0.7 ' );
21+ define ('MPG_APP_VERSION ' , '1.0.8 ' );
2222
2323/**
2424 * Development mode?
Original file line number Diff line number Diff line change @@ -33,8 +33,39 @@ MPG.visNetworkOptions = {
3333
3434} ;
3535
36+ /**
37+ * Forwards navigation links.
38+ *
39+ * @returns {void }
40+ */
41+ MPG . helpers . forwardNavLinks = function ( ) {
42+
43+ var fragmentUrl = window . location . hash . split ( '#' ) ;
44+
45+ if ( fragmentUrl . length === 2 && fragmentUrl [ 1 ] !== '' ) {
46+
47+ databaseAndCollectionName = fragmentUrl [ 1 ] . split ( '/' ) ;
48+
49+ if ( databaseAndCollectionName . length === 1 ) {
50+
51+ MPG . helpers . completeNavLinks ( '#' + databaseAndCollectionName [ 0 ] ) ;
52+
53+ } else if ( databaseAndCollectionName . length === 2 ) {
54+
55+ MPG . helpers . completeNavLinks (
56+ '#' + databaseAndCollectionName [ 0 ] + '/' + databaseAndCollectionName [ 1 ]
57+ ) ;
58+
59+ }
60+
61+ }
62+
63+ } ;
64+
3665/**
3766 * Draws vis.Network graph.
67+ *
68+ * @returns {void }
3869 */
3970MPG . drawVisNetwork = function ( ) {
4071
@@ -84,7 +115,9 @@ MPG.drawVisNetwork = function() {
84115// When document is ready:
85116window . addEventListener ( 'DOMContentLoaded' , function ( _event ) {
86117
118+ MPG . helpers . forwardNavLinks ( ) ;
87119 MPG . eventListeners . addMenuToggle ( ) ;
120+
88121 MPG . drawVisNetwork ( ) ;
89122
90123} ) ;
Original file line number Diff line number Diff line change @@ -128,7 +128,9 @@ MPG.helpers.navigateOnSamePage = function() {
128128/**
129129 * Completes navigation links with an URL fragment.
130130 *
131- * @param {string } urlFragment
131+ * @param {string } urlFragment
132+ *
133+ * @returns {void }
132134 */
133135MPG . helpers . completeNavLinks = function ( urlFragment ) {
134136
Original file line number Diff line number Diff line change 55 <div class="navbar-nav">
66 <a class="nav-item nav-link<?php echo ('collection ' === $ viewName ) ? ' active ' : '' ; ?> " data-canonical-url="<?php echo MPG_BASE_URL ; ?> /manageCollections" href="<?php echo MPG_BASE_URL ; ?> /manageCollections">Manage collections</a>
77 <a class="nav-item nav-link<?php echo ('collection.import ' === $ viewName ) ? ' active ' : '' ; ?> " data-canonical-url="<?php echo MPG_BASE_URL ; ?> /importDocuments" href="<?php echo MPG_BASE_URL ; ?> /importDocuments">Import documents</a>
8- <a class="nav-item nav-link<?php echo ('database.visualize ' === $ viewName ) ? ' active ' : '' ; ?> " href="<?php echo MPG_BASE_URL ; ?> /visualizeDatabase">Visualize database</a>
8+ <a class="nav-item nav-link<?php echo ('database.visualize ' === $ viewName ) ? ' active ' : '' ; ?> " data-canonical-url=" <?php echo MPG_BASE_URL ; ?> /visualizeDatabase" href="<?php echo MPG_BASE_URL ; ?> /visualizeDatabase">Visualize database</a>
99 <a class="nav-item nav-link<?php echo ('database.query ' === $ viewName ) ? ' active ' : '' ; ?> " data-canonical-url="<?php echo MPG_BASE_URL ; ?> /queryDatabase" href="<?php echo MPG_BASE_URL ; ?> /queryDatabase">Query database</a>
1010 <a class="nav-item nav-link<?php echo ('collection.indexes ' === $ viewName ) ? ' active ' : '' ; ?> " data-canonical-url="<?php echo MPG_BASE_URL ; ?> /manageIndexes" href="<?php echo MPG_BASE_URL ; ?> /manageIndexes">Manage indexes</a>
1111 <a class="nav-item nav-link<?php echo ('database.users ' === $ viewName ) ? ' active ' : '' ; ?> " data-canonical-url="<?php echo MPG_BASE_URL ; ?> /manageUsers" href="<?php echo MPG_BASE_URL ; ?> /manageUsers">Manage users</a>
You can’t perform that action at this time.
0 commit comments