{"size": 2315, "ext": "js", "max_stars_repo_path": "server/Known.WebApi/demo_eui/static/js/index.js", "max_stars_repo_name": "known/KAdmin", "max_stars_repo_stars_event_min_datetime": "2018-12-31T03:14:17.000Z", "max_stars_repo_stars_event_max_datetime": "2018-12-31T03:14:17.000Z", "max_issues_repo_path": "server/Known.WebApi/demo_eui/static/js/index.js", "max_issues_repo_name": "known/KnownAdmin", "max_issues_repo_issues_event_min_datetime": "2020-09-04T22:18:39.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-26T11:05:23.000Z", "max_forks_repo_path": "server/Known.WebApi/demo_eui/static/js/index.js", "max_forks_repo_name": "known/KnownAdmin", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": 7, "max_forks_count": null, "avg_line_length": 30.8666666667, "max_line_length": 90, "alphanum_fraction": 0.4539956803}
﻿$.fn.panel.defaults.loadingMessage = '加载中...';
$.fn.datagrid.defaults.loadMsg = '数据加载中，请稍等...';
$.fn.datagrid.defaults.pageList = [10, 20, 30, 40, 50, 100, 200, 500];
$.fn.pagination.defaults.displayMsg = '共 {total} 条数据';
$.fn.pagination.defaults.beforePageText = '第';
$.fn.pagination.defaults.afterPageText = '/{pages}页';

var Index = {

    mainTabs: null,
    leftTree: null,

    show: function () {
        this.mainTabs = this._getMainTabs();
        this.leftTree = this._getLeftTree();
    },

    _getMainTabs: function () {
        var _this = this;
        return $('#mainTabs').tabs({
            border: false,
            onSelect: function (title, index) {
                var leftTree = _this.leftTree;
                if (leftTree) {
                    var node = leftTree.tree('find', { text: title });
                    if (node) {
                        leftTree.tree('expandTo', node.target)
                            .tree('select', node.target);
                    }
                }
            }
        });
    },

    _getLeftTree: function () {
        var _this = this;
        return $('#leftTree').tree({
            animate: true,
            method: 'get',
            url: 'static/data/menu.json',
            onClick: function (node) {
                if (node.children)
                    return;

                var mainTabs = _this.mainTabs;
                if (mainTabs.tabs('exists', node.text)) {
                    mainTabs.tabs('select', node.text);
                } else {
                    mainTabs.tabs('add', {
                        id: node.id,
                        title: node.text,
                        iconCls: node.iconCls,
                        href: '/Pages' + node.url,
                        closable: true,
                        bodyCls: 'content'
                    });
                }
            },
            onLoadSuccess: function (node, data) {
                _this._removeNodeIcon();
            },
            onExpand: function (node) {
                _this._removeNodeIcon();
            }
        });
    },

    _removeNodeIcon: function () {
        $('.fa').removeClass('tree-icon tree-file');
        $('.fa').removeClass('tree-icon tree-folder tree-folder-open tree-folder-closed');
    }

};

Index.show();