├── .babelrc ├── .eslintrc ├── .gitignore ├── Dockerfile ├── LICENSE ├── README.md ├── README_zh-CN.md ├── development.js ├── docker-compose.yml ├── nginx.conf ├── package.json ├── pm2.json ├── production.js ├── src ├── bootstrap │ ├── master.js │ └── worker.js ├── config │ ├── adapter.js │ ├── config.js │ ├── config.production.js │ ├── extend.js │ ├── middleware.js │ └── router.js ├── controller │ ├── api │ │ ├── doc.js │ │ ├── doc │ │ │ └── user.js │ │ ├── markdown.js │ │ ├── token.js │ │ └── user.js │ ├── base.js │ ├── index.js │ └── rest.js ├── extend │ ├── controller.js │ └── think.js ├── logic │ ├── api │ │ ├── base.js │ │ ├── doc.js │ │ ├── doc │ │ │ └── user.js │ │ ├── markdown.js │ │ ├── token.js │ │ └── user.js │ └── index.js ├── model │ ├── doc.js │ └── user.js └── service │ └── markdown.js ├── test └── index.js ├── view ├── index_doc.html ├── index_index.html └── index_mockjs.html ├── webpack.config.js └── www ├── doc ├── api_data.js ├── api_data.json ├── api_project.js ├── api_project.json ├── css │ └── style.css ├── fonts │ ├── glyphicons-halflings-regular.eot │ ├── glyphicons-halflings-regular.svg │ ├── glyphicons-halflings-regular.ttf │ ├── glyphicons-halflings-regular.woff │ └── glyphicons-halflings-regular.woff2 ├── img │ └── favicon.ico ├── index.html ├── locales │ ├── ca.js │ ├── de.js │ ├── es.js │ ├── fr.js │ ├── it.js │ ├── locale.js │ ├── nl.js │ ├── pl.js │ ├── pt_br.js │ ├── ro.js │ ├── ru.js │ ├── zh.js │ └── zh_cn.js ├── main.js ├── utils │ ├── handlebars_helper.js │ └── send_sample_request.js └── vendor │ ├── bootstrap.min.css │ ├── bootstrap.min.js │ ├── diff_match_patch.min.js │ ├── handlebars.min.js │ ├── jquery.min.js │ ├── list.min.js │ ├── lodash.custom.min.js │ ├── path-to-regexp │ ├── LICENSE │ └── index.js │ ├── polyfill.js │ ├── prettify.css │ ├── prettify │ ├── lang-Splus.js │ ├── lang-aea.js │ ├── lang-agc.js │ ├── lang-apollo.js │ ├── lang-basic.js │ ├── lang-cbm.js │ ├── lang-cl.js │ ├── lang-clj.js │ ├── lang-css.js │ ├── lang-dart.js │ ├── lang-el.js │ ├── lang-erl.js │ ├── lang-erlang.js │ ├── lang-fs.js │ ├── lang-go.js │ ├── lang-hs.js │ ├── lang-lasso.js │ ├── lang-lassoscript.js │ ├── lang-latex.js │ ├── lang-lgt.js │ ├── lang-lisp.js │ ├── lang-ll.js │ ├── lang-llvm.js │ ├── lang-logtalk.js │ ├── lang-ls.js │ ├── lang-lsp.js │ ├── lang-lua.js │ ├── lang-matlab.js │ ├── lang-ml.js │ ├── lang-mumps.js │ ├── lang-n.js │ ├── lang-nemerle.js │ ├── lang-pascal.js │ ├── lang-proto.js │ ├── lang-r.js │ ├── lang-rd.js │ ├── lang-rkt.js │ ├── lang-rust.js │ ├── lang-s.js │ ├── lang-scala.js │ ├── lang-scm.js │ ├── lang-sql.js │ ├── lang-ss.js │ ├── lang-swift.js │ ├── lang-tcl.js │ ├── lang-tex.js │ ├── lang-vb.js │ ├── lang-vbs.js │ ├── lang-vhd.js │ ├── lang-vhdl.js │ ├── lang-wiki.js │ ├── lang-xq.js │ ├── lang-xquery.js │ ├── lang-yaml.js │ ├── lang-yml.js │ ├── prettify.css │ ├── prettify.js │ └── run_prettify.js │ ├── require.min.js │ ├── semver.min.js │ └── webfontloader.js └── static ├── css └── style.css ├── image └── .gitkeep ├── js └── .gitkeep └── src ├── Edit.jsx ├── Home.jsx ├── Login.jsx ├── Mock.jsx ├── Register.jsx ├── components ├── AddOrEditProductModal.jsx ├── AddOrEditUserModal.jsx ├── Api │ ├── Params.jsx │ ├── Resp.jsx │ └── index.jsx ├── Auth.jsx ├── Header.jsx ├── Layout.jsx ├── SideApi.jsx └── request.js └── index.jsx /.babelrc: -------------------------------------------------------------------------------- 1 | { 2 | "presets": [ 3 | "@babel/preset-react", 4 | ["@babel/preset-env", { 5 | "target": { 6 | "browsers": ["last 2 versions", "safari >= 7"] 7 | } 8 | }] 9 | ], 10 | "plugins": [ 11 | ["import", { 12 | "libraryName": "antd", 13 | "libraryDirectory": "es", 14 | "style": "css" 15 | }], 16 | "@babel/plugin-proposal-object-rest-spread", 17 | "transform-class-properties" 18 | ] 19 | } -------------------------------------------------------------------------------- /.eslintrc: -------------------------------------------------------------------------------- 1 | { 2 | "env": { 3 | "node": true, 4 | "browser": true 5 | }, 6 | "extends": [ 7 | "think" 8 | ], 9 | "plugins": [ 10 | "react" 11 | ], 12 | "parserOptions": { 13 | "ecmaFeatures": { 14 | "jsx": true 15 | } 16 | }, 17 | "rules": { 18 | "react/jsx-uses-react": "error", 19 | "react/jsx-uses-vars": "error", 20 | "camelcase": "off" 21 | } 22 | } -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Logs 2 | logs 3 | *.log 4 | 5 | # Runtime data 6 | pids 7 | *.pid 8 | *.seed 9 | 10 | # Directory for instrumented libs generated by jscoverage/JSCover 11 | lib-cov 12 | 13 | # Coverage directory used by tools like istanbul 14 | coverage/ 15 | 16 | # Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) 17 | .grunt 18 | 19 | # node-waf configuration 20 | .lock-wscript 21 | 22 | # Dependency directory 23 | # https://www.npmjs.org/doc/misc/npm-faq.html#should-i-check-my-node_modules-folder-into-git 24 | node_modules/ 25 | 26 | # IDE config 27 | .idea 28 | 29 | # output 30 | output/ 31 | output.tar.gz 32 | 33 | runtime/ 34 | app/ 35 | 36 | config.development.js 37 | adapter.development.js 38 | www/static/js/home.js 39 | www/static/css/base.css -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM mhart/alpine-node:8.9.4 2 | 3 | WORKDIR /animaris 4 | COPY package.json /animaris/package.json 5 | RUN npm i --production --registry=https://registry.npm.taobao.org 6 | 7 | COPY src /animaris/src 8 | COPY view /animaris/view 9 | COPY www /animaris/www 10 | COPY production.js /animaris/production.js 11 | 12 | ENV DOCKER=true 13 | EXPOSE 8360 14 | CMD [ "node", "/animaris/production.js" ] -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2013-2017 lichengyin (welefen@gmail.com) and contributors 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in 11 | all copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 19 | THE SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 |

Animaris

7 | 8 |
9 | 10 | node version required 11 | 12 | 13 | License 14 | 15 | 16 | MicroBadger Size 17 | 18 | 19 | MicroBadger Layers 20 | 21 | 22 | Chat 23 | 24 |
25 | 26 |

Documentation and Mock for Mobile WebView APIs base on ThinkJS & MongoDB & React & Antd.

27 |
28 | 29 | [简体中文文档](https://github.com/lizheming/animaris/blob/master/README_zh-CN.md) 30 | 31 | ## Introduction 32 | 33 | Animaris is a system to resolve problem about mobile webview api documentation and mock. We use [ThinkJS](https://thinkjs.org) and MongoDB for server, React and [Antd](https://ant.design) for front end, [Docsify](http://docsify.js.org) for documentation at last. Animaris fixed follow questions: 34 | 35 | 1. A visual documentation for Mobile WebView API. 36 | 2. How mock Mobile WebView API. 37 | 38 | If your Mobile web page depend on WebView API, you should inspect to simulator or physical machine. It's very terrible. All we know api mock program usually support server http api, there has little mock webview api program. 39 | 40 | ## Installation 41 | 42 | ### Docker Compose 43 | 44 | You can easily run animaris using [docker-compose](https://docs.docker.com/compose/). Project have an example config named `docker-compose.yml` for you. You can use it directly or config it. It relies on a number of environment variables that you can set before running `docker-compose up`. The variables are described below. 45 | 46 | ```yaml 47 | version: '2' 48 | 49 | services: 50 | animaris: 51 | image: lizheming/animaris:latest 52 | ports: 53 | - 8360:8360 54 | restart: always 55 | environment: 56 | # mongo database setting 57 | - MONGO_HOST=mongo 58 | - MONGO_PORT=27017 59 | - MONGO_DATABASE=animaris 60 | # If your mongo setting have user auth you should add below enviroment 61 | # - MONGO_USER=admin 62 | # - MONGO_PASSWORD=admin 63 | 64 | mongo: 65 | image: mongo 66 | environment: 67 | # mongo data path 68 | - MONGO_DATA_DIR=/data/db 69 | volumes: 70 | - ./runtime/data:/data/db 71 | command: mongod --smallfiles 72 | ``` 73 | 74 | After run `docker-compose -f docker-composer.yml up`, you can open `http://localhost:8360` to view program. 75 | 76 | ### Normal Install 77 | 78 | If you don't use docker, you also can install it with common method. First of all you should have Node.js v8+, and then clone repo: 79 | 80 | ``` 81 | git clone git@github.com:lizheming/animaris.git 82 | ``` 83 | 84 | Modify `src/config/adapter.js` with your mongo config and then install dependencies. 85 | 86 | ``` 87 | vim +48 src/config/adapter.js 88 | npm install 89 | ``` 90 | 91 | Then compile js and start server. 92 | 93 | ``` 94 | npm run webpack 95 | npm start 96 | ``` 97 | 98 | After start, you can open `http://localhost:8360` to view program. 99 | 100 | ## Documentation 101 | 102 | After start, you can see RESTful APIs documentation at . 103 | 104 | ## Name 105 | 106 | Animaris means machines like humans, that's function same as Mock. 107 | 108 | ## Screenshot 109 | 110 | Documentation List 111 | 112 | ![](https://p0.ssl.qhimg.com/t0194fc9409ff5770e2.jpg) 113 | 114 | Documentation view page 115 | 116 | ![](https://p0.ssl.qhimg.com/t01e4a2090ed1f5aed5.jpg) 117 | 118 | Mock data setting page 119 | 120 | ![](https://p0.ssl.qhimg.com/t015a770a88a74fa694.jpg) 121 | 122 | ## License 123 | 124 | [MIT](https://github.com/lizheming/animaris/blob/master/LICENSE) 125 | -------------------------------------------------------------------------------- /README_zh-CN.md: -------------------------------------------------------------------------------- 1 |
2 | 3 | 4 | 5 | 6 |

Animaris

7 | 8 |
9 | 10 | node version required 11 | 12 | 13 | License 14 | 15 | 16 | MicroBadger Size 17 | 18 | 19 | MicroBadger Layers 20 | 21 | 22 | Chat 23 | 24 |
25 | 26 |

使用 ThinkJS + MongoDB + React + Antd 开发的移动端 WebView 接口文档系统

27 |
28 | 29 | ## 简介 30 | 31 | Animaris 是一个移动端 WebView 接口文档以及接口 Mock 的解决方案,服务端基于 [ThinkJS](https://thinkjs.org) 和 MongoDB,前端使用了 React 和 Antd,另外接口文档部分使用了 Docsify 做适配。该程序主要是解决以下两个问题: 32 | 33 | 1. 移动端接口编写并生成可视化文档 34 | 2. 移动端接口前端开发环境模拟问题 35 | 36 | 移动端页面开发有时候会依赖客户端的接口,此时我们就必须连接真机或者模拟器进行调试,这样颇为麻烦。目前市面上常见的接口 Mock 程序都是模拟 HTTP 服务端请求接口,很少有针对客户端接口进行模拟的。 37 | 38 | ## 安装 39 | 40 | ### Docker Compose 41 | 42 | 使用 [docker-compose](https://docs.docker.com/compose/) 你可以非常轻松的启动 Animaris。项目根目录有一个 `docker-compose.yml` 提供了默认的配置,你可以直接使用它启动也可以自行配置。项目依赖的一些环境变量会在下方进行说明: 43 | 44 | ```yaml 45 | version: '2' 46 | 47 | services: 48 | animaris: 49 | image: lizheming/animaris:latest 50 | ports: 51 | - 8360:8360 52 | restart: always 53 | environment: 54 | # mongo database setting 55 | - MONGO_HOST=mongo 56 | - MONGO_PORT=27017 57 | - MONGO_DATABASE=animaris 58 | # If your mongo setting have user auth you should add below enviroment 59 | # - MONGO_USER=admin 60 | # - MONGO_PASSWORD=admin 61 | 62 | mongo: 63 | image: mongo 64 | environment: 65 | # mongo data path 66 | - MONGO_DATA_DIR=/data/db 67 | volumes: 68 | - ./runtime/data:/data/db 69 | command: mongod --smallfiles 70 | ``` 71 | 修改好后直接执行 `docker-compose -f docker-composer.yml up` 就算启动成功了。之后访问 `http://localhost:8360` 即可访问到程序。 72 | 73 | ### 普通安装 74 | 75 | 如果你没有使用 docker,你也可以用正常的方法安装项目。首先你需要确保有 Node.js v8+,之后克隆仓库: 76 | 77 | ``` 78 | git clone git@github.com:lizheming/animaris.git 79 | ``` 80 | 81 | 修改 `src/config/adapter.js` 文件中的 mongo 配置后安装依赖 82 | 83 | ``` 84 | vim +48 src/config/adapter.js 85 | npm install 86 | ``` 87 | 88 | 编译前端资源之后即可启动服务 89 | 90 | ``` 91 | npm run webpack 92 | npm start 93 | ``` 94 | 95 | 启动后访问 `http://localhost:8360` 即可访问到程序。 96 | 97 | ## 文档 98 | 99 | 接口文档见: 100 | 101 | ## 名字 102 | 103 | Animaris 意为仿生兽,与接口模拟有异曲同工之妙。 104 | 105 | ## 截图 106 | 107 | 文档列表页 108 | 109 | ![](https://p0.ssl.qhimg.com/t0194fc9409ff5770e2.jpg) 110 | 111 | 文档查看页 112 | 113 | ![](https://p0.ssl.qhimg.com/t01e4a2090ed1f5aed5.jpg) 114 | 115 | Mock数据配置页 116 | 117 | ![](https://p0.ssl.qhimg.com/t015a770a88a74fa694.jpg) 118 | 119 | ## License 120 | 121 | [MIT](https://github.com/lizheming/animaris/blob/master/LICENSE) -------------------------------------------------------------------------------- /development.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const Application = require('thinkjs'); 3 | const watcher = require('think-watcher'); 4 | 5 | const instance = new Application({ 6 | ROOT_PATH: __dirname, 7 | APP_PATH: path.join(__dirname, 'src'), 8 | watcher: watcher, 9 | env: 'development' 10 | }); 11 | 12 | instance.run(); 13 | -------------------------------------------------------------------------------- /docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | 3 | services: 4 | animaris: 5 | image: lizheming/animaris:latest 6 | ports: 7 | - 8360:8360 8 | restart: always 9 | environment: 10 | # mongo database setting 11 | - MONGO_HOST=mongo 12 | - MONGO_PORT=27017 13 | - MONGO_DATABASE=animaris 14 | 15 | mongo: 16 | image: mongo 17 | environment: 18 | - MONGO_DATA_DIR=/data/db 19 | volumes: 20 | - ./runtime/data:/data/db 21 | command: mongod --smallfiles 22 | -------------------------------------------------------------------------------- /nginx.conf: -------------------------------------------------------------------------------- 1 | server { 2 | listen 80; 3 | server_name example.com www.example.com; 4 | root /Users/lizheming/Desktop/workspace/360/WebViewMock; 5 | set $node_port 8360; 6 | 7 | index index.js index.html index.htm; 8 | if ( -f $request_filename/index.html ){ 9 | rewrite (.*) $1/index.html break; 10 | } 11 | if ( !-f $request_filename ){ 12 | rewrite (.*) /index.js; 13 | } 14 | location = /index.js { 15 | proxy_http_version 1.1; 16 | proxy_set_header X-Real-IP $remote_addr; 17 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 18 | proxy_set_header Host $http_host; 19 | proxy_set_header X-NginX-Proxy true; 20 | proxy_set_header Upgrade $http_upgrade; 21 | proxy_set_header Connection "upgrade"; 22 | proxy_pass http://127.0.0.1:$node_port$request_uri; 23 | proxy_redirect off; 24 | } 25 | 26 | location ~ /static/ { 27 | etag on; 28 | expires max; 29 | } 30 | } -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Animaris", 3 | "description": "webview api mock", 4 | "version": "1.0.0", 5 | "author": "lizheming ", 6 | "scripts": { 7 | "compile": "webpack --mode=development", 8 | "start": "node development.js", 9 | "test": "THINK_UNIT_TEST=1 nyc ava test/ && nyc report --reporter=html", 10 | "lint": "eslint src/", 11 | "lint-fix": "eslint --fix src/" 12 | }, 13 | "dependencies": { 14 | "css-loader": "^0.28.11", 15 | "less-loader": "^4.1.0", 16 | "phpass": "^0.1.1", 17 | "style-loader": "^0.20.3", 18 | "think-cache": "^1.0.0", 19 | "think-cache-file": "^1.0.8", 20 | "think-logger3": "^1.0.0", 21 | "think-model": "^1.0.0", 22 | "think-model-mysql": "^1.0.0", 23 | "think-mongo": "^1.0.8", 24 | "think-router-rest": "^1.0.4", 25 | "think-session": "^1.0.0", 26 | "think-session-file": "^1.0.5", 27 | "think-view": "^1.0.0", 28 | "think-view-nunjucks": "^1.0.1", 29 | "thinkjs": "^3.0.0" 30 | }, 31 | "devDependencies": { 32 | "@babel/core": "^7.0.0-beta.44", 33 | "@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.44", 34 | "@babel/preset-env": "^7.0.0-beta.44", 35 | "@babel/preset-react": "^7.0.0-beta.44", 36 | "ant-design-pro": "^1.2.1", 37 | "antd": "^3.4.0", 38 | "ava": "^0.18.0", 39 | "babel-loader": "^8.0.0-beta.2", 40 | "babel-plugin-import": "^1.7.0", 41 | "babel-plugin-transform-class-properties": "^6.24.1", 42 | "babel-polyfill": "^6.26.0", 43 | "eslint": "^4.2.0", 44 | "eslint-config-think": "^1.0.0", 45 | "eslint-plugin-react": "^7.7.0", 46 | "extract-text-webpack-plugin": "^4.0.0-beta.0", 47 | "file-loader": "^1.1.11", 48 | "less": "^3.0.1", 49 | "nyc": "^7.0.0", 50 | "react": "^16.3.1", 51 | "react-dom": "^16.3.1", 52 | "react-router-dom": "^4.2.2", 53 | "think-watcher": "^3.0.0", 54 | "url-loader": "^1.0.1", 55 | "webpack": "^4.5.0", 56 | "webpack-cli": "^2.0.14" 57 | }, 58 | "repository": "https://github.com/lizheming/animaris.git", 59 | "license": "MIT", 60 | "engines": { 61 | "node": ">=6.0.0" 62 | }, 63 | "readmeFilename": "README.md", 64 | "thinkjs": { 65 | "metadata": { 66 | "name": "Animaris", 67 | "description": "webview api mock", 68 | "author": "lizheming ", 69 | "babel": false 70 | }, 71 | "projectName": "Animaris", 72 | "templateName": "standard", 73 | "cacheTemplatePath": "/Users/lizheming/.think-templates/standard", 74 | "clone": false, 75 | "isMultiModule": false 76 | }, 77 | "apidoc": { 78 | "title": "Animaris API 接口文档", 79 | "url": "/api", 80 | "sampleUrl": "/api" 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /pm2.json: -------------------------------------------------------------------------------- 1 | { 2 | "apps": [{ 3 | "name": "Animaris", 4 | "script": "production.js", 5 | "cwd": "/var/www/animaris", 6 | "exec_mode": "fork", 7 | "max_memory_restart": "1G", 8 | "autorestart": true, 9 | "node_args": [], 10 | "args": [], 11 | "env": { 12 | 13 | } 14 | }] 15 | } 16 | -------------------------------------------------------------------------------- /production.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const Application = require('thinkjs'); 3 | 4 | const instance = new Application({ 5 | ROOT_PATH: __dirname, 6 | APP_PATH: path.join(__dirname, 'src'), 7 | proxy: true, // use proxy 8 | env: 'production' 9 | }); 10 | 11 | instance.run(); 12 | -------------------------------------------------------------------------------- /src/bootstrap/master.js: -------------------------------------------------------------------------------- 1 | // invoked in master 2 | -------------------------------------------------------------------------------- /src/bootstrap/worker.js: -------------------------------------------------------------------------------- 1 | // invoked in worker 2 | -------------------------------------------------------------------------------- /src/config/adapter.js: -------------------------------------------------------------------------------- 1 | const fileCache = require('think-cache-file'); 2 | const nunjucks = require('think-view-nunjucks'); 3 | const fileSession = require('think-session-file'); 4 | const mysql = require('think-model-mysql'); 5 | const {Console, File, DateFile} = require('think-logger3'); 6 | const path = require('path'); 7 | const isDev = think.env === 'development'; 8 | 9 | /** 10 | * cache adapter config 11 | * @type {Object} 12 | */ 13 | exports.cache = { 14 | type: 'file', 15 | common: { 16 | timeout: 24 * 60 * 60 * 1000 // millisecond 17 | }, 18 | file: { 19 | handle: fileCache, 20 | cachePath: path.join(think.ROOT_PATH, 'runtime/cache'), // absoulte path is necessarily required 21 | pathDepth: 1, 22 | gcInterval: 24 * 60 * 60 * 1000 // gc interval 23 | } 24 | }; 25 | 26 | /** 27 | * model adapter config 28 | * @type {Object} 29 | */ 30 | exports.model = { 31 | type: 'mongo', 32 | common: { 33 | logConnect: isDev, 34 | logSql: isDev, 35 | logger: msg => think.logger.info(msg) 36 | }, 37 | mysql: { 38 | handle: mysql, 39 | database: '', 40 | prefix: 'think_', 41 | encoding: 'utf8', 42 | host: '127.0.0.1', 43 | port: '', 44 | user: 'root', 45 | password: 'root', 46 | dateStrings: true 47 | }, 48 | mongo: { 49 | host: process.env.MONGO_HOST || '127.0.0.1', 50 | port: process.env.MONGO_PORT || 27017, 51 | user: process.env.MONGO_USER || '', 52 | password: process.env.MONGO_PASSWORD || '', 53 | database: process.env.MONGO_DATABASE || 'webview_mock' 54 | } 55 | }; 56 | 57 | /** 58 | * session adapter config 59 | * @type {Object} 60 | */ 61 | exports.session = { 62 | type: 'file', 63 | common: { 64 | cookie: { 65 | name: 'thinkjs' 66 | // keys: ['werwer', 'werwer'], 67 | // signed: true 68 | } 69 | }, 70 | file: { 71 | handle: fileSession, 72 | sessionPath: path.join(think.ROOT_PATH, 'runtime/session') 73 | } 74 | }; 75 | 76 | /** 77 | * view adapter config 78 | * @type {Object} 79 | */ 80 | exports.view = { 81 | type: 'nunjucks', 82 | common: { 83 | viewPath: path.join(think.ROOT_PATH, 'view'), 84 | sep: '_', 85 | extname: '.html' 86 | }, 87 | nunjucks: { 88 | handle: nunjucks, 89 | beforeRender(env, nunjucks) { 90 | env.addGlobal('think', think); 91 | env.addGlobal('JSON', JSON); 92 | } 93 | } 94 | }; 95 | 96 | /** 97 | * logger adapter config 98 | * @type {Object} 99 | */ 100 | exports.logger = { 101 | type: (isDev || process.env.DOCKER) ? 'console' : 'dateFile', 102 | console: { 103 | handle: Console 104 | }, 105 | file: { 106 | handle: File, 107 | backups: 10, // max chunk number 108 | absolute: true, 109 | maxLogSize: 50 * 1024, // 50M 110 | filename: path.join(think.ROOT_PATH, 'logs/app.log') 111 | }, 112 | dateFile: { 113 | handle: DateFile, 114 | level: 'ALL', 115 | absolute: true, 116 | pattern: '-yyyy-MM-dd', 117 | alwaysIncludePattern: true, 118 | filename: path.join(think.ROOT_PATH, 'logs/app.log') 119 | } 120 | }; 121 | -------------------------------------------------------------------------------- /src/config/config.js: -------------------------------------------------------------------------------- 1 | // default config 2 | module.exports = { 3 | workers: 1, 4 | host: '0.0.0.0' 5 | }; 6 | -------------------------------------------------------------------------------- /src/config/config.production.js: -------------------------------------------------------------------------------- 1 | // production config, it will load in production enviroment 2 | module.exports = { 3 | workers: 0 4 | }; 5 | -------------------------------------------------------------------------------- /src/config/extend.js: -------------------------------------------------------------------------------- 1 | const view = require('think-view'); 2 | const model = require('think-model'); 3 | const cache = require('think-cache'); 4 | const session = require('think-session'); 5 | const mongo = require('think-mongo'); 6 | 7 | module.exports = [ 8 | view, // make application support view 9 | model(think.app), 10 | cache, 11 | session, 12 | mongo(think.app) 13 | ]; 14 | -------------------------------------------------------------------------------- /src/config/middleware.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | const routerREST = require('think-router-rest'); 3 | const isDev = think.env === 'development'; 4 | 5 | module.exports = [ 6 | { 7 | handle: 'meta', 8 | options: { 9 | logRequest: isDev, 10 | sendResponseTime: isDev 11 | } 12 | }, 13 | { 14 | handle: 'resource', 15 | options: { 16 | root: path.join(think.ROOT_PATH, 'www'), 17 | publicPath: /^\/(doc|static|favicon\.ico)/ 18 | } 19 | }, 20 | { 21 | handle: 'trace', 22 | enable: !think.isCli, 23 | options: { 24 | debug: isDev, 25 | error(err) { 26 | if (think.isPrevent(err)) { 27 | return false; 28 | } 29 | console.error(err); 30 | } 31 | } 32 | }, 33 | { 34 | handle: 'payload', 35 | options: { 36 | keepExtensions: true, 37 | limit: '5mb' 38 | } 39 | }, 40 | { 41 | handle: 'router', 42 | options: {} 43 | }, 44 | {handle: routerREST}, 45 | 'logic', 46 | { 47 | handle: 'controller', 48 | options: { 49 | emptyController: 'index' 50 | } 51 | } 52 | ]; 53 | -------------------------------------------------------------------------------- /src/config/router.js: -------------------------------------------------------------------------------- 1 | module.exports = [ 2 | [/^\/mock\/([a-z0-9]+)\.js$/i, 'index/mockjs?id=:1'], 3 | [/^\/api\/doc\/([a-z0-9]+)\/user(?:\/(\w+))?/i, 'api/doc/user/:2?id=:1'] 4 | ]; 5 | -------------------------------------------------------------------------------- /src/controller/api/doc.js: -------------------------------------------------------------------------------- 1 | const BaseRest = require('../rest.js'); 2 | 3 | module.exports = class extends BaseRest { 4 | async getAction() { 5 | const {_id: user_id} = this.userInfo; 6 | let data; 7 | if (this.id) { 8 | data = await this.modelInstance.getDoc(user_id, this.id); 9 | } else { 10 | data = await this.modelInstance.getDocs(user_id); 11 | } 12 | 13 | return this.success(data); 14 | } 15 | 16 | async postAction() { 17 | const {_id: user_id} = this.userInfo; 18 | 19 | const pk = this.modelInstance.pk; 20 | const data = this.post(); 21 | delete data[pk]; 22 | if (think.isEmpty(data)) { 23 | return this.fail('data is empty'); 24 | } 25 | 26 | const insertId = await this.modelInstance.addDoc(user_id, data); 27 | return this.success({ id: insertId }); 28 | } 29 | 30 | async putAction() { 31 | if (!this.id) { 32 | return this.fail('params error'); 33 | } 34 | const {_id: user_id} = this.userInfo; 35 | 36 | const pk = this.modelInstance.pk; 37 | const data = this.post(); 38 | data[pk] = this.id; // rewrite data[pk] forbidden data[pk] !== this.id 39 | if (think.isEmpty(data)) { 40 | return this.fail('data is empty'); 41 | } 42 | 43 | const rows = await this.modelInstance.updateDoc(user_id, this.id, data); 44 | return this.success({ affectedRows: rows }); 45 | } 46 | 47 | async deleteAction() { 48 | if (!this.id) { 49 | return this.fail('params error'); 50 | } 51 | 52 | const {_id: user_id} = this.userInfo; 53 | 54 | await this.modelInstance.deleteDoc(user_id, this.id); 55 | return this.success(); 56 | } 57 | }; 58 | -------------------------------------------------------------------------------- /src/controller/api/doc/user.js: -------------------------------------------------------------------------------- 1 | const {ObjectId} = require('mongodb'); 2 | const BaseRest = require('../../rest.js'); 3 | 4 | module.exports = class extends BaseRest { 5 | async getAction() { 6 | const {id: doc_id} = this.get(); 7 | const user_ids = await this.mongo('doc_user').where({doc_id}).select(); 8 | const users = await this.mongo('user').where({_id: { 9 | '$in': user_ids.map(user => ObjectId(user.user_id)) 10 | }}).field('name,email,display_name,_id').select(); 11 | return this.success(users); 12 | } 13 | 14 | async postAction() { 15 | const {id: doc_id} = this.get(); 16 | const user_id = this.id; 17 | 18 | const result = await this.mongo('doc_user').where({doc_id, user_id}).thenAdd({doc_id, user_id}); 19 | return this.success(result); 20 | } 21 | 22 | async putAction() { 23 | const {id: doc_id} = this.get(); 24 | const {user_ids} = this.post(); 25 | 26 | const data = user_ids.map(user_id => ({doc_id, user_id})); 27 | await this.mongo('doc_user').where({doc_id}).delete(); 28 | await this.mongo('doc_user').addMany(data); 29 | return this.success(); 30 | } 31 | 32 | async deleteAction() { 33 | const {id: doc_id} = this.get(); 34 | const user_id = this.id; 35 | 36 | const result = await this.mongo('doc_user').where({doc_id, user_id}).delete(); 37 | return this.success(result); 38 | } 39 | }; 40 | -------------------------------------------------------------------------------- /src/controller/api/markdown.js: -------------------------------------------------------------------------------- 1 | 2 | const BaseRest = require('../rest.js'); 3 | module.exports = class extends BaseRest { 4 | constructor(...args) { 5 | super(...args); 6 | this.modelInstance = this.mongo('doc'); 7 | } 8 | 9 | async getAction() { 10 | if (!this.id) { 11 | this.ctx.body = ''; 12 | return true; 13 | } 14 | 15 | const {type} = this.get(); 16 | const pk = this.modelInstance.pk; 17 | const product = await this.modelInstance.where({[pk]: this.id}).find(); 18 | if (think.isEmpty(product)) { 19 | return this.success(''); 20 | } 21 | 22 | let markdown = ''; 23 | switch (type) { 24 | case 'sidebar': 25 | const {interfaces} = product.data; 26 | const cates = new Map(); 27 | if (!think.isArray(interfaces)) { 28 | break; 29 | } 30 | 31 | for (const api of interfaces) { 32 | if (!cates.has(api.cate)) { 33 | cates.set(api.cate, []); 34 | } 35 | const data = cates.get(api.cate); 36 | data.push(api.name); 37 | cates.set(api.cate, data); 38 | } 39 | 40 | const result = []; 41 | for (const cate of cates.keys()) { 42 | result.push(`* ${cate}`); 43 | for (const name of cates.get(cate)) { 44 | result.push(` * [${name}](?id=${name})`); 45 | } 46 | } 47 | markdown = result.join('\r\n'); 48 | break; 49 | 50 | case 'coverage': 51 | markdown = `![logo](${product.data.avatar}) 52 | # ${product.data.title} 53 | 54 | ${product.data.description} 55 | 56 | [Get Started](#start)`; 57 | break; 58 | 59 | default: 60 | if (!think.isArray(product.data.interfaces)) { 61 | break; 62 | } 63 | markdown = ` 64 | 65 | ${product.data.description} 66 | 67 | ${this.service('markdown').build(product.data)}`; 68 | break; 69 | } 70 | this.ctx.type = 'text/plain'; 71 | this.ctx.body = markdown; 72 | } 73 | }; 74 | -------------------------------------------------------------------------------- /src/controller/api/token.js: -------------------------------------------------------------------------------- 1 | const BaseRest = require('../rest.js'); 2 | module.exports = class extends BaseRest { 3 | async postAction() { 4 | // 校验帐号和密码 5 | const {credential, password} = this.post(); 6 | const userModel = this.mongo('user'); 7 | const userInfo = await userModel.where({ 8 | '$or': [ 9 | {name: credential}, 10 | {email: credential} 11 | ] 12 | }).field('id,email,name,password,display_name,status').find(); 13 | 14 | // 账号不存在或者被删除 15 | if ( 16 | think.isEmpty(userInfo) || 17 | !userModel.checkPassword(userInfo, password) 18 | ) { 19 | return this.fail('ACCOUNT_ERROR'); 20 | } 21 | 22 | delete userInfo.password; 23 | await this.session('userInfo', userInfo); 24 | return this.success(userInfo); 25 | } 26 | 27 | async deleteAction() { 28 | await this.session('userInfo', null); 29 | return this.success(); 30 | } 31 | }; 32 | -------------------------------------------------------------------------------- /src/controller/api/user.js: -------------------------------------------------------------------------------- 1 | 2 | const BaseRest = require('../rest.js'); 3 | module.exports = class extends BaseRest { 4 | constructor(...args) { 5 | super(...args); 6 | this.modelInstance = this.mongo(this.resource); 7 | } 8 | 9 | async getAction() { 10 | const {page, pagesize, keyword} = this.get(); 11 | 12 | let data; 13 | if (this.id) { 14 | const pk = await this.modelInstance.pk; 15 | data = await this.modelInstance.where({[pk]: this.id}).find(); 16 | return this.success(data); 17 | } else if (keyword) { 18 | const reg = new RegExp(keyword, 'i'); 19 | this.modelInstance = this.modelInstance.where({ 20 | '$or': [ 21 | {name: reg}, 22 | {email: reg}, 23 | {display_name: reg} 24 | ] 25 | }); 26 | } 27 | data = await this.modelInstance.page([page, pagesize]).countSelect(); 28 | return this.success(data); 29 | } 30 | 31 | async postAction() { 32 | const data = this.post(); 33 | const insertId = await this.modelInstance.addUser(data, this.ctx.ip); 34 | 35 | if (insertId.type === 'exist') { 36 | return this.fail('USER_EXIST'); 37 | } 38 | 39 | return this.success(insertId); 40 | } 41 | 42 | async putAction() { 43 | if (!this.id) { 44 | return this.fail('MISS USER ID'); 45 | } 46 | 47 | let data = this.post(); 48 | for (const i in data) { 49 | if (!data[i]) { 50 | delete data[i]; 51 | } 52 | } 53 | 54 | data.id = this.id; 55 | data = await this.modelInstance.updateUser(data); 56 | return this.success(data); 57 | } 58 | }; 59 | -------------------------------------------------------------------------------- /src/controller/base.js: -------------------------------------------------------------------------------- 1 | module.exports = class extends think.Controller { 2 | async __before() { 3 | const userInfo = await this.session('userInfo') || {}; 4 | if (think.isEmpty(userInfo)) { 5 | if (this.isAjax()) { 6 | return this.fail('NOT_LOGIN'); 7 | } 8 | } 9 | 10 | this.userInfo = userInfo; 11 | if (!this.isAjax()) { 12 | this.assign('userInfo', { 13 | id: userInfo._id, 14 | name: userInfo.name 15 | }); 16 | } 17 | } 18 | 19 | async __call() { 20 | return this.display('index_index'); 21 | } 22 | }; 23 | -------------------------------------------------------------------------------- /src/controller/index.js: -------------------------------------------------------------------------------- 1 | const Base = require('./base.js'); 2 | 3 | module.exports = class extends Base { 4 | indexAction() { 5 | return this.display('index_index'); 6 | } 7 | 8 | async docAction() { 9 | const {id} = this.get(); 10 | const docModel = this.mongo('doc'); 11 | const pk = docModel.pk; 12 | const doc = await docModel.where({[pk]: id}).find(); 13 | this.assign(doc.data); 14 | this.assign({id}); 15 | return this.display(); 16 | } 17 | 18 | async mockjsAction() { 19 | const {id} = this.get(); 20 | const docModel = this.mongo('doc'); 21 | const pk = docModel.pk; 22 | const doc = await docModel.where({[pk]: id}).find(); 23 | 24 | doc.data.interfaces.forEach(api => { 25 | if (!think.isArray(api.resp)) { 26 | return true; 27 | } 28 | 29 | let resp = api.resp.find(r => r.active); 30 | if (!resp) { 31 | resp = api.resp[0]; 32 | } 33 | if (!resp || !resp.content) { 34 | return true; 35 | } 36 | api.resp = resp.content; 37 | }); 38 | 39 | this.ctx.type = 'application/javascript'; 40 | this.assign({doc: doc.data.interfaces}); 41 | return this.display(); 42 | } 43 | }; 44 | -------------------------------------------------------------------------------- /src/controller/rest.js: -------------------------------------------------------------------------------- 1 | const assert = require('assert'); 2 | 3 | module.exports = class extends think.Controller { 4 | static get _REST() { 5 | return true; 6 | } 7 | 8 | constructor(ctx) { 9 | super(ctx); 10 | this.resource = this.getResource(); 11 | this.id = this.getId(); 12 | assert(think.isFunction(this.model), 'this.model must be a function'); 13 | this.modelInstance = this.mongo(this.resource); 14 | } 15 | async __before() { 16 | const userInfo = await this.session('userInfo') || {}; 17 | this.userInfo = userInfo; 18 | } 19 | /** 20 | * get resource 21 | * @return {String} [resource name] 22 | */ 23 | getResource() { 24 | return this.ctx.controller.split('/').pop(); 25 | } 26 | 27 | getId() { 28 | const id = this.get('id'); 29 | if (id && (think.isString(id) || think.isNumber(id))) { 30 | return id; 31 | } 32 | const last = this.ctx.path.split('/').slice(-1)[0]; 33 | if (last !== this.resource) { 34 | return last; 35 | } 36 | return ''; 37 | } 38 | async getAction() { 39 | let data; 40 | if (this.id) { 41 | const pk = this.modelInstance.pk; 42 | data = await this.modelInstance.where({ [pk]: this.id }).find(); 43 | return this.success(data); 44 | } 45 | data = await this.modelInstance.select(); 46 | return this.success(data); 47 | } 48 | /** 49 | * put resource 50 | * @return {Promise} [] 51 | */ 52 | async postAction() { 53 | const pk = this.modelInstance.pk; 54 | const data = this.post(); 55 | delete data[pk]; 56 | if (think.isEmpty(data)) { 57 | return this.fail('data is empty'); 58 | } 59 | const insertId = await this.modelInstance.add(data); 60 | return this.success({ id: insertId }); 61 | } 62 | /** 63 | * delete resource 64 | * @return {Promise} [] 65 | */ 66 | async deleteAction() { 67 | if (!this.id) { 68 | return this.fail('params error'); 69 | } 70 | const pk = this.modelInstance.pk; 71 | const rows = await this.modelInstance.where({ [pk]: this.id }).delete(); 72 | return this.success({ affectedRows: rows }); 73 | } 74 | /** 75 | * update resource 76 | * @return {Promise} [] 77 | */ 78 | async putAction() { 79 | if (!this.id) { 80 | return this.fail('params error'); 81 | } 82 | const pk = this.modelInstance.pk; 83 | const data = this.post(); 84 | data[pk] = this.id; // rewrite data[pk] forbidden data[pk] !== this.id 85 | if (think.isEmpty(data)) { 86 | return this.fail('data is empty'); 87 | } 88 | const rows = await this.modelInstance.where({ [pk]: this.id }).update(data); 89 | return this.success({ affectedRows: rows }); 90 | } 91 | __call() {} 92 | }; 93 | -------------------------------------------------------------------------------- /src/extend/controller.js: -------------------------------------------------------------------------------- 1 | module.exports = { 2 | success(...args) { 3 | this.ctx.success(...args); 4 | return think.prevent(); 5 | }, 6 | fail(...args) { 7 | this.ctx.fail(...args); 8 | return think.prevent(); 9 | } 10 | }; 11 | -------------------------------------------------------------------------------- /src/extend/think.js: -------------------------------------------------------------------------------- 1 | const preventMessage = 'PREVENT_NEXT_PROCESS'; 2 | module.exports = { 3 | prevent() { 4 | throw new Error(preventMessage); 5 | }, 6 | isPrevent(err) { 7 | return think.isError(err) && err.message === preventMessage; 8 | } 9 | }; 10 | -------------------------------------------------------------------------------- /src/logic/api/base.js: -------------------------------------------------------------------------------- 1 | module.exports = class extends think.Logic { 2 | async __before() { 3 | const userInfo = await this.session('userInfo') || {}; 4 | if (think.isEmpty(userInfo)) { 5 | this.fail('USER_NOT_LOGIN'); 6 | } 7 | this.userInfo = userInfo; 8 | } 9 | 10 | /** 11 | * get resource 12 | * @return {String} [resource name] 13 | */ 14 | get resource() { 15 | const filename = this.ctx.controller; 16 | return filename.split('/').pop(); 17 | } 18 | 19 | get id() { 20 | const id = this.get('id'); 21 | if (id && (think.isString(id) || think.isNumber(id))) { 22 | return parseInt(id); 23 | } 24 | const last = decodeURIComponent(this.ctx.path.split('/').pop()); 25 | if (last !== this.resource && /^(\d+,?)*$/.test(last)) { 26 | return last; 27 | } 28 | return undefined; 29 | } 30 | }; 31 | -------------------------------------------------------------------------------- /src/logic/api/doc.js: -------------------------------------------------------------------------------- 1 | const Base = require('./base'); 2 | module.exports = class extends Base { 3 | /** 4 | * @api {GET} /doc 获取文档列表 5 | * @apiGroup Doc 6 | * @apiVersion 0.0.1 7 | * 8 | * @apiParam {String} page 页数 9 | * @apiParam {String} pagesize 分页大小 10 | */ 11 | /** 12 | * @api {GET} /doc/:id 获取文档内容 13 | * @apiGroup Doc 14 | * @apiVersion 0.0.1 15 | */ 16 | getAction() { 17 | this.rules = { 18 | page: { 19 | int: true 20 | }, 21 | pagesize: { 22 | int: true, 23 | default: 10 24 | } 25 | }; 26 | } 27 | 28 | /** 29 | * @api {POST} /doc 添加文档 30 | * @apiGroup Doc 31 | * @apiVersion 0.0.1 32 | * 33 | * @apiParam {Object} data 文档数据 34 | */ 35 | postAction() { 36 | } 37 | 38 | /** 39 | * @api {PUT} /doc/:id 修改文档 40 | * @apiGroup Doc 41 | * @apiVersion 0.0.1 42 | * 43 | * @apiParam {Object} data 文档数据 44 | */ 45 | putAction() { 46 | } 47 | /** 48 | * @api {DELETE} /doc/:id 删除文档 49 | * @apiGroup Doc 50 | * @apiVersion 0.0.1 51 | */ 52 | deleteAction() {} 53 | }; 54 | -------------------------------------------------------------------------------- /src/logic/api/doc/user.js: -------------------------------------------------------------------------------- 1 | const Base = require('../base'); 2 | module.exports = class extends Base { 3 | async __before(...args) { 4 | await Base.prototype.__before.call(this, ...args); 5 | 6 | const {id: doc_id} = this.get(); 7 | const {_id: user_id} = this.userInfo; 8 | 9 | const result = this.mongo('doc_user').where({doc_id, user_id}).find(); 10 | if (think.isEmpty(result)) { 11 | return this.fail('NO ACCESS'); 12 | } 13 | } 14 | 15 | putAction() { 16 | this.rules = { 17 | user_ids: { 18 | required: true, 19 | array: true 20 | } 21 | }; 22 | } 23 | }; 24 | -------------------------------------------------------------------------------- /src/logic/api/markdown.js: -------------------------------------------------------------------------------- 1 | module.exports = class extends think.Logic { 2 | /** 3 | * @api {GET} /markdown/:id 获取文档的 markdown 格式 4 | * @apiGroup Doc 5 | * @apiVersion 0.0.1 6 | */ 7 | }; 8 | -------------------------------------------------------------------------------- /src/logic/api/token.js: -------------------------------------------------------------------------------- 1 | module.exports = class extends think.Logic { 2 | /** 3 | * @api {POST} /token 用户登录 4 | * @apiGroup User 5 | * @apiVersion 0.0.1 6 | * 7 | * @apiParam {String} credential 用户名或者密码 8 | * @apiParam {String} password 用户密码 9 | */ 10 | async postAction() { 11 | this.rules = { 12 | credential: { 13 | required: true, 14 | string: true 15 | }, 16 | password: { 17 | required: true, 18 | string: true, 19 | length: {min: 8, max: 20} 20 | } 21 | }; 22 | } 23 | 24 | /** 25 | * @api {DELETE} /token 用户登出 26 | * @apiGroup User 27 | * @apiVersion 0.0.1 28 | */ 29 | deleteAction() { 30 | 31 | } 32 | }; 33 | -------------------------------------------------------------------------------- /src/logic/api/user.js: -------------------------------------------------------------------------------- 1 | const Base = require('./base'); 2 | module.exports = class extends Base { 3 | async __before(...args) { 4 | if (!this.isPost) { 5 | await Base.prototype.__before.call(this, ...args); 6 | } 7 | } 8 | /** 9 | * @api {GET} /user 获取用户列表 10 | * @apiGroup User 11 | * @apiVersion 0.0.1 12 | * 13 | * @apiParam {String} keyword 搜索关键词 14 | * @apiParam {String} page 页数 15 | * @apiParam {String} pagesize 分页大小 16 | */ 17 | getAction() { 18 | this.rules = { 19 | page: { 20 | int: true 21 | // default: 1 22 | }, 23 | pagesize: { 24 | int: true, 25 | default: 10 26 | } 27 | }; 28 | } 29 | /** 30 | * @api {POST} /user 用户注册 31 | * @apiGroup User 32 | * @apiVersion 0.0.1 33 | * 34 | * @apiParam {String} name 用户 ID 35 | * @apiParam {String} display_name 用户昵称 36 | * @apiParam {String} email 用户邮箱 37 | * @apiParam {String} password 用户密码 38 | */ 39 | postAction() { 40 | this.rules = { 41 | name: { 42 | required: true, 43 | string: true, 44 | regexp: /[a-z0-9-_.]{4,}/i 45 | }, 46 | display_name: { 47 | required: true, 48 | string: true, 49 | length: {min: 4, max: 10} 50 | }, 51 | email: { 52 | required: true, 53 | email: true 54 | }, 55 | password: { 56 | required: true, 57 | string: true, 58 | length: {min: 8, max: 20} 59 | }, 60 | status: { 61 | int: true, 62 | value: 0 63 | } 64 | }; 65 | } 66 | 67 | /** 68 | * @api {DELETE} /user/:id 用户删除 69 | * @apiGroup User 70 | * @apiVersion 0.0.1 71 | */ 72 | deleteAction() { 73 | } 74 | 75 | /** 76 | * @api {PUT} /user/:id 更新用户信息 77 | * @apiGroup User 78 | * @apiVersion 0.0.1 79 | * 80 | * @apiParam {String} display_name 用户昵称 81 | * @apiParam {String} password 用户密码 82 | * @apiParam {String} status 用户状态 83 | */ 84 | putAction() { 85 | if (!this.id) { 86 | return this.fail('MISS_ID'); 87 | } 88 | 89 | this.rules = { 90 | display_name: { 91 | string: true, 92 | length: {min: 4, max: 10} 93 | }, 94 | password: { 95 | string: true, 96 | length: {min: 8, max: 20} 97 | }, 98 | status: { 99 | int: true 100 | } 101 | }; 102 | } 103 | }; 104 | -------------------------------------------------------------------------------- /src/logic/index.js: -------------------------------------------------------------------------------- 1 | module.exports = class extends think.Logic { 2 | indexAction() { 3 | 4 | } 5 | 6 | docAction() { 7 | this.rules = { 8 | id: { 9 | required: true, 10 | string: true 11 | } 12 | }; 13 | } 14 | }; 15 | -------------------------------------------------------------------------------- /src/model/doc.js: -------------------------------------------------------------------------------- 1 | const {ObjectId} = require('mongodb'); 2 | module.exports = class extends think.Mongo { 3 | async getDocIds(user_id) { 4 | const data = await think.mongo('doc_user').where({user_id}).select(); 5 | if (think.isEmpty(data)) { 6 | return []; 7 | } 8 | return data.map(item => item.doc_id); 9 | } 10 | 11 | async getDocs(user_id) { 12 | const docIds = await this.getDocIds(user_id); 13 | return this.where({ 14 | [this.pk]: { 15 | '$in': docIds.map(id => ObjectId(id)) 16 | } 17 | }).select(); 18 | } 19 | 20 | async getDoc(user_id, doc_id) { 21 | const docIds = await this.getDocIds(user_id); 22 | if (!docIds.includes(doc_id)) { 23 | return null; 24 | } 25 | 26 | return this.where({[this.pk]: ObjectId(doc_id)}).find(); 27 | } 28 | 29 | async addDoc(user_id, data) { 30 | const doc_id = await this.add(data); 31 | await think.mongo('doc_user').add({user_id, doc_id}); 32 | return doc_id; 33 | } 34 | 35 | async updateDoc(user_id, doc_id, data) { 36 | const docIds = await this.getDocIds(user_id); 37 | if (!docIds.includes(doc_id)) { 38 | return null; 39 | } 40 | 41 | return this.where({[this.pk]: ObjectId(doc_id)}).update(data); 42 | } 43 | 44 | async deleteDoc(user_id, doc_id) { 45 | const docIds = await this.getDocIds(user_id); 46 | if (!docIds.includes(doc_id)) { 47 | return false; 48 | } 49 | 50 | await this.where({[this.pk]: ObjectId(doc_id)}).delete(); 51 | await think.mongo('doc_user').where({user_id, doc_id}).delete(); 52 | return true; 53 | } 54 | }; 55 | -------------------------------------------------------------------------------- /src/model/user.js: -------------------------------------------------------------------------------- 1 | 2 | const {PasswordHash} = require('phpass'); 3 | 4 | module.exports = class extends think.Mongo { 5 | getEncryptPassword(password) { 6 | const passwordHash = new PasswordHash(); 7 | const hash = passwordHash.hashPassword(password); 8 | return hash; 9 | } 10 | 11 | checkPassword(userInfo, password) { 12 | const passwordHash = new PasswordHash(); 13 | return passwordHash.checkPassword(password, userInfo.password); 14 | } 15 | 16 | addUser(data, ip) { 17 | const date = think.datetime(); 18 | const encryptPassword = this.getEncryptPassword(data.password); 19 | return this.where({ 20 | '$or': [ 21 | {name: data.name}, 22 | {email: data.email} 23 | ] 24 | }).thenAdd({ 25 | name: data.name, 26 | email: data.email, 27 | display_name: data.display_name, 28 | password: encryptPassword, 29 | create_time: date, 30 | last_login_time: date, 31 | create_ip: ip, 32 | last_login_ip: ip, 33 | status: data.status 34 | }); 35 | } 36 | 37 | updateUser(data) { 38 | if (data.password) { 39 | data.password = this.getEncryptPassword(data.password); 40 | } 41 | 42 | return this.where({[this.pk]: data.id}).update(data); 43 | } 44 | }; 45 | -------------------------------------------------------------------------------- /src/service/markdown.js: -------------------------------------------------------------------------------- 1 | const down = { 2 | h(text, size = 2) { 3 | return `${'#'.repeat(size)} ${text}`; 4 | }, 5 | p(text) { 6 | return `${text} `; 7 | }, 8 | args(data) { 9 | const mk = data.map(([name, should, type, desc]) => `| ${name} | ${should} | ${type} | ${desc} |`); 10 | return `|参数名称|必填|参数类型|备注| 11 | |----|--|----|--| 12 | ${mk.join('\r\n')}`; 13 | }, 14 | code(code) { 15 | return `\`\`\`javascript 16 | ${code} 17 | \`\`\``; 18 | } 19 | }; 20 | 21 | module.exports = class extends think.Service { 22 | callFormatRender(str, data) { 23 | return str.replace(/\${(\w+)}/g, (a, b) => data[b]); 24 | } 25 | 26 | buildCallExample(api) { 27 | let code = '$'; 28 | code += api.name; 29 | code += ':'; 30 | 31 | // const args = {}; 32 | // if (typeof api.args === 'object') { 33 | // for (var i in api.args) { 34 | // args[i] = api.args[i].value; 35 | // } 36 | // } 37 | const args = api.args.length ? api.args.reduce((v, o) => { 38 | if (o.name && o.type === 'callback' && !o.value) { 39 | o.value = 'fn'; 40 | } 41 | v[o.name] = o.value; 42 | return v; 43 | }, {}) : {}; 44 | 45 | // 调用格式和普通格式不一样的时候 46 | if (api.format) { 47 | return `console.log('${this.callFormatRender(api.format, args)}');`; 48 | } 49 | 50 | if (args.callback) { 51 | return `console.log('${code}{callback: ${args.callback}}');`; 52 | } 53 | 54 | return `console.log('${code}${think.isEmpty(args) ? '' : JSON.stringify(args)}');`; 55 | } 56 | 57 | buildRespExample(api) { 58 | let callback = api.callback; 59 | if (!callback) { 60 | if (api.args.length) { 61 | const cb = api.args.find(arg => arg.name === 'callback'); 62 | if (cb) { 63 | callback = cb.value || 'fn'; 64 | } 65 | } 66 | } 67 | if (!callback) { 68 | return ''; 69 | } 70 | // const callback = api.callback || (api.args && api.args.callback && api.args.callback.value); 71 | 72 | return `function ${callback}(resp) { 73 | console.log(resp); 74 | } 75 | //输出 76 | ${JSON.stringify(api.resp[0].content, null, ' ')} 77 | `; 78 | } 79 | build({interfaces: apis}) { 80 | const result = []; 81 | for (const api of apis) { 82 | const cate = down.h(api.cate); 83 | if (!result.includes(cate)) { 84 | result.push(cate); 85 | } 86 | result.push(down.h(api.name)); 87 | result.push(down.p(api.desc)); 88 | 89 | if (api.args.length) { 90 | result.push(down.h('参数说明:', 5)); 91 | result.push(down.args(api.args.sort((a, b) => { 92 | const aRequired = a.required !== false; 93 | const bRequired = b.required !== false; 94 | if (aRequired === bRequired) { 95 | return 0; 96 | } 97 | 98 | if (aRequired && !bRequired) { 99 | return -1; 100 | } 101 | 102 | if (!aRequired && bRequired) { 103 | return 1; 104 | } 105 | }).map(arg => ([ 106 | arg.name, 107 | arg.required === false ? 'N' : 'Y', 108 | arg.type, 109 | arg.description || '无' 110 | ])))); 111 | } 112 | result.push(down.h('调用示例:', 5)); 113 | result.push(down.code(this.buildCallExample(api))); 114 | 115 | if (api.resp.length && api.resp[0].content) { 116 | result.push(down.h('响应示例:', 5)); 117 | result.push(down.code(this.buildRespExample(api))); 118 | } 119 | } 120 | return result.join('\r\n'); 121 | } 122 | }; 123 | -------------------------------------------------------------------------------- /test/index.js: -------------------------------------------------------------------------------- 1 | const test = require('ava'); 2 | const path = require('path'); 3 | require(path.join(process.cwd(), 'production.js')); 4 | 5 | test('first test', t => { 6 | const indexModel = think.model('index'); 7 | }) 8 | -------------------------------------------------------------------------------- /view/index_doc.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | {{title}} 6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 26 | 27 | 28 | 29 | 30 | -------------------------------------------------------------------------------- /view/index_index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 9 | 10 | 11 |
12 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /view/index_mockjs.html: -------------------------------------------------------------------------------- 1 | const api = {{JSON.stringify(doc) | safe}}; 2 | 3 | class Mock { 4 | constructor(text) { 5 | this.data = this.parse(text); 6 | this.run(); 7 | } 8 | 9 | parse(text) { 10 | const matches = text.trim().match(/^\$(\w+)\:\s*({.+})$/i); 11 | if (!Array.isArray(matches)) { 12 | return false; 13 | } 14 | 15 | const [_, name, args] = matches; 16 | 17 | const cbReg = /^{(callback):\s*([^\s]+)\s*}$/i; 18 | if (cbReg.test(args)) { 19 | const [_, argName, argVal] = args.match(cbReg); 20 | return { 21 | name, 22 | args: { 23 | [argName]: argVal 24 | } 25 | }; 26 | } 27 | 28 | const result = {name}; 29 | try { 30 | result.args = JSON.parse(`(${args})`); 31 | } catch (e) { 32 | result.args = args; 33 | } 34 | 35 | return result; 36 | } 37 | 38 | run() { 39 | if (!this.data) { 40 | return; 41 | } 42 | 43 | this.log(this.data); 44 | const index = api.findIndex(({name}) => name === this.data.name); 45 | if (index === -1) { 46 | return; 47 | } 48 | // TODO: 校验参数格式 49 | 50 | // 若需要执行回调就执行回调 51 | // 动态指定的 52 | const {callback} = this.data.args; 53 | if (callback && typeof window[callback] === 'function') { 54 | window[callback](api[index].resp); 55 | } 56 | 57 | // 固定回调的 58 | if (api[index].callback && typeof window[api[index].callback] === 'function') { 59 | window[api[index].callback](api[index].resp); 60 | } 61 | } 62 | 63 | log(...args) { 64 | if (!console._debug) { 65 | return; 66 | } 67 | 68 | return console.warn(`[APIMock] --`, ...args); 69 | } 70 | } 71 | 72 | console._log = console.log; 73 | console.log = function(text, ...args) { 74 | if(typeof text === 'string') { 75 | new Mock(text); 76 | } 77 | return console._log(text, ...args); 78 | }; 79 | 80 | console._debug = true; 81 | // console.log('$isLogin:{callback: $COMMENT_NATIVE_CALLBACK100}'); 82 | // console.log('$apullRequestRelateAd:{"requestId":"relate_ad","mv_ext":{"gnid":"99258f4635a05b5d0"}}'); 83 | 84 | // http://dev.m.look.360.cn:8082/transcoding?url=http%3A%2F%2Fzm.news.so.com%2F5c4f9e415bc9765aa7f3a59e9837fd07&check=dcf663552b9e7f8a&uid=73tpefn6d8b6nwdpir7ao04h1kjprt4z&sign=wap&market=nh00002&stype=portal&tj_cmode=wap&v=1&sv=1&templetctl=7&360newsdetail=1&articlety=zmt&hsitetype=1&ucheck=6aa803dc5abc52b4a192421579c78519&hscmt=1&mock=1 85 | -------------------------------------------------------------------------------- /webpack.config.js: -------------------------------------------------------------------------------- 1 | const path = require('path'); 2 | // const webpack = require('webpack'); 3 | const ExtractTextPlugin = require('extract-text-webpack-plugin'); 4 | 5 | const src = path.join(__dirname, 'www/static/src'); 6 | module.exports = { 7 | entry: { 8 | home: ['babel-polyfill', path.join(src, 'index.jsx')] 9 | }, 10 | output: { 11 | path: path.join(src, '../js'), 12 | filename: '[name].js', 13 | publicPath: '/static/js/', 14 | chunkFilename: '[name].js' 15 | }, 16 | resolve: { 17 | extensions: ['.js', '.jsx', '.json'] 18 | }, 19 | module: { 20 | noParse: [/moment.js/], 21 | rules: [ 22 | { 23 | test: /\.jsx?$/, 24 | exclude: /node_modules/, 25 | use: 'babel-loader' 26 | }, 27 | { 28 | test: /\.less$/, 29 | use: [{ 30 | loader: 'style-loader' // creates style nodes from JS strings 31 | }, { 32 | loader: 'css-loader' // translates CSS into CommonJS 33 | }, { 34 | loader: 'less-loader', // compiles Less to CSS 35 | options: { 36 | javascriptEnabled: true 37 | } 38 | }] 39 | }, 40 | { 41 | test: /\.css$/, 42 | use: ExtractTextPlugin.extract({ 43 | fallback: 'style-loader', 44 | use: [ 45 | {loader: 'css-loader', options: {minimize: true}} 46 | ] 47 | }) 48 | }, 49 | 50 | { 51 | test: /\.woff(\?v=\d+\.\d+\.\d+)?$/, 52 | loader: 'url-loader', 53 | options: { 54 | limit: 10000, 55 | minetype: 'application/font-woff' 56 | } 57 | }, 58 | { 59 | test: /\.woff2(\?v=\d+\.\d+\.\d+)?$/, 60 | loader: 'url-loader', 61 | options: { 62 | limit: 10000, 63 | minetype: 'application/font-woff' 64 | } 65 | }, 66 | { 67 | test: /\.ttf(\?v=\d+\.\d+\.\d+)?$/, 68 | loader: 'url-loader', 69 | options: { 70 | limit: 10000, 71 | minetype: 'application/octet-stream' 72 | } 73 | }, 74 | { test: /\.eot(\?v=\d+\.\d+\.\d+)?$/, 75 | loader: 'url-loader', 76 | options: { 77 | limit: 10000, 78 | minetype: 'application/vnd.ms-fontobject' 79 | } 80 | }, 81 | { 82 | test: /\.svg(\?v=\d+\.\d+\.\d+)?$/, 83 | loader: 'url-loader', 84 | options: { 85 | limit: 10000, 86 | minetype: 'image/svg+xml' 87 | } 88 | }, 89 | { 90 | test: /\.(png|jpg|jpeg|gif)(\?v=\d+\.\d+\.\d+)?$/i, 91 | loader: 'url-loader', 92 | options: { 93 | limit: 10000 94 | } 95 | }, 96 | { 97 | test: /\.html?$/, 98 | loader: 'file-loader', 99 | options: { 100 | name: '[name].[ext]' 101 | } 102 | } 103 | ] 104 | }, 105 | plugins: [ 106 | // new webpack.optimize.splitChunks({ 107 | // name: 'common', 108 | // filename: 'common.js' 109 | // }), 110 | new ExtractTextPlugin('../css/base.css') 111 | ] 112 | }; 113 | -------------------------------------------------------------------------------- /www/doc/api_data.js: -------------------------------------------------------------------------------- 1 | define({ "api": [ { "type": "DELETE", "url": "/doc/:id", "title": "删除文档", "group": "Doc", "version": "0.0.1", "filename": "src/logic/api/doc.js", "groupTitle": "Doc", "name": "DeleteDocId", "sampleRequest": [ { "url": "/api/doc/:id" } ] }, { "type": "GET", "url": "/doc", "title": "获取文档列表", "group": "Doc", "version": "0.0.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "page", "description": "

页数

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "pagesize", "description": "

分页大小

" } ] } }, "filename": "src/logic/api/doc.js", "groupTitle": "Doc", "name": "GetDoc", "sampleRequest": [ { "url": "/api/doc" } ] }, { "type": "GET", "url": "/doc/:id", "title": "获取文档内容", "group": "Doc", "version": "0.0.1", "filename": "src/logic/api/doc.js", "groupTitle": "Doc", "name": "GetDocId", "sampleRequest": [ { "url": "/api/doc/:id" } ] }, { "type": "POST", "url": "/doc", "title": "添加文档", "group": "Doc", "version": "0.0.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Object", "optional": false, "field": "data", "description": "

文档数据

" } ] } }, "filename": "src/logic/api/doc.js", "groupTitle": "Doc", "name": "PostDoc", "sampleRequest": [ { "url": "/api/doc" } ] }, { "type": "PUT", "url": "/doc/:id", "title": "修改文档", "group": "Doc", "version": "0.0.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Object", "optional": false, "field": "data", "description": "

文档数据

" } ] } }, "filename": "src/logic/api/doc.js", "groupTitle": "Doc", "name": "PutDocId", "sampleRequest": [ { "url": "/api/doc/:id" } ] }, { "type": "DELETE", "url": "/token", "title": "用户登出", "group": "User", "version": "0.0.1", "filename": "src/logic/api/token.js", "groupTitle": "User", "name": "DeleteToken", "sampleRequest": [ { "url": "/api/token" } ] }, { "type": "DELETE", "url": "/user/:id", "title": "用户删除", "group": "User", "version": "0.0.1", "filename": "src/logic/api/user.js", "groupTitle": "User", "name": "DeleteUserId", "sampleRequest": [ { "url": "/api/user/:id" } ] }, { "type": "GET", "url": "/user", "title": "获取用户列表", "group": "User", "version": "0.0.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "keyword", "description": "

搜索关键词

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "page", "description": "

页数

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "pagesize", "description": "

分页大小

" } ] } }, "filename": "src/logic/api/user.js", "groupTitle": "User", "name": "GetUser", "sampleRequest": [ { "url": "/api/user" } ] }, { "type": "POST", "url": "/token", "title": "用户登录", "group": "User", "version": "0.0.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "credential", "description": "

用户名或者密码

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "password", "description": "

用户密码

" } ] } }, "filename": "src/logic/api/token.js", "groupTitle": "User", "name": "PostToken", "sampleRequest": [ { "url": "/api/token" } ] }, { "type": "POST", "url": "/user", "title": "用户注册", "group": "User", "version": "0.0.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "

用户 ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "display_name", "description": "

用户昵称

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "email", "description": "

用户邮箱

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "password", "description": "

用户密码

" } ] } }, "filename": "src/logic/api/user.js", "groupTitle": "User", "name": "PostUser", "sampleRequest": [ { "url": "/api/user" } ] }, { "type": "PUT", "url": "/user/:id", "title": "更新用户信息", "group": "User", "version": "0.0.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "display_name", "description": "

用户昵称

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "password", "description": "

用户密码

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "status", "description": "

用户状态

" } ] } }, "filename": "src/logic/api/user.js", "groupTitle": "User", "name": "PutUserId", "sampleRequest": [ { "url": "/api/user/:id" } ] } ] }); 2 | -------------------------------------------------------------------------------- /www/doc/api_data.json: -------------------------------------------------------------------------------- 1 | [ { "type": "DELETE", "url": "/doc/:id", "title": "删除文档", "group": "Doc", "version": "0.0.1", "filename": "src/logic/api/doc.js", "groupTitle": "Doc", "name": "DeleteDocId", "sampleRequest": [ { "url": "/api/doc/:id" } ] }, { "type": "GET", "url": "/doc", "title": "获取文档列表", "group": "Doc", "version": "0.0.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "page", "description": "

页数

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "pagesize", "description": "

分页大小

" } ] } }, "filename": "src/logic/api/doc.js", "groupTitle": "Doc", "name": "GetDoc", "sampleRequest": [ { "url": "/api/doc" } ] }, { "type": "GET", "url": "/doc/:id", "title": "获取文档内容", "group": "Doc", "version": "0.0.1", "filename": "src/logic/api/doc.js", "groupTitle": "Doc", "name": "GetDocId", "sampleRequest": [ { "url": "/api/doc/:id" } ] }, { "type": "POST", "url": "/doc", "title": "添加文档", "group": "Doc", "version": "0.0.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Object", "optional": false, "field": "data", "description": "

文档数据

" } ] } }, "filename": "src/logic/api/doc.js", "groupTitle": "Doc", "name": "PostDoc", "sampleRequest": [ { "url": "/api/doc" } ] }, { "type": "PUT", "url": "/doc/:id", "title": "修改文档", "group": "Doc", "version": "0.0.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Object", "optional": false, "field": "data", "description": "

文档数据

" } ] } }, "filename": "src/logic/api/doc.js", "groupTitle": "Doc", "name": "PutDocId", "sampleRequest": [ { "url": "/api/doc/:id" } ] }, { "type": "DELETE", "url": "/token", "title": "用户登出", "group": "User", "version": "0.0.1", "filename": "src/logic/api/token.js", "groupTitle": "User", "name": "DeleteToken", "sampleRequest": [ { "url": "/api/token" } ] }, { "type": "DELETE", "url": "/user/:id", "title": "用户删除", "group": "User", "version": "0.0.1", "filename": "src/logic/api/user.js", "groupTitle": "User", "name": "DeleteUserId", "sampleRequest": [ { "url": "/api/user/:id" } ] }, { "type": "GET", "url": "/user", "title": "获取用户列表", "group": "User", "version": "0.0.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "keyword", "description": "

搜索关键词

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "page", "description": "

页数

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "pagesize", "description": "

分页大小

" } ] } }, "filename": "src/logic/api/user.js", "groupTitle": "User", "name": "GetUser", "sampleRequest": [ { "url": "/api/user" } ] }, { "type": "POST", "url": "/token", "title": "用户登录", "group": "User", "version": "0.0.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "credential", "description": "

用户名或者密码

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "password", "description": "

用户密码

" } ] } }, "filename": "src/logic/api/token.js", "groupTitle": "User", "name": "PostToken", "sampleRequest": [ { "url": "/api/token" } ] }, { "type": "POST", "url": "/user", "title": "用户注册", "group": "User", "version": "0.0.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "

用户 ID

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "display_name", "description": "

用户昵称

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "email", "description": "

用户邮箱

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "password", "description": "

用户密码

" } ] } }, "filename": "src/logic/api/user.js", "groupTitle": "User", "name": "PostUser", "sampleRequest": [ { "url": "/api/user" } ] }, { "type": "PUT", "url": "/user/:id", "title": "更新用户信息", "group": "User", "version": "0.0.1", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "display_name", "description": "

用户昵称

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "password", "description": "

用户密码

" }, { "group": "Parameter", "type": "String", "optional": false, "field": "status", "description": "

用户状态

" } ] } }, "filename": "src/logic/api/user.js", "groupTitle": "User", "name": "PutUserId", "sampleRequest": [ { "url": "/api/user/:id" } ] } ] 2 | -------------------------------------------------------------------------------- /www/doc/api_project.js: -------------------------------------------------------------------------------- 1 | define({ "title": "WebViewMock API 接口文档", "url": "/api", "sampleUrl": "/api", "name": "WebViewMock", "version": "1.0.0", "description": "webview api mock", "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2018-04-15T14:22:42.837Z", "url": "http://apidocjs.com", "version": "0.17.5" } }); 2 | -------------------------------------------------------------------------------- /www/doc/api_project.json: -------------------------------------------------------------------------------- 1 | { "title": "WebViewMock API 接口文档", "url": "/api", "sampleUrl": "/api", "name": "WebViewMock", "version": "1.0.0", "description": "webview api mock", "defaultVersion": "0.0.0", "apidoc": "0.3.0", "generator": { "name": "apidoc", "time": "2018-04-15T14:22:42.837Z", "url": "http://apidocjs.com", "version": "0.17.5" } } 2 | -------------------------------------------------------------------------------- /www/doc/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizheming/animaris/6151225a7c7304791a369cd561acfa37147d704f/www/doc/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /www/doc/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizheming/animaris/6151225a7c7304791a369cd561acfa37147d704f/www/doc/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /www/doc/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizheming/animaris/6151225a7c7304791a369cd561acfa37147d704f/www/doc/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /www/doc/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizheming/animaris/6151225a7c7304791a369cd561acfa37147d704f/www/doc/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /www/doc/img/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizheming/animaris/6151225a7c7304791a369cd561acfa37147d704f/www/doc/img/favicon.ico -------------------------------------------------------------------------------- /www/doc/locales/ca.js: -------------------------------------------------------------------------------- 1 | define({ 2 | ca: { 3 | 'Allowed values:' : 'Valors permesos:', 4 | 'Compare all with predecessor': 'Comparar tot amb versió anterior', 5 | 'compare changes to:' : 'comparar canvis amb:', 6 | 'compared to' : 'comparat amb', 7 | 'Default value:' : 'Valor per defecte:', 8 | 'Description' : 'Descripció', 9 | 'Field' : 'Camp', 10 | 'General' : 'General', 11 | 'Generated with' : 'Generat amb', 12 | 'Name' : 'Nom', 13 | 'No response values.' : 'Sense valors en la resposta.', 14 | 'optional' : 'opcional', 15 | 'Parameter' : 'Paràmetre', 16 | 'Permission:' : 'Permisos:', 17 | 'Response' : 'Resposta', 18 | 'Send' : 'Enviar', 19 | 'Send a Sample Request' : 'Enviar una petició d\'exemple', 20 | 'show up to version:' : 'mostrar versió:', 21 | 'Size range:' : 'Tamany de rang:', 22 | 'Type' : 'Tipus', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /www/doc/locales/de.js: -------------------------------------------------------------------------------- 1 | define({ 2 | de: { 3 | 'Allowed values:' : 'Erlaubte Werte:', 4 | 'Compare all with predecessor': 'Vergleiche alle mit ihren Vorgängern', 5 | 'compare changes to:' : 'vergleiche Änderungen mit:', 6 | 'compared to' : 'verglichen mit', 7 | 'Default value:' : 'Standardwert:', 8 | 'Description' : 'Beschreibung', 9 | 'Field' : 'Feld', 10 | 'General' : 'Allgemein', 11 | 'Generated with' : 'Erstellt mit', 12 | 'Name' : 'Name', 13 | 'No response values.' : 'Keine Rückgabewerte.', 14 | 'optional' : 'optional', 15 | 'Parameter' : 'Parameter', 16 | 'Permission:' : 'Berechtigung:', 17 | 'Response' : 'Antwort', 18 | 'Send' : 'Senden', 19 | 'Send a Sample Request' : 'Eine Beispielanfrage senden', 20 | 'show up to version:' : 'zeige bis zur Version:', 21 | 'Size range:' : 'Größenbereich:', 22 | 'Type' : 'Typ', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /www/doc/locales/es.js: -------------------------------------------------------------------------------- 1 | define({ 2 | es: { 3 | 'Allowed values:' : 'Valores permitidos:', 4 | 'Compare all with predecessor': 'Comparar todo con versión anterior', 5 | 'compare changes to:' : 'comparar cambios con:', 6 | 'compared to' : 'comparado con', 7 | 'Default value:' : 'Valor por defecto:', 8 | 'Description' : 'Descripción', 9 | 'Field' : 'Campo', 10 | 'General' : 'General', 11 | 'Generated with' : 'Generado con', 12 | 'Name' : 'Nombre', 13 | 'No response values.' : 'Sin valores en la respuesta.', 14 | 'optional' : 'opcional', 15 | 'Parameter' : 'Parámetro', 16 | 'Permission:' : 'Permisos:', 17 | 'Response' : 'Respuesta', 18 | 'Send' : 'Enviar', 19 | 'Send a Sample Request' : 'Enviar una petición de ejemplo', 20 | 'show up to version:' : 'mostrar a versión:', 21 | 'Size range:' : 'Tamaño de rango:', 22 | 'Type' : 'Tipo', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /www/doc/locales/fr.js: -------------------------------------------------------------------------------- 1 | define({ 2 | fr: { 3 | 'Allowed values:' : 'Valeurs autorisées :', 4 | 'Compare all with predecessor': 'Tout comparer avec ...', 5 | 'compare changes to:' : 'comparer les changements à :', 6 | 'compared to' : 'comparer à', 7 | 'Default value:' : 'Valeur par défaut :', 8 | 'Description' : 'Description', 9 | 'Field' : 'Champ', 10 | 'General' : 'Général', 11 | 'Generated with' : 'Généré avec', 12 | 'Name' : 'Nom', 13 | 'No response values.' : 'Aucune valeur de réponse.', 14 | 'optional' : 'optionnel', 15 | 'Parameter' : 'Paramètre', 16 | 'Permission:' : 'Permission :', 17 | 'Response' : 'Réponse', 18 | 'Send' : 'Envoyer', 19 | 'Send a Sample Request' : 'Envoyer une requête représentative', 20 | 'show up to version:' : 'Montrer à partir de la version :', 21 | 'Size range:' : 'Ordre de grandeur :', 22 | 'Type' : 'Type', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /www/doc/locales/it.js: -------------------------------------------------------------------------------- 1 | define({ 2 | it: { 3 | 'Allowed values:' : 'Valori permessi:', 4 | 'Compare all with predecessor': 'Confronta tutto con versioni precedenti', 5 | 'compare changes to:' : 'confronta modifiche con:', 6 | 'compared to' : 'confrontato con', 7 | 'Default value:' : 'Valore predefinito:', 8 | 'Description' : 'Descrizione', 9 | 'Field' : 'Campo', 10 | 'General' : 'Generale', 11 | 'Generated with' : 'Creato con', 12 | 'Name' : 'Nome', 13 | 'No response values.' : 'Nessun valore di risposta.', 14 | 'optional' : 'opzionale', 15 | 'Parameter' : 'Parametro', 16 | 'Permission:' : 'Permessi:', 17 | 'Response' : 'Risposta', 18 | 'Send' : 'Invia', 19 | 'Send a Sample Request' : 'Invia una richiesta di esempio', 20 | 'show up to version:' : 'mostra alla versione:', 21 | 'Size range:' : 'Intervallo dimensione:', 22 | 'Type' : 'Tipo', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /www/doc/locales/locale.js: -------------------------------------------------------------------------------- 1 | define([ 2 | './locales/ca.js', 3 | './locales/de.js', 4 | './locales/es.js', 5 | './locales/fr.js', 6 | './locales/it.js', 7 | './locales/nl.js', 8 | './locales/pl.js', 9 | './locales/pt_br.js', 10 | './locales/ro.js', 11 | './locales/ru.js', 12 | './locales/zh.js', 13 | './locales/zh_cn.js' 14 | ], function() { 15 | var langId = (navigator.language || navigator.userLanguage).toLowerCase().replace('-', '_'); 16 | var language = langId.substr(0, 2); 17 | var locales = {}; 18 | 19 | for (index in arguments) { 20 | for (property in arguments[index]) 21 | locales[property] = arguments[index][property]; 22 | } 23 | if ( ! locales['en']) 24 | locales['en'] = {}; 25 | 26 | if ( ! locales[langId] && ! locales[language]) 27 | language = 'en'; 28 | 29 | var locale = (locales[langId] ? locales[langId] : locales[language]); 30 | 31 | function __(text) { 32 | var index = locale[text]; 33 | if (index === undefined) 34 | return text; 35 | return index; 36 | }; 37 | 38 | function setLanguage(language) { 39 | locale = locales[language]; 40 | } 41 | 42 | return { 43 | __ : __, 44 | locales : locales, 45 | locale : locale, 46 | setLanguage: setLanguage 47 | }; 48 | }); 49 | -------------------------------------------------------------------------------- /www/doc/locales/nl.js: -------------------------------------------------------------------------------- 1 | define({ 2 | nl: { 3 | 'Allowed values:' : 'Toegestane waarden:', 4 | 'Compare all with predecessor': 'Vergelijk alle met voorgaande versie', 5 | 'compare changes to:' : 'vergelijk veranderingen met:', 6 | 'compared to' : 'vergelijk met', 7 | 'Default value:' : 'Standaard waarde:', 8 | 'Description' : 'Omschrijving', 9 | 'Field' : 'Veld', 10 | 'General' : 'Algemeen', 11 | 'Generated with' : 'Gegenereerd met', 12 | 'Name' : 'Naam', 13 | 'No response values.' : 'Geen response waardes.', 14 | 'optional' : 'optioneel', 15 | 'Parameter' : 'Parameter', 16 | 'Permission:' : 'Permissie:', 17 | 'Response' : 'Antwoorden', 18 | 'Send' : 'Sturen', 19 | 'Send a Sample Request' : 'Stuur een sample aanvragen', 20 | 'show up to version:' : 'toon tot en met versie:', 21 | 'Size range:' : 'Maatbereik:', 22 | 'Type' : 'Type', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /www/doc/locales/pl.js: -------------------------------------------------------------------------------- 1 | define({ 2 | pl: { 3 | 'Allowed values:' : 'Dozwolone wartości:', 4 | 'Compare all with predecessor': 'Porównaj z poprzednimi wersjami', 5 | 'compare changes to:' : 'porównaj zmiany do:', 6 | 'compared to' : 'porównaj do:', 7 | 'Default value:' : 'Wartość domyślna:', 8 | 'Description' : 'Opis', 9 | 'Field' : 'Pole', 10 | 'General' : 'Generalnie', 11 | 'Generated with' : 'Wygenerowano z', 12 | 'Name' : 'Nazwa', 13 | 'No response values.' : 'Brak odpowiedzi.', 14 | 'optional' : 'opcjonalny', 15 | 'Parameter' : 'Parametr', 16 | 'Permission:' : 'Uprawnienia:', 17 | 'Response' : 'Odpowiedź', 18 | 'Send' : 'Wyślij', 19 | 'Send a Sample Request' : 'Wyślij przykładowe żądanie', 20 | 'show up to version:' : 'pokaż do wersji:', 21 | 'Size range:' : 'Zakres rozmiaru:', 22 | 'Type' : 'Typ', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /www/doc/locales/pt_br.js: -------------------------------------------------------------------------------- 1 | define({ 2 | 'pt_br': { 3 | 'Allowed values:' : 'Valores permitidos:', 4 | 'Compare all with predecessor': 'Compare todos com antecessores', 5 | 'compare changes to:' : 'comparar alterações com:', 6 | 'compared to' : 'comparado com', 7 | 'Default value:' : 'Valor padrão:', 8 | 'Description' : 'Descrição', 9 | 'Field' : 'Campo', 10 | 'General' : 'Geral', 11 | 'Generated with' : 'Gerado com', 12 | 'Name' : 'Nome', 13 | 'No response values.' : 'Sem valores de resposta.', 14 | 'optional' : 'opcional', 15 | 'Parameter' : 'Parâmetro', 16 | 'Permission:' : 'Permissão:', 17 | 'Response' : 'Resposta', 18 | 'Send' : 'Enviar', 19 | 'Send a Sample Request' : 'Enviar um Exemplo de Pedido', 20 | 'show up to version:' : 'aparecer para a versão:', 21 | 'Size range:' : 'Faixa de tamanho:', 22 | 'Type' : 'Tipo', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /www/doc/locales/ro.js: -------------------------------------------------------------------------------- 1 | define({ 2 | ro: { 3 | 'Allowed values:' : 'Valori permise:', 4 | 'Compare all with predecessor': 'Compară toate cu versiunea precedentă', 5 | 'compare changes to:' : 'compară cu versiunea:', 6 | 'compared to' : 'comparat cu', 7 | 'Default value:' : 'Valoare implicită:', 8 | 'Description' : 'Descriere', 9 | 'Field' : 'Câmp', 10 | 'General' : 'General', 11 | 'Generated with' : 'Generat cu', 12 | 'Name' : 'Nume', 13 | 'No response values.' : 'Nici o valoare returnată.', 14 | 'optional' : 'opțional', 15 | 'Parameter' : 'Parametru', 16 | 'Permission:' : 'Permisiune:', 17 | 'Response' : 'Răspuns', 18 | 'Send' : 'Trimite', 19 | 'Send a Sample Request' : 'Trimite o cerere de probă', 20 | 'show up to version:' : 'arată până la versiunea:', 21 | 'Size range:' : 'Interval permis:', 22 | 'Type' : 'Tip', 23 | 'url' : 'url' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /www/doc/locales/ru.js: -------------------------------------------------------------------------------- 1 | define({ 2 | ru: { 3 | 'Allowed values:' : 'Допустимые значения:', 4 | 'Compare all with predecessor': 'Сравнить с предыдущей версией', 5 | 'compare changes to:' : 'сравнить с:', 6 | 'compared to' : 'в сравнении с', 7 | 'Default value:' : 'По умолчанию:', 8 | 'Description' : 'Описание', 9 | 'Field' : 'Название', 10 | 'General' : 'Общая информация', 11 | 'Generated with' : 'Сгенерировано с помощью', 12 | 'Name' : 'Название', 13 | 'No response values.' : 'Нет значений для ответа.', 14 | 'optional' : 'необязательный', 15 | 'Parameter' : 'Параметр', 16 | 'Permission:' : 'Разрешено:', 17 | 'Response' : 'Ответ', 18 | 'Send' : 'Отправить', 19 | 'Send a Sample Request' : 'Отправить тестовый запрос', 20 | 'show up to version:' : 'показать версию:', 21 | 'Size range:' : 'Ограничения:', 22 | 'Type' : 'Тип', 23 | 'url' : 'URL' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /www/doc/locales/zh.js: -------------------------------------------------------------------------------- 1 | define({ 2 | zh: { 3 | 'Allowed values​​:' : '允許值:', 4 | 'Compare all with predecessor': '預先比較所有', 5 | 'compare changes to:' : '比較變更:', 6 | 'compared to' : '對比', 7 | 'Default value:' : '默認值:', 8 | 'Description' : '描述', 9 | 'Field' : '字段', 10 | 'General' : '概括', 11 | 'Generated with' : '生成工具', 12 | 'Name' : '名稱', 13 | 'No response values​​.' : '無對應資料.', 14 | 'optional' : '選項', 15 | 'Parameter' : '參數', 16 | 'Permission:' : '允許:', 17 | 'Response' : '回應', 18 | 'Send' : '發送', 19 | 'Send a Sample Request' : '發送試用需求', 20 | 'show up to version:' : '顯示到版本:', 21 | 'Size range:' : '尺寸範圍:', 22 | 'Type' : '類型', 23 | 'url' : '網址' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /www/doc/locales/zh_cn.js: -------------------------------------------------------------------------------- 1 | define({ 2 | 'zh_cn': { 3 | 'Allowed values:' : '允许值:', 4 | 'Compare all with predecessor': '与所有较早的比较', 5 | 'compare changes to:' : '将当前版本与指定版本比较:', 6 | 'compared to' : '相比于', 7 | 'Default value:' : '默认值:', 8 | 'Description' : '描述', 9 | 'Field' : '字段', 10 | 'General' : '概要', 11 | 'Generated with' : '基于', 12 | 'Name' : '名称', 13 | 'No response values.' : '无返回值.', 14 | 'optional' : '可选', 15 | 'Parameter' : '参数', 16 | 'Permission:' : '权限:', 17 | 'Response' : '返回', 18 | 'Send' : '发送', 19 | 'Send a Sample Request' : '发送示例请求', 20 | 'show up to version:' : '显示到指定版本:', 21 | 'Size range:' : '取值范围:', 22 | 'Type' : '类型', 23 | 'url' : '网址' 24 | } 25 | }); 26 | -------------------------------------------------------------------------------- /www/doc/vendor/path-to-regexp/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Blake Embrey (hello@blakeembrey.com) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in 13 | all 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, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | THE SOFTWARE. 22 | -------------------------------------------------------------------------------- /www/doc/vendor/path-to-regexp/index.js: -------------------------------------------------------------------------------- 1 | var isArray = Array.isArray || function (arr) { 2 | return Object.prototype.toString.call(arr) == '[object Array]'; 3 | }; 4 | 5 | /** 6 | * Expose `pathToRegexp`. 7 | */ 8 | // module.exports = pathToRegexp 9 | 10 | /** 11 | * The main path matching regexp utility. 12 | * 13 | * @type {RegExp} 14 | */ 15 | var PATH_REGEXP = new RegExp([ 16 | // Match escaped characters that would otherwise appear in future matches. 17 | // This allows the user to escape special characters that won't transform. 18 | '(\\\\.)', 19 | // Match Express-style parameters and un-named parameters with a prefix 20 | // and optional suffixes. Matches appear as: 21 | // 22 | // "/:test(\\d+)?" => ["/", "test", "\d+", undefined, "?"] 23 | // "/route(\\d+)" => [undefined, undefined, undefined, "\d+", undefined] 24 | '([\\/.])?(?:\\:(\\w+)(?:\\(((?:\\\\.|[^)])*)\\))?|\\(((?:\\\\.|[^)])*)\\))([+*?])?', 25 | // Match regexp special characters that are always escaped. 26 | '([.+*?=^!:${}()[\\]|\\/])' 27 | ].join('|'), 'g'); 28 | 29 | /** 30 | * Escape the capturing group by escaping special characters and meaning. 31 | * 32 | * @param {String} group 33 | * @return {String} 34 | */ 35 | function escapeGroup (group) { 36 | return group.replace(/([=!:$\/()])/g, '\\$1'); 37 | } 38 | 39 | /** 40 | * Attach the keys as a property of the regexp. 41 | * 42 | * @param {RegExp} re 43 | * @param {Array} keys 44 | * @return {RegExp} 45 | */ 46 | function attachKeys (re, keys) { 47 | re.keys = keys; 48 | return re; 49 | } 50 | 51 | /** 52 | * Get the flags for a regexp from the options. 53 | * 54 | * @param {Object} options 55 | * @return {String} 56 | */ 57 | function flags (options) { 58 | return options.sensitive ? '' : 'i'; 59 | } 60 | 61 | /** 62 | * Pull out keys from a regexp. 63 | * 64 | * @param {RegExp} path 65 | * @param {Array} keys 66 | * @return {RegExp} 67 | */ 68 | function regexpToRegexp (path, keys) { 69 | // Use a negative lookahead to match only capturing groups. 70 | var groups = path.source.match(/\((?!\?)/g); 71 | 72 | if (groups) { 73 | for (var i = 0; i < groups.length; i++) { 74 | keys.push({ 75 | name: i, 76 | delimiter: null, 77 | optional: false, 78 | repeat: false 79 | }); 80 | } 81 | } 82 | 83 | return attachKeys(path, keys); 84 | } 85 | 86 | /** 87 | * Transform an array into a regexp. 88 | * 89 | * @param {Array} path 90 | * @param {Array} keys 91 | * @param {Object} options 92 | * @return {RegExp} 93 | */ 94 | function arrayToRegexp (path, keys, options) { 95 | var parts = []; 96 | 97 | for (var i = 0; i < path.length; i++) { 98 | parts.push(pathToRegexp(path[i], keys, options).source); 99 | } 100 | 101 | var regexp = new RegExp('(?:' + parts.join('|') + ')', flags(options)); 102 | return attachKeys(regexp, keys); 103 | } 104 | 105 | /** 106 | * Replace the specific tags with regexp strings. 107 | * 108 | * @param {String} path 109 | * @param {Array} keys 110 | * @return {String} 111 | */ 112 | function replacePath (path, keys) { 113 | var index = 0; 114 | 115 | function replace (_, escaped, prefix, key, capture, group, suffix, escape) { 116 | if (escaped) { 117 | return escaped; 118 | } 119 | 120 | if (escape) { 121 | return '\\' + escape; 122 | } 123 | 124 | var repeat = suffix === '+' || suffix === '*'; 125 | var optional = suffix === '?' || suffix === '*'; 126 | 127 | keys.push({ 128 | name: key || index++, 129 | delimiter: prefix || '/', 130 | optional: optional, 131 | repeat: repeat 132 | }); 133 | 134 | prefix = prefix ? ('\\' + prefix) : ''; 135 | capture = escapeGroup(capture || group || '[^' + (prefix || '\\/') + ']+?'); 136 | 137 | if (repeat) { 138 | capture = capture + '(?:' + prefix + capture + ')*'; 139 | } 140 | 141 | if (optional) { 142 | return '(?:' + prefix + '(' + capture + '))?'; 143 | } 144 | 145 | // Basic parameter support. 146 | return prefix + '(' + capture + ')'; 147 | } 148 | 149 | return path.replace(PATH_REGEXP, replace); 150 | } 151 | 152 | /** 153 | * Normalize the given path string, returning a regular expression. 154 | * 155 | * An empty array can be passed in for the keys, which will hold the 156 | * placeholder key descriptions. For example, using `/user/:id`, `keys` will 157 | * contain `[{ name: 'id', delimiter: '/', optional: false, repeat: false }]`. 158 | * 159 | * @param {(String|RegExp|Array)} path 160 | * @param {Array} [keys] 161 | * @param {Object} [options] 162 | * @return {RegExp} 163 | */ 164 | function pathToRegexp (path, keys, options) { 165 | keys = keys || []; 166 | 167 | if (!isArray(keys)) { 168 | options = keys; 169 | keys = []; 170 | } else if (!options) { 171 | options = {}; 172 | } 173 | 174 | if (path instanceof RegExp) { 175 | return regexpToRegexp(path, keys, options); 176 | } 177 | 178 | if (isArray(path)) { 179 | return arrayToRegexp(path, keys, options); 180 | } 181 | 182 | var strict = options.strict; 183 | var end = options.end !== false; 184 | var route = replacePath(path, keys); 185 | var endsWithSlash = path.charAt(path.length - 1) === '/'; 186 | 187 | // In non-strict mode we allow a slash at the end of match. If the path to 188 | // match already ends with a slash, we remove it for consistency. The slash 189 | // is valid at the end of a path match, not in the middle. This is important 190 | // in non-ending mode, where "/test/" shouldn't match "/test//route". 191 | if (!strict) { 192 | route = (endsWithSlash ? route.slice(0, -2) : route) + '(?:\\/(?=$))?'; 193 | } 194 | 195 | if (end) { 196 | route += '$'; 197 | } else { 198 | // In non-ending mode, we need the capturing groups to match as much as 199 | // possible by using a positive lookahead to the end or next path segment. 200 | route += strict && endsWithSlash ? '' : '(?=\\/|$)'; 201 | } 202 | 203 | return attachKeys(new RegExp('^' + route, flags(options)), keys); 204 | } 205 | -------------------------------------------------------------------------------- /www/doc/vendor/polyfill.js: -------------------------------------------------------------------------------- 1 | // From https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/keys 2 | if (!Object.keys) { 3 | Object.keys = (function () { 4 | 'use strict'; 5 | var hasOwnProperty = Object.prototype.hasOwnProperty, 6 | hasDontEnumBug = !({toString: null}).propertyIsEnumerable('toString'), 7 | dontEnums = [ 8 | 'toString', 9 | 'toLocaleString', 10 | 'valueOf', 11 | 'hasOwnProperty', 12 | 'isPrototypeOf', 13 | 'propertyIsEnumerable', 14 | 'constructor' 15 | ], 16 | dontEnumsLength = dontEnums.length; 17 | 18 | return function (obj) { 19 | if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) { 20 | throw new TypeError('Object.keys called on non-object'); 21 | } 22 | 23 | var result = [], prop, i; 24 | 25 | for (prop in obj) { 26 | if (hasOwnProperty.call(obj, prop)) { 27 | result.push(prop); 28 | } 29 | } 30 | 31 | if (hasDontEnumBug) { 32 | for (i = 0; i < dontEnumsLength; i++) { 33 | if (hasOwnProperty.call(obj, dontEnums[i])) { 34 | result.push(dontEnums[i]); 35 | } 36 | } 37 | } 38 | return result; 39 | }; 40 | }()); 41 | } 42 | 43 | //Production steps of ECMA-262, Edition 5, 15.4.4.18 44 | //Reference: http://es5.github.com/#x15.4.4.18 45 | if (!Array.prototype.forEach) { 46 | Array.prototype.forEach = function (callback, thisArg) { 47 | var T, k; 48 | 49 | if (this == null) { 50 | throw new TypeError(' this is null or not defined'); 51 | } 52 | 53 | // 1. Let O be the result of calling ToObject passing the |this| value as the argument. 54 | var O = Object(this); 55 | 56 | // 2. Let lenValue be the result of calling the Get internal method of O with the argument "length". 57 | // 3. Let len be ToUint32(lenValue). 58 | var len = O.length >>> 0; 59 | 60 | // 4. If IsCallable(callback) is false, throw a TypeError exception. 61 | // See: http://es5.github.com/#x9.11 62 | if (typeof callback !== "function") { 63 | throw new TypeError(callback + " is not a function"); 64 | } 65 | 66 | // 5. If thisArg was supplied, let T be thisArg; else let T be undefined. 67 | if (arguments.length > 1) { 68 | T = thisArg; 69 | } 70 | 71 | // 6. Let k be 0 72 | k = 0; 73 | 74 | // 7. Repeat, while k < len 75 | while (k < len) { 76 | var kValue; 77 | 78 | // a. Let Pk be ToString(k). 79 | // This is implicit for LHS operands of the in operator 80 | // b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk. 81 | // This step can be combined with c 82 | // c. If kPresent is true, then 83 | if (k in O) { 84 | // i. Let kValue be the result of calling the Get internal method of O with argument Pk. 85 | kValue = O[k]; 86 | 87 | // ii. Call the Call internal method of callback with T as the this value and 88 | // argument list containing kValue, k, and O. 89 | callback.call(T, kValue, k, O); 90 | } 91 | // d. Increase k by 1. 92 | k++; 93 | } 94 | // 8. return undefined 95 | }; 96 | } 97 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify.css: -------------------------------------------------------------------------------- 1 | /* Pretty printing styles. Used with prettify.js. */ 2 | /* Vim sunburst theme by David Leibovic */ 3 | 4 | pre .str, code .str { color: #65B042; } /* string - green */ 5 | pre .kwd, code .kwd { color: #E28964; } /* keyword - dark pink */ 6 | pre .com, code .com { color: #AEAEAE; font-style: italic; } /* comment - gray */ 7 | pre .typ, code .typ { color: #89bdff; } /* type - light blue */ 8 | pre .lit, code .lit { color: #3387CC; } /* literal - blue */ 9 | pre .pun, code .pun { color: #fff; } /* punctuation - white */ 10 | pre .pln, code .pln { color: #fff; } /* plaintext - white */ 11 | pre .tag, code .tag { color: #89bdff; } /* html/xml tag - light blue */ 12 | pre .atn, code .atn { color: #bdb76b; } /* html/xml attribute name - khaki */ 13 | pre .atv, code .atv { color: #65B042; } /* html/xml attribute value - green */ 14 | pre .dec, code .dec { color: #3387CC; } /* decimal - blue */ 15 | 16 | pre.prettyprint, code.prettyprint { 17 | background-color: #000; 18 | -moz-border-radius: 8px; 19 | -webkit-border-radius: 8px; 20 | -o-border-radius: 8px; 21 | -ms-border-radius: 8px; 22 | -khtml-border-radius: 8px; 23 | border-radius: 8px; 24 | } 25 | 26 | pre.prettyprint { 27 | width: 95%; 28 | margin: 1em auto; 29 | padding: 1em; 30 | white-space: pre-wrap; 31 | } 32 | 33 | 34 | /* Specify class=linenums on a pre to get line numbering */ 35 | ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE; } /* IE indents via margin-left */ 36 | li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none } 37 | /* Alternate shading for lines */ 38 | li.L1,li.L3,li.L5,li.L7,li.L9 { } 39 | 40 | @media print { 41 | pre .str, code .str { color: #060; } 42 | pre .kwd, code .kwd { color: #006; font-weight: bold; } 43 | pre .com, code .com { color: #600; font-style: italic; } 44 | pre .typ, code .typ { color: #404; font-weight: bold; } 45 | pre .lit, code .lit { color: #044; } 46 | pre .pun, code .pun { color: #440; } 47 | pre .pln, code .pln { color: #000; } 48 | pre .tag, code .tag { color: #006; font-weight: bold; } 49 | pre .atn, code .atn { color: #404; } 50 | pre .atv, code .atv { color: #060; } 51 | } 52 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-Splus.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2012 Jeffrey B. Arnold 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![A-Za-z0-9_.])/],["lit",/^0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?/],["lit",/^[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|[0-9]+))(?![A-Za-z0-9_.])/], 18 | ["pun",/^(?:<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\*|\+|\^|\/|!|%.*?%|=|~|\$|@|:{1,3}|[\[\](){};,?])/],["pln",/^(?:[A-Za-z]+[A-Za-z0-9_.]*|\.[a-zA-Z_][0-9a-zA-Z\._]*)(?![A-Za-z0-9_.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-aea.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Onno Hommes. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, 18 | null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-agc.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Onno Hommes. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, 18 | null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-apollo.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Onno Hommes. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:ADS|AD|AUG|BZF|BZMF|CAE|CAF|CA|CCS|COM|CS|DAS|DCA|DCOM|DCS|DDOUBL|DIM|DOUBLE|DTCB|DTCF|DV|DXCH|EDRUPT|EXTEND|INCR|INDEX|NDX|INHINT|LXCH|MASK|MSK|MP|MSU|NOOP|OVSK|QXCH|RAND|READ|RELINT|RESUME|RETURN|ROR|RXOR|SQUARE|SU|TCR|TCAA|OVSK|TCF|TC|TS|WAND|WOR|WRITE|XCH|XLQ|XXALQ|ZL|ZQ|ADD|ADZ|SUB|SUZ|MPY|MPR|MPZ|DVP|COM|ABS|CLA|CLZ|LDQ|STO|STQ|ALS|LLS|LRS|TRA|TSQ|TMI|TOV|AXT|TIX|DLY|INP|OUT)\s/, 18 | null],["typ",/^(?:-?GENADR|=MINUS|2BCADR|VN|BOF|MM|-?2CADR|-?[1-6]DNADR|ADRES|BBCON|[SE]?BANK\=?|BLOCK|BNKSUM|E?CADR|COUNT\*?|2?DEC\*?|-?DNCHAN|-?DNPTR|EQUALS|ERASE|MEMORY|2?OCT|REMADR|SETLOC|SUBRO|ORG|BSS|BES|SYN|EQU|DEFINE|END)\s/,null],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[!-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["apollo","agc","aea"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-basic.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Peter Kofler 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:"(?:[^\\"\r\n]|\\.)*(?:"|$))/,null,'"'],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["com",/^REM[^\r\n]*/,null],["kwd",/^\b(?:AND|CLOSE|CLR|CMD|CONT|DATA|DEF ?FN|DIM|END|FOR|GET|GOSUB|GOTO|IF|INPUT|LET|LIST|LOAD|NEW|NEXT|NOT|ON|OPEN|OR|POKE|PRINT|READ|RESTORE|RETURN|RUN|SAVE|STEP|STOP|SYS|THEN|TO|VERIFY|WAIT)\b/,null],["pln",/^[A-Z][A-Z0-9]?(?:\$|%)?/i,null],["lit",/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?/i, 18 | null,"0123456789"],["pun",/^.[^\s\w\.$%"]*/,null]]),["basic","cbm"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-cbm.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Peter Kofler 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:"(?:[^\\"\r\n]|\\.)*(?:"|$))/,null,'"'],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["com",/^REM[^\r\n]*/,null],["kwd",/^\b(?:AND|CLOSE|CLR|CMD|CONT|DATA|DEF ?FN|DIM|END|FOR|GET|GOSUB|GOTO|IF|INPUT|LET|LIST|LOAD|NEW|NEXT|NOT|ON|OPEN|OR|POKE|PRINT|READ|RESTORE|RETURN|RUN|SAVE|STEP|STOP|SYS|THEN|TO|VERIFY|WAIT)\b/,null],["pln",/^[A-Z][A-Z0-9]?(?:\$|%)?/i,null],["lit",/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?/i, 18 | null,"0123456789"],["pun",/^.[^\s\w\.$%"]*/,null]]),["basic","cbm"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-cl.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-clj.js: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 2011 Google Inc. 3 | 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | */ 16 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^[\(\{\[]+/,null,"([{"],["clo",/^[\)\}\]]+/,null,")]}"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:def|if|do|let|quote|var|fn|loop|recur|throw|try|monitor-enter|monitor-exit|defmacro|defn|defn-|macroexpand|macroexpand-1|for|doseq|dosync|dotimes|and|or|when|not|assert|doto|proxy|defstruct|first|rest|cons|defprotocol|deftype|defrecord|reify|defmulti|defmethod|meta|with-meta|ns|in-ns|create-ns|import|intern|refer|alias|namespace|resolve|ref|deref|refset|new|set!|memfn|to-array|into-array|aset|gen-class|reduce|map|filter|find|nil?|empty?|hash-map|hash-set|vec|vector|seq|flatten|reverse|assoc|dissoc|list|list?|disj|get|union|difference|intersection|extend|extend-type|extend-protocol|prn)\b/, 17 | null],["typ",/^:[0-9a-zA-Z\-]+/]]),["clj"]); 18 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-css.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[ \t\r\n\f]+/,null," \t\r\n\f"]],[["str",/^\"(?:[^\n\r\f\\\"]|\\(?:\r\n?|\n|\f)|\\[\s\S])*\"/,null],["str",/^\'(?:[^\n\r\f\\\']|\\(?:\r\n?|\n|\f)|\\[\s\S])*\'/,null],["lang-css-str",/^url\(([^\)\"\']+)\)/i],["kwd",/^(?:url|rgb|\!important|@import|@page|@media|@charset|inherit)(?=[^\-\w]|$)/i,null],["lang-css-kw",/^(-?(?:[_a-z]|(?:\\[0-9a-f]+ ?))(?:[_a-z0-9\-]|\\(?:\\[0-9a-f]+ ?))*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//], 18 | ["com",/^(?:\x3c!--|--\x3e)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#(?:[0-9a-f]{3}){1,2}\b/i],["pln",/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i],["pun",/^[^\s\w\'\"]+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|(?:\\[\da-f]+ ?))(?:[_a-z\d\-]|\\(?:\\[\da-f]+ ?))*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^\)\"\']+/]]),["css-str"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-dart.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"]],[["com",/^#!(?:.*)/],["kwd",/^\b(?:import|library|part of|part|as|show|hide)\b/i],["com",/^\/\/(?:.*)/],["com",/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],["kwd",/^\b(?:class|interface)\b/i],["kwd",/^\b(?:assert|async|await|break|case|catch|continue|default|do|else|finally|for|if|in|is|new|return|super|switch|sync|this|throw|try|while)\b/i],["kwd",/^\b(?:abstract|const|extends|factory|final|get|implements|native|operator|set|static|typedef|var)\b/i], 18 | ["typ",/^\b(?:bool|double|Dynamic|int|num|Object|String|void)\b/i],["kwd",/^\b(?:false|null|true)\b/i],["str",/^r?[\']{3}[\s|\S]*?[^\\][\']{3}/],["str",/^r?[\"]{3}[\s|\S]*?[^\\][\"]{3}/],["str",/^r?\'(\'|(?:[^\n\r\f])*?[^\\]\')/],["str",/^r?\"(\"|(?:[^\n\r\f])*?[^\\]\")/],["typ",/^[A-Z]\w*/],["pln",/^[a-z_$][a-z0-9_]*/i],["pun",/^[~!%^&*+=|?:<>/-]/],["lit",/^\b0x[0-9a-f]+/i],["lit",/^\b\d+(?:\.\d*)?(?:e[+-]?\d+)?/i],["lit", 19 | /^\b\.\d+(?:e[+-]?\d+)?/i],["pun",/^[(){}\[\],.;]/]]),["dart"]); 20 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-el.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-erl.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Andrew Allen 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\x0B\f\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^\?[^ \t\n({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/], 18 | ["kwd",/^-[a-z_]+/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;]/]]),["erlang","erl"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-erlang.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Andrew Allen 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\x0B\f\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^\?[^ \t\n({]+/,null,"?"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\n]*/],["kwd",/^(?:module|attributes|do|let|in|letrec|apply|call|primop|case|of|end|when|fun|try|catch|receive|after|char|integer|float,atom,string,var)\b/], 18 | ["kwd",/^-[a-z_]+/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;]/]]),["erlang","erl"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-fs.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xA0]+(?:[a-z_$][\w\']*|``[^\r\n\t`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])(?:\'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\r\n]*|\(\*[\s\S]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], 18 | ["lit",/^[+\-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^(?:[a-z_][\w']*[!?#]?|``[^\r\n\t`]*(?:``|$))/i],["pun",/^[^\t\n\r \xA0\"\'\w]+/]]),["fs","ml"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-go.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2010 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["pln",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])+(?:\'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\r\n]*|\/\*[\s\S]*?\*\/)/],["pln",/^(?:[^\/\"\'`]|\/(?![\/\*]))+/i]]),["go"]); 18 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-hs.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\x0B\x0C\r ]+/,null,"\t\n\x0B\f\r "],["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])\'?/,null,"'"],["lit",/^(?:0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^(?:(?:--+(?:[^\r\n\x0C]*)?)|(?:\{-(?:[^-]|-+[^-\}])*-\}))/],["kwd",/^(?:case|class|data|default|deriving|do|else|if|import|in|infix|infixl|infixr|instance|let|module|newtype|of|then|type|where|_)(?=[^a-zA-Z0-9\']|$)/, 18 | null],["pln",/^(?:[A-Z][\w\']*\.)*[a-zA-Z][\w\']*/],["pun",/^[^\t\n\x0B\x0C\r a-zA-Z0-9\'\"]+/]]),["hs"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-lasso.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Eric Knibbe 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\`[^\`]*(?:\`|$)/,null,"`"],["lit",/^0x[\da-f]+|\d+/i,null,"0123456789"],["atn",/^#\d+|[#$][a-z_][\w.]*|#![ \S]+lasso9\b/i,null,"#$"]],[["tag",/^[[\]]|<\?(?:lasso(?:script)?|=)|\?>|noprocess\b|no_square_brackets\b/i],["com",/^\/\/[^\r\n]*|\/\*[\s\S]*?\*\//], 18 | ["atn",/^-(?!infinity)[a-z_][\w.]*|\.\s*'[a-z_][\w.]*'/i],["lit",/^\d*\.\d+(?:e[-+]?\d+)?|infinity\b|NaN\b/i],["atv",/^::\s*[a-z_][\w.]*/i],["lit",/^(?:true|false|none|minimal|full|all|void|and|or|not|bw|nbw|ew|new|cn|ncn|lt|lte|gt|gte|eq|neq|rx|nrx|ft)\b/i],["kwd",/^(?:error_code|error_msg|error_pop|error_push|error_reset|cache|database_names|database_schemanames|database_tablenames|define_tag|define_type|email_batch|encode_set|html_comment|handle|handle_error|header|if|inline|iterate|ljax_target|link|link_currentaction|link_currentgroup|link_currentrecord|link_detail|link_firstgroup|link_firstrecord|link_lastgroup|link_lastrecord|link_nextgroup|link_nextrecord|link_prevgroup|link_prevrecord|log|loop|namespace_using|output_none|portal|private|protect|records|referer|referrer|repeating|resultset|rows|search_args|search_arguments|select|sort_args|sort_arguments|thread_atomic|value_list|while|abort|case|else|if_empty|if_false|if_null|if_true|loop_abort|loop_continue|loop_count|params|params_up|return|return_value|run_children|soap_definetag|soap_lastrequest|soap_lastresponse|tag_name|ascending|average|by|define|descending|do|equals|frozen|group|handle_failure|import|in|into|join|let|match|max|min|on|order|parent|protected|provide|public|require|returnhome|skip|split_thread|sum|take|thread|to|trait|type|where|with|yield|yieldhome)\b/i], 19 | ["typ",/^(?:array|date|decimal|duration|integer|map|pair|string|tag|xml|null|boolean|bytes|keyword|list|locale|queue|set|stack|staticarray|local|var|variable|global|data|self|inherited|currentcapture|givenblock)\b|^\.\.?/i],["pln",/^[a-z_][\w.]*(?:=\s*(?=\())?/i],["pun",/^:=|[-+*\/%=<>&|!?\\]/]]),["lasso","ls","lassoscript"]); 20 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-lassoscript.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Eric Knibbe 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\`[^\`]*(?:\`|$)/,null,"`"],["lit",/^0x[\da-f]+|\d+/i,null,"0123456789"],["atn",/^#\d+|[#$][a-z_][\w.]*|#![ \S]+lasso9\b/i,null,"#$"]],[["tag",/^[[\]]|<\?(?:lasso(?:script)?|=)|\?>|noprocess\b|no_square_brackets\b/i],["com",/^\/\/[^\r\n]*|\/\*[\s\S]*?\*\//], 18 | ["atn",/^-(?!infinity)[a-z_][\w.]*|\.\s*'[a-z_][\w.]*'/i],["lit",/^\d*\.\d+(?:e[-+]?\d+)?|infinity\b|NaN\b/i],["atv",/^::\s*[a-z_][\w.]*/i],["lit",/^(?:true|false|none|minimal|full|all|void|and|or|not|bw|nbw|ew|new|cn|ncn|lt|lte|gt|gte|eq|neq|rx|nrx|ft)\b/i],["kwd",/^(?:error_code|error_msg|error_pop|error_push|error_reset|cache|database_names|database_schemanames|database_tablenames|define_tag|define_type|email_batch|encode_set|html_comment|handle|handle_error|header|if|inline|iterate|ljax_target|link|link_currentaction|link_currentgroup|link_currentrecord|link_detail|link_firstgroup|link_firstrecord|link_lastgroup|link_lastrecord|link_nextgroup|link_nextrecord|link_prevgroup|link_prevrecord|log|loop|namespace_using|output_none|portal|private|protect|records|referer|referrer|repeating|resultset|rows|search_args|search_arguments|select|sort_args|sort_arguments|thread_atomic|value_list|while|abort|case|else|if_empty|if_false|if_null|if_true|loop_abort|loop_continue|loop_count|params|params_up|return|return_value|run_children|soap_definetag|soap_lastrequest|soap_lastresponse|tag_name|ascending|average|by|define|descending|do|equals|frozen|group|handle_failure|import|in|into|join|let|match|max|min|on|order|parent|protected|provide|public|require|returnhome|skip|split_thread|sum|take|thread|to|trait|type|where|with|yield|yieldhome)\b/i], 19 | ["typ",/^(?:array|date|decimal|duration|integer|map|pair|string|tag|xml|null|boolean|bytes|keyword|list|locale|queue|set|stack|staticarray|local|var|variable|global|data|self|inherited|currentcapture|givenblock)\b|^\.\.?/i],["pln",/^[a-z_][\w.]*(?:=\s*(?=\())?/i],["pun",/^:=|[-+*\/%=<>&|!?\\]/]]),["lasso","ls","lassoscript"]); 20 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-latex.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2011 Martin S. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\r\n]*/,null,"%"]],[["kwd",/^\\[a-zA-Z@]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[{}()\[\]=]+/]]),["latex","tex"]); 18 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-lgt.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2014 Paulo Moura 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^(?:0'.|0b[0-1]+|0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\r\n]*/,null,"%"],["com",/^\/\*[\s\S]*?\*\//],["kwd",/^\s*:-\s(c(a(lls|tegory)|oinductive)|p(ublic|r(ot(ocol|ected)|ivate))|e(l(if|se)|n(coding|sure_loaded)|xport)|i(f|n(clude|itialization|fo))|alias|d(ynamic|iscontiguous)|m(eta_(non_terminal|predicate)|od(e|ule)|ultifile)|reexport|s(et_(logtalk|prolog)_flag|ynchronized)|o(bject|p)|use(s|_module))/], 18 | ["kwd",/^\s*:-\s(e(lse|nd(if|_(category|object|protocol)))|built_in|dynamic|synchronized|threaded)/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;{}:^<>=\\/+*?#!-]/]]),["logtalk","lgt"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-lisp.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-ll.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Nikhil Dabas 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^!?\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["com",/^;[^\r\n]*/,null,";"]],[["pln",/^[%@!](?:[-a-zA-Z$._][-a-zA-Z$._0-9]*|\d+)/],["kwd",/^[A-Za-z_][0-9A-Za-z_]*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[xX][a-fA-F0-9]+)/],["pun",/^[()\[\]{},=*<>:]|\.\.\.$/]]),["llvm","ll"]); 18 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-llvm.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Nikhil Dabas 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^!?\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["com",/^;[^\r\n]*/,null,";"]],[["pln",/^[%@!](?:[-a-zA-Z$._][-a-zA-Z$._0-9]*|\d+)/],["kwd",/^[A-Za-z_][0-9A-Za-z_]*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[xX][a-fA-F0-9]+)/],["pun",/^[()\[\]{},=*<>:]|\.\.\.$/]]),["llvm","ll"]); 18 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-logtalk.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2014 Paulo Moura 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^\"(?:[^\"\\\n\x0C\r]|\\[\s\S])*(?:\"|$)/,null,'"'],["lit",/^[a-z][a-zA-Z0-9_]*/],["lit",/^\'(?:[^\'\\\n\x0C\r]|\\[^&])+\'?/,null,"'"],["lit",/^(?:0'.|0b[0-1]+|0o[0-7]+|0x[\da-f]+|\d+(?:\.\d+)?(?:e[+\-]?\d+)?)/i,null,"0123456789"]],[["com",/^%[^\r\n]*/,null,"%"],["com",/^\/\*[\s\S]*?\*\//],["kwd",/^\s*:-\s(c(a(lls|tegory)|oinductive)|p(ublic|r(ot(ocol|ected)|ivate))|e(l(if|se)|n(coding|sure_loaded)|xport)|i(f|n(clude|itialization|fo))|alias|d(ynamic|iscontiguous)|m(eta_(non_terminal|predicate)|od(e|ule)|ultifile)|reexport|s(et_(logtalk|prolog)_flag|ynchronized)|o(bject|p)|use(s|_module))/], 18 | ["kwd",/^\s*:-\s(e(lse|nd(if|_(category|object|protocol)))|built_in|dynamic|synchronized|threaded)/],["typ",/^[A-Z_][a-zA-Z0-9_]*/],["pun",/^[.,;{}:^<>=\\/+*?#!-]/]]),["logtalk","lgt"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-ls.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Eric Knibbe 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\`[^\`]*(?:\`|$)/,null,"`"],["lit",/^0x[\da-f]+|\d+/i,null,"0123456789"],["atn",/^#\d+|[#$][a-z_][\w.]*|#![ \S]+lasso9\b/i,null,"#$"]],[["tag",/^[[\]]|<\?(?:lasso(?:script)?|=)|\?>|noprocess\b|no_square_brackets\b/i],["com",/^\/\/[^\r\n]*|\/\*[\s\S]*?\*\//], 18 | ["atn",/^-(?!infinity)[a-z_][\w.]*|\.\s*'[a-z_][\w.]*'/i],["lit",/^\d*\.\d+(?:e[-+]?\d+)?|infinity\b|NaN\b/i],["atv",/^::\s*[a-z_][\w.]*/i],["lit",/^(?:true|false|none|minimal|full|all|void|and|or|not|bw|nbw|ew|new|cn|ncn|lt|lte|gt|gte|eq|neq|rx|nrx|ft)\b/i],["kwd",/^(?:error_code|error_msg|error_pop|error_push|error_reset|cache|database_names|database_schemanames|database_tablenames|define_tag|define_type|email_batch|encode_set|html_comment|handle|handle_error|header|if|inline|iterate|ljax_target|link|link_currentaction|link_currentgroup|link_currentrecord|link_detail|link_firstgroup|link_firstrecord|link_lastgroup|link_lastrecord|link_nextgroup|link_nextrecord|link_prevgroup|link_prevrecord|log|loop|namespace_using|output_none|portal|private|protect|records|referer|referrer|repeating|resultset|rows|search_args|search_arguments|select|sort_args|sort_arguments|thread_atomic|value_list|while|abort|case|else|if_empty|if_false|if_null|if_true|loop_abort|loop_continue|loop_count|params|params_up|return|return_value|run_children|soap_definetag|soap_lastrequest|soap_lastresponse|tag_name|ascending|average|by|define|descending|do|equals|frozen|group|handle_failure|import|in|into|join|let|match|max|min|on|order|parent|protected|provide|public|require|returnhome|skip|split_thread|sum|take|thread|to|trait|type|where|with|yield|yieldhome)\b/i], 19 | ["typ",/^(?:array|date|decimal|duration|integer|map|pair|string|tag|xml|null|boolean|bytes|keyword|list|locale|queue|set|stack|staticarray|local|var|variable|global|data|self|inherited|currentcapture|givenblock)\b|^\.\.?/i],["pln",/^[a-z_][\w.]*(?:=\s*(?=\())?/i],["pun",/^:=|[-+*\/%=<>&|!?\\]/]]),["lasso","ls","lassoscript"]); 20 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-lsp.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-lua.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])*(?:\'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\s\S]*?(?:\]\1\]|$)|[^\r\n]*)/],["str",/^\[(=*)\[[\s\S]*?(?:\]\1\]|$)/],["kwd",/^(?:and|break|do|else|elseif|end|false|for|function|if|in|local|nil|not|or|repeat|return|then|true|until|while)\b/,null],["lit",/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i], 18 | ["pln",/^[a-z_]\w*/i],["pun",/^[^\w\t\n\r \xA0][^\w\t\n\r \xA0\"\'\-\+=]*/]]),["lua"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-ml.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^#(?:if[\t\n\r \xA0]+(?:[a-z_$][\w\']*|``[^\r\n\t`]*(?:``|$))|else|endif|light)/i,null,"#"],["str",/^(?:\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)|\'(?:[^\'\\]|\\[\s\S])(?:\'|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\r\n]*|\(\*[\s\S]*?\*\))/],["kwd",/^(?:abstract|and|as|assert|begin|class|default|delegate|do|done|downcast|downto|elif|else|end|exception|extern|false|finally|for|fun|function|if|in|inherit|inline|interface|internal|lazy|let|match|member|module|mutable|namespace|new|null|of|open|or|override|private|public|rec|return|static|struct|then|to|true|try|type|upcast|use|val|void|when|while|with|yield|asr|land|lor|lsl|lsr|lxor|mod|sig|atomic|break|checked|component|const|constraint|constructor|continue|eager|event|external|fixed|functor|global|include|method|mixin|object|parallel|process|protected|pure|sealed|trait|virtual|volatile)\b/], 18 | ["lit",/^[+\-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^(?:[a-z_][\w']*[!?#]?|``[^\r\n\t`]*(?:``|$))/i],["pun",/^[^\t\n\r \xA0\"\'\w]+/]]),["fs","ml"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-mumps.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2011 Kitware Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"]|\\.)*")/,null,'"']],[["com",/^;[^\r\n]*/,null,";"],["dec",/^(?:\$(?:D|DEVICE|EC|ECODE|ES|ESTACK|ET|ETRAP|H|HOROLOG|I|IO|J|JOB|K|KEY|P|PRINCIPAL|Q|QUIT|ST|STACK|S|STORAGE|SY|SYSTEM|T|TEST|TL|TLEVEL|TR|TRESTART|X|Y|Z[A-Z]*|A|ASCII|C|CHAR|D|DATA|E|EXTRACT|F|FIND|FN|FNUMBER|G|GET|J|JUSTIFY|L|LENGTH|NA|NAME|O|ORDER|P|PIECE|QL|QLENGTH|QS|QSUBSCRIPT|Q|QUERY|R|RANDOM|RE|REVERSE|S|SELECT|ST|STACK|T|TEXT|TR|TRANSLATE|NaN))\b/i, 18 | null],["kwd",/^(?:[^\$]B|BREAK|C|CLOSE|D|DO|E|ELSE|F|FOR|G|GOTO|H|HALT|H|HANG|I|IF|J|JOB|K|KILL|L|LOCK|M|MERGE|N|NEW|O|OPEN|Q|QUIT|R|READ|S|SET|TC|TCOMMIT|TRE|TRESTART|TRO|TROLLBACK|TS|TSTART|U|USE|V|VIEW|W|WRITE|X|XECUTE)\b/i,null],["lit",/^[+-]?(?:(?:\.\d+|\d+(?:\.\d*)?)(?:E[+\-]?\d+)?)/i],["pln",/^[a-z][a-zA-Z0-9]*/i],["pun",/^[^\w\t\n\r\xA0\"\$;%\^]|_/]]),["mumps"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-n.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2011 Zimin A.V. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*\'|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null],["str",/^<#(?:[^#>])*(?:#>|$)/,null],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null],["com",/^\/\/[^\r\n]*/, 18 | null],["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, 19 | null],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,null],["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^@[A-Z]+[a-z][A-Za-z_$@0-9]*/,null],["pln",/^'?[A-Za-z_$][a-z_$@0-9]*/i,null],["lit",/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,null,"0123456789"],["pun",/^.[^\s\w\.$@\'\"\`\/\#]*/,null]]),["n","nemerle"]); 20 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-nemerle.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2011 Zimin A.V. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*\'|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,'"'],["com",/^#(?:(?:define|elif|else|endif|error|ifdef|include|ifndef|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["str",/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null],["str",/^<#(?:[^#>])*(?:#>|$)/,null],["str",/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h|[a-z]\w*)>/,null],["com",/^\/\/[^\r\n]*/, 18 | null],["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null],["kwd",/^(?:abstract|and|as|base|catch|class|def|delegate|enum|event|extern|false|finally|fun|implements|interface|internal|is|macro|match|matches|module|mutable|namespace|new|null|out|override|params|partial|private|protected|public|ref|sealed|static|struct|syntax|this|throw|true|try|type|typeof|using|variant|virtual|volatile|when|where|with|assert|assert2|async|break|checked|continue|do|else|ensures|for|foreach|if|late|lock|new|nolate|otherwise|regexp|repeat|requires|return|surroundwith|unchecked|unless|using|while|yield)\b/, 19 | null],["typ",/^(?:array|bool|byte|char|decimal|double|float|int|list|long|object|sbyte|short|string|ulong|uint|ufloat|ulong|ushort|void)\b/,null],["lit",/^@[a-z_$][a-z_$@0-9]*/i,null],["typ",/^@[A-Z]+[a-z][A-Za-z_$@0-9]*/,null],["pln",/^'?[A-Za-z_$][a-z_$@0-9]*/i,null],["lit",/^(?:0x[a-f0-9]+|(?:\d(?:_\d+)*\d*(?:\.\d*)?|\.\d\+)(?:e[+\-]?\d+)?)[a-z]*/i,null,"0123456789"],["pun",/^.[^\s\w\.$@\'\"\`\/\#]*/,null]]),["n","nemerle"]); 20 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-pascal.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2013 Peter Kofler 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["str",/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$))/,null,"'"],["pln",/^\s+/,null," \r\n\t\u00a0"]],[["com",/^\(\*[\s\S]*?(?:\*\)|$)|^\{[\s\S]*?(?:\}|$)/,null],["kwd",/^(?:ABSOLUTE|AND|ARRAY|ASM|ASSEMBLER|BEGIN|CASE|CONST|CONSTRUCTOR|DESTRUCTOR|DIV|DO|DOWNTO|ELSE|END|EXTERNAL|FOR|FORWARD|FUNCTION|GOTO|IF|IMPLEMENTATION|IN|INLINE|INTERFACE|INTERRUPT|LABEL|MOD|NOT|OBJECT|OF|OR|PACKED|PROCEDURE|PROGRAM|RECORD|REPEAT|SET|SHL|SHR|THEN|TO|TYPE|UNIT|UNTIL|USES|VAR|VIRTUAL|WHILE|WITH|XOR)\b/i, 18 | null],["lit",/^(?:true|false|self|nil)/i,null],["pln",/^[a-z][a-z0-9]*/i,null],["lit",/^(?:\$[a-f0-9]+|(?:\d+(?:\.\d*)?|\.\d+)(?:e[+\-]?\d+)?)/i,null,"0123456789"],["pun",/^.[^\s\w\.$@\'\/]*/,null]]),["pascal"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-proto.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2006 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.sourceDecorator({keywords:"bytes,default,double,enum,extend,extensions,false,group,import,max,message,option,optional,package,repeated,required,returns,rpc,service,syntax,to,true",types:/^(bool|(double|s?fixed|[su]?int)(32|64)|float|string)\b/,cStyleComments:!0}),["proto"]); 18 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-r.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2012 Jeffrey B. Arnold 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![A-Za-z0-9_.])/],["lit",/^0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?/],["lit",/^[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|[0-9]+))(?![A-Za-z0-9_.])/], 18 | ["pun",/^(?:<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\*|\+|\^|\/|!|%.*?%|=|~|\$|@|:{1,3}|[\[\](){};,?])/],["pln",/^(?:[A-Za-z]+[A-Za-z0-9_.]*|\.[a-zA-Z_][0-9a-zA-Z\._]*)(?![A-Za-z0-9_.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-rd.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2012 Jeffrey Arnold 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\r\n]*/,null,"%"]],[["lit",/^\\(?:cr|l?dots|R|tab)\b/],["kwd",/^\\[a-zA-Z@]+/],["kwd",/^#(?:ifn?def|endif)/],["pln",/^\\[{}]/],["pun",/^[{}()\[\]]+/]]),["Rd","rd"]); 18 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-rkt.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-rust.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015 Chris Morgan 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([],[["pln",/^[\t\n\r \xA0]+/],["com",/^\/\/.*/],["com",/^\/\*[\s\S]*?(?:\*\/|$)/],["str",/^b"(?:[^\\]|\\(?:.|x[\da-fA-F]{2}))*?"/],["str",/^"(?:[^\\]|\\(?:.|x[\da-fA-F]{2}|u\{\[\da-fA-F]{1,6}\}))*?"/],["str",/^b?r(#*)\"[\s\S]*?\"\1/],["str",/^b'([^\\]|\\(.|x[\da-fA-F]{2}))'/],["str",/^'([^\\]|\\(.|x[\da-fA-F]{2}|u\{[\da-fA-F]{1,6}\}))'/],["tag",/^'\w+?\b/],["kwd",/^(?:match|if|else|as|break|box|continue|extern|fn|for|in|if|impl|let|loop|pub|return|super|unsafe|where|while|use|mod|trait|struct|enum|type|move|mut|ref|static|const|crate)\b/], 18 | ["kwd",/^(?:alignof|become|do|offsetof|priv|pure|sizeof|typeof|unsized|yield|abstract|virtual|final|override|macro)\b/],["typ",/^(?:[iu](8|16|32|64|size)|char|bool|f32|f64|str|Self)\b/],["typ",/^(?:Copy|Send|Sized|Sync|Drop|Fn|FnMut|FnOnce|Box|ToOwned|Clone|PartialEq|PartialOrd|Eq|Ord|AsRef|AsMut|Into|From|Default|Iterator|Extend|IntoIterator|DoubleEndedIterator|ExactSizeIterator|Option|Some|None|Result|Ok|Err|SliceConcatExt|String|ToString|Vec)\b/],["lit",/^(self|true|false|null)\b/], 19 | ["lit",/^\d[0-9_]*(?:[iu](?:size|8|16|32|64))?/],["lit",/^0x[a-fA-F0-9_]+(?:[iu](?:size|8|16|32|64))?/],["lit",/^0o[0-7_]+(?:[iu](?:size|8|16|32|64))?/],["lit",/^0b[01_]+(?:[iu](?:size|8|16|32|64))?/],["lit",/^\d[0-9_]*\.(?![^\s\d.])/],["lit",/^\d[0-9_]*(?:\.\d[0-9_]*)(?:[eE][+-]?[0-9_]+)?(?:f32|f64)?/],["lit",/^\d[0-9_]*(?:\.\d[0-9_]*)?(?:[eE][+-]?[0-9_]+)(?:f32|f64)?/],["lit",/^\d[0-9_]*(?:\.\d[0-9_]*)?(?:[eE][+-]?[0-9_]+)?(?:f32|f64)/], 20 | ["atn",/^[a-z_]\w*!/i],["pln",/^[a-z_]\w*/i],["atv",/^#!?\[[\s\S]*?\]/],["pun",/^[+\-/*=^&|!<>%[\](){}?:.,;]/],["pln",/./]]),["rust"]); 21 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-s.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2012 Jeffrey B. Arnold 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"'],["str",/^\'(?:[^\'\\]|\\[\s\S])*(?:\'|$)/,null,"'"]],[["com",/^#.*/],["kwd",/^(?:if|else|for|while|repeat|in|next|break|return|switch|function)(?![A-Za-z0-9_.])/],["lit",/^0[xX][a-fA-F0-9]+([pP][0-9]+)?[Li]?/],["lit",/^[+-]?([0-9]+(\.[0-9]+)?|\.[0-9]+)([eE][+-]?[0-9]+)?[Li]?/],["lit",/^(?:NULL|NA(?:_(?:integer|real|complex|character)_)?|Inf|TRUE|FALSE|NaN|\.\.(?:\.|[0-9]+))(?![A-Za-z0-9_.])/], 18 | ["pun",/^(?:<>?|-|==|<=|>=|<|>|&&?|!=|\|\|?|\*|\+|\^|\/|!|%.*?%|=|~|\$|@|:{1,3}|[\[\](){};,?])/],["pln",/^(?:[A-Za-z]+[A-Za-z0-9_.]*|\.[a-zA-Z_][0-9a-zA-Z\._]*)(?![A-Za-z0-9_.])/],["str",/^`.+`/]]),["r","s","R","S","Splus"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-scala.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2010 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:(?:""(?:""?(?!")|[^\\"]|\\.)*"{0,3})|(?:[^"\r\n\\]|\\.)*"?))/,null,'"'],["lit",/^`(?:[^\r\n\\`]|\\.)*`?/,null,"`"],["pun",/^[!#%&()*+,\-:;<=>?@\[\\\]^{|}~]+/,null,"!#%&()*+,-:;<=>?@[\\]^{|}~"]],[["str",/^'(?:[^\r\n\\']|\\(?:'|[^\r\n']+))'/],["lit",/^'[a-zA-Z_$][\w$]*(?!['$\w])/],["kwd",/^(?:abstract|case|catch|class|def|do|else|extends|final|finally|for|forSome|if|implicit|import|lazy|match|new|object|override|package|private|protected|requires|return|sealed|super|throw|trait|try|type|val|var|while|with|yield)\b/], 18 | ["lit",/^(?:true|false|null|this)\b/],["lit",/^(?:(?:0(?:[0-7]+|X[0-9A-F]+))L?|(?:(?:0|[1-9][0-9]*)(?:(?:\.[0-9]+)?(?:E[+\-]?[0-9]+)?F?|L?))|\\.[0-9]+(?:E[+\-]?[0-9]+)?F?)/i],["typ",/^[$_]*[A-Z][_$A-Z0-9]*[a-z][\w$]*/],["pln",/^[$a-zA-Z_][\w$]*/],["com",/^\/(?:\/.*|\*(?:\/|\**[^*/])*(?:\*+\/?)?)/],["pun",/^(?:\.+|\/)/]]),["scala"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-scm.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-sql.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^\"\\]|\\.)*"|'(?:[^\'\\]|\\.)*')/,null,"\"'"]],[["com",/^(?:--[^\r\n]*|\/\*[\s\S]*?(?:\*\/|$))/],["kwd",/^(?:ADD|ALL|ALTER|AND|ANY|APPLY|AS|ASC|AUTHORIZATION|BACKUP|BEGIN|BETWEEN|BREAK|BROWSE|BULK|BY|CASCADE|CASE|CHECK|CHECKPOINT|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMN|COMMIT|COMPUTE|CONNECT|CONSTRAINT|CONTAINS|CONTAINSTABLE|CONTINUE|CONVERT|CREATE|CROSS|CURRENT|CURRENT_DATE|CURRENT_TIME|CURRENT_TIMESTAMP|CURRENT_USER|CURSOR|DATABASE|DBCC|DEALLOCATE|DECLARE|DEFAULT|DELETE|DENY|DESC|DISK|DISTINCT|DISTRIBUTED|DOUBLE|DROP|DUMMY|DUMP|ELSE|END|ERRLVL|ESCAPE|EXCEPT|EXEC|EXECUTE|EXISTS|EXIT|FETCH|FILE|FILLFACTOR|FOLLOWING|FOR|FOREIGN|FREETEXT|FREETEXTTABLE|FROM|FULL|FUNCTION|GOTO|GRANT|GROUP|HAVING|HOLDLOCK|IDENTITY|IDENTITYCOL|IDENTITY_INSERT|IF|IN|INDEX|INNER|INSERT|INTERSECT|INTO|IS|JOIN|KEY|KILL|LEFT|LIKE|LINENO|LOAD|MATCH|MATCHED|MERGE|NATURAL|NATIONAL|NOCHECK|NONCLUSTERED|NOCYCLE|NOT|NULL|NULLIF|OF|OFF|OFFSETS|ON|OPEN|OPENDATASOURCE|OPENQUERY|OPENROWSET|OPENXML|OPTION|OR|ORDER|OUTER|OVER|PARTITION|PERCENT|PIVOT|PLAN|PRECEDING|PRECISION|PRIMARY|PRINT|PROC|PROCEDURE|PUBLIC|RAISERROR|READ|READTEXT|RECONFIGURE|REFERENCES|REPLICATION|RESTORE|RESTRICT|RETURN|REVOKE|RIGHT|ROLLBACK|ROWCOUNT|ROWGUIDCOL|ROWS?|RULE|SAVE|SCHEMA|SELECT|SESSION_USER|SET|SETUSER|SHUTDOWN|SOME|START|STATISTICS|SYSTEM_USER|TABLE|TEXTSIZE|THEN|TO|TOP|TRAN|TRANSACTION|TRIGGER|TRUNCATE|TSEQUAL|UNBOUNDED|UNION|UNIQUE|UNPIVOT|UPDATE|UPDATETEXT|USE|USER|USING|VALUES|VARYING|VIEW|WAITFOR|WHEN|WHERE|WHILE|WITH|WITHIN|WRITETEXT|XML)(?=[^\w-]|$)/i, 18 | null],["lit",/^[+-]?(?:0x[\da-f]+|(?:(?:\.\d+|\d+(?:\.\d*)?)(?:e[+\-]?\d+)?))/i],["pln",/^[a-z_][\w-]*/i],["pun",/^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0+\-\"\']*/]]),["sql"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-ss.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2008 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,null,"("],["clo",/^\)+/,null,")"],["com",/^;[^\r\n]*/,null,";"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:block|c[ad]+r|catch|con[ds]|def(?:ine|un)|do|eq|eql|equal|equalp|eval-when|flet|format|go|if|labels|lambda|let|load-time-value|locally|macrolet|multiple-value-call|nil|progn|progv|quote|require|return-from|setq|symbol-macrolet|t|tagbody|the|throw|unwind)\b/, 18 | null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i],["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),"cl el lisp lsp scm ss rkt".split(" ")); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-swift.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015 Google Inc. 4 | Licensed under the Apache License, Version 2.0 (the "License"); 5 | you may not use this file except in compliance with the License. 6 | You may obtain a copy of the License at 7 | 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | */ 15 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[ \n\r\t\v\f\0]+/,null," \n\r\t\v\f\x00"],["str",/^"(?:[^"\\]|(?:\\.)|(?:\\\((?:[^"\\)]|\\.)*\)))*"/,null,'"']],[["lit",/^(?:(?:0x[\da-fA-F][\da-fA-F_]*\.[\da-fA-F][\da-fA-F_]*[pP]?)|(?:\d[\d_]*\.\d[\d_]*[eE]?))[+-]?\d[\d_]*/,null],["lit",/^-?(?:(?:0(?:(?:b[01][01_]*)|(?:o[0-7][0-7_]*)|(?:x[\da-fA-F][\da-fA-F_]*)))|(?:\d[\d_]*))/,null],["lit",/^(?:true|false|nil)\b/,null],["kwd",/^\b(?:__COLUMN__|__FILE__|__FUNCTION__|__LINE__|#available|#else|#elseif|#endif|#if|#line|arch|arm|arm64|associativity|as|break|case|catch|class|continue|convenience|default|defer|deinit|didSet|do|dynamic|dynamicType|else|enum|fallthrough|final|for|func|get|import|indirect|infix|init|inout|internal|i386|if|in|iOS|iOSApplicationExtension|is|lazy|left|let|mutating|none|nonmutating|operator|optional|OSX|OSXApplicationExtension|override|postfix|precedence|prefix|private|protocol|Protocol|public|required|rethrows|return|right|safe|self|set|static|struct|subscript|super|switch|throw|try|Type|typealias|unowned|unsafe|var|weak|watchOS|while|willSet|x86_64)\b/, 16 | null],["com",/^\/\/.*?[\n\r]/,null],["com",/^\/\*[\s\S]*?(?:\*\/|$)/,null],["pun",/^<<=|<=|<<|>>=|>=|>>|===|==|\.\.\.|&&=|\.\.<|!==|!=|&=|~=|~|\(|\)|\[|\]|{|}|@|#|;|\.|,|:|\|\|=|\?\?|\|\||&&|&\*|&\+|&-|&=|\+=|-=|\/=|\*=|\^=|%=|\|=|->|`|==|\+\+|--|\/|\+|!|\*|%|<|>|&|\||\^|\?|=|-|_/,null],["typ",/^\b(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null]]),["swift"]); 17 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-tcl.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2012 Pyrios 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\{+/,null,"{"],["clo",/^\}+/,null,"}"],["com",/^#[^\r\n]*/,null,"#"],["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["str",/^\"(?:[^\"\\]|\\[\s\S])*(?:\"|$)/,null,'"']],[["kwd",/^(?:after|append|apply|array|break|case|catch|continue|error|eval|exec|exit|expr|for|foreach|if|incr|info|proc|return|set|switch|trace|uplevel|upvar|while)\b/,null],["lit",/^[+\-]?(?:[0#]x[0-9a-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[ed][+\-]?\d+)?)/i], 18 | ["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["tcl"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-tex.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2011 Martin S. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\r\n]*/,null,"%"]],[["kwd",/^\\[a-zA-Z@]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[{}()\[\]=]+/]]),["latex","tex"]); 18 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-vb.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0\u2028\u2029]+/,null,"\t\n\r \u00a0\u2028\u2029"],["str",/^(?:[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})(?:[\"\u201C\u201D]c|$)|[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})*(?:[\"\u201C\u201D]|$))/i,null,'"\u201c\u201d'],["com",/^[\'\u2018\u2019](?:_(?:\r\n?|[^\r]?)|[^\r\n_\u2028\u2029])*/,null,"'\u2018\u2019"]],[["kwd",/^(?:AddHandler|AddressOf|Alias|And|AndAlso|Ansi|As|Assembly|Auto|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|CBool|CByte|CChar|CDate|CDbl|CDec|Char|CInt|Class|CLng|CObj|Const|CShort|CSng|CStr|CType|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else|ElseIf|End|EndIf|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get|GetType|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|Let|Lib|Like|Long|Loop|Me|Mod|Module|MustInherit|MustOverride|MyBase|MyClass|Namespace|New|Next|Not|NotInheritable|NotOverridable|Object|On|Option|Optional|Or|OrElse|Overloads|Overridable|Overrides|ParamArray|Preserve|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|Select|Set|Shadows|Shared|Short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TypeOf|Unicode|Until|Variant|Wend|When|While|With|WithEvents|WriteOnly|Xor|EndIf|GoSub|Let|Variant|Wend)\b/i, 18 | null],["com",/^REM\b[^\r\n\u2028\u2029]*/i],["lit",/^(?:True\b|False\b|Nothing\b|\d+(?:E[+\-]?\d+[FRD]?|[FRDSIL])?|(?:&H[0-9A-F]+|&O[0-7]+)[SIL]?|\d*\.\d+(?:E[+\-]?\d+)?[FRD]?|#\s+(?:\d+[\-\/]\d+[\-\/]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)?|\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*(?:\[[%&@!#]+\])?|\[(?:[a-z]|_\w)\w*\])/i],["pun",/^[^\w\t\n\r \"\'\[\]\xA0\u2018\u2019\u201C\u201D\u2028\u2029]+/],["pun",/^(?:\[|\])/]]),["vb", 19 | "vbs"]); 20 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-vbs.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0\u2028\u2029]+/,null,"\t\n\r \u00a0\u2028\u2029"],["str",/^(?:[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})(?:[\"\u201C\u201D]c|$)|[\"\u201C\u201D](?:[^\"\u201C\u201D]|[\"\u201C\u201D]{2})*(?:[\"\u201C\u201D]|$))/i,null,'"\u201c\u201d'],["com",/^[\'\u2018\u2019](?:_(?:\r\n?|[^\r]?)|[^\r\n_\u2028\u2029])*/,null,"'\u2018\u2019"]],[["kwd",/^(?:AddHandler|AddressOf|Alias|And|AndAlso|Ansi|As|Assembly|Auto|Boolean|ByRef|Byte|ByVal|Call|Case|Catch|CBool|CByte|CChar|CDate|CDbl|CDec|Char|CInt|Class|CLng|CObj|Const|CShort|CSng|CStr|CType|Date|Decimal|Declare|Default|Delegate|Dim|DirectCast|Do|Double|Each|Else|ElseIf|End|EndIf|Enum|Erase|Error|Event|Exit|Finally|For|Friend|Function|Get|GetType|GoSub|GoTo|Handles|If|Implements|Imports|In|Inherits|Integer|Interface|Is|Let|Lib|Like|Long|Loop|Me|Mod|Module|MustInherit|MustOverride|MyBase|MyClass|Namespace|New|Next|Not|NotInheritable|NotOverridable|Object|On|Option|Optional|Or|OrElse|Overloads|Overridable|Overrides|ParamArray|Preserve|Private|Property|Protected|Public|RaiseEvent|ReadOnly|ReDim|RemoveHandler|Resume|Return|Select|Set|Shadows|Shared|Short|Single|Static|Step|Stop|String|Structure|Sub|SyncLock|Then|Throw|To|Try|TypeOf|Unicode|Until|Variant|Wend|When|While|With|WithEvents|WriteOnly|Xor|EndIf|GoSub|Let|Variant|Wend)\b/i, 18 | null],["com",/^REM\b[^\r\n\u2028\u2029]*/i],["lit",/^(?:True\b|False\b|Nothing\b|\d+(?:E[+\-]?\d+[FRD]?|[FRDSIL])?|(?:&H[0-9A-F]+|&O[0-7]+)[SIL]?|\d*\.\d+(?:E[+\-]?\d+)?[FRD]?|#\s+(?:\d+[\-\/]\d+[\-\/]\d+(?:\s+\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)?|\d+:\d+(?::\d+)?(\s*(?:AM|PM))?)\s+#)/i],["pln",/^(?:(?:[a-z]|_\w)\w*(?:\[[%&@!#]+\])?|\[(?:[a-z]|_\w)\w*\])/i],["pun",/^[^\w\t\n\r \"\'\[\]\xA0\u2018\u2019\u201C\u201D\u2028\u2029]+/],["pun",/^(?:\[|\])/]]),["vb", 19 | "vbs"]); 20 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-vhd.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2010 benoit@ryder.fr 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"]],[["str",/^(?:[BOX]?"(?:[^\"]|"")*"|'.')/i],["com",/^--[^\r\n]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, 18 | null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^\'(?:ACTIVE|ASCENDING|BASE|DELAYED|DRIVING|DRIVING_VALUE|EVENT|HIGH|IMAGE|INSTANCE_NAME|LAST_ACTIVE|LAST_EVENT|LAST_VALUE|LEFT|LEFTOF|LENGTH|LOW|PATH_NAME|POS|PRED|QUIET|RANGE|REVERSE_RANGE|RIGHT|RIGHTOF|SIMPLE_NAME|STABLE|SUCC|TRANSACTION|VAL|VALUE)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w\\.]+#(?:[+\-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:E[+\-]?\d+(?:_\d+)*)?)/i], 19 | ["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0\-\"\']*/]]),["vhdl","vhd"]); 20 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-vhdl.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2010 benoit@ryder.fr 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xA0]+/,null,"\t\n\r \u00a0"]],[["str",/^(?:[BOX]?"(?:[^\"]|"")*"|'.')/i],["com",/^--[^\r\n]*/],["kwd",/^(?:abs|access|after|alias|all|and|architecture|array|assert|attribute|begin|block|body|buffer|bus|case|component|configuration|constant|disconnect|downto|else|elsif|end|entity|exit|file|for|function|generate|generic|group|guarded|if|impure|in|inertial|inout|is|label|library|linkage|literal|loop|map|mod|nand|new|next|nor|not|null|of|on|open|or|others|out|package|port|postponed|procedure|process|pure|range|record|register|reject|rem|report|return|rol|ror|select|severity|shared|signal|sla|sll|sra|srl|subtype|then|to|transport|type|unaffected|units|until|use|variable|wait|when|while|with|xnor|xor)(?=[^\w-]|$)/i, 18 | null],["typ",/^(?:bit|bit_vector|character|boolean|integer|real|time|string|severity_level|positive|natural|signed|unsigned|line|text|std_u?logic(?:_vector)?)(?=[^\w-]|$)/i,null],["typ",/^\'(?:ACTIVE|ASCENDING|BASE|DELAYED|DRIVING|DRIVING_VALUE|EVENT|HIGH|IMAGE|INSTANCE_NAME|LAST_ACTIVE|LAST_EVENT|LAST_VALUE|LEFT|LEFTOF|LENGTH|LOW|PATH_NAME|POS|PRED|QUIET|RANGE|REVERSE_RANGE|RIGHT|RIGHTOF|SIMPLE_NAME|STABLE|SUCC|TRANSACTION|VAL|VALUE)(?=[^\w-]|$)/i,null],["lit",/^\d+(?:_\d+)*(?:#[\w\\.]+#(?:[+\-]?\d+(?:_\d+)*)?|(?:\.\d+(?:_\d+)*)?(?:E[+\-]?\d+(?:_\d+)*)?)/i], 19 | ["pln",/^(?:[a-z]\w*|\\[^\\]*\\)/i],["pun",/^[^\w\t\n\r \xA0\"\'][^\w\t\n\r \xA0\-\"\']*/]]),["vhdl","vhd"]); 20 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-wiki.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2009 Google Inc. 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t \xA0a-gi-z0-9]+/,null,"\t \u00a0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[=*~\^\[\]]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^(?:[A-Z][a-z][a-z0-9]+[A-Z][a-z][a-zA-Z0-9]+)\b/],["lang-",/^\{\{\{([\s\S]+?)\}\}\}/],["lang-",/^`([^\r\n`]+)`/],["str",/^https?:\/\/[^\/?#\s]*(?:\/[^?#\s]*)?(?:\?[^#\s]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\s\S])[^#=*~^A-Zh\{`\[\r\n]*/]]),["wiki"]); 18 | PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-yaml.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015 ribrdb @ code.google.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:|>?]+/,null,":|>?"],["dec",/^%(?:YAML|TAG)[^#\r\n]+/,null,"%"],["typ",/^[&]\S+/,null,"&"],["typ",/^!\S*/,null,"!"],["str",/^"(?:[^\\"]|\\.)*(?:"|$)/,null,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,null,"'"],["com",/^#[^\r\n]*/,null,"#"],["pln",/^\s+/,null," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\r\n]|$)/],["pun",/^-/],["kwd",/^[\w-]+:[ \r\n]/],["pln", 18 | /^\w+/]]),["yaml","yml"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/lang-yml.js: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright (C) 2015 ribrdb @ code.google.com 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | 9 | http://www.apache.org/licenses/LICENSE-2.0 10 | 11 | Unless required by applicable law or agreed to in writing, software 12 | distributed under the License is distributed on an "AS IS" BASIS, 13 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 | See the License for the specific language governing permissions and 15 | limitations under the License. 16 | */ 17 | PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:|>?]+/,null,":|>?"],["dec",/^%(?:YAML|TAG)[^#\r\n]+/,null,"%"],["typ",/^[&]\S+/,null,"&"],["typ",/^!\S*/,null,"!"],["str",/^"(?:[^\\"]|\\.)*(?:"|$)/,null,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,null,"'"],["com",/^#[^\r\n]*/,null,"#"],["pln",/^\s+/,null," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\r\n]|$)/],["pun",/^-/],["kwd",/^[\w-]+:[ \r\n]/],["pln", 18 | /^\w+/]]),["yaml","yml"]); 19 | -------------------------------------------------------------------------------- /www/doc/vendor/prettify/prettify.css: -------------------------------------------------------------------------------- 1 | .pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee} -------------------------------------------------------------------------------- /www/static/css/style.css: -------------------------------------------------------------------------------- 1 | 2 | .ellipsis { 3 | position: relative; 4 | overflow: hidden; 5 | text-overflow: ellipsis; 6 | display: -webkit-box; 7 | height: 64px; 8 | } 9 | 10 | .ant-btn.newButton { 11 | background-color: #fff; 12 | border-color: #d9d9d9; 13 | border-radius: 2px; 14 | color: rgba(0,0,0,.45); 15 | width: 100%; 16 | height: 185px; 17 | } 18 | 19 | .logo { 20 | /* width: 120px; */ 21 | height: 31px; 22 | /* background: rgba(255,255,255,.2); */ 23 | margin: 16px 24px 16px 0; 24 | float: left; 25 | color: #FFF; 26 | font-size: 32px; 27 | line-height: 32px; 28 | } 29 | 30 | .editable-cell { 31 | position: relative; 32 | } 33 | 34 | .editable-cell-input-wrapper, 35 | .editable-cell-text-wrapper { 36 | padding-right: 24px; 37 | } 38 | 39 | .editable-cell-text-wrapper { 40 | padding: 5px 24px 5px 5px; 41 | } 42 | 43 | .editable-cell-icon, 44 | .editable-cell-icon-check { 45 | position: absolute; 46 | right: 0; 47 | width: 20px; 48 | cursor: pointer; 49 | } 50 | 51 | .editable-cell-icon { 52 | line-height: 18px; 53 | display: none; 54 | } 55 | 56 | .editable-cell-icon-check { 57 | line-height: 28px; 58 | } 59 | 60 | .editable-cell:hover .editable-cell-icon { 61 | display: inline-block; 62 | } 63 | 64 | .editable-cell-icon:hover, 65 | .editable-cell-icon-check:hover { 66 | color: #108ee9; 67 | } 68 | 69 | .editable-add-btn { 70 | margin-bottom: 8px; 71 | } 72 | 73 | .editable-row-operations a + a { 74 | margin-left: 10px; 75 | } 76 | 77 | 78 | .api-name, .api-name:focus, 79 | .api-desc, .api-desc:focus, 80 | .api-format, .api-format:focus, 81 | .api-callback, .api-callback:focus { 82 | border-top: none; 83 | border-left: none; 84 | border-right: none; 85 | outline: none; 86 | border-radius: 0; 87 | box-shadow: none; 88 | } 89 | 90 | .api-name, .api-name:focus { 91 | font-size: 30px; 92 | line-height: 80px; 93 | height: 80px; 94 | padding: 2.25rem 0; 95 | margin-bottom: 20px; 96 | } 97 | 98 | .api-desc, .api-desc:focus { 99 | font-size: 20px; 100 | min-height: 150px; 101 | padding: 1.25rem 0; 102 | } 103 | 104 | 105 | .api-format, .api-format:forcus, 106 | .api-callback, .api-callback:forcus { 107 | font-size: 16px; 108 | padding: 2rem 0; 109 | } 110 | .api-params { 111 | padding: 30px 0; 112 | } 113 | 114 | .api-params label, .api-resp>label { 115 | font-size: 20px; 116 | font-weight: bold; 117 | } 118 | 119 | .sub-menu-title .sub-menu-opt { 120 | display: none; 121 | margin-left: 10px; 122 | } 123 | .sub-menu-title:hover .sub-menu-opt { 124 | display: inline-block; 125 | } 126 | 127 | .ant-layout { 128 | min-height: 100vh; 129 | } 130 | 131 | .login { 132 | margin: 200px auto auto; 133 | width: 400px; 134 | } 135 | .login h1 { 136 | text-align: center; 137 | } 138 | .user-pop { 139 | position: absolute; 140 | right: 15px; 141 | top: 0; 142 | color: #FFF; 143 | } 144 | .user-pop .ant-avatar { 145 | margin-right: 10px; 146 | } -------------------------------------------------------------------------------- /www/static/image/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizheming/animaris/6151225a7c7304791a369cd561acfa37147d704f/www/static/image/.gitkeep -------------------------------------------------------------------------------- /www/static/js/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lizheming/animaris/6151225a7c7304791a369cd561acfa37147d704f/www/static/js/.gitkeep -------------------------------------------------------------------------------- /www/static/src/Edit.jsx: -------------------------------------------------------------------------------- 1 | import { PureComponent } from 'react'; 2 | import {Layout, Button} from 'antd'; 3 | import API from './components/Api'; 4 | import SideApi from './components/SideApi'; 5 | import rq from './components/request'; 6 | 7 | export default class extends PureComponent { 8 | constructor(props, state) { 9 | super(props, state); 10 | this.id = props.match.params.id; 11 | 12 | this.getDoc(); 13 | this.state = this.initState(); 14 | } 15 | 16 | initState() { 17 | return { 18 | data: {interfaces: []}, 19 | currentItem: null, 20 | currentApi: { 21 | name: '', 22 | cate: '', 23 | desc: '', 24 | args: [], 25 | resp: [{key: 1}] 26 | } 27 | }; 28 | } 29 | 30 | async getDoc() { 31 | const resp = await rq.get(`/api/doc/${this.id}`); 32 | if (resp.errno) { 33 | return; 34 | } 35 | const {data} = resp; 36 | this.setState({data: {id: data._id, interfaces: [], ...data.data}}); 37 | } 38 | 39 | onEdit(data) { 40 | const currentApiIndex = this.state.data.interfaces.findIndex(api => 41 | api.name === data 42 | ); 43 | if (currentApiIndex === -1) { 44 | return; 45 | } 46 | 47 | const currentApi = this.state.data.interfaces[currentApiIndex]; 48 | this.setState({currentApi, currentItem: data}); 49 | } 50 | 51 | onCancel() { 52 | const {currentItem, currentApi} = this.initState(); 53 | this.setState({currentItem, currentApi}); 54 | } 55 | 56 | async onSave() { 57 | const {currentItem, currentApi, data} = this.state; 58 | const newData = Object.assign({}, data); 59 | const interfaces = Array.from(newData.interfaces); 60 | 61 | if (!currentApi.name || !currentApi.cate) { 62 | return alert('请填写完整内容'); 63 | } 64 | 65 | if (!currentItem) { 66 | interfaces.push(currentApi); 67 | newData.interfaces = interfaces; 68 | await rq.put(`/api/doc/${this.id}`, {data: newData}); 69 | return this.setState({data: newData, currentItem: currentApi.name}); 70 | } 71 | 72 | const currentApiIndex = interfaces.findIndex(api => api.name === currentItem); 73 | if (currentApiIndex === -1) { 74 | return; 75 | } 76 | 77 | interfaces[currentApiIndex] = currentApi; 78 | newData.interfaces = interfaces; 79 | 80 | await rq.put(`/api/doc/${this.id}`, {data: newData}); 81 | return this.setState({data: newData}); 82 | } 83 | 84 | render() { 85 | return ( 86 | 87 | 88 | this.setState({data})} 91 | onSelect={data => this.onEdit(data)} 92 | onDeSelect={this.onCancel.bind(this)} 93 | /> 94 | 95 | 96 | this.setState({currentApi: data})} 99 | /> 100 | 101 | 102 | 103 | ); 104 | } 105 | } 106 | -------------------------------------------------------------------------------- /www/static/src/Login.jsx: -------------------------------------------------------------------------------- 1 | import {PureComponent} from 'react'; 2 | import {Alert} from 'antd'; 3 | import Login, {UserName, Password, Submit} from 'ant-design-pro/lib/Login'; 4 | import {Link} from 'react-router-dom'; 5 | import rq from './components/request'; 6 | 7 | export default class extends PureComponent { 8 | state = { 9 | notice: '' 10 | } 11 | 12 | onSubmit = async(err, values) => { 13 | if (err) { 14 | return false; 15 | } 16 | 17 | const resp = await rq.post('/api/token', values); 18 | if (resp.errno) { 19 | return this.setState({ 20 | notice: resp.errmsg 21 | }); 22 | } 23 | location.href = '/'; 24 | } 25 | 26 | render() { 27 | return ( 28 |
29 |

Animaris

30 | { 31 | this.state.notice && 32 | 33 | } 34 | 35 | 36 | 37 | 登录 38 | 注册账户 39 | 40 |
41 | ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /www/static/src/Mock.jsx: -------------------------------------------------------------------------------- 1 | import {PureComponent} from 'react'; 2 | import {Radio, Input} from 'antd'; 3 | import rq from './components/request'; 4 | 5 | export default class extends PureComponent { 6 | state = { 7 | data: { 8 | interfaces: [] 9 | } 10 | } 11 | 12 | constructor(props, state) { 13 | super(props, state); 14 | 15 | const {id} = props.match.params; 16 | if (!id) { 17 | return; 18 | } 19 | this.id = id; 20 | this.getDoc(); 21 | } 22 | 23 | async getDoc() { 24 | const resp = await rq.get(`/api/doc/${this.id}`); 25 | if (resp.errno) { 26 | return; 27 | } 28 | const {data} = resp; 29 | this.setState({data: {_id: data._id, interfaces: [], ...data.data}}); 30 | } 31 | 32 | async updateActiveResp({name}, respName) { 33 | const data = Object.assign({}, this.state.data); 34 | const {interfaces} = data; 35 | const api = interfaces.find(v => v.name === name); 36 | if (!api) { 37 | return false; 38 | } 39 | 40 | const {resp} = api; 41 | if (!Array.isArray(resp)) { 42 | return false; 43 | } 44 | 45 | for (let i = 0; i < resp.length; i++) { 46 | resp[i].active = resp[i].name === respName; 47 | } 48 | api.resp = resp; 49 | data.interfaces = interfaces; 50 | const result = await rq.put(`/api/doc/${this.id}`, {data}); 51 | if (result.errno) { 52 | return false; 53 | } 54 | this.setState({data, random: Math.random()}); 55 | } 56 | 57 | renderAPI = (api) => { 58 | const activeName = (api.resp.find(r => r.active) || api.resp[0]).name; 59 | return ( 60 | {api.name} 61 | 62 | { 66 | this.updateActiveResp(api, e.target.value); 67 | }}> 68 | {api.resp.map(resp => {resp.name})} 69 | 70 | 71 | ); 72 | } 73 | 74 | render() { 75 | const {iframe, random} = this.state; 76 | const {interfaces} = this.state.data; 77 | const apis = interfaces.filter(api => Array.isArray(api.resp) && api.resp.length && api.resp[0].content).map(this.renderAPI); 78 | return ( 79 |
80 |
81 |

82 | this.setState({iframe: value})} 86 | /> 87 |

88 | 89 |
90 |
91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | {apis} 100 | 101 |
接口名称返回数据
102 |
103 |
104 | ); 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /www/static/src/components/AddOrEditProductModal.jsx: -------------------------------------------------------------------------------- 1 | import {PureComponent} from 'react'; 2 | import {Modal, Input, Form} from 'antd'; 3 | 4 | export default Form.create({ 5 | mapPropsToFields({model}) { 6 | if (!model || !Object.keys(model).length) { 7 | return; 8 | } 9 | 10 | return { 11 | title: Form.createFormField({value: model.title}), 12 | avatar: Form.createFormField({value: model.avatar}), 13 | description: Form.createFormField({value: model.description}) 14 | }; 15 | } 16 | })(class extends PureComponent { 17 | render() { 18 | const {visible, onOk, onCancel, isEdit, model, form} = this.props; 19 | const {getFieldDecorator} = form; 20 | 21 | return ( 22 | 28 |
29 | 30 | {getFieldDecorator('title', { 31 | rules: [ 32 | { 33 | required: true, 34 | message: '请输入产品名称' 35 | } 36 | ] 37 | })()} 38 | 39 | 40 | {getFieldDecorator('avatar', { 41 | rules: [ 42 | { 43 | required: true, 44 | message: '请输入产品LOGO' 45 | } 46 | ] 47 | })()} 48 | 49 | 50 | {getFieldDecorator('description', { 51 | rules: [ 52 | { 53 | required: true, 54 | message: '请输入产品简介' 55 | } 56 | ] 57 | })()} 58 | 59 |
60 |
61 | ); 62 | } 63 | }); 64 | -------------------------------------------------------------------------------- /www/static/src/components/AddOrEditUserModal.jsx: -------------------------------------------------------------------------------- 1 | import {PureComponent} from 'react'; 2 | import {Modal, Form, Select, Spin} from 'antd'; 3 | import rq from './request'; 4 | 5 | export default Form.create({ 6 | // mapPropsToFields({model}) { 7 | // if (!model || !Object.keys(model).length) { 8 | // return; 9 | // } 10 | 11 | // return { 12 | // users: Form.createFormField( 13 | // model.users.map(user => ({ 14 | // text: user.display_name || user.name, 15 | // value: user._id 16 | // })) 17 | // ) 18 | // }; 19 | // } 20 | })(class extends PureComponent { 21 | state = { 22 | data: [], 23 | fetching: false 24 | } 25 | 26 | fetchUser = async keyword => { 27 | this.setState({data: [], fetching: true}); 28 | const resp = await rq.get('/api/user?keyword=' + keyword); 29 | const data = resp.data.data.map(user => ({ 30 | text: user.display_name || user.name, 31 | value: user._id 32 | })); 33 | this.setState({data, fetching: false}); 34 | } 35 | 36 | render() { 37 | const {visible, onOk, onCancel, form, model} = this.props; 38 | const {getFieldDecorator} = form; 39 | const {fetching, data} = this.state; 40 | 41 | const defaultUsers = model ? model.users.map(user => ({ 42 | key: user._id, 43 | label: user.display_name || user.name 44 | })) : []; 45 | 46 | return ( 47 | 53 |
54 | 55 | {getFieldDecorator('users', { 56 | initialValue: defaultUsers, 57 | rules: [ 58 | { 59 | required: true, 60 | message: '请输入成员名称' 61 | } 62 | ] 63 | })()} 74 | 75 |
76 |
77 | ); 78 | } 79 | }); 80 | -------------------------------------------------------------------------------- /www/static/src/components/Api/Resp.jsx: -------------------------------------------------------------------------------- 1 | import {PureComponent} from 'react'; 2 | import { 3 | Tabs, 4 | Input 5 | } from 'antd'; 6 | 7 | const {TabPane} = Tabs; 8 | export default class extends PureComponent { 9 | constructor(props) { 10 | super(props); 11 | this.newTabIndex = 0; 12 | this.state = this.initialState(); 13 | } 14 | 15 | initialState() { 16 | return { 17 | activeKey: this.panes[0].key 18 | }; 19 | } 20 | 21 | get activeKey() { 22 | return this.state.activeKey; 23 | } 24 | 25 | set activeKey(key) { 26 | this.setState({activeKey: key}); 27 | } 28 | 29 | get panes() { 30 | return Array.from(this.props.panes, v => { 31 | v.key = '' + v.key; 32 | return v; 33 | }); 34 | } 35 | 36 | set panes(data) { 37 | this.props.onChange(data); 38 | } 39 | 40 | onEdit(targetKey, action) { 41 | this[action](targetKey); 42 | } 43 | 44 | add() { 45 | const activeKey = 1; 46 | const panes = this.panes.map(pane => { 47 | pane.key += 1; 48 | return pane; 49 | }); 50 | panes.unshift({ 51 | name: 'New Response', 52 | content: '', 53 | key: activeKey 54 | }); 55 | 56 | this.activeKey = activeKey; 57 | this.panes = panes; 58 | } 59 | 60 | remove(targetKey) { 61 | const panes = this.panes; 62 | let activeKey = this.state.activeKey; 63 | let lastIndex; 64 | panes.forEach((pane, i) => { 65 | if (pane.key === targetKey) { 66 | lastIndex = i - 1; 67 | } 68 | }); 69 | const newPanes = panes.filter(pane => pane.key !== targetKey); 70 | if (lastIndex >= 0 && activeKey === targetKey) { 71 | activeKey = newPanes[lastIndex].key; 72 | } 73 | this.activeKey = activeKey; 74 | this.panes = newPanes; 75 | } 76 | 77 | updateData(key, col, val) { 78 | const panes = this.panes; 79 | const targetIndex = panes.findIndex(item => key === item.key); 80 | if(targetIndex === -1) { return; } 81 | 82 | const target = panes[targetIndex]; 83 | target[col] = val; 84 | this.panes = panes; 85 | } 86 | 87 | renderContent(pane) { 88 | return ( 89 | <> 90 |

91 | 92 | this.updateData(pane.key, 'name', e.target.value)} /> 93 |

94 |

95 | 96 | { 100 | let data = e.target.value; 101 | try { 102 | data = JSON.parse(data); 103 | } catch(e) { 104 | console.error('[error][JSON.parse]', data); 105 | } 106 | this.updateData(pane.key, 'content',data); 107 | }} 108 | /> 109 |

110 | 111 | ) 112 | } 113 | 114 | render() { 115 | const panes = this.panes.map(pane => 116 | {this.renderContent(pane)} 121 | ); 122 | 123 | return ( 124 |
125 | 126 | { this.activeKey = key }} 128 | activeKey={this.activeKey} 129 | type="editable-card" 130 | onEdit={this.onEdit.bind(this)} 131 | > 132 | {panes} 133 | 134 |
135 | ); 136 | } 137 | } 138 | -------------------------------------------------------------------------------- /www/static/src/components/Api/index.jsx: -------------------------------------------------------------------------------- 1 | import {PureComponent} from 'react'; 2 | import {Input} from 'antd'; 3 | 4 | import ParamsTable from './Params'; 5 | import RespTab from './Resp'; 6 | 7 | const APIName = props => ( 8 | 13 | ); 14 | 15 | const APIDesc = props => ( 16 | 21 | ); 22 | 23 | const APICate = props => ( 24 | 29 | ); 30 | 31 | const APIFormat = props => ( 32 | 37 | ); 38 | 39 | const APICallback = props => ( 40 | 45 | ); 46 | 47 | export default class extends PureComponent { 48 | getProps(key) { 49 | const newData = Object.assign({}, this.props.value); 50 | 51 | return { 52 | value: newData[key], 53 | onChange: e => { 54 | newData[key] = e.target.value; 55 | this.props.onChange(newData); 56 | } 57 | }; 58 | } 59 | 60 | getParamProps() { 61 | const data = this.props.value.args; 62 | return { 63 | data, 64 | onChange: data => { 65 | const newData = Object.assign({}, this.props.value); 66 | newData.args = data; 67 | this.props.onChange(newData); 68 | } 69 | }; 70 | } 71 | 72 | getRespProps() { 73 | const panes = this.props.value.resp; 74 | return { 75 | panes: Array.isArray(panes) ? panes : [], 76 | onChange: data => { 77 | const newData = Object.assign({}, this.props.value); 78 | newData.resp = data; 79 | this.props.onChange(newData); 80 | } 81 | }; 82 | } 83 | 84 | render() { 85 | return ( 86 |
87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 |
95 | ); 96 | } 97 | } 98 | -------------------------------------------------------------------------------- /www/static/src/components/Auth.jsx: -------------------------------------------------------------------------------- 1 | import {Route, Redirect} from 'react-router-dom'; 2 | 3 | const Auth = { 4 | get isLogin() { 5 | return global.userInfo.name; 6 | }, 7 | login() { 8 | global.location.reload(); 9 | }, 10 | logout() { 11 | global.location.reload(); 12 | } 13 | }; 14 | 15 | Auth.Route = ({component: Component, ...rest}) => ( 16 | { 19 | if (Auth.isLogin) { 20 | return ; 21 | } 22 | 23 | return ; 24 | }} 25 | /> 26 | ); 27 | 28 | export default Auth; 29 | -------------------------------------------------------------------------------- /www/static/src/components/Header.jsx: -------------------------------------------------------------------------------- 1 | import React from 'react'; 2 | import {Link} from 'react-router-dom'; 3 | import {Layout, Menu, Dropdown, Avatar, Icon} from 'antd'; 4 | 5 | import rq from './request'; 6 | 7 | const navs = [ 8 | { 9 | title: '首页', 10 | pathname: '/' 11 | }, 12 | { 13 | title: '关于', 14 | pathname: '/about' 15 | } 16 | ]; 17 | 18 | async function logout() { 19 | await rq.delete('/api/token'); 20 | location.reload(); 21 | } 22 | 23 | export default props => { 24 | const defaultSelectedKeys = [location.pathname]; 25 | if (!global.userInfo.name) { 26 | return ( 27 | 28 |
29 | Animaris 30 |
31 |
32 | ); 33 | } 34 | 35 | return ( 36 | 37 |
38 | Animaris 39 |
40 | 46 | {navs.map(nav => 47 | 48 | {nav.title} 49 | 50 | )} 51 | 52 |
53 | 54 | 55 | 个人中心 56 | 57 | 58 | 59 | 退出登录 60 | 61 | }> 62 | 63 | 64 | {global.userInfo.name} 65 | 66 | 67 |
68 |
69 | ); 70 | }; 71 | -------------------------------------------------------------------------------- /www/static/src/components/Layout.jsx: -------------------------------------------------------------------------------- 1 | 2 | import { 3 | Layout, 4 | Menu 5 | } from 'antd'; 6 | 7 | export default function(props) { 8 | return ( 9 | 10 | 11 |
Animaris
12 | 18 | 首页 19 | 关于 20 | 21 |
22 | 23 | {props.children} 24 | 25 | 26 | WebView Mock Platform ©2018 Created by Lizheming 27 | 28 |
29 | ); 30 | } 31 | -------------------------------------------------------------------------------- /www/static/src/components/SideApi.jsx: -------------------------------------------------------------------------------- 1 | import { PureComponent } from 'react'; 2 | import { 3 | Menu, 4 | Icon, 5 | Input, 6 | Button, 7 | Popconfirm 8 | } from 'antd'; 9 | const {SubMenu} = Menu; 10 | 11 | export default class extends PureComponent { 12 | constructor(...args) { 13 | super(...args); 14 | this.state = this.initialState(); 15 | } 16 | 17 | initialState() { 18 | return { 19 | editElement: '', 20 | editData: '' 21 | }; 22 | } 23 | 24 | onEdit(data, e) { 25 | e.stopPropagation(); 26 | this.setState({editElement: data.name, editData: data.name}); 27 | } 28 | 29 | onDelete(data, e) { 30 | e.stopPropagation(); 31 | 32 | const apis = Object.assign({}, this.props.value); 33 | const interfaces = Array.from(apis.interfaces).filter(api => api.cate !== data.name); 34 | apis.interfaces = interfaces; 35 | 36 | this.props.onChange(apis); 37 | this.setState(this.initialState()); 38 | } 39 | 40 | onUpdate(e) { 41 | this.setState({editData: e.target.value}); 42 | } 43 | 44 | onSave(e) { 45 | e.stopPropagation(); 46 | 47 | const apis = Object.assign({}, this.props.value); 48 | const interfaces = Array.from(apis.interfaces); 49 | interfaces.forEach(api => { 50 | if (api.cate === this.state.editElement) { 51 | api.cate = this.state.editData; 52 | } 53 | }); 54 | apis.interfaces = interfaces; 55 | 56 | this.props.onChange(apis); 57 | this.setState(this.initialState()); 58 | } 59 | 60 | onCancel(e) { 61 | e.stopPropagation(); 62 | this.setState(this.initialState()); 63 | } 64 | 65 | onSelect({key}) { 66 | this.props.onSelect(key); 67 | } 68 | 69 | onDeleteAPI(data, e) { 70 | console.log(data.name); 71 | e.stopPropagation(); 72 | const apis = Object.assign({}, this.props.value); 73 | const interfaces = Array.from(apis.interfaces).filter(api => api.name !== data.name); 74 | apis.interfaces = interfaces; 75 | 76 | this.props.onChange(apis); 77 | this.setState(this.initialState()); 78 | } 79 | 80 | onAdd() { 81 | this.props.onDeSelect(); 82 | } 83 | 84 | renderCateMenu(data) { 85 | const editable = data.name === this.state.editElement; 86 | if (editable) { 87 | return ( 88 |
89 | 90 |
91 | 92 | 96 | e.stopPropagation()}/> 97 | 98 |
99 |
100 | ); 101 | } 102 | 103 | return ( 104 |
105 | {data.name} 106 |
107 | 108 | 112 | 113 | 114 |
115 |
116 | ); 117 | } 118 | 119 | renderSubMenu(data) { 120 | if (data.name === this.props.value.name) { 121 | return 122 | {data.name} 123 |
124 | 132 |
133 |
; 134 | } 135 | 136 | if (!Array.isArray(data.children) || !data.children.length) { 137 | return null; 138 | } 139 | 140 | return ( 141 | 142 | {data.children.map(item => 143 | 144 |
145 | {item.name} 146 |
147 | 151 | 152 | 153 |
154 |
155 |
)} 156 |
157 | ); 158 | } 159 | 160 | render() { 161 | let list = [{name: this.props.value.name, children: []}]; 162 | let defaultOpenKeys = []; 163 | 164 | if ( 165 | Array.isArray(this.props.value.interfaces) && 166 | this.props.value.interfaces.length 167 | ) { 168 | let listAPI = {}; 169 | this.props.value.interfaces.forEach(function(api) { 170 | if (!Array.isArray(listAPI[api.cate])) { 171 | listAPI[api.cate] = []; 172 | } 173 | listAPI[api.cate].push(api); 174 | }); 175 | listAPI = Object.keys(listAPI).map(item => ({name: item, children: listAPI[item]})); 176 | list = [...list, ...listAPI]; 177 | 178 | defaultOpenKeys = listAPI.map(data => data.name); 179 | } 180 | 181 | return ( 182 | this.onSelect(data)} 188 | > 189 | {list.map(data => this.renderSubMenu(data))} 190 | 191 | ); 192 | } 193 | } 194 | -------------------------------------------------------------------------------- /www/static/src/components/request.js: -------------------------------------------------------------------------------- 1 | export default { 2 | get(url, opts = {}) { 3 | return fetch(url, Object.assign({ 4 | credentials: 'include' 5 | }, opts)).then(resp => resp.json()); 6 | }, 7 | post(url, data, opts = {}) { 8 | return fetch(url, Object.assign({ 9 | body: JSON.stringify(data), 10 | cache: 'no-cache', 11 | credentials: 'include', 12 | headers: { 13 | 'Content-Type': 'application/json' 14 | }, 15 | method: 'POST' 16 | }, opts)).then(resp => resp.json()); 17 | }, 18 | put(url, data, opts = {}) { 19 | opts.method = 'PUT'; 20 | return this.post(url, data, opts); 21 | }, 22 | delete(url, opts = {}) { 23 | return fetch(url, Object.assign({ 24 | cache: 'no-cache', 25 | credentials: 'include', 26 | method: 'DELETE' 27 | }, opts)).then(resp => resp.json()); 28 | } 29 | }; 30 | -------------------------------------------------------------------------------- /www/static/src/index.jsx: -------------------------------------------------------------------------------- 1 | import { 2 | BrowserRouter as Router, 3 | Route 4 | } from 'react-router-dom'; 5 | import React from 'react'; 6 | import {Layout} from 'antd'; 7 | import {render} from 'react-dom'; 8 | 9 | import Auth from './components/Auth'; 10 | import Header from './components/Header'; 11 | import Home from './Home'; 12 | import Edit from './Edit'; 13 | import Login from './Login'; 14 | import Register from './Register'; 15 | import Mock from './Mock'; 16 | 17 | global.React = React; 18 | 19 | render(( 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | Animaris Platform ©2018 Created by @lizheming 32 | 33 | 34 | 35 | ), document.getElementById('app')); 36 | --------------------------------------------------------------------------------