├── public
├── robots.txt
├── benefit.gif
├── nodata.png
├── show1.png
├── show2.png
├── startup.png
├── cb8i9-ocarf.png
├── discover
│ ├── discover1.jpg
│ └── discover2.jpg
├── 0a52cbb6d188224109c015a26fed8png.png
├── 0b06a4ac7f649e1a52a3257561bc4png.png
├── 116d72b960f4acad6f8affb94b2c4png.png
├── 415695be0ca9310e49686e55dca84png.png
├── a6228253d0a38bc2843ba94afdc5dpng.png
├── d7913eda5137f4971ee7d1c83e71apng.png
├── e6c516736041dcb5a046cc5e7eef6png.png
├── ef6c0dcde937b826fd526aaf2ab9apng.png
├── 11b918e4dbda3cda2c320654c414bjpeg.png
├── 184e380e7da5cc010d50f763330b2jpeg.png
├── 185f7259ebda19e16123884a60ef2jpeg.png
├── 6f2631288a44ec177204e05cbcb93jpeg.png
├── 76a23eb90dada42528bc41499d6f8jpeg.png
├── 77ff360f7d3fde2d459727ad09fcfjpeg.png
├── 95f763839e8ed34e6041413c6cba3jpeg.png
├── a867c870b22bc74c87c348b75528djpeg.png
├── af108e256ebc9f02db599592ae655jpeg.png
├── b7ba9547aa700bd20d0420e1794a8jpeg.png
├── bceb19258e3264e64fb856722c3c1jpeg.png
├── c888acb2c8ba9e0c813f36ec9e90ajpeg.png
├── dd7c960f08cdc756b1d3ad54978fdjpeg.png
├── e42997b86b232161a5a16ab813ae8jpeg.png
├── f29dbf20be425fc12426c0b1f90b7jpeg.png
├── banner
│ ├── 146be328e7121c456ac67f54b59fbjpeg.png
│ ├── 4a6f8262a2a006c0bd6ba31b137c4jpeg.png
│ └── b28f567a846a21f01aa39a55d6facjpeg.png
└── flexible.js
├── index.js
├── config
├── development.js
└── default.js
├── screenshots
├── 1.gif
├── 1.png
├── 2.gif
├── 2.png
├── 3.gif
├── 3.png
├── 4.gif
├── 4.png
├── 5.gif
├── 5.png
├── alipay.jpg
├── qr-code.png
└── wechat.jpg
├── .babelrc
├── doc
├── img
│ └── favicon.ico
├── fonts
│ ├── glyphicons-halflings-regular.eot
│ ├── glyphicons-halflings-regular.ttf
│ ├── glyphicons-halflings-regular.woff
│ └── glyphicons-halflings-regular.woff2
├── api_project.json
├── api_project.js
├── vendor
│ ├── prettify
│ │ ├── prettify.css
│ │ ├── lang-rd.js
│ │ ├── lang-latex.js
│ │ ├── lang-tex.js
│ │ ├── lang-go.js
│ │ ├── lang-proto.js
│ │ ├── lang-ll.js
│ │ ├── lang-llvm.js
│ │ ├── lang-yaml.js
│ │ ├── lang-yml.js
│ │ ├── lang-cbm.js
│ │ ├── lang-basic.js
│ │ ├── lang-wiki.js
│ │ ├── lang-lua.js
│ │ ├── lang-erl.js
│ │ ├── lang-erlang.js
│ │ ├── lang-hs.js
│ │ ├── lang-tcl.js
│ │ ├── lang-pascal.js
│ │ ├── lang-r.js
│ │ ├── lang-s.js
│ │ ├── lang-Splus.js
│ │ ├── lang-cl.js
│ │ ├── lang-el.js
│ │ ├── lang-ss.js
│ │ ├── lang-lisp.js
│ │ ├── lang-lsp.js
│ │ ├── lang-rkt.js
│ │ ├── lang-scm.js
│ │ ├── lang-lgt.js
│ │ ├── lang-logtalk.js
│ │ ├── lang-clj.js
│ │ ├── lang-mumps.js
│ │ ├── lang-css.js
│ │ ├── lang-scala.js
│ │ ├── lang-aea.js
│ │ ├── lang-agc.js
│ │ ├── lang-apollo.js
│ │ ├── lang-dart.js
│ │ ├── lang-fs.js
│ │ ├── lang-ml.js
│ │ ├── lang-swift.js
│ │ ├── lang-vhd.js
│ │ ├── lang-vhdl.js
│ │ ├── lang-n.js
│ │ ├── lang-nemerle.js
│ │ ├── lang-rust.js
│ │ ├── lang-sql.js
│ │ ├── lang-vb.js
│ │ ├── lang-vbs.js
│ │ ├── lang-lasso.js
│ │ ├── lang-ls.js
│ │ └── lang-lassoscript.js
│ ├── path-to-regexp
│ │ ├── LICENSE
│ │ └── index.js
│ ├── prettify.css
│ ├── polyfill.js
│ ├── webfontloader.js
│ └── semver.min.js
├── locales
│ ├── zh.js
│ ├── zh_cn.js
│ ├── tr.js
│ ├── pl.js
│ ├── ca.js
│ ├── vi.js
│ ├── de.js
│ ├── ro.js
│ ├── ru.js
│ ├── pt_br.js
│ ├── es.js
│ ├── nl.js
│ ├── fr.js
│ ├── it.js
│ └── locale.js
└── utils
│ ├── send_sample_request.js
│ └── handlebars_helper.js
├── routes
├── index.js
├── common.js
├── shopping.js
└── user.js
├── .gitignore
├── models
├── user
│ ├── user.js
│ └── address.js
├── common
│ └── homeDataModel.js
└── shopping
│ ├── business.js
│ └── restaurants.js
├── controller
├── common
│ ├── homeData.js
│ └── position.js
├── shopping
│ ├── restaurants.js
│ └── business.js
└── user
│ ├── address.js
│ └── user.js
├── .github
└── issue_template.md
├── mongodb
└── db.js
├── initData
└── home.js
├── app.js
├── package.json
├── README.md
└── README_zh-EN.md
/public/robots.txt:
--------------------------------------------------------------------------------
1 | User-agent: *
2 | Disallow: /
3 |
--------------------------------------------------------------------------------
/index.js:
--------------------------------------------------------------------------------
1 | require('babel-register');
2 | require('./app.js');
--------------------------------------------------------------------------------
/config/development.js:
--------------------------------------------------------------------------------
1 | 'use strict';
2 |
3 | module.exports = {
4 |
5 | }
--------------------------------------------------------------------------------
/public/benefit.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/benefit.gif
--------------------------------------------------------------------------------
/public/nodata.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/nodata.png
--------------------------------------------------------------------------------
/public/show1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/show1.png
--------------------------------------------------------------------------------
/public/show2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/show2.png
--------------------------------------------------------------------------------
/public/startup.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/startup.png
--------------------------------------------------------------------------------
/screenshots/1.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/screenshots/1.gif
--------------------------------------------------------------------------------
/screenshots/1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/screenshots/1.png
--------------------------------------------------------------------------------
/screenshots/2.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/screenshots/2.gif
--------------------------------------------------------------------------------
/screenshots/2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/screenshots/2.png
--------------------------------------------------------------------------------
/screenshots/3.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/screenshots/3.gif
--------------------------------------------------------------------------------
/screenshots/3.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/screenshots/3.png
--------------------------------------------------------------------------------
/screenshots/4.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/screenshots/4.gif
--------------------------------------------------------------------------------
/screenshots/4.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/screenshots/4.png
--------------------------------------------------------------------------------
/screenshots/5.gif:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/screenshots/5.gif
--------------------------------------------------------------------------------
/screenshots/5.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/screenshots/5.png
--------------------------------------------------------------------------------
/.babelrc:
--------------------------------------------------------------------------------
1 | {
2 | "presets": ["env"],
3 | "plugins": [
4 | "transform-runtime"
5 | ]
6 | }
--------------------------------------------------------------------------------
/doc/img/favicon.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/doc/img/favicon.ico
--------------------------------------------------------------------------------
/public/cb8i9-ocarf.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/cb8i9-ocarf.png
--------------------------------------------------------------------------------
/screenshots/alipay.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/screenshots/alipay.jpg
--------------------------------------------------------------------------------
/screenshots/qr-code.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/screenshots/qr-code.png
--------------------------------------------------------------------------------
/screenshots/wechat.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/screenshots/wechat.jpg
--------------------------------------------------------------------------------
/public/discover/discover1.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/discover/discover1.jpg
--------------------------------------------------------------------------------
/public/discover/discover2.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/discover/discover2.jpg
--------------------------------------------------------------------------------
/config/default.js:
--------------------------------------------------------------------------------
1 | // config-lite模块配置文件
2 |
3 | module.exports = {
4 | port: 9000,
5 | url: 'mongodb://localhost:27017/elm',
6 | }
--------------------------------------------------------------------------------
/doc/fonts/glyphicons-halflings-regular.eot:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/doc/fonts/glyphicons-halflings-regular.eot
--------------------------------------------------------------------------------
/doc/fonts/glyphicons-halflings-regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/doc/fonts/glyphicons-halflings-regular.ttf
--------------------------------------------------------------------------------
/doc/fonts/glyphicons-halflings-regular.woff:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/doc/fonts/glyphicons-halflings-regular.woff
--------------------------------------------------------------------------------
/public/0a52cbb6d188224109c015a26fed8png.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/0a52cbb6d188224109c015a26fed8png.png
--------------------------------------------------------------------------------
/public/0b06a4ac7f649e1a52a3257561bc4png.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/0b06a4ac7f649e1a52a3257561bc4png.png
--------------------------------------------------------------------------------
/public/116d72b960f4acad6f8affb94b2c4png.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/116d72b960f4acad6f8affb94b2c4png.png
--------------------------------------------------------------------------------
/public/415695be0ca9310e49686e55dca84png.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/415695be0ca9310e49686e55dca84png.png
--------------------------------------------------------------------------------
/public/a6228253d0a38bc2843ba94afdc5dpng.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/a6228253d0a38bc2843ba94afdc5dpng.png
--------------------------------------------------------------------------------
/public/d7913eda5137f4971ee7d1c83e71apng.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/d7913eda5137f4971ee7d1c83e71apng.png
--------------------------------------------------------------------------------
/public/e6c516736041dcb5a046cc5e7eef6png.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/e6c516736041dcb5a046cc5e7eef6png.png
--------------------------------------------------------------------------------
/public/ef6c0dcde937b826fd526aaf2ab9apng.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/ef6c0dcde937b826fd526aaf2ab9apng.png
--------------------------------------------------------------------------------
/doc/fonts/glyphicons-halflings-regular.woff2:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/doc/fonts/glyphicons-halflings-regular.woff2
--------------------------------------------------------------------------------
/public/11b918e4dbda3cda2c320654c414bjpeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/11b918e4dbda3cda2c320654c414bjpeg.png
--------------------------------------------------------------------------------
/public/184e380e7da5cc010d50f763330b2jpeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/184e380e7da5cc010d50f763330b2jpeg.png
--------------------------------------------------------------------------------
/public/185f7259ebda19e16123884a60ef2jpeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/185f7259ebda19e16123884a60ef2jpeg.png
--------------------------------------------------------------------------------
/public/6f2631288a44ec177204e05cbcb93jpeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/6f2631288a44ec177204e05cbcb93jpeg.png
--------------------------------------------------------------------------------
/public/76a23eb90dada42528bc41499d6f8jpeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/76a23eb90dada42528bc41499d6f8jpeg.png
--------------------------------------------------------------------------------
/public/77ff360f7d3fde2d459727ad09fcfjpeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/77ff360f7d3fde2d459727ad09fcfjpeg.png
--------------------------------------------------------------------------------
/public/95f763839e8ed34e6041413c6cba3jpeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/95f763839e8ed34e6041413c6cba3jpeg.png
--------------------------------------------------------------------------------
/public/a867c870b22bc74c87c348b75528djpeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/a867c870b22bc74c87c348b75528djpeg.png
--------------------------------------------------------------------------------
/public/af108e256ebc9f02db599592ae655jpeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/af108e256ebc9f02db599592ae655jpeg.png
--------------------------------------------------------------------------------
/public/b7ba9547aa700bd20d0420e1794a8jpeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/b7ba9547aa700bd20d0420e1794a8jpeg.png
--------------------------------------------------------------------------------
/public/bceb19258e3264e64fb856722c3c1jpeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/bceb19258e3264e64fb856722c3c1jpeg.png
--------------------------------------------------------------------------------
/public/c888acb2c8ba9e0c813f36ec9e90ajpeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/c888acb2c8ba9e0c813f36ec9e90ajpeg.png
--------------------------------------------------------------------------------
/public/dd7c960f08cdc756b1d3ad54978fdjpeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/dd7c960f08cdc756b1d3ad54978fdjpeg.png
--------------------------------------------------------------------------------
/public/e42997b86b232161a5a16ab813ae8jpeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/e42997b86b232161a5a16ab813ae8jpeg.png
--------------------------------------------------------------------------------
/public/f29dbf20be425fc12426c0b1f90b7jpeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/f29dbf20be425fc12426c0b1f90b7jpeg.png
--------------------------------------------------------------------------------
/public/banner/146be328e7121c456ac67f54b59fbjpeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/banner/146be328e7121c456ac67f54b59fbjpeg.png
--------------------------------------------------------------------------------
/public/banner/4a6f8262a2a006c0bd6ba31b137c4jpeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/banner/4a6f8262a2a006c0bd6ba31b137c4jpeg.png
--------------------------------------------------------------------------------
/public/banner/b28f567a846a21f01aa39a55d6facjpeg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/EasyTuan/node-elm-api/HEAD/public/banner/b28f567a846a21f01aa39a55d6facjpeg.png
--------------------------------------------------------------------------------
/routes/index.js:
--------------------------------------------------------------------------------
1 | import common from './common';
2 | import shopping from './shopping';
3 | import user from './user';
4 |
5 | export default app => {
6 | app.use('/common', common);
7 | app.use('/shopping', shopping);
8 | app.use('/user', user);
9 | }
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *.iml
2 | .idea
3 | .idea/
4 | .ipr
5 | .iws
6 | *~
7 | ~*
8 | *.diff
9 | *.patch
10 | *.bak
11 | .DS_Store
12 | Thumbs.db
13 | .project
14 | .*proj
15 | .svn/
16 | *.swp
17 | *.swo
18 | *.pyc
19 | *.pyo
20 | node_modules
21 | conflicts-debug.log
22 | package-lock.json
23 | .wepycache
24 | .eslintcache
25 |
--------------------------------------------------------------------------------
/doc/api_project.json:
--------------------------------------------------------------------------------
1 | {
"title": "elm-api接口文档",
"url": "https://elm-api.caibowen.net",
"name": "node-elm-api",
"version": "1.0.0",
"description": "为nuxt-elm提供接口服务",
"sampleUrl": false,
"defaultVersion": "0.0.0",
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2018-09-20T04:26:00.624Z",
"url": "http://apidocjs.com",
"version": "0.17.6"
}
}
2 |
--------------------------------------------------------------------------------
/doc/api_project.js:
--------------------------------------------------------------------------------
1 | define({
"title": "elm-api接口文档",
"url": "https://elm-api.caibowen.net",
"name": "node-elm-api",
"version": "1.0.0",
"description": "为nuxt-elm提供接口服务",
"sampleUrl": false,
"defaultVersion": "0.0.0",
"apidoc": "0.3.0",
"generator": {
"name": "apidoc",
"time": "2018-09-20T04:26:00.624Z",
"url": "http://apidocjs.com",
"version": "0.17.6"
}
});
2 |
--------------------------------------------------------------------------------
/models/user/user.js:
--------------------------------------------------------------------------------
1 | import mongoose from 'mongoose';
2 |
3 | const Schema = mongoose.Schema;
4 |
5 | const userSchema = new Schema({
6 | user_id: String,
7 | mobile: String,
8 | username: String,
9 | password: String,
10 | create_time: String,
11 | avatar: {
12 | type: String,
13 | default: null
14 | },
15 | })
16 |
17 | userSchema.index({
18 | id: 1
19 | });
20 |
21 | const User = mongoose.model('User', userSchema);
22 |
23 | export default User;
--------------------------------------------------------------------------------
/controller/common/homeData.js:
--------------------------------------------------------------------------------
1 | import homeDataModel from '../../models/common/homeDataModel';
2 |
3 | class HomeData {
4 | async getHomeData(req, res, next) {
5 | try {
6 | const homeDataList = await homeDataModel.find();
7 | res.send({
8 | code: 0,
9 | msg: null,
10 | data: homeDataList
11 | });
12 | } catch(err) {
13 | res.send({
14 | code: -1,
15 | msg: '获取首页导航信息失败',
16 | data: []
17 | })
18 | }
19 | }
20 | }
21 |
22 | export default new HomeData();
--------------------------------------------------------------------------------
/controller/shopping/restaurants.js:
--------------------------------------------------------------------------------
1 | import restaurantsModel from '../../models/shopping/restaurants';
2 |
3 | class restaurantsData {
4 | async restaurants(req, res, next) {
5 | try {
6 | const restaurantsList = await restaurantsModel.find();
7 | res.send({
8 | code: 0,
9 | msg: null,
10 | data: restaurantsList
11 | });
12 | } catch(err) {
13 | res.send({
14 | code: -1,
15 | msg: '获取商家信息失败',
16 | data: []
17 | })
18 | }
19 | }
20 | }
21 |
22 | export default new restaurantsData();
--------------------------------------------------------------------------------
/models/user/address.js:
--------------------------------------------------------------------------------
1 | import mongoose from 'mongoose'
2 |
3 | const Schema = mongoose.Schema;
4 |
5 | const addressSchema = new Schema({
6 | id: String,
7 | user_id: String,
8 | name: String,
9 | phone: String,
10 | address: String,
11 | details: String,
12 | is_valid: {
13 | type: Number,
14 | default: 1
15 | },
16 | created_at: {
17 | type: Date,
18 | default: Date.now()
19 | },
20 | })
21 |
22 | addressSchema.index({
23 | id: 1
24 | });
25 |
26 | const Address = mongoose.model('Address', addressSchema);
27 |
28 | export default Address
--------------------------------------------------------------------------------
/models/common/homeDataModel.js:
--------------------------------------------------------------------------------
1 | import mongoose from 'mongoose';
2 | import homeData from '../../InitData/home';
3 |
4 | const Schema = mongoose.Schema;
5 |
6 | const homeDataSchema = new Schema({
7 | imgUrl: String,
8 | text: String,
9 | })
10 |
11 | homeDataSchema.index({
12 | id: 1
13 | });
14 |
15 | const HomeData = mongoose.model('HomeData', homeDataSchema);
16 |
17 | //如果数据库为空,添加初始化数据
18 | HomeData.findOne((err, data) => {
19 | if(!data) {
20 | homeData.forEach(item => {
21 | HomeData.create(item);
22 | })
23 | }
24 | })
25 |
26 | export default HomeData
--------------------------------------------------------------------------------
/models/shopping/business.js:
--------------------------------------------------------------------------------
1 | import mongoose from 'mongoose';
2 | import business from '../../InitData/business';
3 |
4 | const Schema = mongoose.Schema;
5 |
6 | const businessDataSchema = new Schema({
7 | "seller": {},
8 | "goods": [],
9 | "ratings": [],
10 | })
11 |
12 | businessDataSchema.index({
13 | id: 1
14 | });
15 |
16 | const BusinessData = mongoose.model('BusinessData', businessDataSchema);
17 |
18 | //如果数据库为空,添加初始化数据
19 | BusinessData.findOne((err, data) => {
20 | if(!data) {
21 | business.forEach(item => {
22 | BusinessData.create(item);
23 | })
24 | }
25 | })
26 |
27 | export default BusinessData
--------------------------------------------------------------------------------
/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}
--------------------------------------------------------------------------------
/.github/issue_template.md:
--------------------------------------------------------------------------------
1 | 如果是提交 bug,请搜索文档和 issue,确认以下事项:
2 |
3 | * 该问题没有在其他 issue 和文档讨论到,不属于重复内容
4 |
5 | * 分割线以下的模板除了「 补充信息」每一样都必填
6 |
7 | 🙏🙏🙏
8 | 阅读完后请在提交的issue中删除以上内容,包括分割线。
9 | ------------------------
10 |
11 | **问题描述**
12 | [问题描述:站在其它人的角度尽可能清晰地、简洁地把问题描述清楚]
13 |
14 | **复现步骤**
15 | [复现问题的步骤]
16 | 1. Go to '...'
17 | 2. Click on '....'
18 | 3. Scroll down to '....'
19 | 4. See error
20 |
21 | [或者可以直接贴源代码,能贴文字就不要截图]
22 |
23 | ```js
24 | // 这里可以贴代码
25 |
26 | ```
27 |
28 | **期望行为**
29 | [这里请用简洁清晰的语言描述你期望的行为]
30 |
31 | **报错信息**
32 |
33 | [这里请贴上你的**完整**报错截图或文字]
34 |
35 | **系统信息**
36 |
37 | - 操作系统: [e.g. Windows 10]
38 | - Node.js 版本 [e.g. v10.13.0]
39 |
40 | **补充信息**
41 | [可选]
42 | [根据你的调查研究,出现这个问题的原因可能在哪里?]
43 |
--------------------------------------------------------------------------------
/mongodb/db.js:
--------------------------------------------------------------------------------
1 | import mongoose from 'mongoose';
2 | import config from 'config-lite';
3 | import chalk from 'chalk';
4 | mongoose.connect(config.url, {
5 | useMongoClient: true
6 | });
7 | mongoose.Promise = global.Promise;
8 |
9 | const db = mongoose.connection;
10 |
11 | db.once('open', () => {
12 | console.log(
13 | chalk.green('连接数据库成功')
14 | );
15 | })
16 |
17 | db.on('error', function(error) {
18 | console.error(
19 | chalk.red('Error in MongoDb connection: ' + error)
20 | );
21 | mongoose.disconnect();
22 | });
23 |
24 | db.on('close', function() {
25 | console.log(
26 | chalk.red('数据库断开,重新连接数据库')
27 | );
28 | mongoose.connect(config.url, {
29 | server: {
30 | auto_reconnect: true
31 | }
32 | });
33 | });
34 |
35 | export default db;
--------------------------------------------------------------------------------
/initData/home.js:
--------------------------------------------------------------------------------
1 | export default [{
2 | imgUrl: 'a867c870b22bc74c87c348b75528djpeg.png',
3 | text: '美食'
4 | }, {
5 | imgUrl: '185f7259ebda19e16123884a60ef2jpeg.png',
6 | text: '晚餐'
7 | }, {
8 | imgUrl: '76a23eb90dada42528bc41499d6f8jpeg.png',
9 | text: '商超便利'
10 | }, {
11 | imgUrl: 'dd7c960f08cdc756b1d3ad54978fdjpeg.png',
12 | text: '水果'
13 | }, {
14 | imgUrl: 'af108e256ebc9f02db599592ae655jpeg.png',
15 | text: '医药健康'
16 | }, {
17 | imgUrl: 'c888acb2c8ba9e0c813f36ec9e90ajpeg.png',
18 | text: '浪漫鲜花'
19 | }, {
20 | imgUrl: 'e42997b86b232161a5a16ab813ae8jpeg.png',
21 | text: '厨房生鲜'
22 | }, {
23 | imgUrl: 'bceb19258e3264e64fb856722c3c1jpeg.png',
24 | text: '跑腿代购'
25 | }, {
26 | imgUrl: '6f2631288a44ec177204e05cbcb93jpeg.png',
27 | text: '地方小吃'
28 | }, {
29 | imgUrl: 'b7ba9547aa700bd20d0420e1794a8jpeg.png',
30 | text: '麻辣烫'
31 | }]
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/app.js:
--------------------------------------------------------------------------------
1 | import express from 'express';
2 | import bodyParser from 'body-parser';
3 | import cookieParser from 'cookie-parser';
4 | import path from 'path';
5 | import config from 'config-lite';
6 | import db from './mongodb/db.js';
7 | import router from './routes/index.js';
8 | import chalk from 'chalk';
9 |
10 | const app = express();
11 |
12 | // 用于接收post参数
13 | app.use(bodyParser.json());
14 | app.use(bodyParser.urlencoded({
15 | extended: false
16 | }));
17 |
18 | // 用于接收cookie
19 | app.use(cookieParser());
20 |
21 | app.use(express.static(path.join(__dirname, 'public'), {
22 | maxAge: '30 days'
23 | }));
24 |
25 | app.get('/',(req, res, next) => {
26 | res.send('欢迎访问elm-api后台系统,API文档地址');
27 | })
28 |
29 | router(app);
30 |
31 | app.use((req, res, next) => {
32 | res.send(404);
33 | })
34 |
35 | app.listen(config.port, () => {
36 | console.log(
37 | chalk.green(`成功监听端口:${config.port}`)
38 | )
39 | });
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/controller/common/position.js:
--------------------------------------------------------------------------------
1 | import request from 'request';
2 |
3 | class Position {
4 | async getAddress(req, res, next) {
5 | const ip = req.query.ip || req.ip.split(':')[req.ip.split(':').length - 1];
6 | request(`http://ip.taobao.com/service/getIpInfo.php?ip=${ip}`, (err, resq) => {
7 | try {
8 | var data = JSON.parse(resq.body).data;
9 | console.log(`${new Date().toLocaleString()} ip:${ip} address:${data.country}${data.region}${data.city}${data.isp} `);
10 | res.jsonp(JSON.parse(resq.body));
11 | } catch(e) {
12 | console.log('request error');
13 | var obj = {
14 | "code": 0,
15 | "data": {
16 | "ip": "1",
17 | "country": "",
18 | "area": "",
19 | "region": "",
20 | "city": "",
21 | "county": "",
22 | "isp": "",
23 | "country_id": "",
24 | "area_id": "",
25 | "region_id": "",
26 | "city_id": "",
27 | "county_id": "",
28 | "isp_id": ""
29 | }
30 | };
31 | res.jsonp(obj);
32 | }
33 | })
34 | }
35 | }
36 |
37 | export default new Position();
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/controller/shopping/business.js:
--------------------------------------------------------------------------------
1 | import businesssModel from '../../models/shopping/business';
2 |
3 | class businessListData {
4 | async seller(req, res, next) {
5 | try {
6 | const businessList = await businesssModel.findOne();
7 | res.send({
8 | code: 0,
9 | msg: null,
10 | data: businessList.seller
11 | });
12 | } catch(err) {
13 | res.send({
14 | code: -1,
15 | msg: '获取商家信息失败',
16 | data: []
17 | })
18 | }
19 | }
20 | async goods(req, res, next) {
21 | try {
22 | const businessList = await businesssModel.findOne();
23 | res.send({
24 | code: 0,
25 | msg: null,
26 | data: businessList.goods
27 | });
28 | } catch(err) {
29 | res.send({
30 | code: -1,
31 | msg: '获取商家信息失败',
32 | data: []
33 | })
34 | }
35 | }
36 | async ratings(req, res, next) {
37 | try {
38 | const businessList = await businesssModel.findOne();
39 | res.send({
40 | code: 0,
41 | msg: null,
42 | data: businessList.ratings
43 | });
44 | } catch(err) {
45 | res.send({
46 | code: -1,
47 | msg: '获取商家信息失败',
48 | data: []
49 | })
50 | }
51 | }
52 | }
53 |
54 | export default new businessListData();
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/routes/common.js:
--------------------------------------------------------------------------------
1 | import express from 'express';
2 | const router = express.Router();
3 |
4 | import HomeData from '../controller/common/homeData';
5 | import Position from '../controller/common/position';
6 |
7 | /**
8 | * @api {get} /common/getHomeData getHomeData
9 | * @apiDescription 获取首页导航栏信息
10 | * @apiGroup common
11 | * @apiVersion 1.0.0
12 | *
13 | * @apiSuccess {Number} code 成功状态码
14 | * @apiSuccess {String} msg 返回信息
15 | * @apiSuccess {Array} data 返回首页导航栏信息
16 | *
17 | * @apiSuccessExample Success-Response:
18 | * HTTP/1.1 200 OK
19 | * {
20 | * "code": 0,
21 | * "msg": null,
22 | * "data": []
23 | * }
24 | *
25 | */
26 | router.get('/getHomeData', HomeData.getHomeData);
27 | /**
28 | * @api {get} /common/getAddress getAddress
29 | * @apiDescription 获取ip地理位置信息
30 | * @apiGroup common
31 | * @apiVersion 1.0.0
32 | *
33 | * @apiSuccess {Number} code 成功状态码
34 | * @apiSuccess {Object} data 返回ip地理位置信息
35 | *
36 | * @apiSuccessExample Success-Response:
37 | * HTTP/1.1 200 OK
38 | * {
39 | * "code": 0,
40 | * "data": {}
41 | * }
42 | *
43 | */
44 | router.get('/getAddress', Position.getAddress);
45 |
46 | export default router;
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/doc/locales/tr.js:
--------------------------------------------------------------------------------
1 | define({
2 | tr: {
3 | 'Allowed values:' : 'İzin verilen değerler:',
4 | 'Compare all with predecessor': 'Tümünü öncekiler ile karşılaştır',
5 | 'compare changes to:' : 'değişiklikleri karşılaştır:',
6 | 'compared to' : 'karşılaştır',
7 | 'Default value:' : 'Varsayılan değer:',
8 | 'Description' : 'Açıklama',
9 | 'Field' : 'Alan',
10 | 'General' : 'Genel',
11 | 'Generated with' : 'Oluşturan',
12 | 'Name' : 'İsim',
13 | 'No response values.' : 'Dönüş verisi yok.',
14 | 'optional' : 'opsiyonel',
15 | 'Parameter' : 'Parametre',
16 | 'Permission:' : 'İzin:',
17 | 'Response' : 'Dönüş',
18 | 'Send' : 'Gönder',
19 | 'Send a Sample Request' : 'Örnek istek gönder',
20 | 'show up to version:' : 'bu versiyona kadar göster:',
21 | 'Size range:' : 'Boyut aralığı:',
22 | 'Type' : 'Tip',
23 | 'url' : 'url'
24 | }
25 | });
26 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/doc/locales/vi.js:
--------------------------------------------------------------------------------
1 | define({
2 | vi: {
3 | 'Allowed values:' : 'Giá trị chấp nhận:',
4 | 'Compare all with predecessor': 'So sánh với tất cả phiên bản trước',
5 | 'compare changes to:' : 'so sánh sự thay đổi với:',
6 | 'compared to' : 'so sánh với',
7 | 'Default value:' : 'Giá trị mặc định:',
8 | 'Description' : 'Chú thích',
9 | 'Field' : 'Trường dữ liệu',
10 | 'General' : 'Tổng quan',
11 | 'Generated with' : 'Được tạo bởi',
12 | 'Name' : 'Tên',
13 | 'No response values.' : 'Không có kết quả trả về.',
14 | 'optional' : 'Tùy chọn',
15 | 'Parameter' : 'Tham số',
16 | 'Permission:' : 'Quyền hạn:',
17 | 'Response' : 'Kết quả',
18 | 'Send' : 'Gửi',
19 | 'Send a Sample Request' : 'Gửi một yêu cầu mẫu',
20 | 'show up to version:' : 'hiển thị phiên bản:',
21 | 'Size range:' : 'Kích cỡ:',
22 | 'Type' : 'Kiểu',
23 | 'url' : 'liên kết'
24 | }
25 | });
26 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/models/shopping/restaurants.js:
--------------------------------------------------------------------------------
1 | import mongoose from 'mongoose';
2 | import restaurants from '../../InitData/restaurants';
3 |
4 | const Schema = mongoose.Schema;
5 |
6 | const restaurantsDataSchema = new Schema({
7 | "name": String,
8 | "address": String,
9 | "id": Number,
10 | "latitude": Number,
11 | "longitude": Number,
12 | "location": [],
13 | "phone": String,
14 | "category": String,
15 | "supports": [],
16 | "status": Number,
17 | "recent_order_num": Number,
18 | "rating_count": Number,
19 | "rating": Number,
20 | "promotion_info": String,
21 | "piecewise_agent_fee": {},
22 | "opening_hours": [],
23 | "license": {},
24 | "is_new": Boolean,
25 | "is_premium": Boolean,
26 | "image_path": String,
27 | "identification": {},
28 | "float_minimum_order_amount": Number,
29 | "float_delivery_fee": Number,
30 | "distance": String,
31 | "order_lead_time": String,
32 | "description": String,
33 | "delivery_mode": {},
34 | "activities": [],
35 | "__v": Number,
36 | })
37 |
38 | restaurantsDataSchema.index({
39 | id: 1
40 | });
41 |
42 | const RestaurantsData = mongoose.model('RestaurantsData', restaurantsDataSchema);
43 |
44 | //如果数据库为空,添加初始化数据
45 | RestaurantsData.findOne((err, data) => {
46 | if(!data) {
47 | restaurants.forEach(item => {
48 | RestaurantsData.create(item);
49 | })
50 | }
51 | })
52 |
53 | export default RestaurantsData
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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/tr.js',
13 | './locales/vi.js',
14 | './locales/zh.js',
15 | './locales/zh_cn.js'
16 | ], function() {
17 | var langId = (navigator.language || navigator.userLanguage).toLowerCase().replace('-', '_');
18 | var language = langId.substr(0, 2);
19 | var locales = {};
20 |
21 | for (index in arguments) {
22 | for (property in arguments[index])
23 | locales[property] = arguments[index][property];
24 | }
25 | if ( ! locales['en'])
26 | locales['en'] = {};
27 |
28 | if ( ! locales[langId] && ! locales[language])
29 | language = 'en';
30 |
31 | var locale = (locales[langId] ? locales[langId] : locales[language]);
32 |
33 | function __(text) {
34 | var index = locale[text];
35 | if (index === undefined)
36 | return text;
37 | return index;
38 | };
39 |
40 | function setLanguage(language) {
41 | locale = locales[language];
42 | }
43 |
44 | return {
45 | __ : __,
46 | locales : locales,
47 | locale : locale,
48 | setLanguage: setLanguage
49 | };
50 | });
51 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/package.json:
--------------------------------------------------------------------------------
1 | {
2 | "name": "node-elm-api",
3 | "version": "1.0.0",
4 | "description": "为nuxt-elm提供接口服务",
5 | "main": "index.js",
6 | "author": "[easytuan] <[easytuan@foxmail.com]>",
7 | "license": "GPL",
8 | "private": true,
9 | "apidoc": {
10 | "title": "elm-api接口文档",
11 | "url": "https://elm-api.caibowen.net"
12 | },
13 | "scripts": {
14 | "dev": "cross-env NODE_ENV=development nodemon index.js",
15 | "mongod": "mongod --dbpath ~/mongodb/data",
16 | "mongo": "node node_modules/admin-mongo/app",
17 | "doc": "apidoc -i routes/ -o doc/",
18 | "start": "cross-env NODE_ENV=production pm2 start index.js --node-args='--harmony' --name 'node-elm-api'",
19 | "stop": "cross-env NODE_ENV=production pm2 stop index.js --name 'node-elm-api'",
20 | "restart": "cross-env NODE_ENV=production pm2 restart index.js --node-args='--harmony' --name 'node-elm-api'",
21 | "delete": "pm2 delete node-elm-api"
22 | },
23 | "repository": {
24 | "type": "git",
25 | "url": "https://github.com/EasyTuan/node-elm-api"
26 | },
27 | "dependencies": {
28 | "babel": "^6.23.0",
29 | "babel-preset-env": "^1.7.0",
30 | "babel-register": "^6.26.0",
31 | "body-parser": "^1.18.3",
32 | "chalk": "^2.4.1",
33 | "config-lite": "^1.6.0",
34 | "cookie-parser": "^1.4.3",
35 | "cross-env": "^5.2.0",
36 | "express": "^4.16.3",
37 | "gm": "^1.23.1",
38 | "mongoose": "^4.13.15",
39 | "pm2": "^2.10.4",
40 | "request": "^2.88.0",
41 | "time-formater": "^1.0.1",
42 | "uuid": "^3.3.2"
43 | },
44 | "devDependencies": {
45 | "admin-mongo": "^0.0.23",
46 | "apidoc": "^0.17.6",
47 | "babel-plugin-transform-runtime": "^6.23.0",
48 | "nodemon": "^1.18.3"
49 | }
50 | }
51 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/routes/shopping.js:
--------------------------------------------------------------------------------
1 | import express from 'express';
2 | const router = express.Router();
3 |
4 | import restaurantsData from '../controller/shopping/restaurants'
5 | import businessListData from '../controller/shopping/business'
6 |
7 | /**
8 | * @api {get} /shopping/restaurants restaurants
9 | * @apiDescription 获取商家列表
10 | * @apiGroup shopping
11 | * @apiVersion 1.0.0
12 | *
13 | * @apiSuccess {Number} code 成功状态码
14 | * @apiSuccess {String} msg 返回信息
15 | * @apiSuccess {Array} data 返回商家列表信息
16 | *
17 | * @apiSuccessExample Success-Response:
18 | * HTTP/1.1 200 OK
19 | * {
20 | * "code": 0,
21 | * "msg": null,
22 | * "data": []
23 | * }
24 | *
25 | */
26 | router.get('/restaurants', restaurantsData.restaurants);
27 |
28 | /**
29 | * @api {get} /shopping/seller seller
30 | * @apiDescription 获取商家详情
31 | * @apiGroup shopping
32 | * @apiVersion 1.0.0
33 | *
34 | * @apiSuccess {Number} code 成功状态码
35 | * @apiSuccess {String} msg 返回信息
36 | * @apiSuccess {Object} data 返回商家详情信息
37 | *
38 | * @apiSuccessExample Success-Response:
39 | * HTTP/1.1 200 OK
40 | * {
41 | * "code": 0,
42 | * "msg": null,
43 | * "data": {}
44 | * }
45 | *
46 | */
47 | router.get('/seller', businessListData.seller);
48 |
49 | /**
50 | * @api {get} /shopping/goods goods
51 | * @apiDescription 获取商家餐品列表
52 | * @apiGroup shopping
53 | * @apiVersion 1.0.0
54 | *
55 | * @apiSuccess {Number} code 成功状态码
56 | * @apiSuccess {String} msg 返回信息
57 | * @apiSuccess {Array} data 返回商家餐品列表
58 | *
59 | * @apiSuccessExample Success-Response:
60 | * HTTP/1.1 200 OK
61 | * {
62 | * "code": 0,
63 | * "msg": null,
64 | * "data": []
65 | * }
66 | *
67 | */
68 | router.get('/goods', businessListData.goods);
69 |
70 | /**
71 | * @api {get} /shopping/ratings ratings
72 | * @apiDescription 获取商家评价列表
73 | * @apiGroup shopping
74 | * @apiVersion 1.0.0
75 | *
76 | * @apiSuccess {Number} code 成功状态码
77 | * @apiSuccess {String} msg 返回信息
78 | * @apiSuccess {Array} data 返回商家评价列表
79 | *
80 | * @apiSuccessExample Success-Response:
81 | * HTTP/1.1 200 OK
82 | * {
83 | * "code": 0,
84 | * "msg": null,
85 | * "data": []
86 | * }
87 | *
88 | */
89 | router.get('/ratings', businessListData.ratings);
90 |
91 | export default router;
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/controller/user/address.js:
--------------------------------------------------------------------------------
1 | import AddressModel from '../../models/user/address'
2 | import dtime from 'time-formater';
3 | import uuid from 'uuid/v4';
4 |
5 | class Address {
6 | async getAddress(req, res, next) {
7 | const {
8 | userInfo
9 | } = req.cookies;
10 | try {
11 | if(!userInfo || !JSON.parse(userInfo).user_id) {
12 | throw new Error('user_id参数错误');
13 | }
14 | } catch(err) {
15 | res.send({
16 | code: -1,
17 | msg: err.message,
18 | data: null
19 | })
20 | return;
21 | }
22 | try {
23 | const addressList = await AddressModel.find({
24 | user_id: JSON.parse(userInfo).user_id
25 | });
26 | res.send({
27 | code: 0,
28 | msg: null,
29 | data: addressList
30 | })
31 | } catch(err) {
32 | console.log('获取收获地址失败', err);
33 | res.send({
34 | code: -1,
35 | msg: '获取地址列表失败',
36 | data: []
37 | })
38 | }
39 | }
40 | async getAddAddressById(req, res, next) {
41 | const {
42 | address_id
43 | } = req.body;
44 | if(!address_id) {
45 | res.send({
46 | code: -1,
47 | msg: '参数错误',
48 | data: null
49 | })
50 | return
51 | }
52 | try {
53 | const address = await AddressModel.findOne({
54 | id: address_id
55 | });
56 | res.send({
57 | code: 0,
58 | msg: '获取地址信息成功',
59 | data: address
60 | })
61 | } catch(err) {
62 | res.send({
63 | code: -1,
64 | msg: '获取地址信息失败',
65 | data: address
66 | })
67 | }
68 | }
69 | async addAddress(req, res, next) {
70 | const {
71 | name,
72 | phone,
73 | address,
74 | details
75 | } = req.body;
76 | const {
77 | userInfo
78 | } = req.cookies;
79 | try {
80 | if(!userInfo || !JSON.parse(userInfo).user_id) {
81 | throw new Error('user_id参数错误');
82 | } else if(!name) {
83 | throw new Error('姓名不可为空');
84 | } else if(!phone) {
85 | throw new Error('手机号不可为空');
86 | } else if(!address) {
87 | throw new Error('地址不可为空');
88 | }
89 | } catch(err) {
90 | res.send({
91 | code: -1,
92 | msg: err.message,
93 | data: null
94 | })
95 | return;
96 | }
97 | try {
98 | const newAddress = {
99 | id: uuid(),
100 | user_id: JSON.parse(userInfo).user_id,
101 | name,
102 | phone,
103 | address,
104 | details,
105 | created_at: dtime().format('YYYY-MM-DD HH:mm:ss'),
106 | }
107 | await AddressModel.create(newAddress);
108 | res.send({
109 | code: 0,
110 | msg: '添加地址成功',
111 | data: null
112 | })
113 | } catch(err) {
114 | console.log('添加地址失败', err);
115 | res.send({
116 | code: -1,
117 | msg: '添加地址失败',
118 | data: null
119 | })
120 | }
121 | }
122 | async deleteAddress(req, res, next) {
123 | const {
124 | address_id
125 | } = req.query;
126 | // console.log(req.query('address_id'))
127 | const {
128 | userInfo
129 | } = req.cookies;
130 | try {
131 | if(!userInfo || !JSON.parse(userInfo).user_id) {
132 | throw new Error('user_id参数错误');
133 | } else if(!address_id) {
134 | throw new Error('address_id参数错误');
135 | }
136 | } catch(err) {
137 | res.send({
138 | code: -1,
139 | msg: err.message,
140 | data: null
141 | })
142 | return;
143 | }
144 | try {
145 | await AddressModel.findOneAndRemove({
146 | id: address_id
147 | });
148 | res.send({
149 | code: 0,
150 | msg: '删除地址成功',
151 | data: null
152 | })
153 | } catch(err) {
154 | res.send({
155 | code: -1,
156 | msg: '删除收获地址失败',
157 | data: null
158 | })
159 | }
160 | }
161 | }
162 |
163 | export default new Address()
--------------------------------------------------------------------------------
/public/flexible.js:
--------------------------------------------------------------------------------
1 | !function(){var a='@charset "utf-8"; html{overflow-y:scroll}html,body{font-family:sans-serif}.clearfix:before,.clearfix:after{content:" ";display:table}.clearfix:after{clear:both}.fn-hide{display:none}html{color:#000;background:#fff;-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%}html *{outline:0;-webkit-text-size-adjust:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,code,form,fieldset,legend,input,textarea,p,blockquote,th,td,hr,button,article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{margin:0;padding:0}input,select,textarea{font-size:100%}table{border-collapse:collapse;border-spacing:0}fieldset,img{border:0}abbr,acronym{border:0;font-variant:normal}del{text-decoration:line-through}address,caption,cite,code,dfn,em,th,var{font-style:normal;font-weight:500}ol,ul{list-style:none}caption,th{text-align:left}h1,h2,h3,h4,h5,h6{font-size:100%;font-weight:500}q:before,q:after{content:\'\'}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}a:hover{text-decoration:underline}ins,a{text-decoration:none}.grid{box-sizing:content-box;padding-left:.3rem;padding-right:.3rem;margin-left:-.2rem}.grid:before,.grid:after{content:" ";display:table}.grid:after{clear:both}.grid [class^=col-]{margin-left:.2rem;float:left}.grid .col-1{width:1.1rem}.grid .col-2{width:2.4rem}.grid .col-3{width:3.7rem}.grid .col-4{width:5rem}.grid .col-5{width:6.3rem}.grid .col-6{width:7.6000000000000005rem}.grid .col-7{width:8.900000000000002rem}.grid .col-8{width:10.200000000000001rem}.grid .col-9{width:11.500000000000002rem}.grid .col-10{width:12.8rem}.grid .col-11{width:14.100000000000001rem}.grid .col-12{width:15.400000000000002rem}.grid-thin{box-sizing:content-box;padding-left:.4rem;padding-right:.4rem;margin-left:-.4rem}.grid-thin:before,.grid-thin:after{content:" ";display:table}.grid-thin:after{clear:both}.grid-thin [class^=col-]{margin-left:.4rem;float:left}.grid-thin .col-1{width:.9rem}.grid-thin .col-2{width:2.2rem}.grid-thin .col-3{width:3.5000000000000004rem}.grid-thin .col-4{width:4.8rem}.grid-thin .col-5{width:6.1rem}.grid-thin .col-6{width:7.4rem}.grid-thin .col-7{width:8.7rem}.grid-thin .col-8{width:10rem}.grid-thin .col-9{width:11.299999999999999rem}.grid-thin .col-10{width:12.6rem}.grid-thin .col-11{width:13.9rem}.grid-thin .col-12{width:15.200000000000001rem}.grid-fat{box-sizing:content-box;padding-left:.2rem;padding-right:.2rem;margin-left:0rem}.grid-fat:before,.grid-fat:after{content:" ";display:table}.grid-fat:after{clear:both}.grid-fat [class^=col-]{margin-left:0rem;float:left}.grid-fat .col-1{width:1.3rem}.grid-fat .col-2{width:2.6rem}.grid-fat .col-3{width:3.9000000000000004rem}.grid-fat .col-4{width:5.2rem}.grid-fat .col-5{width:6.5rem}.grid-fat .col-6{width:7.800000000000001rem}.grid-fat .col-7{width:9.1rem}.grid-fat .col-8{width:10.4rem}.grid-fat .col-9{width:11.700000000000001rem}.grid-fat .col-10{width:13rem}.grid-fat .col-11{width:14.3rem}.grid-fat .col-12{width:15.600000000000001rem}',b=document.createElement("style");if(document.getElementsByTagName("head")[0].appendChild(b),b.styleSheet)b.styleSheet.disabled||(b.styleSheet.cssText=a);else try{b.innerHTML=a}catch(c){b.innerText=a}}();!function(a){function b(){var b=g.getBoundingClientRect().width;b/c>540&&(b=540*c),a.rem=b/16,g.style.fontSize=a.rem+"px"}var c,d,e,f=a.document,g=f.documentElement,h=f.querySelector('meta[name="viewport"]'),i=f.querySelector('meta[name="flexible"]');if(h){console.warn("将根据已有的meta标签来设置缩放比例");var j=h.getAttribute("content").match(/initial\-scale=(["']?)([\d\.]+)\1?/);j&&(d=parseFloat(j[2]),c=parseInt(1/d))}else if(i){var j=i.getAttribute("content").match(/initial\-dpr=(["']?)([\d\.]+)\1?/);j&&(c=parseFloat(j[2]),d=parseFloat((1/c).toFixed(2)))}if(!c&&!d){var k=(a.navigator.appVersion.match(/android/gi),a.navigator.appVersion.match(/iphone/gi)),c=a.devicePixelRatio;c=k?c>=3?3:c>=2?2:1:1,d=1/c}if(g.setAttribute("data-dpr",c),!h)if(h=f.createElement("meta"),h.setAttribute("name","viewport"),h.setAttribute("content","initial-scale="+d+", maximum-scale="+d+", minimum-scale="+d+", user-scalable=no"),g.firstElementChild)g.firstElementChild.appendChild(h);else{var l=f.createElement("div");l.appendChild(h),f.write(l.innerHTML)}a.dpr=c,a.addEventListener("resize",function(){clearTimeout(e),e=setTimeout(b,300)},!1),a.addEventListener("pageshow",function(a){a.persisted&&(clearTimeout(e),e=setTimeout(b,300))},!1),"complete"===f.readyState?f.body.style.fontSize=12*c+"px":f.addEventListener("DOMContentLoaded",function(){f.body.style.fontSize=12*c+"px"},!1),b()}(window);
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 简体中文 | [English](./README_zh-EN.md)
2 |
3 | # 前言
4 |
5 | 基于 node.js + mongodb 构建的后台系统,为[nuxt-elm](https://github.com/EasyTuan/nuxt-elm)提供接口服务。
6 |
7 | 如遇网络不佳,请移步[国内镜像加速节点](https://gitee.com/easytuan/node-elm-api)
8 |
9 | # 效果演示
10 |
11 | [前端网址请戳这里](https://elm.caibowen.net/)(请用chrome手机模式预览)
12 |
13 | ### 移动端扫描下方二维码
14 |
15 |
16 |
17 | # API接口文档
18 |
19 | [接口文档地址](https://easytuan.gitee.io/node-elm-api/doc)(基于apidoc)
20 |
21 | # 技术栈
22 |
23 | nodejs + express + mongodb + mongoose + pm2
24 |
25 | ## 项目运行
26 |
27 | ```
28 |
29 | git clone git@github.com:EasyTuan/node-elm-api.git
30 |
31 | cd nuxt-elm
32 |
33 | npm install
34 |
35 | npm run dev
36 |
37 | ```
38 |
39 | ### 1.2 开发过程
40 |
41 | #### 1.2.1 命令
42 |
43 | ```sh
44 |
45 | # 开发
46 | npm run dev
47 |
48 | # 启动mongodb(确保已经安装了mongodb)
49 | npm run mongod
50 |
51 | # 开启浏览器GUI界面查看mongodb(默认端口1234)
52 | npm run mongo
53 |
54 | # 生成api文档(基于apidoc)
55 | npm run doc
56 |
57 | # 生产部署(pm2进程守护)
58 | npm run start
59 |
60 | ```
61 |
62 | # 目标功能
63 | - [x] 商家列表 -- 完成
64 | - [x] 购物车功能 -- 完成
65 | - [x] 餐馆食品列表页 -- 完成
66 | - [x] 店铺评价页面 -- 完成
67 | - [x] 商家详情页 -- 完成
68 | - [x] 登录、注册 -- 完成
69 | - [x] 修改密码 -- 完成
70 | - [x] 个人中心 -- 完成
71 | - [x] 红包 -- 完成
72 | - [x] 收货地址 -- 完成
73 |
74 |
75 | # 目录结构
76 |
77 | ├── config // 配置文件
78 | │ ├── default.js // 默认配置
79 | │ └── development.js // 开发环境
80 | ├── controller // 处理中心,负责路由及数据库的具体操作
81 | │ ├── common
82 | │ │ ├── homeData.js // 首页数据
83 | │ │ └── position.js // 根据ip获取位置
84 | │ ├── shopping
85 | │ │ ├── business.js // 餐馆详情
86 | │ │ └── restaurants.js // 商家列表
87 | │ └── user
88 | │ ├── address.js // 用户地址
89 | │ └── user.js // 用户中心
90 | ├── doc // apidoc自动生成的静态文档
91 | ├── InitData // 模拟数据
92 | │ ├── business.js
93 | │ ├── home.js
94 | │ └── restaurants.js
95 | ├── models // 模型(数据库)
96 | │ ├── common
97 | │ │ └── common.js // 通用模型
98 | │ ├── shopping
99 | │ │ ├── business.js // 餐馆详情模型
100 | │ │ └── restaurants.js // 商家列表模型
101 | │ └── user
102 | │ ├── address.js // 用户地址
103 | │ └── user.js // 用户中心
104 | ├── mongodb // 连接数据库
105 | │ └── db.js
106 | ├── public // 静态资源目录
107 | ├── routes // 路由配置
108 | │ ├── common.js // 通用
109 | │ ├── index.js // 路由配置主文件
110 | │ ├── shopping.js // 餐馆、食品
111 | │ └── user.js // 用户中心
112 | ├── screenshots // 项目截图
113 | ├── .babelrc
114 | ├── .gitignore
115 | ├── app.js // 基础配置
116 | ├── COPYING // GPL协议
117 | ├── index.js // 入口文件
118 | ├── package.json
119 | └── README.md
120 |
121 |
122 | ## 部分截图展示
123 |
124 | ### 首页展示
125 |
126 |
127 |
128 | ### 个人资料
129 |
130 |
131 |
132 | ### 我的
133 |
134 |
135 |
136 | ### 订餐
137 |
138 |
139 |
140 | ### 商家评价
141 |
142 |
143 |
144 |
145 | # 说明
146 |
147 | > 如果对您有帮助,您可以点右上角 "Star" 支持一下 谢谢! ^_^
148 |
149 | > 或者您可以 "follow" 一下,我会不断开源更多的有趣的项目
150 |
151 | > 开发环境 macOS 10.13.4 nodejs 8.11.3 Mongodb 4.0.1
152 |
153 | > 部署环境 AWS CentOS 6.8 64位
154 |
155 | > 如有问题请直接在 Issues 中提,或者您发现问题并有非常好的解决方案,欢迎 PR 👍
156 |
157 |
158 | # 赞助
159 |
160 | 如有帮助,欢迎赞助
161 |
162 | 收到赞助款后,我会及时更新[赞助墙](https://caibowen.net/sponsor)
163 |
164 |
165 |
166 | # 友情链接
167 |
168 | [前端项目传送地址](https://github.com/EasyTuan/nuxt-elm)
169 |
170 | # License
171 |
172 | [GPL](LICENSE)
173 |
--------------------------------------------------------------------------------
/README_zh-EN.md:
--------------------------------------------------------------------------------
1 | English | [简体中文](./README.md)
2 |
3 | # Foreword
4 |
5 | A background system built on node.js + mongodb provides interface services for [nuxt-elm] (https://github.com/EasyTuan/nuxt-elm).
6 |
7 | In case of poor network, please move to [Domestic Mirror Acceleration Node] (https://gitee.com/easytuan/node-elm-api)
8 |
9 | # Show results
10 |
11 | [Front URL please poke here] (https://elm.caibowen.net/) (please preview with chrome phone mode)
12 |
13 | ### Mobile scanning the QR code below
14 |
15 |
16 |
17 | # API interface documentation
18 |
19 | [Interface document address](https://easytuan.gitee.io/node-elm-api/doc)(Based on apidoc)
20 |
21 | # Technology stack
22 |
23 | nodejs + express + mongodb + mongoose + pm2
24 |
25 | ## Project operation
26 |
27 | ```
28 |
29 | git clone git@github.com:EasyTuan/node-elm-api.git
30 |
31 | cd nuxt-elm
32 |
33 | npm install
34 |
35 | npm run dev
36 |
37 | ```
38 |
39 | ### 1.2 development process
40 |
41 | #### 1.2.1 command
42 |
43 | ```sh
44 |
45 | # Development
46 | npm run dev
47 |
48 | # Start mongodb(Make sure mongodb is installed)
49 | npm run mongod
50 |
51 | # Open the browser GUI interface to view mongodb (default port 1234)
52 | npm run mongo
53 |
54 | # Generate an api document (based on apidoc)
55 | npm run doc
56 |
57 | # Production deployment (pm2 process daemon)
58 | npm run start
59 |
60 | ```
61 |
62 | # Target function
63 | - [x] Merchant list -- finished
64 | - [x] Shopping cart -- finished
65 | - [x] Restaurant food list -- finished
66 | - [x] Store evaluation -- finished
67 | - [x] Business details -- finished
68 | - [x] log in Register -- finished
69 | - [x] change Password -- finished
70 | - [x] Personal center -- finished
71 | - [x] Red envelope -- finished
72 | - [x] Shipping address -- finished
73 |
74 |
75 | # Directory Structure
76 |
77 | ├── config
78 | │ ├── default.js
79 | │ └── development.js
80 | ├── controller
81 | │ ├── common
82 | │ │ ├── homeData.js
83 | │ │ └── position.js
84 | │ ├── shopping
85 | │ │ ├── business.js
86 | │ │ └── restaurants.js
87 | │ └── user
88 | │ ├── address.js
89 | │ └── user.js
90 | ├── doc
91 | ├── InitData
92 | │ ├── business.js
93 | │ ├── home.js
94 | │ └── restaurants.js
95 | ├── models
96 | │ ├── common
97 | │ │ └── common.js
98 | │ ├── shopping
99 | │ │ ├── business.js
100 | │ │ └── restaurants.js
101 | │ └── user
102 | │ ├── address.js
103 | │ └── user.js
104 | ├── mongodb
105 | │ └── db.js
106 | ├── public
107 | ├── routes
108 | │ ├── common.js
109 | │ ├── index.js
110 | │ ├── shopping.js
111 | │ └── user.js
112 | ├── screenshots
113 | ├── .babelrc
114 | ├── .gitignore
115 | ├── app.js
116 | ├── COPYING
117 | ├── index.js
118 | ├── package.json
119 | └── README.md
120 |
121 |
122 | ## Partial screenshot display
123 |
124 | ### Home show
125 |
126 |
127 |
128 | ### personal information
129 |
130 |
131 |
132 | ### mine
133 |
134 |
135 |
136 | ### Ordering
137 |
138 |
139 |
140 | ### Merchant evaluation
141 |
142 |
143 |
144 |
145 |
146 | # Description
147 |
148 | > If it helps, you can click on the "Star" support in the upper right corner. Thank you! ^_^
149 |
150 | > Or you can "follow" it, I will continue to open up more interesting projects.
151 |
152 | > Development environment macOS 10.13.4 nodejs 8.11.3 Mongodb 4.0.1
153 |
154 | > Deployment environment AWS CentOS 6.8 64位
155 |
156 | > If you have any questions, please do so directly in the Issues, or you find the problem and have a very good solution, welcome PR 👍
157 |
158 |
159 | # Sponsorship
160 |
161 | If you are helpful, welcome sponsorship
162 |
163 | After receiving the sponsorship, I will promptly update the [sponsorship wall](https://caibowen.net/sponsor)
164 |
165 |
166 |
167 | # Links
168 |
169 | [Project background address](https://github.com/EasyTuan/node-elm-api)
170 |
171 | # License
172 |
173 | [GPL](LICENSE)
174 |
--------------------------------------------------------------------------------
/controller/user/user.js:
--------------------------------------------------------------------------------
1 | import UserModel from '../../models/user/user'
2 | import crypto from 'crypto';
3 | import dtime from 'time-formater';
4 | import uuid from 'uuid/v1';
5 |
6 | class Admin {
7 | constructor() {
8 | this.login = this.login.bind(this);
9 | this.encryption = this.encryption.bind(this);
10 | this.retsetPassword = this.retsetPassword.bind(this);
11 | }
12 | async login(req, res, next) {
13 | const {
14 | mobile,
15 | password
16 | } = req.body;
17 | try {
18 | if(!mobile) {
19 | throw new Error('用户名参数错误');
20 | } else if(!password) {
21 | throw new Error('密码参数错误');
22 | }
23 | } catch(err) {
24 | res.send({
25 | code: -1,
26 | msg: err.message,
27 | data: null
28 | })
29 | return;
30 | }
31 | const newpassword = this.encryption(password);
32 | try {
33 | const user = await UserModel.findOne({
34 | mobile
35 | })
36 | if(!user) {
37 | const user_id = uuid();
38 | const newUser = {
39 | user_id,
40 | mobile,
41 | password: newpassword,
42 | username: uuid().slice(0, 8),
43 | create_time: dtime().format('YYYY-MM-DD HH:mm:ss'),
44 | }
45 | await UserModel.create(newUser)
46 | this.selectUserInfo(res, user_id);
47 | } else if(newpassword.toString() != user.password.toString()) {
48 | res.send({
49 | code: -1,
50 | msg: '该用户已存在,密码输入错误',
51 | data: null
52 | })
53 | } else {
54 | res.send({
55 | code: 0,
56 | msg: '登录成功',
57 | data: user
58 | })
59 | }
60 | } catch(err) {
61 | res.send({
62 | code: -1,
63 | msg: String(err),
64 | data: null,
65 | })
66 | }
67 | }
68 | encryption(password) {
69 | const newpassword = this.Md5(this.Md5(password).substr(3, 12) + this.Md5(password));
70 | return newpassword;
71 | }
72 | Md5(password) {
73 | const md5 = crypto.createHash('md5');
74 | return md5.update(password).digest('base64');
75 | }
76 | async getUserInfo(req, res, next) {
77 | this.selectUserInfo(res, req.body.user_id);
78 | }
79 | async selectUserInfo(res, user_id) {
80 | if(!user_id) {
81 | res.send({
82 | code: -1,
83 | msg: '获取用户信息失败',
84 | data: null
85 | })
86 | return;
87 | }
88 | try {
89 | const info = await UserModel.findOne({
90 | user_id: user_id
91 | });
92 | if(!info) {
93 | throw new Error('用户不存在')
94 | } else {
95 | res.send({
96 | code: 0,
97 | msg: '获取用户信息成功',
98 | data: info
99 | })
100 | }
101 | } catch(err) {
102 | res.send({
103 | code: -1,
104 | msg: err.message,
105 | data: null
106 | })
107 | }
108 | }
109 | async retsetName(req, res, next) {
110 | const {
111 | username
112 | } = req.body;
113 | const {
114 | userInfo
115 | } = req.cookies;
116 | try {
117 | if(!username) {
118 | throw new Error('用户名不可为空');
119 | } else if(username.length < 2 || username.length > 24) {
120 | throw new Error('用户名长度不合法');
121 | } else if(!userInfo || !JSON.parse(userInfo).user_id) {
122 | throw new Error('登录已过期');
123 | }
124 | } catch(err) {
125 | res.send({
126 | code: -1,
127 | msg: err.message,
128 | data: null
129 | })
130 | return;
131 | }
132 | try {
133 | const info = await UserModel.findOneAndUpdate({
134 | user_id: JSON.parse(userInfo).user_id
135 | }, {
136 | $set: {
137 | username
138 | }
139 | });
140 | if(!info) {
141 | throw new Error('用户不存在')
142 | } else {
143 | res.send({
144 | code: 0,
145 | msg: '更新用户信息成功',
146 | data: info
147 | })
148 | }
149 | } catch(err) {
150 | res.send({
151 | code: -1,
152 | msg: err.message,
153 | data: null
154 | })
155 | }
156 | }
157 | async retsetPassword(req, res, next) {
158 | const {
159 | oldpassword,
160 | newpassword
161 | } = req.body;
162 | const {
163 | userInfo
164 | } = req.cookies;
165 | try {
166 | if(!oldpassword) {
167 | throw new Error('请输入旧密码');
168 | } else if(!newpassword) {
169 | throw new Error('请输入新密码');
170 | } else if(!userInfo || !JSON.parse(userInfo).user_id) {
171 | throw new Error('登录已过期');
172 | }
173 | } catch(err) {
174 | res.send({
175 | code: -1,
176 | msg: err.message,
177 | data: null
178 | })
179 | return;
180 | }
181 | try {
182 | const info = await UserModel.findOneAndUpdate({
183 | user_id: JSON.parse(userInfo).user_id,
184 | password: this.encryption(oldpassword)
185 | }, {
186 | $set: {
187 | password: this.encryption(newpassword)
188 | }
189 | });
190 | if(!info) {
191 | throw new Error('原密码错误,请重新输入')
192 | } else {
193 | res.send({
194 | code: 0,
195 | msg: '更新密码成功',
196 | data: info
197 | })
198 | }
199 | } catch(err) {
200 | res.send({
201 | code: -1,
202 | msg: err.message,
203 | data: null
204 | })
205 | }
206 | }
207 | }
208 |
209 | export default new Admin()
--------------------------------------------------------------------------------
/routes/user.js:
--------------------------------------------------------------------------------
1 | import express from 'express';
2 | const router = express.Router();
3 |
4 | import user from '../controller/user/user';
5 | import address from '../controller/user/address';
6 |
7 | /**
8 | * @api {post} /user/login login
9 | * @apiDescription 用户登陆(新用户自动注册)
10 | * @apiGroup user
11 | * @apiVersion 1.0.0
12 | *
13 | * @apiParam {String} mobile 手机号
14 | * @apiParam {String} password 密码
15 | *
16 | * @apiSuccess {Number} code 成功状态码
17 | * @apiSuccess {String} msg 返回信息
18 | * @apiSuccess {Object} data 返回用户信息
19 | *
20 | * @apiSuccessExample Success-Response:
21 | * HTTP/1.1 200 OK
22 | * {
23 | * "code": 0,
24 | * "msg": "登录成功",
25 | * "data": {
26 | * "_id":"5b7a61bo5661e20e3o8e7764",
27 | * "user_id":"f5d746a1-adkk-11e6-8146-0b4ccjkd1fd5",
28 | * "mobile":"13818334060",
29 | * "password":"F3kcH9qCfhvrFYeop2s8AC==",
30 | * "username":"啦啦啦",
31 | * "create_time":"2018-09-01 17:54:04",
32 | * "__v":0,
33 | * "avatar":null
34 | * }
35 | * }
36 | *
37 | */
38 | router.post('/login', user.login);
39 |
40 | /**
41 | * @api {post} /user/retsetName retsetName
42 | * @apiDescription 修改用户名
43 | * @apiGroup user
44 | * @apiVersion 1.0.0
45 | *
46 | * @apiParam {String} username 用户名
47 | *
48 | * @apiSuccess {Number} code 成功状态码
49 | * @apiSuccess {String} msg 返回信息
50 | * @apiSuccess {Object} data 返回用户信息
51 | *
52 | * @apiSuccessExample Success-Response:
53 | * HTTP/1.1 200 OK
54 | * {
55 | * "code": 0,
56 | * "msg": "更新用户信息成功",
57 | * "data": {
58 | * "_id":"5b7a61bo5661e20e3o8e7764",
59 | * "user_id":"f5d746a1-adkk-11e6-8146-0b4ccjkd1fd5",
60 | * "mobile":"13818334060",
61 | * "password":"F3kcH9qCfhvrFYeop2s8AC==",
62 | * "username":"啦啦啦",
63 | * "create_time":"2018-09-01 17:54:04",
64 | * "__v":0,
65 | * "avatar":null
66 | * }
67 | * }
68 | *
69 | */
70 | router.post('/retsetName', user.retsetName);
71 |
72 | /**
73 | * @api {post} /user/retsetPassword retsetPassword
74 | * @apiDescription 修改密码
75 | * @apiGroup user
76 | * @apiVersion 1.0.0
77 | *
78 | * @apiParam {String} oldpassword 原始密码
79 | * @apiParam {String} newpassword 新密码
80 | *
81 | * @apiSuccess {Number} code 成功状态码
82 | * @apiSuccess {String} msg 返回信息
83 | * @apiSuccess {Object} data 返回用户信息
84 | *
85 | * @apiSuccessExample Success-Response:
86 | * HTTP/1.1 200 OK
87 | * {
88 | * "code": 0,
89 | * "msg": "更新密码成功",
90 | * "data": {
91 | * "_id":"5b7a61bo5661e20e3o8e7764",
92 | * "user_id":"f5d746a1-adkk-11e6-8146-0b4ccjkd1fd5",
93 | * "mobile":"13818334060",
94 | * "password":"F3kcH9qCfhvrFYeop2s8AC==",
95 | * "username":"啦啦啦",
96 | * "create_time":"2018-09-01 17:54:04",
97 | * "__v":0,
98 | * "avatar":null
99 | * }
100 | * }
101 | *
102 | */
103 | router.post('/retsetPassword', user.retsetPassword);
104 |
105 | /**
106 | * @api {get} /user/getAddress getAddress
107 | * @apiDescription 获取用户地址列表
108 | * @apiGroup user
109 | * @apiVersion 1.0.0
110 | *
111 | *
112 | * @apiSuccess {Number} code 成功状态码
113 | * @apiSuccess {String} msg 返回信息
114 | * @apiSuccess {Array} data 返回用户地址列表
115 | *
116 | * @apiSuccessExample Success-Response:
117 | * HTTP/1.1 200 OK
118 | * {
119 | * "code": 0,
120 | * "msg": "更新密码成功",
121 | * "data": []
122 | * }
123 | *
124 | */
125 | router.get('/getAddress', address.getAddress);
126 |
127 | /**
128 | * @api {get} /user/getAddAddressById getAddAddressById
129 | * @apiDescription 获取用户地址详情
130 | * @apiGroup user
131 | * @apiVersion 1.0.0
132 | *
133 | *
134 | * @apiSuccess {Number} code 成功状态码
135 | * @apiSuccess {String} msg 返回信息
136 | * @apiSuccess {Object} data 返回用户地址
137 | *
138 | * @apiSuccessExample Success-Response:
139 | * HTTP/1.1 200 OK
140 | * {
141 | * "code": 0,
142 | * "msg": "获取地址信息成功",
143 | * "data": {}
144 | * }
145 | *
146 | */
147 | router.get('/getAddAddressById', address.getAddAddressById);
148 |
149 | /**
150 | * @api {post} /user/addAddress addAddress
151 | * @apiDescription 添加用户地址
152 | * @apiGroup user
153 | * @apiVersion 1.0.0
154 | *
155 | *
156 | * @apiSuccess {Number} code 成功状态码
157 | * @apiSuccess {String} msg 返回信息
158 | * @apiSuccess {null} data
159 | *
160 | * @apiSuccessExample Success-Response:
161 | * HTTP/1.1 200 OK
162 | * {
163 | * "code": 0,
164 | * "msg": "添加地址成功",
165 | * "data": null
166 | * }
167 | *
168 | */
169 | router.post('/addAddress', address.addAddress);
170 |
171 | /**
172 | * @api {delete} /user/deleteAddress deleteAddress
173 | * @apiDescription 删除用户地址
174 | * @apiGroup user
175 | * @apiVersion 1.0.0
176 | *
177 | *
178 | * @apiSuccess {Number} code 成功状态码
179 | * @apiSuccess {String} msg 返回信息
180 | * @apiSuccess {null} data
181 | *
182 | * @apiSuccessExample Success-Response:
183 | * HTTP/1.1 200 OK
184 | * {
185 | * "code": 0,
186 | * "msg": "删除地址成功",
187 | * "data": null
188 | * }
189 | *
190 | */
191 | router.delete('/deleteAddress', address.deleteAddress);
192 |
193 | export default router;
--------------------------------------------------------------------------------
/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 |
--------------------------------------------------------------------------------
/doc/utils/send_sample_request.js:
--------------------------------------------------------------------------------
1 | define([
2 | 'jquery',
3 | 'lodash'
4 | ], function($, _) {
5 |
6 | var initDynamic = function() {
7 | // Button send
8 | $(".sample-request-send").off("click");
9 | $(".sample-request-send").on("click", function(e) {
10 | e.preventDefault();
11 | var $root = $(this).parents("article");
12 | var group = $root.data("group");
13 | var name = $root.data("name");
14 | var version = $root.data("version");
15 | sendSampleRequest(group, name, version, $(this).data("sample-request-type"));
16 | });
17 |
18 | // Button clear
19 | $(".sample-request-clear").off("click");
20 | $(".sample-request-clear").on("click", function(e) {
21 | e.preventDefault();
22 | var $root = $(this).parents("article");
23 | var group = $root.data("group");
24 | var name = $root.data("name");
25 | var version = $root.data("version");
26 | clearSampleRequest(group, name, version);
27 | });
28 | }; // initDynamic
29 |
30 | function sendSampleRequest(group, name, version, type)
31 | {
32 | var $root = $('article[data-group="' + group + '"][data-name="' + name + '"][data-version="' + version + '"]');
33 |
34 | // Optional header
35 | var header = {};
36 | $root.find(".sample-request-header:checked").each(function(i, element) {
37 | var group = $(element).data("sample-request-header-group-id");
38 | $root.find("[data-sample-request-header-group=\"" + group + "\"]").each(function(i, element) {
39 | var key = $(element).data("sample-request-header-name");
40 | var value = element.value;
41 | if ( ! element.optional && element.defaultValue !== '') {
42 | value = element.defaultValue;
43 | }
44 | header[key] = value;
45 | });
46 | });
47 |
48 | // create JSON dictionary of parameters
49 | var param = {};
50 | var paramType = {};
51 | $root.find(".sample-request-param:checked").each(function(i, element) {
52 | var group = $(element).data("sample-request-param-group-id");
53 | $root.find("[data-sample-request-param-group=\"" + group + "\"]").not(function(){
54 | return $(this).val() == "" && $(this).is("[data-sample-request-param-optional='true']");
55 | }).each(function(i, element) {
56 | var key = $(element).data("sample-request-param-name");
57 | var value = element.value;
58 | if ( ! element.optional && element.defaultValue !== '') {
59 | value = element.defaultValue;
60 | }
61 | param[key] = value;
62 | paramType[key] = $(element).next().text();
63 | });
64 | });
65 |
66 | // grab user-inputted URL
67 | var url = $root.find(".sample-request-url").val();
68 |
69 | // Insert url parameter
70 | var pattern = pathToRegexp(url, null);
71 | var matches = pattern.exec(url);
72 | for (var i = 1; i < matches.length; i++) {
73 | var key = matches[i].substr(1);
74 | if (param[key] !== undefined) {
75 | url = url.replace(matches[i], encodeURIComponent(param[key]));
76 |
77 | // remove URL parameters from list
78 | delete param[key];
79 | }
80 | } // for
81 |
82 | $root.find(".sample-request-response").fadeTo(250, 1);
83 | $root.find(".sample-request-response-json").html("Loading...");
84 | refreshScrollSpy();
85 |
86 | _.each( param, function( val, key ) {
87 | var t = paramType[ key ].toLowerCase();
88 | if ( t === 'object' || t === 'array' ) {
89 | try {
90 | param[ key ] = JSON.parse( val );
91 | } catch (e) {
92 | }
93 | }
94 | });
95 |
96 | // send AJAX request, catch success or error callback
97 | var ajaxRequest = {
98 | url : url,
99 | headers : header,
100 | data : param,
101 | type : type.toUpperCase(),
102 | success : displaySuccess,
103 | error : displayError
104 | };
105 |
106 | $.ajax(ajaxRequest);
107 |
108 |
109 | function displaySuccess(data, status, jqXHR) {
110 | var jsonResponse;
111 | try {
112 | jsonResponse = JSON.parse(jqXHR.responseText);
113 | jsonResponse = JSON.stringify(jsonResponse, null, 4);
114 | } catch (e) {
115 | jsonResponse = data;
116 | }
117 | $root.find(".sample-request-response-json").html(jsonResponse);
118 | refreshScrollSpy();
119 | };
120 |
121 | function displayError(jqXHR, textStatus, error) {
122 | var message = "Error " + jqXHR.status + ": " + error;
123 | var jsonResponse;
124 | try {
125 | jsonResponse = JSON.parse(jqXHR.responseText);
126 | jsonResponse = JSON.stringify(jsonResponse, null, 4);
127 | } catch (e) {
128 | jsonResponse = escape(jqXHR.responseText);
129 | }
130 |
131 | if (jsonResponse)
132 | message += "
" + jsonResponse;
133 |
134 | // flicker on previous error to make clear that there is a new response
135 | if($root.find(".sample-request-response").is(":visible"))
136 | $root.find(".sample-request-response").fadeTo(1, 0.1);
137 |
138 | $root.find(".sample-request-response").fadeTo(250, 1);
139 | $root.find(".sample-request-response-json").html(message);
140 | refreshScrollSpy();
141 | };
142 | }
143 |
144 | function clearSampleRequest(group, name, version)
145 | {
146 | var $root = $('article[data-group="' + group + '"][data-name="' + name + '"][data-version="' + version + '"]');
147 |
148 | // hide sample response
149 | $root.find(".sample-request-response-json").html("");
150 | $root.find(".sample-request-response").hide();
151 |
152 | // reset value of parameters
153 | $root.find(".sample-request-param").each(function(i, element) {
154 | element.value = "";
155 | });
156 |
157 | // restore default URL
158 | var $urlElement = $root.find(".sample-request-url");
159 | $urlElement.val($urlElement.prop("defaultValue"));
160 |
161 | refreshScrollSpy();
162 | }
163 |
164 | function refreshScrollSpy()
165 | {
166 | $('[data-spy="scroll"]').each(function () {
167 | $(this).scrollspy("refresh");
168 | });
169 | }
170 |
171 | function escapeHtml(str) {
172 | var div = document.createElement("div");
173 | div.appendChild(document.createTextNode(str));
174 | return div.innerHTML;
175 | }
176 |
177 | /**
178 | * Exports.
179 | */
180 | return {
181 | initDynamic: initDynamic
182 | };
183 |
184 | });
185 |
--------------------------------------------------------------------------------
/doc/utils/handlebars_helper.js:
--------------------------------------------------------------------------------
1 | define([
2 | 'locales',
3 | 'handlebars',
4 | 'diffMatchPatch'
5 | ], function(locale, Handlebars, DiffMatchPatch) {
6 |
7 | /**
8 | * Return a text as markdown.
9 | * Currently only a little helper to replace apidoc-inline Links (#Group:Name).
10 | * Should be replaced with a full markdown lib.
11 | * @param string text
12 | */
13 | Handlebars.registerHelper('markdown', function(text) {
14 | if ( ! text ) {
15 | return text;
16 | }
17 | text = text.replace(/((\[(.*?)\])?\(#)((.+?):(.+?))(\))/mg, function(match, p1, p2, p3, p4, p5, p6) {
18 | var link = p3 || p5 + '/' + p6;
19 | return '' + link + '';
20 | });
21 | return text;
22 | });
23 |
24 | /**
25 | * start/stop timer for simple performance check.
26 | */
27 | var timer;
28 | Handlebars.registerHelper('startTimer', function(text) {
29 | timer = new Date();
30 | return '';
31 | });
32 |
33 | Handlebars.registerHelper('stopTimer', function(text) {
34 | console.log(new Date() - timer);
35 | return '';
36 | });
37 |
38 | /**
39 | * Return localized Text.
40 | * @param string text
41 | */
42 | Handlebars.registerHelper('__', function(text) {
43 | return locale.__(text);
44 | });
45 |
46 | /**
47 | * Console log.
48 | * @param mixed obj
49 | */
50 | Handlebars.registerHelper('cl', function(obj) {
51 | console.log(obj);
52 | return '';
53 | });
54 |
55 | /**
56 | * Replace underscore with space.
57 | * @param string text
58 | */
59 | Handlebars.registerHelper('underscoreToSpace', function(text) {
60 | return text.replace(/(_+)/g, ' ');
61 | });
62 |
63 | /**
64 | *
65 | */
66 | Handlebars.registerHelper('assign', function(name) {
67 | if(arguments.length > 0) {
68 | var type = typeof(arguments[1]);
69 | var arg = null;
70 | if(type === 'string' || type === 'number' || type === 'boolean') arg = arguments[1];
71 | Handlebars.registerHelper(name, function() { return arg; });
72 | }
73 | return '';
74 | });
75 |
76 | /**
77 | *
78 | */
79 | Handlebars.registerHelper('nl2br', function(text) {
80 | return _handlebarsNewlineToBreak(text);
81 | });
82 |
83 | /**
84 | *
85 | */
86 | Handlebars.registerHelper('if_eq', function(context, options) {
87 | var compare = context;
88 | // Get length if context is an object
89 | if (context instanceof Object && ! (options.hash.compare instanceof Object))
90 | compare = Object.keys(context).length;
91 |
92 | if (compare === options.hash.compare)
93 | return options.fn(this);
94 |
95 | return options.inverse(this);
96 | });
97 |
98 | /**
99 | *
100 | */
101 | Handlebars.registerHelper('if_gt', function(context, options) {
102 | var compare = context;
103 | // Get length if context is an object
104 | if (context instanceof Object && ! (options.hash.compare instanceof Object))
105 | compare = Object.keys(context).length;
106 |
107 | if(compare > options.hash.compare)
108 | return options.fn(this);
109 |
110 | return options.inverse(this);
111 | });
112 |
113 | /**
114 | *
115 | */
116 | var templateCache = {};
117 | Handlebars.registerHelper('subTemplate', function(name, sourceContext) {
118 | if ( ! templateCache[name])
119 | templateCache[name] = Handlebars.compile($('#template-' + name).html());
120 |
121 | var template = templateCache[name];
122 | var templateContext = $.extend({}, this, sourceContext.hash);
123 | return new Handlebars.SafeString( template(templateContext) );
124 | });
125 |
126 | /**
127 | *
128 | */
129 | Handlebars.registerHelper('toLowerCase', function(value) {
130 | return (value && typeof value === 'string') ? value.toLowerCase() : '';
131 | });
132 |
133 | /**
134 | *
135 | */
136 | Handlebars.registerHelper('splitFill', function(value, splitChar, fillChar) {
137 | var splits = value.split(splitChar);
138 | return new Array(splits.length).join(fillChar) + splits[splits.length - 1];
139 | });
140 |
141 | /**
142 | * Convert Newline to HTML-Break (nl2br).
143 | *
144 | * @param {String} text
145 | * @returns {String}
146 | */
147 | function _handlebarsNewlineToBreak(text) {
148 | return ('' + text).replace(/([^>\r\n]?)(\r\n|\n\r|\r|\n)/g, '$1' + '
' + '$2');
149 | }
150 |
151 | /**
152 | *
153 | */
154 | Handlebars.registerHelper('each_compare_list_field', function(source, compare, options) {
155 | var fieldName = options.hash.field;
156 | var newSource = [];
157 | if (source) {
158 | source.forEach(function(entry) {
159 | var values = entry;
160 | values['key'] = entry[fieldName];
161 | newSource.push(values);
162 | });
163 | }
164 |
165 | var newCompare = [];
166 | if (compare) {
167 | compare.forEach(function(entry) {
168 | var values = entry;
169 | values['key'] = entry[fieldName];
170 | newCompare.push(values);
171 | });
172 | }
173 | return _handlebarsEachCompared('key', newSource, newCompare, options);
174 | });
175 |
176 | /**
177 | *
178 | */
179 | Handlebars.registerHelper('each_compare_keys', function(source, compare, options) {
180 | var newSource = [];
181 | if (source) {
182 | var sourceFields = Object.keys(source);
183 | sourceFields.forEach(function(name) {
184 | var values = {};
185 | values['value'] = source[name];
186 | values['key'] = name;
187 | newSource.push(values);
188 | });
189 | }
190 |
191 | var newCompare = [];
192 | if (compare) {
193 | var compareFields = Object.keys(compare);
194 | compareFields.forEach(function(name) {
195 | var values = {};
196 | values['value'] = compare[name];
197 | values['key'] = name;
198 | newCompare.push(values);
199 | });
200 | }
201 | return _handlebarsEachCompared('key', newSource, newCompare, options);
202 | });
203 |
204 | /**
205 | *
206 | */
207 | Handlebars.registerHelper('each_compare_field', function(source, compare, options) {
208 | return _handlebarsEachCompared('field', source, compare, options);
209 | });
210 |
211 | /**
212 | *
213 | */
214 | Handlebars.registerHelper('each_compare_title', function(source, compare, options) {
215 | return _handlebarsEachCompared('title', source, compare, options);
216 | });
217 |
218 | /**
219 | *
220 | */
221 | Handlebars.registerHelper('reformat', function(source, type){
222 | if (type == 'json')
223 | try {
224 | return JSON.stringify(JSON.parse(source.trim()),null, " ");
225 | } catch(e) {
226 |
227 | }
228 | return source
229 | });
230 |
231 | /**
232 | *
233 | */
234 | Handlebars.registerHelper('showDiff', function(source, compare, options) {
235 | var ds = '';
236 | if(source === compare) {
237 | ds = source;
238 | } else {
239 | if( ! source)
240 | return compare;
241 |
242 | if( ! compare)
243 | return source;
244 |
245 | var d = diffMatchPatch.diff_main(compare, source);
246 | diffMatchPatch.diff_cleanupSemantic(d);
247 | ds = diffMatchPatch.diff_prettyHtml(d);
248 | ds = ds.replace(/¶/gm, '');
249 | }
250 | if(options === 'nl2br')
251 | ds = _handlebarsNewlineToBreak(ds);
252 |
253 | return ds;
254 | });
255 |
256 | /**
257 | *
258 | */
259 | function _handlebarsEachCompared(fieldname, source, compare, options)
260 | {
261 | var dataList = [];
262 | var index = 0;
263 | if(source) {
264 | source.forEach(function(sourceEntry) {
265 | var found = false;
266 | if (compare) {
267 | compare.forEach(function(compareEntry) {
268 | if(sourceEntry[fieldname] === compareEntry[fieldname]) {
269 | var data = {
270 | typeSame: true,
271 | source: sourceEntry,
272 | compare: compareEntry,
273 | index: index
274 | };
275 | dataList.push(data);
276 | found = true;
277 | index++;
278 | }
279 | });
280 | }
281 | if ( ! found) {
282 | var data = {
283 | typeIns: true,
284 | source: sourceEntry,
285 | index: index
286 | };
287 | dataList.push(data);
288 | index++;
289 | }
290 | });
291 | }
292 |
293 | if (compare) {
294 | compare.forEach(function(compareEntry) {
295 | var found = false;
296 | if (source) {
297 | source.forEach(function(sourceEntry) {
298 | if(sourceEntry[fieldname] === compareEntry[fieldname])
299 | found = true;
300 | });
301 | }
302 | if ( ! found) {
303 | var data = {
304 | typeDel: true,
305 | compare: compareEntry,
306 | index: index
307 | };
308 | dataList.push(data);
309 | index++;
310 | }
311 | });
312 | }
313 |
314 | var ret = '';
315 | var length = dataList.length;
316 | for (var index in dataList) {
317 | if(index == (length - 1))
318 | dataList[index]['_last'] = true;
319 | ret = ret + options.fn(dataList[index]);
320 | }
321 | return ret;
322 | }
323 |
324 | var diffMatchPatch = new DiffMatchPatch();
325 |
326 | /**
327 | * Overwrite Colors
328 | */
329 | DiffMatchPatch.prototype.diff_prettyHtml = function(diffs) {
330 | var html = [];
331 | var pattern_amp = /&/g;
332 | var pattern_lt = //g;
334 | var pattern_para = /\n/g;
335 | for (var x = 0; x < diffs.length; x++) {
336 | var op = diffs[x][0]; // Operation (insert, delete, equal)
337 | var data = diffs[x][1]; // Text of change.
338 | var text = data.replace(pattern_amp, '&').replace(pattern_lt, '<')
339 | .replace(pattern_gt, '>').replace(pattern_para, '¶
');
340 | switch (op) {
341 | case DIFF_INSERT:
342 | html[x] = '' + text + '';
343 | break;
344 | case DIFF_DELETE:
345 | html[x] = '' + text + '';
346 | break;
347 | case DIFF_EQUAL:
348 | html[x] = '' + text + '';
349 | break;
350 | }
351 | }
352 | return html.join('');
353 | };
354 |
355 | // Exports
356 | return Handlebars;
357 | });
358 |
--------------------------------------------------------------------------------
/doc/vendor/webfontloader.js:
--------------------------------------------------------------------------------
1 | /* Web Font Loader v1.6.24 - (c) Adobe Systems, Google. License: Apache 2.0 */
2 | (function(){function aa(a,b,d){return a.call.apply(a.bind,arguments)}function ba(a,b,d){if(!a)throw Error();if(2=b.f?e():a.fonts.load(fa(b.a),b.h).then(function(a){1<=a.length?c():setTimeout(k,25)},function(){e()})}k()}),e=new Promise(function(a,c){setTimeout(c,b.f)});Promise.race([e,c]).then(function(){b.g(b.a)},function(){b.j(b.a)})};function R(a,b,d,c,e,f,g){this.v=a;this.B=b;this.c=d;this.a=c;this.s=g||"BESbswy";this.f={};this.w=e||3E3;this.u=f||null;this.o=this.j=this.h=this.g=null;this.g=new N(this.c,this.s);this.h=new N(this.c,this.s);this.j=new N(this.c,this.s);this.o=new N(this.c,this.s);a=new H(this.a.c+",serif",K(this.a));a=P(a);this.g.a.style.cssText=a;a=new H(this.a.c+",sans-serif",K(this.a));a=P(a);this.h.a.style.cssText=a;a=new H("serif",K(this.a));a=P(a);this.j.a.style.cssText=a;a=new H("sans-serif",K(this.a));a=
8 | P(a);this.o.a.style.cssText=a;O(this.g);O(this.h);O(this.j);O(this.o)}var S={D:"serif",C:"sans-serif"},T=null;function U(){if(null===T){var a=/AppleWebKit\/([0-9]+)(?:\.([0-9]+))/.exec(window.navigator.userAgent);T=!!a&&(536>parseInt(a[1],10)||536===parseInt(a[1],10)&&11>=parseInt(a[2],10))}return T}R.prototype.start=function(){this.f.serif=this.j.a.offsetWidth;this.f["sans-serif"]=this.o.a.offsetWidth;this.A=q();la(this)};
9 | function ma(a,b,d){for(var c in S)if(S.hasOwnProperty(c)&&b===a.f[S[c]]&&d===a.f[S[c]])return!0;return!1}function la(a){var b=a.g.a.offsetWidth,d=a.h.a.offsetWidth,c;(c=b===a.f.serif&&d===a.f["sans-serif"])||(c=U()&&ma(a,b,d));c?q()-a.A>=a.w?U()&&ma(a,b,d)&&(null===a.u||a.u.hasOwnProperty(a.a.c))?V(a,a.v):V(a,a.B):na(a):V(a,a.v)}function na(a){setTimeout(p(function(){la(this)},a),50)}function V(a,b){setTimeout(p(function(){v(this.g.a);v(this.h.a);v(this.j.a);v(this.o.a);b(this.a)},a),0)};function W(a,b,d){this.c=a;this.a=b;this.f=0;this.o=this.j=!1;this.s=d}var X=null;W.prototype.g=function(a){var b=this.a;b.g&&w(b.f,[b.a.c("wf",a.c,K(a).toString(),"active")],[b.a.c("wf",a.c,K(a).toString(),"loading"),b.a.c("wf",a.c,K(a).toString(),"inactive")]);L(b,"fontactive",a);this.o=!0;oa(this)};
10 | W.prototype.h=function(a){var b=this.a;if(b.g){var d=y(b.f,b.a.c("wf",a.c,K(a).toString(),"active")),c=[],e=[b.a.c("wf",a.c,K(a).toString(),"loading")];d||c.push(b.a.c("wf",a.c,K(a).toString(),"inactive"));w(b.f,c,e)}L(b,"fontinactive",a);oa(this)};function oa(a){0==--a.f&&a.j&&(a.o?(a=a.a,a.g&&w(a.f,[a.a.c("wf","active")],[a.a.c("wf","loading"),a.a.c("wf","inactive")]),L(a,"active")):M(a.a))};function pa(a){this.j=a;this.a=new ja;this.h=0;this.f=this.g=!0}pa.prototype.load=function(a){this.c=new ca(this.j,a.context||this.j);this.g=!1!==a.events;this.f=!1!==a.classes;qa(this,new ha(this.c,a),a)};
11 | function ra(a,b,d,c,e){var f=0==--a.h;(a.f||a.g)&&setTimeout(function(){var a=e||null,k=c||null||{};if(0===d.length&&f)M(b.a);else{b.f+=d.length;f&&(b.j=f);var h,m=[];for(h=0;h)?=?)";var E=s++;i[E]=i[a]+"|x|X|\\*";var $=s++;i[$]=i[o]+"|x|X|\\*";var k=s++;i[k]="[v=\\s]*("+i[$]+")"+"(?:\\.("+i[$]+")"+"(?:\\.("+i[$]+")"+"(?:"+i[c]+")?"+i[g]+"?"+")?)?";var R=s++;i[R]="[v=\\s]*("+i[E]+")"+"(?:\\.("+i[E]+")"+"(?:\\.("+i[E]+")"+"(?:"+i[v]+")?"+i[g]+"?"+")?)?";var S=s++;i[S]="^"+i[b]+"\\s*"+i[k]+"$";var x=s++;i[x]="^"+i[b]+"\\s*"+i[R]+"$";var I=s++;i[I]="(?:~>?)";var T=s++;i[T]="(\\s*)"+i[I]+"\\s+";n[T]=new RegExp(i[T],"g");var V="$1~";var A=s++;i[A]="^"+i[I]+i[k]+"$";var C=s++;i[C]="^"+i[I]+i[R]+"$";var M=s++;i[M]="(?:\\^)";var N=s++;i[N]="(\\s*)"+i[M]+"\\s+";n[N]=new RegExp(i[N],"g");var _="$1^";var z=s++;i[z]="^"+i[M]+i[k]+"$";var P=s++;i[P]="^"+i[M]+i[R]+"$";var X=s++;i[X]="^"+i[b]+"\\s*("+d+")$|^$";var Z=s++;i[Z]="^"+i[b]+"\\s*("+y+")$|^$";var q=s++;i[q]="(\\s*)"+i[b]+"\\s*("+d+"|"+i[k]+")";n[q]=new RegExp(i[q],"g");var L="$1$2$3";var F=s++;i[F]="^\\s*("+i[k]+")"+"\\s+-\\s+"+"("+i[k]+")"+"\\s*$";var G=s++;i[G]="^\\s*("+i[R]+")"+"\\s+-\\s+"+"("+i[R]+")"+"\\s*$";var O=s++;i[O]="(<|>)?=?\\s*\\*";for(var B=0;Br)return null;var i=t?n[j]:n[w];if(!i.test(e))return null;try{return new K(e,t)}catch(s){return null}}e.valid=H;function H(e,r){var t=D(e,r);return t?t.version:null}e.clean=J;function J(e,r){var t=D(e.trim().replace(/^[=v]+/,""),r);return t?t.version:null}e.SemVer=K;function K(e,i){if(e instanceof K){if(e.loose===i)return e;else e=e.version}else if(typeof e!=="string"){throw new TypeError("Invalid Version: "+e)}if(e.length>r)throw new TypeError("version is longer than "+r+" characters");if(!(this instanceof K))return new K(e,i);this.loose=i;var s=e.trim().match(i?n[j]:n[w]);if(!s)throw new TypeError("Invalid Version: "+e);this.raw=e;this.major=+s[1];this.minor=+s[2];this.patch=+s[3];if(this.major>t||this.major<0)throw new TypeError("Invalid major version");if(this.minor>t||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>t||this.patch<0)throw new TypeError("Invalid patch version");if(!s[4])this.prerelease=[];else this.prerelease=s[4].split(".").map(function(e){if(/^[0-9]+$/.test(e)){var r=+e;if(r>=0&&r'};K.prototype.toString=function(){return this.version};K.prototype.compare=function(e){if(!(e instanceof K))e=new K(e,this.loose);return this.compareMain(e)||this.comparePre(e)};K.prototype.compareMain=function(e){if(!(e instanceof K))e=new K(e,this.loose);return Y(this.major,e.major)||Y(this.minor,e.minor)||Y(this.patch,e.patch)};K.prototype.comparePre=function(e){if(!(e instanceof K))e=new K(e,this.loose);if(this.prerelease.length&&!e.prerelease.length)return-1;else if(!this.prerelease.length&&e.prerelease.length)return 1;else if(!this.prerelease.length&&!e.prerelease.length)return 0;var r=0;do{var t=this.prerelease[r];var n=e.prerelease[r];if(t===undefined&&n===undefined)return 0;else if(n===undefined)return 1;else if(t===undefined)return-1;else if(t===n)continue;else return Y(t,n)}while(++r)};K.prototype.inc=function(e,r){switch(e){case"premajor":this.prerelease.length=0;this.patch=0;this.minor=0;this.major++;this.inc("pre",r);break;case"preminor":this.prerelease.length=0;this.patch=0;this.minor++;this.inc("pre",r);break;case"prepatch":this.prerelease.length=0;this.inc("patch",r);this.inc("pre",r);break;case"prerelease":if(this.prerelease.length===0)this.inc("patch",r);this.inc("pre",r);break;case"major":if(this.minor!==0||this.patch!==0||this.prerelease.length===0)this.major++;this.minor=0;this.patch=0;this.prerelease=[];break;case"minor":if(this.patch!==0||this.prerelease.length===0)this.minor++;this.patch=0;this.prerelease=[];break;case"patch":if(this.prerelease.length===0)this.patch++;this.prerelease=[];break;case"pre":if(this.prerelease.length===0)this.prerelease=[0];else{var t=this.prerelease.length;while(--t>=0){if(typeof this.prerelease[t]==="number"){this.prerelease[t]++;t=-2}}if(t===-1)this.prerelease.push(0)}if(r){if(this.prerelease[0]===r){if(isNaN(this.prerelease[1]))this.prerelease=[r,0]}else this.prerelease=[r,0]}break;default:throw new Error("invalid increment argument: "+e)}this.format();return this};e.inc=Q;function Q(e,r,t,n){if(typeof t==="string"){n=t;t=undefined}try{return new K(e,t).inc(r,n).version}catch(i){return null}}e.diff=U;function U(e,r){if(pr(e,r)){return null}else{var t=D(e);var n=D(r);if(t.prerelease.length||n.prerelease.length){for(var i in t){if(i==="major"||i==="minor"||i==="patch"){if(t[i]!==n[i]){return"pre"+i}}}return"prerelease"}for(var i in t){if(i==="major"||i==="minor"||i==="patch"){if(t[i]!==n[i]){return i}}}}}e.compareIdentifiers=Y;var W=/^[0-9]+$/;function Y(e,r){var t=W.test(e);var n=W.test(r);if(t&&n){e=+e;r=+r}return t&&!n?-1:n&&!t?1:er?1:0}e.rcompareIdentifiers=er;function er(e,r){return Y(r,e)}e.major=rr;function rr(e,r){return new K(e,r).major}e.minor=tr;function tr(e,r){return new K(e,r).minor}e.patch=nr;function nr(e,r){return new K(e,r).patch}e.compare=ir;function ir(e,r,t){return new K(e,t).compare(r)}e.compareLoose=sr;function sr(e,r){return ir(e,r,true)}e.rcompare=or;function or(e,r,t){return ir(r,e,t)}e.sort=ar;function ar(r,t){return r.sort(function(r,n){return e.compare(r,n,t)})}e.rsort=fr;function fr(r,t){return r.sort(function(r,n){return e.rcompare(r,n,t)})}e.gt=ur;function ur(e,r,t){return ir(e,r,t)>0}e.lt=lr;function lr(e,r,t){return ir(e,r,t)<0}e.eq=pr;function pr(e,r,t){return ir(e,r,t)===0}e.neq=hr;function hr(e,r,t){return ir(e,r,t)!==0}e.gte=cr;function cr(e,r,t){return ir(e,r,t)>=0}e.lte=vr;function vr(e,r,t){return ir(e,r,t)<=0}e.cmp=mr;function mr(e,r,t,n){var i;switch(r){case"===":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e===t;break;case"!==":if(typeof e==="object")e=e.version;if(typeof t==="object")t=t.version;i=e!==t;break;case"":case"=":case"==":i=pr(e,t,n);break;case"!=":i=hr(e,t,n);break;case">":i=ur(e,t,n);break;case">=":i=cr(e,t,n);break;case"<":i=lr(e,t,n);break;case"<=":i=vr(e,t,n);break;default:throw new TypeError("Invalid operator: "+r)}return i}e.Comparator=gr;function gr(e,r){if(e instanceof gr){if(e.loose===r)return e;else e=e.value}if(!(this instanceof gr))return new gr(e,r);this.loose=r;this.parse(e);if(this.semver===wr)this.value="";else this.value=this.operator+this.semver.version}var wr={};gr.prototype.parse=function(e){var r=this.loose?n[X]:n[Z];var t=e.match(r);if(!t)throw new TypeError("Invalid comparator: "+e);this.operator=t[1];if(this.operator==="=")this.operator="";if(!t[2])this.semver=wr;else this.semver=new K(t[2],this.loose)};gr.prototype.inspect=function(){return''};gr.prototype.toString=function(){return this.value};gr.prototype.test=function(e){if(this.semver===wr)return true;if(typeof e==="string")e=new K(e,this.loose);return mr(e,this.operator,this.semver,this.loose)};e.Range=yr;function yr(e,r){if(e instanceof yr&&e.loose===r)return e;if(!(this instanceof yr))return new yr(e,r);this.loose=r;this.raw=e;this.set=e.split(/\s*\|\|\s*/).map(function(e){return this.parseRange(e.trim())},this).filter(function(e){return e.length});if(!this.set.length){throw new TypeError("Invalid SemVer Range: "+e)}this.format()}yr.prototype.inspect=function(){return''};yr.prototype.format=function(){this.range=this.set.map(function(e){return e.join(" ").trim()}).join("||").trim();return this.range};yr.prototype.toString=function(){return this.range};yr.prototype.parseRange=function(e){var r=this.loose;e=e.trim();var t=r?n[G]:n[F];e=e.replace(t,Tr);e=e.replace(n[q],L);e=e.replace(n[T],V);e=e.replace(n[N],_);e=e.split(/\s+/).join(" ");var i=r?n[X]:n[Z];var s=e.split(" ").map(function(e){return jr(e,r)}).join(" ").split(/\s+/);if(this.loose){s=s.filter(function(e){return!!e.match(i)})}s=s.map(function(e){return new gr(e,r)});return s};e.toComparators=dr;function dr(e,r){return new yr(e,r).set.map(function(e){return e.map(function(e){return e.value}).join(" ").trim().split(" ")})}function jr(e,r){e=kr(e,r);e=Er(e,r);e=Sr(e,r);e=Ir(e,r);return e}function br(e){return!e||e.toLowerCase()==="x"||e==="*"}function Er(e,r){return e.trim().split(/\s+/).map(function(e){return $r(e,r)}).join(" ")}function $r(e,r){var t=r?n[C]:n[A];return e.replace(t,function(e,r,t,n,i){var s;if(br(r))s="";else if(br(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(br(n))s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else if(i){if(i.charAt(0)!=="-")i="-"+i;s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0";return s})}function kr(e,r){return e.trim().split(/\s+/).map(function(e){return Rr(e,r)}).join(" ")}function Rr(e,r){var t=r?n[P]:n[z];return e.replace(t,function(e,r,t,n,i){var s;if(br(r))s="";else if(br(t))s=">="+r+".0.0 <"+(+r+1)+".0.0";else if(br(n)){if(r==="0")s=">="+r+"."+t+".0 <"+r+"."+(+t+1)+".0";else s=">="+r+"."+t+".0 <"+(+r+1)+".0.0"}else if(i){if(i.charAt(0)!=="-")i="-"+i;if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+i+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+i+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+i+" <"+(+r+1)+".0.0"}else{if(r==="0"){if(t==="0")s=">="+r+"."+t+"."+n+" <"+r+"."+t+"."+(+n+1);else s=">="+r+"."+t+"."+n+" <"+r+"."+(+t+1)+".0"}else s=">="+r+"."+t+"."+n+" <"+(+r+1)+".0.0"}return s})}function Sr(e,r){return e.split(/\s+/).map(function(e){return xr(e,r)}).join(" ")}function xr(e,r){e=e.trim();var t=r?n[x]:n[S];return e.replace(t,function(e,r,t,n,i,s){var o=br(t);var a=o||br(n);var f=a||br(i);var u=f;if(r==="="&&u)r="";if(o){if(r===">"||r==="<"){e="<0.0.0"}else{e="*"}}else if(r&&u){if(a)n=0;if(f)i=0;if(r===">"){r=">=";if(a){t=+t+1;n=0;i=0}else if(f){n=+n+1;i=0}}else if(r==="<="){r="<";if(a)t=+t+1;else n=+n+1}e=r+t+"."+n+"."+i}else if(a){e=">="+t+".0.0 <"+(+t+1)+".0.0"}else if(f){e=">="+t+"."+n+".0 <"+t+"."+(+n+1)+".0"}return e})}function Ir(e,r){return e.trim().replace(n[O],"")}function Tr(e,r,t,n,i,s,o,a,f,u,l,p,h){if(br(t))r="";else if(br(n))r=">="+t+".0.0";else if(br(i))r=">="+t+"."+n+".0";else r=">="+r;if(br(f))a="";else if(br(u))a="<"+(+f+1)+".0.0";else if(br(l))a="<"+f+"."+(+u+1)+".0";else if(p)a="<="+f+"."+u+"."+l+"-"+p;else a="<="+a;return(r+" "+a).trim()}yr.prototype.test=function(e){if(!e)return false;if(typeof e==="string")e=new K(e,this.loose);for(var r=0;r0){var n=e[t].semver;if(n.major===r.major&&n.minor===r.minor&&n.patch===r.patch)return true}}return false}return true}e.satisfies=Ar;function Ar(e,r,t){try{r=new yr(r,t)}catch(n){return false}return r.test(e)}e.maxSatisfying=Cr;function Cr(e,r,t){return e.filter(function(e){return Ar(e,r,t)}).sort(function(e,r){return or(e,r,t)})[0]||null}e.validRange=Mr;function Mr(e,r){try{return new yr(e,r).range||"*"}catch(t){return null}}e.ltr=Nr;function Nr(e,r,t){return zr(e,r,"<",t)}e.gtr=_r;function _r(e,r,t){return zr(e,r,">",t)}e.outside=zr;function zr(e,r,t,n){e=new K(e,n);r=new yr(r,n);var i,s,o,a,f;switch(t){case">":i=ur;s=vr;o=lr;a=">";f=">=";break;case"<":i=lr;s=cr;o=ur;a="<";f="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Ar(e,r,n)){return false}for(var u=0;u