shipfi@thinkpad

AllProjects

Showing 54 changed files with 6966 additions and 0 deletions
# ECMAScript 6 语法
### 1.let 命令
##### 代码作用域
ES6新增 **let** 命令,用来声明变量,用法类似于 **var**
但其声明的变量,只在let命令所在的代码块有效。
```
{
let a = 10;
var b = 1;
}
a // ReferenceError: a is not defined.
b // 1
```
for循环的计数器,就很合适使用let命令。
```
for (let i = 0; i < arr.length; i++) {}
console.log(i); //ReferenceError: i is not defined
```
##### 不存在变量提升
let不像var那样会发生“变量提升”现象。所以,变量一定要在声明后使用,否则报错。
```
console.log(foo); // 输出undefined
console.log(bar); // 报错ReferenceError
var foo = 2;
let bar = 2;
```
##### 不允许重复声明
let不允许在相同作用域内,重复声明同一个变量。
```
// 报错
function () {
let a = 10;
var a = 1;
}
```
---
### 2.const命令
const 声明一个只读的常量。一旦声明,常量的值就不能改变。
```
'use strict';
const PI = 3.1415;
PI // 3.1415
PI = 3; // TypeError: "PI" is read-only
```
---
### 3.数组解构赋值
[参考链接](http://es6.ruanyifeng.com/#docs/destructuring)
ES6允许以下方式赋值变量
`var [a, b, c] = [1, 2, 3];`
##### 嵌套解构
下面是一些使用嵌套数组进行解构的例子。
```
let [foo, [[bar], baz]] = [1, [[2], 3]];
let [ , , third] = ["foo", "bar", "baz"];
let [x, , y] = [1, 2, 3];
x // 1
y // 3
let [head, ...tail] = [1, 2, 3, 4];
head // 1
tail // [2, 3, 4]
```
##### 解析缺少
如果解构不成功,变量的值就等于undefined。
```
var [foo] = [];
var [bar, foo] = [1];
// 以上两种情况都属于解构不成功,foo的值都会等于undefined。
```
##### 不完全解析
等号左边的模式,只匹配一部分的等号右边的数组。这种情况下,解构依然可以成功。
```
let [x, y] = [1, 2, 3];
x // 1
y // 2
let [a, [b], d] = [1, [2, 3], 4];
a // 1
b // 2
d // 4
```
---
### 4. 对象的解构赋值
解构不仅可以用于数组,还可以用于对象。
```
var { foo, bar } = { foo: "aaa", bar: "bbb" };
foo // "aaa" ; bar // "bbb"
```
对象的解构与数组有一个重要的不同。数组的元素是按次序排列的,变量的取值由它的位置决定;而 **对象的属性没有次序,变量必须与属性同名**,才能取到正确的值。
```
var { bar, foo } = { foo: "aaa", bar: "bbb" };
foo // "aaa"
bar // "bbb"
```
如果变量名与属性名不一致,必须写成下面这样。
```
var { foo: baz } = { foo: "aaa", bar: "bbb" };
baz // "aaa"
```
这实际上说明, **对象的解构赋值是下面形式的简写**
对象的解构赋值的内部机制,是先找到同名属性,然后再赋给对应的变量。真正被赋值的是后者,而不是前者。
`var { foo: foo, bar: bar } = { foo: "aaa", bar: "bbb" };`
---
### 5. 字符串的解构赋值
字符串也可以解构赋值。这是因为此时,字符串被转换成了一个类似数组的对象。
```
const [a, b, c, d, e] = 'hello';
a // "h"
b // "e"
c // "l"
d // "l"
e // "o"
```
# NPM 使用帮助
### 1.使用npm其它源
可以使用nrm工具,具体链接参考:
[nrm](https://github.com/Pana/nrm)
```
npm install -g nrm
nrm use rednpm
```
### 2.npm 安装库到devDependencies和dependencies
devDependencies是开发时所需要用的库
dependencies 是开发和运行都需要运行的库
> devDependencies
`npm i npm_module -D || npm install npm_module --save-dev`
> dependencies
`npm i npm_module -S || npm install npm_module --save`
### 3. 查看npm配置
`$ npm config list -l`
### 4. 设置环境变量。
```
$ npm set init-author-name 'Your name'
$ npm set init-author-email 'Your email'
$ npm set init-author-url 'http://yourdomain.com'
$ npm set init-license 'MIT'
```
### 5. 查看已安装模块
> 列出当前项目安装的所有模块及全局模块
`npm list | npm list --global`
\ No newline at end of file
# 前端组件化的一些学习资料
### 前端整体
>[Vue+ES6+Jade+Scss+Webpack+Gulp 编程](https://segmentfault.com/a/1190000005115926)
>[2016年后Web 开发趋势是什么](http://yafeilee.me/blogs/86)
>[AlloyTeam腾讯全端Blog](http://www.alloyteam.com/)
>[前端开发者手册](https://dwqs.gitbooks.io/frontenddevhandbook/content/)
>[CommonJS规范](http://www.feeldesignstudio.com/2013/09/javascript-module-pattern-commonjs/)
>[浅淡Javascript模块化编程](https://segmentfault.com/a/1190000000492678)
---
## ECMAScript6
>[-- ES6初探](https://github.com/shipfi/es6features)
>[-- ES6相关学习资源](https://segmentfault.com/a/1190000003739409)
>[-- ECMAScript6入门-阮一峰](http://es6.ruanyifeng.com/#docs/intro)
>[-- ECMAScript6入门-木头人](http://www.hubwiz.com/course/5594e91ac086935f4a6fb8ef/)
>[-- ES6 in depth](https://hacks.mozilla.org/category/es6-in-depth/)
+
----
### Webpackt篇
+ 说明:
>[-- Webpack Doc中文](https://github.com/liunian/webpack-doc/blob/master/SUMMARY.md)
>[-- Webpack入门指南](http://www.cnblogs.com/vajoy/p/4650467.html#!/follow)
>[-- Webpack入门指南2](https://segmentfault.com/a/1190000002551952)
>[-- Webpack怎么用](https://segmentfault.com/a/1190000002552008)
>[-- webpack中文指南](http://zhaoda.net/webpack-handbook/index.html)
>[-- webpack傻瓜式指南****](https://github.com/vikingmute/webpack-for-fools)
>[-- webpack loader](http://guowenfh.github.io/2016/03/24/vue-webpack-02-deploy/)
>[-- webpack 使用](http://fakefish.github.io/react-webpack-cookbook/index.html)
+ Webpack 套件 (可通过npm安装)
>[-- 一个webpack插件,用于打包css资源文件](https://github.com/webpack/extract-text-webpack-plugin)
>[-- css-loader,style-loader](https://github.com/liunian/webpack-doc/blob/master/tutorials/getting-started/index.md)
```
css-loader 是处理css文件中的url()等
style-loader 将css插入到页面的style标签
less-loader 是将less文件编译成css
sass-loader 是将sass文件编译成css
```
+ 示例:
>[-- webpack_JS_CSS数据打包及对生产环境html模板的生成](https://github.com/qianjiahao/webpack-babel-react-development-tools)
>[-- webpack Samples](https://github.com/ruanyf/webpack-demos)
>[-- Webpack+React+ES6开发模式入门](http://www.cnblogs.com/skylar/p/React-Webpack-ES6.html)
---
### Vue篇
+ 实践
>[-- Vue组件化开放实践](http://gold.xitu.io/entry/55f77eb460b28e6a6f0f4f86)
>[-- Webpack + vue-loader入坑之旅](https://segmentfault.com/a/1190000004690338)
>[-- Vue + webpack 项目实践](http://ju.outofmemory.cn/entry/195573)
+ 组件篇
> [Vue-Router](https://github.com/vuejs/vue-router)
> 官方Vue Router
> [flatiron/director](https://github.com/flatiron/director)
> a tiny and isomorphic URL router for JavaScript
> [vuejs/vue-resource](https://github.com/vuejs/vue-resource)
> 网络请求库
> [vuejs/vue-validator](https://github.com/vuejs/vue-validator)
> 表单验证库
> [vuejs/vue-touch] (https://github.com/vuejs/vue-touch)
> 事件模拟
+ Github示例
>[-- vuejs/vue-webpack-example](https://github.com/vuejs/vue-webpack-example/blob/master/package.json)
>[-- Vue官方Examples](https://github.com/vuejs/vue/tree/dev/examples)
>[-- Vuewjs-templates/webpack](https://github.com/vuejs-templates/webpack/tree/dist/template)
>A full-featured Webpack + vue-loader setup with hot reload, linting, testing & css extraction.
>[-- Just Vue](https://github.com/JustClear/just-vue)
> A quick starter for Vue and Webpack
---
### Gulp篇
---
### Jade篇
>[Jade —— 源于 Node.js 的 HTML 模板引擎](https://segmentfault.com/a/1190000000357534)
>[Jade Document](http://naltatis.github.io/jade-syntax-docs/)
---
### 其它工具篇
>[-- Mobile Web Developer Tool:AlloyLever](http://www.alloyteam.com/2016/05/mobile-web-development-debugging-tools-alloylever-introduced/)
---
### Javascript 语言篇
>[-- 从作用域链谈闭包](http://www.ido321.com/1641.html)
闭包是指有权访问另外一个函数作用域中的变量的函数
---
### Nodejs篇
>[Nodejs资源汇总](https://www.douban.com/group/topic/35067110/)
>[Nodejs手册文档](http://nodeapi.ucdok.com/#/api/)
##### QA
>[nodejs中exports与module.exports的区别](http://www.cnblogs.com/pigtail/archive/2013/01/14/2859555.html)
### NPM
> [npm源](https://github.com/Pana/nrm)
> 使用nrm工具来切换npm源
# Webpack QA
### ReferenceError: webpackJsonp is not defined #606
[Linke](https://github.com/webpack/webpack/issues/606)
### Webpack 使用Bower
[Link](http://webpack.github.io/docs/usage-with-bower.html)
\ No newline at end of file
# Laravel中的User模型
分析在laravel中的User Model,会发现一些很有意思的事情
+ **User模型**
```
use Illuminate\Auth\Authenticatable;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Auth\Passwords\CanResetPassword;
use Illuminate\Contracts\Auth\Authenticatable as AuthenticatableContract;
use Illuminate\Contracts\Auth\CanResetPassword as CanResetPasswordContract;
// 实现了AuthenticatableContract,CanResetPasswordContract
// 但是在模型类中不实现,只是
// 通过trait class = (Authenticatable,CanResetPassword)实现。
class User extends Model
implements AuthenticatableContract, CanResetPasswordContract
{
use Authenticatable, CanResetPassword;
/**
* The database table used by the model.
*
* @var string
*/
protected $table = 'users';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = ['name', 'email', 'password'];
/**
* The attributes excluded from the model's JSON form.
*
* @var array
*/
protected $hidden = ['password', 'remember_token'];
}
```
+ **AuthenticatableContract接口定义**
```
namespace Illuminate\Contracts\Auth;
// 约定,namespace带有Contracts的,表示接口
interface Authenticatable {
/**
* Get the unique identifier for the user.
*
* @return mixed
*/
public function getAuthIdentifier();
/**
* Get the password for the user.
*
* @return string
*/
public function getAuthPassword();
/**
* Get the token value for the "remember me" session.
*
* @return string
*/
public function getRememberToken();
/**
* Set the token value for the "remember me" session.
*
* @param string $value
* @return void
*/
public function setRememberToken($value);
/**
* Get the column name for the "remember me" token.
*
* @return string
*/
public function getRememberTokenName();
}
```
+ **Authenticatable的实现**
```
namespace Illuminate\Auth;
trait Authenticatable {
/**
* Get the unique identifier for the user.
*
* @return mixed
*/
public function getAuthIdentifier()
{
return $this->getKey();
}
/**
* Get the password for the user.
*
* @return string
*/
public function getAuthPassword()
{
return $this->password;
}
/**
* Get the token value for the "remember me" session.
*
* @return string
*/
public function getRememberToken()
{
return $this->{$this->getRememberTokenName()};
}
/**
* Set the token value for the "remember me" session.
*
* @param string $value
* @return void
*/
public function setRememberToken($value)
{
// 用这样的方式很灵活....
$this->{$this->getRememberTokenName()} = $value;
}
/**
* Get the column name for the "remember me" token.
*
* @return string
*/
public function getRememberTokenName()
{
return 'remember_token';
}
}
```
\ No newline at end of file
# Laravel & Lumen 中整体配置的说明
### 1. Lumen使用自定义的配置文件
在laravel当中,默认是存在config文件夹,按照规则,相应的库需要配置文件,都是在config中以独立的一个php config文件存在的。
而在Lumen当中,是没有config文件夹,配置文件统一放到.env文件中。
- 以下是Laravel中使用的结构文件:
![Alt text](../imgs/laravel_st1.png)
- 以下是Lumen中使用的文件结构
![Alt text](../imgs/lumen_st1.png)
如果在Lumen当中需要启用config文件夹,并且按库去设定相应的配置文件。那么就需要以下两个步骤:
1. 在项目根目录中,建立config文件夹
2. 创建相应的.php配置文件,这些配置文件返回的是一个key=>value组成的数组结构
3. 在bootstrap/app.php中指定使用相应的配置文件,但是有一个config/database.php配置文件不需要configure指定,就可以默认加载。
```
$app->configure('api');
$app->configure('jwt');
$app->configure('auth');
```
---
### 2. 入口文件、启动文件和配置文件
[参考链接](https://segmentfault.com/a/1190000002902055)
应用程序的入口文件是:
/index.php ==> /public/index.php ==> /bootstrap/app.php
应用程序最基本的启动是:
- public/index.php
`$app = require(bootstrap/app.php)`
- bootstrap/app.php
```
Dotenv\Dotenv(__DIR__.'/../'))->load(); // load env
$app = new Laravel/Lumen/Application();
// 如果是Laravel,则是 new Illuminate/Foundation/Application
// Register Singleton Container Bindings
$app->singleton(...);
// Register Middleware
$app->middleware(...);
$app->routeMiddleware(...);
// Register Service Provider
$app->register(...);
// 加载路由
require app/Http/routes.php
```
- router定义
```
$app->get('/', function () use ($app) {
return $app->version();
});
```
- 程序运行(public/index.php)
`$app->run();`
Lumen的配置文件是根目录下的.env文件,.env文件的载入是bootstrap/app.php中的一行代码:
`new Dotenv\Dotenv(__DIR__.'/../'))->load()`
---
### 3. Facades
>Facades 提供一个静态接口给在应用程序的服务容器中可以取用的类
在配置文件中,有一个`$app->withFacades();`是表示启用Facades.
启用和不启用的区域在于:
- 启用前:
```
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\DB;
Cache::put('key', 'value', $minutes);
DB::getQueryLog();
```
- 启用后
```
use Cache;
use DB;
Cache::put('key', 'value', $minutes);
DB::getQueryLog();
```
通过查看withFacades,可以看出玄机:
```
public function withFacades()
{
Facade::setFacadeApplication($this);
if (! static::$aliasesRegistered) {
static::$aliasesRegistered = true;
class_alias('Illuminate\Support\Facades\App', 'App');
class_alias('Illuminate\Support\Facades\Auth', 'Auth');
class_alias('Illuminate\Support\Facades\Bus', 'Bus');
class_alias('Illuminate\Support\Facades\DB', 'DB');
class_alias('Illuminate\Support\Facades\Cache', 'Cache');
class_alias('Illuminate\Support\Facades\Cookie', 'Cookie');
class_alias('Illuminate\Support\Facades\Crypt', 'Crypt');
class_alias('Illuminate\Support\Facades\Event', 'Event');
class_alias('Illuminate\Support\Facades\Hash', 'Hash');
class_alias('Illuminate\Support\Facades\Log', 'Log');
class_alias('Illuminate\Support\Facades\Mail', 'Mail');
class_alias('Illuminate\Support\Facades\Queue', 'Queue');
class_alias('Illuminate\Support\Facades\Request', 'Request');
class_alias('Illuminate\Support\Facades\Schema', 'Schema');
class_alias('Illuminate\Support\Facades\Session', 'Session');
class_alias('Illuminate\Support\Facades\Storage', 'Storage');
class_alias('Illuminate\Support\Facades\Validator', 'Validator');
}
}
```
---
### 4. Session
Session 默认未开启。
开启方式:去掉 bootstrap/app.php 中 $app->middleware(); 的 StartSession中间件的注释。
在 .env 文件中,Session 的默认驱动是:memcached。
目前支持的驱动有:file、cookie、database、memcached、redis、array
[Session参考](http://lumen.laravel-china.org/docs/session#session-drivers)
### 5. Laravel的一些package
[参考](https://segmentfault.com/a/1190000002889864)
# 一些Laravel中的代码说明
### 1.在Controller中函数参数使用Request
首先需要引用Illuminate\Http\Request命名空间,才能使用$request变量
```
use Illuminate\Http\Request
use dump;
class ProjectController extends Controller
{
public function index(Request $request) {
dump($request);
}
}
```
也可以在bootstrap/app.php中使用class_alias将Illuminate\Http\Request定义为Request.
```
// in bootstrap/app.php
class_alias('Illuminate\Http\Request','Request');
// in controller.php
use Request;
public function index(Request $request) {...}
```
---
### 2.Request操作
>[参考链接](http://laravel-china.org/docs/5.1/requests)
+ 验证
```
$this->validate($request, [
'email' => 'required|email|max:255',
'password' => 'required',
]);
```
+ 获得请求字段
```
- 方式1:
$order_state = Request::input('order_state');
$evaluation_state = Request::input('evaluation_state');
$orderId = $request->input('order_id',1);
- 方式2:
$request->only('email', 'password');
```
---
### 3.Response操作
Response默认使用的类为 `Illuminate\Http\Response`
当然,也可以实现一个自定义的Response,作为ServiceProvider,注册到容器中。
具体自定义Response,可以查看Lumen-Api这本书。
>[Response文档](http://laravel-china.org/docs/5.1/responses)
>[Response详细API](http://laravel-china.org/api/master/Illuminate/Http/Response.html)
+ **基本响应**
```
return (new Response($content, $status))
->header('Content-Type', $value);
return response($content, $status)
->header('Content-Type', $value);
```
+ **标头定义响应**
```
return response($content)
->header('Content-Type', $type)
->header('X-Header-One', 'Header Value')
->header('X-Header-Two', 'Header Value');
```
+ **附加Cookies**
```
return response($content)->header('Content-Type', $type)
->withCookie('name', 'value');
- Cookie的可定义属性
->withCookie($name, $value, $minutes, $path, $domain, $secure, $httpOnly)
```
+ **视图响应**
```
return response()->view('hello', $data)->header('Content-Type', $type);
```
+ **JSON响应**
```
return response()->json(['name' => 'Abigail', 'state' => 'CA']);
- JSONP 响应
return response()->json(['name' => 'Abigail', 'state' => 'CA'])
->setCallback($request->input('callback'));
```
+ **文件下载**
```
return response()->download($pathToFile);
return response()->download($pathToFile, $name, $headers);
```
+ **重定向**
```
return redirect('home/dashboard');
// 重定向到某个位置
return back()->withInput();
// 重定向至命名路由
return redirect()->route('login');
// 重定向至路由,路由带有参数
return redirect()->route('profile', [1]);
return redirect()->route('profile', [$user]);
// 重定向至控制器行为
return redirect()->action('HomeController@index');
return redirect()->action('UserController@profile', [1]);
```
### 4.注册中间件(Middleware)
中间件的注册,在laravel和Lumen中的方式是不一样的。
+ 在Laravel中,通过app/Http/Kernal.php进行注册
```
protected $middleware = [
'Illuminate\Foundation\Http\Middleware\CheckForMaintenanceMode',
'Illuminate\Cookie\Middleware\EncryptCookies',
'Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse',
'Illuminate\Session\Middleware\StartSession',
'Illuminate\View\Middleware\ShareErrorsFromSession',
'App\Http\Middleware\VerifyCsrfToken',
];
protected $routeMiddleware = [
'auth' => 'App\Http\Middleware\Authenticate',
'auth.basic' => 'Illuminate\Auth\Middleware\AuthenticateWithBasicAuth',
'guest' => 'App\Http\Middleware\RedirectIfAuthenticated',
];
```
+ 而在Lumen中,则是通过bootstrap/app.php注册
```
$app->middleware([
App\Http\Middleware\ExampleMiddleware::class
]);
$app->routeMiddleware([
'auth' => App\Http\Middleware\Authenticate::class,
'jwt.auth' => Tymon\JWTAuth\Middleware\GetUserFromToken::class,
'jwt.refresh' => Tymon\JWTAuth\Middleware\RefreshToken::class,
]);
```
---
### 5. 服务提供者和服务容器
应用程序通过 bootstrap/app.php 文件中所生成的 Laravel 应用程序实例。
通过调用以下代码,创建应用程序Application的实例app,app中创建了服务容器(loadedProviders).
```
-- in bootstrap/app.php
$app = new Laravel\Lumen\Application()
-- in Application.php
protected $serviceProviders = array();
protected $loadedProviders = array();
protected $deferredServices = array();
...
$this->registerBaseBindings();
$this->registerBaseServiceProviders();
$this->registerCoreContainerAliases();
...
```
### 6.服务的注册(ServiceProvider)
ServiceProvider的注册,在Laravel和Lumen中情况不一样。
+ Laravel
> Laravel中的服务提供是,都在config/app.php配置文件的providers数组
```
'providers' => [
/*
* Laravel Framework Service Providers...
*/
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
'Illuminate\Auth\AuthServiceProvider',
'Illuminate\Bus\BusServiceProvider',
'Illuminate\Cache\CacheServiceProvider',
'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
'Illuminate\Routing\ControllerServiceProvider',
'App\Providers\AppServiceProvider',
'App\Providers\BusServiceProvider',
'App\Providers\ConfigServiceProvider',
...
];
```
+ Luemn
> Lumen中直接使用register进行注册
```
$app->register(Tymon\JWTAuth\Providers\JWTAuthServiceProvider::class);
// Dingo API Register
$app->register(Dingo\Api\Provider\LumenServiceProvider::class);
// $app->register(App\Providers\AuthServiceProvider::class);
$app->register(App\Providers\EventServiceProvider::class);
```
# Artisan命令行
## artisan提供的帮助
在Laravel&Lumen中,artisan命令行是一个非常重要的工具,平常使用到的有:
**artisan 命令帮助**
在命令行中,可以通过`php artisan`或者`php artisan list`来查看Artisan命令所支持的命令
命令前面加上help可以显示帮助界面:
`php artisan help migrate`
**参考:**
[artisan命令行](http://laravel-china.org/docs/5.1/artisan)
---
#### **1. make:migration**
> 生成数据库迁移命令,命令示例:
`php artisan make:migration create_some_table --table=table_name`
`php artisan make:migration add_column_to_table --table=table_name`
`php artisan make:migration alter_column_to_table --table=table_name`
> 以上命令是让框架在database/migrations目录下生成migration文件。文件格式如下:
`2016_04_21_143315_create_user_login.php`
> 通过编写生成的文件,我们可以控制数据库的结构和数据,相关示例:
文件中内容相关示例:
- 创建数据表
```
class CreateBrand extends Migration
{
public function up()
{
Schema::create('brand', function (Blueprint $table) {
$table->engine = 'InnoDB';
$table->increments('brand_id');
$table->string('app_id',30)->comment('集团联盟ID');
$table->string('brand_name',100)->comment('品牌名称');
$table->string('brand_pic',100)->comment('图片');
$table->timestamps();
});
}
public function down()
{
Schema::drop('brand');
}
}
```
- 修改数据字段
```
class RenameColumnForCart extends Migration
{
public function up()
{
Schema::table('cart_default', function (Blueprint $table) {
$table->renameColumn('spd_common_id', 'spd_detail_id');
});
}
public function down()
{
Schema::table('cart_default', function (Blueprint $table) {
});
}
}
```
- 添加数据字段
```
class AddCustomerIdColumnToBuyer extends Migration
{
public function up()
{
Schema::table('buyer', function (Blueprint $table) {
$table->string('customer_id')->after('buyer_id')->comment('会员ID,从CRM获得');
});
}
public function down()
{
Schema::table('buyer', function (Blueprint $table) {
$table->dropColumn('customer_id');
});
}
}
```
---
#### **2.migrate**
> 将make:migration所生成的数据库迁移文件反映到数据库中。
> 参考:[数据迁移](http://laravel-china.org/docs/5.1/migrations)
>相关命令:
- `php artisan migrate`
>对于这个命令,数据库中都会生成migration数据表,表中的数据行设置了哪些文件已经被迁移了.laravel只会对新的文件执行迁移动作(文件内定义的up函数),表中所记录的文件将不会被执行迁移动作。
当新的文件被执行完成后,这些文件将被记录到migration数据表中。
- `php artisan migrate:refresh`
> 对于这个命令,将会清除数据表migration数据,回滚所有迁移并重新运行所有迁移。
所谓回滚,就是先执行回滚动作(down()函数定义), 再执行迁移动作(up()函数定义)。
- `php artisan migrate:rollback`
> 回滚最后一次迁移
- `php artisan migrate:reset`
> 回滚所有迁移
- `php artisan migrate:refresh --seed`
> 回滚所有迁移并重新运行迁移,迁移后,执行database/seeds/DatabaSeeder进行数据表的数据填充
---
#### **3.db:seed**
> 依照database/seeds/目录下文件内容对数据库执行填充。
参考链接: [数据填充](http://laravel-china.org/docs/5.1/seeding)
数据填充Seeder,是使用 seed 类来给数据库填充测试数据。
一般在laravel中,填充测试数据有以下几种方式
**注意**
在Database/seeds/目录下创建一个数据填充文件后,需要通过以下命令注册到Laravel中,否则这个文件类不会被识别 :
`composer dump-autoload`
** 数据生成的命令 **
运行database/seeds/DatabaseSeeder.php执行数据填充
`php artisan db:seed`
指定database/seeds/目录下的某个类进行填充
`php artisan db:seed --clas=SomeSeederClass`
- 可以使用数据工厂来生成数据,数据工厂在database/factories目录内定义。
```
$factory->define(App\Models\AppGroup::class,function($faker){
$appId = str_replace('-','',$faker->uuid);
return [
'group_name'=>$faker->company,
'app_secret'=>substr($appId,1,12),
'crm_url'=>$faker->url,
'group_logo'=>$faker->imageUrl,
'group_areaid'=>$faker->numerify("###"),
'group_area_info'=>$faker->state.' '.$faker->city.' '.$faker->country,
'create_time'=>$faker->unixTime(),
'create_person'=>$faker->name,
'created_at'=>\Carbon\Carbon::now(),
'updated_at'=>\Carbon\Carbon::now()
];
});
// 在Seeder文件中,使用factory()函数调用工厂类创建数据
$brands = factory(App\Models\AppGroup::class,12)->make();
```
- 可以直接在seed文件内SQL生成数据
```
//直接在seeder中创建数据
DB::table('product_class')->truncate();
DB::statement('INSERT INTO ev_product_class(gc_id,app_id,gc_name,type_id,gc_parent_id,gc_sort,gc_title,
gc_keywords,gc_description,gc_image,level_num,create_time,create_person,created_at,updated_at)
SELECT ecc.gc_id,:app_id,ecc.gc_name,type_id,gc_parent_id,gc_sort,:gc_title,
gc_keywords,:gc_description,gc_image,level_num,:create_time,create_person,:created_at,:updated_at FROM ev_common_class ecc
where ecc.industry_id=1',
[
'app_id'=>$this->app_id_str,
'gc_title'=>$this->faker->word,
'gc_description'=>$this->faker->sentences(3,10),
'create_time'=>Carbon::now()->timestamp,
'created_at'=>Carbon::now(),
'updated_at'=>Carbon::now()
]
);
```
- 使用Eloquent模型创建数据
```
$OrderCommon = [
'order_id' => $orderModel->order_id,
'app_id' => $orderModel->app_id,
'order_sn' => $orderModel->order_sn,
'shipping_time' => $this->faker->unixTime,
'shipping_express_id' => 1, //物流公司id
'shipping_code' => '',
'evaluation_time' => '',
'order_message' => $this->faker->word,
'order_pointscount' => 0,
'deliver_explain' => '',
'seller_daddress_id' => '',
'reciver_name' => $buyserAddress->buyer_name,
'reciver_info' => $buyserAddress->address,
'reciver_province_id' => $buyserAddress->province_id,
'reciver_daddress_id' => $buyserAddress->buyer_address_id,
'invoice_info' => '',
'create_time' => $this->faker->unixTime('now'),
'create_person' => $this->faker->name
];
App\Models\ShopOrderCommon::create($OrderCommon);
```
---
#### **4.tinker**
> 是 laravel提供的命令行工具,可以和项目进行交互。
对于Lumen框架来说,默认是不带tinker命令的,需要安装以下库才允许使用:
`composer require vluzrmos/tinker`
- tinker命令的使用
参考:[tinker使用](http://www.cnblogs.com/ZhangJinglin/p/4383513.html)
- 具体示例
php artisan tinker
**以下是在tinker中的交互输入**
Psy Shell v0.4.1 (PHP 5.4.16 — cli) by Justin Hileman
>>> $name = 'zhang jinglin';
=> "zhang jinglin"
>>> $name
=> "zhang jinglin"
>>> $article = new App\Article;
=> <App\Article #000000005c4b7ee400000000ab91a676> {}
>>> $article->title = 'My First Article';
=> "My First Article"
>>> $article->published_at = Carbon\Carbon::now();
=> <Carbon\Carbon #000000005c4b7ee600000000ab91dcb6> {
date: "2015-03-28 06:37:22",
timezone_type: 3,
timezone: "UTC"
}
>>> $article;
=> <App\Article #000000005c4b7ee400000000ab91a676> {
title: "My First Article",
body: "Some content...",
published_at: <Carbon\Carbon #000000005c4b7ee600000000ab91dcb6> {
date: "2015-03-28 06:37:22",
timezone_type: 3,
timezone: "UTC"
}
}
>>> $article->toArray();
=> [
"title" => "My First Article",
"body" => "Some content...",
"published_at" => <Carbon\Carbon #000000005c4b7ee600000000ab91dcb6> {
date: "2015-03-28 06:37:22",
timezone_type: 3,
timezone: "UTC"
}
]
>>> $article->save();
=> true
>>> App\Article::all()->toArray();
=> [
[
"id" => "1",
"title" => "My First Article",
"body" => "Some content...",
"published_at" => "2015-03-28 06:37:22",
"created_at" => "2015-03-28 06:38:53",
"updated_at" => "2015-03-28 06:38:53"
]
]
>>> $article = App\Article::find(1);
=> <App\Article #000000005c4b7e1600000000ab91a676> {
id: "1",
title: "My First Update Title",
body: "Some content...",
published_at: "2015-03-28 06:37:22",
created_at: "2015-03-28 06:38:53",
updated_at: "2015-03-28 06:42:03"
}
>>> $article = App\Article::where('body', 'Some content...')->get();
...
>>> $article = App\Article::where('body', 'Some content...')->first();
...
>>> $article = App\Article::create(['title' => 'New Article', 'body' => 'New body', 'published_at' => Carbon\Carbon::now()]);
>>> $article->update(['body' => 'New Updaet Body']);
=> true
---
**<u>=>以下命令可能就是laravel所独有的</u>**
#### 5.make controller
通过命令创建Controller类
+ 默认方式,类中会有一系列方法,包括index,create,store,show...:
`php artisan make:controller TestController`
+ 创建没有任何预定义方法的控制器类
`php artisan make:controller TestContoller --plain`
---
#### 6. make其它功能
包括:
- make:event
- make:middleware
- make:model
- make:provider
- make:request
---
#### 7. 查看路由
针对当前的路由配置,可以通过以下命令查看:
`php artisan route:list`
# 一些Laravel站点
帮助参考学习用:
+ [基本文档](http://laravel-china.org/)
+ [Laravel不权威导航](https://segmentfault.com/a/1190000004086565)
+ [Laravel学院](http://laravelacademy.org/)
+ [Laravel函数和命令](http://cheats.jesse-obrien.ca/)
\ No newline at end of file
# Introduction
<div style="color:#333">本知识库为 <strong>青鸽攻城狮</strong> 在项目中的点滴技术分享、工作积累、学习成果合集!</div>
<p></p>
>众奇开放文档知识库
> **## 开放.分享.学习 ##**
>祝学习愉快 !!!
---
**众奇信息技术有限公司 &copy; Qingger Team**
\ No newline at end of file
# Summary
- [README](.\README.md)
- Thinkphp
- Controller
- [evshop_controller](Thinkphp\Controller\evshop_controller.md)
- DB
- [db_sqls](Thinkphp\DB\db_sqls.md)
- Others
- [functions](Thinkphp\Others\functions.md)
- [UsefulCodes](Thinkphp\Others\UsefulCodes.md)
- Structure
- [evshop_structure](Thinkphp\Structure\evshop_structure.md)
- View
- [evshop_view](Thinkphp\View\evshop_view.md)
- Javascript
- [evshop_dialog](Thinkphp\Javascript\evshop_dialog.md)
- [evshop_js](Thinkphp\Javascript\evshop_js.md)
# Summary
- [简介](.\README.md)
- Thinkphp
- Structure
- [EVShop框架结构图](Thinkphp\Structure\evshop_structure.md)
- Controller
- [EVShop之Controller篇](Thinkphp\Controller\evshop_controller.md)
- View
- [EVShop之View篇](Thinkphp\View\evshop_view.md)
- Javascript
- [EVShop之Dialog篇](Thinkphp\Javascript\evshop_dialog.md)
- [EVShop之Javascript篇](Thinkphp\Javascript\evshop_js.md)
- DB
- [Thinkphp中SQL的写法](Thinkphp\DB\db_sqls.md)
- Others
- [Thinkphp中常用功能](Thinkphp\Others\functions.md)
- [EVShop中备用代码片段](Thinkphp\Others\UsefulCodes.md)
- Laravel
- 其它
- [artisan命令行](Laravel\Others\artisan.md)
- [laraval学习站点](Laravel\Others\laravel_sites.md)
- 配置
- [整体配置说明](Laravel\Configs\configs.md)
- Javascript
- 学习
- [前端各工具集学习链接](Javascript\Learn\webfront.md)
- [NPM使用](Javascript\Learn\npm_cmd.md)
- [ES6学习](Javascript\Learn\ES6.md)
\ No newline at end of file
# EVShop编程规则之Controller篇
### 1. Controller中成功和错误的处理
不涉及对话框处理,只在Controller页面跳转的情况下,针对错误处理和成功处理规则如下:
1. 错误和异常情况下,使用 `$this->error(message);`
2. 成功的情况下,使用 `$this->success(message);`
而具体error,success函数调用后所显示的画面的样式,可以在conf/config.php中进行定义
```
//默认错误跳转对应的模板文件(View/Public/error.html)
'TMPL_ACTION_ERROR' => 'Public:error',
//默认成功跳转对应的模板文件' (View/Public/success.html)
'TMPL_ACTION_SUCCESS' => 'Public:success',
```
---
### 2. Controller中成功或者失败返回JSON数据格式
Controller返回JSON数据,一般用于前端JS异步调用Controller方法的场合。
返回JSON,为了后期扩展,统一使用以下函数生成json返回
1. 成功的场合:
json_return_success('successMessage');
// will return { 'errCode':0, 'info':'successMessage'}
2. 失败的场合:
json_return_error('errorMessage');
// will return {'errCode':1, 'info':'errorMessage'}
3. 需要自定义errorCode的场合:
json_return_err_code(4001,'errorMessage');
// will return {'errCode':4001, 'info':'errorMessage'}
4. 需要自定义多个数据字段的场合:
json_return_customer([
'errCode'=>4002,
'Message'=>'Customer Message',
'OtherInfo'=>'Other Infomation'
]);
5. 对于微页面(weipage),有其自定义的JSON定义,在微页面编辑中,涉及到的JSON返回一般使用:
json_return_for_weipage($err_code,$err_msg='',$err_dom='');
---
### 3. 页面中分页显示的设置
设置数据的分页需要以下步骤:
+ 在Controller中导入以下命名空间
`use Library\MyPage;`
+ 在对应的Controller方法中,调用MyPage类
```php
public function album_pic_list() {
$where_condition = Array('aclass_id'=>$_GET['id'],'app_id'=>$this->app_id); // 查询条件
$pic_count = M('album_pic')->where($where_condition)->count(); // 获得显示的总数目
$pic_page = new MyPage($pic_count,6); // 创建MyPage类,参数1表示显示的总数,参数2表示一页中显示的数目
$pic_list = M('album_pic')->where($where_condition)
->order('create_timedesc')
->limit($pic_page->firstRow.','.$pic_page->listRows)
->select(); // 查询时注意加入limit进行限定
$this->assign('pic_list',$pic_list);// 向页面赋值列表
$pagebar = $pic_page->show();
$this->assign('show_page',$pagebar); // 向页面赋值pagebar元素
$this->display('gp02_goods_album_pic_list'); // 视图显示
}
```
+ 在视图中,通过以下代码显示Pager导航
`<div class="pagination"><?php echo $show_page; ?></div>`
---
# Thinkphp中复杂SQL的写法
### 1. SQL 多表联接的写法:
```
$spc_common_default = D("spc_common_default");
$filter['S.spc_common_id'] = array('eq',71);
$model_list  = $spc_common_default->table('__SPC_COMMON_DEFAULT__ S')
->join('LEFT JOIN __SPC_PGROUP_DEFAULT__ U ON S.spc_common_id = U.spc_common_id')
->field('S.*')
->where($map)
->select();
```
以上代码相当于以下SQL语句:
```
SELECT S.* FROM ev_spc_common_default as S
LEFT JOIN ev_spc_group_default as U
ON S.spc_common_id=U.spc_common_id
WHERE s.spc_common_id=71
```
### 2. SQL Group 写法:
```
$model_list = $this->table('__ALBUM_CLASS__ A')->join('LEFT JOIN __ALBUM_PIC__ B ON A.aclass_id=B.aclass_id')
->field('A.aclass_id,A.app_id,A.aclass_name,A.aclass_des,A.aclass_conver,A.aclass_dic,A.is_default,A.create_time,count(B.aclass_id) as ClassCount')
->where($condition)
->group('A.aclass_id')
->order('A.create_time')
->select();
```
### 3. 统计查询(count,sum...)
```
$model->table('__ALBUM_CLASS__')->where($condition)->count();
$model->table('__ALBUM_CLASS__')->count('columnName');
$sumScore = $User->sum('score');
```
\ No newline at end of file
# EVShop编程规则之Dialog篇
> 在Evshop中,对话框是使用artDialog控件,关于artDialog的使用方式,可以参考:
> [artDialog文档](http://aui.github.io/artDialog/doc/index.html)
> 我们在artDialog基础上,做了一些基础的封装,封装参考代码:
> `/data/application/common/myDialog.js`
> 对话框的基本使用示例,参考:
> `/data/application/shop/sample_list.js`
### 对话框(myDialog)的使用
+ 要使用对话框,需要在前端js中引入:
`var myDialog = require("myDialog");`
+ 使用基本的 **Success/Error/Info** 对话框:
```
myDialog.showSucc("Success");
myDialog.showError("Failed");
myDialog.showInfo("title","你好啊");
```
+ 对话框中显示本页面中元素内的内容:
```
$("#opelem").bind("click",function(){
var dialog= myDialog.showMoreDialog(this,{
width:400,
height:$("#dlg_element").height+200,
title:$(this).attr("dialog_title"),
content:$("#dlg_element").html(),
},true);
});
```
+ 显示自定义confirm对话框
```
myDialog.showConfirm("提示信息","删除相册?注意:相册内的图片将转移到默认相册",function(){
$(this).ajaxSubmit({
data: {"id":album_id},
dataType:'json',
type:'get',
url:process_uri,
success:function(responseText,stsText,xhr){
commonFunc.showAjaxProcessInfo(responseText);
},
error:function(error) {
myDialog.showError(error);
}
});
//alert('xxx');
});
```
+ 对话框中显示指定URL的内容
```
$("#opelurl2").bind('click',function(){
// support param: width,
var dialog = myDialog.showFormDialog(this,{
width:500,
title:"Open Dialog",
url:$(this).attr("dialog_url"),
okValue : "确定", // 确定按钮文件,如果不设定,则默认为"确定"
extraSubmitData : {"param1":"1","param2":"2"},
success: function(dialogObj,responseText) {
console.log(responseText); // responsetext后端返回的JSON对象
myDialog.showSucc("Success");
//dialogObj.close().remove();
},
error: function(dialogObj,errorText) {
console.log(errorText);
myDialog.showError(errorText);
//dialogObj.close().remove();
}
});
});
```
> 注:一般来说,指定URL内容包含的是FORM表单,表单提交的Button不需要在页面中定义,
> 而是使用对话框提供的OK/Cancel按钮
+ 对话框URL方式打开后,支持对话框内元素事件的监听
在myDialog.showFormDialog函数内,
可以使用eventListeners来监听对话框内元素的事件监听。方式如下:
```
$("#opelurl2").bind('click',function(){
// support param: width,
var dialog = myDialog.showFormDialog(this,{
width:500,
title:"Open Dialog",
url:$(this).attr("dialog_url"),
eventListeners : [{
selector:'input[type="text"]', // Dialog中事件绑定的选择器
eventName:'change', // Dialog中需要监测的事件
eventFunction : function($sender,$dlgDocument) { // 事件产生后所回调的函数
// $sender是触发此事件的jquery对象,$document是页面中document的jquery对象
console.log($sender.attr("name"));
//console.log($dlgDocument);
}
}],
okValue : "确定", // 确定按钮文件,如果不设定,则默认为"确定"
...
}
```
# EVShop编程规则之Javascript篇
### 1. HTML中添加sevent/saction/sparams 对元素进行事件的绑定
> 事件绑定是通过jquery的on方法,绑定在document元素上,基于事件的冒泡实现的。
+ 在视图html中,可以通过以下方式进行事件的绑定动作:
```
<a href="JavaScript:void(0);" class="ncsc-btn-mini" sevent="click" saction="picAction" stype="multiDel" sparams="1,2" ></a>
<a href="JavaScript:void(1);" class="ncsc-btn-mini" id="img_move" sevent="click" saction="picAction" stype="multiMov" sparms="3,4"></a>
```
+ 在此视图对应的js文件中,只需要定义以下事件:
```
PageModel.prototype.picAction = function(sender,param1,param2) {
if($(sender).attr("stype")==="multiDel") {
//具体事件的动作
}
}
```
在绑定的过程中,支持的事件行为(sevent)有:
"click", "change", "blur", "dbclick", "focus", "hover", "resize"
---
### 2. JSON.Parse函数的参数存在特殊字符的处理
> JSON.Parse()函数,使用的参数是一个字符串,
> 该字符串中存在"\"时,函数转换就会出错,出错提示为:
> `JSON.parse: expected ',' or '}' after property value in object`
> 所以,需要将字符串进行转换,为"\"符号进行转义
__具体实现__:
1. 在PHP中,针对字符串,使用addslashes函数:
`$this->assign('customField', addslashes(json_encode($customField)));`
2. 在JS中,使用replace将"\"转换成"\\"格式
---
### 3. 使用jquery-form 进行异步提交
> jquery-form是一种js的异步提交,提交时,除了把指定的form数据进行提交,
> 还支持额外自定义数据的提交
实现方式:
```
var jquery_form = require("jquery-form");
$(selector).ajaxSubmit({
data:[extraSubmitdata]
dataType:'json',
type:'post',
timeout:5000,
success:function(responseText,stsText,xhr,element) {
},
error:function(error) {
}
});
```
# EVShop中备用代码片段
> 此文件记录了Evshop实现过程中的一些经常被使用到的代码。
> 记录于此,需要时以备查询。
# Thinkphp中一些常用功能
### 1. 加入验证码功能
Think\Verify类可以支持验证码的生成和验证功能。
> 参考:[Thinkphp验证码](http://document.thinkphp.cn/manual_3_2.html#verify)
下面是最简单的方式生成验证码:
```
$Verify = new \Think\Verify();
$Verify->entry();
```
---
### 2. 文件上传(后台)
```
use Library\UploadFile;
if (!empty($_FILES['group_logo']['name'])){
$upload = new UploadFile();
$upload->set('default_dir',ATTACH_COMMON);
$upload->set('file_name','category-pic-'.$newClassId.'.jpg');
$upload->set('ifremove',false);
$upload->set('fprefix','fprefix');
$upload->set('ext','ext');
if ($result){
$this->success("上传图片成功");
}else {
$this->error("上传图片失败");
}
}
```
---
### 3. 图像处理
Todo : write here
---
### 4. IP获取
内置了get_client_ip方法用于获取客户端的IP地址
+ 获取IP示例:
`$ip = get_client_ip();`
+ IP定位示例:
```
$Ip = new \Org\Net\IpLocation('UTFWry.dat'); // 实例化类 参数表示IP地址库文件
$area = $Ip->getlocation('203.34.5.66'); // 获取某个IP地址所在的位置
```
---
### 5. 字符转换成二维码
生成带有LOGO的二维码,可以参考:
> 参考: [带有LOGO二维码]( http://www.cnblogs.com/txw1958/p/phpqrcode.html)
二维码转换实现:
```
use Library\QRcode;
include_once '/app/Library/phpqrcode.php';
$test="http://www.evate-soft.com/";
$filename = "baidu.png";
$level='L';
$size = '6';
$margin=4;
QRcode::png($test, false, $level, $size, $margin);
```
\ No newline at end of file
# EVShop程序框架整体结构图
> 待完成
\ No newline at end of file
# EVShop编程规则之View篇
### 1. 系统变量和配置变量
系统变量的输出通常以$Think 打头,比如:
```
1. {$Think.server.script_name} // 输出$_SERVER['SCRIPT_NAME']变量
2. {$Think.session.user_id} // 输出$_SESSION['user_id']变量
3. {$Think.get.pageNumber} // 输出$_GET['pageNumber']变量
4. {$Think.cookie.name} // 输出$_COOKIE['name']变量
5. {$Think.const.MODULE_NAME} 输出常量
6. {$Think.config.url_model} // 配置参数(在config.php)中设定
7. {$Think.MODULE_NAME} // 模块名称
```
---
### 2. View中将php变量值传递到前端JS文件
需要两个步骤:
1. View中定义pageParam字面量对象
```
<script>
var pageParam = {
s:"page1",
};
</script>
```
2. 在js的initialize()函数中直接使用options.pageParam属性
```
var PageModel = function (options) {
this.pageName = options.page;
this.module = options.module;
this.pageParam = options.pageParam;
this.languageData = new LanguageData("member_group_index");
}
```
如果需要将变量转换成JSON传递到前端js中:
```
<script>
var pageParam = {
language: <?php echo json_encode($lang) ?>,
};
</script>
```
\ No newline at end of file
# Summary
- [README](.\README.md)
- Thinkphp
- Controller
- [evshop_controller](Thinkphp\Controller\evshop_controller.md)
- DB
- [db_sqls](Thinkphp\DB\db_sqls.md)
- Others
- [functions](Thinkphp\Others\functions.md)
- [UsefulCodes](Thinkphp\Others\UsefulCodes.md)
- Structure
- [evshop_structure](Thinkphp\Structure\evshop_structure.md)
- View
- [evshop_view](Thinkphp\View\evshop_view.md)
- Javascript
- [evshop_dialog](Thinkphp\Javascript\evshop_dialog.md)
- [evshop_js](Thinkphp\Javascript\evshop_js.md)
<!DOCTYPE HTML>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>EVShop之Controller篇 | Introduction</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="description" content="">
<meta name="generator" content="GitBook 2.6.7">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="../../gitbook/style.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
<link rel="next" href="../../Thinkphp/View/evshop_view.html" />
<link rel="prev" href="../../Thinkphp/Structure/evshop_structure.html" />
</head>
<body>
<div class="book"
data-level="1.2.1"
data-chapter-title="EVShop之Controller篇"
data-filepath="Thinkphp/Controller/evshop_controller.md"
data-basepath="../.."
data-revision="Wed May 11 2016 00:54:11 GMT+0800 (中国标准时间)"
data-innerlanguage="">
<div class="book-summary">
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="0" data-path="index.html">
<a href="../../index.html">
<i class="fa fa-check"></i>
简介
</a>
</li>
<li class="chapter " data-level="1" >
<span><b>1.</b> Thinkphp</span>
<ul class="articles">
<li class="chapter " data-level="1.1" >
<span><b>1.1.</b> Structure</span>
<ul class="articles">
<li class="chapter " data-level="1.1.1" data-path="Thinkphp/Structure/evshop_structure.html">
<a href="../../Thinkphp/Structure/evshop_structure.html">
<i class="fa fa-check"></i>
<b>1.1.1.</b>
EVShop框架结构图
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.2" >
<span><b>1.2.</b> Controller</span>
<ul class="articles">
<li class="chapter active" data-level="1.2.1" data-path="Thinkphp/Controller/evshop_controller.html">
<a href="../../Thinkphp/Controller/evshop_controller.html">
<i class="fa fa-check"></i>
<b>1.2.1.</b>
EVShop之Controller篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3" >
<span><b>1.3.</b> View</span>
<ul class="articles">
<li class="chapter " data-level="1.3.1" data-path="Thinkphp/View/evshop_view.html">
<a href="../../Thinkphp/View/evshop_view.html">
<i class="fa fa-check"></i>
<b>1.3.1.</b>
EVShop之View篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4" >
<span><b>1.4.</b> Javascript</span>
<ul class="articles">
<li class="chapter " data-level="1.4.1" data-path="Thinkphp/Javascript/evshop_dialog.html">
<a href="../../Thinkphp/Javascript/evshop_dialog.html">
<i class="fa fa-check"></i>
<b>1.4.1.</b>
EVShop之Dialog篇
</a>
</li>
<li class="chapter " data-level="1.4.2" data-path="Thinkphp/Javascript/evshop_js.html">
<a href="../../Thinkphp/Javascript/evshop_js.html">
<i class="fa fa-check"></i>
<b>1.4.2.</b>
EVShop之Javascript篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.5" >
<span><b>1.5.</b> DB</span>
<ul class="articles">
<li class="chapter " data-level="1.5.1" data-path="Thinkphp/DB/db_sqls.html">
<a href="../../Thinkphp/DB/db_sqls.html">
<i class="fa fa-check"></i>
<b>1.5.1.</b>
Thinkphp中SQL的写法
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.6" >
<span><b>1.6.</b> Others</span>
<ul class="articles">
<li class="chapter " data-level="1.6.1" data-path="Thinkphp/Others/functions.html">
<a href="../../Thinkphp/Others/functions.html">
<i class="fa fa-check"></i>
<b>1.6.1.</b>
Thinkphp中常用功能
</a>
</li>
<li class="chapter " data-level="1.6.2" data-path="Thinkphp/Others/UsefulCodes.html">
<a href="../../Thinkphp/Others/UsefulCodes.html">
<i class="fa fa-check"></i>
<b>1.6.2.</b>
EVShop中备用代码片段
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Actions Left -->
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href="../../" >Introduction</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<section class="normal" id="section-">
<h1 id="evshop&#x7F16;&#x7A0B;&#x89C4;&#x5219;&#x4E4B;controller&#x7BC7;">EVShop&#x7F16;&#x7A0B;&#x89C4;&#x5219;&#x4E4B;Controller&#x7BC7;</h1>
<h3 id="1-controller&#x4E2D;&#x6210;&#x529F;&#x548C;&#x9519;&#x8BEF;&#x7684;&#x5904;&#x7406;">1. Controller&#x4E2D;&#x6210;&#x529F;&#x548C;&#x9519;&#x8BEF;&#x7684;&#x5904;&#x7406;</h3>
<p>&#x4E0D;&#x6D89;&#x53CA;&#x5BF9;&#x8BDD;&#x6846;&#x5904;&#x7406;&#xFF0C;&#x53EA;&#x5728;Controller&#x9875;&#x9762;&#x8DF3;&#x8F6C;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x9488;&#x5BF9;&#x9519;&#x8BEF;&#x5904;&#x7406;&#x548C;&#x6210;&#x529F;&#x5904;&#x7406;&#x89C4;&#x5219;&#x5982;&#x4E0B;:</p>
<ol>
<li>&#x9519;&#x8BEF;&#x548C;&#x5F02;&#x5E38;&#x60C5;&#x51B5;&#x4E0B;,&#x4F7F;&#x7528; <code>$this-&gt;error(message);</code> </li>
<li>&#x6210;&#x529F;&#x7684;&#x60C5;&#x51B5;&#x4E0B;&#xFF0C;&#x4F7F;&#x7528; <code>$this-&gt;success(message);</code></li>
</ol>
<p>&#x800C;&#x5177;&#x4F53;error,success&#x51FD;&#x6570;&#x8C03;&#x7528;&#x540E;&#x6240;&#x663E;&#x793A;&#x7684;&#x753B;&#x9762;&#x7684;&#x6837;&#x5F0F;&#xFF0C;&#x53EF;&#x4EE5;&#x5728;conf/config.php&#x4E2D;&#x8FDB;&#x884C;&#x5B9A;&#x4E49;</p>
<pre><code>//&#x9ED8;&#x8BA4;&#x9519;&#x8BEF;&#x8DF3;&#x8F6C;&#x5BF9;&#x5E94;&#x7684;&#x6A21;&#x677F;&#x6587;&#x4EF6;(View/Public/error.html)
&apos;TMPL_ACTION_ERROR&apos; =&gt; &apos;Public:error&apos;,
//&#x9ED8;&#x8BA4;&#x6210;&#x529F;&#x8DF3;&#x8F6C;&#x5BF9;&#x5E94;&#x7684;&#x6A21;&#x677F;&#x6587;&#x4EF6;&apos; (View/Public/success.html)
&apos;TMPL_ACTION_SUCCESS&apos; =&gt; &apos;Public:success&apos;,
</code></pre><hr>
<h3 id="2-controller&#x4E2D;&#x6210;&#x529F;&#x6216;&#x8005;&#x5931;&#x8D25;&#x8FD4;&#x56DE;json&#x6570;&#x636E;&#x683C;&#x5F0F;">2. Controller&#x4E2D;&#x6210;&#x529F;&#x6216;&#x8005;&#x5931;&#x8D25;&#x8FD4;&#x56DE;JSON&#x6570;&#x636E;&#x683C;&#x5F0F;</h3>
<p>Controller&#x8FD4;&#x56DE;JSON&#x6570;&#x636E;&#xFF0C;&#x4E00;&#x822C;&#x7528;&#x4E8E;&#x524D;&#x7AEF;JS&#x5F02;&#x6B65;&#x8C03;&#x7528;Controller&#x65B9;&#x6CD5;&#x7684;&#x573A;&#x5408;&#x3002;
&#x8FD4;&#x56DE;JSON,&#x4E3A;&#x4E86;&#x540E;&#x671F;&#x6269;&#x5C55;&#xFF0C;&#x7EDF;&#x4E00;&#x4F7F;&#x7528;&#x4EE5;&#x4E0B;&#x51FD;&#x6570;&#x751F;&#x6210;json&#x8FD4;&#x56DE;</p>
<ol>
<li><p>&#x6210;&#x529F;&#x7684;&#x573A;&#x5408;:</p>
<pre><code> json_return_success(&apos;successMessage&apos;);
// will return { &apos;errCode&apos;:0, &apos;info&apos;:&apos;successMessage&apos;}
</code></pre></li>
<li><p>&#x5931;&#x8D25;&#x7684;&#x573A;&#x5408;:</p>
<pre><code> json_return_error(&apos;errorMessage&apos;);
// will return {&apos;errCode&apos;:1, &apos;info&apos;:&apos;errorMessage&apos;}
</code></pre></li>
<li><p>&#x9700;&#x8981;&#x81EA;&#x5B9A;&#x4E49;errorCode&#x7684;&#x573A;&#x5408;:</p>
<pre><code> json_return_err_code(4001,&apos;errorMessage&apos;);
// will return {&apos;errCode&apos;:4001, &apos;info&apos;:&apos;errorMessage&apos;}
</code></pre></li>
<li><p>&#x9700;&#x8981;&#x81EA;&#x5B9A;&#x4E49;&#x591A;&#x4E2A;&#x6570;&#x636E;&#x5B57;&#x6BB5;&#x7684;&#x573A;&#x5408;:</p>
<pre><code> json_return_customer([
&apos;errCode&apos;=&gt;4002,
&apos;Message&apos;=&gt;&apos;Customer Message&apos;,
&apos;OtherInfo&apos;=&gt;&apos;Other Infomation&apos;
]);
</code></pre></li>
<li><p>&#x5BF9;&#x4E8E;&#x5FAE;&#x9875;&#x9762;(weipage)&#xFF0C;&#x6709;&#x5176;&#x81EA;&#x5B9A;&#x4E49;&#x7684;JSON&#x5B9A;&#x4E49;&#xFF0C;&#x5728;&#x5FAE;&#x9875;&#x9762;&#x7F16;&#x8F91;&#x4E2D;&#xFF0C;&#x6D89;&#x53CA;&#x5230;&#x7684;JSON&#x8FD4;&#x56DE;&#x4E00;&#x822C;&#x4F7F;&#x7528;:</p>
<pre><code> json_return_for_weipage($err_code,$err_msg=&apos;&apos;,$err_dom=&apos;&apos;);
</code></pre></li>
</ol>
<hr>
<h3 id="3-&#x9875;&#x9762;&#x4E2D;&#x5206;&#x9875;&#x663E;&#x793A;&#x7684;&#x8BBE;&#x7F6E;">3. &#x9875;&#x9762;&#x4E2D;&#x5206;&#x9875;&#x663E;&#x793A;&#x7684;&#x8BBE;&#x7F6E;</h3>
<p>&#x8BBE;&#x7F6E;&#x6570;&#x636E;&#x7684;&#x5206;&#x9875;&#x9700;&#x8981;&#x4EE5;&#x4E0B;&#x6B65;&#x9AA4;:</p>
<ul>
<li>&#x5728;Controller&#x4E2D;&#x5BFC;&#x5165;&#x4EE5;&#x4E0B;&#x547D;&#x540D;&#x7A7A;&#x95F4;
<code>use Library\MyPage;</code></li>
<li>&#x5728;&#x5BF9;&#x5E94;&#x7684;Controller&#x65B9;&#x6CD5;&#x4E2D;&#xFF0C;&#x8C03;&#x7528;MyPage&#x7C7B;<pre><code>public function album_pic_list() {
$where_condition = Array(&apos;aclass_id&apos;=&gt;$_GET[&apos;id&apos;],&apos;app_id&apos;=&gt;$this-&gt;app_id); // &#x67E5;&#x8BE2;&#x6761;&#x4EF6;
$pic_count = M(&apos;album_pic&apos;)-&gt;where($where_condition)-&gt;count(); // &#x83B7;&#x5F97;&#x663E;&#x793A;&#x7684;&#x603B;&#x6570;&#x76EE;
$pic_page = new MyPage($pic_count,6); // &#x521B;&#x5EFA;MyPage&#x7C7B;&#xFF0C;&#x53C2;&#x6570;1&#x8868;&#x793A;&#x663E;&#x793A;&#x7684;&#x603B;&#x6570;&#xFF0C;&#x53C2;&#x6570;2&#x8868;&#x793A;&#x4E00;&#x9875;&#x4E2D;&#x663E;&#x793A;&#x7684;&#x6570;&#x76EE;
$pic_list = M(&apos;album_pic&apos;)-&gt;where($where_condition)
-&gt;order(&apos;create_timedesc&apos;)
-&gt;limit($pic_page-&gt;firstRow.&apos;,&apos;.$pic_page-&gt;listRows)
-&gt;select(); // &#x67E5;&#x8BE2;&#x65F6;&#x6CE8;&#x610F;&#x52A0;&#x5165;limit&#x8FDB;&#x884C;&#x9650;&#x5B9A;
$this-&gt;assign(&apos;pic_list&apos;,$pic_list);// &#x5411;&#x9875;&#x9762;&#x8D4B;&#x503C;&#x5217;&#x8868;
$pagebar = $pic_page-&gt;show();
$this-&gt;assign(&apos;show_page&apos;,$pagebar); // &#x5411;&#x9875;&#x9762;&#x8D4B;&#x503C;pagebar&#x5143;&#x7D20;
$this-&gt;display(&apos;gp02_goods_album_pic_list&apos;); // &#x89C6;&#x56FE;&#x663E;&#x793A;
}
</code></pre></li>
<li>&#x5728;&#x89C6;&#x56FE;&#x4E2D;&#xFF0C;&#x901A;&#x8FC7;&#x4EE5;&#x4E0B;&#x4EE3;&#x7801;&#x663E;&#x793A;Pager&#x5BFC;&#x822A;
<code>&lt;div class=&quot;pagination&quot;&gt;&lt;?php echo $show_page; ?&gt;&lt;/div&gt;</code></li>
</ul>
<hr>
</section>
</div>
</div>
</div>
<a href="../../Thinkphp/Structure/evshop_structure.html" class="navigation navigation-prev " aria-label="Previous page: EVShop框架结构图"><i class="fa fa-angle-left"></i></a>
<a href="../../Thinkphp/View/evshop_view.html" class="navigation navigation-next " aria-label="Next page: EVShop之View篇"><i class="fa fa-angle-right"></i></a>
</div>
</div>
<script src="../../gitbook/app.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
<script>
require(["gitbook"], function(gitbook) {
var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
gitbook.start(config);
});
</script>
</body>
</html>
<!DOCTYPE HTML>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Thinkphp中SQL的写法 | Introduction</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="description" content="">
<meta name="generator" content="GitBook 2.6.7">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="../../gitbook/style.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
<link rel="next" href="../../Thinkphp/Others/functions.html" />
<link rel="prev" href="../../Thinkphp/Javascript/evshop_js.html" />
</head>
<body>
<div class="book"
data-level="1.5.1"
data-chapter-title="Thinkphp中SQL的写法"
data-filepath="Thinkphp/DB/db_sqls.md"
data-basepath="../.."
data-revision="Wed May 11 2016 00:54:11 GMT+0800 (中国标准时间)"
data-innerlanguage="">
<div class="book-summary">
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="0" data-path="index.html">
<a href="../../index.html">
<i class="fa fa-check"></i>
简介
</a>
</li>
<li class="chapter " data-level="1" >
<span><b>1.</b> Thinkphp</span>
<ul class="articles">
<li class="chapter " data-level="1.1" >
<span><b>1.1.</b> Structure</span>
<ul class="articles">
<li class="chapter " data-level="1.1.1" data-path="Thinkphp/Structure/evshop_structure.html">
<a href="../../Thinkphp/Structure/evshop_structure.html">
<i class="fa fa-check"></i>
<b>1.1.1.</b>
EVShop框架结构图
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.2" >
<span><b>1.2.</b> Controller</span>
<ul class="articles">
<li class="chapter " data-level="1.2.1" data-path="Thinkphp/Controller/evshop_controller.html">
<a href="../../Thinkphp/Controller/evshop_controller.html">
<i class="fa fa-check"></i>
<b>1.2.1.</b>
EVShop之Controller篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3" >
<span><b>1.3.</b> View</span>
<ul class="articles">
<li class="chapter " data-level="1.3.1" data-path="Thinkphp/View/evshop_view.html">
<a href="../../Thinkphp/View/evshop_view.html">
<i class="fa fa-check"></i>
<b>1.3.1.</b>
EVShop之View篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4" >
<span><b>1.4.</b> Javascript</span>
<ul class="articles">
<li class="chapter " data-level="1.4.1" data-path="Thinkphp/Javascript/evshop_dialog.html">
<a href="../../Thinkphp/Javascript/evshop_dialog.html">
<i class="fa fa-check"></i>
<b>1.4.1.</b>
EVShop之Dialog篇
</a>
</li>
<li class="chapter " data-level="1.4.2" data-path="Thinkphp/Javascript/evshop_js.html">
<a href="../../Thinkphp/Javascript/evshop_js.html">
<i class="fa fa-check"></i>
<b>1.4.2.</b>
EVShop之Javascript篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.5" >
<span><b>1.5.</b> DB</span>
<ul class="articles">
<li class="chapter active" data-level="1.5.1" data-path="Thinkphp/DB/db_sqls.html">
<a href="../../Thinkphp/DB/db_sqls.html">
<i class="fa fa-check"></i>
<b>1.5.1.</b>
Thinkphp中SQL的写法
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.6" >
<span><b>1.6.</b> Others</span>
<ul class="articles">
<li class="chapter " data-level="1.6.1" data-path="Thinkphp/Others/functions.html">
<a href="../../Thinkphp/Others/functions.html">
<i class="fa fa-check"></i>
<b>1.6.1.</b>
Thinkphp中常用功能
</a>
</li>
<li class="chapter " data-level="1.6.2" data-path="Thinkphp/Others/UsefulCodes.html">
<a href="../../Thinkphp/Others/UsefulCodes.html">
<i class="fa fa-check"></i>
<b>1.6.2.</b>
EVShop中备用代码片段
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Actions Left -->
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href="../../" >Introduction</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<section class="normal" id="section-">
<h1 id="thinkphp&#x4E2D;&#x590D;&#x6742;sql&#x7684;&#x5199;&#x6CD5;">Thinkphp&#x4E2D;&#x590D;&#x6742;SQL&#x7684;&#x5199;&#x6CD5;</h1>
<h3 id="1-sql-&#x591A;&#x8868;&#x8054;&#x63A5;&#x7684;&#x5199;&#x6CD5;&#xFF1A;">1. SQL &#x591A;&#x8868;&#x8054;&#x63A5;&#x7684;&#x5199;&#x6CD5;&#xFF1A;</h3>
<pre><code>$spc_common_default = D(&quot;spc_common_default&quot;);
$filter[&apos;S.spc_common_id&apos;] = array(&apos;eq&apos;,71);
$model_list = $spc_common_default-&gt;table(&apos;__SPC_COMMON_DEFAULT__ S&apos;)
-&gt;join(&apos;LEFT JOIN __SPC_PGROUP_DEFAULT__ U ON S.spc_common_id = U.spc_common_id&apos;)
-&gt;field(&apos;S.*&apos;)
-&gt;where($map)
-&gt;select();
</code></pre><p>&#x4EE5;&#x4E0A;&#x4EE3;&#x7801;&#x76F8;&#x5F53;&#x4E8E;&#x4EE5;&#x4E0B;SQL&#x8BED;&#x53E5;&#xFF1A;</p>
<pre><code>SELECT S.* FROM ev_spc_common_default as S
LEFT JOIN ev_spc_group_default as U
ON S.spc_common_id=U.spc_common_id
WHERE s.spc_common_id=71
</code></pre><h3 id="2-sql-group-&#x5199;&#x6CD5;">2. SQL Group &#x5199;&#x6CD5;:</h3>
<pre><code>$model_list = $this-&gt;table(&apos;__ALBUM_CLASS__ A&apos;)-&gt;join(&apos;LEFT JOIN __ALBUM_PIC__ B ON A.aclass_id=B.aclass_id&apos;)
-&gt;field(&apos;A.aclass_id,A.app_id,A.aclass_name,A.aclass_des,A.aclass_conver,A.aclass_dic,A.is_default,A.create_time,count(B.aclass_id) as ClassCount&apos;)
-&gt;where($condition)
-&gt;group(&apos;A.aclass_id&apos;)
-&gt;order(&apos;A.create_time&apos;)
-&gt;select();
</code></pre><h3 id="3-&#x7EDF;&#x8BA1;&#x67E5;&#x8BE2;countsum">3. &#x7EDF;&#x8BA1;&#x67E5;&#x8BE2;(count,sum...)</h3>
<pre><code>$model-&gt;table(&apos;__ALBUM_CLASS__&apos;)-&gt;where($condition)-&gt;count();
$model-&gt;table(&apos;__ALBUM_CLASS__&apos;)-&gt;count(&apos;columnName&apos;);
$sumScore = $User-&gt;sum(&apos;score&apos;);
</code></pre>
</section>
</div>
</div>
</div>
<a href="../../Thinkphp/Javascript/evshop_js.html" class="navigation navigation-prev " aria-label="Previous page: EVShop之Javascript篇"><i class="fa fa-angle-left"></i></a>
<a href="../../Thinkphp/Others/functions.html" class="navigation navigation-next " aria-label="Next page: Thinkphp中常用功能"><i class="fa fa-angle-right"></i></a>
</div>
</div>
<script src="../../gitbook/app.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
<script>
require(["gitbook"], function(gitbook) {
var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
gitbook.start(config);
});
</script>
</body>
</html>
<!DOCTYPE HTML>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>EVShop之Dialog篇 | Introduction</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="description" content="">
<meta name="generator" content="GitBook 2.6.7">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="../../gitbook/style.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
<link rel="next" href="../../Thinkphp/Javascript/evshop_js.html" />
<link rel="prev" href="../../Thinkphp/View/evshop_view.html" />
</head>
<body>
<div class="book"
data-level="1.4.1"
data-chapter-title="EVShop之Dialog篇"
data-filepath="Thinkphp/Javascript/evshop_dialog.md"
data-basepath="../.."
data-revision="Wed May 11 2016 00:54:11 GMT+0800 (中国标准时间)"
data-innerlanguage="">
<div class="book-summary">
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="0" data-path="index.html">
<a href="../../index.html">
<i class="fa fa-check"></i>
简介
</a>
</li>
<li class="chapter " data-level="1" >
<span><b>1.</b> Thinkphp</span>
<ul class="articles">
<li class="chapter " data-level="1.1" >
<span><b>1.1.</b> Structure</span>
<ul class="articles">
<li class="chapter " data-level="1.1.1" data-path="Thinkphp/Structure/evshop_structure.html">
<a href="../../Thinkphp/Structure/evshop_structure.html">
<i class="fa fa-check"></i>
<b>1.1.1.</b>
EVShop框架结构图
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.2" >
<span><b>1.2.</b> Controller</span>
<ul class="articles">
<li class="chapter " data-level="1.2.1" data-path="Thinkphp/Controller/evshop_controller.html">
<a href="../../Thinkphp/Controller/evshop_controller.html">
<i class="fa fa-check"></i>
<b>1.2.1.</b>
EVShop之Controller篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3" >
<span><b>1.3.</b> View</span>
<ul class="articles">
<li class="chapter " data-level="1.3.1" data-path="Thinkphp/View/evshop_view.html">
<a href="../../Thinkphp/View/evshop_view.html">
<i class="fa fa-check"></i>
<b>1.3.1.</b>
EVShop之View篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4" >
<span><b>1.4.</b> Javascript</span>
<ul class="articles">
<li class="chapter active" data-level="1.4.1" data-path="Thinkphp/Javascript/evshop_dialog.html">
<a href="../../Thinkphp/Javascript/evshop_dialog.html">
<i class="fa fa-check"></i>
<b>1.4.1.</b>
EVShop之Dialog篇
</a>
</li>
<li class="chapter " data-level="1.4.2" data-path="Thinkphp/Javascript/evshop_js.html">
<a href="../../Thinkphp/Javascript/evshop_js.html">
<i class="fa fa-check"></i>
<b>1.4.2.</b>
EVShop之Javascript篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.5" >
<span><b>1.5.</b> DB</span>
<ul class="articles">
<li class="chapter " data-level="1.5.1" data-path="Thinkphp/DB/db_sqls.html">
<a href="../../Thinkphp/DB/db_sqls.html">
<i class="fa fa-check"></i>
<b>1.5.1.</b>
Thinkphp中SQL的写法
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.6" >
<span><b>1.6.</b> Others</span>
<ul class="articles">
<li class="chapter " data-level="1.6.1" data-path="Thinkphp/Others/functions.html">
<a href="../../Thinkphp/Others/functions.html">
<i class="fa fa-check"></i>
<b>1.6.1.</b>
Thinkphp中常用功能
</a>
</li>
<li class="chapter " data-level="1.6.2" data-path="Thinkphp/Others/UsefulCodes.html">
<a href="../../Thinkphp/Others/UsefulCodes.html">
<i class="fa fa-check"></i>
<b>1.6.2.</b>
EVShop中备用代码片段
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Actions Left -->
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href="../../" >Introduction</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<section class="normal" id="section-">
<h1 id="evshop&#x7F16;&#x7A0B;&#x89C4;&#x5219;&#x4E4B;dialog&#x7BC7;">EVShop&#x7F16;&#x7A0B;&#x89C4;&#x5219;&#x4E4B;Dialog&#x7BC7;</h1>
<blockquote>
<p>&#x5728;Evshop&#x4E2D;&#xFF0C;&#x5BF9;&#x8BDD;&#x6846;&#x662F;&#x4F7F;&#x7528;artDialog&#x63A7;&#x4EF6;&#xFF0C;&#x5173;&#x4E8E;artDialog&#x7684;&#x4F7F;&#x7528;&#x65B9;&#x5F0F;&#xFF0C;&#x53EF;&#x4EE5;&#x53C2;&#x8003;:
<a href="http://aui.github.io/artDialog/doc/index.html" target="_blank">artDialog&#x6587;&#x6863;</a>
&#x6211;&#x4EEC;&#x5728;artDialog&#x57FA;&#x7840;&#x4E0A;&#xFF0C;&#x505A;&#x4E86;&#x4E00;&#x4E9B;&#x57FA;&#x7840;&#x7684;&#x5C01;&#x88C5;&#xFF0C;&#x5C01;&#x88C5;&#x53C2;&#x8003;&#x4EE3;&#x7801;:
<code>/data/application/common/myDialog.js</code>
&#x5BF9;&#x8BDD;&#x6846;&#x7684;&#x57FA;&#x672C;&#x4F7F;&#x7528;&#x793A;&#x4F8B;&#xFF0C;&#x53C2;&#x8003;:
<code>/data/application/shop/sample_list.js</code></p>
</blockquote>
<h3 id="&#x5BF9;&#x8BDD;&#x6846;mydialog&#x7684;&#x4F7F;&#x7528;">&#x5BF9;&#x8BDD;&#x6846;(myDialog)&#x7684;&#x4F7F;&#x7528;</h3>
<ul>
<li><p>&#x8981;&#x4F7F;&#x7528;&#x5BF9;&#x8BDD;&#x6846;&#xFF0C;&#x9700;&#x8981;&#x5728;&#x524D;&#x7AEF;js&#x4E2D;&#x5F15;&#x5165;:
<code>var myDialog = require(&quot;myDialog&quot;);</code></p>
</li>
<li><p>&#x4F7F;&#x7528;&#x57FA;&#x672C;&#x7684; <strong>Success/Error/Info</strong> &#x5BF9;&#x8BDD;&#x6846;:</p>
<pre><code>myDialog.showSucc(&quot;Success&quot;);
myDialog.showError(&quot;Failed&quot;);
myDialog.showInfo(&quot;title&quot;,&quot;&#x4F60;&#x597D;&#x554A;&quot;);
</code></pre></li>
<li><p>&#x5BF9;&#x8BDD;&#x6846;&#x4E2D;&#x663E;&#x793A;&#x672C;&#x9875;&#x9762;&#x4E2D;&#x5143;&#x7D20;&#x5185;&#x7684;&#x5185;&#x5BB9;:</p>
<pre><code>$(&quot;#opelem&quot;).bind(&quot;click&quot;,function(){
var dialog= myDialog.showMoreDialog(this,{
width:400,
height:$(&quot;#dlg_element&quot;).height+200,
title:$(this).attr(&quot;dialog_title&quot;),
content:$(&quot;#dlg_element&quot;).html(),
},true);
});
</code></pre></li>
<li><p>&#x663E;&#x793A;&#x81EA;&#x5B9A;&#x4E49;confirm&#x5BF9;&#x8BDD;&#x6846;</p>
<pre><code>myDialog.showConfirm(&quot;&#x63D0;&#x793A;&#x4FE1;&#x606F;&quot;,&quot;&#x5220;&#x9664;&#x76F8;&#x518C;&#xFF1F;&#x6CE8;&#x610F;&#xFF1A;&#x76F8;&#x518C;&#x5185;&#x7684;&#x56FE;&#x7247;&#x5C06;&#x8F6C;&#x79FB;&#x5230;&#x9ED8;&#x8BA4;&#x76F8;&#x518C;&quot;,function(){
$(this).ajaxSubmit({
data: {&quot;id&quot;:album_id},
dataType:&apos;json&apos;,
type:&apos;get&apos;,
url:process_uri,
success:function(responseText,stsText,xhr){
commonFunc.showAjaxProcessInfo(responseText);
},
error:function(error) {
myDialog.showError(error);
}
});
//alert(&apos;xxx&apos;);
});
</code></pre></li>
</ul>
<ul>
<li><p>&#x5BF9;&#x8BDD;&#x6846;&#x4E2D;&#x663E;&#x793A;&#x6307;&#x5B9A;URL&#x7684;&#x5185;&#x5BB9; </p>
<pre><code> $(&quot;#opelurl2&quot;).bind(&apos;click&apos;,function(){
// support param: width,
var dialog = myDialog.showFormDialog(this,{
width:500,
title:&quot;Open Dialog&quot;,
url:$(this).attr(&quot;dialog_url&quot;),
okValue : &quot;&#x786E;&#x5B9A;&quot;, // &#x786E;&#x5B9A;&#x6309;&#x94AE;&#x6587;&#x4EF6;&#xFF0C;&#x5982;&#x679C;&#x4E0D;&#x8BBE;&#x5B9A;&#xFF0C;&#x5219;&#x9ED8;&#x8BA4;&#x4E3A;&quot;&#x786E;&#x5B9A;&quot;
extraSubmitData : {&quot;param1&quot;:&quot;1&quot;,&quot;param2&quot;:&quot;2&quot;},
success: function(dialogObj,responseText) {
console.log(responseText); // responsetext&#x540E;&#x7AEF;&#x8FD4;&#x56DE;&#x7684;JSON&#x5BF9;&#x8C61;
myDialog.showSucc(&quot;Success&quot;);
//dialogObj.close().remove();
},
error: function(dialogObj,errorText) {
console.log(errorText);
myDialog.showError(errorText);
//dialogObj.close().remove();
}
});
});
</code></pre><blockquote>
<p>&#x6CE8;&#xFF1A;&#x4E00;&#x822C;&#x6765;&#x8BF4;&#xFF0C;&#x6307;&#x5B9A;URL&#x5185;&#x5BB9;&#x5305;&#x542B;&#x7684;&#x662F;FORM&#x8868;&#x5355;&#xFF0C;&#x8868;&#x5355;&#x63D0;&#x4EA4;&#x7684;Button&#x4E0D;&#x9700;&#x8981;&#x5728;&#x9875;&#x9762;&#x4E2D;&#x5B9A;&#x4E49;&#xFF0C;
&#x800C;&#x662F;&#x4F7F;&#x7528;&#x5BF9;&#x8BDD;&#x6846;&#x63D0;&#x4F9B;&#x7684;OK/Cancel&#x6309;&#x94AE; </p>
</blockquote>
</li>
</ul>
<ul>
<li>&#x5BF9;&#x8BDD;&#x6846;URL&#x65B9;&#x5F0F;&#x6253;&#x5F00;&#x540E;&#xFF0C;&#x652F;&#x6301;&#x5BF9;&#x8BDD;&#x6846;&#x5185;&#x5143;&#x7D20;&#x4E8B;&#x4EF6;&#x7684;&#x76D1;&#x542C;
&#x5728;myDialog.showFormDialog&#x51FD;&#x6570;&#x5185;&#xFF0C;
&#x53EF;&#x4EE5;&#x4F7F;&#x7528;eventListeners&#x6765;&#x76D1;&#x542C;&#x5BF9;&#x8BDD;&#x6846;&#x5185;&#x5143;&#x7D20;&#x7684;&#x4E8B;&#x4EF6;&#x76D1;&#x542C;&#x3002;&#x65B9;&#x5F0F;&#x5982;&#x4E0B;&#xFF1A;<pre><code>$(&quot;#opelurl2&quot;).bind(&apos;click&apos;,function(){
// support param: width,
var dialog = myDialog.showFormDialog(this,{
width:500,
title:&quot;Open Dialog&quot;,
url:$(this).attr(&quot;dialog_url&quot;),
eventListeners : [{
selector:&apos;input[type=&quot;text&quot;]&apos;, // Dialog&#x4E2D;&#x4E8B;&#x4EF6;&#x7ED1;&#x5B9A;&#x7684;&#x9009;&#x62E9;&#x5668;
eventName:&apos;change&apos;, // Dialog&#x4E2D;&#x9700;&#x8981;&#x76D1;&#x6D4B;&#x7684;&#x4E8B;&#x4EF6;
eventFunction : function($sender,$dlgDocument) { // &#x4E8B;&#x4EF6;&#x4EA7;&#x751F;&#x540E;&#x6240;&#x56DE;&#x8C03;&#x7684;&#x51FD;&#x6570;
// $sender&#x662F;&#x89E6;&#x53D1;&#x6B64;&#x4E8B;&#x4EF6;&#x7684;jquery&#x5BF9;&#x8C61;,$document&#x662F;&#x9875;&#x9762;&#x4E2D;document&#x7684;jquery&#x5BF9;&#x8C61;
console.log($sender.attr(&quot;name&quot;));
//console.log($dlgDocument);
}
}],
okValue : &quot;&#x786E;&#x5B9A;&quot;, // &#x786E;&#x5B9A;&#x6309;&#x94AE;&#x6587;&#x4EF6;&#xFF0C;&#x5982;&#x679C;&#x4E0D;&#x8BBE;&#x5B9A;&#xFF0C;&#x5219;&#x9ED8;&#x8BA4;&#x4E3A;&quot;&#x786E;&#x5B9A;&quot;
...
}
</code></pre></li>
</ul>
</section>
</div>
</div>
</div>
<a href="../../Thinkphp/View/evshop_view.html" class="navigation navigation-prev " aria-label="Previous page: EVShop之View篇"><i class="fa fa-angle-left"></i></a>
<a href="../../Thinkphp/Javascript/evshop_js.html" class="navigation navigation-next " aria-label="Next page: EVShop之Javascript篇"><i class="fa fa-angle-right"></i></a>
</div>
</div>
<script src="../../gitbook/app.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
<script>
require(["gitbook"], function(gitbook) {
var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
gitbook.start(config);
});
</script>
</body>
</html>
<!DOCTYPE HTML>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>EVShop之Javascript篇 | Introduction</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="description" content="">
<meta name="generator" content="GitBook 2.6.7">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="../../gitbook/style.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
<link rel="next" href="../../Thinkphp/DB/db_sqls.html" />
<link rel="prev" href="../../Thinkphp/Javascript/evshop_dialog.html" />
</head>
<body>
<div class="book"
data-level="1.4.2"
data-chapter-title="EVShop之Javascript篇"
data-filepath="Thinkphp/Javascript/evshop_js.md"
data-basepath="../.."
data-revision="Wed May 11 2016 00:54:11 GMT+0800 (中国标准时间)"
data-innerlanguage="">
<div class="book-summary">
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="0" data-path="index.html">
<a href="../../index.html">
<i class="fa fa-check"></i>
简介
</a>
</li>
<li class="chapter " data-level="1" >
<span><b>1.</b> Thinkphp</span>
<ul class="articles">
<li class="chapter " data-level="1.1" >
<span><b>1.1.</b> Structure</span>
<ul class="articles">
<li class="chapter " data-level="1.1.1" data-path="Thinkphp/Structure/evshop_structure.html">
<a href="../../Thinkphp/Structure/evshop_structure.html">
<i class="fa fa-check"></i>
<b>1.1.1.</b>
EVShop框架结构图
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.2" >
<span><b>1.2.</b> Controller</span>
<ul class="articles">
<li class="chapter " data-level="1.2.1" data-path="Thinkphp/Controller/evshop_controller.html">
<a href="../../Thinkphp/Controller/evshop_controller.html">
<i class="fa fa-check"></i>
<b>1.2.1.</b>
EVShop之Controller篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3" >
<span><b>1.3.</b> View</span>
<ul class="articles">
<li class="chapter " data-level="1.3.1" data-path="Thinkphp/View/evshop_view.html">
<a href="../../Thinkphp/View/evshop_view.html">
<i class="fa fa-check"></i>
<b>1.3.1.</b>
EVShop之View篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4" >
<span><b>1.4.</b> Javascript</span>
<ul class="articles">
<li class="chapter " data-level="1.4.1" data-path="Thinkphp/Javascript/evshop_dialog.html">
<a href="../../Thinkphp/Javascript/evshop_dialog.html">
<i class="fa fa-check"></i>
<b>1.4.1.</b>
EVShop之Dialog篇
</a>
</li>
<li class="chapter active" data-level="1.4.2" data-path="Thinkphp/Javascript/evshop_js.html">
<a href="../../Thinkphp/Javascript/evshop_js.html">
<i class="fa fa-check"></i>
<b>1.4.2.</b>
EVShop之Javascript篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.5" >
<span><b>1.5.</b> DB</span>
<ul class="articles">
<li class="chapter " data-level="1.5.1" data-path="Thinkphp/DB/db_sqls.html">
<a href="../../Thinkphp/DB/db_sqls.html">
<i class="fa fa-check"></i>
<b>1.5.1.</b>
Thinkphp中SQL的写法
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.6" >
<span><b>1.6.</b> Others</span>
<ul class="articles">
<li class="chapter " data-level="1.6.1" data-path="Thinkphp/Others/functions.html">
<a href="../../Thinkphp/Others/functions.html">
<i class="fa fa-check"></i>
<b>1.6.1.</b>
Thinkphp中常用功能
</a>
</li>
<li class="chapter " data-level="1.6.2" data-path="Thinkphp/Others/UsefulCodes.html">
<a href="../../Thinkphp/Others/UsefulCodes.html">
<i class="fa fa-check"></i>
<b>1.6.2.</b>
EVShop中备用代码片段
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Actions Left -->
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href="../../" >Introduction</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<section class="normal" id="section-">
<h1 id="evshop&#x7F16;&#x7A0B;&#x89C4;&#x5219;&#x4E4B;javascript&#x7BC7;">EVShop&#x7F16;&#x7A0B;&#x89C4;&#x5219;&#x4E4B;Javascript&#x7BC7;</h1>
<h3 id="1-html&#x4E2D;&#x6DFB;&#x52A0;seventsactionsparams-&#x5BF9;&#x5143;&#x7D20;&#x8FDB;&#x884C;&#x4E8B;&#x4EF6;&#x7684;&#x7ED1;&#x5B9A;">1. HTML&#x4E2D;&#x6DFB;&#x52A0;sevent/saction/sparams &#x5BF9;&#x5143;&#x7D20;&#x8FDB;&#x884C;&#x4E8B;&#x4EF6;&#x7684;&#x7ED1;&#x5B9A;</h3>
<pre><code>&gt; &#x4E8B;&#x4EF6;&#x7ED1;&#x5B9A;&#x662F;&#x901A;&#x8FC7;jquery&#x7684;on&#x65B9;&#x6CD5;&#xFF0C;&#x7ED1;&#x5B9A;&#x5728;document&#x5143;&#x7D20;&#x4E0A;&#xFF0C;&#x57FA;&#x4E8E;&#x4E8B;&#x4EF6;&#x7684;&#x5192;&#x6CE1;&#x5B9E;&#x73B0;&#x7684;&#x3002;
</code></pre><ul>
<li>&#x5728;&#x89C6;&#x56FE;html&#x4E2D;&#xFF0C;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;&#x4EE5;&#x4E0B;&#x65B9;&#x5F0F;&#x8FDB;&#x884C;&#x4E8B;&#x4EF6;&#x7684;&#x7ED1;&#x5B9A;&#x52A8;&#x4F5C;&#xFF1A;</li>
</ul>
<pre><code>&lt;a href=&quot;JavaScript:void(0);&quot; class=&quot;ncsc-btn-mini&quot; sevent=&quot;click&quot; saction=&quot;picAction&quot; stype=&quot;multiDel&quot; sparams=&quot;1,2&quot; &gt;&lt;/a&gt;
&lt;a href=&quot;JavaScript:void(1);&quot; class=&quot;ncsc-btn-mini&quot; id=&quot;img_move&quot; sevent=&quot;click&quot; saction=&quot;picAction&quot; stype=&quot;multiMov&quot; sparms=&quot;3,4&quot;&gt;&lt;/a&gt;
</code></pre><ul>
<li>&#x5728;&#x6B64;&#x89C6;&#x56FE;&#x5BF9;&#x5E94;&#x7684;js&#x6587;&#x4EF6;&#x4E2D;&#xFF0C;&#x53EA;&#x9700;&#x8981;&#x5B9A;&#x4E49;&#x4EE5;&#x4E0B;&#x4E8B;&#x4EF6;&#xFF1A;<pre><code>PageModel.prototype.picAction = function(sender,param1,param2) {
if($(sender).attr(&quot;stype&quot;)===&quot;multiDel&quot;) {
//&#x5177;&#x4F53;&#x4E8B;&#x4EF6;&#x7684;&#x52A8;&#x4F5C;
}
}
</code></pre></li>
</ul>
<p>&#x5728;&#x7ED1;&#x5B9A;&#x7684;&#x8FC7;&#x7A0B;&#x4E2D;&#xFF0C;&#x652F;&#x6301;&#x7684;&#x4E8B;&#x4EF6;&#x884C;&#x4E3A;(sevent)&#x6709;&#xFF1A;</p>
<pre><code> &quot;click&quot;, &quot;change&quot;, &quot;blur&quot;, &quot;dbclick&quot;, &quot;focus&quot;, &quot;hover&quot;, &quot;resize&quot;
</code></pre><hr>
<h3 id="2-jsonparse&#x51FD;&#x6570;&#x7684;&#x53C2;&#x6570;&#x5B58;&#x5728;&#x7279;&#x6B8A;&#x5B57;&#x7B26;&#x7684;&#x5904;&#x7406;">2. JSON.Parse&#x51FD;&#x6570;&#x7684;&#x53C2;&#x6570;&#x5B58;&#x5728;&#x7279;&#x6B8A;&#x5B57;&#x7B26;&#x7684;&#x5904;&#x7406;</h3>
<blockquote>
<p>JSON.Parse()&#x51FD;&#x6570;&#xFF0C;&#x4F7F;&#x7528;&#x7684;&#x53C2;&#x6570;&#x662F;&#x4E00;&#x4E2A;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;
&#x8BE5;&#x5B57;&#x7B26;&#x4E32;&#x4E2D;&#x5B58;&#x5728;&quot;\&quot;&#x65F6;&#xFF0C;&#x51FD;&#x6570;&#x8F6C;&#x6362;&#x5C31;&#x4F1A;&#x51FA;&#x9519;&#xFF0C;&#x51FA;&#x9519;&#x63D0;&#x793A;&#x4E3A;&#xFF1A;
<code>JSON.parse: expected &apos;,&apos; or &apos;}&apos; after property value in object</code>
&#x6240;&#x4EE5;&#xFF0C;&#x9700;&#x8981;&#x5C06;&#x5B57;&#x7B26;&#x4E32;&#x8FDB;&#x884C;&#x8F6C;&#x6362;&#xFF0C;&#x4E3A;&quot;\&quot;&#x7B26;&#x53F7;&#x8FDB;&#x884C;&#x8F6C;&#x4E49;</p>
</blockquote>
<p><strong>&#x5177;&#x4F53;&#x5B9E;&#x73B0;</strong>:</p>
<ol>
<li>&#x5728;PHP&#x4E2D;&#xFF0C;&#x9488;&#x5BF9;&#x5B57;&#x7B26;&#x4E32;&#xFF0C;&#x4F7F;&#x7528;addslashes&#x51FD;&#x6570;:
<code>$this-&gt;assign(&apos;customField&apos;, addslashes(json_encode($customField)));</code></li>
<li>&#x5728;JS&#x4E2D;&#xFF0C;&#x4F7F;&#x7528;replace&#x5C06;&quot;\&quot;&#x8F6C;&#x6362;&#x6210;&quot;\&quot;&#x683C;&#x5F0F; </li>
</ol>
<hr>
<h3 id="3-&#x4F7F;&#x7528;jqueryform-&#x8FDB;&#x884C;&#x5F02;&#x6B65;&#x63D0;&#x4EA4;">3. &#x4F7F;&#x7528;jquery-form &#x8FDB;&#x884C;&#x5F02;&#x6B65;&#x63D0;&#x4EA4;</h3>
<blockquote>
<p>jquery-form&#x662F;&#x4E00;&#x79CD;js&#x7684;&#x5F02;&#x6B65;&#x63D0;&#x4EA4;&#xFF0C;&#x63D0;&#x4EA4;&#x65F6;&#xFF0C;&#x9664;&#x4E86;&#x628A;&#x6307;&#x5B9A;&#x7684;form&#x6570;&#x636E;&#x8FDB;&#x884C;&#x63D0;&#x4EA4;&#xFF0C;
&#x8FD8;&#x652F;&#x6301;&#x989D;&#x5916;&#x81EA;&#x5B9A;&#x4E49;&#x6570;&#x636E;&#x7684;&#x63D0;&#x4EA4;</p>
</blockquote>
<p>&#x5B9E;&#x73B0;&#x65B9;&#x5F0F;:</p>
<pre><code>var jquery_form = require(&quot;jquery-form&quot;);
$(selector).ajaxSubmit({
data:[extraSubmitdata]
dataType:&apos;json&apos;,
type:&apos;post&apos;,
timeout:5000,
success:function(responseText,stsText,xhr,element) {
},
error:function(error) {
}
});
</code></pre>
</section>
</div>
</div>
</div>
<a href="../../Thinkphp/Javascript/evshop_dialog.html" class="navigation navigation-prev " aria-label="Previous page: EVShop之Dialog篇"><i class="fa fa-angle-left"></i></a>
<a href="../../Thinkphp/DB/db_sqls.html" class="navigation navigation-next " aria-label="Next page: Thinkphp中SQL的写法"><i class="fa fa-angle-right"></i></a>
</div>
</div>
<script src="../../gitbook/app.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
<script>
require(["gitbook"], function(gitbook) {
var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
gitbook.start(config);
});
</script>
</body>
</html>
<!DOCTYPE HTML>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>EVShop中备用代码片段 | Introduction</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="description" content="">
<meta name="generator" content="GitBook 2.6.7">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="../../gitbook/style.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
<link rel="prev" href="../../Thinkphp/Others/functions.html" />
</head>
<body>
<div class="book"
data-level="1.6.2"
data-chapter-title="EVShop中备用代码片段"
data-filepath="Thinkphp/Others/UsefulCodes.md"
data-basepath="../.."
data-revision="Wed May 11 2016 00:54:11 GMT+0800 (中国标准时间)"
data-innerlanguage="">
<div class="book-summary">
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="0" data-path="index.html">
<a href="../../index.html">
<i class="fa fa-check"></i>
简介
</a>
</li>
<li class="chapter " data-level="1" >
<span><b>1.</b> Thinkphp</span>
<ul class="articles">
<li class="chapter " data-level="1.1" >
<span><b>1.1.</b> Structure</span>
<ul class="articles">
<li class="chapter " data-level="1.1.1" data-path="Thinkphp/Structure/evshop_structure.html">
<a href="../../Thinkphp/Structure/evshop_structure.html">
<i class="fa fa-check"></i>
<b>1.1.1.</b>
EVShop框架结构图
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.2" >
<span><b>1.2.</b> Controller</span>
<ul class="articles">
<li class="chapter " data-level="1.2.1" data-path="Thinkphp/Controller/evshop_controller.html">
<a href="../../Thinkphp/Controller/evshop_controller.html">
<i class="fa fa-check"></i>
<b>1.2.1.</b>
EVShop之Controller篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3" >
<span><b>1.3.</b> View</span>
<ul class="articles">
<li class="chapter " data-level="1.3.1" data-path="Thinkphp/View/evshop_view.html">
<a href="../../Thinkphp/View/evshop_view.html">
<i class="fa fa-check"></i>
<b>1.3.1.</b>
EVShop之View篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4" >
<span><b>1.4.</b> Javascript</span>
<ul class="articles">
<li class="chapter " data-level="1.4.1" data-path="Thinkphp/Javascript/evshop_dialog.html">
<a href="../../Thinkphp/Javascript/evshop_dialog.html">
<i class="fa fa-check"></i>
<b>1.4.1.</b>
EVShop之Dialog篇
</a>
</li>
<li class="chapter " data-level="1.4.2" data-path="Thinkphp/Javascript/evshop_js.html">
<a href="../../Thinkphp/Javascript/evshop_js.html">
<i class="fa fa-check"></i>
<b>1.4.2.</b>
EVShop之Javascript篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.5" >
<span><b>1.5.</b> DB</span>
<ul class="articles">
<li class="chapter " data-level="1.5.1" data-path="Thinkphp/DB/db_sqls.html">
<a href="../../Thinkphp/DB/db_sqls.html">
<i class="fa fa-check"></i>
<b>1.5.1.</b>
Thinkphp中SQL的写法
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.6" >
<span><b>1.6.</b> Others</span>
<ul class="articles">
<li class="chapter " data-level="1.6.1" data-path="Thinkphp/Others/functions.html">
<a href="../../Thinkphp/Others/functions.html">
<i class="fa fa-check"></i>
<b>1.6.1.</b>
Thinkphp中常用功能
</a>
</li>
<li class="chapter active" data-level="1.6.2" data-path="Thinkphp/Others/UsefulCodes.html">
<a href="../../Thinkphp/Others/UsefulCodes.html">
<i class="fa fa-check"></i>
<b>1.6.2.</b>
EVShop中备用代码片段
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Actions Left -->
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href="../../" >Introduction</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<section class="normal" id="section-">
<h1 id="evshop&#x4E2D;&#x5907;&#x7528;&#x4EE3;&#x7801;&#x7247;&#x6BB5;">EVShop&#x4E2D;&#x5907;&#x7528;&#x4EE3;&#x7801;&#x7247;&#x6BB5;</h1>
<blockquote>
<p>&#x6B64;&#x6587;&#x4EF6;&#x8BB0;&#x5F55;&#x4E86;Evshop&#x5B9E;&#x73B0;&#x8FC7;&#x7A0B;&#x4E2D;&#x7684;&#x4E00;&#x4E9B;&#x7ECF;&#x5E38;&#x88AB;&#x4F7F;&#x7528;&#x5230;&#x7684;&#x4EE3;&#x7801;&#x3002;
&#x8BB0;&#x5F55;&#x4E8E;&#x6B64;&#xFF0C;&#x9700;&#x8981;&#x65F6;&#x4EE5;&#x5907;&#x67E5;&#x8BE2;&#x3002;</p>
</blockquote>
</section>
</div>
</div>
</div>
<a href="../../Thinkphp/Others/functions.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page: Thinkphp中常用功能"><i class="fa fa-angle-left"></i></a>
</div>
</div>
<script src="../../gitbook/app.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
<script>
require(["gitbook"], function(gitbook) {
var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
gitbook.start(config);
});
</script>
</body>
</html>
<!DOCTYPE HTML>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>Thinkphp中常用功能 | Introduction</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="description" content="">
<meta name="generator" content="GitBook 2.6.7">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="../../gitbook/style.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
<link rel="next" href="../../Thinkphp/Others/UsefulCodes.html" />
<link rel="prev" href="../../Thinkphp/DB/db_sqls.html" />
</head>
<body>
<div class="book"
data-level="1.6.1"
data-chapter-title="Thinkphp中常用功能"
data-filepath="Thinkphp/Others/functions.md"
data-basepath="../.."
data-revision="Wed May 11 2016 00:54:11 GMT+0800 (中国标准时间)"
data-innerlanguage="">
<div class="book-summary">
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="0" data-path="index.html">
<a href="../../index.html">
<i class="fa fa-check"></i>
简介
</a>
</li>
<li class="chapter " data-level="1" >
<span><b>1.</b> Thinkphp</span>
<ul class="articles">
<li class="chapter " data-level="1.1" >
<span><b>1.1.</b> Structure</span>
<ul class="articles">
<li class="chapter " data-level="1.1.1" data-path="Thinkphp/Structure/evshop_structure.html">
<a href="../../Thinkphp/Structure/evshop_structure.html">
<i class="fa fa-check"></i>
<b>1.1.1.</b>
EVShop框架结构图
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.2" >
<span><b>1.2.</b> Controller</span>
<ul class="articles">
<li class="chapter " data-level="1.2.1" data-path="Thinkphp/Controller/evshop_controller.html">
<a href="../../Thinkphp/Controller/evshop_controller.html">
<i class="fa fa-check"></i>
<b>1.2.1.</b>
EVShop之Controller篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3" >
<span><b>1.3.</b> View</span>
<ul class="articles">
<li class="chapter " data-level="1.3.1" data-path="Thinkphp/View/evshop_view.html">
<a href="../../Thinkphp/View/evshop_view.html">
<i class="fa fa-check"></i>
<b>1.3.1.</b>
EVShop之View篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4" >
<span><b>1.4.</b> Javascript</span>
<ul class="articles">
<li class="chapter " data-level="1.4.1" data-path="Thinkphp/Javascript/evshop_dialog.html">
<a href="../../Thinkphp/Javascript/evshop_dialog.html">
<i class="fa fa-check"></i>
<b>1.4.1.</b>
EVShop之Dialog篇
</a>
</li>
<li class="chapter " data-level="1.4.2" data-path="Thinkphp/Javascript/evshop_js.html">
<a href="../../Thinkphp/Javascript/evshop_js.html">
<i class="fa fa-check"></i>
<b>1.4.2.</b>
EVShop之Javascript篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.5" >
<span><b>1.5.</b> DB</span>
<ul class="articles">
<li class="chapter " data-level="1.5.1" data-path="Thinkphp/DB/db_sqls.html">
<a href="../../Thinkphp/DB/db_sqls.html">
<i class="fa fa-check"></i>
<b>1.5.1.</b>
Thinkphp中SQL的写法
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.6" >
<span><b>1.6.</b> Others</span>
<ul class="articles">
<li class="chapter active" data-level="1.6.1" data-path="Thinkphp/Others/functions.html">
<a href="../../Thinkphp/Others/functions.html">
<i class="fa fa-check"></i>
<b>1.6.1.</b>
Thinkphp中常用功能
</a>
</li>
<li class="chapter " data-level="1.6.2" data-path="Thinkphp/Others/UsefulCodes.html">
<a href="../../Thinkphp/Others/UsefulCodes.html">
<i class="fa fa-check"></i>
<b>1.6.2.</b>
EVShop中备用代码片段
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Actions Left -->
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href="../../" >Introduction</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<section class="normal" id="section-">
<h1 id="thinkphp&#x4E2D;&#x4E00;&#x4E9B;&#x5E38;&#x7528;&#x529F;&#x80FD;">Thinkphp&#x4E2D;&#x4E00;&#x4E9B;&#x5E38;&#x7528;&#x529F;&#x80FD;</h1>
<h3 id="1-&#x52A0;&#x5165;&#x9A8C;&#x8BC1;&#x7801;&#x529F;&#x80FD;">1. &#x52A0;&#x5165;&#x9A8C;&#x8BC1;&#x7801;&#x529F;&#x80FD;</h3>
<p>Think\Verify&#x7C7B;&#x53EF;&#x4EE5;&#x652F;&#x6301;&#x9A8C;&#x8BC1;&#x7801;&#x7684;&#x751F;&#x6210;&#x548C;&#x9A8C;&#x8BC1;&#x529F;&#x80FD;&#x3002;</p>
<blockquote>
<p>&#x53C2;&#x8003;&#xFF1A;<a href="http://document.thinkphp.cn/manual_3_2.html#verify" target="_blank">Thinkphp&#x9A8C;&#x8BC1;&#x7801;</a></p>
</blockquote>
<p>&#x4E0B;&#x9762;&#x662F;&#x6700;&#x7B80;&#x5355;&#x7684;&#x65B9;&#x5F0F;&#x751F;&#x6210;&#x9A8C;&#x8BC1;&#x7801;&#xFF1A;</p>
<pre><code>$Verify = new \Think\Verify();
$Verify-&gt;entry();
</code></pre><hr>
<h3 id="2-&#x6587;&#x4EF6;&#x4E0A;&#x4F20;&#x540E;&#x53F0;">2. &#x6587;&#x4EF6;&#x4E0A;&#x4F20;(&#x540E;&#x53F0;)</h3>
<pre><code>use Library\UploadFile;
if (!empty($_FILES[&apos;group_logo&apos;][&apos;name&apos;])){
$upload = new UploadFile();
$upload-&gt;set(&apos;default_dir&apos;,ATTACH_COMMON);
$upload-&gt;set(&apos;file_name&apos;,&apos;category-pic-&apos;.$newClassId.&apos;.jpg&apos;);
$upload-&gt;set(&apos;ifremove&apos;,false);
$upload-&gt;set(&apos;fprefix&apos;,&apos;fprefix&apos;);
$upload-&gt;set(&apos;ext&apos;,&apos;ext&apos;);
if ($result){
$this-&gt;success(&quot;&#x4E0A;&#x4F20;&#x56FE;&#x7247;&#x6210;&#x529F;&quot;);
}else {
$this-&gt;error(&quot;&#x4E0A;&#x4F20;&#x56FE;&#x7247;&#x5931;&#x8D25;&quot;);
}
}
</code></pre><hr>
<h3 id="3-&#x56FE;&#x50CF;&#x5904;&#x7406;">3. &#x56FE;&#x50CF;&#x5904;&#x7406;</h3>
<p>Todo : write here</p>
<hr>
<h3 id="4-ip&#x83B7;&#x53D6;">4. IP&#x83B7;&#x53D6;</h3>
<p>&#x5185;&#x7F6E;&#x4E86;get_client_ip&#x65B9;&#x6CD5;&#x7528;&#x4E8E;&#x83B7;&#x53D6;&#x5BA2;&#x6237;&#x7AEF;&#x7684;IP&#x5730;&#x5740;</p>
<ul>
<li>&#x83B7;&#x53D6;IP&#x793A;&#x4F8B;&#xFF1A;
<code>$ip = get_client_ip();</code></li>
<li>IP&#x5B9A;&#x4F4D;&#x793A;&#x4F8B;:<pre><code>$Ip = new \Org\Net\IpLocation(&apos;UTFWry.dat&apos;); // &#x5B9E;&#x4F8B;&#x5316;&#x7C7B; &#x53C2;&#x6570;&#x8868;&#x793A;IP&#x5730;&#x5740;&#x5E93;&#x6587;&#x4EF6;
$area = $Ip-&gt;getlocation(&apos;203.34.5.66&apos;); // &#x83B7;&#x53D6;&#x67D0;&#x4E2A;IP&#x5730;&#x5740;&#x6240;&#x5728;&#x7684;&#x4F4D;&#x7F6E;
</code></pre></li>
</ul>
<hr>
<h3 id="5-&#x5B57;&#x7B26;&#x8F6C;&#x6362;&#x6210;&#x4E8C;&#x7EF4;&#x7801;">5. &#x5B57;&#x7B26;&#x8F6C;&#x6362;&#x6210;&#x4E8C;&#x7EF4;&#x7801;</h3>
<p>&#x751F;&#x6210;&#x5E26;&#x6709;LOGO&#x7684;&#x4E8C;&#x7EF4;&#x7801;&#xFF0C;&#x53EF;&#x4EE5;&#x53C2;&#x8003;:</p>
<blockquote>
<p>&#x53C2;&#x8003;&#xFF1A; <a href="http://www.cnblogs.com/txw1958/p/phpqrcode.html" target="_blank">&#x5E26;&#x6709;LOGO&#x4E8C;&#x7EF4;&#x7801;</a></p>
</blockquote>
<p>&#x4E8C;&#x7EF4;&#x7801;&#x8F6C;&#x6362;&#x5B9E;&#x73B0;:</p>
<pre><code>use Library\QRcode;
include_once &apos;/app/Library/phpqrcode.php&apos;;
$test=&quot;http://www.evate-soft.com/&quot;;
$filename = &quot;baidu.png&quot;;
$level=&apos;L&apos;;
$size = &apos;6&apos;;
$margin=4;
QRcode::png($test, false, $level, $size, $margin);
</code></pre>
</section>
</div>
</div>
</div>
<a href="../../Thinkphp/DB/db_sqls.html" class="navigation navigation-prev " aria-label="Previous page: Thinkphp中SQL的写法"><i class="fa fa-angle-left"></i></a>
<a href="../../Thinkphp/Others/UsefulCodes.html" class="navigation navigation-next " aria-label="Next page: EVShop中备用代码片段"><i class="fa fa-angle-right"></i></a>
</div>
</div>
<script src="../../gitbook/app.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
<script>
require(["gitbook"], function(gitbook) {
var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
gitbook.start(config);
});
</script>
</body>
</html>
<!DOCTYPE HTML>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>EVShop框架结构图 | Introduction</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="description" content="">
<meta name="generator" content="GitBook 2.6.7">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="../../gitbook/style.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
<link rel="next" href="../../Thinkphp/Controller/evshop_controller.html" />
<link rel="prev" href="../../index.html" />
</head>
<body>
<div class="book"
data-level="1.1.1"
data-chapter-title="EVShop框架结构图"
data-filepath="Thinkphp/Structure/evshop_structure.md"
data-basepath="../.."
data-revision="Wed May 11 2016 00:54:11 GMT+0800 (中国标准时间)"
data-innerlanguage="">
<div class="book-summary">
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="0" data-path="index.html">
<a href="../../index.html">
<i class="fa fa-check"></i>
简介
</a>
</li>
<li class="chapter " data-level="1" >
<span><b>1.</b> Thinkphp</span>
<ul class="articles">
<li class="chapter " data-level="1.1" >
<span><b>1.1.</b> Structure</span>
<ul class="articles">
<li class="chapter active" data-level="1.1.1" data-path="Thinkphp/Structure/evshop_structure.html">
<a href="../../Thinkphp/Structure/evshop_structure.html">
<i class="fa fa-check"></i>
<b>1.1.1.</b>
EVShop框架结构图
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.2" >
<span><b>1.2.</b> Controller</span>
<ul class="articles">
<li class="chapter " data-level="1.2.1" data-path="Thinkphp/Controller/evshop_controller.html">
<a href="../../Thinkphp/Controller/evshop_controller.html">
<i class="fa fa-check"></i>
<b>1.2.1.</b>
EVShop之Controller篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3" >
<span><b>1.3.</b> View</span>
<ul class="articles">
<li class="chapter " data-level="1.3.1" data-path="Thinkphp/View/evshop_view.html">
<a href="../../Thinkphp/View/evshop_view.html">
<i class="fa fa-check"></i>
<b>1.3.1.</b>
EVShop之View篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4" >
<span><b>1.4.</b> Javascript</span>
<ul class="articles">
<li class="chapter " data-level="1.4.1" data-path="Thinkphp/Javascript/evshop_dialog.html">
<a href="../../Thinkphp/Javascript/evshop_dialog.html">
<i class="fa fa-check"></i>
<b>1.4.1.</b>
EVShop之Dialog篇
</a>
</li>
<li class="chapter " data-level="1.4.2" data-path="Thinkphp/Javascript/evshop_js.html">
<a href="../../Thinkphp/Javascript/evshop_js.html">
<i class="fa fa-check"></i>
<b>1.4.2.</b>
EVShop之Javascript篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.5" >
<span><b>1.5.</b> DB</span>
<ul class="articles">
<li class="chapter " data-level="1.5.1" data-path="Thinkphp/DB/db_sqls.html">
<a href="../../Thinkphp/DB/db_sqls.html">
<i class="fa fa-check"></i>
<b>1.5.1.</b>
Thinkphp中SQL的写法
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.6" >
<span><b>1.6.</b> Others</span>
<ul class="articles">
<li class="chapter " data-level="1.6.1" data-path="Thinkphp/Others/functions.html">
<a href="../../Thinkphp/Others/functions.html">
<i class="fa fa-check"></i>
<b>1.6.1.</b>
Thinkphp中常用功能
</a>
</li>
<li class="chapter " data-level="1.6.2" data-path="Thinkphp/Others/UsefulCodes.html">
<a href="../../Thinkphp/Others/UsefulCodes.html">
<i class="fa fa-check"></i>
<b>1.6.2.</b>
EVShop中备用代码片段
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Actions Left -->
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href="../../" >Introduction</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<section class="normal" id="section-">
<h1 id="evshop&#x7A0B;&#x5E8F;&#x6846;&#x67B6;&#x6574;&#x4F53;&#x7ED3;&#x6784;&#x56FE;">EVShop&#x7A0B;&#x5E8F;&#x6846;&#x67B6;&#x6574;&#x4F53;&#x7ED3;&#x6784;&#x56FE;</h1>
<blockquote>
<p>&#x5F85;&#x5B8C;&#x6210;</p>
</blockquote>
</section>
</div>
</div>
</div>
<a href="../../index.html" class="navigation navigation-prev " aria-label="Previous page: 简介"><i class="fa fa-angle-left"></i></a>
<a href="../../Thinkphp/Controller/evshop_controller.html" class="navigation navigation-next " aria-label="Next page: EVShop之Controller篇"><i class="fa fa-angle-right"></i></a>
</div>
</div>
<script src="../../gitbook/app.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
<script>
require(["gitbook"], function(gitbook) {
var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
gitbook.start(config);
});
</script>
</body>
</html>
<!DOCTYPE HTML>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>EVShop之View篇 | Introduction</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="description" content="">
<meta name="generator" content="GitBook 2.6.7">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="../../gitbook/style.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="../../gitbook/plugins/gitbook-plugin-fontsettings/website.css">
<link rel="next" href="../../Thinkphp/Javascript/evshop_dialog.html" />
<link rel="prev" href="../../Thinkphp/Controller/evshop_controller.html" />
</head>
<body>
<div class="book"
data-level="1.3.1"
data-chapter-title="EVShop之View篇"
data-filepath="Thinkphp/View/evshop_view.md"
data-basepath="../.."
data-revision="Wed May 11 2016 00:54:11 GMT+0800 (中国标准时间)"
data-innerlanguage="">
<div class="book-summary">
<nav role="navigation">
<ul class="summary">
<li class="chapter " data-level="0" data-path="index.html">
<a href="../../index.html">
<i class="fa fa-check"></i>
简介
</a>
</li>
<li class="chapter " data-level="1" >
<span><b>1.</b> Thinkphp</span>
<ul class="articles">
<li class="chapter " data-level="1.1" >
<span><b>1.1.</b> Structure</span>
<ul class="articles">
<li class="chapter " data-level="1.1.1" data-path="Thinkphp/Structure/evshop_structure.html">
<a href="../../Thinkphp/Structure/evshop_structure.html">
<i class="fa fa-check"></i>
<b>1.1.1.</b>
EVShop框架结构图
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.2" >
<span><b>1.2.</b> Controller</span>
<ul class="articles">
<li class="chapter " data-level="1.2.1" data-path="Thinkphp/Controller/evshop_controller.html">
<a href="../../Thinkphp/Controller/evshop_controller.html">
<i class="fa fa-check"></i>
<b>1.2.1.</b>
EVShop之Controller篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3" >
<span><b>1.3.</b> View</span>
<ul class="articles">
<li class="chapter active" data-level="1.3.1" data-path="Thinkphp/View/evshop_view.html">
<a href="../../Thinkphp/View/evshop_view.html">
<i class="fa fa-check"></i>
<b>1.3.1.</b>
EVShop之View篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4" >
<span><b>1.4.</b> Javascript</span>
<ul class="articles">
<li class="chapter " data-level="1.4.1" data-path="Thinkphp/Javascript/evshop_dialog.html">
<a href="../../Thinkphp/Javascript/evshop_dialog.html">
<i class="fa fa-check"></i>
<b>1.4.1.</b>
EVShop之Dialog篇
</a>
</li>
<li class="chapter " data-level="1.4.2" data-path="Thinkphp/Javascript/evshop_js.html">
<a href="../../Thinkphp/Javascript/evshop_js.html">
<i class="fa fa-check"></i>
<b>1.4.2.</b>
EVShop之Javascript篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.5" >
<span><b>1.5.</b> DB</span>
<ul class="articles">
<li class="chapter " data-level="1.5.1" data-path="Thinkphp/DB/db_sqls.html">
<a href="../../Thinkphp/DB/db_sqls.html">
<i class="fa fa-check"></i>
<b>1.5.1.</b>
Thinkphp中SQL的写法
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.6" >
<span><b>1.6.</b> Others</span>
<ul class="articles">
<li class="chapter " data-level="1.6.1" data-path="Thinkphp/Others/functions.html">
<a href="../../Thinkphp/Others/functions.html">
<i class="fa fa-check"></i>
<b>1.6.1.</b>
Thinkphp中常用功能
</a>
</li>
<li class="chapter " data-level="1.6.2" data-path="Thinkphp/Others/UsefulCodes.html">
<a href="../../Thinkphp/Others/UsefulCodes.html">
<i class="fa fa-check"></i>
<b>1.6.2.</b>
EVShop中备用代码片段
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Actions Left -->
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href="../../" >Introduction</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<section class="normal" id="section-">
<h1 id="evshop&#x7F16;&#x7A0B;&#x89C4;&#x5219;&#x4E4B;view&#x7BC7;">EVShop&#x7F16;&#x7A0B;&#x89C4;&#x5219;&#x4E4B;View&#x7BC7;</h1>
<h3 id="1-&#x7CFB;&#x7EDF;&#x53D8;&#x91CF;&#x548C;&#x914D;&#x7F6E;&#x53D8;&#x91CF;">1. &#x7CFB;&#x7EDF;&#x53D8;&#x91CF;&#x548C;&#x914D;&#x7F6E;&#x53D8;&#x91CF;</h3>
<p>&#x7CFB;&#x7EDF;&#x53D8;&#x91CF;&#x7684;&#x8F93;&#x51FA;&#x901A;&#x5E38;&#x4EE5;$Think &#x6253;&#x5934;,&#x6BD4;&#x5982;:</p>
<pre><code>1. {$Think.server.script_name} // &#x8F93;&#x51FA;$_SERVER[&apos;SCRIPT_NAME&apos;]&#x53D8;&#x91CF;
2. {$Think.session.user_id} // &#x8F93;&#x51FA;$_SESSION[&apos;user_id&apos;]&#x53D8;&#x91CF;
3. {$Think.get.pageNumber} // &#x8F93;&#x51FA;$_GET[&apos;pageNumber&apos;]&#x53D8;&#x91CF;
4. {$Think.cookie.name} // &#x8F93;&#x51FA;$_COOKIE[&apos;name&apos;]&#x53D8;&#x91CF;
5. {$Think.const.MODULE_NAME} &#x8F93;&#x51FA;&#x5E38;&#x91CF;
6. {$Think.config.url_model} // &#x914D;&#x7F6E;&#x53C2;&#x6570;&#xFF08;&#x5728;config.php)&#x4E2D;&#x8BBE;&#x5B9A;
7. {$Think.MODULE_NAME} // &#x6A21;&#x5757;&#x540D;&#x79F0;
</code></pre><hr>
<h3 id="2-view&#x4E2D;&#x5C06;php&#x53D8;&#x91CF;&#x503C;&#x4F20;&#x9012;&#x5230;&#x524D;&#x7AEF;js&#x6587;&#x4EF6;">2. View&#x4E2D;&#x5C06;php&#x53D8;&#x91CF;&#x503C;&#x4F20;&#x9012;&#x5230;&#x524D;&#x7AEF;JS&#x6587;&#x4EF6;</h3>
<p>&#x9700;&#x8981;&#x4E24;&#x4E2A;&#x6B65;&#x9AA4;:</p>
<ol>
<li>View&#x4E2D;&#x5B9A;&#x4E49;pageParam&#x5B57;&#x9762;&#x91CF;&#x5BF9;&#x8C61;<pre><code>&lt;script&gt;
var pageParam = {
s:&quot;page1&quot;,
};
&lt;/script&gt;
</code></pre></li>
<li>&#x5728;js&#x7684;initialize()&#x51FD;&#x6570;&#x4E2D;&#x76F4;&#x63A5;&#x4F7F;&#x7528;options.pageParam&#x5C5E;&#x6027;<pre><code>var PageModel = function (options) {
this.pageName = options.page;
this.module = options.module;
this.pageParam = options.pageParam;
this.languageData = new LanguageData(&quot;member_group_index&quot;);
}
</code></pre></li>
</ol>
<p>&#x5982;&#x679C;&#x9700;&#x8981;&#x5C06;&#x53D8;&#x91CF;&#x8F6C;&#x6362;&#x6210;JSON&#x4F20;&#x9012;&#x5230;&#x524D;&#x7AEF;js&#x4E2D;:</p>
<pre><code>&lt;script&gt;
var pageParam = {
language: &lt;?php echo json_encode($lang) ?&gt;,
};
&lt;/script&gt;
</code></pre>
</section>
</div>
</div>
</div>
<a href="../../Thinkphp/Controller/evshop_controller.html" class="navigation navigation-prev " aria-label="Previous page: EVShop之Controller篇"><i class="fa fa-angle-left"></i></a>
<a href="../../Thinkphp/Javascript/evshop_dialog.html" class="navigation navigation-next " aria-label="Next page: EVShop之Dialog篇"><i class="fa fa-angle-right"></i></a>
</div>
</div>
<script src="../../gitbook/app.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-search/search.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
<script src="../../gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
<script>
require(["gitbook"], function(gitbook) {
var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
gitbook.start(config);
});
</script>
</body>
</html>
This diff could not be displayed because it is too large.
This diff could not be displayed because it is too large.
require(["gitbook", "lodash", "jQuery"], function(gitbook, _, $) {
var fontState;
var THEMES = {
"white": 0,
"sepia": 1,
"night": 2
};
var FAMILY = {
"serif": 0,
"sans": 1
};
// Save current font settings
function saveFontSettings() {
gitbook.storage.set("fontState", fontState);
update();
}
// Increase font size
function enlargeFontSize(e) {
e.preventDefault();
if (fontState.size >= 4) return;
fontState.size++;
saveFontSettings();
};
// Decrease font size
function reduceFontSize(e) {
e.preventDefault();
if (fontState.size <= 0) return;
fontState.size--;
saveFontSettings();
};
// Change font family
function changeFontFamily(index, e) {
e.preventDefault();
fontState.family = index;
saveFontSettings();
};
// Change type of color
function changeColorTheme(index, e) {
e.preventDefault();
var $book = $(".book");
if (fontState.theme !== 0)
$book.removeClass("color-theme-"+fontState.theme);
fontState.theme = index;
if (fontState.theme !== 0)
$book.addClass("color-theme-"+fontState.theme);
saveFontSettings();
};
function update() {
var $book = gitbook.state.$book;
$(".font-settings .font-family-list li").removeClass("active");
$(".font-settings .font-family-list li:nth-child("+(fontState.family+1)+")").addClass("active");
$book[0].className = $book[0].className.replace(/\bfont-\S+/g, '');
$book.addClass("font-size-"+fontState.size);
$book.addClass("font-family-"+fontState.family);
if(fontState.theme !== 0) {
$book[0].className = $book[0].className.replace(/\bcolor-theme-\S+/g, '');
$book.addClass("color-theme-"+fontState.theme);
}
};
function init(config) {
var $bookBody, $book;
//Find DOM elements.
$book = gitbook.state.$book;
$bookBody = $book.find(".book-body");
// Instantiate font state object
fontState = gitbook.storage.get("fontState", {
size: config.size || 2,
family: FAMILY[config.family || "sans"],
theme: THEMES[config.theme || "white"]
});
update();
};
gitbook.events.bind("start", function(e, config) {
var opts = config.fontsettings;
// Create buttons in toolbar
gitbook.toolbar.createButton({
icon: 'fa fa-font',
label: 'Font Settings',
className: 'font-settings',
dropdown: [
[
{
text: 'A',
className: 'font-reduce',
onClick: reduceFontSize
},
{
text: 'A',
className: 'font-enlarge',
onClick: enlargeFontSize
}
],
[
{
text: 'Serif',
onClick: _.partial(changeFontFamily, 0)
},
{
text: 'Sans',
onClick: _.partial(changeFontFamily, 1)
}
],
[
{
text: 'White',
onClick: _.partial(changeColorTheme, 0)
},
{
text: 'Sepia',
onClick: _.partial(changeColorTheme, 1)
},
{
text: 'Night',
onClick: _.partial(changeColorTheme, 2)
}
]
]
});
// Init current settings
init(opts);
});
});
/*
* Theme 1
*/
.color-theme-1 .dropdown-menu {
background-color: #111111;
border-color: #7e888b;
}
.color-theme-1 .dropdown-menu .dropdown-caret .caret-inner {
border-bottom: 9px solid #111111;
}
.color-theme-1 .dropdown-menu .buttons {
border-color: #7e888b;
}
.color-theme-1 .dropdown-menu .button {
color: #afa790;
}
.color-theme-1 .dropdown-menu .button:hover {
color: #73553c;
}
/*
* Theme 2
*/
.color-theme-2 .dropdown-menu {
background-color: #2d3143;
border-color: #272a3a;
}
.color-theme-2 .dropdown-menu .dropdown-caret .caret-inner {
border-bottom: 9px solid #2d3143;
}
.color-theme-2 .dropdown-menu .buttons {
border-color: #272a3a;
}
.color-theme-2 .dropdown-menu .button {
color: #62677f;
}
.color-theme-2 .dropdown-menu .button:hover {
color: #f4f4f5;
}
.book .book-header .font-settings .font-enlarge {
line-height: 30px;
font-size: 1.4em;
}
.book .book-header .font-settings .font-reduce {
line-height: 30px;
font-size: 1em;
}
.book.color-theme-1 .book-body {
color: #704214;
background: #f3eacb;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section {
background: #f3eacb;
}
.book.color-theme-2 .book-body {
color: #bdcadb;
background: #1c1f2b;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section {
background: #1c1f2b;
}
.book.font-size-0 .book-body .page-inner section {
font-size: 1.2rem;
}
.book.font-size-1 .book-body .page-inner section {
font-size: 1.4rem;
}
.book.font-size-2 .book-body .page-inner section {
font-size: 1.6rem;
}
.book.font-size-3 .book-body .page-inner section {
font-size: 2.2rem;
}
.book.font-size-4 .book-body .page-inner section {
font-size: 4rem;
}
.book.font-family-0 {
font-family: Georgia, serif;
}
.book.font-family-1 {
font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal {
color: #704214;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal a {
color: inherit;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h3,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h4,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h5,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h6 {
color: inherit;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2 {
border-color: inherit;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h6 {
color: inherit;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal hr {
background-color: inherit;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal blockquote {
border-color: inherit;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code {
background: #fdf6e3;
color: #657b83;
border-color: #f8df9c;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal .highlight {
background-color: inherit;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table th,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table td {
border-color: #f5d06c;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table tr {
color: inherit;
background-color: #fdf6e3;
border-color: #444444;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) {
background-color: #fbeecb;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal {
color: #bdcadb;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal a {
color: #3eb1d0;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h3,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h4,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h5,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h6 {
color: #fffffa;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2 {
border-color: #373b4e;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h6 {
color: #373b4e;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal hr {
background-color: #373b4e;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal blockquote {
border-color: #373b4e;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code {
color: #9dbed8;
background: #2d3143;
border-color: #2d3143;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal .highlight {
background-color: #282a39;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table th,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table td {
border-color: #3b3f54;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table tr {
color: #b6c2d2;
background-color: #2d3143;
border-color: #3b3f54;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) {
background-color: #35394b;
}
.book.color-theme-1 .book-header {
color: #afa790;
background: transparent;
}
.book.color-theme-1 .book-header .btn {
color: #afa790;
}
.book.color-theme-1 .book-header .btn:hover {
color: #73553c;
background: none;
}
.book.color-theme-1 .book-header h1 {
color: #704214;
}
.book.color-theme-2 .book-header {
color: #7e888b;
background: transparent;
}
.book.color-theme-2 .book-header .btn {
color: #3b3f54;
}
.book.color-theme-2 .book-header .btn:hover {
color: #fffff5;
background: none;
}
.book.color-theme-2 .book-header h1 {
color: #bdcadb;
}
.book.color-theme-1 .book-body .navigation {
color: #afa790;
}
.book.color-theme-1 .book-body .navigation:hover {
color: #73553c;
}
.book.color-theme-2 .book-body .navigation {
color: #383f52;
}
.book.color-theme-2 .book-body .navigation:hover {
color: #fffff5;
}
/*
* Theme 1
*/
.book.color-theme-1 .book-summary {
color: #afa790;
background: #111111;
border-right: 1px solid rgba(0, 0, 0, 0.07);
}
.book.color-theme-1 .book-summary .book-search {
background: transparent;
}
.book.color-theme-1 .book-summary .book-search input,
.book.color-theme-1 .book-summary .book-search input:focus {
border: 1px solid transparent;
}
.book.color-theme-1 .book-summary ul.summary li.divider {
background: #7e888b;
box-shadow: none;
}
.book.color-theme-1 .book-summary ul.summary li i.fa-check {
color: #33cc33;
}
.book.color-theme-1 .book-summary ul.summary li.done > a {
color: #877f6a;
}
.book.color-theme-1 .book-summary ul.summary li a,
.book.color-theme-1 .book-summary ul.summary li span {
color: #877f6a;
background: transparent;
font-weight: normal;
}
.book.color-theme-1 .book-summary ul.summary li.active > a,
.book.color-theme-1 .book-summary ul.summary li a:hover {
color: #704214;
background: transparent;
font-weight: normal;
}
/*
* Theme 2
*/
.book.color-theme-2 .book-summary {
color: #bcc1d2;
background: #2d3143;
border-right: none;
}
.book.color-theme-2 .book-summary .book-search {
background: transparent;
}
.book.color-theme-2 .book-summary .book-search input,
.book.color-theme-2 .book-summary .book-search input:focus {
border: 1px solid transparent;
}
.book.color-theme-2 .book-summary ul.summary li.divider {
background: #272a3a;
box-shadow: none;
}
.book.color-theme-2 .book-summary ul.summary li i.fa-check {
color: #33cc33;
}
.book.color-theme-2 .book-summary ul.summary li.done > a {
color: #62687f;
}
.book.color-theme-2 .book-summary ul.summary li a,
.book.color-theme-2 .book-summary ul.summary li span {
color: #c1c6d7;
background: transparent;
font-weight: 600;
}
.book.color-theme-2 .book-summary ul.summary li.active > a,
.book.color-theme-2 .book-summary ul.summary li a:hover {
color: #f4f4f5;
background: #252737;
font-weight: 600;
}
pre,
code {
/* http://jmblog.github.io/color-themes-for-highlightjs */
/* Tomorrow Comment */
/* Tomorrow Red */
/* Tomorrow Orange */
/* Tomorrow Yellow */
/* Tomorrow Green */
/* Tomorrow Aqua */
/* Tomorrow Blue */
/* Tomorrow Purple */
}
pre .hljs-comment,
code .hljs-comment,
pre .hljs-title,
code .hljs-title {
color: #8e908c;
}
pre .hljs-variable,
code .hljs-variable,
pre .hljs-attribute,
code .hljs-attribute,
pre .hljs-tag,
code .hljs-tag,
pre .hljs-regexp,
code .hljs-regexp,
pre .ruby .hljs-constant,
code .ruby .hljs-constant,
pre .xml .hljs-tag .hljs-title,
code .xml .hljs-tag .hljs-title,
pre .xml .hljs-pi,
code .xml .hljs-pi,
pre .xml .hljs-doctype,
code .xml .hljs-doctype,
pre .html .hljs-doctype,
code .html .hljs-doctype,
pre .css .hljs-id,
code .css .hljs-id,
pre .css .hljs-class,
code .css .hljs-class,
pre .css .hljs-pseudo,
code .css .hljs-pseudo {
color: #c82829;
}
pre .hljs-number,
code .hljs-number,
pre .hljs-preprocessor,
code .hljs-preprocessor,
pre .hljs-pragma,
code .hljs-pragma,
pre .hljs-built_in,
code .hljs-built_in,
pre .hljs-literal,
code .hljs-literal,
pre .hljs-params,
code .hljs-params,
pre .hljs-constant,
code .hljs-constant {
color: #f5871f;
}
pre .ruby .hljs-class .hljs-title,
code .ruby .hljs-class .hljs-title,
pre .css .hljs-rules .hljs-attribute,
code .css .hljs-rules .hljs-attribute {
color: #eab700;
}
pre .hljs-string,
code .hljs-string,
pre .hljs-value,
code .hljs-value,
pre .hljs-inheritance,
code .hljs-inheritance,
pre .hljs-header,
code .hljs-header,
pre .ruby .hljs-symbol,
code .ruby .hljs-symbol,
pre .xml .hljs-cdata,
code .xml .hljs-cdata {
color: #718c00;
}
pre .css .hljs-hexcolor,
code .css .hljs-hexcolor {
color: #3e999f;
}
pre .hljs-function,
code .hljs-function,
pre .python .hljs-decorator,
code .python .hljs-decorator,
pre .python .hljs-title,
code .python .hljs-title,
pre .ruby .hljs-function .hljs-title,
code .ruby .hljs-function .hljs-title,
pre .ruby .hljs-title .hljs-keyword,
code .ruby .hljs-title .hljs-keyword,
pre .perl .hljs-sub,
code .perl .hljs-sub,
pre .javascript .hljs-title,
code .javascript .hljs-title,
pre .coffeescript .hljs-title,
code .coffeescript .hljs-title {
color: #4271ae;
}
pre .hljs-keyword,
code .hljs-keyword,
pre .javascript .hljs-function,
code .javascript .hljs-function {
color: #8959a8;
}
pre .hljs,
code .hljs {
display: block;
background: white;
color: #4d4d4c;
padding: 0.5em;
}
pre .coffeescript .javascript,
code .coffeescript .javascript,
pre .javascript .xml,
code .javascript .xml,
pre .tex .hljs-formula,
code .tex .hljs-formula,
pre .xml .javascript,
code .xml .javascript,
pre .xml .vbscript,
code .xml .vbscript,
pre .xml .css,
code .xml .css,
pre .xml .hljs-cdata,
code .xml .hljs-cdata {
opacity: 0.5;
}
.book .book-body .page-wrapper .page-inner section.normal pre,
.book .book-body .page-wrapper .page-inner section.normal code {
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
/* Tomorrow Comment */
/* Tomorrow Red */
/* Tomorrow Orange */
/* Tomorrow Yellow */
/* Tomorrow Green */
/* Tomorrow Aqua */
/* Tomorrow Blue */
/* Tomorrow Purple */
}
.book .book-body .page-wrapper .page-inner section.normal pre .hljs-comment,
.book .book-body .page-wrapper .page-inner section.normal code .hljs-comment,
.book .book-body .page-wrapper .page-inner section.normal pre .hljs-title,
.book .book-body .page-wrapper .page-inner section.normal code .hljs-title {
color: #8e908c;
}
.book .book-body .page-wrapper .page-inner section.normal pre .hljs-variable,
.book .book-body .page-wrapper .page-inner section.normal code .hljs-variable,
.book .book-body .page-wrapper .page-inner section.normal pre .hljs-attribute,
.book .book-body .page-wrapper .page-inner section.normal code .hljs-attribute,
.book .book-body .page-wrapper .page-inner section.normal pre .hljs-tag,
.book .book-body .page-wrapper .page-inner section.normal code .hljs-tag,
.book .book-body .page-wrapper .page-inner section.normal pre .hljs-regexp,
.book .book-body .page-wrapper .page-inner section.normal code .hljs-regexp,
.book .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-constant,
.book .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-constant,
.book .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-tag .hljs-title,
.book .book-body .page-wrapper .page-inner section.normal code .xml .hljs-tag .hljs-title,
.book .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-pi,
.book .book-body .page-wrapper .page-inner section.normal code .xml .hljs-pi,
.book .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-doctype,
.book .book-body .page-wrapper .page-inner section.normal code .xml .hljs-doctype,
.book .book-body .page-wrapper .page-inner section.normal pre .html .hljs-doctype,
.book .book-body .page-wrapper .page-inner section.normal code .html .hljs-doctype,
.book .book-body .page-wrapper .page-inner section.normal pre .css .hljs-id,
.book .book-body .page-wrapper .page-inner section.normal code .css .hljs-id,
.book .book-body .page-wrapper .page-inner section.normal pre .css .hljs-class,
.book .book-body .page-wrapper .page-inner section.normal code .css .hljs-class,
.book .book-body .page-wrapper .page-inner section.normal pre .css .hljs-pseudo,
.book .book-body .page-wrapper .page-inner section.normal code .css .hljs-pseudo {
color: #c82829;
}
.book .book-body .page-wrapper .page-inner section.normal pre .hljs-number,
.book .book-body .page-wrapper .page-inner section.normal code .hljs-number,
.book .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor,
.book .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor,
.book .book-body .page-wrapper .page-inner section.normal pre .hljs-pragma,
.book .book-body .page-wrapper .page-inner section.normal code .hljs-pragma,
.book .book-body .page-wrapper .page-inner section.normal pre .hljs-built_in,
.book .book-body .page-wrapper .page-inner section.normal code .hljs-built_in,
.book .book-body .page-wrapper .page-inner section.normal pre .hljs-literal,
.book .book-body .page-wrapper .page-inner section.normal code .hljs-literal,
.book .book-body .page-wrapper .page-inner section.normal pre .hljs-params,
.book .book-body .page-wrapper .page-inner section.normal code .hljs-params,
.book .book-body .page-wrapper .page-inner section.normal pre .hljs-constant,
.book .book-body .page-wrapper .page-inner section.normal code .hljs-constant {
color: #f5871f;
}
.book .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-class .hljs-title,
.book .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-class .hljs-title,
.book .book-body .page-wrapper .page-inner section.normal pre .css .hljs-rules .hljs-attribute,
.book .book-body .page-wrapper .page-inner section.normal code .css .hljs-rules .hljs-attribute {
color: #eab700;
}
.book .book-body .page-wrapper .page-inner section.normal pre .hljs-string,
.book .book-body .page-wrapper .page-inner section.normal code .hljs-string,
.book .book-body .page-wrapper .page-inner section.normal pre .hljs-value,
.book .book-body .page-wrapper .page-inner section.normal code .hljs-value,
.book .book-body .page-wrapper .page-inner section.normal pre .hljs-inheritance,
.book .book-body .page-wrapper .page-inner section.normal code .hljs-inheritance,
.book .book-body .page-wrapper .page-inner section.normal pre .hljs-header,
.book .book-body .page-wrapper .page-inner section.normal code .hljs-header,
.book .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-symbol,
.book .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-symbol,
.book .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-cdata,
.book .book-body .page-wrapper .page-inner section.normal code .xml .hljs-cdata {
color: #718c00;
}
.book .book-body .page-wrapper .page-inner section.normal pre .css .hljs-hexcolor,
.book .book-body .page-wrapper .page-inner section.normal code .css .hljs-hexcolor {
color: #3e999f;
}
.book .book-body .page-wrapper .page-inner section.normal pre .hljs-function,
.book .book-body .page-wrapper .page-inner section.normal code .hljs-function,
.book .book-body .page-wrapper .page-inner section.normal pre .python .hljs-decorator,
.book .book-body .page-wrapper .page-inner section.normal code .python .hljs-decorator,
.book .book-body .page-wrapper .page-inner section.normal pre .python .hljs-title,
.book .book-body .page-wrapper .page-inner section.normal code .python .hljs-title,
.book .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-function .hljs-title,
.book .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-function .hljs-title,
.book .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-title .hljs-keyword,
.book .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-title .hljs-keyword,
.book .book-body .page-wrapper .page-inner section.normal pre .perl .hljs-sub,
.book .book-body .page-wrapper .page-inner section.normal code .perl .hljs-sub,
.book .book-body .page-wrapper .page-inner section.normal pre .javascript .hljs-title,
.book .book-body .page-wrapper .page-inner section.normal code .javascript .hljs-title,
.book .book-body .page-wrapper .page-inner section.normal pre .coffeescript .hljs-title,
.book .book-body .page-wrapper .page-inner section.normal code .coffeescript .hljs-title {
color: #4271ae;
}
.book .book-body .page-wrapper .page-inner section.normal pre .hljs-keyword,
.book .book-body .page-wrapper .page-inner section.normal code .hljs-keyword,
.book .book-body .page-wrapper .page-inner section.normal pre .javascript .hljs-function,
.book .book-body .page-wrapper .page-inner section.normal code .javascript .hljs-function {
color: #8959a8;
}
.book .book-body .page-wrapper .page-inner section.normal pre .hljs,
.book .book-body .page-wrapper .page-inner section.normal code .hljs {
display: block;
background: white;
color: #4d4d4c;
padding: 0.5em;
}
.book .book-body .page-wrapper .page-inner section.normal pre .coffeescript .javascript,
.book .book-body .page-wrapper .page-inner section.normal code .coffeescript .javascript,
.book .book-body .page-wrapper .page-inner section.normal pre .javascript .xml,
.book .book-body .page-wrapper .page-inner section.normal code .javascript .xml,
.book .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula,
.book .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula,
.book .book-body .page-wrapper .page-inner section.normal pre .xml .javascript,
.book .book-body .page-wrapper .page-inner section.normal code .xml .javascript,
.book .book-body .page-wrapper .page-inner section.normal pre .xml .vbscript,
.book .book-body .page-wrapper .page-inner section.normal code .xml .vbscript,
.book .book-body .page-wrapper .page-inner section.normal pre .xml .css,
.book .book-body .page-wrapper .page-inner section.normal code .xml .css,
.book .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-cdata,
.book .book-body .page-wrapper .page-inner section.normal code .xml .hljs-cdata {
opacity: 0.5;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code {
/*
Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull <sourdrums@gmail.com>
*/
/* Solarized Green */
/* Solarized Cyan */
/* Solarized Blue */
/* Solarized Yellow */
/* Solarized Orange */
/* Solarized Red */
/* Solarized Violet */
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs {
display: block;
padding: 0.5em;
background: #fdf6e3;
color: #657b83;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-comment,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-comment,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-template_comment,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-template_comment,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .diff .hljs-header,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .diff .hljs-header,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-doctype,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-doctype,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-pi,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-pi,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .lisp .hljs-string,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .lisp .hljs-string,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-javadoc,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-javadoc {
color: #93a1a1;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-keyword,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-keyword,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-winutils,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-winutils,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .method,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .method,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-addition,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-addition,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-tag,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .css .hljs-tag,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-request,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-request,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-status,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-status,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .nginx .hljs-title,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .nginx .hljs-title {
color: #859900;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-number,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-number,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-command,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-command,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-string,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-string,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-tag .hljs-value,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-tag .hljs-value,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-rules .hljs-value,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-rules .hljs-value,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-phpdoc,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-phpdoc,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-regexp,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-regexp,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-hexcolor,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-hexcolor,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-link_url,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-link_url {
color: #2aa198;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-title,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-title,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-localvars,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-localvars,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-chunk,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-chunk,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-decorator,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-decorator,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-built_in,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-built_in,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-identifier,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-identifier,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .vhdl .hljs-literal,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .vhdl .hljs-literal,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-id,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-id,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-function,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .css .hljs-function {
color: #268bd2;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-attribute,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-attribute,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-variable,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-variable,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .lisp .hljs-body,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .lisp .hljs-body,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .smalltalk .hljs-number,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .smalltalk .hljs-number,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-constant,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-constant,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-class .hljs-title,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-class .hljs-title,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-parent,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-parent,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .haskell .hljs-type,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .haskell .hljs-type,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-link_reference,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-link_reference {
color: #b58900;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor .hljs-keyword,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor .hljs-keyword,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-pragma,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-pragma,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-shebang,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-shebang,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-symbol,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-symbol,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-symbol .hljs-string,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-symbol .hljs-string,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .diff .hljs-change,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .diff .hljs-change,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-special,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-special,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-attr_selector,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-attr_selector,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-subst,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-subst,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-cdata,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-cdata,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .clojure .hljs-title,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .clojure .hljs-title,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-pseudo,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .css .hljs-pseudo,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-header,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-header {
color: #cb4b16;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-deletion,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-deletion,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-important,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-important {
color: #dc322f;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-link_label,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-link_label {
color: #6c71c4;
}
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula,
.book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula {
background: #eee8d5;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code {
/* Tomorrow Night Bright Theme */
/* Original theme - https://github.com/chriskempson/tomorrow-theme */
/* http://jmblog.github.com/color-themes-for-google-code-highlightjs */
/* Tomorrow Comment */
/* Tomorrow Red */
/* Tomorrow Orange */
/* Tomorrow Yellow */
/* Tomorrow Green */
/* Tomorrow Aqua */
/* Tomorrow Blue */
/* Tomorrow Purple */
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-comment,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-comment,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-title,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-title {
color: #969896;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-variable,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-variable,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-attribute,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-attribute,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-tag,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-tag,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-regexp,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-regexp,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-constant,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-constant,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-tag .hljs-title,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-tag .hljs-title,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-pi,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-pi,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-doctype,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-doctype,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .html .hljs-doctype,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .html .hljs-doctype,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-id,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-id,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-class,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-class,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-pseudo,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-pseudo {
color: #d54e53;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-number,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-number,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-pragma,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-pragma,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-built_in,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-built_in,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-literal,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-literal,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-params,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-params,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-constant,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-constant {
color: #e78c45;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-class .hljs-title,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-class .hljs-title,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-rules .hljs-attribute,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-rules .hljs-attribute {
color: #e7c547;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-string,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-string,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-value,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-value,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-inheritance,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-inheritance,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-header,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-header,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-symbol,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-symbol,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-cdata,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-cdata {
color: #b9ca4a;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-hexcolor,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-hexcolor {
color: #70c0b1;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-function,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-function,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .python .hljs-decorator,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .python .hljs-decorator,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .python .hljs-title,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .python .hljs-title,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-function .hljs-title,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-function .hljs-title,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-title .hljs-keyword,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-title .hljs-keyword,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .perl .hljs-sub,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .perl .hljs-sub,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .javascript .hljs-title,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .javascript .hljs-title,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .coffeescript .hljs-title,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .coffeescript .hljs-title {
color: #7aa6da;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-keyword,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-keyword,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .javascript .hljs-function,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .javascript .hljs-function {
color: #c397d8;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs {
display: block;
background: black;
color: #eaeaea;
padding: 0.5em;
}
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .coffeescript .javascript,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .coffeescript .javascript,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .javascript .xml,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .javascript .xml,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .javascript,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .javascript,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .vbscript,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .vbscript,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .css,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .css,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-cdata,
.book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-cdata {
opacity: 0.5;
}
/**
* lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 0.5.12
* Copyright (C) 2015 Oliver Nightingale
* MIT Licensed
* @license
*/
!function(){var t=function(e){var n=new t.Index;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),e&&e.call(n,n),n};t.version="0.5.12",t.utils={},t.utils.warn=function(t){return function(e){t.console&&console.warn&&console.warn(e)}}(this),t.EventEmitter=function(){this.events={}},t.EventEmitter.prototype.addListener=function(){var t=Array.prototype.slice.call(arguments),e=t.pop(),n=t;if("function"!=typeof e)throw new TypeError("last argument must be a function");n.forEach(function(t){this.hasHandler(t)||(this.events[t]=[]),this.events[t].push(e)},this)},t.EventEmitter.prototype.removeListener=function(t,e){if(this.hasHandler(t)){var n=this.events[t].indexOf(e);this.events[t].splice(n,1),this.events[t].length||delete this.events[t]}},t.EventEmitter.prototype.emit=function(t){if(this.hasHandler(t)){var e=Array.prototype.slice.call(arguments,1);this.events[t].forEach(function(t){t.apply(void 0,e)})}},t.EventEmitter.prototype.hasHandler=function(t){return t in this.events},t.tokenizer=function(t){return arguments.length&&null!=t&&void 0!=t?Array.isArray(t)?t.map(function(t){return t.toLowerCase()}):t.toString().trim().toLowerCase().split(/[\s\-]+/):[]},t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions={},t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn("Function is not registered with pipeline. This may cause problems when serialising the index.\n",e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(e){var i=t.Pipeline.registeredFunctions[e];if(!i)throw new Error("Cannot load un-registered function: "+e);n.add(i)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(e){t.Pipeline.warnIfFunctionNotRegistered(e),this._stack.push(e)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(e);if(-1==i)throw new Error("Cannot find existingFn");i+=1,this._stack.splice(i,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var i=this._stack.indexOf(e);if(-1==i)throw new Error("Cannot find existingFn");this._stack.splice(i,0,n)},t.Pipeline.prototype.remove=function(t){var e=this._stack.indexOf(t);-1!=e&&this._stack.splice(e,1)},t.Pipeline.prototype.run=function(t){for(var e=[],n=t.length,i=this._stack.length,o=0;n>o;o++){for(var r=t[o],s=0;i>s&&(r=this._stack[s](r,o,t),void 0!==r);s++);void 0!==r&&e.push(r)}return e},t.Pipeline.prototype.reset=function(){this._stack=[]},t.Pipeline.prototype.toJSON=function(){return this._stack.map(function(e){return t.Pipeline.warnIfFunctionNotRegistered(e),e.label})},t.Vector=function(){this._magnitude=null,this.list=void 0,this.length=0},t.Vector.Node=function(t,e,n){this.idx=t,this.val=e,this.next=n},t.Vector.prototype.insert=function(e,n){this._magnitude=void 0;var i=this.list;if(!i)return this.list=new t.Vector.Node(e,n,i),this.length++;if(e<i.idx)return this.list=new t.Vector.Node(e,n,i),this.length++;for(var o=i,r=i.next;void 0!=r;){if(e<r.idx)return o.next=new t.Vector.Node(e,n,r),this.length++;o=r,r=r.next}return o.next=new t.Vector.Node(e,n,r),this.length++},t.Vector.prototype.magnitude=function(){if(this._magnitude)return this._magnitude;for(var t,e=this.list,n=0;e;)t=e.val,n+=t*t,e=e.next;return this._magnitude=Math.sqrt(n)},t.Vector.prototype.dot=function(t){for(var e=this.list,n=t.list,i=0;e&&n;)e.idx<n.idx?e=e.next:e.idx>n.idx?n=n.next:(i+=e.val*n.val,e=e.next,n=n.next);return i},t.Vector.prototype.similarity=function(t){return this.dot(t)/(this.magnitude()*t.magnitude())},t.SortedSet=function(){this.length=0,this.elements=[]},t.SortedSet.load=function(t){var e=new this;return e.elements=t,e.length=t.length,e},t.SortedSet.prototype.add=function(){var t,e;for(t=0;t<arguments.length;t++)e=arguments[t],~this.indexOf(e)||this.elements.splice(this.locationFor(e),0,e);this.length=this.elements.length},t.SortedSet.prototype.toArray=function(){return this.elements.slice()},t.SortedSet.prototype.map=function(t,e){return this.elements.map(t,e)},t.SortedSet.prototype.forEach=function(t,e){return this.elements.forEach(t,e)},t.SortedSet.prototype.indexOf=function(t){for(var e=0,n=this.elements.length,i=n-e,o=e+Math.floor(i/2),r=this.elements[o];i>1;){if(r===t)return o;t>r&&(e=o),r>t&&(n=o),i=n-e,o=e+Math.floor(i/2),r=this.elements[o]}return r===t?o:-1},t.SortedSet.prototype.locationFor=function(t){for(var e=0,n=this.elements.length,i=n-e,o=e+Math.floor(i/2),r=this.elements[o];i>1;)t>r&&(e=o),r>t&&(n=o),i=n-e,o=e+Math.floor(i/2),r=this.elements[o];return r>t?o:t>r?o+1:void 0},t.SortedSet.prototype.intersect=function(e){for(var n=new t.SortedSet,i=0,o=0,r=this.length,s=e.length,a=this.elements,h=e.elements;;){if(i>r-1||o>s-1)break;a[i]!==h[o]?a[i]<h[o]?i++:a[i]>h[o]&&o++:(n.add(a[i]),i++,o++)}return n},t.SortedSet.prototype.clone=function(){var e=new t.SortedSet;return e.elements=this.toArray(),e.length=e.elements.length,e},t.SortedSet.prototype.union=function(t){var e,n,i;return this.length>=t.length?(e=this,n=t):(e=t,n=this),i=e.clone(),i.add.apply(i,n.toArray()),i},t.SortedSet.prototype.toJSON=function(){return this.toArray()},t.Index=function(){this._fields=[],this._ref="id",this.pipeline=new t.Pipeline,this.documentStore=new t.Store,this.tokenStore=new t.TokenStore,this.corpusTokens=new t.SortedSet,this.eventEmitter=new t.EventEmitter,this._idfCache={},this.on("add","remove","update",function(){this._idfCache={}}.bind(this))},t.Index.prototype.on=function(){var t=Array.prototype.slice.call(arguments);return this.eventEmitter.addListener.apply(this.eventEmitter,t)},t.Index.prototype.off=function(t,e){return this.eventEmitter.removeListener(t,e)},t.Index.load=function(e){e.version!==t.version&&t.utils.warn("version mismatch: current "+t.version+" importing "+e.version);var n=new this;return n._fields=e.fields,n._ref=e.ref,n.documentStore=t.Store.load(e.documentStore),n.tokenStore=t.TokenStore.load(e.tokenStore),n.corpusTokens=t.SortedSet.load(e.corpusTokens),n.pipeline=t.Pipeline.load(e.pipeline),n},t.Index.prototype.field=function(t,e){var e=e||{},n={name:t,boost:e.boost||1};return this._fields.push(n),this},t.Index.prototype.ref=function(t){return this._ref=t,this},t.Index.prototype.add=function(e,n){var i={},o=new t.SortedSet,r=e[this._ref],n=void 0===n?!0:n;this._fields.forEach(function(n){var r=this.pipeline.run(t.tokenizer(e[n.name]));i[n.name]=r,t.SortedSet.prototype.add.apply(o,r)},this),this.documentStore.set(r,o),t.SortedSet.prototype.add.apply(this.corpusTokens,o.toArray());for(var s=0;s<o.length;s++){var a=o.elements[s],h=this._fields.reduce(function(t,e){var n=i[e.name].length;if(!n)return t;var o=i[e.name].filter(function(t){return t===a}).length;return t+o/n*e.boost},0);this.tokenStore.add(a,{ref:r,tf:h})}n&&this.eventEmitter.emit("add",e,this)},t.Index.prototype.remove=function(t,e){var n=t[this._ref],e=void 0===e?!0:e;if(this.documentStore.has(n)){var i=this.documentStore.get(n);this.documentStore.remove(n),i.forEach(function(t){this.tokenStore.remove(t,n)},this),e&&this.eventEmitter.emit("remove",t,this)}},t.Index.prototype.update=function(t,e){var e=void 0===e?!0:e;this.remove(t,!1),this.add(t,!1),e&&this.eventEmitter.emit("update",t,this)},t.Index.prototype.idf=function(t){var e="@"+t;if(Object.prototype.hasOwnProperty.call(this._idfCache,e))return this._idfCache[e];var n=this.tokenStore.count(t),i=1;return n>0&&(i=1+Math.log(this.documentStore.length/n)),this._idfCache[e]=i},t.Index.prototype.search=function(e){var n=this.pipeline.run(t.tokenizer(e)),i=new t.Vector,o=[],r=this._fields.reduce(function(t,e){return t+e.boost},0),s=n.some(function(t){return this.tokenStore.has(t)},this);if(!s)return[];n.forEach(function(e,n,s){var a=1/s.length*this._fields.length*r,h=this,l=this.tokenStore.expand(e).reduce(function(n,o){var r=h.corpusTokens.indexOf(o),s=h.idf(o),l=1,u=new t.SortedSet;if(o!==e){var c=Math.max(3,o.length-e.length);l=1/Math.log(c)}return r>-1&&i.insert(r,a*s*l),Object.keys(h.tokenStore.get(o)).forEach(function(t){u.add(t)}),n.union(u)},new t.SortedSet);o.push(l)},this);var a=o.reduce(function(t,e){return t.intersect(e)});return a.map(function(t){return{ref:t,score:i.similarity(this.documentVector(t))}},this).sort(function(t,e){return e.score-t.score})},t.Index.prototype.documentVector=function(e){for(var n=this.documentStore.get(e),i=n.length,o=new t.Vector,r=0;i>r;r++){var s=n.elements[r],a=this.tokenStore.get(s)[e].tf,h=this.idf(s);o.insert(this.corpusTokens.indexOf(s),a*h)}return o},t.Index.prototype.toJSON=function(){return{version:t.version,fields:this._fields,ref:this._ref,documentStore:this.documentStore.toJSON(),tokenStore:this.tokenStore.toJSON(),corpusTokens:this.corpusTokens.toJSON(),pipeline:this.pipeline.toJSON()}},t.Index.prototype.use=function(t){var e=Array.prototype.slice.call(arguments,1);e.unshift(this),t.apply(this,e)},t.Store=function(){this.store={},this.length=0},t.Store.load=function(e){var n=new this;return n.length=e.length,n.store=Object.keys(e.store).reduce(function(n,i){return n[i]=t.SortedSet.load(e.store[i]),n},{}),n},t.Store.prototype.set=function(t,e){this.has(t)||this.length++,this.store[t]=e},t.Store.prototype.get=function(t){return this.store[t]},t.Store.prototype.has=function(t){return t in this.store},t.Store.prototype.remove=function(t){this.has(t)&&(delete this.store[t],this.length--)},t.Store.prototype.toJSON=function(){return{store:this.store,length:this.length}},t.stemmer=function(){var t={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},e={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},n="[^aeiou]",i="[aeiouy]",o=n+"[^aeiouy]*",r=i+"[aeiou]*",s="^("+o+")?"+r+o,a="^("+o+")?"+r+o+"("+r+")?$",h="^("+o+")?"+r+o+r+o,l="^("+o+")?"+i,u=new RegExp(s),c=new RegExp(h),f=new RegExp(a),d=new RegExp(l),p=/^(.+?)(ss|i)es$/,m=/^(.+?)([^s])s$/,v=/^(.+?)eed$/,y=/^(.+?)(ed|ing)$/,g=/.$/,S=/(at|bl|iz)$/,w=new RegExp("([^aeiouylsz])\\1$"),x=new RegExp("^"+o+i+"[^aeiouwxy]$"),k=/^(.+?[^aeiou])y$/,b=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,E=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,_=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,F=/^(.+?)(s|t)(ion)$/,O=/^(.+?)e$/,P=/ll$/,N=new RegExp("^"+o+i+"[^aeiouwxy]$"),T=function(n){var i,o,r,s,a,h,l;if(n.length<3)return n;if(r=n.substr(0,1),"y"==r&&(n=r.toUpperCase()+n.substr(1)),s=p,a=m,s.test(n)?n=n.replace(s,"$1$2"):a.test(n)&&(n=n.replace(a,"$1$2")),s=v,a=y,s.test(n)){var T=s.exec(n);s=u,s.test(T[1])&&(s=g,n=n.replace(s,""))}else if(a.test(n)){var T=a.exec(n);i=T[1],a=d,a.test(i)&&(n=i,a=S,h=w,l=x,a.test(n)?n+="e":h.test(n)?(s=g,n=n.replace(s,"")):l.test(n)&&(n+="e"))}if(s=k,s.test(n)){var T=s.exec(n);i=T[1],n=i+"i"}if(s=b,s.test(n)){var T=s.exec(n);i=T[1],o=T[2],s=u,s.test(i)&&(n=i+t[o])}if(s=E,s.test(n)){var T=s.exec(n);i=T[1],o=T[2],s=u,s.test(i)&&(n=i+e[o])}if(s=_,a=F,s.test(n)){var T=s.exec(n);i=T[1],s=c,s.test(i)&&(n=i)}else if(a.test(n)){var T=a.exec(n);i=T[1]+T[2],a=c,a.test(i)&&(n=i)}if(s=O,s.test(n)){var T=s.exec(n);i=T[1],s=c,a=f,h=N,(s.test(i)||a.test(i)&&!h.test(i))&&(n=i)}return s=P,a=c,s.test(n)&&a.test(n)&&(s=g,n=n.replace(s,"")),"y"==r&&(n=r.toLowerCase()+n.substr(1)),n};return T}(),t.Pipeline.registerFunction(t.stemmer,"stemmer"),t.stopWordFilter=function(e){return e&&t.stopWordFilter.stopWords[e]!==e?e:void 0},t.stopWordFilter.stopWords={a:"a",able:"able",about:"about",across:"across",after:"after",all:"all",almost:"almost",also:"also",am:"am",among:"among",an:"an",and:"and",any:"any",are:"are",as:"as",at:"at",be:"be",because:"because",been:"been",but:"but",by:"by",can:"can",cannot:"cannot",could:"could",dear:"dear",did:"did","do":"do",does:"does",either:"either","else":"else",ever:"ever",every:"every","for":"for",from:"from",get:"get",got:"got",had:"had",has:"has",have:"have",he:"he",her:"her",hers:"hers",him:"him",his:"his",how:"how",however:"however",i:"i","if":"if","in":"in",into:"into",is:"is",it:"it",its:"its",just:"just",least:"least",let:"let",like:"like",likely:"likely",may:"may",me:"me",might:"might",most:"most",must:"must",my:"my",neither:"neither",no:"no",nor:"nor",not:"not",of:"of",off:"off",often:"often",on:"on",only:"only",or:"or",other:"other",our:"our",own:"own",rather:"rather",said:"said",say:"say",says:"says",she:"she",should:"should",since:"since",so:"so",some:"some",than:"than",that:"that",the:"the",their:"their",them:"them",then:"then",there:"there",these:"these",they:"they","this":"this",tis:"tis",to:"to",too:"too",twas:"twas",us:"us",wants:"wants",was:"was",we:"we",were:"were",what:"what",when:"when",where:"where",which:"which","while":"while",who:"who",whom:"whom",why:"why",will:"will","with":"with",would:"would",yet:"yet",you:"you",your:"your"},t.Pipeline.registerFunction(t.stopWordFilter,"stopWordFilter"),t.trimmer=function(t){var e=t.replace(/^\W+/,"").replace(/\W+$/,"");return""===e?void 0:e},t.Pipeline.registerFunction(t.trimmer,"trimmer"),t.TokenStore=function(){this.root={docs:{}},this.length=0},t.TokenStore.load=function(t){var e=new this;return e.root=t.root,e.length=t.length,e},t.TokenStore.prototype.add=function(t,e,n){var n=n||this.root,i=t[0],o=t.slice(1);return i in n||(n[i]={docs:{}}),0===o.length?(n[i].docs[e.ref]=e,void(this.length+=1)):this.add(o,e,n[i])},t.TokenStore.prototype.has=function(t){if(!t)return!1;for(var e=this.root,n=0;n<t.length;n++){if(!e[t[n]])return!1;e=e[t[n]]}return!0},t.TokenStore.prototype.getNode=function(t){if(!t)return{};for(var e=this.root,n=0;n<t.length;n++){if(!e[t[n]])return{};e=e[t[n]]}return e},t.TokenStore.prototype.get=function(t,e){return this.getNode(t,e).docs||{}},t.TokenStore.prototype.count=function(t,e){return Object.keys(this.get(t,e)).length},t.TokenStore.prototype.remove=function(t,e){if(t){for(var n=this.root,i=0;i<t.length;i++){if(!(t[i]in n))return;n=n[t[i]]}delete n.docs[e]}},t.TokenStore.prototype.expand=function(t,e){var n=this.getNode(t),i=n.docs||{},e=e||[];return Object.keys(i).length&&e.push(t),Object.keys(n).forEach(function(n){"docs"!==n&&e.concat(this.expand(t+n,e))},this),e},t.TokenStore.prototype.toJSON=function(){return{root:this.root,length:this.length}},function(t,e){"function"==typeof define&&define.amd?define(e):"object"==typeof exports?module.exports=e():t.lunr=e()}(this,function(){return t})}();
\ No newline at end of file
.book .book-summary .book-search {
padding: 6px;
background: transparent;
position: absolute;
top: -50px;
left: 0px;
right: 0px;
transition: top 0.5s ease;
}
.book .book-summary .book-search input,
.book .book-summary .book-search input:focus,
.book .book-summary .book-search input:hover {
width: 100%;
background: transparent;
border: 1px solid transparent;
box-shadow: none;
outline: none;
line-height: 22px;
padding: 7px 4px;
color: inherit;
}
.book.with-search .book-summary .book-search {
top: 0px;
}
.book.with-search .book-summary ul.summary {
top: 50px;
}
require([
"gitbook",
"lodash"
], function(gitbook, _) {
var index = null;
var $searchInput, $searchForm;
// Use a specific index
function loadIndex(data) {
index = lunr.Index.load(data);
}
// Fetch the search index
function fetchIndex() {
$.getJSON(gitbook.state.basePath+"/search_index.json")
.then(loadIndex);
}
// Search for a term and return results
function search(q) {
if (!index) return;
var results = _.chain(index.search(q))
.map(function(result) {
var parts = result.ref.split("#")
return {
path: parts[0],
hash: parts[1]
}
})
.value();
return results;
}
// Create search form
function createForm(value) {
if ($searchForm) $searchForm.remove();
$searchForm = $('<div>', {
'class': 'book-search',
'role': 'search'
});
$searchInput = $('<input>', {
'type': 'text',
'class': 'form-control',
'val': value,
'placeholder': 'Type to search'
});
$searchInput.appendTo($searchForm);
$searchForm.prependTo(gitbook.state.$book.find('.book-summary'));
}
// Return true if search is open
function isSearchOpen() {
return gitbook.state.$book.hasClass("with-search");
}
// Toggle the search
function toggleSearch(_state) {
if (isSearchOpen() === _state) return;
gitbook.state.$book.toggleClass("with-search", _state);
// If search bar is open: focus input
if (isSearchOpen()) {
gitbook.sidebar.toggle(true);
$searchInput.focus();
} else {
$searchInput.blur();
$searchInput.val("");
gitbook.sidebar.filter(null);
}
}
// Recover current search when page changed
function recoverSearch() {
var keyword = gitbook.storage.get("keyword", "");
createForm(keyword);
if (keyword.length > 0) {
if(!isSearchOpen()) {
toggleSearch();
}
gitbook.sidebar.filter(_.pluck(search(keyword), "path"));
}
};
gitbook.events.bind("start", function(config) {
// Pre-fetch search index and create the form
fetchIndex();
createForm();
// Type in search bar
$(document).on("keyup", ".book-search input", function(e) {
var key = (e.keyCode ? e.keyCode : e.which);
var q = $(this).val();
if (key == 27) {
e.preventDefault();
toggleSearch(false);
return;
}
if (q.length == 0) {
gitbook.sidebar.filter(null);
gitbook.storage.remove("keyword");
} else {
var results = search(q);
gitbook.sidebar.filter(
_.pluck(results, "path")
);
gitbook.storage.set("keyword", q);
}
});
// Create the toggle search button
gitbook.toolbar.createButton({
icon: 'fa fa-search',
label: 'Search',
position: 'left',
onClick: toggleSearch
});
// Bind keyboard to toggle search
gitbook.keyboard.bind(['f'], toggleSearch)
});
gitbook.events.bind("page.change", recoverSearch);
});
require(["gitbook", "lodash"], function(gitbook, _) {
var SITES = {
'facebook': {
'label': 'Facebook',
'icon': 'fa fa-facebook',
'onClick': function(e) {
e.preventDefault();
window.open("http://www.facebook.com/sharer/sharer.php?s=100&p[url]="+encodeURIComponent(location.href));
}
},
'twitter': {
'label': 'Twitter',
'icon': 'fa fa-twitter',
'onClick': function(e) {
e.preventDefault();
window.open("http://twitter.com/home?status="+encodeURIComponent(document.title+" "+location.href));
}
},
'google': {
'label': 'Google+',
'icon': 'fa fa-google-plus',
'onClick': function(e) {
e.preventDefault();
window.open("https://plus.google.com/share?url="+encodeURIComponent(location.href));
}
},
'weibo': {
'label': 'Weibo',
'icon': 'fa fa-weibo',
'onClick': function(e) {
e.preventDefault();
window.open("http://service.weibo.com/share/share.php?content=utf-8&url="+encodeURIComponent(location.href)+"&title="+encodeURIComponent(document.title));
}
},
'instapaper': {
'label': 'Instapaper',
'icon': 'fa fa-instapaper',
'onClick': function(e) {
e.preventDefault();
window.open("http://www.instapaper.com/text?u="+encodeURIComponent(location.href));
}
},
'vk': {
'label': 'VK',
'icon': 'fa fa-vk',
'onClick': function(e) {
e.preventDefault();
window.open("http://vkontakte.ru/share.php?url="+encodeURIComponent(location.href));
}
}
};
gitbook.events.bind("start", function(e, config) {
var opts = config.sharing;
// Create dropdown menu
var menu = _.chain(opts.all)
.map(function(id) {
var site = SITES[id];
return {
text: site.label,
onClick: site.onClick
};
})
.compact()
.value();
// Create main button with dropdown
if (menu.length > 0) {
gitbook.toolbar.createButton({
icon: 'fa fa-share-alt',
label: 'Share',
position: 'right',
dropdown: [menu]
});
}
// Direct actions to share
_.each(SITES, function(site, sideId) {
if (!opts[sideId]) return;
gitbook.toolbar.createButton({
icon: site.icon,
label: site.text,
position: 'right',
onClick: site.onClick
});
});
});
});
/*! normalize.css v2.1.0 | MIT License | git.io/normalize */img,legend{border:0}*,.fa{-webkit-font-smoothing:antialiased}.fa-ul>li,sub,sup{position:relative}.book .book-body .page-wrapper .page-inner section.normal hr:after,.book-langs-index .inner .languages:after,.buttons:after,.dropdown-menu .buttons:after{clear:both}body,html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}article,aside,details,figcaption,figure,footer,header,hgroup,main,nav,section,summary{display:block}audio,canvas,video{display:inline-block}.hidden,[hidden]{display:none}audio:not([controls]){display:none;height:0}html{font-family:sans-serif}body,figure{margin:0}a:focus{outline:dotted thin}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code,kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}small{font-size:80%}sub,sup{font-size:75%;line-height:0;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}svg:not(:root){overflow:hidden}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{padding:0}button,input,select,textarea{font-family:inherit;font-size:100%;margin:0}button,input{line-height:normal}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=search]{-webkit-appearance:textfield;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}textarea{overflow:auto;vertical-align:top}table{border-collapse:collapse;border-spacing:0}/*!
* Preboot v2
*
* Open sourced under MIT license by @mdo.
* Some variables and mixins from Bootstrap (Apache 2 license).
*/.link-inherit,.link-inherit:focus,.link-inherit:hover{color:inherit}.fa,.fa-stack{display:inline-block}/*!
* Font Awesome 4.1.0 by @davegandy - http://fontawesome.io - @fontawesome
* License - http://fontawesome.io/license (Font: SIL OFL 1.1, CSS: MIT License)
*/@font-face{font-family:FontAwesome;src:url(./fonts/fontawesome/fontawesome-webfont.eot?v=4.1.0);src:url(./fonts/fontawesome/fontawesome-webfont.eot?#iefix&v=4.1.0) format('embedded-opentype'),url(./fonts/fontawesome/fontawesome-webfont.woff?v=4.1.0) format('woff'),url(./fonts/fontawesome/fontawesome-webfont.ttf?v=4.1.0) format('truetype'),url(./fonts/fontawesome/fontawesome-webfont.svg?v=4.1.0#fontawesomeregular) format('svg');font-weight:400;font-style:normal}.fa{font-family:FontAwesome;font-style:normal;font-weight:400;line-height:1;-moz-osx-font-smoothing:grayscale}.book .book-header,.book .book-summary{font-family:"Helvetica Neue",Helvetica,Arial,sans-serif}.fa-lg{font-size:1.33333333em;line-height:.75em;vertical-align:-15%}.fa-2x{font-size:2em}.fa-3x{font-size:3em}.fa-4x{font-size:4em}.fa-5x{font-size:5em}.fa-fw{width:1.28571429em;text-align:center}.fa-ul{padding-left:0;margin-left:2.14285714em;list-style-type:none}.fa-li{position:absolute;left:-2.14285714em;width:2.14285714em;top:.14285714em;text-align:center}.fa-li.fa-lg{left:-1.85714286em}.fa-border{padding:.2em .25em .15em;border:.08em solid #eee;border-radius:.1em}.pull-right{float:right}.pull-left{float:left}.fa.pull-left{margin-right:.3em}.fa.pull-right{margin-left:.3em}.fa-spin{-webkit-animation:spin 2s infinite linear;-moz-animation:spin 2s infinite linear;-o-animation:spin 2s infinite linear;animation:spin 2s infinite linear}@-moz-keyframes spin{0%{-moz-transform:rotate(0)}100%{-moz-transform:rotate(359deg)}}@-webkit-keyframes spin{0%{-webkit-transform:rotate(0)}100%{-webkit-transform:rotate(359deg)}}@-o-keyframes spin{0%{-o-transform:rotate(0)}100%{-o-transform:rotate(359deg)}}@keyframes spin{0%{-webkit-transform:rotate(0);transform:rotate(0)}100%{-webkit-transform:rotate(359deg);transform:rotate(359deg)}}.fa-rotate-90{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=1);-webkit-transform:rotate(90deg);-moz-transform:rotate(90deg);-ms-transform:rotate(90deg);-o-transform:rotate(90deg);transform:rotate(90deg)}.fa-rotate-180{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2);-webkit-transform:rotate(180deg);-moz-transform:rotate(180deg);-ms-transform:rotate(180deg);-o-transform:rotate(180deg);transform:rotate(180deg)}.fa-rotate-270{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=3);-webkit-transform:rotate(270deg);-moz-transform:rotate(270deg);-ms-transform:rotate(270deg);-o-transform:rotate(270deg);transform:rotate(270deg)}.fa-flip-horizontal{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=0, mirror=1);-webkit-transform:scale(-1,1);-moz-transform:scale(-1,1);-ms-transform:scale(-1,1);-o-transform:scale(-1,1);transform:scale(-1,1)}.fa-flip-vertical{filter:progid:DXImageTransform.Microsoft.BasicImage(rotation=2, mirror=1);-webkit-transform:scale(1,-1);-moz-transform:scale(1,-1);-ms-transform:scale(1,-1);-o-transform:scale(1,-1);transform:scale(1,-1)}.fa-stack{position:relative;width:2em;height:2em;line-height:2em;vertical-align:middle}.fa-stack-1x,.fa-stack-2x{position:absolute;left:0;width:100%;text-align:center}.fa-stack-1x{line-height:inherit}.fa-stack-2x{font-size:2em}.fa-inverse{color:#fff}.fa-glass:before{content:"\f000"}.fa-music:before{content:"\f001"}.fa-search:before{content:"\f002"}.fa-envelope-o:before{content:"\f003"}.fa-heart:before{content:"\f004"}.fa-star:before{content:"\f005"}.fa-star-o:before{content:"\f006"}.fa-user:before{content:"\f007"}.fa-film:before{content:"\f008"}.fa-th-large:before{content:"\f009"}.fa-th:before{content:"\f00a"}.fa-th-list:before{content:"\f00b"}.fa-check:before{content:"\f00c"}.fa-times:before{content:"\f00d"}.fa-search-plus:before{content:"\f00e"}.fa-search-minus:before{content:"\f010"}.fa-power-off:before{content:"\f011"}.fa-signal:before{content:"\f012"}.fa-cog:before,.fa-gear:before{content:"\f013"}.fa-trash-o:before{content:"\f014"}.fa-home:before{content:"\f015"}.fa-file-o:before{content:"\f016"}.fa-clock-o:before{content:"\f017"}.fa-road:before{content:"\f018"}.fa-download:before{content:"\f019"}.fa-arrow-circle-o-down:before{content:"\f01a"}.fa-arrow-circle-o-up:before{content:"\f01b"}.fa-inbox:before{content:"\f01c"}.fa-play-circle-o:before{content:"\f01d"}.fa-repeat:before,.fa-rotate-right:before{content:"\f01e"}.fa-refresh:before{content:"\f021"}.fa-list-alt:before{content:"\f022"}.fa-lock:before{content:"\f023"}.fa-flag:before{content:"\f024"}.fa-headphones:before{content:"\f025"}.fa-volume-off:before{content:"\f026"}.fa-volume-down:before{content:"\f027"}.fa-volume-up:before{content:"\f028"}.fa-qrcode:before{content:"\f029"}.fa-barcode:before{content:"\f02a"}.fa-tag:before{content:"\f02b"}.fa-tags:before{content:"\f02c"}.fa-book:before{content:"\f02d"}.fa-bookmark:before{content:"\f02e"}.fa-print:before{content:"\f02f"}.fa-camera:before{content:"\f030"}.fa-font:before{content:"\f031"}.fa-bold:before{content:"\f032"}.fa-italic:before{content:"\f033"}.fa-text-height:before{content:"\f034"}.fa-text-width:before{content:"\f035"}.fa-align-left:before{content:"\f036"}.fa-align-center:before{content:"\f037"}.fa-align-right:before{content:"\f038"}.fa-align-justify:before{content:"\f039"}.fa-list:before{content:"\f03a"}.fa-dedent:before,.fa-outdent:before{content:"\f03b"}.fa-indent:before{content:"\f03c"}.fa-video-camera:before{content:"\f03d"}.fa-image:before,.fa-photo:before,.fa-picture-o:before{content:"\f03e"}.fa-pencil:before{content:"\f040"}.fa-map-marker:before{content:"\f041"}.fa-adjust:before{content:"\f042"}.fa-tint:before{content:"\f043"}.fa-edit:before,.fa-pencil-square-o:before{content:"\f044"}.fa-share-square-o:before{content:"\f045"}.fa-check-square-o:before{content:"\f046"}.fa-arrows:before{content:"\f047"}.fa-step-backward:before{content:"\f048"}.fa-fast-backward:before{content:"\f049"}.fa-backward:before{content:"\f04a"}.fa-play:before{content:"\f04b"}.fa-pause:before{content:"\f04c"}.fa-stop:before{content:"\f04d"}.fa-forward:before{content:"\f04e"}.fa-fast-forward:before{content:"\f050"}.fa-step-forward:before{content:"\f051"}.fa-eject:before{content:"\f052"}.fa-chevron-left:before{content:"\f053"}.fa-chevron-right:before{content:"\f054"}.fa-plus-circle:before{content:"\f055"}.fa-minus-circle:before{content:"\f056"}.fa-times-circle:before{content:"\f057"}.fa-check-circle:before{content:"\f058"}.fa-question-circle:before{content:"\f059"}.fa-info-circle:before{content:"\f05a"}.fa-crosshairs:before{content:"\f05b"}.fa-times-circle-o:before{content:"\f05c"}.fa-check-circle-o:before{content:"\f05d"}.fa-ban:before{content:"\f05e"}.fa-arrow-left:before{content:"\f060"}.fa-arrow-right:before{content:"\f061"}.fa-arrow-up:before{content:"\f062"}.fa-arrow-down:before{content:"\f063"}.fa-mail-forward:before,.fa-share:before{content:"\f064"}.fa-expand:before{content:"\f065"}.fa-compress:before{content:"\f066"}.fa-plus:before{content:"\f067"}.fa-minus:before{content:"\f068"}.fa-asterisk:before{content:"\f069"}.fa-exclamation-circle:before{content:"\f06a"}.fa-gift:before{content:"\f06b"}.fa-leaf:before{content:"\f06c"}.fa-fire:before{content:"\f06d"}.fa-eye:before{content:"\f06e"}.fa-eye-slash:before{content:"\f070"}.fa-exclamation-triangle:before,.fa-warning:before{content:"\f071"}.fa-plane:before{content:"\f072"}.fa-calendar:before{content:"\f073"}.fa-random:before{content:"\f074"}.fa-comment:before{content:"\f075"}.fa-magnet:before{content:"\f076"}.fa-chevron-up:before{content:"\f077"}.fa-chevron-down:before{content:"\f078"}.fa-retweet:before{content:"\f079"}.fa-shopping-cart:before{content:"\f07a"}.fa-folder:before{content:"\f07b"}.fa-folder-open:before{content:"\f07c"}.fa-arrows-v:before{content:"\f07d"}.fa-arrows-h:before{content:"\f07e"}.fa-bar-chart-o:before{content:"\f080"}.fa-twitter-square:before{content:"\f081"}.fa-facebook-square:before{content:"\f082"}.fa-camera-retro:before{content:"\f083"}.fa-key:before{content:"\f084"}.fa-cogs:before,.fa-gears:before{content:"\f085"}.fa-comments:before{content:"\f086"}.fa-thumbs-o-up:before{content:"\f087"}.fa-thumbs-o-down:before{content:"\f088"}.fa-star-half:before{content:"\f089"}.fa-heart-o:before{content:"\f08a"}.fa-sign-out:before{content:"\f08b"}.fa-linkedin-square:before{content:"\f08c"}.fa-thumb-tack:before{content:"\f08d"}.fa-external-link:before{content:"\f08e"}.fa-sign-in:before{content:"\f090"}.fa-trophy:before{content:"\f091"}.fa-github-square:before{content:"\f092"}.fa-upload:before{content:"\f093"}.fa-lemon-o:before{content:"\f094"}.fa-phone:before{content:"\f095"}.fa-square-o:before{content:"\f096"}.fa-bookmark-o:before{content:"\f097"}.fa-phone-square:before{content:"\f098"}.fa-twitter:before{content:"\f099"}.fa-facebook:before{content:"\f09a"}.fa-github:before{content:"\f09b"}.fa-unlock:before{content:"\f09c"}.fa-credit-card:before{content:"\f09d"}.fa-rss:before{content:"\f09e"}.fa-hdd-o:before{content:"\f0a0"}.fa-bullhorn:before{content:"\f0a1"}.fa-bell:before{content:"\f0f3"}.fa-certificate:before{content:"\f0a3"}.fa-hand-o-right:before{content:"\f0a4"}.fa-hand-o-left:before{content:"\f0a5"}.fa-hand-o-up:before{content:"\f0a6"}.fa-hand-o-down:before{content:"\f0a7"}.fa-arrow-circle-left:before{content:"\f0a8"}.fa-arrow-circle-right:before{content:"\f0a9"}.fa-arrow-circle-up:before{content:"\f0aa"}.fa-arrow-circle-down:before{content:"\f0ab"}.fa-globe:before{content:"\f0ac"}.fa-wrench:before{content:"\f0ad"}.fa-tasks:before{content:"\f0ae"}.fa-filter:before{content:"\f0b0"}.fa-briefcase:before{content:"\f0b1"}.fa-arrows-alt:before{content:"\f0b2"}.fa-group:before,.fa-users:before{content:"\f0c0"}.fa-chain:before,.fa-link:before{content:"\f0c1"}.fa-cloud:before{content:"\f0c2"}.fa-flask:before{content:"\f0c3"}.fa-cut:before,.fa-scissors:before{content:"\f0c4"}.fa-copy:before,.fa-files-o:before{content:"\f0c5"}.fa-paperclip:before{content:"\f0c6"}.fa-floppy-o:before,.fa-save:before{content:"\f0c7"}.fa-square:before{content:"\f0c8"}.fa-bars:before,.fa-navicon:before,.fa-reorder:before{content:"\f0c9"}.fa-list-ul:before{content:"\f0ca"}.fa-list-ol:before{content:"\f0cb"}.fa-strikethrough:before{content:"\f0cc"}.fa-underline:before{content:"\f0cd"}.fa-table:before{content:"\f0ce"}.fa-magic:before{content:"\f0d0"}.fa-truck:before{content:"\f0d1"}.fa-pinterest:before{content:"\f0d2"}.fa-pinterest-square:before{content:"\f0d3"}.fa-google-plus-square:before{content:"\f0d4"}.fa-google-plus:before{content:"\f0d5"}.fa-money:before{content:"\f0d6"}.fa-caret-down:before{content:"\f0d7"}.fa-caret-up:before{content:"\f0d8"}.fa-caret-left:before{content:"\f0d9"}.fa-caret-right:before{content:"\f0da"}.fa-columns:before{content:"\f0db"}.fa-sort:before,.fa-unsorted:before{content:"\f0dc"}.fa-sort-desc:before,.fa-sort-down:before{content:"\f0dd"}.fa-sort-asc:before,.fa-sort-up:before{content:"\f0de"}.fa-envelope:before{content:"\f0e0"}.fa-linkedin:before{content:"\f0e1"}.fa-rotate-left:before,.fa-undo:before{content:"\f0e2"}.fa-gavel:before,.fa-legal:before{content:"\f0e3"}.fa-dashboard:before,.fa-tachometer:before{content:"\f0e4"}.fa-comment-o:before{content:"\f0e5"}.fa-comments-o:before{content:"\f0e6"}.fa-bolt:before,.fa-flash:before{content:"\f0e7"}.fa-sitemap:before{content:"\f0e8"}.fa-umbrella:before{content:"\f0e9"}.fa-clipboard:before,.fa-paste:before{content:"\f0ea"}.fa-lightbulb-o:before{content:"\f0eb"}.fa-exchange:before{content:"\f0ec"}.fa-cloud-download:before{content:"\f0ed"}.fa-cloud-upload:before{content:"\f0ee"}.fa-user-md:before{content:"\f0f0"}.fa-stethoscope:before{content:"\f0f1"}.fa-suitcase:before{content:"\f0f2"}.fa-bell-o:before{content:"\f0a2"}.fa-coffee:before{content:"\f0f4"}.fa-cutlery:before{content:"\f0f5"}.fa-file-text-o:before{content:"\f0f6"}.fa-building-o:before{content:"\f0f7"}.fa-hospital-o:before{content:"\f0f8"}.fa-ambulance:before{content:"\f0f9"}.fa-medkit:before{content:"\f0fa"}.fa-fighter-jet:before{content:"\f0fb"}.fa-beer:before{content:"\f0fc"}.fa-h-square:before{content:"\f0fd"}.fa-plus-square:before{content:"\f0fe"}.fa-angle-double-left:before{content:"\f100"}.fa-angle-double-right:before{content:"\f101"}.fa-angle-double-up:before{content:"\f102"}.fa-angle-double-down:before{content:"\f103"}.fa-angle-left:before{content:"\f104"}.fa-angle-right:before{content:"\f105"}.fa-angle-up:before{content:"\f106"}.fa-angle-down:before{content:"\f107"}.fa-desktop:before{content:"\f108"}.fa-laptop:before{content:"\f109"}.fa-tablet:before{content:"\f10a"}.fa-mobile-phone:before,.fa-mobile:before{content:"\f10b"}.fa-circle-o:before{content:"\f10c"}.fa-quote-left:before{content:"\f10d"}.fa-quote-right:before{content:"\f10e"}.fa-spinner:before{content:"\f110"}.fa-circle:before{content:"\f111"}.fa-mail-reply:before,.fa-reply:before{content:"\f112"}.fa-github-alt:before{content:"\f113"}.fa-folder-o:before{content:"\f114"}.fa-folder-open-o:before{content:"\f115"}.fa-smile-o:before{content:"\f118"}.fa-frown-o:before{content:"\f119"}.fa-meh-o:before{content:"\f11a"}.fa-gamepad:before{content:"\f11b"}.fa-keyboard-o:before{content:"\f11c"}.fa-flag-o:before{content:"\f11d"}.fa-flag-checkered:before{content:"\f11e"}.fa-terminal:before{content:"\f120"}.fa-code:before{content:"\f121"}.fa-mail-reply-all:before,.fa-reply-all:before{content:"\f122"}.fa-star-half-empty:before,.fa-star-half-full:before,.fa-star-half-o:before{content:"\f123"}.fa-location-arrow:before{content:"\f124"}.fa-crop:before{content:"\f125"}.fa-code-fork:before{content:"\f126"}.fa-chain-broken:before,.fa-unlink:before{content:"\f127"}.fa-question:before{content:"\f128"}.fa-info:before{content:"\f129"}.fa-exclamation:before{content:"\f12a"}.fa-superscript:before{content:"\f12b"}.fa-subscript:before{content:"\f12c"}.fa-eraser:before{content:"\f12d"}.fa-puzzle-piece:before{content:"\f12e"}.fa-microphone:before{content:"\f130"}.fa-microphone-slash:before{content:"\f131"}.fa-shield:before{content:"\f132"}.fa-calendar-o:before{content:"\f133"}.fa-fire-extinguisher:before{content:"\f134"}.fa-rocket:before{content:"\f135"}.fa-maxcdn:before{content:"\f136"}.fa-chevron-circle-left:before{content:"\f137"}.fa-chevron-circle-right:before{content:"\f138"}.fa-chevron-circle-up:before{content:"\f139"}.fa-chevron-circle-down:before{content:"\f13a"}.fa-html5:before{content:"\f13b"}.fa-css3:before{content:"\f13c"}.fa-anchor:before{content:"\f13d"}.fa-unlock-alt:before{content:"\f13e"}.fa-bullseye:before{content:"\f140"}.fa-ellipsis-h:before{content:"\f141"}.fa-ellipsis-v:before{content:"\f142"}.fa-rss-square:before{content:"\f143"}.fa-play-circle:before{content:"\f144"}.fa-ticket:before{content:"\f145"}.fa-minus-square:before{content:"\f146"}.fa-minus-square-o:before{content:"\f147"}.fa-level-up:before{content:"\f148"}.fa-level-down:before{content:"\f149"}.fa-check-square:before{content:"\f14a"}.fa-pencil-square:before{content:"\f14b"}.fa-external-link-square:before{content:"\f14c"}.fa-share-square:before{content:"\f14d"}.fa-compass:before{content:"\f14e"}.fa-caret-square-o-down:before,.fa-toggle-down:before{content:"\f150"}.fa-caret-square-o-up:before,.fa-toggle-up:before{content:"\f151"}.fa-caret-square-o-right:before,.fa-toggle-right:before{content:"\f152"}.fa-eur:before,.fa-euro:before{content:"\f153"}.fa-gbp:before{content:"\f154"}.fa-dollar:before,.fa-usd:before{content:"\f155"}.fa-inr:before,.fa-rupee:before{content:"\f156"}.fa-cny:before,.fa-jpy:before,.fa-rmb:before,.fa-yen:before{content:"\f157"}.fa-rouble:before,.fa-rub:before,.fa-ruble:before{content:"\f158"}.fa-krw:before,.fa-won:before{content:"\f159"}.fa-bitcoin:before,.fa-btc:before{content:"\f15a"}.fa-file:before{content:"\f15b"}.fa-file-text:before{content:"\f15c"}.fa-sort-alpha-asc:before{content:"\f15d"}.fa-sort-alpha-desc:before{content:"\f15e"}.fa-sort-amount-asc:before{content:"\f160"}.fa-sort-amount-desc:before{content:"\f161"}.fa-sort-numeric-asc:before{content:"\f162"}.fa-sort-numeric-desc:before{content:"\f163"}.fa-thumbs-up:before{content:"\f164"}.fa-thumbs-down:before{content:"\f165"}.fa-youtube-square:before{content:"\f166"}.fa-youtube:before{content:"\f167"}.fa-xing:before{content:"\f168"}.fa-xing-square:before{content:"\f169"}.fa-youtube-play:before{content:"\f16a"}.fa-dropbox:before{content:"\f16b"}.fa-stack-overflow:before{content:"\f16c"}.fa-instagram:before{content:"\f16d"}.fa-flickr:before{content:"\f16e"}.fa-adn:before{content:"\f170"}.fa-bitbucket:before{content:"\f171"}.fa-bitbucket-square:before{content:"\f172"}.fa-tumblr:before{content:"\f173"}.fa-tumblr-square:before{content:"\f174"}.fa-long-arrow-down:before{content:"\f175"}.fa-long-arrow-up:before{content:"\f176"}.fa-long-arrow-left:before{content:"\f177"}.fa-long-arrow-right:before{content:"\f178"}.fa-apple:before{content:"\f179"}.fa-windows:before{content:"\f17a"}.fa-android:before{content:"\f17b"}.fa-linux:before{content:"\f17c"}.fa-dribbble:before{content:"\f17d"}.fa-skype:before{content:"\f17e"}.fa-foursquare:before{content:"\f180"}.fa-trello:before{content:"\f181"}.fa-female:before{content:"\f182"}.fa-male:before{content:"\f183"}.fa-gittip:before{content:"\f184"}.fa-sun-o:before{content:"\f185"}.fa-moon-o:before{content:"\f186"}.fa-archive:before{content:"\f187"}.fa-bug:before{content:"\f188"}.fa-vk:before{content:"\f189"}.fa-weibo:before{content:"\f18a"}.fa-renren:before{content:"\f18b"}.fa-pagelines:before{content:"\f18c"}.fa-stack-exchange:before{content:"\f18d"}.fa-arrow-circle-o-right:before{content:"\f18e"}.fa-arrow-circle-o-left:before{content:"\f190"}.fa-caret-square-o-left:before,.fa-toggle-left:before{content:"\f191"}.fa-dot-circle-o:before{content:"\f192"}.fa-wheelchair:before{content:"\f193"}.fa-vimeo-square:before{content:"\f194"}.fa-try:before,.fa-turkish-lira:before{content:"\f195"}.fa-plus-square-o:before{content:"\f196"}.fa-space-shuttle:before{content:"\f197"}.fa-slack:before{content:"\f198"}.fa-envelope-square:before{content:"\f199"}.fa-wordpress:before{content:"\f19a"}.fa-openid:before{content:"\f19b"}.fa-bank:before,.fa-institution:before,.fa-university:before{content:"\f19c"}.fa-graduation-cap:before,.fa-mortar-board:before{content:"\f19d"}.fa-yahoo:before{content:"\f19e"}.fa-google:before{content:"\f1a0"}.fa-reddit:before{content:"\f1a1"}.fa-reddit-square:before{content:"\f1a2"}.fa-stumbleupon-circle:before{content:"\f1a3"}.fa-stumbleupon:before{content:"\f1a4"}.fa-delicious:before{content:"\f1a5"}.fa-digg:before{content:"\f1a6"}.fa-pied-piper-square:before,.fa-pied-piper:before{content:"\f1a7"}.fa-pied-piper-alt:before{content:"\f1a8"}.fa-drupal:before{content:"\f1a9"}.fa-joomla:before{content:"\f1aa"}.fa-language:before{content:"\f1ab"}.fa-fax:before{content:"\f1ac"}.fa-building:before{content:"\f1ad"}.fa-child:before{content:"\f1ae"}.fa-paw:before{content:"\f1b0"}.fa-spoon:before{content:"\f1b1"}.fa-cube:before{content:"\f1b2"}.fa-cubes:before{content:"\f1b3"}.fa-behance:before{content:"\f1b4"}.fa-behance-square:before{content:"\f1b5"}.fa-steam:before{content:"\f1b6"}.fa-steam-square:before{content:"\f1b7"}.fa-recycle:before{content:"\f1b8"}.fa-automobile:before,.fa-car:before{content:"\f1b9"}.fa-cab:before,.fa-taxi:before{content:"\f1ba"}.fa-tree:before{content:"\f1bb"}.fa-spotify:before{content:"\f1bc"}.fa-deviantart:before{content:"\f1bd"}.fa-soundcloud:before{content:"\f1be"}.fa-database:before{content:"\f1c0"}.fa-file-pdf-o:before{content:"\f1c1"}.fa-file-word-o:before{content:"\f1c2"}.fa-file-excel-o:before{content:"\f1c3"}.fa-file-powerpoint-o:before{content:"\f1c4"}.fa-file-image-o:before,.fa-file-photo-o:before,.fa-file-picture-o:before{content:"\f1c5"}.fa-file-archive-o:before,.fa-file-zip-o:before{content:"\f1c6"}.fa-file-audio-o:before,.fa-file-sound-o:before{content:"\f1c7"}.fa-file-movie-o:before,.fa-file-video-o:before{content:"\f1c8"}.fa-file-code-o:before{content:"\f1c9"}.fa-vine:before{content:"\f1ca"}.fa-codepen:before{content:"\f1cb"}.fa-jsfiddle:before{content:"\f1cc"}.fa-life-bouy:before,.fa-life-ring:before,.fa-life-saver:before,.fa-support:before{content:"\f1cd"}.fa-circle-o-notch:before{content:"\f1ce"}.fa-ra:before,.fa-rebel:before{content:"\f1d0"}.fa-empire:before,.fa-ge:before{content:"\f1d1"}.fa-git-square:before{content:"\f1d2"}.fa-git:before{content:"\f1d3"}.fa-hacker-news:before{content:"\f1d4"}.fa-tencent-weibo:before{content:"\f1d5"}.fa-qq:before{content:"\f1d6"}.fa-wechat:before,.fa-weixin:before{content:"\f1d7"}.fa-paper-plane:before,.fa-send:before{content:"\f1d8"}.fa-paper-plane-o:before,.fa-send-o:before{content:"\f1d9"}.fa-history:before{content:"\f1da"}.fa-circle-thin:before{content:"\f1db"}.fa-header:before{content:"\f1dc"}.fa-paragraph:before{content:"\f1dd"}.fa-sliders:before{content:"\f1de"}.fa-share-alt:before{content:"\f1e0"}.fa-share-alt-square:before{content:"\f1e1"}.fa-bomb:before{content:"\f1e2"}.book-langs-index{width:100%;height:100%;padding:40px 0;margin:0;overflow:auto}@media (max-width:600px){.book-langs-index{padding:0}}.book-langs-index .inner{max-width:600px;width:100%;margin:0 auto;padding:30px;background:#fff;border-radius:3px}.book-langs-index .inner h3{margin:0}.book-langs-index .inner .languages{list-style:none;padding:20px 30px;margin-top:20px;border-top:1px solid #eee}.book-langs-index .inner .languages:after,.book-langs-index .inner .languages:before{content:" ";display:table;line-height:0}.book-langs-index .inner .languages li{width:50%;float:left;padding:10px 5px;font-size:16px}@media (max-width:600px){.book-langs-index .inner .languages li{width:100%;max-width:100%}}.book .book-header{overflow:visible;height:50px;padding:0 8px;z-index:2;font-size:.85em;color:#7e888b;background:0 0}.book .book-header .btn{display:block;height:50px;padding:0 15px;border-bottom:none;color:#ccc;text-transform:uppercase;line-height:50px;-webkit-box-shadow:none!important;box-shadow:none!important;position:relative;font-size:14px}.book .book-header .btn:hover{position:relative;text-decoration:none;color:#444;background:0 0}.book .book-header h1{margin:0;font-size:20px;font-weight:200;text-align:center;line-height:50px;opacity:0;padding-left:200px;padding-right:200px;-webkit-transition:opacity .2s ease;-moz-transition:opacity .2s ease;-o-transition:opacity .2s ease;transition:opacity .2s ease;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.book .book-header h1 a,.book .book-header h1 a:hover{color:inherit;text-decoration:none}@media (max-width:1000px){.book .book-header h1{display:none}}.book .book-header h1 i{display:none}.book .book-header:hover h1{opacity:1}.book.is-loading .book-header h1 i{display:inline-block}.book.is-loading .book-header h1 a{display:none}.dropdown{position:relative}.dropdown-menu{position:absolute;top:100%;left:0;z-index:100;display:none;float:left;min-width:160px;padding:0;margin:2px 0 0;list-style:none;font-size:14px;background-color:#fafafa;border:1px solid rgba(0,0,0,.07);border-radius:1px;-webkit-box-shadow:0 6px 12px rgba(0,0,0,.175);box-shadow:0 6px 12px rgba(0,0,0,.175);background-clip:padding-box}.dropdown-menu.open{display:block}.dropdown-menu.dropdown-left{left:auto;right:4%}.dropdown-menu.dropdown-left .dropdown-caret{right:14px;left:auto}.dropdown-menu .dropdown-caret{position:absolute;top:-8px;left:14px;width:18px;height:10px;float:left;overflow:hidden}.dropdown-menu .dropdown-caret .caret-inner,.dropdown-menu .dropdown-caret .caret-outer{display:inline-block;top:0;border-left:9px solid transparent;border-right:9px solid transparent;position:absolute}.dropdown-menu .dropdown-caret .caret-outer{border-bottom:9px solid rgba(0,0,0,.1);height:auto;left:0;width:auto;margin-left:-1px}.dropdown-menu .dropdown-caret .caret-inner{margin-top:-1px;top:1px;border-bottom:9px solid #fafafa}.dropdown-menu .buttons{border-bottom:1px solid rgba(0,0,0,.07)}.dropdown-menu .buttons:after,.dropdown-menu .buttons:before{content:" ";display:table;line-height:0}.dropdown-menu .buttons:last-child{border-bottom:none}.dropdown-menu .buttons .button{border:0;background-color:transparent;color:#a6a6a6;width:100%;text-align:center;float:left;line-height:1.42857143;padding:8px 4px}.alert,.dropdown-menu .buttons .button:hover{color:#444}.dropdown-menu .buttons .button:focus,.dropdown-menu .buttons .button:hover{outline:0}.dropdown-menu .buttons .button.size-2{width:50%}.dropdown-menu .buttons .button.size-3{width:33%}.alert{padding:15px;margin-bottom:20px;background:#eee;border-bottom:5px solid #ddd}.alert-success{background:#dff0d8;border-color:#d6e9c6;color:#3c763d}.alert-info{background:#d9edf7;border-color:#bce8f1;color:#31708f}.alert-danger{background:#f2dede;border-color:#ebccd1;color:#a94442}.alert-warning{background:#fcf8e3;border-color:#faebcc;color:#8a6d3b}.book .book-summary{position:absolute;top:0;left:-300px;bottom:0;z-index:1;width:300px;color:#364149;background:#fafafa;border-right:1px solid rgba(0,0,0,.07);-webkit-transition:left 250ms ease;-moz-transition:left 250ms ease;-o-transition:left 250ms ease;transition:left 250ms ease}.book .book-summary ul.summary{position:absolute;top:0;left:0;right:0;bottom:0;overflow-y:auto;list-style:none;margin:0;padding:0;-webkit-transition:top .5s ease;-moz-transition:top .5s ease;-o-transition:top .5s ease;transition:top .5s ease}.book .book-summary ul.summary li{list-style:none}.book .book-summary ul.summary li.divider{height:1px;margin:7px 0;overflow:hidden;background:rgba(0,0,0,.07)}.book .book-summary ul.summary li i.fa-check{display:none;position:absolute;right:9px;top:16px;font-size:9px;color:#3c3}.book .book-summary ul.summary li.done>a{color:#364149;font-weight:400}.book .book-summary ul.summary li.done>a i{display:inline}.book .book-summary ul.summary li a,.book .book-summary ul.summary li span{display:block;padding:10px 15px;border-bottom:none;color:#364149;background:0 0;text-overflow:ellipsis;overflow:hidden;white-space:nowrap;position:relative}.book .book-summary ul.summary li span{cursor:not-allowed;opacity:.3;filter:alpha(opacity=30)}.book .book-summary ul.summary li a:hover,.book .book-summary ul.summary li.active>a{color:#008cff;background:0 0;text-decoration:none}.book .book-summary ul.summary li ul{padding-left:20px}@media (max-width:600px){.book .book-summary{width:calc(100% - 60px);bottom:0;left:-100%}}.book.with-summary .book-summary{left:0}.book.without-animation .book-summary{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;transition:none!important}.book{position:relative;width:100%;height:100%}.book .book-body,.book .book-body .body-inner{position:absolute;top:0;left:0;overflow-y:auto;bottom:0;right:0}.book .book-body{color:#000;background:#fff;-webkit-transition:left 250ms ease;-moz-transition:left 250ms ease;-o-transition:left 250ms ease;transition:left 250ms ease}.book .book-body .page-wrapper{position:relative;outline:0}.book .book-body .page-wrapper .page-inner{max-width:800px;margin:0 auto;padding:20px 0 40px}.book .book-body .page-wrapper .page-inner section{margin:0;padding:5px 15px;background:#fff;border-radius:2px;line-height:1.7;font-size:1.6rem}.book .book-body .page-wrapper .page-inner .btn-group .btn{border-radius:0;background:#eee;border:0}@media (max-width:1240px){.book .book-body{-webkit-transition:-webkit-transform 250ms ease;-moz-transition:-moz-transform 250ms ease;-o-transition:-o-transform 250ms ease;transition:transform 250ms ease;padding-bottom:20px}.book .book-body .body-inner{position:static;min-height:calc(100% - 50px)}}@media (min-width:600px){.book.with-summary .book-body{left:300px}}@media (max-width:600px){.book.with-summary{overflow:hidden}.book.with-summary .book-body{-webkit-transform:translate(calc(100% - 60px),0);-moz-transform:translate(calc(100% - 60px),0);-ms-transform:translate(calc(100% - 60px),0);-o-transform:translate(calc(100% - 60px),0);transform:translate(calc(100% - 60px),0)}}.book.without-animation .book-body{-webkit-transition:none!important;-moz-transition:none!important;-o-transition:none!important;transition:none!important}.buttons:after,.buttons:before{content:" ";display:table;line-height:0}.button{border:0;background:#eee;color:#666;width:100%;text-align:center;float:left;line-height:1.42857143;padding:8px 4px}.button:hover{color:#444}.button:focus,.button:hover{outline:0}.button.size-2{width:50%}.button.size-3{width:33%}.book .book-body .page-wrapper .page-inner section{display:none}.book .book-body .page-wrapper .page-inner section.normal{display:block;word-wrap:break-word;overflow:hidden;color:#333;line-height:1.7;text-size-adjust:100%;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%;-moz-text-size-adjust:100%}.book .book-body .page-wrapper .page-inner section.normal *{box-sizing:border-box;-webkit-box-sizing:border-box;font-size:inherit}.book .book-body .page-wrapper .page-inner section.normal>:first-child{margin-top:0!important}.book .book-body .page-wrapper .page-inner section.normal>:last-child{margin-bottom:0!important}.book .book-body .page-wrapper .page-inner section.normal blockquote,.book .book-body .page-wrapper .page-inner section.normal code,.book .book-body .page-wrapper .page-inner section.normal figure,.book .book-body .page-wrapper .page-inner section.normal img,.book .book-body .page-wrapper .page-inner section.normal pre,.book .book-body .page-wrapper .page-inner section.normal table,.book .book-body .page-wrapper .page-inner section.normal tr{page-break-inside:avoid}.book .book-body .page-wrapper .page-inner section.normal h2,.book .book-body .page-wrapper .page-inner section.normal h3,.book .book-body .page-wrapper .page-inner section.normal h4,.book .book-body .page-wrapper .page-inner section.normal h5,.book .book-body .page-wrapper .page-inner section.normal p{orphans:3;widows:3}.book .book-body .page-wrapper .page-inner section.normal h1,.book .book-body .page-wrapper .page-inner section.normal h2,.book .book-body .page-wrapper .page-inner section.normal h3,.book .book-body .page-wrapper .page-inner section.normal h4,.book .book-body .page-wrapper .page-inner section.normal h5{page-break-after:avoid}.book .book-body .page-wrapper .page-inner section.normal b,.book .book-body .page-wrapper .page-inner section.normal strong{font-weight:700}.book .book-body .page-wrapper .page-inner section.normal em{font-style:italic}.book .book-body .page-wrapper .page-inner section.normal blockquote,.book .book-body .page-wrapper .page-inner section.normal dl,.book .book-body .page-wrapper .page-inner section.normal ol,.book .book-body .page-wrapper .page-inner section.normal p,.book .book-body .page-wrapper .page-inner section.normal table,.book .book-body .page-wrapper .page-inner section.normal ul{margin-top:0;margin-bottom:.85em}.book .book-body .page-wrapper .page-inner section.normal a{color:#4183c4;text-decoration:none;background:0 0}.book .book-body .page-wrapper .page-inner section.normal a:active,.book .book-body .page-wrapper .page-inner section.normal a:focus,.book .book-body .page-wrapper .page-inner section.normal a:hover{outline:0;text-decoration:underline}.book .book-body .page-wrapper .page-inner section.normal img{border:0;max-width:100%}.book .book-body .page-wrapper .page-inner section.normal hr{height:4px;padding:0;margin:1.7em 0;overflow:hidden;background-color:#e7e7e7;border:none}.book .book-body .page-wrapper .page-inner section.normal hr:after,.book .book-body .page-wrapper .page-inner section.normal hr:before{display:table;content:" "}.book .book-body .page-wrapper .page-inner section.normal h1,.book .book-body .page-wrapper .page-inner section.normal h2,.book .book-body .page-wrapper .page-inner section.normal h3,.book .book-body .page-wrapper .page-inner section.normal h4,.book .book-body .page-wrapper .page-inner section.normal h5,.book .book-body .page-wrapper .page-inner section.normal h6{margin-top:1.275em;margin-bottom:.85em;font-weight:700}.book .book-body .page-wrapper .page-inner section.normal h1{font-size:2em}.book .book-body .page-wrapper .page-inner section.normal h2{font-size:1.75em}.book .book-body .page-wrapper .page-inner section.normal h3{font-size:1.5em}.book .book-body .page-wrapper .page-inner section.normal h4{font-size:1.25em}.book .book-body .page-wrapper .page-inner section.normal h5{font-size:1em}.book .book-body .page-wrapper .page-inner section.normal h6{font-size:1em;color:#777}.book .book-body .page-wrapper .page-inner section.normal code,.book .book-body .page-wrapper .page-inner section.normal pre{font-family:Consolas,"Liberation Mono",Menlo,Courier,monospace;direction:ltr;border:none;color:inherit}.book .book-body .page-wrapper .page-inner section.normal pre{overflow:auto;word-wrap:normal;margin:0 0 1.275em;padding:.85em 1em;background:#f7f7f7}.book .book-body .page-wrapper .page-inner section.normal pre>code{display:inline;max-width:initial;padding:0;margin:0;overflow:initial;line-height:inherit;font-size:.85em;white-space:pre;background:0 0}.book .book-body .page-wrapper .page-inner section.normal pre>code:after,.book .book-body .page-wrapper .page-inner section.normal pre>code:before{content:normal}.book .book-body .page-wrapper .page-inner section.normal code{padding:.2em;margin:0;font-size:.85em;background-color:#f7f7f7}.book .book-body .page-wrapper .page-inner section.normal code:after,.book .book-body .page-wrapper .page-inner section.normal code:before{letter-spacing:-.2em;content:"\00a0"}.book .book-body .page-wrapper .page-inner section.normal table{display:table;width:100%;border-collapse:collapse;border-spacing:0;overflow:auto}.book .book-body .page-wrapper .page-inner section.normal table td,.book .book-body .page-wrapper .page-inner section.normal table th{padding:6px 13px;border:1px solid #ddd}.book .book-body .page-wrapper .page-inner section.normal table tr{background-color:#fff;border-top:1px solid #ccc}.book .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n){background-color:#f8f8f8}.book .book-body .page-wrapper .page-inner section.normal table th{font-weight:700}.book .book-body .page-wrapper .page-inner section.normal ol,.book .book-body .page-wrapper .page-inner section.normal ul{padding:0 0 0 2em;margin:0 0 .85em}.book .book-body .page-wrapper .page-inner section.normal ol ol,.book .book-body .page-wrapper .page-inner section.normal ol ul,.book .book-body .page-wrapper .page-inner section.normal ul ol,.book .book-body .page-wrapper .page-inner section.normal ul ul{margin-top:0;margin-bottom:0}.book .book-body .page-wrapper .page-inner section.normal ol ol{list-style-type:lower-roman}.book .book-body .page-wrapper .page-inner section.normal blockquote{margin:0 0 .85em;padding:0 15px;color:#858585;border-left:4px solid #e5e5e5}.book .book-body .page-wrapper .page-inner section.normal blockquote:first-child{margin-top:0}.book .book-body .page-wrapper .page-inner section.normal blockquote:last-child{margin-bottom:0}.book .book-body .page-wrapper .page-inner section.normal dl{padding:0}.book .book-body .page-wrapper .page-inner section.normal dl dt{padding:0;margin-top:.85em;font-style:italic;font-weight:700}.book .book-body .page-wrapper .page-inner section.normal dl dd{padding:0 .85em;margin-bottom:.85em}.book .book-body .page-wrapper .page-inner section.normal dd{margin-left:0}.book .book-body .page-wrapper .page-inner section.normal .glossary-term{cursor:help;text-decoration:underline}.book .book-body .navigation{position:absolute;top:50px;bottom:0;margin:0;max-width:150px;min-width:90px;display:flex;justify-content:center;align-content:center;flex-direction:column;font-size:40px;color:#ccc;text-align:center;-webkit-transition:all 350ms ease;-moz-transition:all 350ms ease;-o-transition:all 350ms ease;transition:all 350ms ease}.book .book-body .navigation:hover{text-decoration:none;color:#444}.book .book-body .navigation.navigation-next{right:0}.book .book-body .navigation.navigation-prev{left:0}@media (max-width:1240px){.book .book-body .navigation{position:static;top:auto;max-width:50%;width:50%;display:inline-block;float:left}.book .book-body .navigation.navigation-unique{max-width:100%;width:100%}}.book .book-body .page-wrapper .page-inner section.glossary{margin-bottom:40px}.book .book-body .page-wrapper .page-inner section.glossary h2 a,.book .book-body .page-wrapper .page-inner section.glossary h2 a:hover{color:inherit;text-decoration:none}.book .book-body .page-wrapper .page-inner section.glossary .glossary-index{list-style:none;margin:0;padding:0}.book .book-body .page-wrapper .page-inner section.glossary .glossary-index li{display:inline;margin:0 8px;white-space:nowrap}*{-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;-webkit-overflow-scrolling:touch;-webkit-tap-highlight-color:transparent;-webkit-text-size-adjust:none;-webkit-touch-callout:none}a{text-decoration:none}body,html{height:100%}html{font-size:62.5%}body{text-rendering:optimizeLegibility;font-smoothing:antialiased;font-family:"Helvetica Neue",Helvetica,Arial,sans-serif;font-size:14px;letter-spacing:.2px;text-size-adjust:100%}
\ No newline at end of file
<!DOCTYPE HTML>
<html lang="en" >
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<title>简介 | Introduction</title>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<meta name="description" content="众奇开放文档知识库## 开放.分享.学习 ##祝学习愉快 !!!">
<meta name="generator" content="GitBook 2.6.7">
<meta name="HandheldFriendly" content="true"/>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">
<link rel="apple-touch-icon-precomposed" sizes="152x152" href="gitbook/images/apple-touch-icon-precomposed-152.png">
<link rel="shortcut icon" href="gitbook/images/favicon.ico" type="image/x-icon">
<link rel="stylesheet" href="gitbook/style.css">
<link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-highlight/website.css">
<link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-search/search.css">
<link rel="stylesheet" href="gitbook/plugins/gitbook-plugin-fontsettings/website.css">
<link rel="next" href="./Thinkphp/Structure/evshop_structure.html" />
</head>
<body>
<div class="book"
data-level="0"
data-chapter-title="简介"
data-filepath="README.md"
data-basepath="."
data-revision="Wed May 11 2016 00:54:11 GMT+0800 (中国标准时间)"
data-innerlanguage="">
<div class="book-summary">
<nav role="navigation">
<ul class="summary">
<li class="chapter active" data-level="0" data-path="index.html">
<a href="./index.html">
<i class="fa fa-check"></i>
简介
</a>
</li>
<li class="chapter " data-level="1" >
<span><b>1.</b> Thinkphp</span>
<ul class="articles">
<li class="chapter " data-level="1.1" >
<span><b>1.1.</b> Structure</span>
<ul class="articles">
<li class="chapter " data-level="1.1.1" data-path="Thinkphp/Structure/evshop_structure.html">
<a href="./Thinkphp/Structure/evshop_structure.html">
<i class="fa fa-check"></i>
<b>1.1.1.</b>
EVShop框架结构图
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.2" >
<span><b>1.2.</b> Controller</span>
<ul class="articles">
<li class="chapter " data-level="1.2.1" data-path="Thinkphp/Controller/evshop_controller.html">
<a href="./Thinkphp/Controller/evshop_controller.html">
<i class="fa fa-check"></i>
<b>1.2.1.</b>
EVShop之Controller篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.3" >
<span><b>1.3.</b> View</span>
<ul class="articles">
<li class="chapter " data-level="1.3.1" data-path="Thinkphp/View/evshop_view.html">
<a href="./Thinkphp/View/evshop_view.html">
<i class="fa fa-check"></i>
<b>1.3.1.</b>
EVShop之View篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.4" >
<span><b>1.4.</b> Javascript</span>
<ul class="articles">
<li class="chapter " data-level="1.4.1" data-path="Thinkphp/Javascript/evshop_dialog.html">
<a href="./Thinkphp/Javascript/evshop_dialog.html">
<i class="fa fa-check"></i>
<b>1.4.1.</b>
EVShop之Dialog篇
</a>
</li>
<li class="chapter " data-level="1.4.2" data-path="Thinkphp/Javascript/evshop_js.html">
<a href="./Thinkphp/Javascript/evshop_js.html">
<i class="fa fa-check"></i>
<b>1.4.2.</b>
EVShop之Javascript篇
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.5" >
<span><b>1.5.</b> DB</span>
<ul class="articles">
<li class="chapter " data-level="1.5.1" data-path="Thinkphp/DB/db_sqls.html">
<a href="./Thinkphp/DB/db_sqls.html">
<i class="fa fa-check"></i>
<b>1.5.1.</b>
Thinkphp中SQL的写法
</a>
</li>
</ul>
</li>
<li class="chapter " data-level="1.6" >
<span><b>1.6.</b> Others</span>
<ul class="articles">
<li class="chapter " data-level="1.6.1" data-path="Thinkphp/Others/functions.html">
<a href="./Thinkphp/Others/functions.html">
<i class="fa fa-check"></i>
<b>1.6.1.</b>
Thinkphp中常用功能
</a>
</li>
<li class="chapter " data-level="1.6.2" data-path="Thinkphp/Others/UsefulCodes.html">
<a href="./Thinkphp/Others/UsefulCodes.html">
<i class="fa fa-check"></i>
<b>1.6.2.</b>
EVShop中备用代码片段
</a>
</li>
</ul>
</li>
</ul>
</li>
<li class="divider"></li>
<li>
<a href="https://www.gitbook.com" target="blank" class="gitbook-link">
Published with GitBook
</a>
</li>
</ul>
</nav>
</div>
<div class="book-body">
<div class="body-inner">
<div class="book-header" role="navigation">
<!-- Actions Left -->
<!-- Title -->
<h1>
<i class="fa fa-circle-o-notch fa-spin"></i>
<a href="./" >Introduction</a>
</h1>
</div>
<div class="page-wrapper" tabindex="-1" role="main">
<div class="page-inner">
<section class="normal" id="section-">
<h1 id="introduction">Introduction</h1>
<div style="color:#333">&#x672C;&#x77E5;&#x8BC6;&#x5E93;&#x4E3A; <strong>&#x9752;&#x9E3D;&#x653B;&#x57CE;&#x72EE;</strong> &#x5728;&#x9879;&#x76EE;&#x4E2D;&#x7684;&#x70B9;&#x6EF4;&#x6280;&#x672F;&#x5206;&#x4EAB;&#x3001;&#x5DE5;&#x4F5C;&#x79EF;&#x7D2F;&#x3001;&#x5B66;&#x4E60;&#x6210;&#x679C;&#x5408;&#x96C6;&#xFF01;</div>
<p></p>
<blockquote>
<p>&#x4F17;&#x5947;&#x5F00;&#x653E;&#x6587;&#x6863;&#x77E5;&#x8BC6;&#x5E93;
<strong>## &#x5F00;&#x653E;.&#x5206;&#x4EAB;.&#x5B66;&#x4E60; ##</strong>
&#x795D;&#x5B66;&#x4E60;&#x6109;&#x5FEB; !!!</p>
</blockquote>
<hr>
<p><strong>&#x4F17;&#x5947;&#x4FE1;&#x606F;&#x6280;&#x672F;&#x6709;&#x9650;&#x516C;&#x53F8; &#xA9; Qingger Team</strong> </p>
</section>
</div>
</div>
</div>
<a href="./Thinkphp/Structure/evshop_structure.html" class="navigation navigation-next navigation-unique" aria-label="Next page: EVShop框架结构图"><i class="fa fa-angle-right"></i></a>
</div>
</div>
<script src="gitbook/app.js"></script>
<script src="gitbook/plugins/gitbook-plugin-search/lunr.min.js"></script>
<script src="gitbook/plugins/gitbook-plugin-search/search.js"></script>
<script src="gitbook/plugins/gitbook-plugin-sharing/buttons.js"></script>
<script src="gitbook/plugins/gitbook-plugin-fontsettings/buttons.js"></script>
<script>
require(["gitbook"], function(gitbook) {
var config = {"highlight":{},"search":{"maxIndexSize":1000000},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2}};
gitbook.start(config);
});
</script>
</body>
</html>
This diff could not be displayed because it is too large.
### 1. Markdown: Syntax
* [MarkDown中文网](http://www.markdown.cn/ "MarkDown中文网")
### 2. 解决ios设备页面滚动条卡顿 ###
* CSS
overflow: auto;
-webkit-overflow-scrolling: touch;
### 3. 单行文本溢出显示省略号(...) ###
* CSS
overflow: hidden;
text-overflow: ellipsis;// 显示省略符号来代表被修剪的文本。
white-space: nowrap;// 文本不会换行, 在同一行上继续,直到遇到 <br> 标签为止。
### 4. 多行文本溢出显示省略号(...) ###
* CSS
overflow : hidden;
text-overflow: ellipsis;
-webkit-line-clamp: 2; // 限制文本行数2行(webkit私有属性)
display: -webkit-box;
-webkit-box-orient: vertical;
### 5. 手机软键盘遮挡input ###
1. 方案一
* JS
$('INPUT').focus(function () {
var SCROLLY = 100;
var TIMER_NAME = 500; // focus事件中500ms后进行判断
var MAX_SCROLL = 9999; // 越大越好
setTimeout(function () {
if (window.scrollY < SCROLLY) {
window.scrollTo(0, MAX_SCROLL);
}
}, TIMER_NAME)
})
2. 方案二
* JS
var setScroll = function(obj){
var ua = navigator.userAgent;
if(ua.match(/(iPhone|iPod|iPad|iPhone\s+Simulator)/i)){
setTimeout(function () {
obj.scrollIntoViewIfNeeded(); //obj指元素本身
}, 500)
}
};
//只在当前元素在视窗的可见范围内不可见的情况下,才滚动浏览器窗口或容器元素,最终让当前元素可见。如果当前元素在视窗中可见,这个方法不做任何处理。如果将可选参数alignCenter设置为true,则表示尽量将元素显示在视窗中部(垂直方向)------Safari、Chrome实现了这个方法
* 扩展
scrollIntoView(alignWithTop);// 滚动浏览器窗口或容器元素,以便在当前视窗的可见范围看见当前元素。如果alignWithTop为true,或者省略它,窗口会尽可能滚动到自身顶部与元素顶部平齐。-------目前各浏览器均支持
scrollByLines(lineCount);// 将元素的内容滚动指定的行数的高度,lineCount的值可以为正值或是负值。---Safari、Chrome实现了这个方法
scrollByPages(pageCount);// 将元素的内容滚动指定的页面的高度,具体高度由元素的高度决定。---Safari、Chrome实现了这个方法
### 6. 禁止移动端页面的拷贝功能 ###
* CSS
*{
-webkit-touch-callout:none; /*系统默认菜单被禁用*/
-webkit-user-select:none; /*webkit浏览器*/
-khtml-user-select:none; /*早期浏览器*/
-moz-user-select:none;/*火狐*/
-ms-user-select:none; /*IE10*/
user-select:none;
}
* *IE6-9不支持user-select:none属性,但支持使用标签属性 onselectstart="return false";*
* *在添加完上述代码后,在IOS 上会有问题的,input 框无法正常输入了内容了,添加如下样式*
input {
-webkit-user-select:auto; /*webkit浏览器*/
}
### 7. css模拟'<' '>'符号 ###
* HTML && CSS
<span style='display: inline-block;width: 10px;height: 10px;border-top: 2px solid #ddd;border-left: 2px solid #ddd;transform: rotate(-45deg);'></span>
### 8. css模拟三角
* HTML && CSS
<div style="width: 0;height: 0;border: 10px solid transparent;top: 5px;border-left-color: #ddd"></div>
### 9. 根据设备宽度,设置页面字体大小
* JS
(function (doc, win) {
var docEl = doc.documentElement,
resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
recalc = function () {
var clientWidth = docEl.clientWidth;
if (!clientWidth) return;
docEl.style.fontSize = 10 * (clientWidth / 320) + 'px';
};
if (!doc.addEventListener) return;
win.addEventListener(resizeEvt, recalc, false);
doc.addEventListener('DOMContentLoaded', recalc, false);
})(document, window);
### 10. 各类元标签
* 设置编码信息 
<meta http-equiv="Content-Type" Content="text/html; Charset=utf-8" /> 
* 设置语言 
<meta http-equiv="Content-Language" Content="zh-CN" /> 
* 设置重定向
<meta http-equiv="Refresh" Content="15; Url=http://www.baidu.com" /> 
* 设置缓存时间 
<meta http-equiv="Expires" Content="Web, 26 Jun 2015 18:21:57 GMT" /> 
* 不使用缓存 
<meta http-equiv="Pragma" Content="No-cach" /> 
* 设置关键字 
<meta name="Keywords" Content="key1,key2,..." /> 
* 设置描述信息 
<meta name="Description" Content="description abc" /> 
* 设置对搜索引擎抓取 
<meta name="Robots" Content="All|None|Index|Noindex|Follow|Nofollow" />
* 设置可视区域 
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />  
* 针对浏览器使用
* 国产浏览器内核选择
<meta name="renderer" content="webkit|ie-comp|ie-stand"> 
* 使用最新版的ie浏览器,或者chrome
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
* 针对手持设备优化,主要是针对一些老的不识别viewport的浏览器,比如黑莓
<meta name="HandheldFriendly" content="true">
* 微软的老式浏览器
<meta name="MobileOptimized" content="320"> 
* uc强制竖屏
<meta name="screen-orientation" content="portrait"> 
* QQ强制竖屏
<meta name="x5-orientation" content="portrait"> 
* UC强制全屏
<meta name="full-screen" content="yes"> 
* QQ强制全屏
<meta name="x5-fullscreen" content="true">
* UC应用模式
<meta name="browsermode" content="application"> 
* QQ应用模式
<meta name="x5-page-mode" content="app"> 
* windows phone 点击无高光
<meta name="msapplication-tap-highlight" content="no"> 
* 禁止转码
<meta http-equiv="Cache-Control" content="no-siteapp" /> 
* 禁止数字自动识别为电话号码 
<meta name="format-detection" content="telephone=no" />
* 禁止识别邮箱 
<meta name="format-detection" content="email=no" />
### 11. 金额格式化: '12345678' --> '12,345,678'
var numStr = '12345678';
console.log(numStr.split('').reverse().join('').replace(/(\d{3})/g,'$1,').replace(/,$/,'').split('').reverse().join(''));
### 12. 移动端拖拽demo
* HTML
<body>
<img src='homepage.svg' onclick='window.location.href="http://example.com/"' id="link">
</body>
* CSS
html,body { height:100%; }
#link { width:50px;height:50px;position: absolute;left: 0;top: 0; }
* JS
<script>
window.onload = function(){
drag('link')
};
function drag(obj){
var block = document.getElementById(obj);
var oW,oH;
// 绑定touchstart事件
block.addEventListener("touchstart", function(e) {
var touches = e.touches[0];
oW = touches.clientX - block.offsetLeft;
oH = touches.clientY - block.offsetTop;
//阻止页面的滑动默认事件
document.addEventListener("touchmove",defaultEvent,false);
},false)
block.addEventListener("touchmove", function(e) {
var touches = e.touches[0];
var oLeft = touches.clientX - oW;
var oTop = touches.clientY - oH;
if(oLeft < 0) {
oLeft = 0;
}else if(oLeft > document.documentElement.clientWidth - block.offsetWidth) {
oLeft = (document.documentElement.clientWidth - block.offsetWidth);
}
block.style.left = oLeft + "px";
block.style.top = oTop + "px";
},false);
block.addEventListener("touchend",function() {
document.removeEventListener("touchmove",defaultEvent,false);
},false);
function defaultEvent(e) {
e.preventDefault();
}
}
### 13.判断是否为苹果手机
var ua = navigator.userAgent;
if(ua.match(/(iPhone|iPod|iPad|iPhone\s+Simulator)/i)){
alert("是iphone!")
}
### 14. img标签的 alt 属性和 onerror 事件
* onerror 事件会在文档或图像加载过程中发生错误时被触发
<img src="pic.gif" onerror="javascript:this.src='/noPic.gif';" alt="pic" />
* alt属性,如果无法显示图像,浏览器将显示替代文本