From bbb8ca5fdfd7c8ef4fc0dcfdf16e325d7baa00ff Mon Sep 17 00:00:00 2001 From: Aleksey Chichenkov Date: Wed, 19 Sep 2018 13:25:01 +0300 Subject: [PATCH] add show list methods --- docfiles/groupTypes/groupType.js | 50 +++ docfiles/group_types.js | 20 + docfiles/modelTypes.js | 20 + docfiles/models/model.js | 54 +++ docfiles/modelsTypes/modelType.js | 30 ++ example2.json | 383 ++++++++++++++++++ templates/initi/publish.js | 226 ++++++++--- templates/initi/static/scripts/dd-menu.js | 65 +++ templates/initi/static/styles/dd-menu.css | 99 +++++ templates/initi/static/styles/explorer.css | 4 + .../initi/static/styles/jsdoc-default.css | 58 +-- templates/initi/tmpl/layout.tmpl | 11 +- templates/initi/tmpl/method_list.tmpl | 4 +- 13 files changed, 929 insertions(+), 95 deletions(-) create mode 100644 docfiles/groupTypes/groupType.js create mode 100644 docfiles/group_types.js create mode 100644 docfiles/modelTypes.js create mode 100644 docfiles/models/model.js create mode 100644 docfiles/modelsTypes/modelType.js create mode 100644 example2.json create mode 100644 templates/initi/static/scripts/dd-menu.js create mode 100644 templates/initi/static/styles/dd-menu.css create mode 100644 templates/initi/static/styles/explorer.css diff --git a/docfiles/groupTypes/groupType.js b/docfiles/groupTypes/groupType.js new file mode 100644 index 0000000..dbf2e91 --- /dev/null +++ b/docfiles/groupTypes/groupType.js @@ -0,0 +1,50 @@ +/** + * + * @class GroupType + * @memberof GroupTypes + */ +function GroupType() { + /** + * + * @public + * @function self + * @returns v2.vc + * @memberof GroupTypes.GroupType + */ + this.self = function() { + + }; + + /** + * + * @public + * @function parent + * @returns v2.vc + * @memberof GroupTypes.GroupType + */ + this.parent = function() { + + }; + + /** + * + * @public + * @function consist + * @returns v2.vc + * @memberof GroupTypes.GroupType + */ + this.consist = function() { + + }; + + /** + * + * @public + * @function attributes + * @returns v2.map(v2.string.type, v2.vc.type) + * @memberof GroupTypes.GroupType + */ + this.attributes = function() { + + }; +} diff --git a/docfiles/group_types.js b/docfiles/group_types.js new file mode 100644 index 0000000..9e7488a --- /dev/null +++ b/docfiles/group_types.js @@ -0,0 +1,20 @@ +/** + * Менеджер тип групп.
+ + * + * @namespace GroupTypes + */ +function GroupTypes() { + /** + * Вернет ссылку на Тип группы. + * + * @public + * @function get + * @param model_type groupType Адрес модели + * @returns tools.promise + * @memberof GroupTypes + */ + this.get = function (_groupType) { + + }; +} \ No newline at end of file diff --git a/docfiles/modelTypes.js b/docfiles/modelTypes.js new file mode 100644 index 0000000..af1dde8 --- /dev/null +++ b/docfiles/modelTypes.js @@ -0,0 +1,20 @@ +/** + * Менеджер тип групп.
+ + * + * @namespace ModelTypes + */ +function ModelTypes() { + /** + * Вернет ссылку на Тип группы. + * + * @public + * @function get + * @param v2.string modelType Адрес модели + * @returns tools.promise + * @memberof ModelTypes + */ + this.get = function (modelType) { + + }; +} \ No newline at end of file diff --git a/docfiles/models/model.js b/docfiles/models/model.js new file mode 100644 index 0000000..a136fab --- /dev/null +++ b/docfiles/models/model.js @@ -0,0 +1,54 @@ +/** + * Нода дерева.
+ * Представляет интефрейс для доступа к данным устройства.
+ * Позволяет получить список компонентов модели
+ * + * @class Model + * @memberof Models + */ +function Model() { + /** + * + * @public + * @function address + * @returns v2.address + * @memberof Models.Model + */ + this.address = function() { + + }; + + /** + * + * @public + * @function groups + * @returns tools.promise + * @memberof Models.Model + */ + this.groups = function() { + + }; + + /** + * + * @public + * @function touch + * @returns tools.promise + * @memberof Models.Model + */ + this.touch = function() { + + }; + + /** + * + * @public + * @function debug + * @param v2.address destination + * @param v2.address variables + * @memberof Models.Model + */ + this.debug = function(destination, variables) { + + }; +} diff --git a/docfiles/modelsTypes/modelType.js b/docfiles/modelsTypes/modelType.js new file mode 100644 index 0000000..a731ea8 --- /dev/null +++ b/docfiles/modelsTypes/modelType.js @@ -0,0 +1,30 @@ +/** + * + * @class ModelType + * @memberof ModelTypes + */ +function ModelType() { + /** + * + * @public + * @function get_group_type_id + * @param alias + * @returns v2.address + * @memberof ModelTypes.ModelType + */ + this.get_group_type_id = function(alias) { + + }; + + /** + * + * @public + * @function aliases + * @returns v2.map(v2.string, v2.model_type) + * @memberof GroupTypes.GroupType + */ + this.aliases = function() { + + }; + +} diff --git a/example2.json b/example2.json new file mode 100644 index 0000000..5a43a01 --- /dev/null +++ b/example2.json @@ -0,0 +1,383 @@ +[ + { + "comment": "/**\n * @class DesktopTree\n * @extends Trees.GlobalAttributeTree\n * @memberof Trees\n */", + "meta": { + "filename": "desktopTree.js", + "lineno": 1, + "columnno": 0, + "path": "/home/chichenkov/work/docsgen/docfiles/trees", + "code": {}, + "shortpath": "trees/desktopTree.js" + }, + "kind": "class", + "name": "DesktopTree", + "augments": [ + "Trees.GlobalAttributeTree" + ], + "memberof": "Trees", + "scope": "static", + "longname": "Trees.DesktopTree", + "___id": "T000002R000006", + "___s": true, + "attribs": "", + "id": "DesktopTree", + "signature": "()", + "ancestors": [ + "Trees." + ] + }, + { + "comment": "/**\n * @class Node\n * @extends Trees.GlobalAttributeTree.Node\n * @memberof Trees.DesktopTree\n */", + "meta": { + "filename": "desktopTree.js", + "lineno": 10, + "columnno": 0, + "path": "/home/chichenkov/work/docsgen/docfiles/trees", + "code": {}, + "shortpath": "trees/desktopTree.js" + }, + "kind": "class", + "name": "Node", + "augments": [ + "Trees.GlobalAttributeTree.Node" + ], + "memberof": "Trees.DesktopTree", + "scope": "static", + "longname": "Trees.DesktopTree.Node", + "___id": "T000002R000008", + "___s": true, + "attribs": "", + "id": "Node", + "signature": "()", + "ancestors": [ + "Trees", + ".DesktopTree." + ] + }, + { + "comment": "/**\n * Отнаследовано от глобального дерева.
\n * Ноды этого дерева имеют доступ к атрибутам\n *\n * @class GlobalAttributeTree\n * @extends Trees.GlobalTree\n * @memberof Trees\n */", + "meta": { + "filename": "globalAttributeTree.js", + "lineno": 1, + "columnno": 0, + "path": "/home/chichenkov/work/docsgen/docfiles/trees", + "code": {}, + "shortpath": "trees/globalAttributeTree.js" + }, + "description": "Отнаследовано от глобального дерева.
\nНоды этого дерева имеют доступ к атрибутам", + "kind": "class", + "name": "GlobalAttributeTree", + "augments": [ + "Trees.GlobalTree" + ], + "memberof": "Trees", + "scope": "static", + "longname": "Trees.GlobalAttributeTree", + "___id": "T000002R000010", + "___s": true, + "attribs": "", + "id": "GlobalAttributeTree", + "signature": "()", + "ancestors": [ + "Trees." + ] + }, + { + "comment": "/**\n * @class Node\n * @extends Trees.GlobalTree.Node\n * @memberof Trees.GlobalAttributeTree\n */", + "meta": { + "filename": "globalAttributeTree.js", + "lineno": 13, + "columnno": 0, + "path": "/home/chichenkov/work/docsgen/docfiles/trees", + "code": {}, + "shortpath": "trees/globalAttributeTree.js" + }, + "kind": "class", + "name": "Node", + "augments": [ + "Trees.GlobalTree.Node" + ], + "memberof": "Trees.GlobalAttributeTree", + "scope": "static", + "longname": "Trees.GlobalAttributeTree.Node", + "___id": "T000002R000012", + "___s": true, + "attribs": "", + "id": "Node", + "signature": "()", + "ancestors": [ + "Trees", + ".GlobalAttributeTree." + ] + }, + { + "comment": "/**\n * Интерфейс позволяющей пользователю работать с атрибутами ноды\n *\n * @class Attributes\n * @memberof Trees.GlobalAttributeTree.Node\n */", + "meta": { + "filename": "globalAttributeTree.js", + "lineno": 58, + "columnno": 0, + "path": "/home/chichenkov/work/docsgen/docfiles/trees", + "code": {}, + "shortpath": "trees/globalAttributeTree.js" + }, + "description": "Интерфейс позволяющей пользователю работать с атрибутами ноды", + "kind": "class", + "name": "Attributes", + "memberof": "Trees.GlobalAttributeTree.Node", + "scope": "static", + "longname": "Trees.GlobalAttributeTree.Node.Attributes", + "___id": "T000002R000020", + "___s": true, + "attribs": "", + "id": "Attributes", + "signature": "()", + "ancestors": [ + "Trees", + ".GlobalAttributeTree", + ".Node." + ] + }, + { + "comment": "/**\n * Глобальное дерево, от которого отнаследованы все остальные.
\n * Копирует идеологию ядра.
\n * Ноды этого дерева имеют доступ только к списку своих потомков.\n *\n * @class GlobalTree\n * @memberof Trees\n */", + "meta": { + "filename": "globalTree.js", + "lineno": 1, + "columnno": 0, + "path": "/home/chichenkov/work/docsgen/docfiles/trees", + "code": {}, + "shortpath": "trees/globalTree.js" + }, + "description": "Глобальное дерево, от которого отнаследованы все остальные.
\nКопирует идеологию ядра.
\nНоды этого дерева имеют доступ только к списку своих потомков.", + "kind": "class", + "name": "GlobalTree", + "memberof": "Trees", + "scope": "static", + "longname": "Trees.GlobalTree", + "___id": "T000002R000036", + "___s": true, + "attribs": "", + "id": "GlobalTree", + "signature": "()", + "ancestors": [ + "Trees." + ] + }, + { + "comment": "/**\n * Нода дерева.
\n * Представляет интефрейс для доступа к данным глобальной ноды в ядре.
\n * Позволяет узнать потомков ноды
\n *\n * @class Node\n * @memberof Trees.GlobalTree\n */", + "meta": { + "filename": "globalTree.js", + "lineno": 51, + "columnno": 0, + "path": "/home/chichenkov/work/docsgen/docfiles/trees", + "code": {}, + "shortpath": "trees/globalTree.js" + }, + "description": "Нода дерева.
\nПредставляет интефрейс для доступа к данным глобальной ноды в ядре.
\nПозволяет узнать потомков ноды
", + "kind": "class", + "name": "Node", + "memberof": "Trees.GlobalTree", + "scope": "static", + "longname": "Trees.GlobalTree.Node", + "___id": "T000002R000044", + "___s": true, + "attribs": "", + "id": "Node", + "signature": "()", + "ancestors": [ + "Trees", + ".GlobalTree." + ] + }, + { + "comment": "/**\n * Интерфейс позволяющей пользователю работать с потомками ноды\n *\n * @class Children\n * @memberof Trees.GlobalTree.Node\n */", + "meta": { + "filename": "globalTree.js", + "lineno": 124, + "columnno": 0, + "path": "/home/chichenkov/work/docsgen/docfiles/trees", + "code": {}, + "shortpath": "trees/globalTree.js" + }, + "description": "Интерфейс позволяющей пользователю работать с потомками ноды", + "kind": "class", + "name": "Children", + "memberof": "Trees.GlobalTree.Node", + "scope": "static", + "longname": "Trees.GlobalTree.Node.Children", + "___id": "T000002R000056", + "___s": true, + "attribs": "", + "id": "Children", + "signature": "()", + "ancestors": [ + "Trees", + ".GlobalTree", + ".Node." + ] + }, + { + "comment": "/**\n * @class RemoteModulesTree\n * @extends Trees.GlobalAttributeTree\n * @memberof Trees\n */", + "meta": { + "filename": "remoteModulesTree.js", + "lineno": 4, + "columnno": 0, + "path": "/home/chichenkov/work/docsgen/docfiles/trees", + "code": {}, + "shortpath": "trees/remoteModulesTree.js" + }, + "kind": "class", + "name": "RemoteModulesTree", + "augments": [ + "Trees.GlobalAttributeTree" + ], + "memberof": "Trees", + "scope": "static", + "longname": "Trees.RemoteModulesTree", + "___id": "T000002R000062", + "___s": true, + "attribs": "", + "id": "RemoteModulesTree", + "signature": "()", + "ancestors": [ + "Trees." + ] + }, + { + "comment": "/**\n * @class Node\n * @extends Trees.GlobalAttributeTree.Node\n * @memberof Trees.RemoteModulesTree\n */", + "meta": { + "filename": "remoteModulesTree.js", + "lineno": 13, + "columnno": 0, + "path": "/home/chichenkov/work/docsgen/docfiles/trees", + "code": {}, + "shortpath": "trees/remoteModulesTree.js" + }, + "kind": "class", + "name": "Node", + "augments": [ + "Trees.GlobalAttributeTree.Node" + ], + "memberof": "Trees.RemoteModulesTree", + "scope": "static", + "longname": "Trees.RemoteModulesTree.Node", + "___id": "T000002R000064", + "___s": true, + "attribs": "", + "id": "Node", + "signature": "()", + "ancestors": [ + "Trees", + ".RemoteModulesTree." + ] + }, + { + "comment": "/**\n * @class SchemeTree\n * @extends Trees.GlobalTree\n * @memberof Trees\n */", + "meta": { + "filename": "schemeTree.js", + "lineno": 1, + "columnno": 0, + "path": "/home/chichenkov/work/docsgen/docfiles/trees", + "code": {}, + "shortpath": "trees/schemeTree.js" + }, + "kind": "class", + "name": "SchemeTree", + "augments": [ + "Trees.GlobalTree" + ], + "memberof": "Trees", + "scope": "static", + "longname": "Trees.SchemeTree", + "___id": "T000002R000066", + "___s": true, + "attribs": "", + "id": "SchemeTree", + "signature": "()", + "ancestors": [ + "Trees." + ] + }, + { + "comment": "/**\n * @class Node\n * @extends Trees.GlobalTree.Node\n * @memberof Trees.SchemeTree\n */", + "meta": { + "filename": "schemeTree.js", + "lineno": 10, + "columnno": 0, + "path": "/home/chichenkov/work/docsgen/docfiles/trees", + "code": {}, + "shortpath": "trees/schemeTree.js" + }, + "kind": "class", + "name": "Node", + "augments": [ + "Trees.GlobalTree.Node" + ], + "memberof": "Trees.SchemeTree", + "scope": "static", + "longname": "Trees.SchemeTree.Node", + "___id": "T000002R000068", + "___s": true, + "attribs": "", + "id": "Node", + "signature": "()", + "ancestors": [ + "Trees", + ".SchemeTree." + ] + }, + { + "comment": "/**\n * @class UserAttributeTree\n * @extends Trees.GlobalAttributeTree\n * @memberof Trees\n */", + "meta": { + "filename": "userAttributeTree.js", + "lineno": 1, + "columnno": 0, + "path": "/home/chichenkov/work/docsgen/docfiles/trees", + "code": {}, + "shortpath": "trees/userAttributeTree.js" + }, + "kind": "class", + "name": "UserAttributeTree", + "augments": [ + "Trees.GlobalAttributeTree" + ], + "memberof": "Trees", + "scope": "static", + "longname": "Trees.UserAttributeTree", + "___id": "T000002R000070", + "___s": true, + "attribs": "", + "id": "UserAttributeTree", + "signature": "()", + "ancestors": [ + "Trees." + ] + }, + { + "comment": "/**\n * @class Node\n * @extends Trees.GlobalAttributeTree.Node\n * @memberof Trees.UserAttributeTree\n */", + "meta": { + "filename": "userAttributeTree.js", + "lineno": 10, + "columnno": 0, + "path": "/home/chichenkov/work/docsgen/docfiles/trees", + "code": {}, + "shortpath": "trees/userAttributeTree.js" + }, + "kind": "class", + "name": "Node", + "augments": [ + "Trees.GlobalAttributeTree.Node" + ], + "memberof": "Trees.UserAttributeTree", + "scope": "static", + "longname": "Trees.UserAttributeTree.Node", + "___id": "T000002R000072", + "___s": true, + "attribs": "", + "id": "Node", + "signature": "()", + "ancestors": [ + "Trees", + ".UserAttributeTree." + ] + } +] diff --git a/templates/initi/publish.js b/templates/initi/publish.js index e6ee5fb..49f07c9 100644 --- a/templates/initi/publish.js +++ b/templates/initi/publish.js @@ -340,42 +340,7 @@ function buildMemberNav(items, itemHeading, itemsSeen, linktoFn) { } -function buildMemberNavNamespace(items, itemHeading, itemsSeen, linktoFn) { - var nav = ''; - if (items.length) { - var itemsNav = ''; - items.forEach(function(item) { - var displayName; - - if ( !hasOwnProp.call(item, 'longname') ) { - itemsNav += '
  • ' + linktoFn('', item.name) + '
  • '; - } - else if ( !hasOwnProp.call(itemsSeen, item.longname) ) { - displayName = item.longname; - - var arr = displayName.split("."); - var end_id = arr.length - 1; - var last = arr.pop(); - - var prev_name = arr.join("."); - var res = ""; - // res += ""; - if (arr.length > 0) res += "" +prev_name+ "."; - res += "" +last+ ""; - itemsNav += '
  • ' + linktoFn(item.longname, res.replace(/\b(module|event):/g, '')) + '
  • '; - // itemsNav += "
    "; - itemsSeen[item.longname] = true; - } - }); - - if (itemsNav !== '') { - nav += '

    ' + itemHeading + '

    '; - } - } - - return nav; -} function buildMemberNavNamespacesTree(items, itemHeading, itemsSeen, linktoFn) { var nav = ''; @@ -492,45 +457,182 @@ function linktoExternal(longName, name) { * @param {array} members.interfaces * @return {string} The HTML for the navigation sidebar. */ -function buildNav(members) { - var globalNav; - var nav = '

    Home

    '; - var seen = {}; - var seenTutorials = {}; +// function buildNav(members) { +// var globalNav; +// var nav = '

    Home

    '; +// var seen = {}; +// var seenTutorials = {}; +// +// nav += buildMemberNav(members.modules, 'Modules', {}, linkto); +// nav += buildMemberNav(members.externals, 'Externals', seen, linktoExternal); +// nav += buildMemberNavNamespace(members.namespaces, 'Managers', seen, linkto); +// nav += buildMemberNavNamespace(members.classes, 'Classes', seen, linkto); +// nav += buildMemberNav(members.events, 'Events', seen, linkto); +// // nav += buildMemberNavNamespaces(members.namespaces, 'Namespaces', seen, linkto); +// // nav += buildMemberNav(members.namespaces, 'Namespaces', seen, linkto); +// nav += buildMemberNav(members.mixins, 'Mixins', seen, linkto); +// nav += buildMemberNav(members.tutorials, 'Tutorials', seenTutorials, linktoTutorial); +// nav += buildMemberNav(members.interfaces, 'Interfaces', seen, linkto); +// +// if (members.globals.length) { +// globalNav = ''; +// +// members.globals.forEach(function(g) { +// if ( g.kind !== 'typedef' && !hasOwnProp.call(seen, g.longname) ) { +// globalNav += '
  • ' + linkto(g.longname, g.name) + '
  • '; +// } +// seen[g.longname] = true; +// }); +// +// if (!globalNav) { +// // turn the heading into a link so you can actually get to the global page +// nav += '

    ' + linkto('global', 'Global') + '

    '; +// } +// else { +// nav += '

    Global

    '; +// } +// } +// +// return nav; +// } - nav += buildMemberNav(members.modules, 'Modules', {}, linkto); - nav += buildMemberNav(members.externals, 'Externals', seen, linktoExternal); - nav += buildMemberNavNamespace(members.namespaces, 'Managers', seen, linkto); - nav += buildMemberNavNamespace(members.classes, 'Classes', seen, linkto); - nav += buildMemberNav(members.events, 'Events', seen, linkto); - // nav += buildMemberNavNamespaces(members.namespaces, 'Namespaces', seen, linkto); - // nav += buildMemberNav(members.namespaces, 'Namespaces', seen, linkto); - nav += buildMemberNav(members.mixins, 'Mixins', seen, linkto); - nav += buildMemberNav(members.tutorials, 'Tutorials', seenTutorials, linktoTutorial); - nav += buildMemberNav(members.interfaces, 'Interfaces', seen, linkto); +function buildMemberNavNamespace(items, itemHeading, itemsSeen, linktoFn) { + var nav = ''; - if (members.globals.length) { - globalNav = ''; + console.log("buildMemberNavNamespace"); + console.log("items", JSON.stringify(items, true, 3)); + console.log("itemHeading", JSON.stringify(itemHeading, true, 3)); + console.log("itemsSeen", JSON.stringify(itemsSeen, true, 3)); + console.log("linktoFn", JSON.stringify(linktoFn, true, 3)); - members.globals.forEach(function(g) { - if ( g.kind !== 'typedef' && !hasOwnProp.call(seen, g.longname) ) { - globalNav += '
  • ' + linkto(g.longname, g.name) + '
  • '; + if (items.length) { + var itemsNav = ''; + items.forEach(function(item) { + var displayName; + + if ( !hasOwnProp.call(item, 'longname') ) { + itemsNav += '
  • ' + linktoFn('', item.name) + '
  • '; + } + else if ( !hasOwnProp.call(itemsSeen, item.longname) ) { + displayName = item.longname; + + var arr = displayName.split("."); + var end_id = arr.length - 1; + var last = arr.pop(); + + var prev_name = arr.join("."); + var res = ""; + // res += ""; + if (arr.length > 0) res += "" +prev_name+ "."; + res += "" +last+ ""; + itemsNav += '
  • ' + linktoFn(item.longname, res.replace(/\b(module|event):/g, '')) + '
  • '; + // itemsNav += "
    "; + itemsSeen[item.longname] = true; } - seen[g.longname] = true; }); - if (!globalNav) { - // turn the heading into a link so you can actually get to the global page - nav += '

    ' + linkto('global', 'Global') + '

    '; - } - else { - nav += '

    Global

    '; + if (itemsNav !== '') { + nav += '

    ' + itemHeading + '

    '; } } return nav; } +function buildNav(members) { + var nav = '

    GUI 2.9.1-develop

    '; + + // var seen = {}; + // nav += buildMemberNavNamespace(members.namespaces, 'Managers', seen, linkto); + // nav += buildMemberNavNamespace(members.classes, 'Classes', seen, linkto); + + nav += render_explorer(members.namespaces, members.classes); + + return nav; +} + +var render_explorer = function (_nss, _clss) { + var nav = ""; + nav += render_managers(_nss, _clss); + return nav; +}; + + +var render_managers = function (_nss, _clss) { + var nav = ""; + + nav += ""; + + return nav; +}; + +var find_managers = function (_parent, _clss) { + var members = []; + for(var a = 0; a < _clss.length; a++ ) { + var cls = _clss[a]; + + + var hierarchy = cls.memberof.split("."); + if (hierarchy.length == 1 && hierarchy[0] === "") { + continue; + } + + var found = false; + for(var b = 0; b < hierarchy.length; b++ ) { + var hop = hierarchy[b]; + if(hop == _parent) { + found = true; + break; + } + } + + // var cls_hierarchy = cls + + var member_success = found && hierarchy.length - b < 2; + + // console.log("_parent", _parent); + // console.log("cls", JSON.stringify(cls, true, 3)); + // console.log("found", found); + // console.log("hierarchy.length - b", hierarchy.length - b); + + + if(!member_success) continue; + + members.push(cls); + } + + return members; +}; + + /** @param {TAFFY} taffyData See . @param {object} opts diff --git a/templates/initi/static/scripts/dd-menu.js b/templates/initi/static/scripts/dd-menu.js new file mode 100644 index 0000000..6e818e9 --- /dev/null +++ b/templates/initi/static/scripts/dd-menu.js @@ -0,0 +1,65 @@ +/** + * Created by Aleksey Chichenkov on 9/19/18. + */ +window.onload = function () { + create(); +}; + +function create() { + var hop = location.href.split("/").pop().split("."); + hop.pop(); + var current_manager = hop[hop.length - 1]; + var parent = hop[hop.length - 2]; + + var dropdown = document.querySelectorAll('.dropdown'); + var dropdownArray = Array.prototype.slice.call(dropdown, 0); + dropdownArray.forEach(function (el) { + var button = el.querySelector('a.menu-title'); + var menu = el.querySelector('.dropdown-menu'); + + if (!menu) return; + + var arrow = button.querySelector('i.icon-arrow'); + var item = menu.getAttribute("id"); + + var show = true; + var cur_parent = menu.parentNode.children[1] && menu.parentNode.children[1].getAttribute("id"); + if (cur_parent) { + show = cur_parent != parent; + } + + if (show && item == current_manager || parent && item == parent) { + menu.classList.add('show'); + menu.classList.remove('hide'); + arrow.classList.add('open'); + arrow.classList.remove('close'); + event.preventDefault(); + } + + button.onclick = function (event) { + var item = event.target.parentNode.children[1] && event.target.parentNode.children[1].getAttribute("id"); + + var current_page = item && item == current_manager; + + if (!menu.hasClass('show')) { + menu.classList.add('show'); + menu.classList.remove('hide'); + arrow.classList.add('open'); + arrow.classList.remove('close'); + } + else { + menu.classList.remove('show'); + menu.classList.add('hide'); + arrow.classList.remove('open'); + arrow.classList.add('close'); + } + + current_page && event.preventDefault(); + }; + }); + + Element.prototype.hasClass = function (className) { + return this.className && new RegExp("(^|\\s)" + className + "(\\s|$)").test(this.className); + }; + +} diff --git a/templates/initi/static/styles/dd-menu.css b/templates/initi/static/styles/dd-menu.css new file mode 100644 index 0000000..b98a134 --- /dev/null +++ b/templates/initi/static/styles/dd-menu.css @@ -0,0 +1,99 @@ +*, *:before, *:after { + -webkit-border-sizing: border-box; + -moz-border-sizing: border-box; + border-sizing: border-box; +} + +.ddm { + list-style: none; + padding: 0; + margin: 0 0 20px 0; +} + +.dropdown a { + text-decoration: none; +} +.dropdown .menu-title { + position: relative; + display: block; + color: white; + background: #2980B9; + -moz-box-shadow: 0 1px 0 #409ad5 inset, 0 -1px 0 #20638f inset; + -webkit-box-shadow: 0 1px 0 #409ad5 inset, 0 -1px 0 #20638f inset; + box-shadow: 0 1px 0 #409ad5 inset, 0 -1px 0 #20638f inset; + text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3); + padding: 6px; + font-size: 20px; +} + +.dropdown .menu-title:hover { + background: #2c89c6; +} + +.dropdown .icon-arrow { + position: absolute; + display: block; + font-size: 0.7em; + color: #fff; + top: 10px; + right: 10px; +} +.dropdown .icon-arrow.open { + -moz-transform: rotate(-180deg); + -ms-transform: rotate(-180deg); + -webkit-transform: rotate(-180deg); + transform: rotate(-180deg); +} +.dropdown .icon-arrow.close { + -moz-transform: rotate(0deg); + -ms-transform: rotate(0deg); + -webkit-transform: rotate(0deg); + transform: rotate(0deg); +} +.dropdown .icon-arrow:before { + content: '\25BC'; +} +.dropdown .dropdown-menu { + max-height: 0; + overflow: hidden; + list-style: none; + padding: 0; + margin: 0; +} +.dropdown .dropdown-menu li { + padding: 0; +} +.dropdown .dropdown-menu li a { + display: block; + color: #232323; + background: #EEE; + -moz-box-shadow: 0 1px 0 white inset, 0 -1px 0 #d5d5d5 inset; + -webkit-box-shadow: 0 1px 0 white inset, 0 -1px 0 #d5d5d5 inset; + box-shadow: 0 1px 0 white inset, 0 -1px 0 #d5d5d5 inset; + text-shadow: 0 -1px 0 rgba(255, 255, 255, 0.3); + padding: 6px 10px; +} +.dropdown .dropdown-menu li a:hover { + background: #f6f6f6; +} +.dropdown .show, .dropdown .hide { + -moz-transform-origin: 50% 0%; + -ms-transform-origin: 50% 0%; + -webkit-transform-origin: 50% 0%; + transform-origin: 50% 0%; +} +.dropdown .show { + display: block; + max-height: 9999px; + -moz-transform: scaleY(1); + -ms-transform: scaleY(1); + -webkit-transform: scaleY(1); + transform: scaleY(1); +} +.dropdown .hide { + max-height: 0; + -moz-transform: scaleY(0); + -ms-transform: scaleY(0); + -webkit-transform: scaleY(0); + transform: scaleY(0); +} \ No newline at end of file diff --git a/templates/initi/static/styles/explorer.css b/templates/initi/static/styles/explorer.css new file mode 100644 index 0000000..40a39d4 --- /dev/null +++ b/templates/initi/static/styles/explorer.css @@ -0,0 +1,4 @@ +ul div.title { + font-size: 25px; + margin-bottom: 5px; +} \ No newline at end of file diff --git a/templates/initi/static/styles/jsdoc-default.css b/templates/initi/static/styles/jsdoc-default.css index 45c0317..fbeef85 100644 --- a/templates/initi/static/styles/jsdoc-default.css +++ b/templates/initi/static/styles/jsdoc-default.css @@ -73,8 +73,10 @@ tt, code, kbd, samp { } #main { - float: left; - width: 75%; + float: right; + width: 85%; + box-sizing: border-box; + padding-left: 10px; } article dl { @@ -126,40 +128,40 @@ section nav { display: block; - float: right; - margin-top: 28px; - width: 25%; + float: left; + width: 15%; box-sizing: border-box; - border-left: 1px solid #ccc; - padding-left: 16px; - right: 0px; + border-right: 1px solid #ccc; height: -webkit-fill-available; position: fixed; - overflow: scroll; + overflow: auto; + + padding-left: 16px; + padding-right: 16px; } -nav ul { - font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif; - font-size: 100%; - line-height: 17px; - padding: 0; - margin: 0; - list-style-type: none; -} +/*nav ul {*/ + /*font-family: 'Lucida Grande', 'Lucida Sans Unicode', arial, sans-serif;*/ + /*font-size: 100%;*/ + /*line-height: 17px;*/ + /*padding: 0;*/ + /*margin: 0;*/ + /*list-style-type: none;*/ +/*}*/ -nav ul a, nav ul a:visited, nav ul a:active { - /*font-family: Consolas, Monaco, 'Andale Mono', monospace;*/ - line-height: 18px; - color: #4D4E53; -} +/*nav ul a, nav ul a:visited, nav ul a:active {*/ + /*!*font-family: Consolas, Monaco, 'Andale Mono', monospace;*!*/ + /*line-height: 18px;*/ + /*color: #4D4E53;*/ +/*}*/ -nav h3 { - margin-top: 12px; -} +/*nav h3 {*/ + /*margin-top: 12px;*/ +/*}*/ -nav li { - margin-top: 6px; -} +/*nav li {*/ + /*margin-top: 6px;*/ +/*}*/ footer { display: block; diff --git a/templates/initi/tmpl/layout.tmpl b/templates/initi/tmpl/layout.tmpl index 8a9a6b9..6097f05 100644 --- a/templates/initi/tmpl/layout.tmpl +++ b/templates/initi/tmpl/layout.tmpl @@ -6,11 +6,14 @@ + + + @@ -20,6 +23,10 @@

    + +
    + Documentation generated by JSDoc on +