diff --git a/assets/js/drawTree.js b/assets/js/drawTree.js
index 538cec13b..245cb3feb 100644
--- a/assets/js/drawTree.js
+++ b/assets/js/drawTree.js
@@ -25,7 +25,9 @@ for (let path in content) {
id: pageId,
parentId: parentFolderId,
name: pageTitle,
+ text: pageTitle,
type: 'page',
+ a_attr : {href : pathBase.slice(0, pathBase.length - 1) + path} ,
href: pathBase.slice(0, pathBase.length - 1) + path
})
@@ -43,6 +45,7 @@ for (let path in content) {
id: '_' + folderId + '_',
parentId: parentId,
name: folderId.replace(/-/g, ' '),
+ text: folderId.replace(/-/g, ' '),
type: 'folder',
// type : Tree.FOLDER,
level: level
@@ -82,33 +85,17 @@ tree.forEach((el) => {
const structure = root.children;
-// a temporary function to traverse the tree and allowing to display something
-function* traverse(o, path = []) {
- for (var i in o) {
- const itemPath = path.concat(i);
- yield [i, o[i], itemPath, o];
- if (o[i] !== null && typeof o[i] == "object") {
- //going one step down in the object tree!!
- yield* traverse(o[i], itemPath);
- }
- }
-}
-
-// console.log(structure)
-for (var [key, value, path] of traverse(structure)) {
- // console.log(key);
- // console.log(value);
- // console.log(path);
- // console.log("---");
- let doc = document.getElementById("tree").innerHTML
- if (value?.type == "folder") {
- document.getElementById("tree").innerHTML = doc + '
'+value.name + '
'
- }
- if (value?.type == "page") {
- document.getElementById("tree").innerHTML = doc + ' '+ value.name+'
'
- }
-}
-
-return structure
+$(function () {
+ $('#jstree')
+ .on('click', function (e) {
+ $('#jstree').jstree(true).toggle_node(e.target);
+ })
+ .jstree({
+ core : {
+ dblclick_toggle : false,
+ 'data' : structure},
+ "plugins" : [ "wholerow" ]
+ });
+});
}
diff --git a/assets/js/jquery.js b/assets/js/jquery.js
new file mode 100644
index 000000000..fc6c299b7
--- /dev/null
+++ b/assets/js/jquery.js
@@ -0,0 +1,10881 @@
+/*!
+ * jQuery JavaScript Library v3.6.0
+ * https://jquery.com/
+ *
+ * Includes Sizzle.js
+ * https://sizzlejs.com/
+ *
+ * Copyright OpenJS Foundation and other contributors
+ * Released under the MIT license
+ * https://jquery.org/license
+ *
+ * Date: 2021-03-02T17:08Z
+ */
+( function( global, factory ) {
+
+ "use strict";
+
+ if ( typeof module === "object" && typeof module.exports === "object" ) {
+
+ // For CommonJS and CommonJS-like environments where a proper `window`
+ // is present, execute the factory and get jQuery.
+ // For environments that do not have a `window` with a `document`
+ // (such as Node.js), expose a factory as module.exports.
+ // This accentuates the need for the creation of a real `window`.
+ // e.g. var jQuery = require("jquery")(window);
+ // See ticket #14549 for more info.
+ module.exports = global.document ?
+ factory( global, true ) :
+ function( w ) {
+ if ( !w.document ) {
+ throw new Error( "jQuery requires a window with a document" );
+ }
+ return factory( w );
+ };
+ } else {
+ factory( global );
+ }
+
+// Pass this if window is not defined yet
+} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) {
+
+// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1
+// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode
+// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common
+// enough that all such attempts are guarded in a try block.
+"use strict";
+
+var arr = [];
+
+var getProto = Object.getPrototypeOf;
+
+var slice = arr.slice;
+
+var flat = arr.flat ? function( array ) {
+ return arr.flat.call( array );
+} : function( array ) {
+ return arr.concat.apply( [], array );
+};
+
+
+var push = arr.push;
+
+var indexOf = arr.indexOf;
+
+var class2type = {};
+
+var toString = class2type.toString;
+
+var hasOwn = class2type.hasOwnProperty;
+
+var fnToString = hasOwn.toString;
+
+var ObjectFunctionString = fnToString.call( Object );
+
+var support = {};
+
+var isFunction = function isFunction( obj ) {
+
+ // Support: Chrome <=57, Firefox <=52
+ // In some browsers, typeof returns "function" for HTML