Procházet zdrojové kódy

Merge remote-tracking branch 'origin/kuaiyingyong' into kuaiyingyong_dev

# Conflicts:
#	app/Http/Controllers/QuickApp/BaseController.php
#	app/Http/Routes/QuickApp/QuickAppRoutes.php
lishiyeaaron před 5 roky
rodič
revize
e05eff3b71
97 změnil soubory, kde provedl 10041 přidání a 860 odebrání
  1. 11 17
      app/Http/Controllers/QuickApp/BaseController.php
  2. 9 15
      app/Http/Controllers/QuickApp/Oauth/UsersController.php
  3. 22 35
      app/Http/Controllers/QuickApp/Order/OrdersController.php
  4. 26 23
      app/Http/Controllers/QuickApp/User/ReadRecordController.php
  5. 26 18
      app/Http/Controllers/QuickApp/User/UserController.php
  6. 0 14
      app/Http/Controllers/QuickApp/User/UserShelfBooksController.php
  7. 1 0
      app/Http/Kernel.php
  8. 27 0
      app/Http/Middleware/CheckSign.php
  9. 11 16
      app/Http/Routes/QuickApp/QuickAppRoutes.php
  10. 45 29
      app/Libs/Pay/Merchants/Official.php
  11. 264 211
      app/Modules/User/Services/ReadRecordService.php
  12. 3787 1
      public/kyydoc/api_data.js
  13. 3787 1
      public/kyydoc/api_data.json
  14. 24 1
      public/kyydoc/api_project.js
  15. 24 1
      public/kyydoc/api_project.json
  16. 62 25
      public/kyydoc/css/style.css
  17. binární
      public/kyydoc/fonts/glyphicons-halflings-regular.eot
  18. 288 0
      public/kyydoc/fonts/glyphicons-halflings-regular.svg
  19. binární
      public/kyydoc/fonts/glyphicons-halflings-regular.ttf
  20. binární
      public/kyydoc/fonts/glyphicons-halflings-regular.woff
  21. binární
      public/kyydoc/fonts/glyphicons-halflings-regular.woff2
  22. 102 92
      public/kyydoc/index.html
  23. 25 0
      public/kyydoc/locales/cs.js
  24. 2 2
      public/kyydoc/locales/it.js
  25. 4 0
      public/kyydoc/locales/locale.js
  26. 25 0
      public/kyydoc/locales/ro.js
  27. 25 0
      public/kyydoc/locales/tr.js
  28. 25 0
      public/kyydoc/locales/vi.js
  29. 108 27
      public/kyydoc/main.js
  30. 17 0
      public/kyydoc/utils/handlebars_helper.js
  31. 6 3
      public/kyydoc/utils/send_sample_request.js
  32. 5 8
      public/kyydoc/vendor/bootstrap.min.css
  33. 6 5
      public/kyydoc/vendor/bootstrap.min.js
  34. 5 4
      public/kyydoc/vendor/handlebars.min.js
  35. 4 4
      public/kyydoc/vendor/jquery.min.js
  36. 2 0
      public/kyydoc/vendor/list.min.js
  37. 41 0
      public/kyydoc/vendor/lodash.custom.min.js
  38. 50 54
      public/kyydoc/vendor/polyfill.js
  39. 46 96
      public/kyydoc/vendor/prettify.css
  40. 18 0
      public/kyydoc/vendor/prettify/lang-Splus.js
  41. 18 0
      public/kyydoc/vendor/prettify/lang-aea.js
  42. 18 0
      public/kyydoc/vendor/prettify/lang-agc.js
  43. 18 2
      public/kyydoc/vendor/prettify/lang-apollo.js
  44. 18 3
      public/kyydoc/vendor/prettify/lang-basic.js
  45. 18 0
      public/kyydoc/vendor/prettify/lang-cbm.js
  46. 18 0
      public/kyydoc/vendor/prettify/lang-cl.js
  47. 3 4
      public/kyydoc/vendor/prettify/lang-clj.js
  48. 18 2
      public/kyydoc/vendor/prettify/lang-css.js
  49. 19 3
      public/kyydoc/vendor/prettify/lang-dart.js
  50. 18 0
      public/kyydoc/vendor/prettify/lang-el.js
  51. 18 0
      public/kyydoc/vendor/prettify/lang-erl.js
  52. 18 2
      public/kyydoc/vendor/prettify/lang-erlang.js
  53. 18 0
      public/kyydoc/vendor/prettify/lang-fs.js
  54. 17 1
      public/kyydoc/vendor/prettify/lang-go.js
  55. 18 2
      public/kyydoc/vendor/prettify/lang-hs.js
  56. 19 0
      public/kyydoc/vendor/prettify/lang-lasso.js
  57. 19 0
      public/kyydoc/vendor/prettify/lang-lassoscript.js
  58. 17 0
      public/kyydoc/vendor/prettify/lang-latex.js
  59. 18 0
      public/kyydoc/vendor/prettify/lang-lgt.js
  60. 18 3
      public/kyydoc/vendor/prettify/lang-lisp.js
  61. 17 0
      public/kyydoc/vendor/prettify/lang-ll.js
  62. 17 1
      public/kyydoc/vendor/prettify/lang-llvm.js
  63. 18 0
      public/kyydoc/vendor/prettify/lang-logtalk.js
  64. 19 0
      public/kyydoc/vendor/prettify/lang-ls.js
  65. 18 0
      public/kyydoc/vendor/prettify/lang-lsp.js
  66. 18 2
      public/kyydoc/vendor/prettify/lang-lua.js
  67. 29 6
      public/kyydoc/vendor/prettify/lang-matlab.js
  68. 18 2
      public/kyydoc/vendor/prettify/lang-ml.js
  69. 18 2
      public/kyydoc/vendor/prettify/lang-mumps.js
  70. 19 4
      public/kyydoc/vendor/prettify/lang-n.js
  71. 19 0
      public/kyydoc/vendor/prettify/lang-nemerle.js
  72. 18 3
      public/kyydoc/vendor/prettify/lang-pascal.js
  73. 16 0
      public/kyydoc/vendor/prettify/lang-proto.js
  74. 18 2
      public/kyydoc/vendor/prettify/lang-r.js
  75. 17 1
      public/kyydoc/vendor/prettify/lang-rd.js
  76. 18 0
      public/kyydoc/vendor/prettify/lang-rkt.js
  77. 20 0
      public/kyydoc/vendor/prettify/lang-rust.js
  78. 18 0
      public/kyydoc/vendor/prettify/lang-s.js
  79. 18 2
      public/kyydoc/vendor/prettify/lang-scala.js
  80. 18 0
      public/kyydoc/vendor/prettify/lang-scm.js
  81. 18 2
      public/kyydoc/vendor/prettify/lang-sql.js
  82. 18 0
      public/kyydoc/vendor/prettify/lang-ss.js
  83. 16 0
      public/kyydoc/vendor/prettify/lang-swift.js
  84. 18 3
      public/kyydoc/vendor/prettify/lang-tcl.js
  85. 17 1
      public/kyydoc/vendor/prettify/lang-tex.js
  86. 19 2
      public/kyydoc/vendor/prettify/lang-vb.js
  87. 19 0
      public/kyydoc/vendor/prettify/lang-vbs.js
  88. 19 0
      public/kyydoc/vendor/prettify/lang-vhd.js
  89. 19 3
      public/kyydoc/vendor/prettify/lang-vhdl.js
  90. 17 1
      public/kyydoc/vendor/prettify/lang-wiki.js
  91. 18 2
      public/kyydoc/vendor/prettify/lang-xq.js
  92. 19 0
      public/kyydoc/vendor/prettify/lang-xquery.js
  93. 18 2
      public/kyydoc/vendor/prettify/lang-yaml.js
  94. 18 0
      public/kyydoc/vendor/prettify/lang-yml.js
  95. 46 30
      public/kyydoc/vendor/prettify/prettify.js
  96. 63 34
      public/kyydoc/vendor/prettify/run_prettify.js
  97. 32 31
      public/kyydoc/vendor/require.min.js

+ 11 - 17
app/Http/Controllers/QuickApp/BaseController.php

@@ -11,24 +11,18 @@ class BaseController extends Controller
     
     public function __get($name)
     {
-//        if (!isset($this->field[$name])) {
-//            $qapp_user = QappUserService::getGolableUserStatic();
-//            if ($name == '_user_info') {
-//                $this->field[$name] = $qapp_user->user;
-//            }
-//            if ($name == 'uid') {
-//                $this->field[$name] = $qapp_user->uid;
-//            }
-//            if ($name == 'distribution_channel_id') {
-//                $this->field[$name] = $qapp_user->user->distribution_channel_id;
-//            }
-//        }
         if (!isset($this->field[$name])) {
-
-                $this->field['_user_info'] = '';
-                $this->field['uid'] = 1;
-                $this->field['distribution_channel_id'] = 5;
-
+             QappUserService::setGolableUserStatic(162261523);
+            $qapp_user = QappUserService::getGolableUserStatic();
+            if ($name == 'user_info') {
+                $this->field[$name] = $qapp_user->user;
+            }
+            if ($name == 'uid') {
+                $this->field[$name] = $qapp_user->uid;
+            }
+            if ($name == 'distribution_channel_id') {
+                $this->field[$name] = $qapp_user->user->distribution_channel_id;
+            }
         }
         return  $this->field[$name];
     }

+ 9 - 15
app/Http/Controllers/QuickApp/Oauth/UsersController.php

@@ -18,9 +18,10 @@ class UsersController extends Controller
      * @apiVersion 1.0.0
      * @apiDescription 登录
      * @api {post} login 登录
-     * @apiParam  {String}  js_code js_code
-     * @apiParam  {Int}     distribution_channel_id distribution_channel_id
-     * @apiParam  {String}  sign    签名
+     * @apiParam  {String}  device_no 设备号
+     * @apiParam  {String}  device_info 设备信息json格式
+     * @apiParam  {Int}     send_order_id send_order_id
+     * @apiParam  {String}  sign 签名(见微信支付签名https://pay.weixin.qq.com/wiki/doc/api/app/app.php?chapter=4_3)
      * @apiGroup Login
      * @apiName index
      * @apiSuccess {int}         code 状态码
@@ -43,28 +44,21 @@ class UsersController extends Controller
      */
     public function index(Request $request)
     {
-        $params = $request->except('_url');
         $send_order_id = $request->input('send_order_id', 0);
         $device_no = $request->input('device_no', '');
         $device_info = $request->input('device_info', '');
-        $sign = $request->input('sign', '');
-        $key = 'a!A&AFRWT65Nb3NlklezUiqHyQAA@Z8M';
-        if ($sign == _sign($params, $key)) {
-            if ($device_no) {
-                $data = QappUserService::loginStatic(compact('send_order_id', 'device_no', 'device_info'));
-                return response()->success($data);
-            } else {
-                return response()->error('PARAM_ERROR');
-            }
+        if ($device_no) {
+            $data = QappUserService::loginStatic(compact('send_order_id', 'device_no', 'device_info'));
+            return response()->success($data);
         } else {
-            return response()->error('QAPP_SIGN_ERROR');
+            return response()->error('PARAM_ERROR');
         }
     }
 
     /**
      * @apiVersion 1.0.0
      * @apiDescription 刷新token
-     * @api {get} RefreshToken 刷新token
+     * @api {get} refreshToken 刷新token
      * @apiParam {String}  [token]  token
      * @apiHeader {String} [Authorization]  token 两个token任选其一
      * @apiGroup Login

+ 22 - 35
app/Http/Controllers/QuickApp/Order/OrdersController.php

@@ -17,7 +17,6 @@ use DB;
 use Redis;
 use Hashids;
 use EasyWeChat\Foundation\Application;
-use EasyWeChat\Payment\Order as Wxorder;
 use App\Modules\Product\Services\ProductService;
 use App\Modules\Book\Services\BookConfigService;
 use App\Modules\Book\Services\BookService;
@@ -343,11 +342,11 @@ class OrdersController extends BaseController
      * @apiSuccess {String}  msg 信息
      * @apiSuccess {Object}  data 信息
      * @apiSuccess {Object}  data.appId 唤起支付的appId
-     * @apiSuccess {Object}  data.package 唤起支付的package
-     * @apiSuccess {Object}  data.nonceStr 唤起支付的nonceStr
-     * @apiSuccess {Object}  data.timeStamp 唤起支付的timeStamp
-     * @apiSuccess {Object}  data.signType 唤起支付的signType
-     * @apiSuccess {Object}  data.paySign 唤起支付sign
+     * @apiSuccess {Object}  data.mch_id 唤起支付的mch_id
+     * @apiSuccess {Object}  data.nonce_str 唤起支付的nonce_str
+     * @apiSuccess {Object}  data.prepay_id 唤起支付的prepay_id
+     * @apiSuccess {Object}  data.sign 唤起支付的sign
+     * @apiSuccess {Object}  data.trade_type 唤起支付trade_type
      * @apiSuccessExample {json} Success-Response:
      *     HTTP/1.1 200 OK
      *     {
@@ -361,7 +360,7 @@ class OrdersController extends BaseController
     {
         $product_id = $request->get('product_id', 0);
         $send_order_id = $request->get('send_order_id', 0);
-        if (empty($product_id) || empty($sign)) {
+        if (!$product_id) {
             return response()->error('QAPP_PARAM_ERROR');
         }
         $bid = $request->get('bid', 0);
@@ -386,7 +385,7 @@ class OrdersController extends BaseController
             $order_type = '';
         }
 
-        $res = $this->createUnPayOrder([
+        $this->createUnPayOrder([
             'distribution_channel_id' => $distribution_channel_id,
             'uid' => $uid,
             'product_id' => $product_id,
@@ -404,29 +403,23 @@ class OrdersController extends BaseController
         ]);
         $config = [
             // 微信支付参数
-            'app_id'     => 'wxf065f7364b078a73', // 应用ID
-            'mch_id'     => '1500977641', // 微信支付商户号
-            'mch_key'    => '0e7SfPt3EOS0HC1GxVa4fqmCUINcN71E', // 微信支付密钥
+            'appid'     => 'wxf065f7364b078a73', // 应用ID
+            'merchant_id'     => '1500977641', // 微信支付商户号
+            'key'    => '0e7SfPt3EOS0HC1GxVa4fqmCUINcN71E', // 微信支付密钥
+            'trade_type' => 'APP',
         ];
         $pay = WechatPay::Official('OFFICIALPAY', $config);
         try {
             $payOrder = [
-                'out_trade_no'     => $trade_no, // 订单号
-                'total_fee'        => $price, // 订单金额,**单位:分**
-                'body'             => '阅读云阅 小说', // 订单描述
-                'spbill_create_ip' => _getIp(), // 支付人的 IP
-                'notify_url'       => env('WECHART_APP_PAY_CALL_BACK_URL'), // 定义通知URL
-                'attach'            => 'QuickApp'
+                'trade_no'     => $trade_no, // 订单号
+                'price'        => $price, // 订单金额,**单位:分**
+                'body'             => '快应用 小说', // 订单描述
+                'create_ip' => _getIp(), // 支付人的 IP
+                'remark'            => 'QuickApp'
             ];
             $result = $pay->send($payOrder);
-            if ($result && isset($result['prepayid'])) {
-                $data['appid'] = $result['appid'];
-                $data['partnerid'] = $result['partnerid'];
-                $data['prepayid'] = $result['prepayid'];
-                $data['timestamp'] = $result['timestamp'];
-                $data['noncestr'] = $result['noncestr'];
-                $data['packagInfo'] = $result['package'];
-                $data['sign'] = $result['sign'];
+            if ($result) {
+                return response()->success($result);
             } else {
                 Log::error("创建微信订单失败," . json_encode($result));
                 return response()->error('APP_CREATE_WECHAT_ORDER_FAIL');
@@ -489,14 +482,13 @@ class OrdersController extends BaseController
      * @param Request $request
      * @return
      */
-    function wxback_xcx(Request $request)
+    function wxback(Request $request)
     {
-        Log::info('-------------en----------------');
         $options = [
-            'app_id' => 'wxa0c8331eba3b34d5',
+            'app_id' => 'wxf065f7364b078a73',
             'payment' => [
-                'merchant_id' => 1501944981,
-                'key' => 'ee245088b93ba88008279d95f6d30413',
+                'merchant_id' => 1500977641,
+                'key' => '0e7SfPt3EOS0HC1GxVa4fqmCUINcN71E',
             ]
         ];
         $app = new Application($options);
@@ -578,8 +570,6 @@ class OrdersController extends BaseController
         $insert_data['send_order_id'] = $send_order_id;
         $insert_data['charge_balance'] = 0;
         $insert_data['reward_balance'] = 0;
-        Log::info('start_save_book_order');
-        Log::info($insert_data);
         return BookOrderService::save_book_order($insert_data);
     }
 
@@ -593,12 +583,10 @@ class OrdersController extends BaseController
      */
     private function yearOrder($uid, $distribution_channel_id, $fee, $send_order_id)
     {
-        Log::info('start_save_year_order');
         $insert_data['uid'] = $uid;
         $insert_data['distribution_channel_id'] = $distribution_channel_id;
         $insert_data['fee'] = $fee;
         $insert_data['send_order_id'] = $send_order_id;
-        Log::info($insert_data);
         return YearOrderService::save_year_order($insert_data);
     }
 
@@ -611,7 +599,6 @@ class OrdersController extends BaseController
     {
         $total = $product->price * 100 + $product->given;
         UserService::addBalance($uid, $total, $product->price * 100, $product->given);
-        Log::info('update_user_balance_end:' . $uid . ' balance_add:' . $total);
     }
 
     /**

+ 26 - 23
app/Http/Controllers/QuickApp/User/ReadRecordController.php

@@ -7,10 +7,12 @@ use App\Http\Controllers\QuickApp\BaseController;
 use App\Modules\Book\Services\BookConfigService;
 use App\Modules\Book\Services\UserShelfBooksService;
 use App\Http\Controllers\QuickApp\User\Transformers\ReadRecordTransformer;
+use App\Modules\Book\Services\BookService;
 use App\Modules\User\Services\ReadRecordService;
 use Hashids;
 use Redis;
 use Log;
+
 class ReadRecordController extends BaseController
 {
 
@@ -61,9 +63,10 @@ class ReadRecordController extends BaseController
      *           }
      *           ]
      */
-    public function index(Request $request){
+    public function index(Request $request)
+    {
         $res = ReadRecordService::getReadRecord($this->uid);
-        if($res){
+        if ($res) {
             $id_arr = [];
             foreach ($res as $key => $value) {
                 $id_arr[] = $value['bid'];
@@ -72,7 +75,7 @@ class ReadRecordController extends BaseController
             $book = BookConfigService::getBooksByIds($id_arr);
             foreach ($res as $key => &$value) {
                 foreach ($book as  $val) {
-                    if($value['bid'] == $val->bid){
+                    if ($value['bid'] == $val->bid) {
                         $value['cover'] = $val->cover;
                         $value['last_chapter'] = $val->last_chapter;
                         break;
@@ -81,24 +84,23 @@ class ReadRecordController extends BaseController
             }
 
             $shelf = UserShelfBooksService::getUserShelfBooksListByUid($this->uid);
-            foreach ($res as &$v){
+            foreach ($res as &$v) {
                 $v['is_on_user_shelf'] = 0;
-                foreach ($shelf as $val){
-                    if($v['bid'] == $val->bid){
+                foreach ($shelf as $val) {
+                    if ($v['bid'] == $val->bid) {
                         $v['is_on_user_shelf'] = 1;
                         break;
                     }
                 }
             }
         }
-        usort($res,function($a,$b){
-            if($a['time'] >= $b['time']) return -1;
+        usort($res, function ($a, $b) {
+            if ($a['time'] >= $b['time']) return -1;
             return 1;
-
         });
         $res = json_encode($res);
         $res = json_decode($res);
-        return response()->collection(new ReadRecordTransformer(),$res);
+        return response()->collection(new ReadRecordTransformer(), $res);
     }
 
 
@@ -125,24 +127,22 @@ class ReadRecordController extends BaseController
      *       data:{}
      *
      */
-    public function addReadRecord(Request $request){
+    public function addReadRecord(Request $request)
+    {
         $param = $request->except('_url');
-        if(checkParam($param,['bid','cid','chapter_name'])){
+        if (checkParam($param, ['bid', 'cid', 'chapter_name'])) {
             return response()->error('LACK_PARAM');
         }
-        //Redis::hset('book_read:' . $uid, $bid, "{$cid}_{$book_name}_{$chapter_name}_" . time());
-
         $param['uid'] = $this->uid;
         $param['bid'] = Hashids::decode($param['bid'])[0];
-        $record_info = Redis::hget('book_read:'.$this->uid,$param['bid']);
+        $record_info = Redis::hget('book_read:' . $this->uid, $param['bid']);
         $param['book_name'] = 'unknown';
-        if($record_info){
-            $param['book_name'] = explode('_',$record_info)[1];
+        if ($record_info) {
+            $param['book_name'] = explode('_', $record_info)[1];
         }
 
         ReadRecordService::addReadRecord($param);
         return response()->success();
-
     }
 
 
@@ -166,14 +166,17 @@ class ReadRecordController extends BaseController
      *       data:{}
      *
      */
-    public function delReadRecord(Request $request){
+    public function delReadRecord(Request $request)
+    {
         $param = $request->except('_url');
-        if(checkParam($param,['bid'])){
+        if (checkParam($param, ['bid'])) {
             return response()->error('LACK_PARAM');
         }
-        $param['bid'] = Hashids::decode($param['bid'])[0];
-        ReadRecordService::delReadRecord($this->uid,$param['bid']);
+        $bids = explode(',', $param['bid']);
+        array_walk($bids, function (&$item) {
+            $item = BookService::decodeBidStatic($item);
+        });
+        ReadRecordService::delReadRecord($this->uid, $bids);
         return response()->success();
     }
-
 }

+ 26 - 18
app/Http/Controllers/QuickApp/User/UserController.php

@@ -7,9 +7,12 @@ use App\Http\Controllers\QuickApp\BaseController;
 use App\Modules\Subscribe\Services\YearOrderService;
 use App\Modules\User\Transformers\YearOrderTransformer;
 use App\Modules\User\Services\UserService;
+use App\Modules\User\Services\UserSignService;
 use Log;
 use Redis;
 use Cookie;
+use GuzzleHttp\Psr7\Request;
+
 class UserController extends BaseController
 {
     /**
@@ -58,35 +61,40 @@ class UserController extends BaseController
      *         }
      *     }
      */
-    public function index(){
-        $data = UserService::getById($this->uid);
-        if(!$data->head_img){
+    public function index()
+    {
+        $data =  $this->user_info;
+        if (!$data->head_img) {
             $data->head_img = 'https://yueduyun.oss-cn-hangzhou.aliyuncs.com/xiaochengxu/img/defaulthead.png';
         }
         $data['is_vip'] = 0;
         $data['vip_days'] = 0;
         $year_record = YearOrderService::getRecord($this->uid);
-        if($year_record){
+        if ($year_record) {
             $data['is_vip'] = 1;
-            
-            $time = strtotime($year_record['end_time'])-time();
-            if($time>=86400){
-                  $data['vip_days'] = floor($time/86400).'天';  
-            }elseif ($time>3600) {
-                 $data['vip_days'] = floor($time/3600).'小时';  
-            }elseif ($time>60) {
-                 $data['vip_days'] = floor($time/60).'分钟';  
-            }else{
-                $data['vip_days'] = $time.'秒';  
+            $time = strtotime($year_record['end_time']) - time();
+            if ($time >= 86400) {
+                $data['vip_days'] = floor($time / 86400) . '天';
+            } elseif ($time > 3600) {
+                $data['vip_days'] = floor($time / 3600) . '小时';
+            } elseif ($time > 60) {
+                $data['vip_days'] = floor($time / 60) . '分钟';
+            } else {
+                $data['vip_days'] = $time . '秒';
             }
         }
         return response()->success($data);
     }
 
-    function logout()
+
+    public function sign(Request $request)
     {
-        setcookie(env('COOKIE_AUTH_WEB_WECHAT'), '', -1);
-        setcookie('u', '', -1);
-        return response('logout');
+        if (UserSignService::isSign($this->uid)) {
+            return 0;
+        }
+        if (UserSignService::signV2($this->uid, date('Y-m-d'))) {
+            return response()->success();
+        }
+        return 0;
     }
 }

+ 0 - 14
app/Http/Controllers/QuickApp/User/UserShelfBooksController.php

@@ -69,15 +69,10 @@ class UserShelfBooksController extends BaseController
      */
     public function index(Request $request){
         $res = UserShelfBooksService::getUserShelfBooksListByUid($this->uid);
-
         if($res->isEmpty()){
             return response()->success();
         }
-
         $record = ReadRecordService::getReadRecord($this->uid);
-
-        //if(empty($record))   return response()->success($res);
-
         foreach ($res as &$v){
             $v['last_cid'] = $v['first_cid'];
             foreach ($record as $val){
@@ -88,13 +83,6 @@ class UserShelfBooksController extends BaseController
                 }
             }
         }
-
-        /*
-        usort($res,function($a,$b){
-            if($a['updated_at'] >= $b['updated_at']) return -1;
-            return 1;
-
-        });*/
         return response()->collection(new UserShelfBooksTransformer(),$res);
     }
 
@@ -198,8 +186,6 @@ class UserShelfBooksController extends BaseController
         $bid = $request->input('bid');
         if(!$bid) return response()->error('LACK_PARAM');
         $bid = Hashids::decode($bid)[0];
-        //$param['uid'] = $this->uid;
-        //$res = $this->apiClient->get($this->joinUrl('Read/isonshelf'),$param);
         $res = UserShelfBooksService::getUserShelfBooksListByUidAndBid($this->uid,$bid);
         if($res){
             $data['is_on'] = 1;

+ 1 - 0
app/Http/Kernel.php

@@ -47,5 +47,6 @@ class Kernel extends HttpKernel
      */
     protected $routeMiddleware = [
         'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
+        'checkSign' => \App\Http\Middleware\CheckSign::class,
     ];
 }

+ 27 - 0
app/Http/Middleware/CheckSign.php

@@ -0,0 +1,27 @@
+<?php
+
+namespace App\Http\Middleware;
+
+use Closure;
+
+class CheckSign
+{
+    /**
+     * Handle an incoming request.
+     *
+     * @param  \Illuminate\Http\Request  $request
+     * @param  \Closure  $next
+     * @return mixed
+     */
+    public function handle($request, Closure $next)
+    {
+        $sign = $request->input('sign', '');
+        $key = 'a!A&AFRWT65Nb3NlklezUiqHyQAA@Z8M';
+        $params = $request->except('_url');
+        if ($sign == _sign($params, $key)) {
+            return $next($request);
+        } else {
+            return response()->error('QAPP_SIGN_ERROR');
+        }
+    }
+}

+ 11 - 16
app/Http/Routes/QuickApp/QuickAppRoutes.php

@@ -1,17 +1,20 @@
 <?php
 
 Route::group(['domain' => env('QUICKAPP_DOMAIN'), 'namespace' => 'App\Http\Controllers\QuickApp'], function () {
-    //登录
-    Route::post('login', 'Oauth\UsersController@index');
-    //支付
-    Route::any('pay/wcback_xchengxu', 'Order\OrdersController@wxindex');
-    Route::get('refreshToken', 'Oauth\UsersController@refreshToken');
 
     //支付回调
-    Route::any('pay/wcback', 'Order\OrdersController@wxback_xcx');
+    Route::any('pay/wcback', 'Order\OrdersController@wxback');
 
-//    Route::group(['prefix' => 'api', 'middleware' => 'jwttoken'], function () {
+    // Route::group(['prefix' => 'api', 'middleware' => 'checkSign'], function () {
     Route::group(['prefix' => 'api'], function () {
+        //登录
+        Route::post('login', 'Oauth\UsersController@index');
+    });
+
+    // Route::group(['prefix' => 'api', 'middleware' => 'jwttoken'], function () {
+    Route::group(['prefix' => 'api'], function () {
+        //刷新token
+        Route::get('refreshToken', 'Oauth\UsersController@refreshToken');
         //首页
         Route::get('books/{sex}/index', 'Book\BookController@getBookLists');
         //书库
@@ -24,21 +27,16 @@ Route::group(['domain' => env('QUICKAPP_DOMAIN'), 'namespace' => 'App\Http\Contr
         Route::get('books/rank', 'Book\BookController@rank');
         //分类列表
         Route::get('books/getCategory', 'Book\BookCategoryController@getCategory');
-
         //图书详情
         Route::get('book/{bid}', 'Book\BookController@index');
-
         //目录不分页
         Route::get('books/{bid}/allcatalog', 'Book\ChapterController@getCatalog');
-
         //目录分页
         Route::get('books/{bid}/catalog', 'Book\ChapterController@getCatalogPerPage');
-        
         //章节详情
         Route::get('books/{bid}/chapters/{cid}', 'Book\ChapterController@index')->where('cid', '\d+');
         //余额订购
         Route::get('books/{bid}/balance/chapterOrders/{cid}', 'Book\ChapterController@pay');
-
         //充值列表
         Route::get('order/chargeList', 'Order\OrdersController@chargeList');
         //章节订购列表
@@ -49,9 +47,8 @@ Route::group(['domain' => env('QUICKAPP_DOMAIN'), 'namespace' => 'App\Http\Contr
         Route::get('order/chargeRecordLists', 'Order\OrdersController@chargeRecordLists');
 
         Route::get('order/issuccess', 'Order\OrdersController@isSuccess');
+        //个人中心
         Route::get('userinfo', 'User\UserController@index');
-
-
         //书架
         Route::get('userShelfBooks', 'User\UserShelfBooksController@index');
         //添加书架
@@ -60,14 +57,12 @@ Route::group(['domain' => env('QUICKAPP_DOMAIN'), 'namespace' => 'App\Http\Contr
         Route::get('userShelfBooks/delete', 'User\UserShelfBooksController@delShelf');
 
         Route::get('userShelfBooks/isonshelf', 'User\UserShelfBooksController@isOnshelf');
-
         //阅读记录
         Route::get('readrecord', 'User\ReadRecordController@index');
         //添加阅读记录
         Route::post('readrecord', 'User\ReadRecordController@addReadRecord');
         //删除阅读记录
         Route::get('readrecord/delete', 'User\ReadRecordController@delReadRecord');
-
         //支付
         Route::get('goToPay', 'Order\OrdersController@wxindex');
 

+ 45 - 29
app/Libs/Pay/Merchants/Official.php

@@ -1,4 +1,5 @@
 <?php
+
 /**
  * Created by PhpStorm.
  * User: z-yang
@@ -22,26 +23,28 @@ class Official
     private $key;
     private $cert_path;
     private $key_path;
+    private $trade_type;
+
     public $app;
     public function __construct($config)
     {
         $this->appid = $config['appid'];
-        $this->secret = $config['secret'];
-        $this->token = $config['token'];
         $this->merchant_id = $config['merchant_id'];
         $this->key = $config['key'];
-        $this->cert_path = $config['cert_path'];
-        $this->key_path = $config['key_path'];
-
+        $this->secret = isset($config['secret']) ? $config['secret'] : '';
+        $this->token = isset($config['token']) ? $config['token'] : '';
+        $this->key_path = isset($config['key_path']) ? $config['key_path'] : '';
+        $this->cert_path = isset($config['cert_path']) ? $config['cert_path'] : '';
+        $this->trade_type = isset($config['trade_type']) ? $config['trade_type'] : 'JSAPI';
         $options = [
-            'app_id'=>$this->appid,
-            'secret'=>$this->secret,
-            'token'=>$this->token,
-            'payment'=>[
-                'merchant_id'=>$this->merchant_id,
-                'key'=>$this->key,
-                'cert_path'=>public_path($this->cert_path),
-                'key_path'=>public_path($this->key_path)
+            'app_id' => $this->appid,
+            'secret' => $this->secret,
+            'token' => $this->token,
+            'payment' => [
+                'merchant_id' => $this->merchant_id,
+                'key' => $this->key,
+                'cert_path' => public_path($this->cert_path),
+                'key_path' => public_path($this->key_path)
             ]
         ];
         $this->app = new Application($options);
@@ -49,36 +52,49 @@ class Official
 
     function send($data)
     {
-        Log::info('Official---enter--------------');
         $app =  $this->app;
         $payment = $app->payment;
         $attributes = [
-            'trade_type' => 'JSAPI',
+            'trade_type' => $this->trade_type,
             'body' => $data['body'],
-            'detail' => $data['detail'],
+            'detail' => isset($data['detail']) ? $data['detail'] : '',
             'out_trade_no' => $data['trade_no'],
             'total_fee' => $data['price'],
             'notify_url' => env('OFFICIAL_PAY_CALL_BACK_URL'),
-            'openid' => $data['openid'],
+            'openid' => isset($data['openid']) ? $data['openid'] : '',
             'spbill_create_ip' => $data['create_ip'],
             'attach' => $data['remark']
         ];
         $order = new Wxorder($attributes);
         $result = $payment->prepare($order);
-        Log::info('Official -------pay-----result---------- order is: '.$data['trade_no']);
+        Log::info('Official -------pay-----result---------- order is: ' . $data['trade_no']);
         Log::info($result);
         if ($result->return_code == 'SUCCESS' && $result->result_code == 'SUCCESS') {
-            $data = [
-                'appId' => $result->appid,
-                'package' => 'prepay_id=' . $result->prepay_id,
-                'nonceStr' => $result->nonce_str,
-                'timeStamp' => time(),
-                'signType' => 'MD5',
-            ];
-            $data['paySign'] = $this->MakeSign($data);
+            switch ($this->trade_type) {
+                case 'JSAPI':
+                    $data = [
+                        'appId' => $result->appid,
+                        'package' => 'prepay_id=' . $result->prepay_id,
+                        'nonceStr' => $result->nonce_str,
+                        'timeStamp' => time(),
+                        'signType' => 'MD5',
+                    ];
+                    $data['paySign'] = $this->MakeSign($data);
+                    break;
+                case 'APP':
+                    $data = [
+                        'appId' => $result->appid,
+                        'mch_id' => $result->mch_id,
+                        'prepay_id' => $result->prepay_id,
+                        'nonce_str' => $result->nonce_str,
+                        'sign' => $result->sign,
+                        'trade_type' => $result->trade_type,
+                    ];
+                    break;
+            }
             return $data;
         }
-        Log::error('pay error order is: '.$data['trade_no']);
+        Log::error('pay error order is: ' . $data['trade_no']);
         Log::error($result);
         return [];
     }
@@ -96,11 +112,11 @@ class Official
         }
         $buff = trim($buff, "&");
         //签名步骤二:在string后加入KEY
-        $string = $buff . "&key=".$this->key;
+        $string = $buff . "&key=" . $this->key;
         //签名步骤三:MD5加密
         $string = md5($string);
         //签名步骤四:所有字符转为大写
         $result = strtoupper($string);
         return $result;
     }
-}
+}

+ 264 - 211
app/Modules/User/Services/ReadRecordService.php

@@ -1,4 +1,5 @@
 <?php
+
 /**
  * Created by PhpStorm.
  * User: hp
@@ -17,10 +18,65 @@ use DB;
 
 class ReadRecordService
 {
+    #region 以后按照这种方式写静态方法
+    use BaseService;
+    /**
+     * 删除最近阅读记录
+     * @param int $uid
+     * @param array $bids
+     */
+    public function delReadRecord(int $uid, array $bids)
+    {
+        $key = 'book_read:' . $uid;
+        $last_record = explode('_', Redis::hGet($key, 'last_read'));
+        $last_record_bid = $last_record[0];
+        $is_del_last = false;
+        foreach ($bids as $bid) {
+            if ($bid == $last_record_bid) {
+                $is_del_last = true;
+            }
+            Redis::hDel($key, $bid);
+        }
+        if ($is_del_last) {
+            $this->reSetLastRecord($uid);
+        }
+    }
+
+    /**
+     * 重置用户最近阅读记录
+     * @param int $uid
+     */
+    public function reSetLastRecord($uid)
+    {
+        $key = 'book_read:' . $uid;
+        $alls = Redis::hGetAll($key);
+        $has_record = false;
+        $last_timestamp = 0;
+        $last_record = '';
+        foreach ($alls as $k => $v) {
+            if (is_numeric($k)) {
+                $has_record = true;
+                $record = explode('_', $v);
+                $timestamp = $record[1];
+                if ($last_timestamp < $timestamp) {
+                    $last_record = $k . '_' . $v;
+                    $last_timestamp = $timestamp;
+                }
+            }
+        }
+        if ($last_record) {
+            Redis::hSet($key, 'last_read', $last_record);
+        }
+        if (!$has_record) {
+            Redis::hDel($key, 'last_read');
+        }
+    }
+    #endregion
+
     //阅读记录数
     const RECORD_COUNT = 50;
 
-    private static $not_uid_key = ['last_read','send_order_id','sign_count','sign_counts','sign_info','sign_day','smart_push','inner_send_order_id','gxhp','property','bind_phone_status','ua','sign_version','new_outer','new_inner','new_total','next_push_hour','person_account_id'];
+    private static $not_uid_key = ['last_read', 'send_order_id', 'sign_count', 'sign_counts', 'sign_info', 'sign_day', 'smart_push', 'inner_send_order_id', 'gxhp', 'property', 'bind_phone_status', 'ua', 'sign_version', 'new_outer', 'new_inner', 'new_total', 'next_push_hour', 'person_account_id'];
 
     /**
      * 获取
@@ -38,13 +94,12 @@ class ReadRecordService
             $book_name = $record[1];
             $chapter_name = $record[2];
             $latest_read_time = $record[count($record) - 1];
-            $res[$i] = ['book_name' => $book_name, 'bid' => $key, 'cid' => (int)$latest_read_cid, 'time' => (int)$latest_read_time, 'chapter_name' => $chapter_name];
+            $res[$i] = ['book_name' => $book_name, 'bid' => $key, 'cid' => (int) $latest_read_cid, 'time' => (int) $latest_read_time, 'chapter_name' => $chapter_name];
             $i++;
         }
         usort($res, function ($a, $b) {
             if ($a['time'] >= $b['time']) return -1;
             return 1;
-
         });
         return $res;
     }
@@ -55,9 +110,9 @@ class ReadRecordService
      * @param $uid
      * @return array
      */
-    public static function getReadRecord($uid,$is_need_check_db=false)
+    public static function getReadRecord($uid, $is_need_check_db = false)
     {
-        if($is_need_check_db){
+        if ($is_need_check_db) {
             self::resetRecordFromDB($uid);
         }
         self::delTheLastRecord($uid);
@@ -66,7 +121,7 @@ class ReadRecordService
         $i = 0;
         //self::delBookNameAndChapter($uid);
         foreach ($read_bids as $key => $v) {
-            if(in_array($key,self::$not_uid_key)){
+            if (in_array($key, self::$not_uid_key)) {
                 continue;
             }
             $record = explode('_', $v);
@@ -74,13 +129,12 @@ class ReadRecordService
             $latest_read_time = $record[count($record) - 1];
             $book_name = self::bid2BookName($key);
             $chapter_name = self::cid2ChapterName($latest_read_cid);
-            $res[$i] = ['book_name' => $book_name, 'bid' => $key, 'cid' => (int)$latest_read_cid, 'time' => (int)$latest_read_time, 'chapter_name' => $chapter_name];
+            $res[$i] = ['book_name' => $book_name, 'bid' => $key, 'cid' => (int) $latest_read_cid, 'time' => (int) $latest_read_time, 'chapter_name' => $chapter_name];
             $i++;
         }
         usort($res, function ($a, $b) {
             if ($a['time'] >= $b['time']) return -1;
             return 1;
-
         });
         return $res;
     }
@@ -115,62 +169,47 @@ class ReadRecordService
         $bid = $param['bid'];
         $cid = $param['cid'];
 
-        $book_name = isset($param['book_name'])?$param['book_name']:'';
-        $chapter_name = isset($param['chapter_name'])?$param['chapter_name']:'';
-        $book_key = 'wap:string:book:'.$bid;
-        $chapter_key = 'wap:string:chapter:'.$cid;
-        if($book_name){
-            Redis::setex($book_key,3600,$book_name);
+        $book_name = isset($param['book_name']) ? $param['book_name'] : '';
+        $chapter_name = isset($param['chapter_name']) ? $param['chapter_name'] : '';
+        $book_key = 'wap:string:book:' . $bid;
+        $chapter_key = 'wap:string:chapter:' . $cid;
+        if ($book_name) {
+            Redis::setex($book_key, 3600, $book_name);
         }
-        if($chapter_name){
-            Redis::setex($chapter_key,3600,$chapter_name);
+        if ($chapter_name) {
+            Redis::setex($chapter_key, 3600, $chapter_name);
         }
-
-        /*Redis::hset('book_read:' . $uid, 'last_read', "{$bid}_{$cid}_" . time());
-        //Redis::hset('book_read:'.$uid, $bid, $cid."_".time());
-        Redis::hset('book_read:' . $uid, $bid, "{$cid}_" . time());*/
-        Redis::hmset('book_read:' . $uid,'last_read', "{$bid}_{$cid}_" . time(),$bid, "{$cid}_" . time(),'next_push_hour',8);
-        $num = random_int(1,100);
-        if($num <=3){
+        Redis::hmset('book_read:' . $uid, 'last_read', "{$bid}_{$cid}_" . time(), $bid, "{$cid}_" . time(), 'next_push_hour', 8);
+        $num = random_int(1, 100);
+        if ($num <= 3) {
             self::delTheLastRecord($uid);
         }
     }
-    
-    /**
-     * 删除
-     * @param $uid
-     * @param $bid
-     */
-    public static function delReadRecord($uid, $bid)
-    {
-        if (Redis::hexists('book_read:' . $uid, $bid)) {
-            Redis::hdel('book_read:' . $uid, $bid);
-        }
-    }
 
     /**
      * 获取最近一条阅读记录
      * @param $uid
      */
-    public static function getFirstReadRecord_($uid){
+    public static function getFirstReadRecord_($uid)
+    {
         $all = self::getReadRecord($uid);
-        if(empty($all)) return [];
+        if (empty($all)) return [];
         $first = $all[0];
-        if(!$first) return [];
-        if(!isset($first['bid']))  return [];
-        try{
+        if (!$first) return [];
+        if (!isset($first['bid']))  return [];
+        try {
             //$bid = Hashids::encode($first['bid']);
             $bid = $first['bid'];
             $book_info = BookConfigService::getBookById($bid);
             $cid = $first['cid'];
             $book_name = $first['book_name'];
             $res = [
-                'url' => '/reader?bid='.$bid.'&cid='.$cid,
-                'book_name'=>$book_name,
-                'cover' =>$book_info->cover,
-                'channel_name'=>$book_info->channel_name,
+                'url' => '/reader?bid=' . $bid . '&cid=' . $cid,
+                'book_name' => $book_name,
+                'cover' => $book_info->cover,
+                'channel_name' => $book_info->channel_name,
             ];
-        }catch (\Exception $e){
+        } catch (\Exception $e) {
             $res = [];
         }
 
@@ -182,26 +221,27 @@ class ReadRecordService
      * @param $uid
      * @return array
      */
-    public static function getFirstReadRecord($uid){
+    public static function getFirstReadRecord($uid)
+    {
         self::delBookBase($uid);
         //Redis::hget('book_base:' . $uid, 'last_read', "{$bid}_{$cid}_{$book_name}_{$chapter_name}_" . time());
         $record = Redis::hget('book_read:' . $uid, 'last_read');
-        if($record){
-            $record_arr = explode('_',$record);
+        if ($record) {
+            $record_arr = explode('_', $record);
             $bid = $record_arr[0];
             $bid = Hashids::encode($bid);
             $cid = $record_arr[1];
             $time = $record_arr[2];
             $book_info = BookConfigService::getBookById($bid);
-            $book_name = isset($book_info->book_name)?$book_info->book_name:'';
-            $cover = isset($book_info->cover)?$book_info->cover:'';
-            $channel_name = isset($book_info->channel_name)?$book_info->channel_name:'';
+            $book_name = isset($book_info->book_name) ? $book_info->book_name : '';
+            $cover = isset($book_info->cover) ? $book_info->cover : '';
+            $channel_name = isset($book_info->channel_name) ? $book_info->channel_name : '';
             $res = [
-                'url' => '/reader?bid='.$bid.'&cid='.$cid,
-                'book_name'=>$book_name,
-                'cover' =>$cover,
-                'channel_name'=>$channel_name,
-                'time'=>$time
+                'url' => '/reader?bid=' . $bid . '&cid=' . $cid,
+                'book_name' => $book_name,
+                'cover' => $cover,
+                'channel_name' => $channel_name,
+                'time' => $time
             ];
             return $res;
         }
@@ -213,17 +253,16 @@ class ReadRecordService
      * @param $uid
      * @return int
      */
-    public static function getSimpleFirstReadRecord($uid){
-        try{
+    public static function getSimpleFirstReadRecord($uid)
+    {
+        try {
             $record = Redis::hget('book_read:' . $uid, 'last_read');
-            if($record){
-                $record_arr = explode('_',$record);
+            if ($record) {
+                $record_arr = explode('_', $record);
                 $bid = $record_arr[0];
-                return (int)$bid;
+                return (int) $bid;
             }
-        }catch (\Exception $e){
-
-        }
+        } catch (\Exception $e) { }
         return 0;
     }
 
@@ -231,15 +270,17 @@ class ReadRecordService
      * 获取客服消息点击数
      * @param $uid
      */
-    public static function getCustomerMsgClickNum($channel_id,$from,$date){
-        $key = "fromcustomermsgenter:distribution_channel_id:".$channel_id.'from:'.$from;
-        return Redis::hget($key,$date);
+    public static function getCustomerMsgClickNum($channel_id, $from, $date)
+    {
+        $key = "fromcustomermsgenter:distribution_channel_id:" . $channel_id . 'from:' . $from;
+        return Redis::hget($key, $date);
     }
 
     /**
      * 获取某本书的阅读记录
      */
-    public static function getRecordByUidBid($uid,$bid){
+    public static function getRecordByUidBid($uid, $bid)
+    {
         return Redis::hget('book_read:' . $uid, $bid);
     }
 
@@ -248,16 +289,17 @@ class ReadRecordService
      * @param $bid
      * @return bool|null|string
      */
-    public static function bid2BookName($bid){
+    public static function bid2BookName($bid)
+    {
         $book_name = null;
-        if(is_null($book_name)){
-            $book_key = 'wap:string:book:'.$bid;
+        if (is_null($book_name)) {
+            $book_key = 'wap:string:book:' . $bid;
             $book_name = Redis::get($book_key);
-            Redis::EXPIRE($book_key,3600);
-            if(!$book_name){
+            Redis::EXPIRE($book_key, 3600);
+            if (!$book_name) {
                 $book_name = '';
                 $book_info = BookConfigService::getBookById($bid);
-                if($book_info && isset($book_info->book_name)){
+                if ($book_info && isset($book_info->book_name)) {
                     $book_name = $book_info->book_name;
                 }
             }
@@ -270,16 +312,17 @@ class ReadRecordService
      * @param $cid
      * @return bool|null|string
      */
-    public static function cid2ChapterName($cid){
+    public static function cid2ChapterName($cid)
+    {
         $chapter_name = null;
-        if(is_null($chapter_name)){
-            $chapter_key = 'wap:string:chapter:'.$cid;
+        if (is_null($chapter_name)) {
+            $chapter_key = 'wap:string:chapter:' . $cid;
             $chapter_name = Redis::get($chapter_key);
-            Redis::EXPIRE($chapter_key,3600);
-            if(!$chapter_name){
+            Redis::EXPIRE($chapter_key, 3600);
+            if (!$chapter_name) {
                 $chapter_name = '';
                 $chapter_info = Chapter::getChapterNameById($cid);
-                if($chapter_info && isset($chapter_info->name)){
+                if ($chapter_info && isset($chapter_info->name)) {
                     $chapter_name = $chapter_info->name;
                 }
             }
@@ -292,16 +335,17 @@ class ReadRecordService
      * @param $uid
      * @param $record
      */
-    public static function delBookNameAndChapter($uid){
+    public static function delBookNameAndChapter($uid)
+    {
         //Redis::hset('book_base:' . $uid, 'last_read', "{$bid}_{$cid}_{$book_name}_{$chapter_name}_" . time()) ;
         $base_record = Redis::hget('book_base:' . $uid, 'last_read');
-        if($base_record){
-            $record_arr = explode('_',$base_record);
+        if ($base_record) {
+            $record_arr = explode('_', $base_record);
             $c = count($record_arr);
-            if($c>3){
+            if ($c > 3) {
                 $bid = $record_arr[0];
                 $cid = $record_arr[1];
-                $time = $record_arr[$c-1];
+                $time = $record_arr[$c - 1];
                 Redis::hset('book_base:' . $uid, 'last_read', "{$bid}_{$cid}_" . $time);
             }
         }
@@ -309,24 +353,25 @@ class ReadRecordService
         foreach ($records as $key => $v) {
             $record = explode('_', $v);
             $count = count($record);
-            if($count >3){
+            if ($count > 3) {
                 $latest_read_cid = $record[0];
                 $book_name = $record[1];
                 $chapter_name = $record[2];
                 $latest_read_time = $record[$count - 1];
                 Redis::hset('book_read:' . $uid, $key, "{$latest_read_cid}_" . $latest_read_time);
 
-                $book_key = 'wap:string:book:'.$key;
-                $chapter_key = 'wap:string:chapter:'.$latest_read_cid;
-                Redis::set($book_key,$book_name);
-                Redis::set($chapter_key,$chapter_name);
+                $book_key = 'wap:string:book:' . $key;
+                $chapter_key = 'wap:string:chapter:' . $latest_read_cid;
+                Redis::set($book_key, $book_name);
+                Redis::set($chapter_key, $chapter_name);
             }
         }
     }
 
-    public static function delBookBase($uid){
+    public static function delBookBase($uid)
+    {
         $base_record = Redis::hget('book_base:' . $uid, 'last_read');
-        if($base_record){
+        if ($base_record) {
             Redis::del('book_base:' . $uid);
             Redis::hset('book_read:' . $uid, 'last_read', $base_record);
         }
@@ -337,35 +382,34 @@ class ReadRecordService
      * @param int $uid
      * @return array
      */
-    public static function getSimpleReadRecord(int $uid):array
+    public static function getSimpleReadRecord(int $uid): array
     {
         $read_bids = Redis::hgetall('book_read:' . $uid);
         $res = [];
-        if(!$read_bids) {
+        if (!$read_bids) {
             return $res;
         }
         foreach ($read_bids as $key => $v) {
-            if(in_array($key,self::$not_uid_key)){
-            	continue;
+            if (in_array($key, self::$not_uid_key)) {
+                continue;
             }
-            array_push($res,$key);
+            array_push($res, $key);
         }
         return $res;
     }
 
 
-    public static function ReadRecordStatistical(int $uid,int $distribution_channel_id,string $from){
-        try{
+    public static function ReadRecordStatistical(int $uid, int $distribution_channel_id, string $from)
+    {
+        try {
             DB::table('temp_read_active')->insert([
-                'uid'=>$uid,
-                'distribution_channel_id'=>$distribution_channel_id,
-                'from'=>$from,
-                'created_at'=>date('Y-m-d H:i:s'),
-                'updated_at'=>date('Y-m-d H:i:s'),
+                'uid' => $uid,
+                'distribution_channel_id' => $distribution_channel_id,
+                'from' => $from,
+                'created_at' => date('Y-m-d H:i:s'),
+                'updated_at' => date('Y-m-d H:i:s'),
             ]);
-        }catch (\Exception $e){
-
-        }
+        } catch (\Exception $e) { }
     }
 
     /**
@@ -373,14 +417,13 @@ class ReadRecordService
      * @param int $uid
      * @return int
      */
-    public static function getSendOrderId(int $uid){
-        try{
-            $send_order_id = Redis::hget('book_read:' . $uid,'send_order_id');
-            if($send_order_id)
-                return (int)$send_order_id;
-        }catch (\Exception $e){
-
-        }
+    public static function getSendOrderId(int $uid)
+    {
+        try {
+            $send_order_id = Redis::hget('book_read:' . $uid, 'send_order_id');
+            if ($send_order_id)
+                return (int) $send_order_id;
+        } catch (\Exception $e) { }
         return 0;
     }
 
@@ -389,10 +432,11 @@ class ReadRecordService
      * @param $uid
      * @param $inner_order_id
      */
-    public static function setInnerSendOrderId($uid,$inner_order_id){
-        try{
-            Redis::hset('book_read:' . $uid,'inner_send_order_id',$inner_order_id);
-        }catch (\Exception $e){}
+    public static function setInnerSendOrderId($uid, $inner_order_id)
+    {
+        try {
+            Redis::hset('book_read:' . $uid, 'inner_send_order_id', $inner_order_id);
+        } catch (\Exception $e) { }
     }
 
     /**
@@ -400,14 +444,15 @@ class ReadRecordService
      * @param $uid
      * @return string
      */
-    public static function getInnerSendOrderId($uid){
-        try{
-            $inner_send_order_id = Redis::hget('book_read:' . $uid,'inner_send_order_id');
-            if($inner_send_order_id){
+    public static function getInnerSendOrderId($uid)
+    {
+        try {
+            $inner_send_order_id = Redis::hget('book_read:' . $uid, 'inner_send_order_id');
+            if ($inner_send_order_id) {
                 return $inner_send_order_id;
             }
             return '';
-        }catch (\Exception $e){}
+        } catch (\Exception $e) { }
         return '';
     }
     /**
@@ -415,31 +460,34 @@ class ReadRecordService
      * @param int $uid
      * @return mixed
      */
-    public static function getSignDay(int $uid){
-        try{
-            return Redis::hget('book_read:' . $uid,'sign_day');
-        }catch (\Exception $e){}
+    public static function getSignDay(int $uid)
+    {
+        try {
+            return Redis::hget('book_read:' . $uid, 'sign_day');
+        } catch (\Exception $e) { }
         return -1;
     }
 
-    public static function setSignDay(int $uid){
-        return Redis::hset('book_read:' . $uid,'sign_day',date('Y-m-d'));
+    public static function setSignDay(int $uid)
+    {
+        return Redis::hset('book_read:' . $uid, 'sign_day', date('Y-m-d'));
     }
 
     /**
      * 签到次数和日期
      * @param int $uid
      */
-    public static function sign(int $uid,bool $is_incr){
-        try{
-            if($is_incr){
-                Redis::hincrby('book_read:' . $uid,'sign_counts',1);
-            }else{
-                self::setSignCount($uid,1);
+    public static function sign(int $uid, bool $is_incr)
+    {
+        try {
+            if ($is_incr) {
+                Redis::hincrby('book_read:' . $uid, 'sign_counts', 1);
+            } else {
+                self::setSignCount($uid, 1);
             }
             self::setSignDay($uid);
-        }catch (\Exception $e){
-        	\Log::info('sign_ept:'.$e->getMessage());
+        } catch (\Exception $e) {
+            \Log::info('sign_ept:' . $e->getMessage());
         }
         return;
     }
@@ -448,135 +496,140 @@ class ReadRecordService
      * @param int $uid
      * @return int
      */
-    public static function getSignCount(int $uid){
-        try{
-            $count = Redis::hget('book_read:' . $uid,'sign_counts');
-            if($count){
+    public static function getSignCount(int $uid)
+    {
+        try {
+            $count = Redis::hget('book_read:' . $uid, 'sign_counts');
+            if ($count) {
                 return $count;
             }
-        }catch (\Exception $e){
-
-        }
+        } catch (\Exception $e) { }
         return 0;
     }
 
     /**
- * 获取简单签到次数
- * @param int $uid
- * @return int
- */
-    public static function getSignCountSimple(int $uid){
-        try{
-            $count = Redis::hget('book_read:' . $uid,'sign_counts');
-            if($count){
-                return (int)$count;
+     * 获取简单签到次数
+     * @param int $uid
+     * @return int
+     */
+    public static function getSignCountSimple(int $uid)
+    {
+        try {
+            $count = Redis::hget('book_read:' . $uid, 'sign_counts');
+            if ($count) {
+                return (int) $count;
             }
             return 0;
-        }catch (\Exception $e){
-        }
+        } catch (\Exception $e) { }
         return 0;
     }
 
-    public static function setSignCount(int $uid,int $count){
-        Redis::hset('book_read:' . $uid,'sign_counts',$count);
+    public static function setSignCount(int $uid, int $count)
+    {
+        Redis::hset('book_read:' . $uid, 'sign_counts', $count);
     }
 
 
-    public static function setSignInfo(int $uid,string $info){
-        Redis::hset('book_read:' . $uid,'sign_info',$info);
+    public static function setSignInfo(int $uid, string $info)
+    {
+        Redis::hset('book_read:' . $uid, 'sign_info', $info);
     }
 
-    public static function setSmartPush($uid,$bid){
+    public static function setSmartPush($uid, $bid)
+    {
         $old = self::getSmartPush($uid);
-        if($old && !in_array($bid,$old)){
-            array_push($old,$bid);
-            $bid_str = implode(',',$old);
-            return Redis::hset('book_read:' . $uid,'smart_push',$bid_str);
-        }else{
-            return Redis::hset('book_read:' . $uid,'smart_push',$bid);
+        if ($old && !in_array($bid, $old)) {
+            array_push($old, $bid);
+            $bid_str = implode(',', $old);
+            return Redis::hset('book_read:' . $uid, 'smart_push', $bid_str);
+        } else {
+            return Redis::hset('book_read:' . $uid, 'smart_push', $bid);
         }
     }
 
-    public static function getSmartPush(int $uid):array{
-        $res =  Redis::hget('book_read:' . $uid,'smart_push');
-        if($res){
-            return explode(',',$res);
+    public static function getSmartPush(int $uid): array
+    {
+        $res =  Redis::hget('book_read:' . $uid, 'smart_push');
+        if ($res) {
+            return explode(',', $res);
         }
         return [];
     }
 
-    public static function getByField(int $uid,$field){
-        try{
-            return Redis::hget('book_read:' . $uid,$field);
-
-        }catch (\Exception $e){
-        }
+    public static function getByField(int $uid, $field)
+    {
+        try {
+            return Redis::hget('book_read:' . $uid, $field);
+        } catch (\Exception $e) { }
         return '';
     }
 
-    public static function getByMultiField(int $uid,...$field){
-        try{
-            return Redis::hmget('book_read:' . $uid,$field);
-        }catch (\Exception $e){
-        }
+    public static function getByMultiField(int $uid, ...$field)
+    {
+        try {
+            return Redis::hmget('book_read:' . $uid, $field);
+        } catch (\Exception $e) { }
         return '';
     }
 
-    public static function setByField(int $uid,$field,$value){
-        if(!in_array($field,self::$not_uid_key)){
+    public static function setByField(int $uid, $field, $value)
+    {
+        if (!in_array($field, self::$not_uid_key)) {
             return false;
         }
-        try{
-            return Redis::hset('book_read:' . $uid,$field,$value);
-        }catch (\Exception $e){}
+        try {
+            return Redis::hset('book_read:' . $uid, $field, $value);
+        } catch (\Exception $e) { }
         return '';
     }
 
-    public static function setByMultiField(int $uid,$kv){
+    public static function setByMultiField(int $uid, $kv)
+    {
         $keys = array_keys($kv);
-        foreach ($keys as $field){
-            if(!in_array($field,self::$not_uid_key)){
+        foreach ($keys as $field) {
+            if (!in_array($field, self::$not_uid_key)) {
                 return false;
             }
         }
-        try{
-            return Redis::hmset('book_read:' . $uid,$kv);
-        }catch (\Exception $e){}
+        try {
+            return Redis::hmset('book_read:' . $uid, $kv);
+        } catch (\Exception $e) { }
         return '';
     }
 
 
     private static function resetRecordFromDB($uid)
     {
-        if(self::getByField($uid,'last_read')){
-            return ;
-        }
-        $record = ReadRecordFromRedis::where('uid',$uid)->select('field','value')->get();
-        if($record->isNotEmpty()){
-            foreach ($record as $item){
-                if(!in_array($item->field,self::$not_uid_key) || $item->field == 'last_read'){
-                    Redis::hset('book_read:'.$uid,$item->field,$item->value);
+        if (self::getByField($uid, 'last_read')) {
+            return;
+        }
+        $record = ReadRecordFromRedis::where('uid', $uid)->select('field', 'value')->get();
+        if ($record->isNotEmpty()) {
+            foreach ($record as $item) {
+                if (!in_array($item->field, self::$not_uid_key) || $item->field == 'last_read') {
+                    Redis::hset('book_read:' . $uid, $item->field, $item->value);
                 }
             }
         }
     }
 
     //删除多余的阅读纪律
-    public static function delTheLastRecord($uid){
-        $length = Redis::hlen('book_read:'.$uid);
-        if($length <= self::RECORD_COUNT+count(self::$not_uid_key)){
-            return ;
+    public static function delTheLastRecord($uid)
+    {
+        $length = Redis::hlen('book_read:' . $uid);
+        if ($length <= self::RECORD_COUNT + count(self::$not_uid_key)) {
+            return;
         }
         $read_bids = Redis::hgetall('book_read:' . $uid);
         $i = 0;
         foreach ($read_bids as $key => $v) {
-            if(in_array($key,self::$not_uid_key)){
+            if (in_array($key, self::$not_uid_key)) {
                 continue;
             }
             $record = explode('_', $v);
             $latest_read_cid = $record[0];
             $latest_read_time = $record[count($record) - 1];
-            $res[$i++] = [ 'bid' => $key, 'cid' => (int)$latest_read_cid, 'time' => (int)$latest_read_time];
+            $res[$i++] = ['bid' => $key, 'cid' => (int) $latest_read_cid, 'time' => (int) $latest_read_time];
         }
         usort($res, function ($a, $b) {
             if ($a['time'] >= $b['time']) return -1;
@@ -584,10 +637,10 @@ class ReadRecordService
         });
 
         $j = 0;
-        foreach ($res as $v){
-            if($j++ >=self::RECORD_COUNT){
-                Redis::hdel('book_read:'.$uid,$v['bid']);
+        foreach ($res as $v) {
+            if ($j++ >= self::RECORD_COUNT) {
+                Redis::hdel('book_read:' . $uid, $v['bid']);
             }
         }
     }
-}
+}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 3787 - 1
public/kyydoc/api_data.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 3787 - 1
public/kyydoc/api_data.json


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 24 - 1
public/kyydoc/api_project.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 24 - 1
public/kyydoc/api_project.json


+ 62 - 25
public/kyydoc/css/style.css

@@ -114,7 +114,7 @@ th {
 
 td {
   vertical-align: top;
-  padding: 2px 8px;
+  padding: 10px 8px 0 8px;
   border: #e0e0e0 1px solid;
 }
 
@@ -126,6 +126,8 @@ td {
 
 .label-optional {
   float: right;
+  background-color: grey;
+  margin-top: 4px;
 }
 
 .open-left {
@@ -170,6 +172,11 @@ pre {
   border-radius: 6px;
   position: relative;
   margin: 10px 0 20px 0;
+  overflow-x: auto;
+}
+
+pre.prettyprint {
+  width: 100%;
 }
 
 code.language-text {
@@ -181,38 +188,35 @@ pre.language-json {
 }
 
 pre.language-html {
-  margin: 40px 0 20px 0;
+  margin: 0 0 20px 0;
 }
 
-pre.language-html:before {
-  content: attr(data-type);
-  position: absolute;
-  top: -30px;
-  left: 0;
+.type {
   font-family: "Source Sans Pro", sans-serif;
   font-weight: 600;
   font-size: 15px;
   display: inline-block;
-  padding: 2px 5px;
+  margin: 0 0 5px 0;
+  padding: 4px 5px;
   border-radius: 6px;
   text-transform: uppercase;
   background-color: #3387CC;
   color: #ffffff;
 }
 
-pre.language-html[data-type="get"]:before {
+.type__get {
   background-color: green;
 }
 
-pre.language-html[data-type="put"]:before {
+.type__put {
   background-color: #e5c500;
 }
 
-pre.language-html[data-type="post"]:before {
+.type__post {
   background-color: #4070ec;
 }
 
-pre.language-html[data-type="delete"]:before {
+.type__delete {
   background-color: #ed0039;
 }
 
@@ -247,9 +251,9 @@ pre code.sample-request-response-json {
 .sidenav {
   width: 228px;
   margin: 0;
-  padding: 20px;
+  padding: 0 20px 20px 20px;
   position: fixed;
-  top: 0;
+  top: 50px;
   left: 0;
   bottom: 0;
   overflow-x: hidden;
@@ -271,6 +275,11 @@ pre code.sample-request-response-json {
   font-size: 14px;
 }
 
+.sidenav > li.nav-header {
+  margin-top: 8px;
+  margin-bottom: 8px;
+}
+
 .sidenav > li.nav-header > a {
   padding: 5px 15px;
   border: 1px solid #e5e5e5;
@@ -281,17 +290,11 @@ pre code.sample-request-response-json {
   background-color: #ffffff;
 }
 
-.sidenav > li.nav-header.active > a {
-  background-color: #0088cc;
-}
-
-.sidenav > .active > a {
-  position: relative;
-  z-index: 2;
-}
-
-.sidenav > li > a:hover {
-  background-color: #ffffff;
+.sidenav > li.active > a {
+    position: relative;
+    z-index: 2;
+    background-color: #0088cc;
+    color: #ffffff;
 }
 
 .sidenav > li.has-modifications a {
@@ -303,6 +306,34 @@ pre code.sample-request-response-json {
 }
 
 /* ------------------------------------------------------------------------------------------
+ * Side nav search
+ * ------------------------------------------------------------------------------------------ */
+.sidenav-search {
+  width: 228px;
+  left: 0px;
+  position: fixed;
+  padding: 16px 20px 10px 20px;
+  background-color: #F5F5F5;
+  z-index: 11;
+}
+
+.sidenav-search .search {
+  height: 26px;
+}
+
+.search-reset {
+  position: absolute;
+  display: block;
+  cursor: pointer;
+  width: 20px;
+  height: 20px;
+  text-align: center;
+  right: 28px;
+  top: 17px;
+  background-color: #fff;
+}
+
+/* ------------------------------------------------------------------------------------------
  * Compare
  * ------------------------------------------------------------------------------------------ */
 
@@ -488,6 +519,12 @@ ul.nav-tabs {
   margin: 0;
 }
 
+p.deprecated span{
+  color: #ff0000;
+  font-weight: bold;
+  text-decoration: underline;
+}
+
 /* ------------------------------------------------------------------------------------------
  * Print
  * ------------------------------------------------------------------------------------------ */

binární
public/kyydoc/fonts/glyphicons-halflings-regular.eot


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 288 - 0
public/kyydoc/fonts/glyphicons-halflings-regular.svg


binární
public/kyydoc/fonts/glyphicons-halflings-regular.ttf


binární
public/kyydoc/fonts/glyphicons-halflings-regular.woff


binární
public/kyydoc/fonts/glyphicons-halflings-regular.woff2


+ 102 - 92
public/kyydoc/index.html

@@ -15,18 +15,22 @@
 
 <script id="template-sidenav" type="text/x-handlebars-template">
 <nav id="scrollingNav">
-  <ul class="sidenav nav nav-list">
+  <div class="sidenav-search">
+    <input class="form-control search" type="text" placeholder="{{__ "Filter..."}}">
+    <span class="search-reset">x</span>
+  </div>
+  <ul class="sidenav nav nav-list list">
   {{#each nav}}
     {{#if title}}
       {{#if isHeader}}
         {{#if isFixed}}
-          <li class="nav-fixed nav-header" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li>
+          <li class="nav-fixed nav-header navbar-btn nav-list-item" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li>
         {{else}}
-          <li class="nav-header" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li>
+          <li class="nav-header nav-list-item" data-group="{{group}}"><a href="#api-{{group}}">{{underscoreToSpace title}}</a></li>
         {{/if}}
       {{else}}
-        <li {{#if hidden}}class="hide" {{/if}}data-group="{{group}}" data-name="{{name}}" data-version="{{version}}">
-          <a href="#api-{{group}}-{{name}}">{{title}}</a>
+        <li class="{{#if hidden}}hide {{/if}}" data-group="{{group}}" data-name="{{name}}" data-version="{{version}}">
+          <a href="#api-{{group}}-{{name}}" class="nav-list-item">{{title}}</a>
         </li>
       {{/if}}
     {{/if}}
@@ -43,16 +47,16 @@
   {{#if template.withCompare}}
   <div class="pull-right">
     <div class="btn-group">
-      <button id="version" class="btn btn-large dropdown-toggle" data-toggle="dropdown">
-        <strong>{{version}}</strong> <span class="caret"></span>
+      <button id="version" class="btn btn-lg btn-default dropdown-toggle" data-toggle="dropdown">
+        <strong>{{version}}</strong>&nbsp;<span class="caret"></span>
       </button>
       <ul id="versions" class="dropdown-menu open-left">
-          <li><a id="compareAllWithPredecessor" href="#">{{__ "Compare all with predecessor"}}</a></li>
-          <li class="divider"></li>
-          <li class="disabled"><a href="#">{{__ "show up to version:"}}</a></li>
-  {{#each versions}}
+        <li><a id="compareAllWithPredecessor" href="#">{{__ "Compare all with predecessor"}}</a></li>
+        <li class="divider"></li>
+        <li class="disabled"><a href="#">{{__ "show up to version:"}}</a></li>
+      {{#each versions}}
         <li class="version"><a href="#">{{this}}</a></li>
-  {{/each}}
+      {{/each}}
       </ul>
     </div>
   </div>
@@ -104,24 +108,30 @@
     {{#if template.withCompare}}
     <div class="pull-right">
       <div class="btn-group">
-        <button class="version btn dropdown-toggle" data-toggle="dropdown">
-          <strong>{{article.version}}</strong> <span class="caret"></span>
+        <button class="version btn btn-default dropdown-toggle" data-toggle="dropdown">
+          <strong>{{article.version}}</strong>&nbsp;<span class="caret"></span>
         </button>
         <ul class="versions dropdown-menu open-left">
           <li class="disabled"><a href="#">{{__ "compare changes to:"}}</a></li>
-  {{#each versions}}
+        {{#each versions}}
           <li class="version"><a href="#">{{this}}</a></li>
-  {{/each}}
+        {{/each}}
         </ul>
       </div>
     </div>
     {{/if}}
     <div class="clearfix"></div>
 
+    {{#if article.deprecated}}
+      <p class="deprecated"><span>{{__ "DEPRECATED"}}</span>
+        {{{markdown article.deprecated.content}}}
+      </p>
+    {{/if}}
+
     {{#if article.description}}
       <p>{{{nl2br article.description}}}</p>
     {{/if}}
-
+    <span class="type type__{{toLowerCase article.type}}">{{toLowerCase article.type}}</span>
     <pre class="prettyprint language-html" data-type="{{toLowerCase article.type}}"><code>{{article.url}}</code></pre>
 
     {{#if article.permission}}
@@ -130,8 +140,9 @@
         {{#each article.permission}}
           {{name}}
           {{#if title}}
-            &nbsp;<a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br description}}" title="" data-original-title="{{title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a>
-            {{#unless @last}}, {{/unless}}
+          <button type="button" class="btn btn-info btn-xs" data-title="{{title}}" data-content="{{nl2br description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
+              <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
+          </button>
           {{/if}}
         {{/each}}
       </p>
@@ -161,7 +172,6 @@
     {{subTemplate "article-param-block" params=article.error _col1="Name" _hasType=_hasTypeInErrorFields section="error"}}
 
     {{subTemplate "article-sample-request" article=article id=id}}
-
   </article>
 </script>
 
@@ -172,13 +182,13 @@
       <table>
         <thead>
           <tr>
-          <th style="width: 30%">{{#if ../../_col1}}{{__ ../../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
-            {{#if ../../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
-            <th style="width: {{#if ../../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
+          <th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
+            {{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
+            <th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
           </tr>
         </thead>
         <tbody>
-      {{#each this}}
+        {{#each this}}
           <tr>
             <td class="code">{{{splitFill field "." "&nbsp;&nbsp;"}}}{{#if optional}} <span class="label label-optional">{{__ "optional"}}</span>{{/if}}</td>
             {{#if ../../_hasType}}
@@ -198,29 +208,27 @@
             {{/if}}
             </td>
           </tr>
-      {{/each}}
+        {{/each}}
         </tbody>
       </table>
     {{/each}}
-
     {{#if_gt params.examples.length compare=0}}
       <ul class="nav nav-tabs nav-tabs-examples">
-        {{#each params.examples}}
-          <li{{#if_eq @index compare=0}} class="active"{{/if_eq}}>
-            <a href="#{{../section}}-examples-{{../id}}-{{@index}}">{{title}}</a>
-          </li>
-        {{/each}}
+      {{#each params.examples}}
+        <li{{#if_eq @index compare=0}} class="active"{{/if_eq}}>
+          <a href="#{{../section}}-examples-{{../id}}-{{@index}}">{{title}}</a>
+        </li>
+      {{/each}}
       </ul>
 
       <div class="tab-content">
       {{#each params.examples}}
         <div class="tab-pane{{#if_eq @index compare=0}} active{{/if_eq}}" id="{{../section}}-examples-{{../id}}-{{@index}}">
-        <pre class="prettyprint language-{{type}}" data-type="{{type}}"><code>{{{reformat content type}}}</code></pre>
+        <pre class="prettyprint language-{{type}}" data-type="{{type}}"><code>{{reformat content type}}</code></pre>
         </div>
       {{/each}}
       </div>
     {{/if_gt}}
-
   {{/if}}
 </script>
 
@@ -229,29 +237,26 @@
       <h2>{{__ "Send a Sample Request"}}</h2>
       <form class="form-horizontal">
         <fieldset>
-          <div class="control-group">
-            <div class="controls">
-              <div class="input-prepend">>
-                <span class="add-on">{{__ "url"}}</span>
-                <input type="text" class="input-xxlarge sample-request-url" value="{{article.sampleRequest.0.url}}" />
+            <div class="form-group">
+              <label class="col-md-3 control-label" for="{{../id}}-sample-request-url"></label>
+              <div class="input-group">
+                <input id="{{../id}}-sample-request-url" type="text" class="form-control sample-request-url" value="{{article.sampleRequest.0.url}}" />
+                <span class="input-group-addon">{{__ "url"}}</span>
               </div>
             </div>
-          </div>
 
       {{#if article.header}}
         {{#if article.header.fields}}
           <h3>{{__ "Headers"}}</h3>
           {{#each article.header.fields}}
-            <h4><input type="radio" data-sample-request-header-group-id="sample-request-header-{{@index}}" name="{{../id}}-sample-request-header" value="{{@index}}" class="sample-request-header sample-request-switch"{{#if_eq @index compare=0}} checked{{/if_eq}}> {{@key}}</h4>
+            <h4><input type="radio" data-sample-request-header-group-id="sample-request-header-{{@index}}" name="{{../id}}-sample-request-header" value="{{@index}}" class="sample-request-header sample-request-switch" {{#if_eq @index compare=0}} checked{{/if_eq}} />{{@key}}</h4>
             <div class="{{../id}}-sample-request-header-fields{{#if_gt @index compare=0}} hide{{/if_gt}}">
               {{#each this}}
-              <div class="control-group">
-                <label class="control-label" for="sample-request-header-field-{{field}}">{{field}}</label>
-                <div class="controls">
-                  <div class="input-append">>
-                    <input type="text" placeholder="{{field}}" class="input-xxlarge sample-request-header" data-sample-request-header-name="{{field}}" data-sample-request-header-group="sample-request-header-{{@../index}}">
-                    <span class="add-on">{{{type}}}</span>
-                  </div>
+              <div class="form-group">
+                <label class="col-md-3 control-label" for="sample-request-header-field-{{field}}">{{field}}</label>
+                <div class="input-group">
+                  <input type="text" placeholder="{{field}}" id="sample-request-header-field-{{field}}" class="form-control sample-request-header" data-sample-request-header-name="{{field}}" data-sample-request-header-group="sample-request-header-{{@../index}}">
+                  <span class="input-group-addon">{{{type}}}</span>
                 </div>
               </div>
               {{/each}}
@@ -264,38 +269,32 @@
         {{#if article.parameter.fields}}
           <h3>{{__ "Parameters"}}</h3>
           {{#each article.parameter.fields}}
-            <h4><input type="radio" data-sample-request-param-group-id="sample-request-param-{{@index}}"  name="{{../id}}-sample-request-param" value="{{@index}}" class="sample-request-param sample-request-switch"{{#if_eq @index compare=0}} checked{{/if_eq}}> {{@key}}</h4>
-            <div class="{{../id}}-sample-request-param-fields{{#if_gt @index compare=0}} hide{{/if_gt}}">
+            <h4><input type="radio" data-sample-request-param-group-id="sample-request-param-{{@index}}"  name="{{../id}}-sample-request-param" value="{{@index}}" class="sample-request-param sample-request-switch" {{#if_eq @index compare=0}} checked{{/if_eq}} />{{@key}}</h4>
+            <div class="form-group {{../id}}-sample-request-param-fields{{#if_gt @index compare=0}} hide{{/if_gt}}">
               {{#each this}}
-              <div class="control-group">
-                <label class="control-label" for="sample-request-param-field-{{field}}">{{field}}</label>
-                <div class="controls">
-                  <div class="input-append">>
-                    <input type="text" placeholder="{{field}}" class="input-xxlarge sample-request-param" data-sample-request-param-name="{{field}}" data-sample-request-param-group="sample-request-param-{{@../index}}">
-                    <span class="add-on">{{{type}}}</span>
-                  </div>
+                <label class="col-md-3 control-label" for="sample-request-param-field-{{field}}">{{field}}</label>
+                <div class="input-group">
+                  <input id="sample-request-param-field-{{field}}" type="text" placeholder="{{field}}" class="form-control sample-request-param" data-sample-request-param-name="{{field}}" data-sample-request-param-group="sample-request-param-{{@../index}}" {{#if optional}}data-sample-request-param-optional="true"{{/if}}>
+                  <div class="input-group-addon">{{{type}}}</div>
                 </div>
-              </div>
               {{/each}}
             </div>
           {{/each}}
         {{/if}}
       {{/if}}
 
-          <div class="control-group">
-            <div class="controls">
-              <button class="btn btn-default sample-request-send" data-sample-request-type="{{article.type}}">{{__ "Send"}}</button>
+          <div class="form-group">
+            <div class="controls pull-right">
+              <button class="btn btn-primary sample-request-send" data-sample-request-type="{{article.type}}">{{__ "Send"}}</button>
             </div>
           </div>
-
-          <div class="sample-request-response" style="display: none;">
+          <div class="form-group sample-request-response" style="display: none;">
             <h3>
               {{__ "Response"}}
-              <button class="btn btn-small btn-default pull-right sample-request-clear">X</button>
+              <button class="btn btn-default btn-xs pull-right sample-request-clear">X</button>
             </h3>
             <pre class="prettyprint language-json" data-type="json"><code class="sample-request-response-json"></code></pre>
           </div>
-
         </fieldset>
       </form>
     {{/if}}
@@ -313,14 +312,14 @@
           <strong>{{article.version}}</strong> {{__ "compared to"}}
         </button>
         <button class="version btn btn-danger dropdown-toggle" data-toggle="dropdown">
-          <strong>{{compare.version}}</strong> <span class="caret"></span>
+          <strong>{{compare.version}}</strong>&nbsp;<span class="caret"></span>
         </button>
         <ul class="versions dropdown-menu open-left">
           <li class="disabled"><a href="#">{{__ "compare changes to:"}}</a></li>
           <li class="divider"></li>
-  {{#each versions}}
+        {{#each versions}}
           <li class="version"><a href="#">{{this}}</a></li>
-  {{/each}}
+        {{/each}}
         </ul>
       </div>
     </div>
@@ -340,7 +339,6 @@
 
     <ul class="nav nav-tabs nav-tabs-examples">
     {{#each_compare_title article.examples compare.examples}}
-
       {{#if typeSame}}
         <li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
           <a href="#compare-examples-{{../../article.id}}-{{index}}">{{{showDiff source.title compare.title}}}</a>
@@ -358,7 +356,6 @@
           <a href="#compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a>
         </li>
       {{/if}}
-
     {{/each_compare_title}}
     </ul>
 
@@ -396,12 +393,16 @@
 </script>
 
 <script id="template-article-compare-permission" type="text/x-handlebars-template">
+  <p>
+  {{__ "Permission:"}}
   {{#each_compare_list_field article.permission compare.permission field="name"}}
     {{#if source}}
       {{#if typeSame}}
         {{source.name}}
         {{#if source.title}}
-          &nbsp;<a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br source.description}}" title="" data-original-title="{{source.title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a>
+          <button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
+            <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
+          </button>
           {{#unless _last}}, {{/unless}}
         {{/if}}
       {{/if}}
@@ -409,7 +410,9 @@
       {{#if typeIns}}
         <ins>{{source.name}}</ins>
         {{#if source.title}}
-          &nbsp;<a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br source.description}}" title="" data-original-title="{{source.title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a>
+          <button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
+            <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
+          </button>
           {{#unless _last}}, {{/unless}}
         {{/if}}
       {{/if}}
@@ -417,7 +420,9 @@
       {{#if typeDel}}
         <del>{{source.name}}</del>
         {{#if source.title}}
-          &nbsp;<a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br source.description}}" title="" data-original-title="{{source.title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a>
+          <button type="button" class="btn btn-info btn-xs" data-title="{{source.title}}" data-content="{{nl2br source.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
+            <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
+          </button>
           {{#unless _last}}, {{/unless}}
         {{/if}}
       {{/if}}
@@ -425,7 +430,9 @@
       {{#if typeSame}}
         {{compare.name}}
         {{#if compare.title}}
-          &nbsp;<a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br compare.description}}" title="" data-original-title="{{compare.title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a>
+          <button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
+            <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
+          </button>
           {{#unless _last}}, {{/unless}}
         {{/if}}
       {{/if}}
@@ -433,7 +440,9 @@
       {{#if typeIns}}
         <ins>{{compare.name}}</ins>
         {{#if compare.title}}
-          &nbsp;<a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br compare.description}}" title="" data-original-title="{{compare.title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a>
+          <button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
+            <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
+          </button>
           {{#unless _last}}, {{/unless}}
         {{/if}}
       {{/if}}
@@ -441,12 +450,15 @@
       {{#if typeDel}}
         <del>{{compare.name}}</del>
         {{#if compare.title}}
-          &nbsp;<a href="#" data-toggle="popover" data-placement="right" data-html="true" data-content="{{nl2br compare.description}}" title="" data-original-title="{{compare.title}}"><span class="label label-info"><i class="icon icon-info-sign icon-white"></i></span></a>
+          <button type="button" class="btn btn-info btn-xs" data-title="{{compare.title}}" data-content="{{nl2br compare.description}}" data-html="true" data-toggle="popover" data-placement="right" data-trigger="hover">
+            <span class="glyphicon glyphicon-info-sign" aria-hidden="true"></span>
+          </button>
           {{#unless _last}}, {{/unless}}
         {{/if}}
       {{/if}}
     {{/if}}
   {{/each_compare_list_field}}
+  </p>
 </script>
 
 <script id="template-article-compare-param-block" type="text/x-handlebars-template">
@@ -457,12 +469,12 @@
         <table>
         <thead>
           <tr>
-            <th style="width: 30%">{{#if ../../_col1}}{{__ ../../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
-            {{#if ../../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
-            <th style="width: {{#if ../../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
+            <th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
+            {{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
+            <th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
           </tr>
         </thead>
-        {{subTemplate "article-compare-param-block-body" source=source.value compare=compare.value _hasType=../../_hasType}}
+        {{subTemplate "article-compare-param-block-body" source=source.value compare=compare.value _hasType=../_hasType}}
         </table>
       {{/if}}
 
@@ -471,12 +483,12 @@
         <table class="ins">
         <thead>
           <tr>
-            <th style="width: 30%">{{#if ../../_col1}}{{__ ../../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
-            {{#if ../../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
-            <th style="width: {{#if ../../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
+            <th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
+            {{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
+            <th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
           </tr>
         </thead>
-        {{subTemplate "article-compare-param-block-body" source=source.value compare=source.value _hasType=../../_hasType}}
+        {{subTemplate "article-compare-param-block-body" source=source.value compare=source.value _hasType=../_hasType}}
         </table>
       {{/if}}
 
@@ -485,19 +497,19 @@
         <table class="del">
         <thead>
           <tr>
-            <th style="width: 30%">{{#if ../../_col1}}{{__ ../../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
-            {{#if ../../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
-            <th style="width: {{#if ../../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
+            <th style="width: 30%">{{#if ../_col1}}{{__ ../_col1}}{{else}}{{__ "Field"}}{{/if}}</th>
+            {{#if ../_hasType}}<th style="width: 10%">{{__ "Type"}}</th>{{/if}}
+            <th style="width: {{#if ../_hasType}}60%{{else}}70%{{/if}}">{{__ "Description"}}</th>
           </tr>
         </thead>
-        {{subTemplate "article-compare-param-block-body" source=compare.value compare=compare.value _hasType=../../_hasType}}
+        {{subTemplate "article-compare-param-block-body" source=compare.value compare=compare.value _hasType=../_hasType}}
         </table>
       {{/if}}
     {{/each_compare_keys}}
 
+    {{#if source.examples}}
     <ul class="nav nav-tabs nav-tabs-examples">
     {{#each_compare_title source.examples compare.examples}}
-
       {{#if typeSame}}
         <li{{#if_eq index compare=0}} class="active"{{/if_eq}}>
           <a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}">{{{showDiff source.title compare.title}}}</a>
@@ -515,7 +527,6 @@
           <a href="#{{../../section}}-compare-examples-{{../../article.id}}-{{index}}"><del>{{{compare.title}}}</del></a>
         </li>
       {{/if}}
-
     {{/each_compare_title}}
     </ul>
 
@@ -539,10 +550,9 @@
           <pre class="prettyprint language-{{source.type}}" data-type="{{compare.type}}"><code>{{{compare.content}}}</code></pre>
         </div>
       {{/if}}
-
     {{/each_compare_title}}
     </div>
-
+    {{/if}}
   {{/if}}
 </script>
 
@@ -627,7 +637,7 @@
 </script>
 
 <div class="container-fluid">
-  <div class="row-fluid">
+  <div class="row">
     <div id="sidenav" class="span2"></div>
     <div id="content">
       <div id="project"></div>

+ 25 - 0
public/kyydoc/locales/cs.js

@@ -0,0 +1,25 @@
+define({
+    cs: {
+        'Allowed values:'             : 'Povolené hodnoty:',
+        'Compare all with predecessor': 'Porovnat vše s předchozími verzemi',
+        'compare changes to:'         : 'porovnat změny s:',
+        'compared to'                 : 'porovnat s',
+        'Default value:'              : 'Výchozí hodnota:',
+        'Description'                 : 'Popis',
+        'Field'                       : 'Pole',
+        'General'                     : 'Obecné',
+        'Generated with'              : 'Vygenerováno pomocí',
+        'Name'                        : 'Název',
+        'No response values.'         : 'Nebyly vráceny žádné hodnoty.',
+        'optional'                    : 'volitelné',
+        'Parameter'                   : 'Parametr',
+        'Permission:'                 : 'Oprávnění:',
+        'Response'                    : 'Odpověď',
+        'Send'                        : 'Odeslat',
+        'Send a Sample Request'       : 'Odeslat ukázkový požadavek',
+        'show up to version:'         : 'zobrazit po verzi:',
+        'Size range:'                 : 'Rozsah velikosti:',
+        'Type'                        : 'Typ',
+        'url'                         : 'url'
+    }
+});

+ 2 - 2
public/kyydoc/locales/it.js

@@ -10,14 +10,14 @@ define({
         'General'                     : 'Generale',
         'Generated with'              : 'Creato con',
         'Name'                        : 'Nome',
-        'No response values.'         : 'Nessnu valore di risposta.',
+        'No response values.'         : 'Nessun valore di risposta.',
         'optional'                    : 'opzionale',
         'Parameter'                   : 'Parametro',
         'Permission:'                 : 'Permessi:',
         'Response'                    : 'Risposta',
         'Send'                        : 'Invia',
         'Send a Sample Request'       : 'Invia una richiesta di esempio',
-        'show up to version:'         : 'visualizza la versione:',
+        'show up to version:'         : 'mostra alla versione:',
         'Size range:'                 : 'Intervallo dimensione:',
         'Type'                        : 'Tipo',
         'url'                         : 'url'

+ 4 - 0
public/kyydoc/locales/locale.js

@@ -1,5 +1,6 @@
 define([
     './locales/ca.js',
+    './locales/cs.js',
     './locales/de.js',
     './locales/es.js',
     './locales/fr.js',
@@ -7,7 +8,10 @@ define([
     './locales/nl.js',
     './locales/pl.js',
     './locales/pt_br.js',
+    './locales/ro.js',
     './locales/ru.js',
+    './locales/tr.js',
+    './locales/vi.js',
     './locales/zh.js',
     './locales/zh_cn.js'
 ], function() {

+ 25 - 0
public/kyydoc/locales/ro.js

@@ -0,0 +1,25 @@
+define({
+    ro: {
+        'Allowed values:'             : 'Valori permise:',
+        'Compare all with predecessor': 'Compară toate cu versiunea precedentă',
+        'compare changes to:'         : 'compară cu versiunea:',
+        'compared to'                 : 'comparat cu',
+        'Default value:'              : 'Valoare implicită:',
+        'Description'                 : 'Descriere',
+        'Field'                       : 'Câmp',
+        'General'                     : 'General',
+        'Generated with'              : 'Generat cu',
+        'Name'                        : 'Nume',
+        'No response values.'         : 'Nici o valoare returnată.',
+        'optional'                    : 'opțional',
+        'Parameter'                   : 'Parametru',
+        'Permission:'                 : 'Permisiune:',
+        'Response'                    : 'Răspuns',
+        'Send'                        : 'Trimite',
+        'Send a Sample Request'       : 'Trimite o cerere de probă',
+        'show up to version:'         : 'arată până la versiunea:',
+        'Size range:'                 : 'Interval permis:',
+        'Type'                        : 'Tip',
+        'url'                         : 'url'
+    }
+});

+ 25 - 0
public/kyydoc/locales/tr.js

@@ -0,0 +1,25 @@
+define({
+    tr: {
+        'Allowed values:'             : 'İzin verilen değerler:',
+        'Compare all with predecessor': 'Tümünü öncekiler ile karşılaştır',
+        'compare changes to:'         : 'değişiklikleri karşılaştır:',
+        'compared to'                 : 'karşılaştır',
+        'Default value:'              : 'Varsayılan değer:',
+        'Description'                 : 'Açıklama',
+        'Field'                       : 'Alan',
+        'General'                     : 'Genel',
+        'Generated with'              : 'Oluşturan',
+        'Name'                        : 'İsim',
+        'No response values.'         : 'Dönüş verisi yok.',
+        'optional'                    : 'opsiyonel',
+        'Parameter'                   : 'Parametre',
+        'Permission:'                 : 'İzin:',
+        'Response'                    : 'Dönüş',
+        'Send'                        : 'Gönder',
+        'Send a Sample Request'       : 'Örnek istek gönder',
+        'show up to version:'         : 'bu versiyona kadar göster:',
+        'Size range:'                 : 'Boyut aralığı:',
+        'Type'                        : 'Tip',
+        'url'                         : 'url'
+    }
+});

+ 25 - 0
public/kyydoc/locales/vi.js

@@ -0,0 +1,25 @@
+define({
+    vi: {
+        'Allowed values:'             : 'Giá trị chấp nhận:',
+        'Compare all with predecessor': 'So sánh với tất cả phiên bản trước',
+        'compare changes to:'         : 'so sánh sự thay đổi với:',
+        'compared to'                 : 'so sánh với',
+        'Default value:'              : 'Giá trị mặc định:',
+        'Description'                 : 'Chú thích',
+        'Field'                       : 'Trường dữ liệu',
+        'General'                     : 'Tổng quan',
+        'Generated with'              : 'Được tạo bởi',
+        'Name'                        : 'Tên',
+        'No response values.'         : 'Không có kết quả trả về.',
+        'optional'                    : 'Tùy chọn',
+        'Parameter'                   : 'Tham số',
+        'Permission:'                 : 'Quyền hạn:',
+        'Response'                    : 'Kết quả',
+        'Send'                        : 'Gửi',
+        'Send a Sample Request'       : 'Gửi một yêu cầu mẫu',
+        'show up to version:'         : 'hiển thị phiên bản:',
+        'Size range:'                 : 'Kích cỡ:',
+        'Type'                        : 'Kiểu',
+        'url'                         : 'liên kết'
+    }
+});

+ 108 - 27
public/kyydoc/main.js

@@ -6,12 +6,13 @@ require.config({
         handlebarsExtended: './utils/handlebars_helper',
         jquery: './vendor/jquery.min',
         locales: './locales/locale',
-        lodash: './vendor/lodash.min',
+        lodash: './vendor/lodash.custom.min',
         pathToRegexp: './vendor/path-to-regexp/index',
         prettify: './vendor/prettify/prettify',
         semver: './vendor/semver.min',
         utilsSampleRequest: './utils/send_sample_request',
-        webfontloader: './vendor/webfontloader'
+        webfontloader: './vendor/webfontloader',
+        list: './vendor/list.min'
     },
     shim: {
         bootstrap: {
@@ -47,7 +48,8 @@ require([
     'semver',
     'webfontloader',
     'bootstrap',
-    'pathToRegexp'
+    'pathToRegexp',
+    'list'
 ], function($, _, locale, Handlebars, apiProject, apiData, prettyPrint, sampleRequest, semver, WebFont) {
 
     // load google web fonts
@@ -201,24 +203,77 @@ require([
         });
     });
 
+    /**
+     * Add navigation items by analyzing the HTML content and searching for h1 and h2 tags
+     * @param nav Object the navigation array
+     * @param content string the compiled HTML content
+     * @param index where to insert items
+     * @return boolean true if any good-looking (i.e. with a group identifier) <h1> tag was found
+     */
+    function add_nav(nav, content, index) {
+        var found_level1 = false;
+        if ( ! content) {
+          return found_level1;
+        }
+        var topics = content.match(/<h(1|2).*?>(.+?)<\/h(1|2)>/gi);
+        if ( topics ) {
+          topics.forEach(function(entry) {
+              var level = entry.substring(2,3);
+              var title = entry.replace(/<.+?>/g, '');    // Remove all HTML tags for the title
+              var entry_tags = entry.match(/id="api-([^\-]+)(?:-(.+))?"/);    // Find the group and name in the id property
+              var group = (entry_tags ? entry_tags[1] : null);
+              var name = (entry_tags ? entry_tags[2] : null);
+              if (level==1 && title && group)  {
+                  nav.splice(index, 0, {
+                      group: group,
+                      isHeader: true,
+                      title: title,
+                      isFixed: true
+                  });
+                  index++;
+                  found_level1 = true;
+              }
+              if (level==2 && title && group && name)    {
+                  nav.splice(index, 0, {
+                      group: group,
+                      name: name,
+                      isHeader: false,
+                      title: title,
+                      isFixed: false,
+                      version: '1.0'
+                  });
+                  index++;
+              }
+          });
+        }
+        return found_level1;
+    }
+
     // Mainmenu Header entry
     if (apiProject.header) {
-        nav.unshift({
-            group: '_',
-            isHeader: true,
-            title: (apiProject.header.title == null) ? locale.__('General') : apiProject.header.title,
-            isFixed: true
-        });
+        var found_level1 = add_nav(nav, apiProject.header.content, 0); // Add level 1 and 2 titles
+        if (!found_level1) {    // If no Level 1 tags were found, make a title
+            nav.unshift({
+                group: '_',
+                isHeader: true,
+                title: (apiProject.header.title == null) ? locale.__('General') : apiProject.header.title,
+                isFixed: true
+            });
+        }
     }
 
     // Mainmenu Footer entry
-    if (apiProject.footer && apiProject.footer.title != null) {
-        nav.push({
-            group: '_footer',
-            isHeader: true,
-            title: apiProject.footer.title,
-            isFixed: true
-        });
+    if (apiProject.footer) {
+        var last_nav_index = nav.length;
+        var found_level1 = add_nav(nav, apiProject.footer.content, nav.length); // Add level 1 and 2 titles
+        if (!found_level1 && apiProject.footer.title != null) {    // If no Level 1 tags were found, make a title
+            nav.splice(last_nav_index, 0, {
+                group: '_footer',
+                isHeader: true,
+                title: apiProject.footer.title,
+                isFixed: true
+            });
+        }
     }
 
     // render pagetitle
@@ -348,8 +403,7 @@ require([
     function _hasTypeInFields(fields) {
         var result = false;
         $.each(fields, function(name) {
-            if (_.any(fields[name], function(item) { return item.type; }) )
-                result = true;
+            result = result || _.some(fields[name], function(item) { return item.type; });
         });
         return result;
     }
@@ -358,13 +412,10 @@ require([
      * On Template changes, recall plugins.
      */
     function initDynamic() {
-        // bootstrap popover
-        $('a[data-toggle=popover]')
-            .popover()
-            .click(function(e) {
-                e.preventDefault();
-            })
-        ;
+        // Bootstrap popover
+        $('button[data-toggle="popover"]').popover().click(function(e) {
+            e.preventDefault();
+        });
 
         var version = $('#version strong').html();
         $('#sidenav li').removeClass('is-new');
@@ -424,7 +475,7 @@ require([
             var name = $(this).data('name');
             var version = $(this).data('version');
 
-            if (version <= selectedVersion) {
+            if (semver.lte(version, selectedVersion)) {
                 if ($('article[data-group=\'' + group + '\'][data-name=\'' + name + '\']:visible').length === 0) {
                     // enable Article
                     $('article[data-group=\'' + group + '\'][data-name=\'' + name + '\'][data-version=\'' + version + '\']').removeClass('hide');
@@ -435,7 +486,6 @@ require([
             }
         });
 
-
         // show 1st equal or lower Version of each entry
         $('article[data-version]').each(function(index) {
             var group = $(this).data('group');
@@ -474,6 +524,37 @@ require([
     }
 
     /**
+     * Initialize search
+     */
+    var options = {
+      valueNames: [ 'nav-list-item' ]
+    };
+    var endpointsList = new List('scrollingNav', options);
+
+    /**
+     * Set initial focus to search input
+     */
+    $('#scrollingNav .sidenav-search input.search').focus();
+
+    /**
+     * Detect ESC key to reset search
+     */
+    $(document).keyup(function(e) {
+      if (e.keyCode === 27) $('span.search-reset').click();
+    });
+
+    /**
+     * Search reset
+     */
+    $('span.search-reset').on('click', function() {
+      $('#scrollingNav .sidenav-search input.search')
+        .val("")
+        .focus()
+      ;
+      endpointsList.search();
+    });
+
+    /**
      * Change version of an article to compare it to an other version.
      */
     function changeVersionCompareTo(e) {

+ 17 - 0
public/kyydoc/utils/handlebars_helper.js

@@ -5,6 +5,23 @@ define([
 ], function(locale, Handlebars, DiffMatchPatch) {
 
     /**
+     * Return a text as markdown.
+     * Currently only a little helper to replace apidoc-inline Links (#Group:Name).
+     * Should be replaced with a full markdown lib.
+     * @param string text
+     */
+    Handlebars.registerHelper('markdown', function(text) {
+        if ( ! text ) {
+          return text;
+        }
+        text = text.replace(/((\[(.*?)\])?\(#)((.+?):(.+?))(\))/mg, function(match, p1, p2, p3, p4, p5, p6) {
+          var link = p3 || p5 + '/' + p6;
+          return '<a href="#api-' + p5 + '-' + p6 + '">' + link + '</a>';
+        });
+        return text;
+    });
+
+    /**
      * start/stop timer for simple performance check.
      */
     var timer;

+ 6 - 3
public/kyydoc/utils/send_sample_request.js

@@ -1,6 +1,7 @@
 define([
-  'jquery'
-], function($) {
+  'jquery',
+  'lodash'
+], function($, _) {
 
   var initDynamic = function() {
       // Button send
@@ -49,7 +50,9 @@ define([
       var paramType = {};
       $root.find(".sample-request-param:checked").each(function(i, element) {
           var group = $(element).data("sample-request-param-group-id");
-          $root.find("[data-sample-request-param-group=\"" + group + "\"]").each(function(i, element) {
+          $root.find("[data-sample-request-param-group=\"" + group + "\"]").not(function(){
+            return $(this).val() == "" && $(this).is("[data-sample-request-param-optional='true']");
+          }).each(function(i, element) {
             var key = $(element).data("sample-request-param-name");
             var value = element.value;
             if ( ! element.optional && element.defaultValue !== '') {

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 5 - 8
public/kyydoc/vendor/bootstrap.min.css


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 6 - 5
public/kyydoc/vendor/bootstrap.min.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 5 - 4
public/kyydoc/vendor/handlebars.min.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 4 - 4
public/kyydoc/vendor/jquery.min.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 2 - 0
public/kyydoc/vendor/list.min.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 41 - 0
public/kyydoc/vendor/lodash.custom.min.js


+ 50 - 54
public/kyydoc/vendor/polyfill.js

@@ -43,58 +43,54 @@ if (!Object.keys) {
 //Production steps of ECMA-262, Edition 5, 15.4.4.18
 //Reference: http://es5.github.com/#x15.4.4.18
 if (!Array.prototype.forEach) {
-
-Array.prototype.forEach = function (callback, thisArg) {
-
- var T, k;
-
- if (this == null) {
-   throw new TypeError(" this is null or not defined");
- }
-
- // 1. Let O be the result of calling ToObject passing the |this| value as the argument.
- var O = Object(this);
-
- // 2. Let lenValue be the result of calling the Get internal method of O with the argument "length".
- // 3. Let len be ToUint32(lenValue).
- var len = O.length >>> 0;
-
- // 4. If IsCallable(callback) is false, throw a TypeError exception.
- // See: http://es5.github.com/#x9.11
- if (typeof callback !== "function") {
-   throw new TypeError(callback + " is not a function");
- }
-
- // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.
- if (arguments.length > 1) {
-   T = thisArg;
- }
-
- // 6. Let k be 0
- k = 0;
-
- // 7. Repeat, while k < len
- while (k < len) {
-
-   var kValue;
-
-   // a. Let Pk be ToString(k).
-   //   This is implicit for LHS operands of the in operator
-   // b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk.
-   //   This step can be combined with c
-   // c. If kPresent is true, then
-   if (k in O) {
-
-     // i. Let kValue be the result of calling the Get internal method of O with argument Pk.
-     kValue = O[k];
-
-     // ii. Call the Call internal method of callback with T as the this value and
-     // argument list containing kValue, k, and O.
-     callback.call(T, kValue, k, O);
-   }
-   // d. Increase k by 1.
-   k++;
- }
- // 8. return undefined
-};
+  Array.prototype.forEach = function (callback, thisArg) {
+    var T, k;
+
+    if (this == null) {
+      throw new TypeError(' this is null or not defined');
+    }
+
+    // 1. Let O be the result of calling ToObject passing the |this| value as the argument.
+    var O = Object(this);
+
+    // 2. Let lenValue be the result of calling the Get internal method of O with the argument "length".
+    // 3. Let len be ToUint32(lenValue).
+    var len = O.length >>> 0;
+
+    // 4. If IsCallable(callback) is false, throw a TypeError exception.
+    // See: http://es5.github.com/#x9.11
+    if (typeof callback !== "function") {
+      throw new TypeError(callback + " is not a function");
+    }
+
+    // 5. If thisArg was supplied, let T be thisArg; else let T be undefined.
+    if (arguments.length > 1) {
+      T = thisArg;
+    }
+
+    // 6. Let k be 0
+    k = 0;
+
+    // 7. Repeat, while k < len
+    while (k < len) {
+      var kValue;
+
+      // a. Let Pk be ToString(k).
+      //   This is implicit for LHS operands of the in operator
+      // b. Let kPresent be the result of calling the HasProperty internal method of O with argument Pk.
+      //   This step can be combined with c
+      // c. If kPresent is true, then
+      if (k in O) {
+        // i. Let kValue be the result of calling the Get internal method of O with argument Pk.
+        kValue = O[k];
+
+        // ii. Call the Call internal method of callback with T as the this value and
+        // argument list containing kValue, k, and O.
+        callback.call(T, kValue, k, O);
+      }
+      // d. Increase k by 1.
+      k++;
+    }
+    // 8. return undefined
+  };
 }

+ 46 - 96
public/kyydoc/vendor/prettify.css

@@ -1,101 +1,51 @@
 /* Pretty printing styles. Used with prettify.js. */
 /* Vim sunburst theme by David Leibovic */
-pre .str {
-  color: #65B042;
-}
-/* string  - green */
-pre .kwd {
-  color: #E28964;
-}
-/* keyword - dark pink */
-pre .com {
-  color: #AEAEAE;
-  font-style: italic;
-}
-/* comment - gray */
-pre .typ {
-  color: #89bdff;
-}
-/* type - light blue */
-pre .lit {
-  color: #3387CC;
-}
-/* literal - blue */
-pre .pun {
-  color: #fff;
-}
-/* punctuation - white */
-pre .pln {
-  color: #fff;
-}
-/* plaintext - white */
-pre .tag {
-  color: #89bdff;
-}
-/* html/xml tag    - light blue */
-pre .atn {
-  color: #bdb76b;
-}
-/* html/xml attribute name  - khaki */
-pre .atv {
-  color: #65B042;
-}
-/* html/xml attribute value - green */
-pre .dec {
-  color: #3387CC;
-}
-/* decimal - blue */
+
+pre .str, code .str { color: #65B042; } /* string  - green */
+pre .kwd, code .kwd { color: #E28964; } /* keyword - dark pink */
+pre .com, code .com { color: #AEAEAE; font-style: italic; } /* comment - gray */
+pre .typ, code .typ { color: #89bdff; } /* type - light blue */
+pre .lit, code .lit { color: #3387CC; } /* literal - blue */
+pre .pun, code .pun { color: #fff; } /* punctuation - white */
+pre .pln, code .pln { color: #fff; } /* plaintext - white */
+pre .tag, code .tag { color: #89bdff; } /* html/xml tag    - light blue */
+pre .atn, code .atn { color: #bdb76b; } /* html/xml attribute name  - khaki */
+pre .atv, code .atv { color: #65B042; } /* html/xml attribute value - green */
+pre .dec, code .dec { color: #3387CC; } /* decimal - blue */
+
+pre.prettyprint, code.prettyprint {
+  background-color: #000;
+  -moz-border-radius: 8px;
+  -webkit-border-radius: 8px;
+  -o-border-radius: 8px;
+  -ms-border-radius: 8px;
+  -khtml-border-radius: 8px;
+  border-radius: 8px;
+}
+
+pre.prettyprint {
+  width: 95%;
+  margin: 1em auto;
+  padding: 1em;
+  white-space: pre-wrap;
+}
+
+
 /* Specify class=linenums on a pre to get line numbering */
-ol.linenums {
-  margin-top: 0;
-  margin-bottom: 0;
-  color: #AEAEAE;
-}
-/* IE indents via margin-left */
-li.L0,
-li.L1,
-li.L2,
-li.L3,
-li.L5,
-li.L6,
-li.L7,
-li.L8 {
-  list-style-type: none;
-}
+ol.linenums { margin-top: 0; margin-bottom: 0; color: #AEAEAE; } /* IE indents via margin-left */
+li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8 { list-style-type: none }
 /* Alternate shading for lines */
+li.L1,li.L3,li.L5,li.L7,li.L9 { }
+
 @media print {
-  pre .str {
-    color: #060;
-  }
-  pre .kwd {
-    color: #006;
-    font-weight: bold;
-  }
-  pre .com {
-    color: #600;
-    font-style: italic;
-  }
-  pre .typ {
-    color: #404;
-    font-weight: bold;
-  }
-  pre .lit {
-    color: #044;
-  }
-  pre .pun {
-    color: #440;
-  }
-  pre .pln {
-    color: #000;
-  }
-  pre .tag {
-    color: #006;
-    font-weight: bold;
-  }
-  pre .atn {
-    color: #404;
-  }
-  pre .atv {
-    color: #060;
-  }
-}
+  pre .str, code .str { color: #060; }
+  pre .kwd, code .kwd { color: #006; font-weight: bold; }
+  pre .com, code .com { color: #600; font-style: italic; }
+  pre .typ, code .typ { color: #404; font-weight: bold; }
+  pre .lit, code .lit { color: #044; }
+  pre .pun, code .pun { color: #440; }
+  pre .pln, code .pln { color: #000; }
+  pre .tag, code .tag { color: #006; font-weight: bold; }
+  pre .atn, code .atn { color: #404; }
+  pre .atv, code .atv { color: #060; }
+}

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 18 - 0
public/kyydoc/vendor/prettify/lang-Splus.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 18 - 0
public/kyydoc/vendor/prettify/lang-aea.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 18 - 0
public/kyydoc/vendor/prettify/lang-agc.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 18 - 2
public/kyydoc/vendor/prettify/lang-apollo.js


+ 18 - 3
public/kyydoc/vendor/prettify/lang-basic.js

@@ -1,3 +1,18 @@
-var a=null;
-PR.registerLangHandler(PR.createSimpleLexer([["str",/^"(?:[^\n\r"\\]|\\.)*(?:"|$)/,a,'"'],["pln",/^\s+/,a," \r\n\t\u00a0"]],[["com",/^REM[^\n\r]*/,a],["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/,a],["pln",/^[a-z][^\W_]?(?:\$|%)?/i,a],["lit",/^(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?/i,a,"0123456789"],["pun",
-/^.[^\s\w"$%.]*/,a]]),["basic","cbm"]);
+/*
+
+ Copyright (C) 2013 Peter Kofler
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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,
+null,"0123456789"],["pun",/^.[^\s\w\.$%"]*/,null]]),["basic","cbm"]);

+ 18 - 0
public/kyydoc/vendor/prettify/lang-cbm.js

@@ -0,0 +1,18 @@
+/*
+
+ Copyright (C) 2013 Peter Kofler
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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,
+null,"0123456789"],["pun",/^.[^\s\w\.$%"]*/,null]]),["basic","cbm"]);

+ 18 - 0
public/kyydoc/vendor/prettify/lang-cl.js

@@ -0,0 +1,18 @@
+/*
+
+ Copyright (C) 2008 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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/,
+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(" "));

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 3 - 4
public/kyydoc/vendor/prettify/lang-clj.js


+ 18 - 2
public/kyydoc/vendor/prettify/lang-css.js

@@ -1,2 +1,18 @@
-PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\f\r ]+/,null," \t\r\n\u000c"]],[["str",/^"(?:[^\n\f\r"\\]|\\(?:\r\n?|\n|\f)|\\[\S\s])*"/,null],["str",/^'(?:[^\n\f\r'\\]|\\(?:\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]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*)\s*:/i],["com",/^\/\*[^*]*\*+(?:[^*/][^*]*\*+)*\//],
-["com",/^(?:<\!--|--\>)/],["lit",/^(?:\d+|\d*\.\d+)(?:%|[a-z]+)?/i],["lit",/^#[\da-f]{3,6}\b/i],["pln",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i],["pun",/^[^\s\w"']+/]]),["css"]);PR.registerLangHandler(PR.createSimpleLexer([],[["kwd",/^-?(?:[_a-z]|\\[\da-f]+ ?)(?:[\w-]|\\\\[\da-f]+ ?)*/i]]),["css-kw"]);PR.registerLangHandler(PR.createSimpleLexer([],[["str",/^[^"')]+/]]),["css-str"]);
+/*
+
+ Copyright (C) 2009 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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",/^\/\*[^*]*\*+(?:[^\/*][^*]*\*+)*\//],
+["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"]);

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 19 - 3
public/kyydoc/vendor/prettify/lang-dart.js


+ 18 - 0
public/kyydoc/vendor/prettify/lang-el.js

@@ -0,0 +1,18 @@
+/*
+
+ Copyright (C) 2008 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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/,
+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(" "));

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 18 - 0
public/kyydoc/vendor/prettify/lang-erl.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 18 - 2
public/kyydoc/vendor/prettify/lang-erlang.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 18 - 0
public/kyydoc/vendor/prettify/lang-fs.js


+ 17 - 1
public/kyydoc/vendor/prettify/lang-go.js

@@ -1 +1,17 @@
-PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["pln",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])+(?:'|$)|`[^`]*(?:`|$))/,null,"\"'"]],[["com",/^(?:\/\/[^\n\r]*|\/\*[\S\s]*?\*\/)/],["pln",/^(?:[^"'/`]|\/(?![*/]))+/]]),["go"]);
+/*
+
+ Copyright (C) 2010 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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"]);

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 18 - 2
public/kyydoc/vendor/prettify/lang-hs.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 19 - 0
public/kyydoc/vendor/prettify/lang-lasso.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 19 - 0
public/kyydoc/vendor/prettify/lang-lassoscript.js


+ 17 - 0
public/kyydoc/vendor/prettify/lang-latex.js

@@ -0,0 +1,17 @@
+/*
+
+ Copyright (C) 2011 Martin S.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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"]);

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 18 - 0
public/kyydoc/vendor/prettify/lang-lgt.js


+ 18 - 3
public/kyydoc/vendor/prettify/lang-lisp.js

@@ -1,3 +1,18 @@
-var a=null;
-PR.registerLangHandler(PR.createSimpleLexer([["opn",/^\(+/,a,"("],["clo",/^\)+/,a,")"],["com",/^;[^\n\r]*/,a,";"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["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/,a],
-["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["cl","el","lisp","lsp","scm","ss","rkt"]);
+/*
+
+ Copyright (C) 2008 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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/,
+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(" "));

+ 17 - 0
public/kyydoc/vendor/prettify/lang-ll.js

@@ -0,0 +1,17 @@
+/*
+
+ Copyright (C) 2013 Nikhil Dabas
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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"]);

+ 17 - 1
public/kyydoc/vendor/prettify/lang-llvm.js

@@ -1 +1,17 @@
-PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^!?"(?:[^"\\]|\\[\S\s])*(?:"|$)/,null,'"'],["com",/^;[^\n\r]*/,null,";"]],[["pln",/^[!%@](?:[$\-.A-Z_a-z][\w$\-.]*|\d+)/],["kwd",/^[^\W\d]\w*/,null],["lit",/^\d+\.\d+/],["lit",/^(?:\d+|0[Xx][\dA-Fa-f]+)/],["pun",/^[(-*,:<->[\]{}]|\.\.\.$/]]),["llvm","ll"]);
+/*
+
+ Copyright (C) 2013 Nikhil Dabas
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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"]);

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 18 - 0
public/kyydoc/vendor/prettify/lang-logtalk.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 19 - 0
public/kyydoc/vendor/prettify/lang-ls.js


+ 18 - 0
public/kyydoc/vendor/prettify/lang-lsp.js

@@ -0,0 +1,18 @@
+/*
+
+ Copyright (C) 2008 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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/,
+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(" "));

+ 18 - 2
public/kyydoc/vendor/prettify/lang-lua.js

@@ -1,2 +1,18 @@
-PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["str",/^(?:"(?:[^"\\]|\\[\S\s])*(?:"|$)|'(?:[^'\\]|\\[\S\s])*(?:'|$))/,null,"\"'"]],[["com",/^--(?:\[(=*)\[[\S\s]*?(?:]\1]|$)|[^\n\r]*)/],["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],
-["pln",/^[_a-z]\w*/i],["pun",/^[^\w\t\n\r \xa0][^\w\t\n\r "'+=\xa0-]*/]]),["lua"]);
+/*
+
+ Copyright (C) 2008 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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],
+["pln",/^[a-z_]\w*/i],["pun",/^[^\w\t\n\r \xA0][^\w\t\n\r \xA0\"\'\-\+=]*/]]),["lua"]);

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 29 - 6
public/kyydoc/vendor/prettify/lang-matlab.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 18 - 2
public/kyydoc/vendor/prettify/lang-ml.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 18 - 2
public/kyydoc/vendor/prettify/lang-mumps.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 19 - 4
public/kyydoc/vendor/prettify/lang-n.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 19 - 0
public/kyydoc/vendor/prettify/lang-nemerle.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 18 - 3
public/kyydoc/vendor/prettify/lang-pascal.js


+ 16 - 0
public/kyydoc/vendor/prettify/lang-proto.js

@@ -1 +1,17 @@
+/*
+
+ Copyright (C) 2006 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
 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"]);

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 18 - 2
public/kyydoc/vendor/prettify/lang-r.js


+ 17 - 1
public/kyydoc/vendor/prettify/lang-rd.js

@@ -1 +1,17 @@
-PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\n\r]*/,null,"%"]],[["lit",/^\\(?:cr|l?dots|R|tab)\b/],["kwd",/^\\[@-Za-z]+/],["kwd",/^#(?:ifn?def|endif)/],["pln",/^\\[{}]/],["pun",/^[()[\]{}]+/]]),["Rd","rd"]);
+/*
+
+ Copyright (C) 2012 Jeffrey Arnold
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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 - 0
public/kyydoc/vendor/prettify/lang-rkt.js

@@ -0,0 +1,18 @@
+/*
+
+ Copyright (C) 2008 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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/,
+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(" "));

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 20 - 0
public/kyydoc/vendor/prettify/lang-rust.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 18 - 0
public/kyydoc/vendor/prettify/lang-s.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 18 - 2
public/kyydoc/vendor/prettify/lang-scala.js


+ 18 - 0
public/kyydoc/vendor/prettify/lang-scm.js

@@ -0,0 +1,18 @@
+/*
+
+ Copyright (C) 2008 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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/,
+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(" "));

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 18 - 2
public/kyydoc/vendor/prettify/lang-sql.js


+ 18 - 0
public/kyydoc/vendor/prettify/lang-ss.js

@@ -0,0 +1,18 @@
+/*
+
+ Copyright (C) 2008 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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/,
+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(" "));

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 16 - 0
public/kyydoc/vendor/prettify/lang-swift.js


+ 18 - 3
public/kyydoc/vendor/prettify/lang-tcl.js

@@ -1,3 +1,18 @@
-var a=null;
-PR.registerLangHandler(PR.createSimpleLexer([["opn",/^{+/,a,"{"],["clo",/^}+/,a,"}"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^[\t\n\r \xa0]+/,a,"\t\n\r \u00a0"],["str",/^"(?:[^"\\]|\\[\S\s])*(?:"|$)/,a,'"']],[["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/,a],["lit",/^[+-]?(?:[#0]x[\da-f]+|\d+\/\d+|(?:\.\d+|\d+(?:\.\d*)?)(?:[de][+-]?\d+)?)/i],["lit",
-/^'(?:-*(?:\w|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?)?/],["pln",/^-*(?:[_a-z]|\\[!-~])(?:[\w-]*|\\[!-~])[!=?]?/i],["pun",/^[^\w\t\n\r "'-);\\\xa0]+/]]),["tcl"]);
+/*
+
+ Copyright (C) 2012 Pyrios
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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],
+["lit",/^\'(?:-*(?:\w|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?)?/],["pln",/^-*(?:[a-z_]|\\[\x21-\x7e])(?:[\w-]*|\\[\x21-\x7e])[=!?]?/i],["pun",/^[^\w\t\n\r \xA0()\"\\\';]+/]]),["tcl"]);

+ 17 - 1
public/kyydoc/vendor/prettify/lang-tex.js

@@ -1 +1,17 @@
-PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\t\n\r \xa0]+/,null,"\t\n\r \u00a0"],["com",/^%[^\n\r]*/,null,"%"]],[["kwd",/^\\[@-Za-z]+/],["kwd",/^\\./],["typ",/^[$&]/],["lit",/[+-]?(?:\.\d+|\d+(?:\.\d*)?)(cm|em|ex|in|pc|pt|bp|mm)/i],["pun",/^[()=[\]{}]+/]]),["latex","tex"]);
+/*
+
+ Copyright (C) 2011 Martin S.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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"]);

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 19 - 2
public/kyydoc/vendor/prettify/lang-vb.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 19 - 0
public/kyydoc/vendor/prettify/lang-vbs.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 19 - 0
public/kyydoc/vendor/prettify/lang-vhd.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 19 - 3
public/kyydoc/vendor/prettify/lang-vhdl.js


+ 17 - 1
public/kyydoc/vendor/prettify/lang-wiki.js

@@ -1,2 +1,18 @@
-PR.registerLangHandler(PR.createSimpleLexer([["pln",/^[\d\t a-gi-z\xa0]+/,null,"\t \u00a0abcdefgijklmnopqrstuvwxyz0123456789"],["pun",/^[*=[\]^~]+/,null,"=*~^[]"]],[["lang-wiki.meta",/(?:^^|\r\n?|\n)(#[a-z]+)\b/],["lit",/^[A-Z][a-z][\da-z]+[A-Z][a-z][^\W_]+\b/],["lang-",/^{{{([\S\s]+?)}}}/],["lang-",/^`([^\n\r`]+)`/],["str",/^https?:\/\/[^\s#/?]*(?:\/[^\s#?]*)?(?:\?[^\s#]*)?(?:#\S*)?/i],["pln",/^(?:\r\n|[\S\s])[^\n\r#*=A-[^`h{~]*/]]),["wiki"]);
+/*
+
+ Copyright (C) 2009 Google Inc.
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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"]);
 PR.registerLangHandler(PR.createSimpleLexer([["kwd",/^#[a-z]+/i,null,"#"]],[]),["wiki.meta"]);

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 18 - 2
public/kyydoc/vendor/prettify/lang-xq.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 19 - 0
public/kyydoc/vendor/prettify/lang-xquery.js


+ 18 - 2
public/kyydoc/vendor/prettify/lang-yaml.js

@@ -1,2 +1,18 @@
-var a=null;
-PR.registerLangHandler(PR.createSimpleLexer([["pun",/^[:>?|]+/,a,":|>?"],["dec",/^%(?:YAML|TAG)[^\n\r#]+/,a,"%"],["typ",/^&\S+/,a,"&"],["typ",/^!\S*/,a,"!"],["str",/^"(?:[^"\\]|\\.)*(?:"|$)/,a,'"'],["str",/^'(?:[^']|'')*(?:'|$)/,a,"'"],["com",/^#[^\n\r]*/,a,"#"],["pln",/^\s+/,a," \t\r\n"]],[["dec",/^(?:---|\.\.\.)(?:[\n\r]|$)/],["pun",/^-/],["kwd",/^\w+:[\n\r ]/],["pln",/^\w+/]]),["yaml","yml"]);
+/*
+
+ Copyright (C) 2015 ribrdb @ code.google.com
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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",
+/^\w+/]]),["yaml","yml"]);

+ 18 - 0
public/kyydoc/vendor/prettify/lang-yml.js

@@ -0,0 +1,18 @@
+/*
+
+ Copyright (C) 2015 ribrdb @ code.google.com
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+    http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+*/
+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",
+/^\w+/]]),["yaml","yml"]);

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 46 - 30
public/kyydoc/vendor/prettify/prettify.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 63 - 34
public/kyydoc/vendor/prettify/run_prettify.js


Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 32 - 31
public/kyydoc/vendor/require.min.js