├── src ├── assets │ ├── img │ │ ├── Expanded.gif │ │ └── Collapsed.gif │ ├── js │ │ ├── zTree_v3 │ │ │ ├── img │ │ │ │ ├── zt-file.png │ │ │ │ ├── zt-folder-o.png │ │ │ │ └── zt-folder.png │ │ │ ├── css │ │ │ │ ├── metroStyle │ │ │ │ │ ├── img │ │ │ │ │ │ ├── metro.gif │ │ │ │ │ │ ├── metro.png │ │ │ │ │ │ ├── loading.gif │ │ │ │ │ │ └── line_conn.png │ │ │ │ │ └── metroStyle.css │ │ │ │ ├── zTreeStyle │ │ │ │ │ ├── img │ │ │ │ │ │ ├── diy │ │ │ │ │ │ │ ├── 2.png │ │ │ │ │ │ │ ├── 3.png │ │ │ │ │ │ │ ├── 4.png │ │ │ │ │ │ │ ├── 5.png │ │ │ │ │ │ │ ├── 6.png │ │ │ │ │ │ │ ├── 7.png │ │ │ │ │ │ │ ├── 8.png │ │ │ │ │ │ │ ├── 9.png │ │ │ │ │ │ │ ├── 1_close.png │ │ │ │ │ │ │ └── 1_open.png │ │ │ │ │ │ ├── loading.gif │ │ │ │ │ │ ├── line_conn.gif │ │ │ │ │ │ ├── zTreeStandard.gif │ │ │ │ │ │ └── zTreeStandard.png │ │ │ │ │ └── zTreeStyle.css │ │ │ │ └── awesomeStyle │ │ │ │ │ ├── img │ │ │ │ │ └── loading.gif │ │ │ │ │ ├── awesome.less │ │ │ │ │ ├── awesome.css │ │ │ │ │ └── fa.less │ │ │ └── js │ │ │ │ └── jquery.ztree.core-3.5.min.js │ │ ├── json.js │ │ ├── bootstrap-typeahead.js │ │ └── bootstrap.min.js │ ├── fonts │ │ ├── glyphicons-halflings-regular.eot │ │ ├── glyphicons-halflings-regular.ttf │ │ ├── glyphicons-halflings-regular.woff │ │ └── glyphicons-halflings-regular.woff2 │ └── css │ │ ├── json.css │ │ └── style.css ├── view │ ├── base.html │ ├── head.html │ ├── pass.html │ ├── index.html │ ├── search.html │ └── info.html ├── config │ ├── route.php │ └── doc.php ├── Service.php ├── DocParser.php ├── DocController.php └── Doc.php ├── composer.json ├── LICENSE ├── demo.php └── README.md /src/assets/img/Expanded.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/img/Expanded.gif -------------------------------------------------------------------------------- /src/assets/img/Collapsed.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/img/Collapsed.gif -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/img/zt-file.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/img/zt-file.png -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/img/zt-folder-o.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/img/zt-folder-o.png -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/img/zt-folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/img/zt-folder.png -------------------------------------------------------------------------------- /src/assets/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /src/assets/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/assets/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/assets/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/metroStyle/img/metro.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/css/metroStyle/img/metro.gif -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/metroStyle/img/metro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/css/metroStyle/img/metro.png -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/zTreeStyle/img/diy/2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/css/zTreeStyle/img/diy/2.png -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/zTreeStyle/img/diy/3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/css/zTreeStyle/img/diy/3.png -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/zTreeStyle/img/diy/4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/css/zTreeStyle/img/diy/4.png -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/zTreeStyle/img/diy/5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/css/zTreeStyle/img/diy/5.png -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/zTreeStyle/img/diy/6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/css/zTreeStyle/img/diy/6.png -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/zTreeStyle/img/diy/7.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/css/zTreeStyle/img/diy/7.png -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/zTreeStyle/img/diy/8.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/css/zTreeStyle/img/diy/8.png -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/zTreeStyle/img/diy/9.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/css/zTreeStyle/img/diy/9.png -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/metroStyle/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/css/metroStyle/img/loading.gif -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/zTreeStyle/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/css/zTreeStyle/img/loading.gif -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/awesomeStyle/img/loading.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/css/awesomeStyle/img/loading.gif -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/metroStyle/img/line_conn.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/css/metroStyle/img/line_conn.png -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/zTreeStyle/img/diy/1_close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/css/zTreeStyle/img/diy/1_close.png -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/zTreeStyle/img/diy/1_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/css/zTreeStyle/img/diy/1_open.png -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/zTreeStyle/img/line_conn.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/css/zTreeStyle/img/line_conn.gif -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/zTreeStyle/img/zTreeStandard.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/css/zTreeStyle/img/zTreeStandard.gif -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/zTreeStyle/img/zTreeStandard.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhangweiwei0326/api-doc/HEAD/src/assets/js/zTree_v3/css/zTreeStyle/img/zTreeStandard.png -------------------------------------------------------------------------------- /src/view/base.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {include file="head" /} 4 | {block name="head"}{/block} 5 | 6 | {block name="main"}{/block} 7 | {block name="footer"}{/block} 8 | 9 | -------------------------------------------------------------------------------- /src/view/head.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | {$title} 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /src/config/route.php: -------------------------------------------------------------------------------- 1 | "APi接口文档", //文档title 4 | 'version'=>'1.0.0', //文档版本 5 | 'copyright'=>'Powered By Zhangweiwei', //版权信息 6 | 'password' => '', //访问密码,为空不需要密码 7 | 'controller' => [ 8 | //需要生成文档的类 9 | 'app\index\controller\demo' 10 | ], 11 | 'filter_method' => [ 12 | //过滤 不解析的方法名称 13 | '_empty' 14 | ], 15 | 'return_format' => [ 16 | //数据格式 17 | 'status' => "200/300/301/302", 18 | 'message' => "提示信息", 19 | ], 20 | 'public_header' => [ 21 | //全局公共头部参数 22 | //如:['name'=>'version', 'require'=>1, 'default'=>'', 'desc'=>'版本号(全局)'] 23 | ], 24 | 'public_param' => [ 25 | //全局公共请求参数,设置了所以的接口会自动增加次参数 26 | //如:['name'=>'token', 'type'=>'string', 'require'=>1, 'default'=>'', 'other'=>'' ,'desc'=>'验证(全局)')'] 27 | ], 28 | ]; 29 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2017 风情万种 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy of 6 | this software and associated documentation files (the "Software"), to deal in 7 | the Software without restriction, including without limitation the rights to 8 | use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of 9 | the Software, and to permit persons to whom the Software is furnished to do so, 10 | subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS 17 | FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR 18 | COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 19 | IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 20 | CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -------------------------------------------------------------------------------- /src/Service.php: -------------------------------------------------------------------------------- 1 | app->route->group(function() { 12 | require __DIR__.'/config/route.php'; 13 | }); 14 | //发布静态资源 15 | $targetDir = $this->app->getRootPath() . 'public/apidoc' .DIRECTORY_SEPARATOR; 16 | if (is_dir($targetDir) == false){ 17 | $sourceDir = __DIR__.DIRECTORY_SEPARATOR.'assets'.DIRECTORY_SEPARATOR; 18 | $this->copy_dir($sourceDir, $targetDir); 19 | } 20 | } 21 | 22 | public function copy_dir($src, $des) 23 | { 24 | $dir = opendir($src); 25 | @mkdir($des); 26 | while (false !== ($file = readdir($dir))) { 27 | if (($file != '.') && ($file != '..')) { 28 | if (is_dir($src . '/' . $file)) { 29 | $this->copy_dir($src . '/' . $file, $des . '/' . $file); 30 | } else { 31 | copy($src . '/' . $file, $des . '/' . $file); 32 | } 33 | } 34 | } 35 | closedir($dir); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /demo.php: -------------------------------------------------------------------------------- 1 | request->header('device'); 39 | echo json_encode(["code"=>200, "message"=>"success", "data"=>['device'=>$device]]); 40 | } 41 | 42 | /** 43 | * @title 登录接口 44 | * @description 接口说明 45 | * @author 开发者 46 | * @url /api/demo 47 | * @method GET 48 | * @module 用户模块 49 | 50 | * @param name:name type:int require:1 default:1 other: desc:用户名 51 | * @param name:pass type:int require:1 default:1 other: desc:密码 52 | * 53 | * @return name:名称 54 | * @return mobile:手机号 55 | * 56 | */ 57 | public function login(Request $request) 58 | { 59 | //接口代码 60 | $device = $request->header('device'); 61 | echo json_encode(["code"=>200, "message"=>"success", "data"=>['device'=>$device]]); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/assets/css/json.css: -------------------------------------------------------------------------------- 1 | @charset "utf-8"; 2 | /* CSS Document */ 3 | div.ControlsRow, div.HeadersRow { 4 | font-family: Georgia; 5 | } 6 | div.Canvas 7 | 8 | { 9 | 10 | font-family: Lucida Console, Georgia; 11 | 12 | font-size: 16px; 13 | 14 | background-color:#ECECEC; 15 | 16 | color:#000000; 17 | 18 | border:solid 1px #CECECE; 19 | 20 | } 21 | 22 | pre{font-size: 16px;} 23 | 24 | .ObjectBrace 25 | 26 | { 27 | 28 | color:#00AA00; 29 | 30 | font-weight:bold; 31 | 32 | } 33 | 34 | .ArrayBrace 35 | 36 | { 37 | 38 | color:#0033FF; 39 | 40 | font-weight:bold; 41 | 42 | } 43 | 44 | .PropertyName 45 | 46 | { 47 | 48 | color:#CC0000; 49 | 50 | font-weight:bold; 51 | 52 | } 53 | 54 | .String 55 | 56 | { 57 | 58 | color:#007777; 59 | 60 | } 61 | 62 | .Number 63 | 64 | { 65 | 66 | color:#AA00AA; 67 | 68 | } 69 | 70 | .Boolean 71 | 72 | { 73 | 74 | color:#0000FF; 75 | 76 | } 77 | 78 | .Function 79 | 80 | { 81 | 82 | color:#AA6633; 83 | 84 | text-decoration:italic; 85 | 86 | } 87 | 88 | .Null 89 | 90 | { 91 | 92 | color:#0000FF; 93 | 94 | } 95 | 96 | .Comma 97 | 98 | { 99 | 100 | color:#000000; 101 | 102 | font-weight:bold; 103 | 104 | } 105 | 106 | PRE.CodeContainer{ 107 | 108 | margin-top:0px; 109 | 110 | margin-bottom:0px; 111 | 112 | } 113 | 114 | PRE.CodeContainer img{ 115 | 116 | cursor:pointer; 117 | 118 | border:none; 119 | 120 | margin-bottom:-1px; 121 | 122 | } 123 | #CollapsibleViewDetail a{ 124 | padding-left:10px; 125 | } 126 | #ControlsRow{ 127 | white-space:nowrap; 128 | font: 11px Georgia; 129 | 130 | } 131 | #TabSizeHolder{ 132 | padding-left:10px; 133 | padding-right:10px; 134 | } 135 | #HeaderTitle{ 136 | text-align:right; 137 | font-size:11px; 138 | } 139 | #HeaderSubTitle{ 140 | margin-bottom:2px; 141 | margin-top:0px 142 | } 143 | #RawJson{ 144 | width:99%; 145 | height:120px; 146 | 147 | } 148 | A.OtherToolsLink { color:#555;text-decoration:none; } 149 | A.OtherToolsLink:hover { text-decoration:underline; } 150 | 151 | .result_body{ margin-bottom: 10px;} 152 | .result_body *{ margin-right:10px;} -------------------------------------------------------------------------------- /src/view/pass.html: -------------------------------------------------------------------------------- 1 | {extend name="base" /} 2 | {block name="head"} 3 | 15 | {/block} 16 | {block name="main"} 17 |
18 |
19 | 22 |
23 |
24 |
25 | 26 |
27 |
28 | 29 |
30 |
31 |
32 |
33 |
34 | {/block} 35 | {block name="footer"} 36 | 59 | {/block} -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | #api-doc 2 | 3 | ### 使用方法 4 | ####1、安装扩展 5 | ``` 6 | - 6.0执行 1.7开始只支持tp6 7 | composer require weiwei/api-doc 8 | - 5.0或者5.1 9 | composer require weiwei/api-doc 1.6.2 10 | ``` 11 | 12 | ####2、配置参数 13 | - 5.0安装好扩展后在 application\extra\ 文件夹下会生成 doc.php 配置文件 14 | - 5.1安装好扩展后在 application\config\ 文件夹下会生成 doc.php 配置文件 15 | - 6.0安装好扩展后在 config\ 文件夹下会生成 doc.php 配置文件 16 | - 在controller参数中添加对应的类 17 | ``` 18 | 'controller' => [ 19 | 'app\\api\\controller\\Demo' //这个是控制器的命名空间+控制器名称 20 | ] 21 | ``` 22 | ####3、在相关接口类中增加注释参数( group 参数将接口分组,可选) 23 | - 方法如下:返回参数支持数组及多维数组 24 | ``` 25 | request->header('device'); 64 | echo json_encode(["code"=>200, "message"=>"success", "data"=>['device'=>$device]]); 65 | } 66 | 67 | /** 68 | * @title 登录接口 69 | * @description 接口说明 70 | * @author 开发者 71 | * @url /api/demo 72 | * @method GET 73 | * @module 用户模块 74 | 75 | * @param name:name type:int require:1 default:1 other: desc:用户名 76 | * @param name:pass type:int require:1 default:1 other: desc:密码 77 | * 78 | * @return name:名称 79 | * @return mobile:手机号 80 | * 81 | */ 82 | public function login(Request $request) 83 | { 84 | //接口代码 85 | $device = $request->header('device'); 86 | echo json_encode(["code"=>200, "message"=>"success", "data"=>['device'=>$device]]); 87 | } 88 | } 89 | ``` 90 | ####4、在浏览器访问http://你的域名/doc 或者 http://你的域名/index.php/doc 查看接口文档 91 | 92 | ####4.1、tp6在浏览器访问http://你的域名/doc/index 或者 http://你的域名/index.php/doc/index 查看接口文档 93 | 94 | ####5、预览 95 | - ![](https://static.oschina.net/uploads/img/201704/17101409_tAgD.png) 96 | - ![](https://static.oschina.net/uploads/img/201704/17101348_XuUz.png) 97 | - ![](https://static.oschina.net/uploads/img/201704/17101306_KePe.png) 98 | 99 | ###更多支持 100 | - QQ群663447446 101 | 102 | ###赞助二维码 103 | - ![](https://static.oschina.net/uploads/space/2018/0601/163814_StfS_270003.jpg) 104 | - ![](https://static.oschina.net/uploads/space/2018/0601/163835_MOVe_270003.jpg) 105 | 106 | ###2017年8月16日更新 107 | - 增加头部参数设置,根据自己需求去设置参数 108 | - 增加全局参数设置及类参数设置,全局参数设置可以doc.php public_param、public_header配置,类局部公用参数可在class下面进行设置,详见demo.php 109 | - 增加模拟请求方式get、post、put、delete,注释课设置method参数进行标识 110 | 111 | ###问题 112 | - 不少小伙伴反应,没有正常安装doc.php 配置文件,原因是你改过应用目录官方默认是application 113 | - 如果没有生成doc.php 配置文件 你可以手动安装,直接在application(你修改的目录)里面创建extra文件夹,然后把扩展包中的vendor\weiwei\api-doc\src\config.php文件复制进去,并重命名为doc.php 114 | 115 | ###2018年6月1日更新 116 | - 增加TP5.1支持 117 | - 增加简单的访问验证(默认不开启密码,要开启只需在doc.php配置password值) 118 | - 增加静态资源自定义路径方式(可以把扩展下面的assets目录复制到你的pulic目录,然后配置static_path='/assets'),特么是nginx线上服务器可以这么做 119 | - 增加文档搜索功能 120 | 121 | -------------------------------------------------------------------------------- /src/view/index.html: -------------------------------------------------------------------------------- 1 | {extend name="base" /} 2 | {block name="head"} 3 | 4 | 5 | 9 | {/block} 10 | {block name="main"} 11 |
12 | {$title} 13 | {$version} 14 | {$copyright} 15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 | 26 |
27 |
28 |
29 |
30 |
31 | {/block} 32 | {block name="footer"} 33 | 125 | {/block} -------------------------------------------------------------------------------- /src/DocParser.php: -------------------------------------------------------------------------------- 1 | params; 16 | } 17 | // Get the comment 18 | if (preg_match ( '#^/\*\*(.*)\*/#s', $doc, $comment ) === false) 19 | return $this->params; 20 | $comment = trim ( $comment [1] ); 21 | // Get all the lines and strip the * from the first character 22 | if (preg_match_all ( '#^\s*\*(.*)#m', $comment, $lines ) === false) 23 | return $this->params; 24 | $this->parseLines ( $lines [1] ); 25 | return $this->params; 26 | } 27 | 28 | private function parseLines($lines) { 29 | $desc = []; 30 | foreach ( $lines as $line ) { 31 | $parsedLine = $this->parseLine ( $line ); // Parse the line 32 | 33 | if ($parsedLine === false && ! isset ( $this->params ['description'] )) { 34 | if (isset ( $desc )) { 35 | // Store the first line in the short description 36 | $this->params ['description'] = implode ( PHP_EOL, $desc ); 37 | } 38 | $desc = array (); 39 | } elseif ($parsedLine !== false) { 40 | $desc [] = $parsedLine; // Store the line in the long description 41 | } 42 | } 43 | $desc = implode ( ' ', $desc ); 44 | if (! empty ( $desc )) 45 | $this->params ['long_description'] = $desc; 46 | } 47 | 48 | private function parseLine($line) { 49 | // trim the whitespace from the line 50 | $line = trim ( $line ); 51 | 52 | if (empty ( $line )) 53 | return false; // Empty line 54 | 55 | if (strpos ( $line, '@' ) === 0) { 56 | if (strpos ( $line, ' ' ) > 0) { 57 | // Get the parameter name 58 | $param = substr ( $line, 1, strpos ( $line, ' ' ) - 1 ); 59 | $value = substr ( $line, strlen ( $param ) + 2 ); // Get the value 60 | } else { 61 | $param = substr ( $line, 1 ); 62 | $value = ''; 63 | } 64 | // Parse the line and return false if the parameter is valid 65 | if ($this->setParam ( $param, $value )) 66 | return false; 67 | } 68 | 69 | return $line; 70 | } 71 | 72 | private function setParam($param, $value) { 73 | if ($param == 'param' || $param == 'header') 74 | $value = $this->formatParam( $value ); 75 | if ($param == 'class') 76 | list ( $param, $value ) = $this->formatClass ( $value ); 77 | 78 | if($param == 'return' || $param == 'param' || $param == 'header'){ 79 | $this->params [$param][] = $value; 80 | }else if (empty ( $this->params [$param] )) { 81 | $this->params [$param] = $value; 82 | } else { 83 | $this->params [$param] = $this->params [$param] . $value; 84 | } 85 | return true; 86 | } 87 | 88 | private function formatClass($value) { 89 | $r = preg_split ( "[\(|\)]", $value ); 90 | if (is_array ( $r )) { 91 | $param = $r [0]; 92 | parse_str ( $r [1], $value ); 93 | foreach ( $value as $key => $val ) { 94 | $val = explode ( ',', $val ); 95 | if (count ( $val ) > 1) 96 | $value [$key] = $val; 97 | } 98 | } else { 99 | $param = 'Unknown'; 100 | } 101 | return array ( 102 | $param, 103 | $value 104 | ); 105 | } 106 | 107 | private function formatParam($string) { 108 | $string = $string." "; 109 | if(preg_match_all('/(\w+):(.*?)[\s\n]/s', $string, $meatchs)){ 110 | $param = []; 111 | foreach ($meatchs[1] as $key=>$value){ 112 | $param[$meatchs[1][$key]] = $this->getParamType($meatchs[2][$key]); 113 | } 114 | return $param; 115 | }else{ 116 | return ''.$string; 117 | } 118 | } 119 | 120 | private function getParamType($type){ 121 | $typeMaps = [ 122 | 'string' => '字符串', 123 | 'int' => '整型', 124 | 'float' => '浮点型', 125 | 'boolean' => '布尔型', 126 | 'date' => '日期', 127 | 'array' => '数组', 128 | 'fixed' => '固定值', 129 | 'enum' => '枚举类型', 130 | 'object' => '对象', 131 | ]; 132 | return array_key_exists($type,$typeMaps) ? $typeMaps[$type] : $type; 133 | } 134 | } -------------------------------------------------------------------------------- /src/view/search.html: -------------------------------------------------------------------------------- 1 | {extend name="base" /} 2 | 3 | {block name="head"} 4 | 12 | 13 | {/block} 14 | {block name="main"} 15 |
16 |
17 |

{$title}

18 |
19 | 20 |
21 | 39 |
40 | 41 | 45 | 46 |
47 |
48 |
49 |
50 | 109 | {/block} -------------------------------------------------------------------------------- /src/assets/css/style.css: -------------------------------------------------------------------------------- 1 | body, table, input, textarea, select, button { 2 | font-family: "Microsoft YaHei", Verdana, sans-serif, "SimSun"; 3 | } 4 | 5 | body { 6 | margin: 0 auto; 7 | font-size: 14px; 8 | } 9 | 10 | a { 11 | color: #00A881; 12 | text-decoration: none; 13 | } 14 | 15 | a:HOVER { 16 | color: #00A881; 17 | text-decoration: none; 18 | } 19 | 20 | a:focus{ 21 | text-decoration: none; 22 | } 23 | 24 | pre { 25 | background-color: #f4f5f7; 26 | border: 1px solid #ccc; 27 | padding: 5px 10px; 28 | } 29 | 30 | blockquote { 31 | background: url("../../../img/blockquote.gif") no-repeat scroll left top 32 | #f4f5f7; 33 | margin: 0px; 34 | padding: 10px 10px 10px 30px; 35 | } 36 | 37 | p { 38 | margin: 5px 0; 39 | } 40 | 41 | h1 { 42 | font-size: 28px; 43 | margin: 7px 0; 44 | } 45 | 46 | h2 { 47 | font-size: 26px; 48 | margin: 7px 0; 49 | } 50 | 51 | h3 { 52 | font-size: 24px; 53 | margin: 7px 0; 54 | } 55 | 56 | h4 { 57 | font-size: 22px; 58 | margin: 7px 0; 59 | } 60 | 61 | h5 { 62 | font-size: 20px; 63 | margin: 7px 0; 64 | } 65 | 66 | h6 { 67 | font-size: 18px; 68 | margin: 7px 0; 69 | } 70 | 71 | .zt_header { 72 | height: 60px; 73 | background-color: #00A881; 74 | color: #fff; 75 | font-size: 30px; 76 | line-height: 60px; 77 | padding-left: 20px; 78 | } 79 | 80 | .zt_header span { 81 | font-size: 14px; 82 | } 83 | 84 | .zt_footer { 85 | height: 60px; 86 | border-top: 2px solid #00A881; 87 | position: absolute; 88 | left: 0; 89 | right: 0; 90 | bottom: 0; 91 | text-align: center; 92 | } 93 | 94 | .zt_navi { 95 | position: absolute; 96 | width: 300px; 97 | left: 0; 98 | bottom: 0px; 99 | top: 60px; 100 | border-right: 2px solid #00A881; 101 | overflow: auto; 102 | } 103 | 104 | .zt_navi_inner { 105 | padding: 5px; 106 | } 107 | 108 | .zt_content_inner { 109 | padding: 10px 20px; 110 | } 111 | 112 | .zt_content_inner p{ 113 | white-space: pre-wrap; 114 | } 115 | 116 | .zt_content { 117 | position: absolute; 118 | right: 0; 119 | left: 302px; 120 | bottom: 0px; 121 | top: 60px; 122 | overflow-y: auto; 123 | } 124 | 125 | .zt_content_title { 126 | font-size: 30px; 127 | line-height: 50px; 128 | border-bottom: 1px dashed #ccc; 129 | margin-bottom: 10px; 130 | } 131 | 132 | .zt_content_text p { 133 | line-height: 24px; 134 | } 135 | 136 | .zt_content_text ul { 137 | padding-left: 30px; 138 | } 139 | 140 | .zt_content_text ul li { 141 | line-height: 22px; 142 | } 143 | 144 | .zt_content_text table { 145 | border-bottom: 1px solid #ccc; 146 | border-left: 1px solid #ccc; 147 | margin-bottom: 10px; 148 | border-collapse: 0; 149 | border-spacing: 0; 150 | width: 100%; 151 | } 152 | 153 | .zt_content_text table th { 154 | border-top: 1px solid #ccc; 155 | border-right: 1px solid #ccc; 156 | padding: 6px 12px; 157 | background-color: #eee; 158 | } 159 | 160 | .zt_content_text table td { 161 | border-top: 1px solid #ccc; 162 | border-right: 1px solid #ccc; 163 | padding: 6px 12px; 164 | } 165 | 166 | .zt_content_text table td p { 167 | padding: 0; 168 | margin: 0; 169 | } 170 | 171 | .zt_callout { 172 | margin-bottom: 10px; 173 | } 174 | 175 | .zt_download { 176 | float: right; 177 | margin-right: 20px; 178 | } 179 | 180 | .zt_download a { 181 | color: #fff; 182 | } 183 | 184 | .zt_oneword_code { 185 | padding: 2px 4px; 186 | margin: 0 2px; 187 | color: #c7254e; 188 | white-space: nowrap; 189 | background-color: #f9f2f4; 190 | border-radius: 4px; 191 | } 192 | pre code{ 193 | overflow: auto; 194 | } 195 | .link{ 196 | background: #34495e; 197 | transition: background .2s ease-in-out; 198 | color: #fff; 199 | display: block; 200 | text-align: center; 201 | text-decoration: none; 202 | margin-bottom: 1rem; 203 | padding: 1.618rem 1rem; 204 | } 205 | .link:hover { 206 | background: #19232d; 207 | color: #fff; 208 | text-decoration: none; 209 | } 210 | .link-b{ 211 | margin-left: 1.618rem; 212 | background: 0 0; 213 | color: #fff; 214 | border: 1px solid #fff; 215 | border-radius: 0; 216 | transition: background .2s ease-in-out; 217 | font-family: 'Open Sans'; 218 | } 219 | .link-b:hover { 220 | background: #fff; 221 | color: #373a3c; 222 | text-decoration: none; 223 | } 224 | .link-b:focus{ 225 | color: #000; 226 | } 227 | 228 | .am-list { 229 | /*margin-bottom: 1.6rem;*/ 230 | padding-left: 0; 231 | } 232 | .am-list>li { 233 | position: relative; 234 | display: block; 235 | /*margin-bottom: -1px;*/ 236 | background-color: #fff; 237 | border-bottom: 1px solid #dedede; 238 | border-width: 1px 0; 239 | /*padding-left: 2em;*/ 240 | } 241 | .am-list>li>a { 242 | display: block; 243 | padding: 1rem 0; 244 | color: #00A881; 245 | text-decoration: none; 246 | padding-left: 2em; 247 | } 248 | .am-in{ 249 | 250 | } 251 | .am-in>li{ 252 | /*padding-left: 2em;*/ 253 | border: none; 254 | border-top: 1px solid #dedede; 255 | } 256 | .am-in>li>a{ 257 | padding-left: 4em; 258 | color: #000000; 259 | } 260 | .center-vertical { 261 | position:relative; 262 | top:50%; 263 | transform:translateY(-50%); 264 | } -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/zTreeStyle/zTreeStyle.css: -------------------------------------------------------------------------------- 1 | /*------------------------------------- 2 | zTree Style 3 | 4 | version: 3.5.19 5 | author: Hunter.z 6 | email: hunter.z@263.net 7 | website: http://code.google.com/p/jquerytree/ 8 | 9 | -------------------------------------*/ 10 | 11 | .ztree * {padding:0; margin:0; font-size:12px; font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif} 12 | .ztree {margin:0; padding:5px; color:#333} 13 | .ztree li{padding:0; margin:0; list-style:none; line-height:14px; text-align:left; white-space:nowrap; outline:0} 14 | .ztree li ul{ margin:0; padding:0 0 0 18px} 15 | .ztree li ul.line{ background:url(./img/line_conn.gif) 0 0 repeat-y;} 16 | 17 | .ztree li a {padding:1px 3px 0 0; margin:0; cursor:pointer; height:17px; color:#333; background-color: transparent; 18 | text-decoration:none; vertical-align:top; display: inline-block} 19 | .ztree li a:hover {text-decoration:underline} 20 | .ztree li a.curSelectedNode {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;} 21 | .ztree li a.curSelectedNode_Edit {padding-top:0px; background-color:#FFE6B0; color:black; height:16px; border:1px #FFB951 solid; opacity:0.8;} 22 | .ztree li a.tmpTargetNode_inner {padding-top:0px; background-color:#316AC5; color:white; height:16px; border:1px #316AC5 solid; 23 | opacity:0.8; filter:alpha(opacity=80)} 24 | .ztree li a.tmpTargetNode_prev {} 25 | .ztree li a.tmpTargetNode_next {} 26 | .ztree li a input.rename {height:14px; width:80px; padding:0; margin:0; 27 | font-size:12px; border:1px #7EC4CC solid; *border:0px} 28 | .ztree li span {line-height:16px; margin-right:2px} 29 | .ztree li span.button {line-height:0; margin:0; width:16px; height:16px; display: inline-block; vertical-align:middle; 30 | border:0 none; cursor: pointer;outline:none; 31 | background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; 32 | background-image:url("./img/zTreeStandard.png"); *background-image:url("./img/zTreeStandard.gif")} 33 | 34 | .ztree li span.button.chk {width:13px; height:13px; margin:0 3px 0 0; cursor: auto} 35 | .ztree li span.button.chk.checkbox_false_full {background-position:0 0} 36 | .ztree li span.button.chk.checkbox_false_full_focus {background-position:0 -14px} 37 | .ztree li span.button.chk.checkbox_false_part {background-position:0 -28px} 38 | .ztree li span.button.chk.checkbox_false_part_focus {background-position:0 -42px} 39 | .ztree li span.button.chk.checkbox_false_disable {background-position:0 -56px} 40 | .ztree li span.button.chk.checkbox_true_full {background-position:-14px 0} 41 | .ztree li span.button.chk.checkbox_true_full_focus {background-position:-14px -14px} 42 | .ztree li span.button.chk.checkbox_true_part {background-position:-14px -28px} 43 | .ztree li span.button.chk.checkbox_true_part_focus {background-position:-14px -42px} 44 | .ztree li span.button.chk.checkbox_true_disable {background-position:-14px -56px} 45 | .ztree li span.button.chk.radio_false_full {background-position:-28px 0} 46 | .ztree li span.button.chk.radio_false_full_focus {background-position:-28px -14px} 47 | .ztree li span.button.chk.radio_false_part {background-position:-28px -28px} 48 | .ztree li span.button.chk.radio_false_part_focus {background-position:-28px -42px} 49 | .ztree li span.button.chk.radio_false_disable {background-position:-28px -56px} 50 | .ztree li span.button.chk.radio_true_full {background-position:-42px 0} 51 | .ztree li span.button.chk.radio_true_full_focus {background-position:-42px -14px} 52 | .ztree li span.button.chk.radio_true_part {background-position:-42px -28px} 53 | .ztree li span.button.chk.radio_true_part_focus {background-position:-42px -42px} 54 | .ztree li span.button.chk.radio_true_disable {background-position:-42px -56px} 55 | 56 | .ztree li span.button.switch {width:18px; height:18px} 57 | .ztree li span.button.root_open{background-position:-92px -54px} 58 | .ztree li span.button.root_close{background-position:-74px -54px} 59 | .ztree li span.button.roots_open{background-position:-92px 0} 60 | .ztree li span.button.roots_close{background-position:-74px 0} 61 | .ztree li span.button.center_open{background-position:-92px -18px} 62 | .ztree li span.button.center_close{background-position:-74px -18px} 63 | .ztree li span.button.bottom_open{background-position:-92px -36px} 64 | .ztree li span.button.bottom_close{background-position:-74px -36px} 65 | .ztree li span.button.noline_open{background-position:-92px -72px} 66 | .ztree li span.button.noline_close{background-position:-74px -72px} 67 | .ztree li span.button.root_docu{ background:none;} 68 | .ztree li span.button.roots_docu{background-position:-56px 0} 69 | .ztree li span.button.center_docu{background-position:-56px -18px} 70 | .ztree li span.button.bottom_docu{background-position:-56px -36px} 71 | .ztree li span.button.noline_docu{ background:none;} 72 | 73 | .ztree li span.button.ico_open{margin-right:2px; background-position:-110px -16px; vertical-align:top; *vertical-align:middle} 74 | .ztree li span.button.ico_close{margin-right:2px; background-position:-110px 0; vertical-align:top; *vertical-align:middle} 75 | .ztree li span.button.ico_docu{margin-right:2px; background-position:-110px -32px; vertical-align:top; *vertical-align:middle} 76 | .ztree li span.button.edit {margin-right:2px; background-position:-110px -48px; vertical-align:top; *vertical-align:middle} 77 | .ztree li span.button.remove {margin-right:2px; background-position:-110px -64px; vertical-align:top; *vertical-align:middle} 78 | 79 | .ztree li span.button.ico_loading{margin-right:2px; background:url(./img/loading.gif) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle} 80 | 81 | ul.tmpTargetzTree {background-color:#FFE6B0; opacity:0.8; filter:alpha(opacity=80)} 82 | 83 | span.tmpzTreeMove_arrow {width:16px; height:16px; display: inline-block; padding:0; margin:2px 0 0 1px; border:0 none; position:absolute; 84 | background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; 85 | background-position:-110px -80px; background-image:url("./img/zTreeStandard.png"); *background-image:url("./img/zTreeStandard.gif")} 86 | 87 | ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height:auto;overflow:hidden; background-color:#cfcfcf; border:1px #00B83F dotted; opacity:0.8; filter:alpha(opacity=80)} 88 | .zTreeMask {z-index:10000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute} 89 | 90 | /* level style*/ 91 | /*.ztree li span.button.level0 { 92 | display:none; 93 | } 94 | .ztree li ul.level0 { 95 | padding:0; 96 | background:none; 97 | }*/ -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/metroStyle/metroStyle.css: -------------------------------------------------------------------------------- 1 | /*------------------------------------- 2 | zTree Style 3 | 4 | version: 3.4 5 | author: Hunter.z 6 | email: hunter.z@263.net 7 | website: http://code.google.com/p/jquerytree/ 8 | 9 | -------------------------------------*/ 10 | 11 | .ztree * {padding:0; margin:0; font-size:12px; font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif} 12 | .ztree {margin:0; padding:5px; color:#333} 13 | .ztree li{padding:0; margin:0; list-style:none; line-height:17px; text-align:left; white-space:nowrap; outline:0} 14 | .ztree li ul{ margin:0; padding:0 0 0 18px} 15 | .ztree li ul.line{ background:url(./img/line_conn.png) 0 0 repeat-y;} 16 | 17 | .ztree li a {padding-right:3px; margin:0; cursor:pointer; height:21px; color:#333; background-color: transparent; text-decoration:none; vertical-align:top; display: inline-block} 18 | .ztree li a:hover {text-decoration:underline} 19 | .ztree li a.curSelectedNode {padding-top:0px; background-color:#e5e5e5; color:black; height:21px; opacity:0.8;} 20 | .ztree li a.curSelectedNode_Edit {padding-top:0px; background-color:#e5e5e5; color:black; height:21px; border:1px #666 solid; opacity:0.8;} 21 | .ztree li a.tmpTargetNode_inner {padding-top:0px; background-color:#aaa; color:white; height:21px; border:1px #666 solid; 22 | opacity:0.8; filter:alpha(opacity=80)} 23 | .ztree li a.tmpTargetNode_prev {} 24 | .ztree li a.tmpTargetNode_next {} 25 | .ztree li a input.rename {height:14px; width:80px; padding:0; margin:0; 26 | font-size:12px; border:1px #585956 solid; *border:0px} 27 | .ztree li span {line-height:21px; margin-right:2px} 28 | .ztree li span.button {line-height:0; margin:0; padding: 0; width:21px; height:21px; display: inline-block; vertical-align:middle; 29 | border:0 none; cursor: pointer;outline:none; 30 | background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; 31 | background-image:url("./img/metro.png"); *background-image:url("./img/metro.gif")} 32 | 33 | .ztree li span.button.chk {width:13px; height:13px; margin:0 2px; cursor: auto} 34 | .ztree li span.button.chk.checkbox_false_full {background-position: -5px -5px;} 35 | .ztree li span.button.chk.checkbox_false_full_focus {background-position: -5px -26px;} 36 | .ztree li span.button.chk.checkbox_false_part {background-position: -5px -48px;} 37 | .ztree li span.button.chk.checkbox_false_part_focus {background-position: -5px -68px;} 38 | .ztree li span.button.chk.checkbox_false_disable {background-position: -5px -89px;} 39 | .ztree li span.button.chk.checkbox_true_full {background-position: -26px -5px;} 40 | .ztree li span.button.chk.checkbox_true_full_focus {background-position: -26px -26px;} 41 | .ztree li span.button.chk.checkbox_true_part {background-position: -26px -48px;} 42 | .ztree li span.button.chk.checkbox_true_part_focus {background-position: -26px -68px;} 43 | .ztree li span.button.chk.checkbox_true_disable {background-position: -26px -89px;} 44 | .ztree li span.button.chk.radio_false_full {background-position: -47px -5px;} 45 | .ztree li span.button.chk.radio_false_full_focus {background-position: -47px -26px;} 46 | .ztree li span.button.chk.radio_false_part {background-position: -47px -47px;} 47 | .ztree li span.button.chk.radio_false_part_focus {background-position: -47px -68px;} 48 | .ztree li span.button.chk.radio_false_disable {background-position: -47px -89px;} 49 | .ztree li span.button.chk.radio_true_full {background-position: -68px -5px;} 50 | .ztree li span.button.chk.radio_true_full_focus {background-position: -68px -26px;} 51 | .ztree li span.button.chk.radio_true_part {background-position: -68px -47px;} 52 | .ztree li span.button.chk.radio_true_part_focus {background-position: -68px -68px;} 53 | .ztree li span.button.chk.radio_true_disable {background-position: -68px -89px;} 54 | 55 | .ztree li span.button.switch {width:21px; height:21px} 56 | .ztree li span.button.root_open{background-position:-105px -63px} 57 | .ztree li span.button.root_close{background-position:-126px -63px} 58 | .ztree li span.button.roots_open{background-position: -105px 0;} 59 | .ztree li span.button.roots_close{background-position: -126px 0;} 60 | .ztree li span.button.center_open{background-position: -105px -21px;} 61 | .ztree li span.button.center_close{background-position: -126px -21px;} 62 | .ztree li span.button.bottom_open{background-position: -105px -42px;} 63 | .ztree li span.button.bottom_close{background-position: -126px -42px;} 64 | .ztree li span.button.noline_open{background-position: -105px -84px;} 65 | .ztree li span.button.noline_close{background-position: -126px -84px;} 66 | .ztree li span.button.root_docu{ background:none;} 67 | .ztree li span.button.roots_docu{background-position: -84px 0;} 68 | .ztree li span.button.center_docu{background-position: -84px -21px;} 69 | .ztree li span.button.bottom_docu{background-position: -84px -42px;} 70 | .ztree li span.button.noline_docu{ background:none;} 71 | 72 | .ztree li span.button.ico_open{margin-right:2px; background-position: -147px -21px; vertical-align:top; *vertical-align:middle} 73 | .ztree li span.button.ico_close{margin-right:2px; margin-right:2px; background-position: -147px 0; vertical-align:top; *vertical-align:middle} 74 | .ztree li span.button.ico_docu{margin-right:2px; background-position: -147px -42px; vertical-align:top; *vertical-align:middle} 75 | .ztree li span.button.edit {margin-left:2px; margin-right: -1px; background-position: -189px -21px; vertical-align:top; *vertical-align:middle} 76 | .ztree li span.button.edit:hover { 77 | background-position: -168px -21px; 78 | } 79 | .ztree li span.button.remove {margin-left:2px; margin-right: -1px; background-position: -189px -42px; vertical-align:top; *vertical-align:middle} 80 | .ztree li span.button.remove:hover { 81 | background-position: -168px -42px; 82 | } 83 | .ztree li span.button.add {margin-left:2px; margin-right: -1px; background-position: -189px 0; vertical-align:top; *vertical-align:middle} 84 | .ztree li span.button.add:hover { 85 | background-position: -168px 0; 86 | } 87 | .ztree li span.button.ico_loading{margin-right:2px; background:url(./img/loading.gif) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle} 88 | 89 | ul.tmpTargetzTree {background-color:#FFE6B0; opacity:0.8; filter:alpha(opacity=80)} 90 | 91 | span.tmpzTreeMove_arrow {width:16px; height:21px; display: inline-block; padding:0; margin:2px 0 0 1px; border:0 none; position:absolute; 92 | background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; 93 | background-position:-168px -84px; background-image:url("./img/metro.png"); *background-image:url("./img/metro.gif")} 94 | 95 | ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height:auto;overflow:hidden; background-color:#cfcfcf; border:1px #00B83F dotted; opacity:0.8; filter:alpha(opacity=80)} 96 | .ztreeMask {z-index:10000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute} 97 | -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/awesomeStyle/awesome.less: -------------------------------------------------------------------------------- 1 | /*------------------------------------- 2 | zTree Style using fontawesome instead of images 3 | 4 | version: 1.1 5 | author: Mike King 6 | email: mikkelking @ hotmail . com 7 | website: http://code.google.com/p/jquerytree/ 8 | 9 | -------------------------------------*/ 10 | 11 | /* Definitions ----------------------*/ 12 | @font-size: 12px; 13 | // Regular icon and text color is white, which suits any medium -> dark background 14 | @color-normal: white; 15 | // Background color 16 | @color-bg: #af0000; 17 | // Highlight color 18 | @color-highlight: yellow; 19 | // Partially selected (checkboxes, radio buttons) 20 | @color-partial: #aaaaaa; 21 | // Partially selected and focused (checkboxes, radio buttons) 22 | @color-partfocus: #cad96c; 23 | // Disabled altogether 24 | @color-disabled: #808080; 25 | // Editing color 26 | @color-edit: yellow; 27 | @w: 15px; 28 | @h: 17px; 29 | @pad-left: 2px; 30 | @pad-top: 10px; 31 | /* End of Definitions ---------------*/ 32 | 33 | /* Imports -------------------------*/ 34 | @import "fa.less"; 35 | /* End of Imports ------------------*/ 36 | 37 | .ztree * {padding:0; margin:0; font-size:@font-size; font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif; background-color: @color-bg;} 38 | .ztree { 39 | margin:0; padding:5px; color:@color-normal; background-color: @color-bg; 40 | li { 41 | padding:0; margin:0; list-style:none; line-height:17px; text-align:left; white-space:nowrap; outline:0; 42 | ul { 43 | margin: 0px; padding:0 0 0 18px; 44 | } 45 | ul.line { } 46 | a {padding-right:3px; margin:0; cursor:pointer; height:@h; color:@color-normal; background-color: transparent; 47 | text-decoration:none; vertical-align:top; display: inline-block; 48 | input.rename {height:14px; width:80px; padding:0; margin:0; 49 | color: @color-bg; background-color: @color-normal; 50 | font-size:@font-size; border:1px #585956 solid; *border:0px} 51 | } 52 | a:hover {text-decoration:underline} 53 | a.curSelectedNode {padding-top:0px; background-color:#af4040; color:@color-highlight; height:@h; opacity:0.8;} 54 | a.curSelectedNode_Edit {padding-top:0px; background-color:transparent; color:@color-highlight; height:@h; border:1px #666 solid; opacity:0.8;} 55 | a.tmpTargetNode_inner {padding-top:0px; background-color:#aaa; color:@color-highlight; height:@h; border:1px #666 solid; 56 | opacity:0.8; filter:alpha(opacity=80)} 57 | a.tmpTargetNode_prev {} 58 | a.tmpTargetNode_next {} 59 | span {line-height:@h; margin-right:2px; background-color:transparent;} 60 | span.button {line-height:0; margin:0; padding: 0; width:@w; height:@h; display: inline-block; vertical-align:top; 61 | border:0px solid; cursor: pointer;outline:none; 62 | background-color:transparent; background-repeat:no-repeat; background-attachment: scroll; 63 | 64 | &::before{color: @color-normal; font-family: FontAwesome; padding-top:@pad-top;} 65 | &.chk { margin:0px; cursor: auto; width: 12px; 66 | display: inline-block;padding-top:@pad-top;padding-left:@pad-left; 67 | 68 | &.checkbox_false_full::before {content: @fa-square-o;} 69 | &.checkbox_false_full_focus::before {content: @fa-square-o; color:@color-highlight;} 70 | &.checkbox_false_part::before {content: @fa-square-o;color: @color-partial;} 71 | &.checkbox_false_part_focus::before {content: @fa-square-o; color:@color-partfocus;} 72 | &.checkbox_false_disable::before {content: @fa-square-o; color:@color-disabled;} 73 | &.checkbox_true_full::before {content: @fa-check-square-o;} 74 | &.checkbox_true_full_focus::before {content: @fa-check-square-o;} 75 | &.checkbox_true_part::before {content: @fa-check-square;} 76 | &.checkbox_true_part_focus::before {content: @fa-check-square; color: @color-highlight} 77 | &.checkbox_true_full_focus::before {content: @fa-check-square-o; color: @color-highlight} 78 | &.checkbox_true_part::before {content: @fa-check-square-o;color: @color-partial} 79 | &.checkbox_true_part_focus::before {content: @fa-check-square-o;color: @color-partfocus;} 80 | &.checkbox_true_disable::before {content: @fa-check-square-o;color: @color-disabled} 81 | 82 | &.radio_false_full::before {content: @fa-circle-o;} 83 | &.radio_false_full_focus::before {content: @fa-circle-o;color: @color-highlight} 84 | &.radio_false_part::before {content: @fa-circle-o;color: @color-partial} 85 | &.radio_false_part_focus::before {content: @fa-circle-o;color: @color-highlight} 86 | &.radio_false_disable::before {content: @fa-circle-thin;color: @color-disabled} 87 | &.radio_true_full::before {content: @fa-dot-circle-o;} 88 | &.radio_true_full_focus::before {content: @fa-dot-circle-o;color: @color-highlight} 89 | &.radio_true_part::before {content: @fa-dot-circle-o;color: @color-partial} 90 | &.radio_true_part_focus::before {content: @fa-dot-circle-o;color: @color-partial;} 91 | &.radio_true_disable::before {content: @fa-circle-thin;color: @color-disabled} 92 | 93 | } 94 | &.switch {width:@w; height:@h} 95 | &.root_open::before{content: @fa-chevron-down;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;} 96 | &.root_close::before{content: @fa-folder-open-o;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;} 97 | &.roots_open::before{content: @fa-chevron-down;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;} 98 | &.roots_close::before{content: @fa-chevron-right;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;} 99 | &.center_open::before{content: @fa-chevron-down;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;} 100 | &.center_close::before{content: @fa-chevron-right;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;} 101 | &.bottom_open::before{content: @fa-chevron-down;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;} 102 | &.bottom_close::before{content: @fa-chevron-right;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;} 103 | &.noline_open{} 104 | &.noline_close{} 105 | &.root_docu{ background:none;} 106 | &.roots_docu::before{content: @fa-list-alt;padding-left:@pad-left;display: inline-block;color:@color-normal;} 107 | &.center_docu::before{padding-top:@pad-top;padding-left:@pad-left;display: inline-block;color:@color-normal;} 108 | &.bottom_docu::before{padding-top:@pad-top;padding-left:@pad-left;display: inline-block;color:@color-normal;} 109 | &.noline_docu{ background:none;} 110 | 111 | &.ico_open::before {content: @fa-folder-open-o;font-family: FontAwesome;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;color:@color-normal;} 112 | &.ico_close::before {content: @fa-folder-o;font-family: FontAwesome;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;color:@color-normal;} 113 | &.ico_docu::before{content: @fa-list-alt;font-family: FontAwesome;padding-top:@pad-top;padding-left:@pad-left;display: inline-block;color:@color-normal;} 114 | 115 | &.edit {margin-left:4px; margin-right: -1px; vertical-align:top; *vertical-align:middle;padding-top:@pad-top;} 116 | &.edit::before{content: @fa-pencil-square-o;font-family: FontAwesome;} 117 | 118 | &.remove {margin-left:4px; margin-right: -1px; vertical-align:top; *vertical-align:middle;padding-top:@pad-top;} 119 | &.remove::before{content: @fa-trash;font-family: FontAwesome;} 120 | 121 | 122 | &.add {margin-left:4px; margin-right: -1px; vertical-align:top; *vertical-align:middle;padding-top:@pad-top;} 123 | &.add::before{content: @fa-plus;font-family: FontAwesome;} 124 | 125 | &.ico_loading{margin-right:2px; background:url(./img/loading.gif) no-repeat scroll 0 0 transparent; vertical-align:top; *vertical-align:middle} 126 | } 127 | 128 | } 129 | } 130 | 131 | 132 | ul.tmpTargetzTree {background-color:#FFE6B0; opacity:0.8; filter:alpha(opacity=80)} 133 | 134 | // this is the arrow that moves 135 | span.tmpzTreeMove_arrow{width:16px; height:@h; display: inline-block; 136 | padding:0; margin:2px 0 0 1px; border:0 none; position:absolute; 137 | background-color:transparent; background-attachment: scroll; 138 | } 139 | span.tmpzTreeMove_arrow::before{content: @fa-play;font-family: FontAwesome;color: @color-highlight; 140 | } 141 | // outline 142 | 143 | ul.ztree.zTreeDragUL {margin:0; padding:0; position:absolute; width:auto; height:auto;overflow:hidden; 144 | background-color:#cfcfcf; border:1px @color-highlight dotted; opacity:0.8; filter:alpha(opacity=80)} 145 | .ztreeMask {z-index:10000; background-color:#cfcfcf; opacity:0.0; filter:alpha(opacity=0); position:absolute} 146 | 147 | -------------------------------------------------------------------------------- /src/assets/js/json.js: -------------------------------------------------------------------------------- 1 | window.SINGLE_TAB = " "; 2 | window.ImgCollapsed = "Collapsed.gif"; 3 | window.ImgExpanded = "Expanded.gif"; 4 | window.QuoteKeys = true; 5 | function $id(id){ return document.getElementById(id); } 6 | function IsArray(obj) { 7 | return obj && 8 | typeof obj === 'object' && 9 | typeof obj.length === 'number' && 10 | !(obj.propertyIsEnumerable('length')); 11 | } 12 | 13 | function Process(){ 14 | var json = window.json; 15 | SetTab(); 16 | window.IsCollapsible = true; 17 | var html = ""; 18 | try{ 19 | if(json == "") json = "\"\""; 20 | var obj = eval("["+json+"]"); 21 | html = ProcessObject(obj[0], 0, false, false, false); 22 | $id("Canvas").innerHTML = "
"+html+"
"; 23 | $("#json_text").html("
"+html+"
"); // hongtao 24 | }catch(e){ 25 | alert("JSON数据格式不正确:\n"+e.message); 26 | $id("Canvas").innerHTML = json; 27 | } 28 | } 29 | window._dateObj = new Date(); 30 | window._regexpObj = new RegExp(); 31 | function ProcessObject(obj, indent, addComma, isArray, isPropertyContent){ 32 | var html = ""; 33 | var comma = (addComma) ? ", " : ""; 34 | var type = typeof obj; 35 | var clpsHtml =""; 36 | if(IsArray(obj)){ 37 | if(obj.length == 0){ 38 | html += GetRow(indent, "[ ]"+comma, isPropertyContent); 39 | }else{ 40 | clpsHtml = window.IsCollapsible ? "" : ""; 41 | html += GetRow(indent, "["+clpsHtml, isPropertyContent); 42 | for(var i = 0; i < obj.length; i++){ 43 | html += ProcessObject(obj[i], indent + 1, i < (obj.length - 1), true, false); 44 | } 45 | clpsHtml = window.IsCollapsible ? "" : ""; 46 | html += GetRow(indent, clpsHtml+"]"+comma); 47 | } 48 | }else if(type == 'object'){ 49 | if (obj == null){ 50 | html += FormatLiteral("null", "", comma, indent, isArray, "Null"); 51 | }else if (obj.constructor == window._dateObj.constructor) { 52 | html += FormatLiteral("new Date(" + obj.getTime() + ") /*" + obj.toLocaleString()+"*/", "", comma, indent, isArray, "Date"); 53 | }else if (obj.constructor == window._regexpObj.constructor) { 54 | html += FormatLiteral("new RegExp(" + obj + ")", "", comma, indent, isArray, "RegExp"); 55 | }else{ 56 | var numProps = 0; 57 | for(var prop in obj) numProps++; 58 | if(numProps == 0){ 59 | html += GetRow(indent, "{ }"+comma, isPropertyContent); 60 | }else{ 61 | clpsHtml = window.IsCollapsible ? "" : ""; 62 | html += GetRow(indent, "{"+clpsHtml, isPropertyContent); 63 | 64 | var j = 0; 65 | 66 | for(var prop in obj){ 67 | 68 | var quote = window.QuoteKeys ? "\"" : ""; 69 | 70 | html += GetRow(indent + 1, ""+quote+prop+quote+": "+ProcessObject(obj[prop], indent + 1, ++j < numProps, false, true)); 71 | 72 | } 73 | 74 | clpsHtml = window.IsCollapsible ? "" : ""; 75 | 76 | html += GetRow(indent, clpsHtml+"}"+comma); 77 | 78 | } 79 | 80 | } 81 | 82 | }else if(type == 'number'){ 83 | 84 | html += FormatLiteral(obj, "", comma, indent, isArray, "Number"); 85 | 86 | }else if(type == 'boolean'){ 87 | 88 | html += FormatLiteral(obj, "", comma, indent, isArray, "Boolean"); 89 | 90 | }else if(type == 'function'){ 91 | 92 | if (obj.constructor == window._regexpObj.constructor) { 93 | 94 | html += FormatLiteral("new RegExp(" + obj + ")", "", comma, indent, isArray, "RegExp"); 95 | 96 | }else{ 97 | 98 | obj = FormatFunction(indent, obj); 99 | 100 | html += FormatLiteral(obj, "", comma, indent, isArray, "Function"); 101 | 102 | } 103 | 104 | }else if(type == 'undefined'){ 105 | 106 | html += FormatLiteral("undefined", "", comma, indent, isArray, "Null"); 107 | 108 | }else{ 109 | 110 | html += FormatLiteral(obj.toString().split("\\").join("\\\\").split('"').join('\\"'), "\"", comma, indent, isArray, "String"); 111 | 112 | } 113 | 114 | return html; 115 | 116 | } 117 | 118 | function FormatLiteral(literal, quote, comma, indent, isArray, style){ 119 | 120 | if(typeof literal == 'string') 121 | 122 | literal = literal.split("<").join("<").split(">").join(">"); 123 | 124 | var str = ""+quote+literal+quote+comma+""; 125 | 126 | if(isArray) str = GetRow(indent, str); 127 | 128 | return str; 129 | 130 | } 131 | 132 | function FormatFunction(indent, obj){ 133 | 134 | var tabs = ""; 135 | 136 | for(var i = 0; i < indent; i++) tabs += window.TAB; 137 | 138 | var funcStrArray = obj.toString().split("\n"); 139 | 140 | var str = ""; 141 | 142 | for(var i = 0; i < funcStrArray.length; i++){ 143 | 144 | str += ((i==0)?"":tabs) + funcStrArray[i] + "\n"; 145 | 146 | } 147 | 148 | return str; 149 | 150 | } 151 | 152 | function GetRow(indent, data, isPropertyContent){ 153 | 154 | var tabs = ""; 155 | 156 | for(var i = 0; i < indent && !isPropertyContent; i++) tabs += window.TAB; 157 | 158 | if(data != null && data.length > 0 && data.charAt(data.length-1) != "\n") 159 | 160 | data = data+"\n"; 161 | 162 | return tabs+data; 163 | 164 | } 165 | 166 | 167 | function QuoteKeysClicked(){ 168 | 169 | window.QuoteKeys = $id("QuoteKeys").checked; 170 | 171 | Process(); 172 | 173 | } 174 | 175 | 176 | 177 | function CollapseAllClicked(){ 178 | 179 | EnsureIsPopulated(); 180 | 181 | TraverseChildren($id("Canvas"), function(element){ 182 | 183 | if(element.className == 'collapsible'){ 184 | 185 | MakeContentVisible(element, false); 186 | 187 | } 188 | 189 | }, 0); 190 | 191 | } 192 | 193 | function ExpandAllClicked(){ 194 | 195 | EnsureIsPopulated(); 196 | 197 | TraverseChildren($id("Canvas"), function(element){ 198 | 199 | if(element.className == 'collapsible'){ 200 | 201 | MakeContentVisible(element, true); 202 | 203 | } 204 | 205 | }, 0); 206 | 207 | } 208 | 209 | function MakeContentVisible(element, visible){ 210 | 211 | var img = element.previousSibling.firstChild; 212 | 213 | if(!!img.tagName && img.tagName.toLowerCase() == "img"){ 214 | 215 | element.style.display = visible ? 'inline' : 'none'; 216 | 217 | element.previousSibling.firstChild.src = visible ? window.ImgExpanded : window.ImgCollapsed; 218 | 219 | } 220 | 221 | } 222 | 223 | function TraverseChildren(element, func, depth){ 224 | 225 | for(var i = 0; i < element.childNodes.length; i++){ 226 | 227 | TraverseChildren(element.childNodes[i], func, depth + 1); 228 | 229 | } 230 | 231 | func(element, depth); 232 | 233 | } 234 | 235 | function ExpImgClicked(img){ 236 | 237 | var container = img.parentNode.nextSibling; 238 | 239 | if(!container) return; 240 | 241 | var disp = "none"; 242 | 243 | var src = window.ImgCollapsed; 244 | 245 | if(container.style.display == "none"){ 246 | 247 | disp = "inline"; 248 | 249 | src = window.ImgExpanded; 250 | 251 | } 252 | 253 | container.style.display = disp; 254 | 255 | img.src = src; 256 | 257 | } 258 | 259 | function CollapseLevel(level){ 260 | 261 | EnsureIsPopulated(); 262 | 263 | TraverseChildren($id("Canvas"), function(element, depth){ 264 | 265 | if(element.className == 'collapsible'){ 266 | 267 | if(depth >= level){ 268 | 269 | MakeContentVisible(element, false); 270 | 271 | }else{ 272 | 273 | MakeContentVisible(element, true); 274 | 275 | } 276 | 277 | } 278 | 279 | }, 0); 280 | 281 | } 282 | 283 | function TabSizeChanged(){ 284 | 285 | Process(); 286 | 287 | } 288 | 289 | function SetTab(){ 290 | 291 | var select = $id("TabSize"); 292 | 293 | window.TAB = MultiplyString(parseInt(select.options[select.selectedIndex].value), window.SINGLE_TAB); 294 | 295 | } 296 | 297 | function EnsureIsPopulated(){ 298 | 299 | if(!$id("Canvas").innerHTML && !!$id("RawJson").value) Process(); 300 | 301 | } 302 | 303 | function MultiplyString(num, str){ 304 | 305 | var sb =[]; 306 | 307 | for(var i = 0; i < num; i++){ 308 | 309 | sb.push(str); 310 | 311 | } 312 | 313 | return sb.join(""); 314 | 315 | } 316 | 317 | function SelectAllClicked(){ 318 | 319 | 320 | 321 | if(!!document.selection && !!document.selection.empty) { 322 | 323 | document.selection.empty(); 324 | 325 | } else if(window.getSelection) { 326 | 327 | var sel = window.getSelection(); 328 | 329 | if(sel.removeAllRanges) { 330 | 331 | window.getSelection().removeAllRanges(); 332 | 333 | } 334 | 335 | } 336 | 337 | 338 | 339 | var range = 340 | 341 | (!!document.body && !!document.body.createTextRange) 342 | 343 | ? document.body.createTextRange() 344 | 345 | : document.createRange(); 346 | 347 | 348 | 349 | if(!!range.selectNode) 350 | 351 | range.selectNode($id("Canvas")); 352 | 353 | else if(range.moveToElementText) 354 | 355 | range.moveToElementText($id("Canvas")); 356 | 357 | 358 | 359 | if(!!range.select) 360 | 361 | range.select($id("Canvas")); 362 | 363 | else 364 | 365 | window.getSelection().addRange(range); 366 | 367 | } 368 | 369 | function LinkToJson(){ 370 | 371 | var val = $id("RawJson").value; 372 | 373 | val = escape(val.split('/n').join(' ').split('/r').join(' ')); 374 | 375 | $id("InvisibleLinkUrl").value = val; 376 | 377 | $id("InvisibleLink").submit(); 378 | 379 | } -------------------------------------------------------------------------------- /src/assets/js/bootstrap-typeahead.js: -------------------------------------------------------------------------------- 1 | /* ============================================================= 2 | * bootstrap-typeahead.js v2.3.2 3 | * http://twbs.github.com/bootstrap/javascript.html#typeahead 4 | * ============================================================= 5 | * Copyright 2013 Twitter, Inc. 6 | * 7 | * Licensed under the Apache License, Version 2.0 (the "License"); 8 | * you may not use this file except in compliance with the License. 9 | * You may obtain a copy of the License at 10 | * 11 | * http://www.apache.org/licenses/LICENSE-2.0 12 | * 13 | * Unless required by applicable law or agreed to in writing, software 14 | * distributed under the License is distributed on an "AS IS" BASIS, 15 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 16 | * See the License for the specific language governing permissions and 17 | * limitations under the License. 18 | * ============================================================ */ 19 | 20 | 21 | !function($){ 22 | 23 | "use strict"; // jshint ;_; 24 | 25 | 26 | /* TYPEAHEAD PUBLIC CLASS DEFINITION 27 | * ================================= */ 28 | 29 | var Typeahead = function (element, options) { 30 | this.$element = $(element) 31 | this.options = $.extend({}, $.fn.typeahead.defaults, options) 32 | this.matcher = this.options.matcher || this.matcher 33 | this.sorter = this.options.sorter || this.sorter 34 | this.highlighter = this.options.highlighter || this.highlighter 35 | this.updater = this.options.updater || this.updater 36 | this.source = this.options.source 37 | this.$menu = $(this.options.menu) 38 | this.shown = false 39 | this.listen() 40 | } 41 | 42 | Typeahead.prototype = { 43 | 44 | constructor: Typeahead 45 | 46 | , select: function () { 47 | var val = this.$menu.find('.active').attr('data-value') 48 | this.$element 49 | .val(this.updater(val)) 50 | .change() 51 | return this.hide() 52 | } 53 | 54 | , updater: function (item) { 55 | return item 56 | } 57 | 58 | , show: function () { 59 | var pos = $.extend({}, this.$element.position(), { 60 | height: this.$element[0].offsetHeight 61 | }) 62 | 63 | this.$menu 64 | .insertAfter(this.$element) 65 | .css({ 66 | top: pos.top + pos.height 67 | , left: pos.left 68 | }) 69 | .show() 70 | 71 | this.shown = true 72 | return this 73 | } 74 | 75 | , hide: function () { 76 | this.$menu.hide() 77 | this.shown = false 78 | return this 79 | } 80 | 81 | , lookup: function (event) { 82 | var items 83 | 84 | this.query = this.$element.val() 85 | 86 | if (!this.query || this.query.length < this.options.minLength) { 87 | return this.shown ? this.hide() : this 88 | } 89 | 90 | items = $.isFunction(this.source) ? this.source(this.query, $.proxy(this.process, this)) : this.source 91 | 92 | return items ? this.process(items) : this 93 | } 94 | 95 | , process: function (items) { 96 | var that = this 97 | 98 | items = $.grep(items, function (item) { 99 | return that.matcher(item) 100 | }) 101 | 102 | items = this.sorter(items) 103 | 104 | if (!items.length) { 105 | return this.shown ? this.hide() : this 106 | } 107 | 108 | return this.render(items.slice(0, this.options.items)).show() 109 | } 110 | 111 | , matcher: function (item) { 112 | return ~item.toLowerCase().indexOf(this.query.toLowerCase()) 113 | } 114 | 115 | , sorter: function (items) { 116 | var beginswith = [] 117 | , caseSensitive = [] 118 | , caseInsensitive = [] 119 | , item 120 | 121 | while (item = items.shift()) { 122 | if (!item.toLowerCase().indexOf(this.query.toLowerCase())) beginswith.push(item) 123 | else if (~item.indexOf(this.query)) caseSensitive.push(item) 124 | else caseInsensitive.push(item) 125 | } 126 | 127 | return beginswith.concat(caseSensitive, caseInsensitive) 128 | } 129 | 130 | , highlighter: function (item) { 131 | var query = this.query.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, '\\$&') 132 | return item.replace(new RegExp('(' + query + ')', 'ig'), function ($1, match) { 133 | return '' + match + '' 134 | }) 135 | } 136 | 137 | , render: function (items) { 138 | var that = this 139 | 140 | items = $(items).map(function (i, item) { 141 | i = $(that.options.item).attr('data-value', item) 142 | i.find('a').html(that.highlighter(item)) 143 | return i[0] 144 | }) 145 | 146 | items.first().addClass('active') 147 | this.$menu.html(items) 148 | return this 149 | } 150 | 151 | , next: function (event) { 152 | var active = this.$menu.find('.active').removeClass('active') 153 | , next = active.next() 154 | 155 | if (!next.length) { 156 | next = $(this.$menu.find('li')[0]) 157 | } 158 | 159 | next.addClass('active') 160 | } 161 | 162 | , prev: function (event) { 163 | var active = this.$menu.find('.active').removeClass('active') 164 | , prev = active.prev() 165 | 166 | if (!prev.length) { 167 | prev = this.$menu.find('li').last() 168 | } 169 | 170 | prev.addClass('active') 171 | } 172 | 173 | , listen: function () { 174 | this.$element 175 | .on('focus', $.proxy(this.focus, this)) 176 | .on('blur', $.proxy(this.blur, this)) 177 | .on('keypress', $.proxy(this.keypress, this)) 178 | .on('keyup', $.proxy(this.keyup, this)) 179 | 180 | if (this.eventSupported('keydown')) { 181 | this.$element.on('keydown', $.proxy(this.keydown, this)) 182 | } 183 | 184 | this.$menu 185 | .on('click', $.proxy(this.click, this)) 186 | .on('mouseenter', 'li', $.proxy(this.mouseenter, this)) 187 | .on('mouseleave', 'li', $.proxy(this.mouseleave, this)) 188 | } 189 | 190 | , eventSupported: function(eventName) { 191 | var isSupported = eventName in this.$element 192 | if (!isSupported) { 193 | this.$element.setAttribute(eventName, 'return;') 194 | isSupported = typeof this.$element[eventName] === 'function' 195 | } 196 | return isSupported 197 | } 198 | 199 | , move: function (e) { 200 | if (!this.shown) return 201 | 202 | switch(e.keyCode) { 203 | case 9: // tab 204 | case 13: // enter 205 | case 27: // escape 206 | e.preventDefault() 207 | break 208 | 209 | case 38: // up arrow 210 | e.preventDefault() 211 | this.prev() 212 | break 213 | 214 | case 40: // down arrow 215 | e.preventDefault() 216 | this.next() 217 | break 218 | } 219 | 220 | e.stopPropagation() 221 | } 222 | 223 | , keydown: function (e) { 224 | this.suppressKeyPressRepeat = ~$.inArray(e.keyCode, [40,38,9,13,27]) 225 | this.move(e) 226 | } 227 | 228 | , keypress: function (e) { 229 | if (this.suppressKeyPressRepeat) return 230 | this.move(e) 231 | } 232 | 233 | , keyup: function (e) { 234 | switch(e.keyCode) { 235 | case 40: // down arrow 236 | case 38: // up arrow 237 | case 16: // shift 238 | case 17: // ctrl 239 | case 18: // alt 240 | break 241 | 242 | case 9: // tab 243 | case 13: // enter 244 | if (!this.shown) return 245 | this.select() 246 | break 247 | 248 | case 27: // escape 249 | if (!this.shown) return 250 | this.hide() 251 | break 252 | 253 | default: 254 | this.lookup() 255 | } 256 | 257 | e.stopPropagation() 258 | e.preventDefault() 259 | } 260 | 261 | , focus: function (e) { 262 | this.focused = true 263 | } 264 | 265 | , blur: function (e) { 266 | this.focused = false 267 | if (!this.mousedover && this.shown) this.hide() 268 | } 269 | 270 | , click: function (e) { 271 | e.stopPropagation() 272 | e.preventDefault() 273 | this.select() 274 | this.$element.focus() 275 | } 276 | 277 | , mouseenter: function (e) { 278 | this.mousedover = true 279 | this.$menu.find('.active').removeClass('active') 280 | $(e.currentTarget).addClass('active') 281 | } 282 | 283 | , mouseleave: function (e) { 284 | this.mousedover = false 285 | if (!this.focused && this.shown) this.hide() 286 | } 287 | 288 | } 289 | 290 | 291 | /* TYPEAHEAD PLUGIN DEFINITION 292 | * =========================== */ 293 | 294 | var old = $.fn.typeahead 295 | 296 | $.fn.typeahead = function (option) { 297 | return this.each(function () { 298 | var $this = $(this) 299 | , data = $this.data('typeahead') 300 | , options = typeof option == 'object' && option 301 | if (!data) $this.data('typeahead', (data = new Typeahead(this, options))) 302 | if (typeof option == 'string') data[option]() 303 | }) 304 | } 305 | 306 | $.fn.typeahead.defaults = { 307 | source: [] 308 | , items: 8 309 | , menu: '' 310 | , item: '
  • ' 311 | , minLength: 1 312 | } 313 | 314 | $.fn.typeahead.Constructor = Typeahead 315 | 316 | 317 | /* TYPEAHEAD NO CONFLICT 318 | * =================== */ 319 | 320 | $.fn.typeahead.noConflict = function () { 321 | $.fn.typeahead = old 322 | return this 323 | } 324 | 325 | 326 | /* TYPEAHEAD DATA-API 327 | * ================== */ 328 | 329 | $(document).on('focus.typeahead.data-api', '[data-provide="typeahead"]', function (e) { 330 | var $this = $(this) 331 | if ($this.data('typeahead')) return 332 | $this.typeahead($this.data()) 333 | }) 334 | 335 | }(window.jQuery); 336 | -------------------------------------------------------------------------------- /src/DocController.php: -------------------------------------------------------------------------------- 1 | 'application/xml,text/xml,application/x-xml', 26 | 'json' => 'application/json,text/x-json,application/jsonrequest,text/json', 27 | 'js' => 'text/javascript,application/javascript,application/x-javascript', 28 | 'css' => 'text/css', 29 | 'rss' => 'application/rss+xml', 30 | 'yaml' => 'application/x-yaml,text/yaml', 31 | 'atom' => 'application/atom+xml', 32 | 'pdf' => 'application/pdf', 33 | 'text' => 'text/plain', 34 | 'png' => 'image/png', 35 | 'jpg' => 'image/jpg,image/jpeg,image/pjpeg', 36 | 'gif' => 'image/gif', 37 | 'csv' => 'text/csv', 38 | 'html' => 'text/html,application/xhtml+xml,*/*', 39 | ]; 40 | 41 | public $static_path = '/apidoc/'; 42 | 43 | public function __construct(Request $request){ 44 | 45 | $this->doc = new Doc((array)Config::get('doc')); 46 | View::config(['view_path' => __DIR__.DIRECTORY_SEPARATOR.'view'.DIRECTORY_SEPARATOR]); 47 | View::assign('title', Config::get("doc.title")); 48 | View::assign('version', Config::get("doc.version")); 49 | View::assign('copyright', Config::get("doc.copyright")); 50 | if(Config::get("doc.static_path", '')){ 51 | $this->static_path = Config::get("doc.static_path"); 52 | } 53 | View::assign('static', $this->static_path); 54 | $this->request = $request; 55 | } 56 | 57 | /** 58 | * 文档首页 59 | * @return Response 60 | */ 61 | public function index() 62 | { 63 | View::assign('root', $this->request->root()); 64 | if($this->checkLogin() == false){ 65 | return redirect('pass'); 66 | } 67 | return view('index', ['doc' => $this->request->get('name')]); 68 | } 69 | 70 | /** 71 | * 文档搜素 72 | * @return \think\Response|\think\response\View 73 | */ 74 | public function search() 75 | { 76 | if($this->request->isAjax()) 77 | { 78 | $data = $this->doc->searchList($this->request->get('query')); 79 | return response($data, 200); 80 | } 81 | else 82 | { 83 | if($this->checkLogin() == false){ 84 | return redirect('pass'); 85 | } 86 | $module = $this->doc->getModuleList(); 87 | View::assign('root', $this->request->root()); 88 | return view('search', ['module' => $module]); 89 | } 90 | } 91 | 92 | /** 93 | * 设置目录树及图标 94 | * @param $actions 95 | * @return mixed 96 | */ 97 | protected function setIcon($actions, $num = 1) 98 | { 99 | foreach ($actions as $key=>$moudel){ 100 | if(isset($moudel['actions'])){ 101 | $actions[$key]['iconClose'] = $this->static_path."/js/zTree_v3/img/zt-folder.png"; 102 | $actions[$key]['iconOpen'] = $this->static_path."/js/zTree_v3/img/zt-folder-o.png"; 103 | $actions[$key]['open'] = true; 104 | $actions[$key]['isParent'] = true; 105 | $actions[$key]['actions'] = $this->setIcon($moudel['actions'], $num = 1); 106 | }else{ 107 | $actions[$key]['icon'] = $this->static_path."/js/zTree_v3/img/zt-file.png"; 108 | $actions[$key]['isParent'] = false; 109 | $actions[$key]['isText'] = true; 110 | } 111 | } 112 | return $actions; 113 | } 114 | 115 | /** 116 | * 接口列表 117 | */ 118 | public function getList() 119 | { 120 | $list = $this->doc->getList(); 121 | $list = $this->setIcon($list); 122 | return response(['firstId'=>'', 'list'=>$list], 200, [], 'json'); 123 | } 124 | 125 | /** 126 | * 接口详情 127 | * @return mixed 128 | */ 129 | public function getInfo() 130 | { 131 | if($this->checkLogin() == false){ 132 | return redirect('pass'); 133 | } 134 | list($class, $action) = explode("::", $this->request->get('name')); 135 | $action_doc = $this->doc->getInfo($class, $action); 136 | if($action_doc) 137 | { 138 | $return = $this->doc->formatReturn($action_doc); 139 | $action_doc['header'] = isset($action_doc['header']) ? array_merge($this->doc->__get('public_header'), $action_doc['header']) : []; 140 | $action_doc['param'] = isset($action_doc['param']) ? array_merge($this->doc->__get('public_param'), $action_doc['param']) : []; 141 | //curl code 142 | $curl_code = 'curl --location --request '.($action_doc['method'] ?? 'GET'); 143 | $params = []; 144 | foreach ($action_doc['param'] as $param){ 145 | $params[$param['name']] = $param['default'] ?? ''; 146 | } 147 | $curl_code .= ' \''.$this->request->root().($action_doc["url"] ?? '').(count($params) > 0 ? '?'.http_build_query($params) : '').'\' '; 148 | foreach ($action_doc['header'] as $header){ 149 | $curl_code .= '--header \''.$header['name'].':\''; 150 | } 151 | View::assign('root', $this->request->root()); 152 | return view('info', ['doc'=>$action_doc, 'return'=>$return, 'curl_code' => $curl_code]); 153 | } 154 | } 155 | 156 | /** 157 | * 验证密码 158 | * @return bool 159 | */ 160 | protected function checkLogin() 161 | { 162 | $pass = $this->doc->__get("password"); 163 | if($pass){ 164 | if(cache('apidoc-pass') === md5($pass)){ 165 | return true; 166 | }else{ 167 | return false; 168 | } 169 | }else{ 170 | return true; 171 | } 172 | } 173 | 174 | /** 175 | * 输入密码 176 | * @return string 177 | */ 178 | public function pass() 179 | { 180 | View::assign('root', $this->request->root()); 181 | return view('pass'); 182 | } 183 | 184 | /** 185 | * 登录 186 | * @return string 187 | */ 188 | public function login() 189 | { 190 | $pass = $this->doc->__get("password"); 191 | if($pass && $this->request->param('pass') === $pass){ 192 | cache('apidoc-pass', md5($pass)); 193 | $data = ['status' => '200', 'message' => '登录成功']; 194 | }else if(!$pass){ 195 | $data = ['status' => '200', 'message' => '登录成功']; 196 | }else{ 197 | $data = ['status' => '300', 'message' => '密码错误']; 198 | } 199 | return response($data, 200, [], 'json'); 200 | } 201 | 202 | /** 203 | * 接口访问测试 204 | * @return \think\Response 205 | */ 206 | public function debug() 207 | { 208 | $data = $this->request->all(); 209 | $api_url = $this->request->input('url'); 210 | $res['status'] = '404'; 211 | $res['meaasge'] = '接口地址无法访问!'; 212 | $res['result'] = ''; 213 | $method = $this->request->input('method_type', 'GET'); 214 | $cookie = $this->request->input('cookie'); 215 | $headers = $this->request->input('header', array()); 216 | unset($data['method_type']); 217 | unset($data['url']); 218 | unset($data['cookie']); 219 | unset($data['header']); 220 | $res['result'] = $this->http_request($api_url, $cookie, $data, $method, $headers); 221 | if($res['result']){ 222 | $res['status'] = '200'; 223 | $res['meaasge'] = 'success'; 224 | } 225 | return response($res, 200, [], 'json'); 226 | } 227 | 228 | /** 229 | * curl模拟请求方法 230 | * @param $url 231 | * @param $cookie 232 | * @param array $data 233 | * @param $method 234 | * @param array $headers 235 | * @return mixed 236 | */ 237 | private function http_request($url, $cookie, $data = array(), $method = array(), $headers = array()){ 238 | $curl = curl_init(); 239 | if(count($data) && $method == "GET"){ 240 | $data = array_filter($data); 241 | $url .= "?".http_build_query($data); 242 | $url = str_replace(array('%5B0%5D'), array('[]'), $url); 243 | } 244 | curl_setopt($curl, CURLOPT_URL, $url); 245 | curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, FALSE); 246 | curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, FALSE); 247 | if (count($headers)){ 248 | $head = array(); 249 | foreach ($headers as $name=>$value){ 250 | $head[] = $name.":".$value; 251 | } 252 | curl_setopt($curl, CURLOPT_HTTPHEADER, $head); 253 | } 254 | $method = strtoupper($method); 255 | switch($method) { 256 | case 'GET': 257 | break; 258 | case 'POST': 259 | curl_setopt($curl, CURLOPT_POST, true); 260 | curl_setopt($curl, CURLOPT_POSTFIELDS, $data); 261 | break; 262 | case 'PUT': 263 | curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'PUT'); 264 | curl_setopt($curl, CURLOPT_POSTFIELDS, $data); 265 | break; 266 | case 'DELETE': 267 | curl_setopt($curl, CURLOPT_CUSTOMREQUEST, 'DELETE'); 268 | break; 269 | } 270 | if (!empty($cookie)){ 271 | curl_setopt($curl, CURLOPT_COOKIE, $cookie); 272 | } 273 | curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1); 274 | $output = curl_exec($curl); 275 | curl_close($curl); 276 | return $output; 277 | } 278 | 279 | } -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/awesomeStyle/awesome.css: -------------------------------------------------------------------------------- 1 | /*------------------------------------- 2 | zTree Style using fontawesome instead of images 3 | 4 | version: 1.1 5 | author: Mike King 6 | email: mikkelking @ hotmail . com 7 | website: http://code.google.com/p/jquerytree/ 8 | 9 | -------------------------------------*/ 10 | /* Definitions ----------------------*/ 11 | /* End of Definitions ---------------*/ 12 | /* Imports -------------------------*/ 13 | /* End of Imports ------------------*/ 14 | .ztree * { 15 | padding: 0; 16 | margin: 0; 17 | font-size: 12px; 18 | font-family: Verdana, Arial, Helvetica, AppleGothic, sans-serif; 19 | background-color: #af0000; 20 | } 21 | .ztree { 22 | margin: 0; 23 | padding: 5px; 24 | color: #ffffff; 25 | background-color: #af0000; 26 | } 27 | .ztree li { 28 | padding: 0; 29 | margin: 0; 30 | list-style: none; 31 | line-height: 17px; 32 | text-align: left; 33 | white-space: nowrap; 34 | outline: 0; 35 | } 36 | .ztree li ul { 37 | margin: 0px; 38 | padding: 0 0 0 18px; 39 | } 40 | .ztree li a { 41 | padding-right: 3px; 42 | margin: 0; 43 | cursor: pointer; 44 | height: 17px; 45 | color: #ffffff; 46 | background-color: transparent; 47 | text-decoration: none; 48 | vertical-align: top; 49 | display: inline-block; 50 | } 51 | .ztree li a input.rename { 52 | height: 14px; 53 | width: 80px; 54 | padding: 0; 55 | margin: 0; 56 | color: #af0000; 57 | background-color: #ffffff; 58 | font-size: 12px; 59 | border: 1px #585956 solid; 60 | *border: 0px; 61 | } 62 | .ztree li a:hover { 63 | text-decoration: underline; 64 | } 65 | .ztree li a.curSelectedNode { 66 | padding-top: 0px; 67 | background-color: #af4040; 68 | color: #ffff00; 69 | height: 17px; 70 | opacity: 0.8; 71 | } 72 | .ztree li a.curSelectedNode_Edit { 73 | padding-top: 0px; 74 | background-color: transparent; 75 | color: #ffff00; 76 | height: 17px; 77 | border: 1px #666 solid; 78 | opacity: 0.8; 79 | } 80 | .ztree li a.tmpTargetNode_inner { 81 | padding-top: 0px; 82 | background-color: #aaa; 83 | color: #ffff00; 84 | height: 17px; 85 | border: 1px #666 solid; 86 | opacity: 0.8; 87 | filter: alpha(opacity=80); 88 | } 89 | .ztree li span { 90 | line-height: 17px; 91 | margin-right: 2px; 92 | background-color: transparent; 93 | } 94 | .ztree li span.button { 95 | line-height: 0; 96 | margin: 0; 97 | padding: 0; 98 | width: 15px; 99 | height: 17px; 100 | display: inline-block; 101 | vertical-align: top; 102 | border: 0px solid; 103 | cursor: pointer; 104 | outline: none; 105 | background-color: transparent; 106 | background-repeat: no-repeat; 107 | background-attachment: scroll; 108 | } 109 | .ztree li span.button::before { 110 | color: #ffffff; 111 | font-family: FontAwesome; 112 | padding-top: 10px; 113 | } 114 | .ztree li span.button.chk { 115 | margin: 0px; 116 | cursor: auto; 117 | width: 12px; 118 | display: inline-block; 119 | padding-top: 10px; 120 | padding-left: 2px; 121 | } 122 | .ztree li span.button.chk.checkbox_false_full::before { 123 | content: "\f096"; 124 | } 125 | .ztree li span.button.chk.checkbox_false_full_focus::before { 126 | content: "\f096"; 127 | color: #ffff00; 128 | } 129 | .ztree li span.button.chk.checkbox_false_part::before { 130 | content: "\f096"; 131 | color: #aaaaaa; 132 | } 133 | .ztree li span.button.chk.checkbox_false_part_focus::before { 134 | content: "\f096"; 135 | color: #cad96c; 136 | } 137 | .ztree li span.button.chk.checkbox_false_disable::before { 138 | content: "\f096"; 139 | color: #808080; 140 | } 141 | .ztree li span.button.chk.checkbox_true_full::before { 142 | content: "\f046"; 143 | } 144 | .ztree li span.button.chk.checkbox_true_full_focus::before { 145 | content: "\f046"; 146 | } 147 | .ztree li span.button.chk.checkbox_true_part::before { 148 | content: "\f14a"; 149 | } 150 | .ztree li span.button.chk.checkbox_true_part_focus::before { 151 | content: "\f14a"; 152 | color: #ffff00; 153 | } 154 | .ztree li span.button.chk.checkbox_true_full_focus::before { 155 | content: "\f046"; 156 | color: #ffff00; 157 | } 158 | .ztree li span.button.chk.checkbox_true_part::before { 159 | content: "\f046"; 160 | color: #aaaaaa; 161 | } 162 | .ztree li span.button.chk.checkbox_true_part_focus::before { 163 | content: "\f046"; 164 | color: #cad96c; 165 | } 166 | .ztree li span.button.chk.checkbox_true_disable::before { 167 | content: "\f046"; 168 | color: #808080; 169 | } 170 | .ztree li span.button.chk.radio_false_full::before { 171 | content: "\f10c"; 172 | } 173 | .ztree li span.button.chk.radio_false_full_focus::before { 174 | content: "\f10c"; 175 | color: #ffff00; 176 | } 177 | .ztree li span.button.chk.radio_false_part::before { 178 | content: "\f10c"; 179 | color: #aaaaaa; 180 | } 181 | .ztree li span.button.chk.radio_false_part_focus::before { 182 | content: "\f10c"; 183 | color: #ffff00; 184 | } 185 | .ztree li span.button.chk.radio_false_disable::before { 186 | content: "\f1db"; 187 | color: #808080; 188 | } 189 | .ztree li span.button.chk.radio_true_full::before { 190 | content: "\f192"; 191 | } 192 | .ztree li span.button.chk.radio_true_full_focus::before { 193 | content: "\f192"; 194 | color: #ffff00; 195 | } 196 | .ztree li span.button.chk.radio_true_part::before { 197 | content: "\f192"; 198 | color: #aaaaaa; 199 | } 200 | .ztree li span.button.chk.radio_true_part_focus::before { 201 | content: "\f192"; 202 | color: #aaaaaa; 203 | } 204 | .ztree li span.button.chk.radio_true_disable::before { 205 | content: "\f1db"; 206 | color: #808080; 207 | } 208 | .ztree li span.button.switch { 209 | width: 15px; 210 | height: 17px; 211 | } 212 | .ztree li span.button.root_open::before { 213 | content: "\f078"; 214 | padding-top: 10px; 215 | padding-left: 2px; 216 | display: inline-block; 217 | } 218 | .ztree li span.button.root_close::before { 219 | content: "\f115"; 220 | padding-top: 10px; 221 | padding-left: 2px; 222 | display: inline-block; 223 | } 224 | .ztree li span.button.roots_open::before { 225 | content: "\f078"; 226 | padding-top: 10px; 227 | padding-left: 2px; 228 | display: inline-block; 229 | } 230 | .ztree li span.button.roots_close::before { 231 | content: "\f054"; 232 | padding-top: 10px; 233 | padding-left: 2px; 234 | display: inline-block; 235 | } 236 | .ztree li span.button.center_open::before { 237 | content: "\f078"; 238 | padding-top: 10px; 239 | padding-left: 2px; 240 | display: inline-block; 241 | } 242 | .ztree li span.button.center_close::before { 243 | content: "\f054"; 244 | padding-top: 10px; 245 | padding-left: 2px; 246 | display: inline-block; 247 | } 248 | .ztree li span.button.bottom_open::before { 249 | content: "\f078"; 250 | padding-top: 10px; 251 | padding-left: 2px; 252 | display: inline-block; 253 | } 254 | .ztree li span.button.bottom_close::before { 255 | content: "\f054"; 256 | padding-top: 10px; 257 | padding-left: 2px; 258 | display: inline-block; 259 | } 260 | .ztree li span.button.root_docu { 261 | background: none; 262 | } 263 | .ztree li span.button.roots_docu::before { 264 | content: "\f022"; 265 | padding-left: 2px; 266 | display: inline-block; 267 | color: #ffffff; 268 | } 269 | .ztree li span.button.center_docu::before { 270 | padding-top: 10px; 271 | padding-left: 2px; 272 | display: inline-block; 273 | color: #ffffff; 274 | } 275 | .ztree li span.button.bottom_docu::before { 276 | padding-top: 10px; 277 | padding-left: 2px; 278 | display: inline-block; 279 | color: #ffffff; 280 | } 281 | .ztree li span.button.noline_docu { 282 | background: none; 283 | } 284 | .ztree li span.button.ico_open::before { 285 | content: "\f115"; 286 | font-family: FontAwesome; 287 | padding-top: 10px; 288 | padding-left: 2px; 289 | display: inline-block; 290 | color: #ffffff; 291 | } 292 | .ztree li span.button.ico_close::before { 293 | content: "\f114"; 294 | font-family: FontAwesome; 295 | padding-top: 10px; 296 | padding-left: 2px; 297 | display: inline-block; 298 | color: #ffffff; 299 | } 300 | .ztree li span.button.ico_docu::before { 301 | content: "\f022"; 302 | font-family: FontAwesome; 303 | padding-top: 10px; 304 | padding-left: 2px; 305 | display: inline-block; 306 | color: #ffffff; 307 | } 308 | .ztree li span.button.edit { 309 | margin-left: 4px; 310 | margin-right: -1px; 311 | vertical-align: top; 312 | *vertical-align: middle; 313 | padding-top: 10px; 314 | } 315 | .ztree li span.button.edit::before { 316 | content: "\f044"; 317 | font-family: FontAwesome; 318 | } 319 | .ztree li span.button.remove { 320 | margin-left: 4px; 321 | margin-right: -1px; 322 | vertical-align: top; 323 | *vertical-align: middle; 324 | padding-top: 10px; 325 | } 326 | .ztree li span.button.remove::before { 327 | content: "\f1f8"; 328 | font-family: FontAwesome; 329 | } 330 | .ztree li span.button.add { 331 | margin-left: 4px; 332 | margin-right: -1px; 333 | vertical-align: top; 334 | *vertical-align: middle; 335 | padding-top: 10px; 336 | } 337 | .ztree li span.button.add::before { 338 | content: "\f067"; 339 | font-family: FontAwesome; 340 | } 341 | .ztree li span.button.ico_loading { 342 | margin-right: 2px; 343 | background: url(./img/loading.gif) no-repeat scroll 0 0 transparent; 344 | vertical-align: top; 345 | *vertical-align: middle; 346 | } 347 | ul.tmpTargetzTree { 348 | background-color: #FFE6B0; 349 | opacity: 0.8; 350 | filter: alpha(opacity=80); 351 | } 352 | span.tmpzTreeMove_arrow { 353 | width: 16px; 354 | height: 17px; 355 | display: inline-block; 356 | padding: 0; 357 | margin: 2px 0 0 1px; 358 | border: 0 none; 359 | position: absolute; 360 | background-color: transparent; 361 | background-attachment: scroll; 362 | } 363 | span.tmpzTreeMove_arrow::before { 364 | content: "\f04b"; 365 | font-family: FontAwesome; 366 | color: #ffff00; 367 | } 368 | ul.ztree.zTreeDragUL { 369 | margin: 0; 370 | padding: 0; 371 | position: absolute; 372 | width: auto; 373 | height: auto; 374 | overflow: hidden; 375 | background-color: #cfcfcf; 376 | border: 1px #ffff00 dotted; 377 | opacity: 0.8; 378 | filter: alpha(opacity=80); 379 | } 380 | .ztreeMask { 381 | z-index: 10000; 382 | background-color: #cfcfcf; 383 | opacity: 0.0; 384 | filter: alpha(opacity=0); 385 | position: absolute; 386 | } 387 | -------------------------------------------------------------------------------- /src/Doc.php: -------------------------------------------------------------------------------- 1 | 'APi接口文档', 8 | 'version'=>'1.0.0', 9 | 'copyright'=>'Powered By Zhangweiwei', 10 | 'controller' => [], 11 | 'filter_method'=>['_empty'], 12 | 'return_format' => [ 13 | 'status' => "200/300/301/302", 14 | 'message' => "提示信息", 15 | ] 16 | ]; 17 | 18 | /** 19 | * 架构方法 设置参数 20 | * @access public 21 | * @param array $config 配置参数 22 | */ 23 | public function __construct($config) 24 | { 25 | $this->config = array_merge($this->config, $config); 26 | } 27 | 28 | /** 29 | * 使用 $this->name 获取配置 30 | * @access public 31 | * @param string $name 配置名称 32 | * @return mixed 配置值 33 | */ 34 | public function __get($name) 35 | { 36 | return $this->config[$name]; 37 | } 38 | 39 | /** 40 | * 设置验证码配置 41 | * @access public 42 | * @param string $name 配置名称 43 | * @param string $value 配置值 44 | * @return void 45 | */ 46 | public function __set($name, $value) 47 | { 48 | if (isset($this->config[$name])) { 49 | $this->config[$name] = $value; 50 | } 51 | } 52 | 53 | /** 54 | * 检查配置 55 | * @access public 56 | * @param string $name 配置名称 57 | * @return bool 58 | */ 59 | public function __isset($name) 60 | { 61 | return isset($this->config[$name]); 62 | } 63 | 64 | /** 65 | * 获取接口列表 66 | * @return array 67 | */ 68 | public function getList() 69 | { 70 | $controller = $this->config['controller']; 71 | $list = []; 72 | foreach ($controller as $class) 73 | { 74 | if(class_exists($class)) 75 | { 76 | $module = []; 77 | $reflection = new \ReflectionClass($class); 78 | $doc_str = $reflection->getDocComment(); 79 | $doc = new DocParser(); 80 | $class_doc = $doc->parse($doc_str); 81 | $module = $class_doc; 82 | $module['class'] = $class; 83 | $method = $reflection->getMethods(\ReflectionMethod::IS_PUBLIC); 84 | $filter_method = array_merge(['__construct'], $this->config['filter_method']); 85 | $module['actions'] = []; 86 | foreach ($method as $action){ 87 | if(!in_array($action->name, $filter_method)) 88 | { 89 | $doc = new DocParser(); 90 | $doc_str = $action->getDocComment(); 91 | if($doc_str) 92 | { 93 | $action_doc = $doc->parse($doc_str); 94 | $action_doc['name'] = $class."::".$action->name; 95 | if(array_key_exists('title', $action_doc)){ 96 | if(array_key_exists('module', $action_doc)){ 97 | $key = array_search($action_doc['module'], array_column($module['actions'], 'title')); 98 | if($key === false){ 99 | $action = $module; 100 | $action['title'] = $action_doc['module']; 101 | $action['module'] = $action_doc['module']; 102 | $action['actions'] = []; 103 | array_push($action['actions'], $action_doc); 104 | array_push($module['actions'], $action); 105 | }else{ 106 | array_push($module['actions'][$key]['actions'], $action_doc); 107 | } 108 | }else{ 109 | array_push($module['actions'], $action_doc); 110 | } 111 | } 112 | } 113 | } 114 | } 115 | if(array_key_exists('group', $module)){ 116 | $key = array_search($module['group'], array_column($list, 'title')); 117 | if($key === false){ //创建分组 118 | $floder = [ 119 | 'title' => $module['group'], 120 | 'description' => '', 121 | 'package' => '', 122 | 'class' => '', 123 | 'actions' => [] 124 | ]; 125 | array_push($floder['actions'], $module); 126 | array_push($list, $floder); 127 | }else{ 128 | array_push($list[$key]['actions'], $module); 129 | } 130 | }else{ 131 | array_push($list, $module); 132 | } 133 | } 134 | } 135 | return $list; 136 | } 137 | 138 | /** 139 | * 文档目录列表 140 | * @return array 141 | */ 142 | public function getModuleList() 143 | { 144 | $controller = $this->config['controller']; 145 | $list = []; 146 | foreach ($controller as $class) { 147 | if (class_exists($class)) { 148 | $reflection = new \ReflectionClass($class); 149 | $doc_str = $reflection->getDocComment(); 150 | $doc = new DocParser(); 151 | $class_doc = $doc->parse($doc_str); 152 | if(array_key_exists('group', $class_doc)){ 153 | $key = array_search($class_doc['group'], array_column($list, 'title')); 154 | if($key === false){ //创建分组 155 | $floder = [ 156 | 'title' => $class_doc['group'], 157 | 'children' => [] 158 | ]; 159 | array_push($floder['children'], $class_doc); 160 | array_push($list, $floder); 161 | } 162 | else 163 | { 164 | array_push($list[$key]['children'], $class_doc); 165 | } 166 | }else{ 167 | array_push($list, $class_doc); 168 | } 169 | } 170 | } 171 | return $list; 172 | } 173 | 174 | /** 175 | * 获取类中指导方法注释详情 176 | * @param $class 177 | * @param $action 178 | * @return array 179 | */ 180 | public function getInfo($class, $action) 181 | { 182 | $action_doc = []; 183 | if($class && class_exists($class)){ 184 | $reflection = new \ReflectionClass($class); 185 | $doc_str = $reflection->getDocComment(); 186 | $doc = new DocParser(); 187 | $class_doc = $doc->parse($doc_str); 188 | $class_doc['header'] = isset($class_doc['header'])? $class_doc['header'] : []; 189 | $class_doc['param'] = isset($class_doc['param']) ? $class_doc['param'] : []; 190 | if($reflection->hasMethod($action)) { 191 | $method = $reflection->getMethod($action); 192 | $doc = new DocParser(); 193 | $action_doc = $doc->parse($method->getDocComment()); 194 | $action_doc['name'] = $class."::".$method->name; 195 | $action_doc['header'] = isset($action_doc['header']) ? array_merge($class_doc['header'], $action_doc['header']) : $class_doc['header']; 196 | $action_doc['param'] = isset($action_doc['param']) ? array_merge($class_doc['param'], $action_doc['param']) : $class_doc['param']; 197 | } 198 | } 199 | return $action_doc; 200 | } 201 | 202 | /** 203 | * 文档列表搜素 204 | * @param string $keyword 205 | * @return array 206 | */ 207 | public function searchList($keyword = "") 208 | { 209 | $controller = $this->config['controller']; 210 | $list = []; 211 | foreach ($controller as $class) 212 | { 213 | if(class_exists($class)) 214 | { 215 | $reflection = new \ReflectionClass($class); 216 | $method = $reflection->getMethods(\ReflectionMethod::IS_PUBLIC); 217 | $filter_method = array_merge(['__construct'], $this->config['filter_method']); 218 | foreach ($method as $action){ 219 | if(!in_array($action->name, $filter_method)) 220 | { 221 | $doc = new DocParser(); 222 | $doc_str = $action->getDocComment(); 223 | if($doc_str) 224 | { 225 | $action_doc = $doc->parse($doc_str); 226 | $action_doc['name'] = $class."::".$action->name; 227 | if((isset($action_doc['title']) && strpos($action_doc['title'], $keyword) !== false) 228 | || (isset($action_doc['description']) && strpos($action_doc['description'], $keyword) !== false) 229 | || (isset($action_doc['author']) && strpos($action_doc['author'], $keyword) !== false) 230 | || (isset($action_doc['url']) && strpos($action_doc['url'], $keyword) !== false)) 231 | { 232 | array_push($list, $action_doc); 233 | } 234 | } 235 | } 236 | } 237 | } 238 | } 239 | return $list; 240 | } 241 | 242 | /** 243 | * 格式化数组为json字符串-用于格式显示 244 | * @param array $doc 245 | * @return string 246 | */ 247 | public function formatReturn($doc = []) 248 | { 249 | $json = '{
    '; 250 | $data = $this->config['return_format']; 251 | $returns = isset($doc['return']) ? $doc['return'] : []; 252 | foreach ($data as $name=>$value) { 253 | if($name != 'data' || (empty($returns) && $name == 'data')){ 254 | $json .= '  "'.$name.'":'.$value.',
    '; 255 | } 256 | } 257 | if( !empty($returns) ) { 258 | $json .= '  "data":{
    '; 259 | foreach ($returns as $val) 260 | { 261 | list($name, $value) = explode(":", trim($val)); 262 | if(strpos($value, '@') != false){ 263 | $json .= $this->string2jsonArray($doc, $val, '    '); 264 | }else{ 265 | $json .= '    ' . $this->string2json(trim($name), $value); 266 | } 267 | } 268 | $json .= '  }
    '; 269 | } 270 | $json .= '}'; 271 | return $json; 272 | } 273 | 274 | /** 275 | * 格式化json字符串-用于展示 276 | * @param $name 277 | * @param $val 278 | * @return string 279 | */ 280 | private function string2json($name, $val){ 281 | if(strpos($val,'#') != false){ 282 | return '"'.$name.'": ["'.str_replace('#','',$val).'"],
    '; 283 | }else { 284 | return '"'.$name.'":"'.$val.'",
    '; 285 | } 286 | } 287 | 288 | /** 289 | * 递归转换数组为json字符格式-用于展示 290 | * @param $doc 291 | * @param $val 292 | * @param $space 293 | * @return string 294 | */ 295 | private function string2jsonArray($doc, $val, $space){ 296 | list($name, $value) = explode(":", trim($val)); 297 | $json = ""; 298 | if(strpos($value, "@!") != false){ 299 | $json .= $space.'"'.$name.'":{//'.str_replace('@!','',$value).'
    '; 300 | }else{ 301 | $json .= $space.'"'.$name.'":[{//'.str_replace('@','',$value).'
    '; 302 | } 303 | $return = isset($doc[$name]) ? $doc[$name] : []; 304 | if(preg_match_all('/(\w+):(.*?)[\s\n]/s', $return." ", $meatchs)){ 305 | foreach ($meatchs[0] as $key=>$v){ 306 | if(strpos($meatchs[2][$key],'@') != false){ 307 | $json .= $this->string2jsonArray($doc,$v,$space.'  '); 308 | } else{ 309 | $json .= $space.'  '. $this->string2json(trim($meatchs[1][$key]), $meatchs[2][$key]); 310 | } 311 | } 312 | } 313 | if(strpos($value, "@!") != false){ 314 | $json .= $space."}
    "; 315 | }else{ 316 | $json .= $space."}]
    "; 317 | } 318 | return $json; 319 | } 320 | } -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/css/awesomeStyle/fa.less: -------------------------------------------------------------------------------- 1 | @fa-glass: "\f000"; 2 | @fa-music: "\f001"; 3 | @fa-search: "\f002"; 4 | @fa-envelope-o: "\f003"; 5 | @fa-heart: "\f004"; 6 | @fa-star: "\f005"; 7 | @fa-star-o: "\f006"; 8 | @fa-user: "\f007"; 9 | @fa-film: "\f008"; 10 | @fa-th-large: "\f009"; 11 | @fa-th: "\f00a"; 12 | @fa-th-list: "\f00b"; 13 | @fa-check: "\f00c"; 14 | @fa-times: "\f00d"; 15 | @fa-search-plus: "\f00e"; 16 | @fa-search-minus: "\f010"; 17 | @fa-power-off: "\f011"; 18 | @fa-signal: "\f012"; 19 | @fa-cog: "\f013"; 20 | @fa-trash-o: "\f014"; 21 | @fa-home: "\f015"; 22 | @fa-file-o: "\f016"; 23 | @fa-clock-o: "\f017"; 24 | @fa-road: "\f018"; 25 | @fa-download: "\f019"; 26 | @fa-arrow-circle-o-down: "\f01a"; 27 | @fa-arrow-circle-o-up: "\f01b"; 28 | @fa-inbox: "\f01c"; 29 | @fa-play-circle-o: "\f01d"; 30 | @fa-repeat: "\f01e"; 31 | @fa-refresh: "\f021"; 32 | @fa-list-alt: "\f022"; 33 | @fa-lock: "\f023"; 34 | @fa-flag: "\f024"; 35 | @fa-headphones: "\f025"; 36 | @fa-volume-off: "\f026"; 37 | @fa-volume-down: "\f027"; 38 | @fa-volume-up: "\f028"; 39 | @fa-qrcode: "\f029"; 40 | @fa-barcode: "\f02a"; 41 | @fa-tag: "\f02b"; 42 | @fa-tags: "\f02c"; 43 | @fa-book: "\f02d"; 44 | @fa-bookmark: "\f02e"; 45 | @fa-print: "\f02f"; 46 | @fa-camera: "\f030"; 47 | @fa-font: "\f031"; 48 | @fa-bold: "\f032"; 49 | @fa-italic: "\f033"; 50 | @fa-text-height: "\f034"; 51 | @fa-text-width: "\f035"; 52 | @fa-align-left: "\f036"; 53 | @fa-align-center: "\f037"; 54 | @fa-align-right: "\f038"; 55 | @fa-align-justify: "\f039"; 56 | @fa-list: "\f03a"; 57 | @fa-outdent: "\f03b"; 58 | @fa-indent: "\f03c"; 59 | @fa-video-camera: "\f03d"; 60 | @fa-picture-o: "\f03e"; 61 | @fa-pencil: "\f040"; 62 | @fa-map-marker: "\f041"; 63 | @fa-adjust: "\f042"; 64 | @fa-tint: "\f043"; 65 | @fa-pencil-square-o: "\f044"; 66 | @fa-share-square-o: "\f045"; 67 | @fa-check-square-o: "\f046"; 68 | @fa-arrows: "\f047"; 69 | @fa-step-backward: "\f048"; 70 | @fa-fast-backward: "\f049"; 71 | @fa-backward: "\f04a"; 72 | @fa-play: "\f04b"; 73 | @fa-pause: "\f04c"; 74 | @fa-stop: "\f04d"; 75 | @fa-forward: "\f04e"; 76 | @fa-fast-forward: "\f050"; 77 | @fa-step-forward: "\f051"; 78 | @fa-eject: "\f052"; 79 | @fa-chevron-left: "\f053"; 80 | @fa-chevron-right: "\f054"; 81 | @fa-plus-circle: "\f055"; 82 | @fa-minus-circle: "\f056"; 83 | @fa-times-circle: "\f057"; 84 | @fa-check-circle: "\f058"; 85 | @fa-question-circle: "\f059"; 86 | @fa-info-circle: "\f05a"; 87 | @fa-crosshairs: "\f05b"; 88 | @fa-times-circle-o: "\f05c"; 89 | @fa-check-circle-o: "\f05d"; 90 | @fa-ban: "\f05e"; 91 | @fa-arrow-left: "\f060"; 92 | @fa-arrow-right: "\f061"; 93 | @fa-arrow-up: "\f062"; 94 | @fa-arrow-down: "\f063"; 95 | @fa-share: "\f064"; 96 | @fa-expand: "\f065"; 97 | @fa-compress: "\f066"; 98 | @fa-plus: "\f067"; 99 | @fa-minus: "\f068"; 100 | @fa-asterisk: "\f069"; 101 | @fa-exclamation-circle: "\f06a"; 102 | @fa-gift: "\f06b"; 103 | @fa-leaf: "\f06c"; 104 | @fa-fire: "\f06d"; 105 | @fa-eye: "\f06e"; 106 | @fa-eye-slash: "\f070"; 107 | @fa-exclamation-triangle: "\f071"; 108 | @fa-plane: "\f072"; 109 | @fa-calendar: "\f073"; 110 | @fa-random: "\f074"; 111 | @fa-comment: "\f075"; 112 | @fa-magnet: "\f076"; 113 | @fa-chevron-up: "\f077"; 114 | @fa-chevron-down: "\f078"; 115 | @fa-retweet: "\f079"; 116 | @fa-shopping-cart: "\f07a"; 117 | @fa-folder: "\f07b"; 118 | @fa-folder-open: "\f07c"; 119 | @fa-arrows-v: "\f07d"; 120 | @fa-arrows-h: "\f07e"; 121 | @fa-bar-chart: "\f080"; 122 | @fa-twitter-square: "\f081"; 123 | @fa-facebook-square: "\f082"; 124 | @fa-camera-retro: "\f083"; 125 | @fa-key: "\f084"; 126 | @fa-cogs: "\f085"; 127 | @fa-comments: "\f086"; 128 | @fa-thumbs-o-up: "\f087"; 129 | @fa-thumbs-o-down: "\f088"; 130 | @fa-star-half: "\f089"; 131 | @fa-heart-o: "\f08a"; 132 | @fa-sign-out: "\f08b"; 133 | @fa-linkedin-square: "\f08c"; 134 | @fa-thumb-tack: "\f08d"; 135 | @fa-external-link: "\f08e"; 136 | @fa-sign-in: "\f090"; 137 | @fa-trophy: "\f091"; 138 | @fa-github-square: "\f092"; 139 | @fa-upload: "\f093"; 140 | @fa-lemon-o: "\f094"; 141 | @fa-phone: "\f095"; 142 | @fa-square-o: "\f096"; 143 | @fa-bookmark-o: "\f097"; 144 | @fa-phone-square: "\f098"; 145 | @fa-twitter: "\f099"; 146 | @fa-facebook: "\f09a"; 147 | @fa-github: "\f09b"; 148 | @fa-unlock: "\f09c"; 149 | @fa-credit-card: "\f09d"; 150 | @fa-rss: "\f09e"; 151 | @fa-hdd-o: "\f0a0"; 152 | @fa-bullhorn: "\f0a1"; 153 | @fa-bell: "\f0f3"; 154 | @fa-certificate: "\f0a3"; 155 | @fa-hand-o-right: "\f0a4"; 156 | @fa-hand-o-left: "\f0a5"; 157 | @fa-hand-o-up: "\f0a6"; 158 | @fa-hand-o-down: "\f0a7"; 159 | @fa-arrow-circle-left: "\f0a8"; 160 | @fa-arrow-circle-right: "\f0a9"; 161 | @fa-arrow-circle-up: "\f0aa"; 162 | @fa-arrow-circle-down: "\f0ab"; 163 | @fa-globe: "\f0ac"; 164 | @fa-wrench: "\f0ad"; 165 | @fa-tasks: "\f0ae"; 166 | @fa-filter: "\f0b0"; 167 | @fa-briefcase: "\f0b1"; 168 | @fa-arrows-alt: "\f0b2"; 169 | @fa-users: "\f0c0"; 170 | @fa-link: "\f0c1"; 171 | @fa-cloud: "\f0c2"; 172 | @fa-flask: "\f0c3"; 173 | @fa-scissors: "\f0c4"; 174 | @fa-files-o: "\f0c5"; 175 | @fa-paperclip: "\f0c6"; 176 | @fa-floppy-o: "\f0c7"; 177 | @fa-square: "\f0c8"; 178 | @fa-bars: "\f0c9"; 179 | @fa-list-ul: "\f0ca"; 180 | @fa-list-ol: "\f0cb"; 181 | @fa-strikethrough: "\f0cc"; 182 | @fa-underline: "\f0cd"; 183 | @fa-table: "\f0ce"; 184 | @fa-magic: "\f0d0"; 185 | @fa-truck: "\f0d1"; 186 | @fa-pinterest: "\f0d2"; 187 | @fa-pinterest-square: "\f0d3"; 188 | @fa-google-plus-square: "\f0d4"; 189 | @fa-google-plus: "\f0d5"; 190 | @fa-money: "\f0d6"; 191 | @fa-caret-down: "\f0d7"; 192 | @fa-caret-up: "\f0d8"; 193 | @fa-caret-left: "\f0d9"; 194 | @fa-caret-right: "\f0da"; 195 | @fa-columns: "\f0db"; 196 | @fa-sort: "\f0dc"; 197 | @fa-sort-desc: "\f0dd"; 198 | @fa-sort-asc: "\f0de"; 199 | @fa-envelope: "\f0e0"; 200 | @fa-linkedin: "\f0e1"; 201 | @fa-undo: "\f0e2"; 202 | @fa-gavel: "\f0e3"; 203 | @fa-tachometer: "\f0e4"; 204 | @fa-comment-o: "\f0e5"; 205 | @fa-comments-o: "\f0e6"; 206 | @fa-bolt: "\f0e7"; 207 | @fa-sitemap: "\f0e8"; 208 | @fa-umbrella: "\f0e9"; 209 | @fa-clipboard: "\f0ea"; 210 | @fa-lightbulb-o: "\f0eb"; 211 | @fa-exchange: "\f0ec"; 212 | @fa-cloud-download: "\f0ed"; 213 | @fa-cloud-upload: "\f0ee"; 214 | @fa-user-md: "\f0f0"; 215 | @fa-stethoscope: "\f0f1"; 216 | @fa-suitcase: "\f0f2"; 217 | @fa-bell-o: "\f0a2"; 218 | @fa-coffee: "\f0f4"; 219 | @fa-cutlery: "\f0f5"; 220 | @fa-file-text-o: "\f0f6"; 221 | @fa-building-o: "\f0f7"; 222 | @fa-hospital-o: "\f0f8"; 223 | @fa-ambulance: "\f0f9"; 224 | @fa-medkit: "\f0fa"; 225 | @fa-fighter-jet: "\f0fb"; 226 | @fa-beer: "\f0fc"; 227 | @fa-h-square: "\f0fd"; 228 | @fa-plus-square: "\f0fe"; 229 | @fa-angle-double-left: "\f100"; 230 | @fa-angle-double-right: "\f101"; 231 | @fa-angle-double-up: "\f102"; 232 | @fa-angle-double-down: "\f103"; 233 | @fa-angle-left: "\f104"; 234 | @fa-angle-right: "\f105"; 235 | @fa-angle-up: "\f106"; 236 | @fa-angle-down: "\f107"; 237 | @fa-desktop: "\f108"; 238 | @fa-laptop: "\f109"; 239 | @fa-tablet: "\f10a"; 240 | @fa-mobile: "\f10b"; 241 | @fa-circle-o: "\f10c"; 242 | @fa-quote-left: "\f10d"; 243 | @fa-quote-right: "\f10e"; 244 | @fa-spinner: "\f110"; 245 | @fa-circle: "\f111"; 246 | @fa-reply: "\f112"; 247 | @fa-github-alt: "\f113"; 248 | @fa-folder-o: "\f114"; 249 | @fa-folder-open-o: "\f115"; 250 | @fa-smile-o: "\f118"; 251 | @fa-frown-o: "\f119"; 252 | @fa-meh-o: "\f11a"; 253 | @fa-gamepad: "\f11b"; 254 | @fa-keyboard-o: "\f11c"; 255 | @fa-flag-o: "\f11d"; 256 | @fa-flag-checkered: "\f11e"; 257 | @fa-terminal: "\f120"; 258 | @fa-code: "\f121"; 259 | @fa-reply-all: "\f122"; 260 | @fa-star-half-o: "\f123"; 261 | @fa-location-arrow: "\f124"; 262 | @fa-crop: "\f125"; 263 | @fa-code-fork: "\f126"; 264 | @fa-chain-broken: "\f127"; 265 | @fa-question: "\f128"; 266 | @fa-info: "\f129"; 267 | @fa-exclamation: "\f12a"; 268 | @fa-superscript: "\f12b"; 269 | @fa-subscript: "\f12c"; 270 | @fa-eraser: "\f12d"; 271 | @fa-puzzle-piece: "\f12e"; 272 | @fa-microphone: "\f130"; 273 | @fa-microphone-slash: "\f131"; 274 | @fa-shield: "\f132"; 275 | @fa-calendar-o: "\f133"; 276 | @fa-fire-extinguisher: "\f134"; 277 | @fa-rocket: "\f135"; 278 | @fa-maxcdn: "\f136"; 279 | @fa-chevron-circle-left: "\f137"; 280 | @fa-chevron-circle-right: "\f138"; 281 | @fa-chevron-circle-up: "\f139"; 282 | @fa-chevron-circle-down: "\f13a"; 283 | @fa-html5: "\f13b"; 284 | @fa-css3: "\f13c"; 285 | @fa-anchor: "\f13d"; 286 | @fa-unlock-alt: "\f13e"; 287 | @fa-bullseye: "\f140"; 288 | @fa-ellipsis-h: "\f141"; 289 | @fa-ellipsis-v: "\f142"; 290 | @fa-rss-square: "\f143"; 291 | @fa-play-circle: "\f144"; 292 | @fa-ticket: "\f145"; 293 | @fa-minus-square: "\f146"; 294 | @fa-minus-square-o: "\f147"; 295 | @fa-level-up: "\f148"; 296 | @fa-level-down: "\f149"; 297 | @fa-check-square: "\f14a"; 298 | @fa-pencil-square: "\f14b"; 299 | @fa-external-link-square: "\f14c"; 300 | @fa-share-square: "\f14d"; 301 | @fa-compass: "\f14e"; 302 | @fa-caret-square-o-down: "\f150"; 303 | @fa-caret-square-o-up: "\f151"; 304 | @fa-caret-square-o-right: "\f152"; 305 | @fa-eur: "\f153"; 306 | @fa-gbp: "\f154"; 307 | @fa-usd: "\f155"; 308 | @fa-inr: "\f156"; 309 | @fa-jpy: "\f157"; 310 | @fa-rub: "\f158"; 311 | @fa-krw: "\f159"; 312 | @fa-btc: "\f15a"; 313 | @fa-file: "\f15b"; 314 | @fa-file-text: "\f15c"; 315 | @fa-sort-alpha-asc: "\f15d"; 316 | @fa-sort-alpha-desc: "\f15e"; 317 | @fa-sort-amount-asc: "\f160"; 318 | @fa-sort-amount-desc: "\f161"; 319 | @fa-sort-numeric-asc: "\f162"; 320 | @fa-sort-numeric-desc: "\f163"; 321 | @fa-thumbs-up: "\f164"; 322 | @fa-thumbs-down: "\f165"; 323 | @fa-youtube-square: "\f166"; 324 | @fa-youtube: "\f167"; 325 | @fa-xing: "\f168"; 326 | @fa-xing-square: "\f169"; 327 | @fa-youtube-play: "\f16a"; 328 | @fa-dropbox: "\f16b"; 329 | @fa-stack-overflow: "\f16c"; 330 | @fa-instagram: "\f16d"; 331 | @fa-flickr: "\f16e"; 332 | @fa-adn: "\f170"; 333 | @fa-bitbucket: "\f171"; 334 | @fa-bitbucket-square: "\f172"; 335 | @fa-tumblr: "\f173"; 336 | @fa-tumblr-square: "\f174"; 337 | @fa-long-arrow-down: "\f175"; 338 | @fa-long-arrow-up: "\f176"; 339 | @fa-long-arrow-left: "\f177"; 340 | @fa-long-arrow-right: "\f178"; 341 | @fa-apple: "\f179"; 342 | @fa-windows: "\f17a"; 343 | @fa-android: "\f17b"; 344 | @fa-linux: "\f17c"; 345 | @fa-dribbble: "\f17d"; 346 | @fa-skype: "\f17e"; 347 | @fa-foursquare: "\f180"; 348 | @fa-trello: "\f181"; 349 | @fa-female: "\f182"; 350 | @fa-male: "\f183"; 351 | @fa-gittip: "\f184"; 352 | @fa-sun-o: "\f185"; 353 | @fa-moon-o: "\f186"; 354 | @fa-archive: "\f187"; 355 | @fa-bug: "\f188"; 356 | @fa-vk: "\f189"; 357 | @fa-weibo: "\f18a"; 358 | @fa-renren: "\f18b"; 359 | @fa-pagelines: "\f18c"; 360 | @fa-stack-exchange: "\f18d"; 361 | @fa-arrow-circle-o-right: "\f18e"; 362 | @fa-arrow-circle-o-left: "\f190"; 363 | @fa-caret-square-o-left: "\f191"; 364 | @fa-dot-circle-o: "\f192"; 365 | @fa-wheelchair: "\f193"; 366 | @fa-vimeo-square: "\f194"; 367 | @fa-try: "\f195"; 368 | @fa-plus-square-o: "\f196"; 369 | @fa-space-shuttle: "\f197"; 370 | @fa-slack: "\f198"; 371 | @fa-envelope-square: "\f199"; 372 | @fa-wordpress: "\f19a"; 373 | @fa-openid: "\f19b"; 374 | @fa-university: "\f19c"; 375 | @fa-graduation-cap: "\f19d"; 376 | @fa-yahoo: "\f19e"; 377 | @fa-google: "\f1a0"; 378 | @fa-reddit: "\f1a1"; 379 | @fa-reddit-square: "\f1a2"; 380 | @fa-stumbleupon-circle: "\f1a3"; 381 | @fa-stumbleupon: "\f1a4"; 382 | @fa-delicious: "\f1a5"; 383 | @fa-digg: "\f1a6"; 384 | @fa-pied-piper: "\f1a7"; 385 | @fa-pied-piper-alt: "\f1a8"; 386 | @fa-drupal: "\f1a9"; 387 | @fa-joomla: "\f1aa"; 388 | @fa-language: "\f1ab"; 389 | @fa-fax: "\f1ac"; 390 | @fa-building: "\f1ad"; 391 | @fa-child: "\f1ae"; 392 | @fa-paw: "\f1b0"; 393 | @fa-spoon: "\f1b1"; 394 | @fa-cube: "\f1b2"; 395 | @fa-cubes: "\f1b3"; 396 | @fa-behance: "\f1b4"; 397 | @fa-behance-square: "\f1b5"; 398 | @fa-steam: "\f1b6"; 399 | @fa-steam-square: "\f1b7"; 400 | @fa-recycle: "\f1b8"; 401 | @fa-car: "\f1b9"; 402 | @fa-taxi: "\f1ba"; 403 | @fa-tree: "\f1bb"; 404 | @fa-spotify: "\f1bc"; 405 | @fa-deviantart: "\f1bd"; 406 | @fa-soundcloud: "\f1be"; 407 | @fa-database: "\f1c0"; 408 | @fa-file-pdf-o: "\f1c1"; 409 | @fa-file-word-o: "\f1c2"; 410 | @fa-file-excel-o: "\f1c3"; 411 | @fa-file-powerpoint-o: "\f1c4"; 412 | @fa-file-image-o: "\f1c5"; 413 | @fa-file-archive-o: "\f1c6"; 414 | @fa-file-audio-o: "\f1c7"; 415 | @fa-file-video-o: "\f1c8"; 416 | @fa-file-code-o: "\f1c9"; 417 | @fa-vine: "\f1ca"; 418 | @fa-codepen: "\f1cb"; 419 | @fa-jsfiddle: "\f1cc"; 420 | @fa-life-ring: "\f1cd"; 421 | @fa-circle-o-notch: "\f1ce"; 422 | @fa-rebel: "\f1d0"; 423 | @fa-empire: "\f1d1"; 424 | @fa-git-square: "\f1d2"; 425 | @fa-git: "\f1d3"; 426 | @fa-hacker-news: "\f1d4"; 427 | @fa-tencent-weibo: "\f1d5"; 428 | @fa-qq: "\f1d6"; 429 | @fa-weixin: "\f1d7"; 430 | @fa-paper-plane: "\f1d8"; 431 | @fa-paper-plane-o: "\f1d9"; 432 | @fa-history: "\f1da"; 433 | @fa-circle-thin: "\f1db"; 434 | @fa-header: "\f1dc"; 435 | @fa-paragraph: "\f1dd"; 436 | @fa-sliders: "\f1de"; 437 | @fa-share-alt: "\f1e0"; 438 | @fa-share-alt-square: "\f1e1"; 439 | @fa-bomb: "\f1e2"; 440 | @fa-futbol-o: "\f1e3"; 441 | @fa-tty: "\f1e4"; 442 | @fa-binoculars: "\f1e5"; 443 | @fa-plug: "\f1e6"; 444 | @fa-slideshare: "\f1e7"; 445 | @fa-twitch: "\f1e8"; 446 | @fa-yelp: "\f1e9"; 447 | @fa-newspaper-o: "\f1ea"; 448 | @fa-wifi: "\f1eb"; 449 | @fa-calculator: "\f1ec"; 450 | @fa-paypal: "\f1ed"; 451 | @fa-google-wallet: "\f1ee"; 452 | @fa-cc-visa: "\f1f0"; 453 | @fa-cc-mastercard: "\f1f1"; 454 | @fa-cc-discover: "\f1f2"; 455 | @fa-cc-amex: "\f1f3"; 456 | @fa-cc-paypal: "\f1f4"; 457 | @fa-cc-stripe: "\f1f5"; 458 | @fa-bell-slash: "\f1f6"; 459 | @fa-bell-slash-o: "\f1f7"; 460 | @fa-trash: "\f1f8"; 461 | @fa-copyright: "\f1f9"; 462 | @fa-at: "\f1fa"; 463 | @fa-eyedropper: "\f1fb"; 464 | @fa-paint-brush: "\f1fc"; 465 | @fa-birthday-cake: "\f1fd"; 466 | @fa-area-chart: "\f1fe"; 467 | @fa-pie-chart: "\f200"; 468 | @fa-line-chart: "\f201"; 469 | @fa-lastfm: "\f202"; 470 | @fa-lastfm-square: "\f203"; 471 | @fa-toggle-off: "\f204"; 472 | @fa-toggle-on: "\f205"; 473 | @fa-bicycle: "\f206"; 474 | @fa-bus: "\f207"; 475 | @fa-ioxhost: "\f208"; 476 | @fa-angellist: "\f209"; 477 | @fa-cc: "\f20a"; 478 | @fa-ils: "\f20b"; 479 | @fa-meanpath: "\f20c"; 480 | 481 | -------------------------------------------------------------------------------- /src/view/info.html: -------------------------------------------------------------------------------- 1 | {extend name="base" /} 2 | 3 | {block name="head"} 4 | 5 | 6 | {/block} 7 | {block name="main"} 8 |
    9 |
    10 |

    文档地址:{$root}/doc?name={$doc['name']}

    11 |

    接口:{$doc.title|default="请设置title注释"}

    12 |

    接口地址:{$doc.url|default="请设置url注释"} {$doc.method|default='GET'}

    13 |

    {$doc.title|default="请设置title注释"} -- {$doc.author|default="请设置auhtor注释"}

    14 |
    15 |

    {$doc.description|default=""}


    16 | 17 | 21 |
    22 | 23 |
    24 | {if condition="isset($doc.header) && !empty($doc.header)"} 25 |

    请求Headers

    26 | 27 | 28 | {volist name="doc.header" id="head"} 29 | 30 | 31 | 32 | 33 | 34 | 35 | {/volist} 36 |
    名称是否必须默认值说明
    {$head.name|default="-"}{if condition="$head.require eq 1"}必填{else/}非必填{/if}{$head.default|default="-"}{$head.desc|default="-"}
    37 |
    38 | {/if} 39 | {if condition="isset($doc.param)"} 40 |

    接口参数

    41 | 42 | 43 | {volist name="doc.param" id="param"} 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | {/volist} 53 |
    参数名字类型是否必须默认值其他说明
    {$param.name|default="-"}{$param.type|default="-"}{if condition="$param.require eq 1"}必填{else/}非必填{/if}{$param.default|default="-"}{$param.other|default="-"}{$param.desc|default="-"}
    54 |
    55 | {/if} 56 | {if condition="isset($doc.remark)"} 57 |

    备注说明

    58 | 61 |
    62 | {/if} 63 |

    返回结果

    64 |

    {$return|raw}

    65 |
    66 | 67 | 68 |
    69 |
    70 | 71 |
    72 |
    73 |

    接口参数

    74 |
    75 |
    76 |
    77 |
    78 | 79 |
    80 | 81 |
    82 |
    83 |
    84 | {if condition="isset($doc.header) && !empty($doc.header)"} 85 | {volist name="doc.header" id="head"} 86 |
    87 | 88 |
    89 | 90 |
    91 |
    92 |
    93 | {/volist} 94 | {/if} 95 |
    96 | 97 |
    98 | 104 |
    105 |
    106 |
    107 |
    108 | 109 |
    110 | 111 |
    112 |
    113 |
    114 |
    115 | 116 |
    117 | 119 |
    120 |
    121 | {if condition="isset($doc.param)"} 122 | {volist name="doc.param" id="param"} 123 |
    124 | 125 |
    126 | 127 |
    128 |
    129 |
    130 | {/volist} 131 | {/if} 132 |
    133 |
    134 |
    135 | 136 | 137 |
    138 |
    139 |

    返回结果

    140 |
    141 |
    142 |
    143 | 144 | 145 | 153 | 154 | 全选 155 | 展开 156 | 叠起 157 | 2级 158 | 3级 159 | 4级 160 | 5级 161 | 6级 162 | 7级 163 | 8级 164 |
    165 | 166 |
    167 | 168 |
    169 | 170 |
    171 | 172 |
    173 | 174 |
    175 | 176 | 177 |
    178 | 181 |
    182 | 183 |

    © {$copyright}

    184 |

    185 | 186 | 214 | 215 | 243 | 305 | {/block} -------------------------------------------------------------------------------- /src/assets/js/zTree_v3/js/jquery.ztree.core-3.5.min.js: -------------------------------------------------------------------------------- 1 | /* 2 | * JQuery zTree core v3.5.17 3 | * http://zTree.me/ 4 | * 5 | * Copyright (c) 2010 Hunter.z 6 | * 7 | * Licensed same as jquery - MIT License 8 | * http://www.opensource.org/licenses/mit-license.php 9 | * 10 | * email: hunter.z@263.net 11 | * Date: 2015-02-15 12 | */ 13 | (function(p){var G,H,I,J,K,L,r={},u={},v={},M={treeId:"",treeObj:null,view:{addDiyDom:null,autoCancelSelected:!0,dblClickExpand:!0,expandSpeed:"fast",fontCss:{},nameIsHTML:!1,selectedMulti:!0,showIcon:!0,showLine:!0,showTitle:!0,txtSelectedEnable:!1},data:{key:{children:"children",name:"name",title:"",url:"url"},simpleData:{enable:!1,idKey:"id",pIdKey:"pId",rootPId:null},keep:{parent:!1,leaf:!1}},async:{enable:!1,contentType:"application/x-www-form-urlencoded",type:"post",dataType:"text",url:"",autoParam:[], 14 | otherParam:[],dataFilter:null},callback:{beforeAsync:null,beforeClick:null,beforeDblClick:null,beforeRightClick:null,beforeMouseDown:null,beforeMouseUp:null,beforeExpand:null,beforeCollapse:null,beforeRemove:null,onAsyncError:null,onAsyncSuccess:null,onNodeCreated:null,onClick:null,onDblClick:null,onRightClick:null,onMouseDown:null,onMouseUp:null,onExpand:null,onCollapse:null,onRemove:null}},w=[function(b){var a=b.treeObj,c=e.event;a.bind(c.NODECREATED,function(a,c,g){j.apply(b.callback.onNodeCreated, 15 | [a,c,g])});a.bind(c.CLICK,function(a,c,g,l,h){j.apply(b.callback.onClick,[c,g,l,h])});a.bind(c.EXPAND,function(a,c,g){j.apply(b.callback.onExpand,[a,c,g])});a.bind(c.COLLAPSE,function(a,c,g){j.apply(b.callback.onCollapse,[a,c,g])});a.bind(c.ASYNC_SUCCESS,function(a,c,g,l){j.apply(b.callback.onAsyncSuccess,[a,c,g,l])});a.bind(c.ASYNC_ERROR,function(a,c,g,l,h,e){j.apply(b.callback.onAsyncError,[a,c,g,l,h,e])});a.bind(c.REMOVE,function(a,c,g){j.apply(b.callback.onRemove,[a,c,g])})}],x=[function(b){var a= 16 | e.event;b.treeObj.unbind(a.NODECREATED).unbind(a.CLICK).unbind(a.EXPAND).unbind(a.COLLAPSE).unbind(a.ASYNC_SUCCESS).unbind(a.ASYNC_ERROR).unbind(a.REMOVE)}],y=[function(b){var a=h.getCache(b);a||(a={},h.setCache(b,a));a.nodes=[];a.doms=[]}],z=[function(b,a,c,d,f,g){if(c){var l=h.getRoot(b),e=b.data.key.children;c.level=a;c.tId=b.treeId+"_"+ ++l.zId;c.parentTId=d?d.tId:null;c.open=typeof c.open=="string"?j.eqs(c.open,"true"):!!c.open;c[e]&&c[e].length>0?(c.isParent=!0,c.zAsync=!0):(c.isParent=typeof c.isParent== 17 | "string"?j.eqs(c.isParent,"true"):!!c.isParent,c.open=c.isParent&&!b.async.enable?c.open:!1,c.zAsync=!c.isParent);c.isFirstNode=f;c.isLastNode=g;c.getParentNode=function(){return h.getNodeCache(b,c.parentTId)};c.getPreNode=function(){return h.getPreNode(b,c)};c.getNextNode=function(){return h.getNextNode(b,c)};c.isAjaxing=!1;h.fixPIdKeyValue(b,c)}}],s=[function(b){var a=b.target,c=h.getSetting(b.data.treeId),d="",f=null,g="",l="",i=null,n=null,k=null;if(j.eqs(b.type,"mousedown"))l="mousedown";else if(j.eqs(b.type, 18 | "mouseup"))l="mouseup";else if(j.eqs(b.type,"contextmenu"))l="contextmenu";else if(j.eqs(b.type,"click"))if(j.eqs(a.tagName,"span")&&a.getAttribute("treeNode"+e.id.SWITCH)!==null)d=j.getNodeMainDom(a).id,g="switchNode";else{if(k=j.getMDom(c,a,[{tagName:"a",attrName:"treeNode"+e.id.A}]))d=j.getNodeMainDom(k).id,g="clickNode"}else if(j.eqs(b.type,"dblclick")&&(l="dblclick",k=j.getMDom(c,a,[{tagName:"a",attrName:"treeNode"+e.id.A}])))d=j.getNodeMainDom(k).id,g="switchNode";if(l.length>0&&d.length==0&& 19 | (k=j.getMDom(c,a,[{tagName:"a",attrName:"treeNode"+e.id.A}])))d=j.getNodeMainDom(k).id;if(d.length>0)switch(f=h.getNodeCache(c,d),g){case "switchNode":f.isParent?j.eqs(b.type,"click")||j.eqs(b.type,"dblclick")&&j.apply(c.view.dblClickExpand,[c.treeId,f],c.view.dblClickExpand)?i=G:g="":g="";break;case "clickNode":i=H}switch(l){case "mousedown":n=I;break;case "mouseup":n=J;break;case "dblclick":n=K;break;case "contextmenu":n=L}return{stop:!1,node:f,nodeEventType:g,nodeEventCallback:i,treeEventType:l, 20 | treeEventCallback:n}}],A=[function(b){var a=h.getRoot(b);a||(a={},h.setRoot(b,a));a[b.data.key.children]=[];a.expandTriggerFlag=!1;a.curSelectedList=[];a.noSelection=!0;a.createdNodes=[];a.zId=0;a._ver=(new Date).getTime()}],B=[],C=[],D=[],E=[],F=[],h={addNodeCache:function(b,a){h.getCache(b).nodes[h.getNodeCacheId(a.tId)]=a},getNodeCacheId:function(b){return b.substring(b.lastIndexOf("_")+1)},addAfterA:function(b){C.push(b)},addBeforeA:function(b){B.push(b)},addInnerAfterA:function(b){E.push(b)}, 21 | addInnerBeforeA:function(b){D.push(b)},addInitBind:function(b){w.push(b)},addInitUnBind:function(b){x.push(b)},addInitCache:function(b){y.push(b)},addInitNode:function(b){z.push(b)},addInitProxy:function(b,a){a?s.splice(0,0,b):s.push(b)},addInitRoot:function(b){A.push(b)},addNodesData:function(b,a,c){var d=b.data.key.children;a[d]||(a[d]=[]);if(a[d].length>0)a[d][a[d].length-1].isLastNode=!1,i.setNodeLineIcos(b,a[d][a[d].length-1]);a.isParent=!0;a[d]=a[d].concat(c)},addSelectedNode:function(b,a){var c= 22 | h.getRoot(b);h.isSelectedNode(b,a)||c.curSelectedList.push(a)},addCreatedNode:function(b,a){(b.callback.onNodeCreated||b.view.addDiyDom)&&h.getRoot(b).createdNodes.push(a)},addZTreeTools:function(b){F.push(b)},exSetting:function(b){p.extend(!0,M,b)},fixPIdKeyValue:function(b,a){b.data.simpleData.enable&&(a[b.data.simpleData.pIdKey]=a.parentTId?a.getParentNode()[b.data.simpleData.idKey]:b.data.simpleData.rootPId)},getAfterA:function(b,a,c){for(var d=0,f=C.length;d-1&&g.push(a[l]),g=g.concat(h.getNodesByParamFuzzy(b,a[l][f],c,d));return g},getNodesByFilter:function(b,a,c,d,f){if(!a)return d? 26 | null:[];for(var g=b.data.key.children,e=d?null:[],i=0,n=a.length;i0)},clone:function(b){if(b===null)return null;var a=j.isArray(b)?[]:{},c;for(c in b)a[c]=b[c]instanceof 36 | Date?new Date(b[c].getTime()):typeof b[c]==="object"?arguments.callee(b[c]):b[c];return a},eqs:function(b,a){return b.toLowerCase()===a.toLowerCase()},isArray:function(b){return Object.prototype.toString.apply(b)==="[object Array]"},$:function(b,a,c){a&&typeof a!="string"&&(c=a,a="");return typeof b=="string"?p(b,c?c.treeObj.get(0).ownerDocument:null):p("#"+b.tId+a,c?c.treeObj:null)},getMDom:function(b,a,c){if(!a)return null;for(;a&&a.id!==b.treeId;){for(var d=0,f=c.length;a.tagName&&d0},uCanDo:function(){return!0}},i={addNodes:function(b,a,c,d){if(!b.data.keep.leaf||!a||a.isParent)if(j.isArray(c)||(c=[c]),b.data.simpleData.enable&&(c=h.transformTozTreeFormat(b,c)),a){var f=k(a,e.id.SWITCH,b),g=k(a,e.id.ICON,b),l=k(a,e.id.UL,b);if(!a.open)i.replaceSwitchClass(a, 38 | f,e.folder.CLOSE),i.replaceIcoClass(a,g,e.folder.CLOSE),a.open=!1,l.css({display:"none"});h.addNodesData(b,a,c);i.createNodes(b,a.level+1,c,a);d||i.expandCollapseParentNode(b,a,!0)}else h.addNodesData(b,h.getRoot(b),c),i.createNodes(b,0,c,null)},appendNodes:function(b,a,c,d,f,g){if(!c)return[];for(var e=[],j=b.data.key.children,k=0,m=c.length;k 39 | 0&&(t=i.appendNodes(b,a+1,o[j],o,f,g&&o.open));g&&(i.makeDOMNodeMainBefore(e,b,o),i.makeDOMNodeLine(e,b,o),h.getBeforeA(b,o,e),i.makeDOMNodeNameBefore(e,b,o),h.getInnerBeforeA(b,o,e),i.makeDOMNodeIcon(e,b,o),h.getInnerAfterA(b,o,e),i.makeDOMNodeNameAfter(e,b,o),h.getAfterA(b,o,e),o.isParent&&o.open&&i.makeUlHtml(b,o,e,t.join("")),i.makeDOMNodeMainAfter(e,b,o),h.addCreatedNode(b,o))}return e},appendParentULDom:function(b,a){var c=[],d=k(a,b);!d.get(0)&&a.parentTId&&(i.appendParentULDom(b,a.getParentNode()), 40 | d=k(a,b));var f=k(a,e.id.UL,b);f.get(0)&&f.remove();f=i.appendNodes(b,a.level+1,a[b.data.key.children],a,!1,!0);i.makeUlHtml(b,a,c,f.join(""));d.append(c.join(""))},asyncNode:function(b,a,c,d){var f,g;if(a&&!a.isParent)return j.apply(d),!1;else if(a&&a.isAjaxing)return!1;else if(j.apply(b.callback.beforeAsync,[b.treeId,a],!0)==!1)return j.apply(d),!1;if(a)a.isAjaxing=!0,k(a,e.id.ICON,b).attr({style:"","class":e.className.BUTTON+" "+e.className.ICO_LOADING});var l={};for(f=0,g=b.async.autoParam.length;a&& 41 | f1&&(n=q[1],q=q[0]);l[n]=a[q]}if(j.isArray(b.async.otherParam))for(f=0,g=b.async.otherParam.length;f=0;d--)if(!a||a===c[d])if(k(c[d],e.id.A,b).removeClass(e.node.CURSELECTED),a){h.removeSelectedNode(b,a);break}if(!a)h.getRoot(b).curSelectedList=[]},createNodeCallback:function(b){if(b.callback.onNodeCreated||b.view.addDiyDom)for(var a=h.getRoot(b);a.createdNodes.length>0;){var c=a.createdNodes.shift();j.apply(b.view.addDiyDom,[b.treeId,c]);b.callback.onNodeCreated&&b.treeObj.trigger(e.event.NODECREATED,[b.treeId,c])}},createNodes:function(b, 44 | a,c,d){if(c&&c.length!=0){var f=h.getRoot(b),g=b.data.key.children,g=!d||d.open||!!k(d[g][0],b).get(0);f.createdNodes=[];a=i.appendNodes(b,a,c,d,!0,g);d?(d=k(d,e.id.UL,b),d.get(0)&&d.append(a.join(""))):b.treeObj.append(a.join(""));i.createNodeCallback(b)}},destroy:function(b){b&&(h.initCache(b),h.initRoot(b),m.unbindTree(b),m.unbindEvent(b),b.treeObj.empty(),delete r[b.treeId])},expandCollapseNode:function(b,a,c,d,f){var g=h.getRoot(b),l=b.data.key.children;if(a){if(g.expandTriggerFlag){var q=f, 45 | f=function(){q&&q();a.open?b.treeObj.trigger(e.event.EXPAND,[b.treeId,a]):b.treeObj.trigger(e.event.COLLAPSE,[b.treeId,a])};g.expandTriggerFlag=!1}if(!a.open&&a.isParent&&(!k(a,e.id.UL,b).get(0)||a[l]&&a[l].length>0&&!k(a[l][0],b).get(0)))i.appendParentULDom(b,a),i.createNodeCallback(b);if(a.open==c)j.apply(f,[]);else{var c=k(a,e.id.UL,b),g=k(a,e.id.SWITCH,b),n=k(a,e.id.ICON,b);a.isParent?(a.open=!a.open,a.iconOpen&&a.iconClose&&n.attr("style",i.makeNodeIcoStyle(b,a)),a.open?(i.replaceSwitchClass(a, 46 | g,e.folder.OPEN),i.replaceIcoClass(a,n,e.folder.OPEN),d==!1||b.view.expandSpeed==""?(c.show(),j.apply(f,[])):a[l]&&a[l].length>0?c.slideDown(b.view.expandSpeed,f):(c.show(),j.apply(f,[]))):(i.replaceSwitchClass(a,g,e.folder.CLOSE),i.replaceIcoClass(a,n,e.folder.CLOSE),d==!1||b.view.expandSpeed==""||!(a[l]&&a[l].length>0)?(c.hide(),j.apply(f,[])):c.slideUp(b.view.expandSpeed,f))):j.apply(f,[])}}else j.apply(f,[])},expandCollapseParentNode:function(b,a,c,d,f){a&&(a.parentTId?(i.expandCollapseNode(b, 47 | a,c,d),a.parentTId&&i.expandCollapseParentNode(b,a.getParentNode(),c,d,f)):i.expandCollapseNode(b,a,c,d,f))},expandCollapseSonNode:function(b,a,c,d,f){var g=h.getRoot(b),e=b.data.key.children,g=a?a[e]:g[e],e=a?!1:d,j=h.getRoot(b).expandTriggerFlag;h.getRoot(b).expandTriggerFlag=!1;if(g)for(var k=0,m=g.length;k/g,">");b.push("",d,"")},makeDOMNodeLine:function(b,a,c){b.push("")},makeDOMNodeMainAfter:function(b){b.push("")},makeDOMNodeMainBefore:function(b, 49 | a,c){b.push("
  • ")},makeDOMNodeNameAfter:function(b){b.push("")},makeDOMNodeNameBefore:function(b,a,c){var d=h.getNodeTitle(a,c),f=i.makeNodeUrl(a,c),g=i.makeNodeFontCss(a,c),l=[],k;for(k in g)l.push(k,":",g[k],";");b.push("0?"href='"+f+"'":""," target='",i.makeNodeTarget(c), 50 | "' style='",l.join(""),"'");j.apply(a.view.showTitle,[a.treeId,c],a.view.showTitle)&&d&&b.push("title='",d.replace(/'/g,"'").replace(//g,">"),"'");b.push(">")},makeNodeFontCss:function(b,a){var c=j.apply(b.view.fontCss,[b.treeId,a],b.view.fontCss);return c&&typeof c!="function"?c:{}},makeNodeIcoClass:function(b,a){var c=["ico"];a.isAjaxing||(c[0]=(a.iconSkin?a.iconSkin+"_":"")+c[0],a.isParent?c.push(a.open?e.folder.OPEN:e.folder.CLOSE):c.push(e.folder.DOCU));return e.className.BUTTON+ 51 | " "+c.join("_")},makeNodeIcoStyle:function(b,a){var c=[];if(!a.isAjaxing){var d=a.isParent&&a.iconOpen&&a.iconClose?a.open?a.iconOpen:a.iconClose:a.icon;d&&c.push("background:url(",d,") 0 0 no-repeat;");(b.view.showIcon==!1||!j.apply(b.view.showIcon,[b.treeId,a],!0))&&c.push("width:0px;height:0px;")}return c.join("")},makeNodeLineClass:function(b,a){var c=[];b.view.showLine?a.level==0&&a.isFirstNode&&a.isLastNode?c.push(e.line.ROOT):a.level==0&&a.isFirstNode?c.push(e.line.ROOTS):a.isLastNode?c.push(e.line.BOTTOM): 52 | c.push(e.line.CENTER):c.push(e.line.NOLINE);a.isParent?c.push(a.open?e.folder.OPEN:e.folder.CLOSE):c.push(e.folder.DOCU);return i.makeNodeLineClassEx(a)+c.join("_")},makeNodeLineClassEx:function(b){return e.className.BUTTON+" "+e.className.LEVEL+b.level+" "+e.className.SWITCH+" "},makeNodeTarget:function(b){return b.target||"_blank"},makeNodeUrl:function(b,a){var c=b.data.key.url;return a[c]?a[c]:null},makeUlHtml:function(b,a,c,d){c.push("
      ");c.push(d);c.push("
    ")},makeUlLineClass:function(b,a){return b.view.showLine&&!a.isLastNode?e.line.LINE:""},removeChildNodes:function(b,a){if(a){var c=b.data.key.children,d=a[c];if(d){for(var f=0,g=d.length;f0)a[c][0].isFirstNode=!0},setLastNode:function(b,a){var c=b.data.key.children,d=a[c].length;if(d>0)a[c][d-1].isLastNode=!0},removeNode:function(b,a){var c=h.getRoot(b),d=b.data.key.children,f=a.parentTId?a.getParentNode():c;a.isFirstNode=!1;a.isLastNode=!1;a.getPreNode=function(){return null};a.getNextNode=function(){return null};if(h.getNodeCache(b,a.tId)){k(a,b).remove(); 55 | h.removeNodeCache(b,a);h.removeSelectedNode(b,a);for(var g=0,l=f[d].length;g0){var n=f[d][g-1],g=k(n,e.id.UL,b),l=k(n,e.id.SWITCH,b);j=k(n,e.id.ICON,b); 56 | f==c?f[d].length==1?i.replaceSwitchClass(n,l,e.line.ROOT):(c=k(f[d][0],e.id.SWITCH,b),i.replaceSwitchClass(f[d][0],c,e.line.ROOTS),i.replaceSwitchClass(n,l,e.line.BOTTOM)):i.replaceSwitchClass(n,l,e.line.BOTTOM);g.removeClass(e.line.LINE)}}},replaceIcoClass:function(b,a,c){if(a&&!b.isAjaxing&&(b=a.attr("class"),b!=void 0)){b=b.split("_");switch(c){case e.folder.OPEN:case e.folder.CLOSE:case e.folder.DOCU:b[b.length-1]=c}a.attr("class",b.join("_"))}},replaceSwitchClass:function(b,a,c){if(a){var d= 57 | a.attr("class");if(d!=void 0){d=d.split("_");switch(c){case e.line.ROOT:case e.line.ROOTS:case e.line.CENTER:case e.line.BOTTOM:case e.line.NOLINE:d[0]=i.makeNodeLineClassEx(b)+c;break;case e.folder.OPEN:case e.folder.CLOSE:case e.folder.DOCU:d[1]=c}a.attr("class",d.join("_"));c!==e.folder.DOCU?a.removeAttr("disabled"):a.attr("disabled","disabled")}}},selectNode:function(b,a,c){c||i.cancelPreSelectedNode(b);k(a,e.id.A,b).addClass(e.node.CURSELECTED);h.addSelectedNode(b,a)},setNodeFontCss:function(b, 58 | a){var c=k(a,e.id.A,b),d=i.makeNodeFontCss(b,a);d&&c.css(d)},setNodeLineIcos:function(b,a){if(a){var c=k(a,e.id.SWITCH,b),d=k(a,e.id.UL,b),f=k(a,e.id.ICON,b),g=i.makeUlLineClass(b,a);g.length==0?d.removeClass(e.line.LINE):d.addClass(g);c.attr("class",i.makeNodeLineClass(b,a));a.isParent?c.removeAttr("disabled"):c.attr("disabled","disabled");f.removeAttr("style");f.attr("style",i.makeNodeIcoStyle(b,a));f.attr("class",i.makeNodeIcoClass(b,a))}},setNodeName:function(b,a){var c=h.getNodeTitle(b,a),d= 59 | k(a,e.id.SPAN,b);d.empty();b.view.nameIsHTML?d.html(h.getNodeName(b,a)):d.text(h.getNodeName(b,a));j.apply(b.view.showTitle,[b.treeId,a],b.view.showTitle)&&k(a,e.id.A,b).attr("title",!c?"":c)},setNodeTarget:function(b,a){k(a,e.id.A,b).attr("target",i.makeNodeTarget(a))},setNodeUrl:function(b,a){var c=k(a,e.id.A,b),d=i.makeNodeUrl(b,a);d==null||d.length==0?c.removeAttr("href"):c.attr("href",d)},switchNode:function(b,a){a.open||!j.canAsync(b,a)?i.expandCollapseNode(b,a,!a.open):b.async.enable?i.asyncNode(b, 60 | a)||i.expandCollapseNode(b,a,!a.open):a&&i.expandCollapseNode(b,a,!a.open)}};p.fn.zTree={consts:{className:{BUTTON:"button",LEVEL:"level",ICO_LOADING:"ico_loading",SWITCH:"switch"},event:{NODECREATED:"ztree_nodeCreated",CLICK:"ztree_click",EXPAND:"ztree_expand",COLLAPSE:"ztree_collapse",ASYNC_SUCCESS:"ztree_async_success",ASYNC_ERROR:"ztree_async_error",REMOVE:"ztree_remove"},id:{A:"_a",ICON:"_ico",SPAN:"_span",SWITCH:"_switch",UL:"_ul"},line:{ROOT:"root",ROOTS:"roots",CENTER:"center",BOTTOM:"bottom", 61 | NOLINE:"noline",LINE:"line"},folder:{OPEN:"open",CLOSE:"close",DOCU:"docu"},node:{CURSELECTED:"curSelectedNode"}},_z:{tools:j,view:i,event:m,data:h},getZTreeObj:function(b){return(b=h.getZTreeTools(b))?b:null},destroy:function(b){if(b&&b.length>0)i.destroy(h.getSetting(b));else for(var a in r)i.destroy(r[a])},init:function(b,a,c){var d=j.clone(M);p.extend(!0,d,a);d.treeId=b.attr("id");d.treeObj=b;d.treeObj.empty();r[d.treeId]=d;if(typeof document.body.style.maxHeight==="undefined")d.view.expandSpeed= 62 | "";h.initRoot(d);b=h.getRoot(d);a=d.data.key.children;c=c?j.clone(j.isArray(c)?c:[c]):[];b[a]=d.data.simpleData.enable?h.transformTozTreeFormat(d,c):c;h.initCache(d);m.unbindTree(d);m.bindTree(d);m.unbindEvent(d);m.bindEvent(d);c={setting:d,addNodes:function(a,b,c){function e(){i.addNodes(d,a,h,c==!0)}if(!b)return null;a||(a=null);if(a&&!a.isParent&&d.data.keep.leaf)return null;var h=j.clone(j.isArray(b)?b:[b]);j.canAsync(d,a)?i.asyncNode(d,a,c,e):e();return h},cancelSelectedNode:function(a){i.cancelPreSelectedNode(d, 63 | a)},destroy:function(){i.destroy(d)},expandAll:function(a){a=!!a;i.expandCollapseSonNode(d,null,a,!0);return a},expandNode:function(a,b,c,e,n){if(!a||!a.isParent)return null;b!==!0&&b!==!1&&(b=!a.open);if((n=!!n)&&b&&j.apply(d.callback.beforeExpand,[d.treeId,a],!0)==!1)return null;else if(n&&!b&&j.apply(d.callback.beforeCollapse,[d.treeId,a],!0)==!1)return null;b&&a.parentTId&&i.expandCollapseParentNode(d,a.getParentNode(),b,!1);if(b===a.open&&!c)return null;h.getRoot(d).expandTriggerFlag=n;if(!j.canAsync(d, 64 | a)&&c)i.expandCollapseSonNode(d,a,b,!0,function(){if(e!==!1)try{k(a,d).focus().blur()}catch(b){}});else if(a.open=!b,i.switchNode(this.setting,a),e!==!1)try{k(a,d).focus().blur()}catch(m){}return b},getNodes:function(){return h.getNodes(d)},getNodeByParam:function(a,b,c){return!a?null:h.getNodeByParam(d,c?c[d.data.key.children]:h.getNodes(d),a,b)},getNodeByTId:function(a){return h.getNodeCache(d,a)},getNodesByParam:function(a,b,c){return!a?null:h.getNodesByParam(d,c?c[d.data.key.children]:h.getNodes(d), 65 | a,b)},getNodesByParamFuzzy:function(a,b,c){return!a?null:h.getNodesByParamFuzzy(d,c?c[d.data.key.children]:h.getNodes(d),a,b)},getNodesByFilter:function(a,b,c,e){b=!!b;return!a||typeof a!="function"?b?null:[]:h.getNodesByFilter(d,c?c[d.data.key.children]:h.getNodes(d),a,b,e)},getNodeIndex:function(a){if(!a)return null;for(var b=d.data.key.children,c=a.parentTId?a.getParentNode():h.getRoot(d),e=0,i=c[b].length;e0?i.createNodes(d, 69 | 0,b[a]):d.async.enable&&d.async.url&&d.async.url!==""&&i.asyncNode(d);return c}};var N=p.fn.zTree,k=j.$,e=N.consts})(jQuery); 70 | -------------------------------------------------------------------------------- /src/assets/js/bootstrap.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Bootstrap v3.3.5 (http://getbootstrap.com) 3 | * Copyright 2011-2015 Twitter, Inc. 4 | * Licensed under the MIT license 5 | */ 6 | if("undefined"==typeof jQuery)throw new Error("Bootstrap's JavaScript requires jQuery");+function(a){"use strict";var b=a.fn.jquery.split(" ")[0].split(".");if(b[0]<2&&b[1]<9||1==b[0]&&9==b[1]&&b[2]<1)throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher")}(jQuery),+function(a){"use strict";function b(){var a=document.createElement("bootstrap"),b={WebkitTransition:"webkitTransitionEnd",MozTransition:"transitionend",OTransition:"oTransitionEnd otransitionend",transition:"transitionend"};for(var c in b)if(void 0!==a.style[c])return{end:b[c]};return!1}a.fn.emulateTransitionEnd=function(b){var c=!1,d=this;a(this).one("bsTransitionEnd",function(){c=!0});var e=function(){c||a(d).trigger(a.support.transition.end)};return setTimeout(e,b),this},a(function(){a.support.transition=b(),a.support.transition&&(a.event.special.bsTransitionEnd={bindType:a.support.transition.end,delegateType:a.support.transition.end,handle:function(b){return a(b.target).is(this)?b.handleObj.handler.apply(this,arguments):void 0}})})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var c=a(this),e=c.data("bs.alert");e||c.data("bs.alert",e=new d(this)),"string"==typeof b&&e[b].call(c)})}var c='[data-dismiss="alert"]',d=function(b){a(b).on("click",c,this.close)};d.VERSION="3.3.5",d.TRANSITION_DURATION=150,d.prototype.close=function(b){function c(){g.detach().trigger("closed.bs.alert").remove()}var e=a(this),f=e.attr("data-target");f||(f=e.attr("href"),f=f&&f.replace(/.*(?=#[^\s]*$)/,""));var g=a(f);b&&b.preventDefault(),g.length||(g=e.closest(".alert")),g.trigger(b=a.Event("close.bs.alert")),b.isDefaultPrevented()||(g.removeClass("in"),a.support.transition&&g.hasClass("fade")?g.one("bsTransitionEnd",c).emulateTransitionEnd(d.TRANSITION_DURATION):c())};var e=a.fn.alert;a.fn.alert=b,a.fn.alert.Constructor=d,a.fn.alert.noConflict=function(){return a.fn.alert=e,this},a(document).on("click.bs.alert.data-api",c,d.prototype.close)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.button"),f="object"==typeof b&&b;e||d.data("bs.button",e=new c(this,f)),"toggle"==b?e.toggle():b&&e.setState(b)})}var c=function(b,d){this.$element=a(b),this.options=a.extend({},c.DEFAULTS,d),this.isLoading=!1};c.VERSION="3.3.5",c.DEFAULTS={loadingText:"loading..."},c.prototype.setState=function(b){var c="disabled",d=this.$element,e=d.is("input")?"val":"html",f=d.data();b+="Text",null==f.resetText&&d.data("resetText",d[e]()),setTimeout(a.proxy(function(){d[e](null==f[b]?this.options[b]:f[b]),"loadingText"==b?(this.isLoading=!0,d.addClass(c).attr(c,c)):this.isLoading&&(this.isLoading=!1,d.removeClass(c).removeAttr(c))},this),0)},c.prototype.toggle=function(){var a=!0,b=this.$element.closest('[data-toggle="buttons"]');if(b.length){var c=this.$element.find("input");"radio"==c.prop("type")?(c.prop("checked")&&(a=!1),b.find(".active").removeClass("active"),this.$element.addClass("active")):"checkbox"==c.prop("type")&&(c.prop("checked")!==this.$element.hasClass("active")&&(a=!1),this.$element.toggleClass("active")),c.prop("checked",this.$element.hasClass("active")),a&&c.trigger("change")}else this.$element.attr("aria-pressed",!this.$element.hasClass("active")),this.$element.toggleClass("active")};var d=a.fn.button;a.fn.button=b,a.fn.button.Constructor=c,a.fn.button.noConflict=function(){return a.fn.button=d,this},a(document).on("click.bs.button.data-api",'[data-toggle^="button"]',function(c){var d=a(c.target);d.hasClass("btn")||(d=d.closest(".btn")),b.call(d,"toggle"),a(c.target).is('input[type="radio"]')||a(c.target).is('input[type="checkbox"]')||c.preventDefault()}).on("focus.bs.button.data-api blur.bs.button.data-api",'[data-toggle^="button"]',function(b){a(b.target).closest(".btn").toggleClass("focus",/^focus(in)?$/.test(b.type))})}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.carousel"),f=a.extend({},c.DEFAULTS,d.data(),"object"==typeof b&&b),g="string"==typeof b?b:f.slide;e||d.data("bs.carousel",e=new c(this,f)),"number"==typeof b?e.to(b):g?e[g]():f.interval&&e.pause().cycle()})}var c=function(b,c){this.$element=a(b),this.$indicators=this.$element.find(".carousel-indicators"),this.options=c,this.paused=null,this.sliding=null,this.interval=null,this.$active=null,this.$items=null,this.options.keyboard&&this.$element.on("keydown.bs.carousel",a.proxy(this.keydown,this)),"hover"==this.options.pause&&!("ontouchstart"in document.documentElement)&&this.$element.on("mouseenter.bs.carousel",a.proxy(this.pause,this)).on("mouseleave.bs.carousel",a.proxy(this.cycle,this))};c.VERSION="3.3.5",c.TRANSITION_DURATION=600,c.DEFAULTS={interval:5e3,pause:"hover",wrap:!0,keyboard:!0},c.prototype.keydown=function(a){if(!/input|textarea/i.test(a.target.tagName)){switch(a.which){case 37:this.prev();break;case 39:this.next();break;default:return}a.preventDefault()}},c.prototype.cycle=function(b){return b||(this.paused=!1),this.interval&&clearInterval(this.interval),this.options.interval&&!this.paused&&(this.interval=setInterval(a.proxy(this.next,this),this.options.interval)),this},c.prototype.getItemIndex=function(a){return this.$items=a.parent().children(".item"),this.$items.index(a||this.$active)},c.prototype.getItemForDirection=function(a,b){var c=this.getItemIndex(b),d="prev"==a&&0===c||"next"==a&&c==this.$items.length-1;if(d&&!this.options.wrap)return b;var e="prev"==a?-1:1,f=(c+e)%this.$items.length;return this.$items.eq(f)},c.prototype.to=function(a){var b=this,c=this.getItemIndex(this.$active=this.$element.find(".item.active"));return a>this.$items.length-1||0>a?void 0:this.sliding?this.$element.one("slid.bs.carousel",function(){b.to(a)}):c==a?this.pause().cycle():this.slide(a>c?"next":"prev",this.$items.eq(a))},c.prototype.pause=function(b){return b||(this.paused=!0),this.$element.find(".next, .prev").length&&a.support.transition&&(this.$element.trigger(a.support.transition.end),this.cycle(!0)),this.interval=clearInterval(this.interval),this},c.prototype.next=function(){return this.sliding?void 0:this.slide("next")},c.prototype.prev=function(){return this.sliding?void 0:this.slide("prev")},c.prototype.slide=function(b,d){var e=this.$element.find(".item.active"),f=d||this.getItemForDirection(b,e),g=this.interval,h="next"==b?"left":"right",i=this;if(f.hasClass("active"))return this.sliding=!1;var j=f[0],k=a.Event("slide.bs.carousel",{relatedTarget:j,direction:h});if(this.$element.trigger(k),!k.isDefaultPrevented()){if(this.sliding=!0,g&&this.pause(),this.$indicators.length){this.$indicators.find(".active").removeClass("active");var l=a(this.$indicators.children()[this.getItemIndex(f)]);l&&l.addClass("active")}var m=a.Event("slid.bs.carousel",{relatedTarget:j,direction:h});return a.support.transition&&this.$element.hasClass("slide")?(f.addClass(b),f[0].offsetWidth,e.addClass(h),f.addClass(h),e.one("bsTransitionEnd",function(){f.removeClass([b,h].join(" ")).addClass("active"),e.removeClass(["active",h].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger(m)},0)}).emulateTransitionEnd(c.TRANSITION_DURATION)):(e.removeClass("active"),f.addClass("active"),this.sliding=!1,this.$element.trigger(m)),g&&this.cycle(),this}};var d=a.fn.carousel;a.fn.carousel=b,a.fn.carousel.Constructor=c,a.fn.carousel.noConflict=function(){return a.fn.carousel=d,this};var e=function(c){var d,e=a(this),f=a(e.attr("data-target")||(d=e.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""));if(f.hasClass("carousel")){var g=a.extend({},f.data(),e.data()),h=e.attr("data-slide-to");h&&(g.interval=!1),b.call(f,g),h&&f.data("bs.carousel").to(h),c.preventDefault()}};a(document).on("click.bs.carousel.data-api","[data-slide]",e).on("click.bs.carousel.data-api","[data-slide-to]",e),a(window).on("load",function(){a('[data-ride="carousel"]').each(function(){var c=a(this);b.call(c,c.data())})})}(jQuery),+function(a){"use strict";function b(b){var c,d=b.attr("data-target")||(c=b.attr("href"))&&c.replace(/.*(?=#[^\s]+$)/,"");return a(d)}function c(b){return this.each(function(){var c=a(this),e=c.data("bs.collapse"),f=a.extend({},d.DEFAULTS,c.data(),"object"==typeof b&&b);!e&&f.toggle&&/show|hide/.test(b)&&(f.toggle=!1),e||c.data("bs.collapse",e=new d(this,f)),"string"==typeof b&&e[b]()})}var d=function(b,c){this.$element=a(b),this.options=a.extend({},d.DEFAULTS,c),this.$trigger=a('[data-toggle="collapse"][href="#'+b.id+'"],[data-toggle="collapse"][data-target="#'+b.id+'"]'),this.transitioning=null,this.options.parent?this.$parent=this.getParent():this.addAriaAndCollapsedClass(this.$element,this.$trigger),this.options.toggle&&this.toggle()};d.VERSION="3.3.5",d.TRANSITION_DURATION=350,d.DEFAULTS={toggle:!0},d.prototype.dimension=function(){var a=this.$element.hasClass("width");return a?"width":"height"},d.prototype.show=function(){if(!this.transitioning&&!this.$element.hasClass("in")){var b,e=this.$parent&&this.$parent.children(".panel").children(".in, .collapsing");if(!(e&&e.length&&(b=e.data("bs.collapse"),b&&b.transitioning))){var f=a.Event("show.bs.collapse");if(this.$element.trigger(f),!f.isDefaultPrevented()){e&&e.length&&(c.call(e,"hide"),b||e.data("bs.collapse",null));var g=this.dimension();this.$element.removeClass("collapse").addClass("collapsing")[g](0).attr("aria-expanded",!0),this.$trigger.removeClass("collapsed").attr("aria-expanded",!0),this.transitioning=1;var h=function(){this.$element.removeClass("collapsing").addClass("collapse in")[g](""),this.transitioning=0,this.$element.trigger("shown.bs.collapse")};if(!a.support.transition)return h.call(this);var i=a.camelCase(["scroll",g].join("-"));this.$element.one("bsTransitionEnd",a.proxy(h,this)).emulateTransitionEnd(d.TRANSITION_DURATION)[g](this.$element[0][i])}}}},d.prototype.hide=function(){if(!this.transitioning&&this.$element.hasClass("in")){var b=a.Event("hide.bs.collapse");if(this.$element.trigger(b),!b.isDefaultPrevented()){var c=this.dimension();this.$element[c](this.$element[c]())[0].offsetHeight,this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded",!1),this.$trigger.addClass("collapsed").attr("aria-expanded",!1),this.transitioning=1;var e=function(){this.transitioning=0,this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse")};return a.support.transition?void this.$element[c](0).one("bsTransitionEnd",a.proxy(e,this)).emulateTransitionEnd(d.TRANSITION_DURATION):e.call(this)}}},d.prototype.toggle=function(){this[this.$element.hasClass("in")?"hide":"show"]()},d.prototype.getParent=function(){return a(this.options.parent).find('[data-toggle="collapse"][data-parent="'+this.options.parent+'"]').each(a.proxy(function(c,d){var e=a(d);this.addAriaAndCollapsedClass(b(e),e)},this)).end()},d.prototype.addAriaAndCollapsedClass=function(a,b){var c=a.hasClass("in");a.attr("aria-expanded",c),b.toggleClass("collapsed",!c).attr("aria-expanded",c)};var e=a.fn.collapse;a.fn.collapse=c,a.fn.collapse.Constructor=d,a.fn.collapse.noConflict=function(){return a.fn.collapse=e,this},a(document).on("click.bs.collapse.data-api",'[data-toggle="collapse"]',function(d){var e=a(this);e.attr("data-target")||d.preventDefault();var f=b(e),g=f.data("bs.collapse"),h=g?"toggle":e.data();c.call(f,h)})}(jQuery),+function(a){"use strict";function b(b){var c=b.attr("data-target");c||(c=b.attr("href"),c=c&&/#[A-Za-z]/.test(c)&&c.replace(/.*(?=#[^\s]*$)/,""));var d=c&&a(c);return d&&d.length?d:b.parent()}function c(c){c&&3===c.which||(a(e).remove(),a(f).each(function(){var d=a(this),e=b(d),f={relatedTarget:this};e.hasClass("open")&&(c&&"click"==c.type&&/input|textarea/i.test(c.target.tagName)&&a.contains(e[0],c.target)||(e.trigger(c=a.Event("hide.bs.dropdown",f)),c.isDefaultPrevented()||(d.attr("aria-expanded","false"),e.removeClass("open").trigger("hidden.bs.dropdown",f))))}))}function d(b){return this.each(function(){var c=a(this),d=c.data("bs.dropdown");d||c.data("bs.dropdown",d=new g(this)),"string"==typeof b&&d[b].call(c)})}var e=".dropdown-backdrop",f='[data-toggle="dropdown"]',g=function(b){a(b).on("click.bs.dropdown",this.toggle)};g.VERSION="3.3.5",g.prototype.toggle=function(d){var e=a(this);if(!e.is(".disabled, :disabled")){var f=b(e),g=f.hasClass("open");if(c(),!g){"ontouchstart"in document.documentElement&&!f.closest(".navbar-nav").length&&a(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(a(this)).on("click",c);var h={relatedTarget:this};if(f.trigger(d=a.Event("show.bs.dropdown",h)),d.isDefaultPrevented())return;e.trigger("focus").attr("aria-expanded","true"),f.toggleClass("open").trigger("shown.bs.dropdown",h)}return!1}},g.prototype.keydown=function(c){if(/(38|40|27|32)/.test(c.which)&&!/input|textarea/i.test(c.target.tagName)){var d=a(this);if(c.preventDefault(),c.stopPropagation(),!d.is(".disabled, :disabled")){var e=b(d),g=e.hasClass("open");if(!g&&27!=c.which||g&&27==c.which)return 27==c.which&&e.find(f).trigger("focus"),d.trigger("click");var h=" li:not(.disabled):visible a",i=e.find(".dropdown-menu"+h);if(i.length){var j=i.index(c.target);38==c.which&&j>0&&j--,40==c.which&&jdocument.documentElement.clientHeight;this.$element.css({paddingLeft:!this.bodyIsOverflowing&&a?this.scrollbarWidth:"",paddingRight:this.bodyIsOverflowing&&!a?this.scrollbarWidth:""})},c.prototype.resetAdjustments=function(){this.$element.css({paddingLeft:"",paddingRight:""})},c.prototype.checkScrollbar=function(){var a=window.innerWidth;if(!a){var b=document.documentElement.getBoundingClientRect();a=b.right-Math.abs(b.left)}this.bodyIsOverflowing=document.body.clientWidth
    ',trigger:"hover focus",title:"",delay:0,html:!1,container:!1,viewport:{selector:"body",padding:0}},c.prototype.init=function(b,c,d){if(this.enabled=!0,this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.$viewport=this.options.viewport&&a(a.isFunction(this.options.viewport)?this.options.viewport.call(this,this.$element):this.options.viewport.selector||this.options.viewport),this.inState={click:!1,hover:!1,focus:!1},this.$element[0]instanceof document.constructor&&!this.options.selector)throw new Error("`selector` option must be specified when initializing "+this.type+" on the window.document object!");for(var e=this.options.trigger.split(" "),f=e.length;f--;){var g=e[f];if("click"==g)this.$element.on("click."+this.type,this.options.selector,a.proxy(this.toggle,this));else if("manual"!=g){var h="hover"==g?"mouseenter":"focusin",i="hover"==g?"mouseleave":"focusout";this.$element.on(h+"."+this.type,this.options.selector,a.proxy(this.enter,this)),this.$element.on(i+"."+this.type,this.options.selector,a.proxy(this.leave,this))}}this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.getOptions=function(b){return b=a.extend({},this.getDefaults(),this.$element.data(),b),b.delay&&"number"==typeof b.delay&&(b.delay={show:b.delay,hide:b.delay}),b},c.prototype.getDelegateOptions=function(){var b={},c=this.getDefaults();return this._options&&a.each(this._options,function(a,d){c[a]!=d&&(b[a]=d)}),b},c.prototype.enter=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusin"==b.type?"focus":"hover"]=!0),c.tip().hasClass("in")||"in"==c.hoverState?void(c.hoverState="in"):(clearTimeout(c.timeout),c.hoverState="in",c.options.delay&&c.options.delay.show?void(c.timeout=setTimeout(function(){"in"==c.hoverState&&c.show()},c.options.delay.show)):c.show())},c.prototype.isInStateTrue=function(){for(var a in this.inState)if(this.inState[a])return!0;return!1},c.prototype.leave=function(b){var c=b instanceof this.constructor?b:a(b.currentTarget).data("bs."+this.type);return c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c)),b instanceof a.Event&&(c.inState["focusout"==b.type?"focus":"hover"]=!1),c.isInStateTrue()?void 0:(clearTimeout(c.timeout),c.hoverState="out",c.options.delay&&c.options.delay.hide?void(c.timeout=setTimeout(function(){"out"==c.hoverState&&c.hide()},c.options.delay.hide)):c.hide())},c.prototype.show=function(){var b=a.Event("show.bs."+this.type);if(this.hasContent()&&this.enabled){this.$element.trigger(b);var d=a.contains(this.$element[0].ownerDocument.documentElement,this.$element[0]);if(b.isDefaultPrevented()||!d)return;var e=this,f=this.tip(),g=this.getUID(this.type);this.setContent(),f.attr("id",g),this.$element.attr("aria-describedby",g),this.options.animation&&f.addClass("fade");var h="function"==typeof this.options.placement?this.options.placement.call(this,f[0],this.$element[0]):this.options.placement,i=/\s?auto?\s?/i,j=i.test(h);j&&(h=h.replace(i,"")||"top"),f.detach().css({top:0,left:0,display:"block"}).addClass(h).data("bs."+this.type,this),this.options.container?f.appendTo(this.options.container):f.insertAfter(this.$element),this.$element.trigger("inserted.bs."+this.type);var k=this.getPosition(),l=f[0].offsetWidth,m=f[0].offsetHeight;if(j){var n=h,o=this.getPosition(this.$viewport);h="bottom"==h&&k.bottom+m>o.bottom?"top":"top"==h&&k.top-mo.width?"left":"left"==h&&k.left-lg.top+g.height&&(e.top=g.top+g.height-i)}else{var j=b.left-f,k=b.left+f+c;jg.right&&(e.left=g.left+g.width-k)}return e},c.prototype.getTitle=function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||("function"==typeof c.title?c.title.call(b[0]):c.title)},c.prototype.getUID=function(a){do a+=~~(1e6*Math.random());while(document.getElementById(a));return a},c.prototype.tip=function(){if(!this.$tip&&(this.$tip=a(this.options.template),1!=this.$tip.length))throw new Error(this.type+" `template` option must consist of exactly 1 top-level element!");return this.$tip},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".tooltip-arrow")},c.prototype.enable=function(){this.enabled=!0},c.prototype.disable=function(){this.enabled=!1},c.prototype.toggleEnabled=function(){this.enabled=!this.enabled},c.prototype.toggle=function(b){var c=this;b&&(c=a(b.currentTarget).data("bs."+this.type),c||(c=new this.constructor(b.currentTarget,this.getDelegateOptions()),a(b.currentTarget).data("bs."+this.type,c))),b?(c.inState.click=!c.inState.click,c.isInStateTrue()?c.enter(c):c.leave(c)):c.tip().hasClass("in")?c.leave(c):c.enter(c)},c.prototype.destroy=function(){var a=this;clearTimeout(this.timeout),this.hide(function(){a.$element.off("."+a.type).removeData("bs."+a.type),a.$tip&&a.$tip.detach(),a.$tip=null,a.$arrow=null,a.$viewport=null})};var d=a.fn.tooltip;a.fn.tooltip=b,a.fn.tooltip.Constructor=c,a.fn.tooltip.noConflict=function(){return a.fn.tooltip=d,this}}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.popover"),f="object"==typeof b&&b;(e||!/destroy|hide/.test(b))&&(e||d.data("bs.popover",e=new c(this,f)),"string"==typeof b&&e[b]())})}var c=function(a,b){this.init("popover",a,b)};if(!a.fn.tooltip)throw new Error("Popover requires tooltip.js");c.VERSION="3.3.5",c.DEFAULTS=a.extend({},a.fn.tooltip.Constructor.DEFAULTS,{placement:"right",trigger:"click",content:"",template:''}),c.prototype=a.extend({},a.fn.tooltip.Constructor.prototype),c.prototype.constructor=c,c.prototype.getDefaults=function(){return c.DEFAULTS},c.prototype.setContent=function(){var a=this.tip(),b=this.getTitle(),c=this.getContent();a.find(".popover-title")[this.options.html?"html":"text"](b),a.find(".popover-content").children().detach().end()[this.options.html?"string"==typeof c?"html":"append":"text"](c),a.removeClass("fade top bottom left right in"),a.find(".popover-title").html()||a.find(".popover-title").hide()},c.prototype.hasContent=function(){return this.getTitle()||this.getContent()},c.prototype.getContent=function(){var a=this.$element,b=this.options;return a.attr("data-content")||("function"==typeof b.content?b.content.call(a[0]):b.content)},c.prototype.arrow=function(){return this.$arrow=this.$arrow||this.tip().find(".arrow")};var d=a.fn.popover;a.fn.popover=b,a.fn.popover.Constructor=c,a.fn.popover.noConflict=function(){return a.fn.popover=d,this}}(jQuery),+function(a){"use strict";function b(c,d){this.$body=a(document.body),this.$scrollElement=a(a(c).is(document.body)?window:c),this.options=a.extend({},b.DEFAULTS,d),this.selector=(this.options.target||"")+" .nav li > a",this.offsets=[],this.targets=[],this.activeTarget=null,this.scrollHeight=0,this.$scrollElement.on("scroll.bs.scrollspy",a.proxy(this.process,this)),this.refresh(),this.process()}function c(c){return this.each(function(){var d=a(this),e=d.data("bs.scrollspy"),f="object"==typeof c&&c;e||d.data("bs.scrollspy",e=new b(this,f)),"string"==typeof c&&e[c]()})}b.VERSION="3.3.5",b.DEFAULTS={offset:10},b.prototype.getScrollHeight=function(){return this.$scrollElement[0].scrollHeight||Math.max(this.$body[0].scrollHeight,document.documentElement.scrollHeight)},b.prototype.refresh=function(){var b=this,c="offset",d=0;this.offsets=[],this.targets=[],this.scrollHeight=this.getScrollHeight(),a.isWindow(this.$scrollElement[0])||(c="position",d=this.$scrollElement.scrollTop()),this.$body.find(this.selector).map(function(){var b=a(this),e=b.data("target")||b.attr("href"),f=/^#./.test(e)&&a(e);return f&&f.length&&f.is(":visible")&&[[f[c]().top+d,e]]||null}).sort(function(a,b){return a[0]-b[0]}).each(function(){b.offsets.push(this[0]),b.targets.push(this[1])})},b.prototype.process=function(){var a,b=this.$scrollElement.scrollTop()+this.options.offset,c=this.getScrollHeight(),d=this.options.offset+c-this.$scrollElement.height(),e=this.offsets,f=this.targets,g=this.activeTarget;if(this.scrollHeight!=c&&this.refresh(),b>=d)return g!=(a=f[f.length-1])&&this.activate(a);if(g&&b=e[a]&&(void 0===e[a+1]||b .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!1),b.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded",!0),h?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu").length&&b.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded",!0),e&&e()}var g=d.find("> .active"),h=e&&a.support.transition&&(g.length&&g.hasClass("fade")||!!d.find("> .fade").length);g.length&&h?g.one("bsTransitionEnd",f).emulateTransitionEnd(c.TRANSITION_DURATION):f(),g.removeClass("in")};var d=a.fn.tab;a.fn.tab=b,a.fn.tab.Constructor=c,a.fn.tab.noConflict=function(){return a.fn.tab=d,this};var e=function(c){c.preventDefault(),b.call(a(this),"show")};a(document).on("click.bs.tab.data-api",'[data-toggle="tab"]',e).on("click.bs.tab.data-api",'[data-toggle="pill"]',e)}(jQuery),+function(a){"use strict";function b(b){return this.each(function(){var d=a(this),e=d.data("bs.affix"),f="object"==typeof b&&b;e||d.data("bs.affix",e=new c(this,f)),"string"==typeof b&&e[b]()})}var c=function(b,d){this.options=a.extend({},c.DEFAULTS,d),this.$target=a(this.options.target).on("scroll.bs.affix.data-api",a.proxy(this.checkPosition,this)).on("click.bs.affix.data-api",a.proxy(this.checkPositionWithEventLoop,this)),this.$element=a(b),this.affixed=null,this.unpin=null,this.pinnedOffset=null,this.checkPosition()};c.VERSION="3.3.5",c.RESET="affix affix-top affix-bottom",c.DEFAULTS={offset:0,target:window},c.prototype.getState=function(a,b,c,d){var e=this.$target.scrollTop(),f=this.$element.offset(),g=this.$target.height();if(null!=c&&"top"==this.affixed)return c>e?"top":!1;if("bottom"==this.affixed)return null!=c?e+this.unpin<=f.top?!1:"bottom":a-d>=e+g?!1:"bottom";var h=null==this.affixed,i=h?e:f.top,j=h?g:b;return null!=c&&c>=e?"top":null!=d&&i+j>=a-d?"bottom":!1},c.prototype.getPinnedOffset=function(){if(this.pinnedOffset)return this.pinnedOffset;this.$element.removeClass(c.RESET).addClass("affix");var a=this.$target.scrollTop(),b=this.$element.offset();return this.pinnedOffset=b.top-a},c.prototype.checkPositionWithEventLoop=function(){setTimeout(a.proxy(this.checkPosition,this),1)},c.prototype.checkPosition=function(){if(this.$element.is(":visible")){var b=this.$element.height(),d=this.options.offset,e=d.top,f=d.bottom,g=Math.max(a(document).height(),a(document.body).height());"object"!=typeof d&&(f=e=d),"function"==typeof e&&(e=d.top(this.$element)),"function"==typeof f&&(f=d.bottom(this.$element));var h=this.getState(g,b,e,f);if(this.affixed!=h){null!=this.unpin&&this.$element.css("top","");var i="affix"+(h?"-"+h:""),j=a.Event(i+".bs.affix");if(this.$element.trigger(j),j.isDefaultPrevented())return;this.affixed=h,this.unpin="bottom"==h?this.getPinnedOffset():null,this.$element.removeClass(c.RESET).addClass(i).trigger(i.replace("affix","affixed")+".bs.affix")}"bottom"==h&&this.$element.offset({top:g-b-f})}};var d=a.fn.affix;a.fn.affix=b,a.fn.affix.Constructor=c,a.fn.affix.noConflict=function(){return a.fn.affix=d,this},a(window).on("load",function(){a('[data-spy="affix"]').each(function(){var c=a(this),d=c.data();d.offset=d.offset||{},null!=d.offsetBottom&&(d.offset.bottom=d.offsetBottom),null!=d.offsetTop&&(d.offset.top=d.offsetTop),b.call(c,d)})})}(jQuery); --------------------------------------------------------------------------------