├── README.md ├── article ├── AFNetworking │ └── AFNetworking.html ├── FLEX │ └── FLEX.html ├── GCDAsyncSocket │ └── GCDAsyncSocket.html ├── KSCrash │ └── KSCrash.html ├── ReactiveCocoa │ └── ReactiveCocoa.html ├── SDWebImage │ └── SDWebImage.html ├── SGDownload │ └── SGDownload.html ├── TransitionKit │ └── TransitionKit.html ├── WebViewJavascriptBridge │ └── WebViewJavascriptBridge.html └── react-native │ └── react-native.html ├── gitbook ├── fonts │ └── fontawesome │ │ ├── FontAwesome.otf │ │ ├── fontawesome-webfont.eot │ │ ├── fontawesome-webfont.svg │ │ ├── fontawesome-webfont.ttf │ │ ├── fontawesome-webfont.woff │ │ └── fontawesome-webfont.woff2 ├── gitbook-plugin-fontsettings │ ├── fontsettings.js │ └── website.css ├── gitbook-plugin-highlight │ ├── ebook.css │ └── website.css ├── gitbook-plugin-lunr │ ├── lunr.min.js │ └── search-lunr.js ├── gitbook-plugin-search │ ├── lunr.min.js │ ├── search-engine.js │ ├── search.css │ └── search.js ├── gitbook-plugin-sharing │ └── buttons.js ├── gitbook.js ├── images │ ├── apple-touch-icon-precomposed-152.png │ └── favicon.ico ├── style.css └── theme.js ├── index.html └── search_index.json /README.md: -------------------------------------------------------------------------------- 1 | 2 | 3 | # iOS开源库源码分析 4 | 5 | 作者:[coderyi](http://coderyi.com/) 6 | 7 | 在线阅读地址:http://coderyi.com/iOSSourceCodeAnalyze/ 8 | 9 | 10 | 内容 11 | 12 | 读源码是一个很有效的提升技术的方式,本书就是记录下源码阅读过程中的一些心得。 13 | 14 | 本书会分析iOS流行的开源库,剖析出源码的主要逻辑,核心原理,设计思路,涉及的知识点。 15 | 16 | 本书涉及的内容AFNetworking,ReactiveCocoa,SDWebImage,FLEX,react-native等 17 | 18 | 19 | 面向初中级iOS开发者,关于本书的任何问题可以随时联系我 20 | 21 | 目录 22 | 23 | * [AFNetworking](http://coderyi.com/iOSSourceCodeAnalyze/article/AFNetworking/AFNetworking.html) 24 | 25 | * [SDWebImage](http://coderyi.com/iOSSourceCodeAnalyze/article/SDWebImage/SDWebImage.html) 26 | 27 | * [GCDAsyncSocket](http://coderyi.com/iOSSourceCodeAnalyze/article/GCDAsyncSocket/GCDAsyncSocket.html) 28 | 29 | * [SGDownload](http://coderyi.com/iOSSourceCodeAnalyze/article/SGDownload/SGDownload.html) 30 | 31 | * [FLEX](http://coderyi.com/iOSSourceCodeAnalyze/article/FLEX/FLEX.html) 32 | 33 | * [KSCrash](http://coderyi.com/iOSSourceCodeAnalyze/article/KSCrash/KSCrash.html) 34 | 35 | * [ReactiveCocoa](http://coderyi.com/iOSSourceCodeAnalyze/article/ReactiveCocoa/ReactiveCocoa.html) 36 | 37 | * [TransitionKit](http://coderyi.com/iOSSourceCodeAnalyze/article/TransitionKit/TransitionKit.html) 38 | 39 | * [WebViewJavascriptBridge](http://coderyi.com/iOSSourceCodeAnalyze/article/WebViewJavascriptBridge/WebViewJavascriptBridge.html) 40 | 41 | * [react-native](http://coderyi.com/iOSSourceCodeAnalyze/article/react-native/react-native.html) 42 | 43 | 44 | 45 | [署名-非商业性使用-相同方式共享 4.0 (CC BY-NC-SA 4.0)](https://creativecommons.org/licenses/by-nc-sa/4.0/deed.zh) 46 | -------------------------------------------------------------------------------- /article/FLEX/FLEX.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | FLEX · iOS开源库源码分析 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 |
70 |
71 | 72 | 73 | 76 | 77 | 78 | 249 | 250 | 251 |
252 | 253 |
254 | 255 |
256 | 257 | 258 | 259 | 268 | 269 | 270 | 271 | 272 |
273 |
274 | 275 |
276 |
277 | 278 |
279 | 280 |

iOS 开源库源码分析之FLEX

281 |

本文基于FLEX 2.4.0

282 |

FLEX 是杂志应用公司 Flipboard 出品的一个 App 内调试的工具。

283 |

本文主要讨论 FLEX 怎么做到的网络监听,FileBrowser 的设计思路,FLEX 怎么获取到堆上对象并且展示出来,绘制出整个 App 的视图层级,FLEX 关于 runtime 的运用。

284 |

Network

285 |

Network 部分主要是监听网络请求相关的数据,所以这里要监听请求相关的回调,有两种办法

286 |
    287 |
  • 一是使用 NSURLProtocol 代理请求回调
  • 288 |
  • 二是如 FLEX 所使用的 hook NSURLConnection 和 NSURLSession 的代理方法。目前来讲普遍都是 hook 某一个类的方法,想要 hook 一个 protocol 的方法,这里是通过寻找工程里面所有实现了 protocol 的类,然后再 hook 这些类的方法,可谓另辟蹊径。
  • 289 |
290 |

一个 App 内请求的数据量还是比较大,所以只考虑把请求的数据保存在内存中,这里是一个单例类 FLEXNetworkRecorder 来进行数据的相关处理,每一个数据对应一个 model 类 FLEXNetworkTransaction。为了达到数据与界面分离的效果,这里当数据更新时采用的是 NSNotification 来通知界面。目前请求处理任务是放在子线程,由于通知是同步的并且接收方是用来更新界面的,所以这里会把发送通知事件切换到主线程。

291 |

FLEX 提供了抓取到请求之后,提供 copy url 的功能,实现在 FLEXNetworkCurlLogger 中,主要是把 NSURLRequest 拼接处 curl 的字符串,如下

292 |
293 | curl -v -X GET 'http://www.google.co.uk/?gfe_rd=cr&dcr=0&ei=LZ2jWpKCEYzR8gf5yrSQCQ' -H 'Accept-Encoding: gzip, deflate' -H 'Accept: */*' -H 'Accept-Language: en-us' -H 'Cookie: 1P_JAR=2018-03-10-08; NID=125=HP2nIQkOz_aVYIzH3zrKicXoGyAQSquxoDjOVBZoPyO2sD8dxbYcHVOHkrYwLLOI9YVGFu66TVHZT77kHzTJXNxCVrO50KtKNv4nuGlszsGweCLvorszOnGZHPtWnArU;'
294 | 
295 | 296 |

curl是一个支持各种网络协议的数据传输命令行工具。

297 |

-v/--verbose 表示获取更多的连接信息

298 |

-X GET 用来选定方法

299 |

-H 用来添加请求头

300 |

-d/--data 是 POST 请求的 application/x-www-url-encoded 方式的 body 数据。

301 |

对于处理回调这里也有一个新思路,一个 UITableViewCell 的点击从 didSelectRowAtIndexPath 中移到了 ViewModel 这一层处理,并且是把这个处理使用 block 属性的方式赋予每个 ViewModel 自己处理。

302 |
FLEXNetworkDetailRow *requestURLRow = [[FLEXNetworkDetailRow alloc] init];
303 | requestURLRow.title = @"Request URL";
304 | NSURL *url = transaction.request.URL;
305 | requestURLRow.detailText = url.absoluteString;
306 | requestURLRow.selectionFuture = ^{
307 | UIViewController *urlWebViewController = [[FLEXWebViewController alloc] initWithURL:url];
308 | urlWebViewController.title = url.absoluteString;
309 | return urlWebViewController;
310 | };
311 | [rows addObject:requestURLRow];
312 | 
313 |

FLEX 计算流量是通过把所有请求 response data 的大小加起来,不过 FLEX 只统计 response,没有统计 request,并且只统计 body 没有统计 header,所以数据是不准确的。

314 |

NSCache 基本上就是跟 NSMutableDictionary 类似,唯一不同的是它会自动释放内存,FLEX 使用 NSCache 来保存 response data。

315 |

FileBrowser

316 |

适配器模式(Adapter Pattern) :将一个接口转换成客户希望的另一个接口,适配器模式使接口不兼容的那些类可以一起工作。

317 |

里面有 Target,Adapter,Adaptee。

318 |

Target 就是目标对象,这里来说就是定义的协议,FLEXFileBrowserFileOperationController。

319 |

Adaptee 就是适配者,实际要访问的对象,这里就是 NSFileManager 的删除或移动。

320 |

Adapter 就是适配器,就是FLEXFileBrowserFileDeleteOperationController,FLEXFileBrowserFileRenameOperationController,访问FLEXFileBrowserFileOperationController 协议就能访问 NSFileManager 的操作

321 |

FLEXFileBrowserFileOperationController

322 |

查询 FileManager 的 path 或者文件因为这是一个耗时操作,所以这里把操作放入NSOperation,自定义一个 Operation,实现 main 方法,然后加入 NSOperationQueue。

323 |

DatabaseBrowser

324 |

FLEXSQLiteDatabaseManager 对于 SQLite 的操作是一个简化版的 fmdb,去除了 GCD 队列的管理,主要作用就是查询数据库。

325 |

FLEXRealmDatabaseManager 是实现能够读取 Realm 数据库,这里的实现并没有引入 Realm 库,首先通过

326 |
#if __has_include(<Realm/Realm.h>)
327 | #else
328 | #endif
329 | 
330 |

来判断想要引入的文件是否存在,如果不存在就 FLEXRealmDefines 定义了一堆 Realm 的 class,并且不实现,然后就可以保证不引入一个库而编译通过。

331 |

Heap Objects

332 |

第一个列表 FLEXLiveObjectsTableViewController 是返回所有注册的类,这个通过 objc_copyClassList 可以获取到。

333 |

另外通过下面的方法还可以获取到堆上的所有实例

334 |
// Inspired by:
335 | // http://llvm.org/svn/llvm-project/lldb/tags/RELEASE_34/final/examples/darwin/heap_find/heap/heap_find.cpp
336 | // https://gist.github.com/samdmarshall/17f4e66b5e2e579fd396
337 | 
338 | vm_address_t *zones = NULL;
339 | unsigned int zoneCount = 0;
340 | kern_return_t result = malloc_get_all_zones(TASK_NULL, reader, &zones, &zoneCount);
341 | 
342 | if (result == KERN_SUCCESS) {
343 |     for (unsigned int i = 0; i < zoneCount; i++) {
344 |         malloc_zone_t *zone = (malloc_zone_t *)zones[i];
345 |         if (zone->introspect && zone->introspect->enumerator) {
346 |             zone->introspect->enumerator(TASK_NULL, (__bridge void *)block, MALLOC_PTR_IN_USE_RANGE_TYPE, (vm_address_t)zone, reader, &range_callback);
347 |         }
348 |     }
349 | }
350 | 
351 |

所以 FLEX 才可以显示所有注册的类并且显示该类所有的实例。

352 |

在打开具体某个实例的时候,这里运用了简单工厂模式。

353 |

简单工厂模式的参与者

354 |

Factory:工厂角色,接收客户端请求,通过请求创建对象的产品对象

355 |

Abstract Product:抽象产品角色,工厂模式创建对象的父类

356 |

Concrete Product:具体产品角色,工厂模式创建的对象

357 |

其实UIButton通过

358 |
+ (instancetype)buttonWithType:(UIButtonType)buttonType;
359 | 
360 |

创建就是简单工厂模式

361 |

362 |

这里综合前面说到适配器模式,适配器模式主要是解决接口不兼容的问题,将一个接口转换为另一个接口,工厂方法是定义一个创建对象的接口,根据不同的参数返回不同的实例。

363 |

View Hierarchy

364 |

关于获取所有的 UIWindow 实例,使用的是 UIWindow 的私有方法,"allWindowsIncludingInternalWindows:onlyVisibleWindows:",这里有一个避开苹果检查的办法就是,方法通过数组组装出来的

365 |
NSArray *allWindowsComponents = @[@"al", @"lWindo", @"wsIncl", @"udingInt", @"ernalWin", @"dows:o", @"nlyVisi", @"bleWin", @"dows:"];
366 | SEL allWindowsSelector = NSSelectorFromString([allWindowsComponents componentsJoinedByString:@""]);
367 | 
368 |

一个 UIView 的层级则是巧妙地循环其 superView,来获取其层级,最后画出整个 App 的层级图。

369 |

"select"功能的实现,会把 tap 上所有的 UIView 找出来,办法是 for 循环所有的 UIView,找出在其 tap 范围内的 UIView。

370 |

FLEXWindow

371 |

打开 FLEX 界面是定义了一个 UIWindow,然后把它显示出来,不过由于 FLEX 有一个浮窗工具栏,这个时候 keyWindow 还是系统的,只有当点击工具栏进入 FLEX 全屏界面才会设置 keyWindow 而接收键盘事件。

372 |

首先重写了触摸响应的方案,以工具栏为例,当点击 FLEX 工具栏时就响应,点击其他位置 FLEX 就会不响应,而传递给下层的 UIWindow。

373 |
- (BOOL)pointInside:(CGPoint)point withEvent:(nullable UIEvent *)event;
374 | 
375 |

preview image

376 |

FLEX 有一个预览 UIView 实例画面的功能,实现机制就是获取到 UIView 实例之后,把它转化为 UIImage 来显示。

377 |
+ (UIViewController *)imagePreviewViewControllerForView:(UIView *)view
378 | {
379 |     UIViewController *imagePreviewViewController = nil;
380 |     if (!CGRectIsEmpty(view.bounds)) {
381 |         CGSize viewSize = view.bounds.size;
382 |         UIGraphicsBeginImageContextWithOptions(viewSize, NO, 0.0);
383 |         [view drawViewHierarchyInRect:CGRectMake(0, 0, viewSize.width, viewSize.height) afterScreenUpdates:YES];
384 |         UIImage *previewImage = UIGraphicsGetImageFromCurrentImageContext();
385 |         UIGraphicsEndImageContext();
386 |         imagePreviewViewController = [[FLEXImagePreviewViewController alloc] initWithImage:previewImage];
387 |     }
388 |     return imagePreviewViewController;
389 | }
390 | 
391 |

FLEXRuntimeUtility

392 |

首先可以看Classes and metaclasses中的一张

393 |

这张图表示的是对象的内存关系,图中实线是 super_class 指针,虚线是 isa 指针,类对象存放实例方法,元类对象存放类方法。

394 |
    395 |
  • 实例对象的 isa 指向类对象(类也是对象,面向对象中一切都是对象)
  • 396 |
  • 类对象的 isa 指向元类对象
  • 397 |
  • Root class (class) 其实就是 NSObject,NSObject 是没有超类的,所以 Root class(class) 的 superclass 指向 nil。
  • 398 |
  • Root class(meta) 的 superclass 指向 Root class(class),也就是 NSObject,形成一个回路。
  • 399 |
  • 每个 Meta class 的 isa 指针都指向 Root class (meta)。
  • 400 |
401 |

这里讲解一下 FLEXRuntimeUtility 的相关应用

402 |

属性

403 |

获取一个类的属性

404 |
objc_property_t *propertyList = class_copyPropertyList(class, &propertyCount);
405 | 
406 |

假如

407 |
@property (readonly, copy) NSString *debugDescription;
408 | 
409 |

获取属性的名字

410 |
NSString *name = @(property_getName(property));
411 | 
412 |

根据属性可以获取这个属性的相关特性

413 |
NSString *attributes = @(property_getAttributes(property));
414 | 
415 |

值为

416 |
417 | T@"NSString",R,C
418 | 
419 | 420 |

这个字符串的意义可以查看参考 421 | 比如T就是属性的类型,R就是read-only,C就是copy

422 |

另外还可以动态添加属性

423 |
class_addProperty(theClass, name, attributes, totalAttributesCount);
424 | 
425 |

实例变量

426 |

获取实例变量

427 |
Ivar *ivarList = class_copyIvarList(class, &ivarCount);
428 | 
429 |

获取实例变量的类型

430 |
const char *type = ivar_getTypeEncoding(ivar);
431 | 
432 |

获取变量的值

433 |
value = object_getIvar(object, ivar);
434 | 
435 |

方法

436 |

获取实例方法

437 |
Class class = [self.object class];
438 | Method *methodList = class_copyMethodList(class, &methodCount);
439 | 
440 |

获取类方法

441 |
const char *className = [NSStringFromClass([self.object class]) UTF8String];
442 | 
443 | Class metaClass = objc_getMetaClass(className);
444 | Method *methodList = class_copyMethodList(metaClass, &methodCount);
445 | 
446 |

获取 selector 名字

447 |
NSString *selectorName = NSStringFromSelector(method_getName(method));
448 | 
449 |

获取返回类型

450 |
char *returnType = method_copyReturnType(method);
451 | 
452 |

获取参数类型

453 |
char *argType = method_copyArgumentType(method, argIndex);
454 | 
455 |

这里的 Type 是 type encoding 之后的结果,比如如果是 BOOL 类型,这里 argType 将是 "B",所以这里会将 @encode(BOOL) 之后的结果与 B 对比,相同则表示为 BOOL 类型。

456 |

最后,文章到这就结束了,FLEX 是 iOS 中一个比较特殊的库,很少有人去做 App 内调试相关的东西,通过这里就可以把 App 的调试框架搭起来了,而且 FLEX 关于 runtime 的应用可谓到了一个极致,学习 runtime 也可以多看这个库。

457 |

本文作者coderyi

458 | 459 | 460 |
461 | 462 |
463 |
464 |
465 | 466 |

results matching ""

467 |
    468 | 469 |
    470 |
    471 | 472 |

    No results matching ""

    473 | 474 |
    475 |
    476 |
    477 | 478 |
    479 |
    480 | 481 |
    482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 |
    497 | 498 | 504 |
    505 | 506 | 507 | 508 | 509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | -------------------------------------------------------------------------------- /article/SGDownload/SGDownload.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | SGDownload · iOS开源库源码分析 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 |
    70 |
    71 | 72 | 73 | 76 | 77 | 78 | 249 | 250 | 251 |
    252 | 253 |
    254 | 255 |
    256 | 257 | 258 | 259 | 268 | 269 | 270 | 271 | 272 |
    273 |
    274 | 275 |
    276 |
    277 | 278 |
    279 | 280 |

    iOS 开源库源码分析之SGDownload

    281 |

    SGDownload是一个专门的大文件下载的库.非常适合视频的下载.

    282 |

    先看一下大致结构

    283 |

    284 |

    SGDownloadManager

    285 |

    SGDownloadManager 管理着SGDownload,表示可以同时开启多个下载任务器。

    286 |

    SGDownload

    287 |

    SGDownload管理着SGDownloadTask

    288 |

    taskQueue是一个队列,管理着task。

    289 |

    SGDownload在run的时候

    290 |

    首先会构造一个sessionDelegateQueue用来管理download 的session delegate。

    291 |

    然后初始化一个共用的NSURLSession,

    292 |

    会通过downloadOperationQueue添加一个downloadOperation,在handler里面又一个while循环,里面通过downloadTaskSync方法查询tasks里面状态为None和Waiting的task取出来,然后置为running状态,然后 通过sessionTask和downloadTask一起构造一个SGDownloadTuple,通过taskTupleQueue管理。

    293 |

    SGDownloadTask

    294 |

    这个一个下载任务的类,主要是具体的模型数据

    295 |

    SGDownloadTaskQueue

    296 |

    SGDownloadTaskQueue是task的队列,通过tasks数组来管理task.提供了添加,启动,挂载,取消,删除任务的接口.

    297 | 298 | 299 |
    300 | 301 |
    302 |
    303 |
    304 | 305 |

    results matching ""

    306 |
      307 | 308 |
      309 |
      310 | 311 |

      No results matching ""

      312 | 313 |
      314 |
      315 |
      316 | 317 |
      318 |
      319 | 320 |
      321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 |
      336 | 337 | 343 |
      344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | -------------------------------------------------------------------------------- /article/TransitionKit/TransitionKit.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | TransitionKit · iOS开源库源码分析 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 |
      70 |
      71 | 72 | 73 | 76 | 77 | 78 | 249 | 250 | 251 |
      252 | 253 |
      254 | 255 |
      256 | 257 | 258 | 259 | 268 | 269 | 270 | 271 | 272 |
      273 |
      274 | 275 |
      276 |
      277 | 278 |
      279 | 280 |

      iOS 开源库源码分析之状态机TransitionKit

      281 |

      状态机

      282 |

      有限状态机(finite-state machine),简称状态机。它有几个特征

      283 |
        284 |
      • 状态(state)总数是有限的
      • 285 |
      • 任意时刻,只处在一种状态之中
      • 286 |
      • 某种条件下,会从一种状态转变(transition)到另一种状态
      • 287 |
      288 |

      状态机能够很好的管理复杂业务。在电商场景(订单,物流,售后),社交(IM消息投递),播放等都可以有很好的应用。适用于有一个明确 且复杂的状态流的场景。状态机能够很好的提高代码的可维护性和可测试性。

      289 |

      TKState

      290 |

      表示状态对象

      291 |

      里面会定义state的name以及四个重要的block(willEnter,didEnter,willExit,didExit)

      292 |

      TKEvent

      293 |

      表示事件对象

      294 |
        295 |
      • 目标状态destinationState

        296 |
      • 297 |
      • 定义有哪些可以到达目标状态的来源状态sourceStates

        298 |
      • 299 |
      • 以及是三个重要的block(shouldFireEvent,willFireEvent,didFireEvent)

        300 |
      • 301 |
      302 |

      TKTransition

      303 |

      一个事件中状态转换的对象

      304 |

      主要有事件对象,来源state

      305 |

      TKStateMachine

      306 |

      状态机对象

      307 |

      管理状态相关东西,

      308 |
        309 |
      • initialState,初始化的状态
      • 310 |
      • states,所有的状态
      • 311 |
      • currentState,当前的状态
      • 312 |
      313 |

      管理事件相关的东西

      314 |
        315 |
      • events,所有的的事件
      • 316 |
      • 添加事件
      • 317 |
      318 |

      状态机相关的方法

      319 |
        320 |
      • activate方法,激活状态机,这个时候进入初始状态

        321 |
      • 322 |
      • canFireEvent方法,判断当前state是否在event的来源state数组中。

        323 |
      • 324 |
      • fireEvent: userInfo: error:方法,执行的内容包括下面

        325 |
      • 326 |
      • 判断状态机激活

        327 |
      • 328 |
      • 判断当前state是否在event的来源state数组中
      • 329 |
      • 构造TKTransition对象
      • 330 |
      • 调用event和state的相关回调
      • 331 |
      332 | 333 | 334 |
      335 | 336 |
      337 |
      338 |
      339 | 340 |

      results matching ""

      341 |
        342 | 343 |
        344 |
        345 | 346 |

        No results matching ""

        347 | 348 |
        349 |
        350 |
        351 | 352 |
        353 |
        354 | 355 |
        356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 |
        371 | 372 | 378 |
        379 | 380 | 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 402 | 403 | 404 | 405 | 406 | 407 | 408 | 409 | 410 | 411 | 412 | -------------------------------------------------------------------------------- /article/WebViewJavascriptBridge/WebViewJavascriptBridge.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | WebViewJavascriptBridge · iOS开源库源码分析 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 |
        70 |
        71 | 72 | 73 | 76 | 77 | 78 | 249 | 250 | 251 |
        252 | 253 |
        254 | 255 |
        256 | 257 | 258 | 259 | 268 | 269 | 270 | 271 | 272 |
        273 |
        274 | 275 |
        276 |
        277 | 278 |
        279 | 280 |

        iOS 开源库源码分析之WebViewJavascriptBridge

        281 |

        WebViewJavascriptBridge_JS

        282 |

        WebViewJavascriptBridge_JS是需要注入JS的JS代码部分,主要是一个JS的WebViewJavascriptBridge对象,里面有registerHandler和callHandler方法。

        283 |

        这个代码会在JS载入的时候通过setupWebViewJavascriptBridge调用

        284 |

        WebViewJavascriptBridge

        285 |

        Objective-C调用JS的方法

        286 |

        可以查看Base提供的

        287 |
        _evaluateJavascript
        288 | 

        在UIWebView的实现是通过stringByEvaluatingJavaScriptFromString方法来实现,在WKWebView中是调用evaluateJavaScript: completionHandler:。

        289 |

        这个方法在WebViewJavascriptBridge 和 WKWebViewJavascriptBridge 则通过callHandler方法来包装。

        290 |

        不过需要注意的是,在调用之前你要保证这个方法是有的,所以需要JS端先调用WebViewJavascriptBridge_JS的registerHandler来把方法和方法名作为keyvalue放入WebViewJavascriptBridge_JS的messageHandlers里面

        291 |

        JS调用Objective-C

        292 |

        JavaScript 能直接调用 native 方法吗?不可以。

        293 |

        首先JS端调用WebViewJavascriptBridge_JS的callHandler,这里会把方法键值对加入sendMessageQueue队列,并且赋值iframe的src

        294 |
        https://__wvjb_queue_message__/
        295 | 

        以便ObjC识别自定义的消息.

        296 |

        但是可以间接的通过一些方法来实现。可以利用 UIWebView 的delegate方法 webView: shouldStartLoadWithRequest: navigationType: 来做。 WKWebView 中可以通过的delegate 方法 webView: decidePolicyForNavigationAction: decisionHandler: 来做.

        297 |

        webView 发起的网络请求都会走上面的代理方法,那么就可以在代理里拦截,如果返回的是我们自己定义的 URL ,就不再加载网页,而是来处理一些我们想让它做的事情,从而实现 native 和 JavaScript 的交互。

        298 |

        在代理方法里面会通过webViewJavascriptFetchQueyCommand拉取消息队列,然后序列化消息后拿到对应的消息去调用messageHandlers里面对应的handler.

        299 | 300 | 301 |
        302 | 303 |
        304 |
        305 |
        306 | 307 |

        results matching ""

        308 |
          309 | 310 |
          311 |
          312 | 313 |

          No results matching ""

          314 | 315 |
          316 |
          317 |
          318 | 319 |
          320 |
          321 | 322 |
          323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 |
          338 | 339 | 345 |
          346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 368 | 369 | 370 | 371 | 372 | 373 | 374 | 375 | 376 | 377 | 378 | 379 | -------------------------------------------------------------------------------- /article/react-native/react-native.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | react-native · iOS开源库源码分析 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 |
          68 |
          69 | 70 | 71 | 74 | 75 | 76 | 247 | 248 | 249 |
          250 | 251 |
          252 | 253 |
          254 | 255 | 256 | 257 | 266 | 267 | 268 | 269 | 270 |
          271 |
          272 | 273 |
          274 |
          275 | 276 |
          277 | 278 |

          iOS 开源库源码分析之react-native

          279 |

          此文基于 react-native-0.53.0

          280 |

          react-native 是 facebook 于 2015.3.27 发布的一款构建移动 native app 的框架,使用的 JavaScript 和 React。

          281 |

          本文主要讲述 react-native 在 iOS 端的内容,包括 react-native 的加载流程,JS 与 native 互调的过程,UI 渲染的步骤以及如何传递 native 事件。

          282 |

          加载流程

          283 |
            284 |
          • RCTBridge 的初始化
          • 285 |
          • batchedBridge(RCTCxxBridge) 调用 start
          • 286 |
          • 通过 RCTJavaScriptLoader 的 loadBundleAtURL 方法把 url 解析成 data
          • 287 |
          • 获取到数据后,调用 RCTCxxBridge 的 executeApplicationScript
          • 288 |
          • 调用 JSCExecutor 的 loadApplicationScript 方法
          • 289 |
          • 在 loadApplicationScript 里面会调用 JSCHelplers 的 evaluateScript 方法,传入 JSContextRef 和前面的 data 转化成的脚本字符串 script,以及 sourceURL,这里其实最终调用的就是 JavaScriptCore 的 JSBase 类的 JSEvaluateScript 函数
          • 290 |
          291 |

          补充RCTBridge的几个通知的时机

          292 |
            293 |
          • RCTJavaScriptWillStartLoadingNotification
          • 294 |
          295 |

          RCTCxxBridge 调用start的时候

          296 |
            297 |
          • RCTJavaScriptWillStartExecutingNotification ,表示bridge开始执行JS bundle
          • 298 |
          299 |

          RCTCxxBridge调用executeApplicationScript的时候

          300 |
            301 |
          • RCTJavaScriptDidLoadNotification , 表示bridge 完成load JS bundle
          • 302 |
          303 |

          RCTJavaScriptLoader loadBundleAtURL 成功之后调用

          304 |
            305 |
          • RCTJavaScriptDidFailToLoadNotification,表示bridge load JS bundle 失败
          • 306 |
          307 |

          RCTJavaScriptLoader loadBundleAtURL 失败之后调用

          308 |
            309 |
          • RCTBridgeWillDownloadScriptNotification ,表示bridge开始下载一个script
          • 310 |
          311 |

          RCTJavaScriptLoader loadBundleAtURL 调用前发出该通知

          312 |
            313 |
          • RCTBridgeDidDownloadScriptNotification
          • 314 |
          315 |

          RCTJavaScriptLoader loadBundleAtURL完成之后调用,在RCTJavaScriptDidLoadNotification之前

          316 |

          顺序是 RCTJavaScriptWillStartLoadingNotification -> RCTBridgeWillDownloadScriptNotification -> RCTBridgeDidDownloadScriptNotification -> RCTJavaScriptWillStartExecutingNotification -> RCTJavaScriptDidLoadNotification

          317 |

          在调用start方法里面,在loadBundleAtURL之前

          318 |
          [self _initModules:RCTGetModuleClasses() withDispatchGroup:prepareBridge lazilyDiscovered:NO];
          319 | 

          这里会注册所有的bridgemodule

          320 |

          JS调用native方法

          321 |

          native 方法能够被 JS 调用

          322 |
            323 |
          • 一个 native 的类能够被访问首先需要注册进入 JS,是通过一个宏 RCT_EXPORT_MODULE(js_name),会把 js_name(类名)加入在 RCTBridge 的 RCTModuleClasses(数组,模块配置列表)中
          • 324 |
          • 然后会把 RCTModuleClasses 转化为 RCTCxxBridge 的 _moduleDataByID (_moduleDataByID 的元素是RCTModuleData类,里面有methods数组)
          • 325 |
          • 接着在 RCTCxxBridge 的 buildModuleRegistry 中会构建出 ModuleRegistry 对象,传入 _moduleDataByID 作为其成员变量 modules

            326 |
          • 327 |
          • Objective-C 的对象能够被 JS 访问得益于此,

            328 |
          • 329 |
          330 |
          331 | installGlobalProxy(m_context, "nativeModuleProxy",
          332 |                            exceptionWrapMethod<&jscexecutor::getnativemodule>());
          333 | 
          334 | 最终这里会调用 JSObjectSetProperty(),传入类名和访问的 callback。 335 | 336 | 这样 JS 端在通过 337 |
          338 | var RCTAlertManager = require('NativeModules').AlertManager;
          339 | 
          340 | 341 |

          访问的时候就会回调 JSCExecutor 的 getNativeModule 方法,最终调用 JSCNativeModules 的 getModule,在这里会从 mmoduleRegistry->getConfig(name) 获取对应的结果,ModuleRegistry 的查找就是根据前面modules模块配置列表找到对应的 RCTAlertManager

          342 |
            343 |
          • ObjC 的方法能够被 JS 调用则是这样,JSCHelpers 的 installGlobalFunction(),可以设置 JS 的 function callback,JS 可以同步(在 JS 线程里面)或者异步(切换到指定线程)调用 native 方法,分别是 nativeCallSyncHook 和 nativeFlushQueueImmediate(MessageQueue.js 的 enqueueNativeCall 调用 callback 对象),这两个方法定义在NativeModules.js,callback 实现在 native 端

            344 |
              345 |
            • nativeFlushQueueImmediate 这个方法主要是将js传过来的队列里面的需要调用的方法一起调用了。nativeCallSyncHook 这个方式主要是给JS直接同步调用ObjC方法来用的。
            • 346 |
            347 |
          • 348 |
          349 |

          installNativeHook 最终是把 exceptionWrapMethod(nativeCallSyncHook) callback设置到对应的 jsName(nativeCallSyncHook) 上去,这里通过的是 JSC_JSObjectMakeFunctionWithCallback 方法(也就是 JSObjectRef 的JSObjectMakeFunctionWithCallback())

          350 |
          installNativeHook<&JSCExecutor::nativeFlushQueueImmediate>("nativeFlushQueueImmediate");
          351 | 
          352 | void JSCExecutor::installNativeHook(const char* name) {
          353 |   installGlobalFunction(m_context, name, exceptionWrapMethod<method>());
          354 | }
          355 | 
          356 | void installGlobalFunction(
          357 |     JSGlobalContextRef ctx,
          358 |     const char* name,
          359 |     JSObjectCallAsFunctionCallback callback) {
          360 |   String jsName(ctx, name);
          361 |   JSObjectRef functionObj = JSC_JSObjectMakeFunctionWithCallback(
          362 |     ctx, jsName, callback);
          363 |   Object::getGlobalObject(ctx).setProperty(jsName, Value(ctx, functionObj));
          364 | }
          365 | 

          对于 exceptionWrapMethod 里面会把 installNativeHook 传进来的执行者和方法来调用 (executor->*method)(argumentCount, arguments),这样调用 callback 的时候就会调用 JSCExecutor 的 nativeCallSyncHook 或者 nativeFlushQueueImmediate 方法。

          366 |
            template&lt;JSValueRef (JSCExecutor::*method)(size_t, const JSValueRef[])&gt;
          367 |   inline JSObjectCallAsFunctionCallback exceptionWrapMethod() {
          368 |     struct funcWrapper {
          369 |       static JSValueRef call(
          370 |                              JSContextRef ctx,
          371 |                              JSObjectRef function,
          372 |                              JSObjectRef thisObject,
          373 |                              size_t argumentCount,
          374 |                              const JSValueRef arguments[],
          375 |                              JSValueRef *exception) {
          376 |         try {
          377 |           auto executor = Object::getGlobalObject(ctx).getPrivate<JSCExecutor>();
          378 |           if (executor && executor->getJavaScriptContext()) { // Executor not invalidated
          379 |             return (executor->*method)(argumentCount, arguments);
          380 |           }
          381 |         } catch (...) {
          382 |           *exception = translatePendingCppExceptionToJSError(ctx, function);
          383 |         }
          384 |         return Value::makeUndefined(ctx);
          385 |       }
          386 |     };
          387 | 
          388 |     return &funcWrapper::call;
          389 |   }
          390 | 
            391 |
          • nativeFlushQueueImmediate 或者 nativeCallSyncHook 会调用 ModuleRegistry 的 callNativeMethod/callSerializableNativeHook 方法,在这里会去匹配模块列表,然后进行正确调用,之后调用 RCTNativeModule 的 invokeInner 方法

            392 |
          • 393 |
          • 最后调用 RCTModuleMethod 类的 [method invokeWithBridge:bridge module:moduleData.instance arguments:objcParams]; 这里其实调用的是 runtime 的 [_invocation invokeWithTarget:module];

            394 |
          • 395 |
          396 |

          native调用JS方法

          397 |
            398 |
          • native 可以调用 RCTBridge的enqueueJSCall:args: 方法来调用 JS 环境的代码
          • 399 |
          • 然后会调用到 NativeToJsBridge.cpp 的 callFunction 方法
          • 400 |
          • 然后调用 JSCExecutor 的 callFunction 方法
          • 401 |
          • 最后在 Value.cpp 中调用下面
          • 402 |
          403 |
          404 | Value Object::callAsFunction(JSObjectRef thisObj, int nArgs, const JSValueRef args[]) const {
          405 |   JSValueRef exn;
          406 |   JSValueRef result = JSC_JSObjectCallAsFunction(m_context, m_obj, thisObj, nArgs, args, &exn);
          407 | 
          408 |   if (!result) {
          409 |     throw JSException(m_context, exn, "Exception calling object as function");
          410 |   }
          411 |   return Value(m_context, result);
          412 | }
          413 | 
          414 | 415 |

          JSC_JSObjectCallAsFunction这里其实是通过__jsc_wrapper最终调用了JSObjectRef的JSObjectCallAsFunction函数。

          416 |

          RCTMessageThread

          417 |

          JS 是单线程的,所以在 native 里面调用 JS 或者 JS 调用 native 的回调都是在JS 线程的。

          418 |
            419 |
          • 在 RCTBridge 初始化的时候会使用 NSThread 初始化出_jsThread实例。
          • 420 |
          • 之后通过 ensureOnJavaScriptThread 方法,在_jsThread中初始化_jsMessageThread(RCTMessageThread)
          • 421 |
          • 在通过 RCTCxxBridge 的 executeApplicationScript 加载 js 文件的时候,最终也会在 NativeToJsBridge 的 loadApplication 方法里面调用 m_executorMessageQueueThread->runOnQueue,来切换到_jsMessageThread。

            422 |
          • 423 |
          • native 调用 JS 时,在 enqueueJSCall 里面 ensureOnJavaScriptThread 来进行切换线程

            424 |
          • 425 |
          • JS 通过 native 定义的 CallSyncHook 和 nativeFlushQueueImmediate 同步或者异步调用 native 方法时候都是会在 RCTMessageThread 线程回调,如果同步则直接调用,如果异步(RCTNativeModule::invoke)则会切换到 moduledata 指定的线程
          • 426 |
          427 |

          moduledata是可以指定执行线程的,详见其类的setUpMethodQueue方法

          428 |
          429 | if (!_methodQueue && _bridge.valid) {
          430 |   // Create new queue (store queueName, as it isn't retained by dispatch_queue)
          431 |   _queueName = [NSString stringWithFormat:@"com.facebook.react.%@Queue", self.name];
          432 |   _methodQueue = dispatch_queue_create(_queueName.UTF8String, DISPATCH_QUEUE_SERIAL);
          433 | }
          434 | 
          435 | 436 | 437 |

          UI渲染

          438 |
            439 |
          • 在最开始 RCTUImanager 设置 bridge 的时候会给_componentDataByName赋值,这是一个以 componentData.name 为 key 的字典,保存了所有为 RCTViewManager 子类的 moduleClasses

            440 |
          • 441 |
          • RCTRootView 在初始化的时候,这里会把 RCTRootContentView addSubView,然后会调用 JS 端 AppRegistry 的 runApplication 方法

            442 |
          • 443 |
          • 这个时候会收到 RootView 的 batchDidComplete 消息进行 RootView 的布局相关操作

            444 |
          • 445 |
          • 之后 JS 会调用 native RCTUIManager 的 createView: 方法进行子视图的创建
          • 446 |
          447 |

          在 create 方法里面会形成一个_shadowViewRegistry字典,key 为所要创建 view 的 reactTag,值为 view 对应的 RCTShadowView

          448 |

          然后在主线程形成一个_viewRegistry字典,key 同样为 reactTag,值则是对应的 UIView

          449 |
            450 |
          • 当收到 batchDidComplete 的消息的时候,会进行子视图的 UI 布局的工作,在这里会通过 addUIBlock 把 UI 工作加入_pendingUIBlocks,最后通过 flushUIBlocksWithCompletion 把所有_pendingUIBlocks异步到主线程来做

            451 |
          • 452 |
          • 在 flushUIBlocksWithCompletion 里面,首先会 setChildren 的 UIBlock,RCTUIManager 的 RCTSetChildren() 方法这里会根据 reactTag 通过 UIView+React 的 insertReactSubview 进行排序,之后还会设置 UIView 的相关属性,然后调用其 didUpdateReactSubviews 来 addSubView。

            453 |
          • 454 |
          455 |

          touch和scroll事件处理

          456 |

          react-native 对于 touch 和 scroll 事件是通过 RCTEventDispatcher 来处理的

          457 |
            458 |
          • 当 native 接收到对应的事件以后,会通过 RCTEventDispatcher 的 sendEvent 来处理,这个时候会把 eventID 加入_eventQueue,_events则保存eventID对应的event
          • 459 |
          460 |

          在这里如果还有未处理的事件后先 block 住,当之前的处理完之后会 dispatch 到 RCTJSThread 来处理

          461 |
            462 |
          • 处理事件调用的是 flushEventsQueue,这里会通过 enqueueJSCall 来发送到 JS 端
          • 463 |
          464 |

          说实话,跨平台开发一直是开发者热爱所在,有移动端的跨平台 react-native,有 PC 端的跨平台 electron,这些都是通过 JS 就可以实现跨平台的,当然也有其他语言也有,不过都不如 JS 应用广泛。跨平台可以减少成本,加快迭代,不用发版,再加上移动互联网的发展,JS 语言的魅力,所以说 react-native 才可以大放异彩。本文只是 react-native 的冰山一角,感兴趣的朋友可以多多了解。

          465 |

          本文作者coderyi

          466 | 467 | 468 |
          469 | 470 |
          471 |
          472 |
          473 | 474 |

          results matching ""

          475 |
            476 | 477 |
            478 |
            479 | 480 |

            No results matching ""

            481 | 482 |
            483 |
            484 |
            485 | 486 |
            487 |
            488 | 489 |
            490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 |
            501 | 502 | 508 |
            509 | 510 | 511 | 512 | 513 | 514 | 515 | 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 538 | 539 | 540 | 541 | 542 | -------------------------------------------------------------------------------- /gitbook/fonts/fontawesome/FontAwesome.otf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderyi/iOSSourceCodeAnalyze/e776f12e7a08d9538d92fd53d39ecf60fb4a196f/gitbook/fonts/fontawesome/FontAwesome.otf -------------------------------------------------------------------------------- /gitbook/fonts/fontawesome/fontawesome-webfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderyi/iOSSourceCodeAnalyze/e776f12e7a08d9538d92fd53d39ecf60fb4a196f/gitbook/fonts/fontawesome/fontawesome-webfont.eot -------------------------------------------------------------------------------- /gitbook/fonts/fontawesome/fontawesome-webfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderyi/iOSSourceCodeAnalyze/e776f12e7a08d9538d92fd53d39ecf60fb4a196f/gitbook/fonts/fontawesome/fontawesome-webfont.ttf -------------------------------------------------------------------------------- /gitbook/fonts/fontawesome/fontawesome-webfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderyi/iOSSourceCodeAnalyze/e776f12e7a08d9538d92fd53d39ecf60fb4a196f/gitbook/fonts/fontawesome/fontawesome-webfont.woff -------------------------------------------------------------------------------- /gitbook/fonts/fontawesome/fontawesome-webfont.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderyi/iOSSourceCodeAnalyze/e776f12e7a08d9538d92fd53d39ecf60fb4a196f/gitbook/fonts/fontawesome/fontawesome-webfont.woff2 -------------------------------------------------------------------------------- /gitbook/gitbook-plugin-fontsettings/fontsettings.js: -------------------------------------------------------------------------------- 1 | require(['gitbook', 'jquery'], function(gitbook, $) { 2 | // Configuration 3 | var MAX_SIZE = 4, 4 | MIN_SIZE = 0, 5 | BUTTON_ID; 6 | 7 | // Current fontsettings state 8 | var fontState; 9 | 10 | // Default themes 11 | var THEMES = [ 12 | { 13 | config: 'white', 14 | text: 'White', 15 | id: 0 16 | }, 17 | { 18 | config: 'sepia', 19 | text: 'Sepia', 20 | id: 1 21 | }, 22 | { 23 | config: 'night', 24 | text: 'Night', 25 | id: 2 26 | } 27 | ]; 28 | 29 | // Default font families 30 | var FAMILIES = [ 31 | { 32 | config: 'serif', 33 | text: 'Serif', 34 | id: 0 35 | }, 36 | { 37 | config: 'sans', 38 | text: 'Sans', 39 | id: 1 40 | } 41 | ]; 42 | 43 | // Return configured themes 44 | function getThemes() { 45 | return THEMES; 46 | } 47 | 48 | // Modify configured themes 49 | function setThemes(themes) { 50 | THEMES = themes; 51 | updateButtons(); 52 | } 53 | 54 | // Return configured font families 55 | function getFamilies() { 56 | return FAMILIES; 57 | } 58 | 59 | // Modify configured font families 60 | function setFamilies(families) { 61 | FAMILIES = families; 62 | updateButtons(); 63 | } 64 | 65 | // Save current font settings 66 | function saveFontSettings() { 67 | gitbook.storage.set('fontState', fontState); 68 | update(); 69 | } 70 | 71 | // Increase font size 72 | function enlargeFontSize(e) { 73 | e.preventDefault(); 74 | if (fontState.size >= MAX_SIZE) return; 75 | 76 | fontState.size++; 77 | saveFontSettings(); 78 | } 79 | 80 | // Decrease font size 81 | function reduceFontSize(e) { 82 | e.preventDefault(); 83 | if (fontState.size <= MIN_SIZE) return; 84 | 85 | fontState.size--; 86 | saveFontSettings(); 87 | } 88 | 89 | // Change font family 90 | function changeFontFamily(configName, e) { 91 | if (e && e instanceof Event) { 92 | e.preventDefault(); 93 | } 94 | 95 | var familyId = getFontFamilyId(configName); 96 | fontState.family = familyId; 97 | saveFontSettings(); 98 | } 99 | 100 | // Change type of color theme 101 | function changeColorTheme(configName, e) { 102 | if (e && e instanceof Event) { 103 | e.preventDefault(); 104 | } 105 | 106 | var $book = gitbook.state.$book; 107 | 108 | // Remove currently applied color theme 109 | if (fontState.theme !== 0) 110 | $book.removeClass('color-theme-'+fontState.theme); 111 | 112 | // Set new color theme 113 | var themeId = getThemeId(configName); 114 | fontState.theme = themeId; 115 | if (fontState.theme !== 0) 116 | $book.addClass('color-theme-'+fontState.theme); 117 | 118 | saveFontSettings(); 119 | } 120 | 121 | // Return the correct id for a font-family config key 122 | // Default to first font-family 123 | function getFontFamilyId(configName) { 124 | // Search for plugin configured font family 125 | var configFamily = $.grep(FAMILIES, function(family) { 126 | return family.config == configName; 127 | })[0]; 128 | // Fallback to default font family 129 | return (!!configFamily)? configFamily.id : 0; 130 | } 131 | 132 | // Return the correct id for a theme config key 133 | // Default to first theme 134 | function getThemeId(configName) { 135 | // Search for plugin configured theme 136 | var configTheme = $.grep(THEMES, function(theme) { 137 | return theme.config == configName; 138 | })[0]; 139 | // Fallback to default theme 140 | return (!!configTheme)? configTheme.id : 0; 141 | } 142 | 143 | function update() { 144 | var $book = gitbook.state.$book; 145 | 146 | $('.font-settings .font-family-list li').removeClass('active'); 147 | $('.font-settings .font-family-list li:nth-child('+(fontState.family+1)+')').addClass('active'); 148 | 149 | $book[0].className = $book[0].className.replace(/\bfont-\S+/g, ''); 150 | $book.addClass('font-size-'+fontState.size); 151 | $book.addClass('font-family-'+fontState.family); 152 | 153 | if(fontState.theme !== 0) { 154 | $book[0].className = $book[0].className.replace(/\bcolor-theme-\S+/g, ''); 155 | $book.addClass('color-theme-'+fontState.theme); 156 | } 157 | } 158 | 159 | function init(config) { 160 | // Search for plugin configured font family 161 | var configFamily = getFontFamilyId(config.family), 162 | configTheme = getThemeId(config.theme); 163 | 164 | // Instantiate font state object 165 | fontState = gitbook.storage.get('fontState', { 166 | size: config.size || 2, 167 | family: configFamily, 168 | theme: configTheme 169 | }); 170 | 171 | update(); 172 | } 173 | 174 | function updateButtons() { 175 | // Remove existing fontsettings buttons 176 | if (!!BUTTON_ID) { 177 | gitbook.toolbar.removeButton(BUTTON_ID); 178 | } 179 | 180 | // Create buttons in toolbar 181 | BUTTON_ID = gitbook.toolbar.createButton({ 182 | icon: 'fa fa-font', 183 | label: 'Font Settings', 184 | className: 'font-settings', 185 | dropdown: [ 186 | [ 187 | { 188 | text: 'A', 189 | className: 'font-reduce', 190 | onClick: reduceFontSize 191 | }, 192 | { 193 | text: 'A', 194 | className: 'font-enlarge', 195 | onClick: enlargeFontSize 196 | } 197 | ], 198 | $.map(FAMILIES, function(family) { 199 | family.onClick = function(e) { 200 | return changeFontFamily(family.config, e); 201 | }; 202 | 203 | return family; 204 | }), 205 | $.map(THEMES, function(theme) { 206 | theme.onClick = function(e) { 207 | return changeColorTheme(theme.config, e); 208 | }; 209 | 210 | return theme; 211 | }) 212 | ] 213 | }); 214 | } 215 | 216 | // Init configuration at start 217 | gitbook.events.bind('start', function(e, config) { 218 | var opts = config.fontsettings; 219 | 220 | // Generate buttons at start 221 | updateButtons(); 222 | 223 | // Init current settings 224 | init(opts); 225 | }); 226 | 227 | // Expose API 228 | gitbook.fontsettings = { 229 | enlargeFontSize: enlargeFontSize, 230 | reduceFontSize: reduceFontSize, 231 | setTheme: changeColorTheme, 232 | setFamily: changeFontFamily, 233 | getThemes: getThemes, 234 | setThemes: setThemes, 235 | getFamilies: getFamilies, 236 | setFamilies: setFamilies 237 | }; 238 | }); 239 | 240 | 241 | -------------------------------------------------------------------------------- /gitbook/gitbook-plugin-fontsettings/website.css: -------------------------------------------------------------------------------- 1 | /* 2 | * Theme 1 3 | */ 4 | .color-theme-1 .dropdown-menu { 5 | background-color: #111111; 6 | border-color: #7e888b; 7 | } 8 | .color-theme-1 .dropdown-menu .dropdown-caret .caret-inner { 9 | border-bottom: 9px solid #111111; 10 | } 11 | .color-theme-1 .dropdown-menu .buttons { 12 | border-color: #7e888b; 13 | } 14 | .color-theme-1 .dropdown-menu .button { 15 | color: #afa790; 16 | } 17 | .color-theme-1 .dropdown-menu .button:hover { 18 | color: #73553c; 19 | } 20 | /* 21 | * Theme 2 22 | */ 23 | .color-theme-2 .dropdown-menu { 24 | background-color: #2d3143; 25 | border-color: #272a3a; 26 | } 27 | .color-theme-2 .dropdown-menu .dropdown-caret .caret-inner { 28 | border-bottom: 9px solid #2d3143; 29 | } 30 | .color-theme-2 .dropdown-menu .buttons { 31 | border-color: #272a3a; 32 | } 33 | .color-theme-2 .dropdown-menu .button { 34 | color: #62677f; 35 | } 36 | .color-theme-2 .dropdown-menu .button:hover { 37 | color: #f4f4f5; 38 | } 39 | .book .book-header .font-settings .font-enlarge { 40 | line-height: 30px; 41 | font-size: 1.4em; 42 | } 43 | .book .book-header .font-settings .font-reduce { 44 | line-height: 30px; 45 | font-size: 1em; 46 | } 47 | .book.color-theme-1 .book-body { 48 | color: #704214; 49 | background: #f3eacb; 50 | } 51 | .book.color-theme-1 .book-body .page-wrapper .page-inner section { 52 | background: #f3eacb; 53 | } 54 | .book.color-theme-2 .book-body { 55 | color: #bdcadb; 56 | background: #1c1f2b; 57 | } 58 | .book.color-theme-2 .book-body .page-wrapper .page-inner section { 59 | background: #1c1f2b; 60 | } 61 | .book.font-size-0 .book-body .page-inner section { 62 | font-size: 1.2rem; 63 | } 64 | .book.font-size-1 .book-body .page-inner section { 65 | font-size: 1.4rem; 66 | } 67 | .book.font-size-2 .book-body .page-inner section { 68 | font-size: 1.6rem; 69 | } 70 | .book.font-size-3 .book-body .page-inner section { 71 | font-size: 2.2rem; 72 | } 73 | .book.font-size-4 .book-body .page-inner section { 74 | font-size: 4rem; 75 | } 76 | .book.font-family-0 { 77 | font-family: Georgia, serif; 78 | } 79 | .book.font-family-1 { 80 | font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; 81 | } 82 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal { 83 | color: #704214; 84 | } 85 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal a { 86 | color: inherit; 87 | } 88 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1, 89 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2, 90 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h3, 91 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h4, 92 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h5, 93 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h6 { 94 | color: inherit; 95 | } 96 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h1, 97 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h2 { 98 | border-color: inherit; 99 | } 100 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal h6 { 101 | color: inherit; 102 | } 103 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal hr { 104 | background-color: inherit; 105 | } 106 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal blockquote { 107 | border-color: inherit; 108 | } 109 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre, 110 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code { 111 | background: #fdf6e3; 112 | color: #657b83; 113 | border-color: #f8df9c; 114 | } 115 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal .highlight { 116 | background-color: inherit; 117 | } 118 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table th, 119 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table td { 120 | border-color: #f5d06c; 121 | } 122 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table tr { 123 | color: inherit; 124 | background-color: #fdf6e3; 125 | border-color: #444444; 126 | } 127 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) { 128 | background-color: #fbeecb; 129 | } 130 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal { 131 | color: #bdcadb; 132 | } 133 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal a { 134 | color: #3eb1d0; 135 | } 136 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1, 137 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2, 138 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h3, 139 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h4, 140 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h5, 141 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h6 { 142 | color: #fffffa; 143 | } 144 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h1, 145 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h2 { 146 | border-color: #373b4e; 147 | } 148 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal h6 { 149 | color: #373b4e; 150 | } 151 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal hr { 152 | background-color: #373b4e; 153 | } 154 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal blockquote { 155 | border-color: #373b4e; 156 | } 157 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre, 158 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code { 159 | color: #9dbed8; 160 | background: #2d3143; 161 | border-color: #2d3143; 162 | } 163 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal .highlight { 164 | background-color: #282a39; 165 | } 166 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table th, 167 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table td { 168 | border-color: #3b3f54; 169 | } 170 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table tr { 171 | color: #b6c2d2; 172 | background-color: #2d3143; 173 | border-color: #3b3f54; 174 | } 175 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal table tr:nth-child(2n) { 176 | background-color: #35394b; 177 | } 178 | .book.color-theme-1 .book-header { 179 | color: #afa790; 180 | background: transparent; 181 | } 182 | .book.color-theme-1 .book-header .btn { 183 | color: #afa790; 184 | } 185 | .book.color-theme-1 .book-header .btn:hover { 186 | color: #73553c; 187 | background: none; 188 | } 189 | .book.color-theme-1 .book-header h1 { 190 | color: #704214; 191 | } 192 | .book.color-theme-2 .book-header { 193 | color: #7e888b; 194 | background: transparent; 195 | } 196 | .book.color-theme-2 .book-header .btn { 197 | color: #3b3f54; 198 | } 199 | .book.color-theme-2 .book-header .btn:hover { 200 | color: #fffff5; 201 | background: none; 202 | } 203 | .book.color-theme-2 .book-header h1 { 204 | color: #bdcadb; 205 | } 206 | .book.color-theme-1 .book-body .navigation { 207 | color: #afa790; 208 | } 209 | .book.color-theme-1 .book-body .navigation:hover { 210 | color: #73553c; 211 | } 212 | .book.color-theme-2 .book-body .navigation { 213 | color: #383f52; 214 | } 215 | .book.color-theme-2 .book-body .navigation:hover { 216 | color: #fffff5; 217 | } 218 | /* 219 | * Theme 1 220 | */ 221 | .book.color-theme-1 .book-summary { 222 | color: #afa790; 223 | background: #111111; 224 | border-right: 1px solid rgba(0, 0, 0, 0.07); 225 | } 226 | .book.color-theme-1 .book-summary .book-search { 227 | background: transparent; 228 | } 229 | .book.color-theme-1 .book-summary .book-search input, 230 | .book.color-theme-1 .book-summary .book-search input:focus { 231 | border: 1px solid transparent; 232 | } 233 | .book.color-theme-1 .book-summary ul.summary li.divider { 234 | background: #7e888b; 235 | box-shadow: none; 236 | } 237 | .book.color-theme-1 .book-summary ul.summary li i.fa-check { 238 | color: #33cc33; 239 | } 240 | .book.color-theme-1 .book-summary ul.summary li.done > a { 241 | color: #877f6a; 242 | } 243 | .book.color-theme-1 .book-summary ul.summary li a, 244 | .book.color-theme-1 .book-summary ul.summary li span { 245 | color: #877f6a; 246 | background: transparent; 247 | font-weight: normal; 248 | } 249 | .book.color-theme-1 .book-summary ul.summary li.active > a, 250 | .book.color-theme-1 .book-summary ul.summary li a:hover { 251 | color: #704214; 252 | background: transparent; 253 | font-weight: normal; 254 | } 255 | /* 256 | * Theme 2 257 | */ 258 | .book.color-theme-2 .book-summary { 259 | color: #bcc1d2; 260 | background: #2d3143; 261 | border-right: none; 262 | } 263 | .book.color-theme-2 .book-summary .book-search { 264 | background: transparent; 265 | } 266 | .book.color-theme-2 .book-summary .book-search input, 267 | .book.color-theme-2 .book-summary .book-search input:focus { 268 | border: 1px solid transparent; 269 | } 270 | .book.color-theme-2 .book-summary ul.summary li.divider { 271 | background: #272a3a; 272 | box-shadow: none; 273 | } 274 | .book.color-theme-2 .book-summary ul.summary li i.fa-check { 275 | color: #33cc33; 276 | } 277 | .book.color-theme-2 .book-summary ul.summary li.done > a { 278 | color: #62687f; 279 | } 280 | .book.color-theme-2 .book-summary ul.summary li a, 281 | .book.color-theme-2 .book-summary ul.summary li span { 282 | color: #c1c6d7; 283 | background: transparent; 284 | font-weight: 600; 285 | } 286 | .book.color-theme-2 .book-summary ul.summary li.active > a, 287 | .book.color-theme-2 .book-summary ul.summary li a:hover { 288 | color: #f4f4f5; 289 | background: #252737; 290 | font-weight: 600; 291 | } 292 | -------------------------------------------------------------------------------- /gitbook/gitbook-plugin-highlight/ebook.css: -------------------------------------------------------------------------------- 1 | pre, 2 | code { 3 | /* http://jmblog.github.io/color-themes-for-highlightjs */ 4 | /* Tomorrow Comment */ 5 | /* Tomorrow Red */ 6 | /* Tomorrow Orange */ 7 | /* Tomorrow Yellow */ 8 | /* Tomorrow Green */ 9 | /* Tomorrow Aqua */ 10 | /* Tomorrow Blue */ 11 | /* Tomorrow Purple */ 12 | } 13 | pre .hljs-comment, 14 | code .hljs-comment, 15 | pre .hljs-title, 16 | code .hljs-title { 17 | color: #8e908c; 18 | } 19 | pre .hljs-variable, 20 | code .hljs-variable, 21 | pre .hljs-attribute, 22 | code .hljs-attribute, 23 | pre .hljs-tag, 24 | code .hljs-tag, 25 | pre .hljs-regexp, 26 | code .hljs-regexp, 27 | pre .hljs-deletion, 28 | code .hljs-deletion, 29 | pre .ruby .hljs-constant, 30 | code .ruby .hljs-constant, 31 | pre .xml .hljs-tag .hljs-title, 32 | code .xml .hljs-tag .hljs-title, 33 | pre .xml .hljs-pi, 34 | code .xml .hljs-pi, 35 | pre .xml .hljs-doctype, 36 | code .xml .hljs-doctype, 37 | pre .html .hljs-doctype, 38 | code .html .hljs-doctype, 39 | pre .css .hljs-id, 40 | code .css .hljs-id, 41 | pre .css .hljs-class, 42 | code .css .hljs-class, 43 | pre .css .hljs-pseudo, 44 | code .css .hljs-pseudo { 45 | color: #c82829; 46 | } 47 | pre .hljs-number, 48 | code .hljs-number, 49 | pre .hljs-preprocessor, 50 | code .hljs-preprocessor, 51 | pre .hljs-pragma, 52 | code .hljs-pragma, 53 | pre .hljs-built_in, 54 | code .hljs-built_in, 55 | pre .hljs-literal, 56 | code .hljs-literal, 57 | pre .hljs-params, 58 | code .hljs-params, 59 | pre .hljs-constant, 60 | code .hljs-constant { 61 | color: #f5871f; 62 | } 63 | pre .ruby .hljs-class .hljs-title, 64 | code .ruby .hljs-class .hljs-title, 65 | pre .css .hljs-rules .hljs-attribute, 66 | code .css .hljs-rules .hljs-attribute { 67 | color: #eab700; 68 | } 69 | pre .hljs-string, 70 | code .hljs-string, 71 | pre .hljs-value, 72 | code .hljs-value, 73 | pre .hljs-inheritance, 74 | code .hljs-inheritance, 75 | pre .hljs-header, 76 | code .hljs-header, 77 | pre .hljs-addition, 78 | code .hljs-addition, 79 | pre .ruby .hljs-symbol, 80 | code .ruby .hljs-symbol, 81 | pre .xml .hljs-cdata, 82 | code .xml .hljs-cdata { 83 | color: #718c00; 84 | } 85 | pre .css .hljs-hexcolor, 86 | code .css .hljs-hexcolor { 87 | color: #3e999f; 88 | } 89 | pre .hljs-function, 90 | code .hljs-function, 91 | pre .python .hljs-decorator, 92 | code .python .hljs-decorator, 93 | pre .python .hljs-title, 94 | code .python .hljs-title, 95 | pre .ruby .hljs-function .hljs-title, 96 | code .ruby .hljs-function .hljs-title, 97 | pre .ruby .hljs-title .hljs-keyword, 98 | code .ruby .hljs-title .hljs-keyword, 99 | pre .perl .hljs-sub, 100 | code .perl .hljs-sub, 101 | pre .javascript .hljs-title, 102 | code .javascript .hljs-title, 103 | pre .coffeescript .hljs-title, 104 | code .coffeescript .hljs-title { 105 | color: #4271ae; 106 | } 107 | pre .hljs-keyword, 108 | code .hljs-keyword, 109 | pre .javascript .hljs-function, 110 | code .javascript .hljs-function { 111 | color: #8959a8; 112 | } 113 | pre .hljs, 114 | code .hljs { 115 | display: block; 116 | background: white; 117 | color: #4d4d4c; 118 | padding: 0.5em; 119 | } 120 | pre .coffeescript .javascript, 121 | code .coffeescript .javascript, 122 | pre .javascript .xml, 123 | code .javascript .xml, 124 | pre .tex .hljs-formula, 125 | code .tex .hljs-formula, 126 | pre .xml .javascript, 127 | code .xml .javascript, 128 | pre .xml .vbscript, 129 | code .xml .vbscript, 130 | pre .xml .css, 131 | code .xml .css, 132 | pre .xml .hljs-cdata, 133 | code .xml .hljs-cdata { 134 | opacity: 0.5; 135 | } 136 | -------------------------------------------------------------------------------- /gitbook/gitbook-plugin-highlight/website.css: -------------------------------------------------------------------------------- 1 | .book .book-body .page-wrapper .page-inner section.normal pre, 2 | .book .book-body .page-wrapper .page-inner section.normal code { 3 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ 4 | /* Tomorrow Comment */ 5 | /* Tomorrow Red */ 6 | /* Tomorrow Orange */ 7 | /* Tomorrow Yellow */ 8 | /* Tomorrow Green */ 9 | /* Tomorrow Aqua */ 10 | /* Tomorrow Blue */ 11 | /* Tomorrow Purple */ 12 | } 13 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-comment, 14 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-comment, 15 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-title, 16 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-title { 17 | color: #8e908c; 18 | } 19 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-variable, 20 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-variable, 21 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-attribute, 22 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-attribute, 23 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-tag, 24 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-tag, 25 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-regexp, 26 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-regexp, 27 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-deletion, 28 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-deletion, 29 | .book .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-constant, 30 | .book .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-constant, 31 | .book .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-tag .hljs-title, 32 | .book .book-body .page-wrapper .page-inner section.normal code .xml .hljs-tag .hljs-title, 33 | .book .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-pi, 34 | .book .book-body .page-wrapper .page-inner section.normal code .xml .hljs-pi, 35 | .book .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-doctype, 36 | .book .book-body .page-wrapper .page-inner section.normal code .xml .hljs-doctype, 37 | .book .book-body .page-wrapper .page-inner section.normal pre .html .hljs-doctype, 38 | .book .book-body .page-wrapper .page-inner section.normal code .html .hljs-doctype, 39 | .book .book-body .page-wrapper .page-inner section.normal pre .css .hljs-id, 40 | .book .book-body .page-wrapper .page-inner section.normal code .css .hljs-id, 41 | .book .book-body .page-wrapper .page-inner section.normal pre .css .hljs-class, 42 | .book .book-body .page-wrapper .page-inner section.normal code .css .hljs-class, 43 | .book .book-body .page-wrapper .page-inner section.normal pre .css .hljs-pseudo, 44 | .book .book-body .page-wrapper .page-inner section.normal code .css .hljs-pseudo { 45 | color: #c82829; 46 | } 47 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-number, 48 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-number, 49 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor, 50 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor, 51 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-pragma, 52 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-pragma, 53 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-built_in, 54 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-built_in, 55 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-literal, 56 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-literal, 57 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-params, 58 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-params, 59 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-constant, 60 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-constant { 61 | color: #f5871f; 62 | } 63 | .book .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-class .hljs-title, 64 | .book .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-class .hljs-title, 65 | .book .book-body .page-wrapper .page-inner section.normal pre .css .hljs-rules .hljs-attribute, 66 | .book .book-body .page-wrapper .page-inner section.normal code .css .hljs-rules .hljs-attribute { 67 | color: #eab700; 68 | } 69 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-string, 70 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-string, 71 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-value, 72 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-value, 73 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-inheritance, 74 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-inheritance, 75 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-header, 76 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-header, 77 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-addition, 78 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-addition, 79 | .book .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-symbol, 80 | .book .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-symbol, 81 | .book .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-cdata, 82 | .book .book-body .page-wrapper .page-inner section.normal code .xml .hljs-cdata { 83 | color: #718c00; 84 | } 85 | .book .book-body .page-wrapper .page-inner section.normal pre .css .hljs-hexcolor, 86 | .book .book-body .page-wrapper .page-inner section.normal code .css .hljs-hexcolor { 87 | color: #3e999f; 88 | } 89 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-function, 90 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-function, 91 | .book .book-body .page-wrapper .page-inner section.normal pre .python .hljs-decorator, 92 | .book .book-body .page-wrapper .page-inner section.normal code .python .hljs-decorator, 93 | .book .book-body .page-wrapper .page-inner section.normal pre .python .hljs-title, 94 | .book .book-body .page-wrapper .page-inner section.normal code .python .hljs-title, 95 | .book .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-function .hljs-title, 96 | .book .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-function .hljs-title, 97 | .book .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-title .hljs-keyword, 98 | .book .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-title .hljs-keyword, 99 | .book .book-body .page-wrapper .page-inner section.normal pre .perl .hljs-sub, 100 | .book .book-body .page-wrapper .page-inner section.normal code .perl .hljs-sub, 101 | .book .book-body .page-wrapper .page-inner section.normal pre .javascript .hljs-title, 102 | .book .book-body .page-wrapper .page-inner section.normal code .javascript .hljs-title, 103 | .book .book-body .page-wrapper .page-inner section.normal pre .coffeescript .hljs-title, 104 | .book .book-body .page-wrapper .page-inner section.normal code .coffeescript .hljs-title { 105 | color: #4271ae; 106 | } 107 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs-keyword, 108 | .book .book-body .page-wrapper .page-inner section.normal code .hljs-keyword, 109 | .book .book-body .page-wrapper .page-inner section.normal pre .javascript .hljs-function, 110 | .book .book-body .page-wrapper .page-inner section.normal code .javascript .hljs-function { 111 | color: #8959a8; 112 | } 113 | .book .book-body .page-wrapper .page-inner section.normal pre .hljs, 114 | .book .book-body .page-wrapper .page-inner section.normal code .hljs { 115 | display: block; 116 | background: white; 117 | color: #4d4d4c; 118 | padding: 0.5em; 119 | } 120 | .book .book-body .page-wrapper .page-inner section.normal pre .coffeescript .javascript, 121 | .book .book-body .page-wrapper .page-inner section.normal code .coffeescript .javascript, 122 | .book .book-body .page-wrapper .page-inner section.normal pre .javascript .xml, 123 | .book .book-body .page-wrapper .page-inner section.normal code .javascript .xml, 124 | .book .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula, 125 | .book .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula, 126 | .book .book-body .page-wrapper .page-inner section.normal pre .xml .javascript, 127 | .book .book-body .page-wrapper .page-inner section.normal code .xml .javascript, 128 | .book .book-body .page-wrapper .page-inner section.normal pre .xml .vbscript, 129 | .book .book-body .page-wrapper .page-inner section.normal code .xml .vbscript, 130 | .book .book-body .page-wrapper .page-inner section.normal pre .xml .css, 131 | .book .book-body .page-wrapper .page-inner section.normal code .xml .css, 132 | .book .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-cdata, 133 | .book .book-body .page-wrapper .page-inner section.normal code .xml .hljs-cdata { 134 | opacity: 0.5; 135 | } 136 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre, 137 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code { 138 | /* 139 | 140 | Orginal Style from ethanschoonover.com/solarized (c) Jeremy Hull 141 | 142 | */ 143 | /* Solarized Green */ 144 | /* Solarized Cyan */ 145 | /* Solarized Blue */ 146 | /* Solarized Yellow */ 147 | /* Solarized Orange */ 148 | /* Solarized Red */ 149 | /* Solarized Violet */ 150 | } 151 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs, 152 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs { 153 | display: block; 154 | padding: 0.5em; 155 | background: #fdf6e3; 156 | color: #657b83; 157 | } 158 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-comment, 159 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-comment, 160 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-template_comment, 161 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-template_comment, 162 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .diff .hljs-header, 163 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .diff .hljs-header, 164 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-doctype, 165 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-doctype, 166 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-pi, 167 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-pi, 168 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .lisp .hljs-string, 169 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .lisp .hljs-string, 170 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-javadoc, 171 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-javadoc { 172 | color: #93a1a1; 173 | } 174 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-keyword, 175 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-keyword, 176 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-winutils, 177 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-winutils, 178 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .method, 179 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .method, 180 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-addition, 181 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-addition, 182 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-tag, 183 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .css .hljs-tag, 184 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-request, 185 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-request, 186 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-status, 187 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-status, 188 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .nginx .hljs-title, 189 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .nginx .hljs-title { 190 | color: #859900; 191 | } 192 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-number, 193 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-number, 194 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-command, 195 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-command, 196 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-string, 197 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-string, 198 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-tag .hljs-value, 199 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-tag .hljs-value, 200 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-rules .hljs-value, 201 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-rules .hljs-value, 202 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-phpdoc, 203 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-phpdoc, 204 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula, 205 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula, 206 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-regexp, 207 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-regexp, 208 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-hexcolor, 209 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-hexcolor, 210 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-link_url, 211 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-link_url { 212 | color: #2aa198; 213 | } 214 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-title, 215 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-title, 216 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-localvars, 217 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-localvars, 218 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-chunk, 219 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-chunk, 220 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-decorator, 221 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-decorator, 222 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-built_in, 223 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-built_in, 224 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-identifier, 225 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-identifier, 226 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .vhdl .hljs-literal, 227 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .vhdl .hljs-literal, 228 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-id, 229 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-id, 230 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-function, 231 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .css .hljs-function { 232 | color: #268bd2; 233 | } 234 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-attribute, 235 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-attribute, 236 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-variable, 237 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-variable, 238 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .lisp .hljs-body, 239 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .lisp .hljs-body, 240 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .smalltalk .hljs-number, 241 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .smalltalk .hljs-number, 242 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-constant, 243 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-constant, 244 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-class .hljs-title, 245 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-class .hljs-title, 246 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-parent, 247 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-parent, 248 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .haskell .hljs-type, 249 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .haskell .hljs-type, 250 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-link_reference, 251 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-link_reference { 252 | color: #b58900; 253 | } 254 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor, 255 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor, 256 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor .hljs-keyword, 257 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor .hljs-keyword, 258 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-pragma, 259 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-pragma, 260 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-shebang, 261 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-shebang, 262 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-symbol, 263 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-symbol, 264 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-symbol .hljs-string, 265 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-symbol .hljs-string, 266 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .diff .hljs-change, 267 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .diff .hljs-change, 268 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-special, 269 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-special, 270 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-attr_selector, 271 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-attr_selector, 272 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-subst, 273 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-subst, 274 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-cdata, 275 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-cdata, 276 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .clojure .hljs-title, 277 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .clojure .hljs-title, 278 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-pseudo, 279 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .css .hljs-pseudo, 280 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-header, 281 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-header { 282 | color: #cb4b16; 283 | } 284 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-deletion, 285 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-deletion, 286 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-important, 287 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-important { 288 | color: #dc322f; 289 | } 290 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .hljs-link_label, 291 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .hljs-link_label { 292 | color: #6c71c4; 293 | } 294 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula, 295 | .book.color-theme-1 .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula { 296 | background: #eee8d5; 297 | } 298 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre, 299 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code { 300 | /* Tomorrow Night Bright Theme */ 301 | /* Original theme - https://github.com/chriskempson/tomorrow-theme */ 302 | /* http://jmblog.github.com/color-themes-for-google-code-highlightjs */ 303 | /* Tomorrow Comment */ 304 | /* Tomorrow Red */ 305 | /* Tomorrow Orange */ 306 | /* Tomorrow Yellow */ 307 | /* Tomorrow Green */ 308 | /* Tomorrow Aqua */ 309 | /* Tomorrow Blue */ 310 | /* Tomorrow Purple */ 311 | } 312 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-comment, 313 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-comment, 314 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-title, 315 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-title { 316 | color: #969896; 317 | } 318 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-variable, 319 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-variable, 320 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-attribute, 321 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-attribute, 322 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-tag, 323 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-tag, 324 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-regexp, 325 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-regexp, 326 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-deletion, 327 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-deletion, 328 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-constant, 329 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-constant, 330 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-tag .hljs-title, 331 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-tag .hljs-title, 332 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-pi, 333 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-pi, 334 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-doctype, 335 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-doctype, 336 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .html .hljs-doctype, 337 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .html .hljs-doctype, 338 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-id, 339 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-id, 340 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-class, 341 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-class, 342 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-pseudo, 343 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-pseudo { 344 | color: #d54e53; 345 | } 346 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-number, 347 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-number, 348 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-preprocessor, 349 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-preprocessor, 350 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-pragma, 351 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-pragma, 352 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-built_in, 353 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-built_in, 354 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-literal, 355 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-literal, 356 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-params, 357 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-params, 358 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-constant, 359 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-constant { 360 | color: #e78c45; 361 | } 362 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-class .hljs-title, 363 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-class .hljs-title, 364 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-rules .hljs-attribute, 365 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-rules .hljs-attribute { 366 | color: #e7c547; 367 | } 368 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-string, 369 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-string, 370 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-value, 371 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-value, 372 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-inheritance, 373 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-inheritance, 374 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-header, 375 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-header, 376 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-addition, 377 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-addition, 378 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-symbol, 379 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-symbol, 380 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-cdata, 381 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-cdata { 382 | color: #b9ca4a; 383 | } 384 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .css .hljs-hexcolor, 385 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .css .hljs-hexcolor { 386 | color: #70c0b1; 387 | } 388 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-function, 389 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-function, 390 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .python .hljs-decorator, 391 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .python .hljs-decorator, 392 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .python .hljs-title, 393 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .python .hljs-title, 394 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-function .hljs-title, 395 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-function .hljs-title, 396 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .ruby .hljs-title .hljs-keyword, 397 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .ruby .hljs-title .hljs-keyword, 398 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .perl .hljs-sub, 399 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .perl .hljs-sub, 400 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .javascript .hljs-title, 401 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .javascript .hljs-title, 402 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .coffeescript .hljs-title, 403 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .coffeescript .hljs-title { 404 | color: #7aa6da; 405 | } 406 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs-keyword, 407 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs-keyword, 408 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .javascript .hljs-function, 409 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .javascript .hljs-function { 410 | color: #c397d8; 411 | } 412 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .hljs, 413 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .hljs { 414 | display: block; 415 | background: black; 416 | color: #eaeaea; 417 | padding: 0.5em; 418 | } 419 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .coffeescript .javascript, 420 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .coffeescript .javascript, 421 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .javascript .xml, 422 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .javascript .xml, 423 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .tex .hljs-formula, 424 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .tex .hljs-formula, 425 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .javascript, 426 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .javascript, 427 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .vbscript, 428 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .vbscript, 429 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .css, 430 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .css, 431 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal pre .xml .hljs-cdata, 432 | .book.color-theme-2 .book-body .page-wrapper .page-inner section.normal code .xml .hljs-cdata { 433 | opacity: 0.5; 434 | } 435 | -------------------------------------------------------------------------------- /gitbook/gitbook-plugin-lunr/lunr.min.js: -------------------------------------------------------------------------------- 1 | /** 2 | * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 0.5.12 3 | * Copyright (C) 2015 Oliver Nightingale 4 | * MIT Licensed 5 | * @license 6 | */ 7 | !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(en.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;t1;){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]&&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;s0&&(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;no;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(en.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;t1;){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]&&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;s0&&(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 element for each result 48 | res.results.forEach(function(res) { 49 | var $li = $('
          • ', { 50 | 'class': 'search-results-item' 51 | }); 52 | 53 | var $title = $('

            '); 54 | 55 | var $link = $('', { 56 | 'href': gitbook.state.basePath + '/' + res.url, 57 | 'text': res.title 58 | }); 59 | 60 | var content = res.body.trim(); 61 | if (content.length > MAX_DESCRIPTION_SIZE) { 62 | content = content.slice(0, MAX_DESCRIPTION_SIZE).trim()+'...'; 63 | } 64 | var $content = $('

            ').html(content); 65 | 66 | $link.appendTo($title); 67 | $title.appendTo($li); 68 | $content.appendTo($li); 69 | $li.appendTo($searchList); 70 | }); 71 | } 72 | 73 | function launchSearch(q) { 74 | // Add class for loading 75 | $body.addClass('with-search'); 76 | $body.addClass('search-loading'); 77 | 78 | // Launch search query 79 | throttle(gitbook.search.query(q, 0, MAX_RESULTS) 80 | .then(function(results) { 81 | displayResults(results); 82 | }) 83 | .always(function() { 84 | $body.removeClass('search-loading'); 85 | }), 1000); 86 | } 87 | 88 | function closeSearch() { 89 | $body.removeClass('with-search'); 90 | $bookSearchResults.removeClass('open'); 91 | } 92 | 93 | function launchSearchFromQueryString() { 94 | var q = getParameterByName('q'); 95 | if (q && q.length > 0) { 96 | // Update search input 97 | $searchInput.val(q); 98 | 99 | // Launch search 100 | launchSearch(q); 101 | } 102 | } 103 | 104 | function bindSearch() { 105 | // Bind DOM 106 | $searchInput = $('#book-search-input input'); 107 | $bookSearchResults = $('#book-search-results'); 108 | $searchList = $bookSearchResults.find('.search-results-list'); 109 | $searchTitle = $bookSearchResults.find('.search-results-title'); 110 | $searchResultsCount = $searchTitle.find('.search-results-count'); 111 | $searchQuery = $searchTitle.find('.search-query'); 112 | 113 | // Launch query based on input content 114 | function handleUpdate() { 115 | var q = $searchInput.val(); 116 | 117 | if (q.length == 0) { 118 | closeSearch(); 119 | } 120 | else { 121 | launchSearch(q); 122 | } 123 | } 124 | 125 | // Detect true content change in search input 126 | // Workaround for IE < 9 127 | var propertyChangeUnbound = false; 128 | $searchInput.on('propertychange', function(e) { 129 | if (e.originalEvent.propertyName == 'value') { 130 | handleUpdate(); 131 | } 132 | }); 133 | 134 | // HTML5 (IE9 & others) 135 | $searchInput.on('input', function(e) { 136 | // Unbind propertychange event for IE9+ 137 | if (!propertyChangeUnbound) { 138 | $(this).unbind('propertychange'); 139 | propertyChangeUnbound = true; 140 | } 141 | 142 | handleUpdate(); 143 | }); 144 | 145 | // Push to history on blur 146 | $searchInput.on('blur', function(e) { 147 | // Update history state 148 | if (usePushState) { 149 | var uri = updateQueryString('q', $(this).val()); 150 | history.pushState({ path: uri }, null, uri); 151 | } 152 | }); 153 | } 154 | 155 | gitbook.events.on('page.change', function() { 156 | bindSearch(); 157 | closeSearch(); 158 | 159 | // Launch search based on query parameter 160 | if (gitbook.search.isInitialized()) { 161 | launchSearchFromQueryString(); 162 | } 163 | }); 164 | 165 | gitbook.events.on('search.ready', function() { 166 | bindSearch(); 167 | 168 | // Launch search from query param at start 169 | launchSearchFromQueryString(); 170 | }); 171 | 172 | function getParameterByName(name) { 173 | var url = window.location.href; 174 | name = name.replace(/[\[\]]/g, '\\$&'); 175 | var regex = new RegExp('[?&]' + name + '(=([^&#]*)|&|#|$)', 'i'), 176 | results = regex.exec(url); 177 | if (!results) return null; 178 | if (!results[2]) return ''; 179 | return decodeURIComponent(results[2].replace(/\+/g, ' ')); 180 | } 181 | 182 | function updateQueryString(key, value) { 183 | value = encodeURIComponent(value); 184 | 185 | var url = window.location.href; 186 | var re = new RegExp('([?&])' + key + '=.*?(&|#|$)(.*)', 'gi'), 187 | hash; 188 | 189 | if (re.test(url)) { 190 | if (typeof value !== 'undefined' && value !== null) 191 | return url.replace(re, '$1' + key + '=' + value + '$2$3'); 192 | else { 193 | hash = url.split('#'); 194 | url = hash[0].replace(re, '$1$3').replace(/(&|\?)$/, ''); 195 | if (typeof hash[1] !== 'undefined' && hash[1] !== null) 196 | url += '#' + hash[1]; 197 | return url; 198 | } 199 | } 200 | else { 201 | if (typeof value !== 'undefined' && value !== null) { 202 | var separator = url.indexOf('?') !== -1 ? '&' : '?'; 203 | hash = url.split('#'); 204 | url = hash[0] + separator + key + '=' + value; 205 | if (typeof hash[1] !== 'undefined' && hash[1] !== null) 206 | url += '#' + hash[1]; 207 | return url; 208 | } 209 | else 210 | return url; 211 | } 212 | } 213 | }); 214 | -------------------------------------------------------------------------------- /gitbook/gitbook-plugin-sharing/buttons.js: -------------------------------------------------------------------------------- 1 | require(['gitbook', 'jquery'], function(gitbook, $) { 2 | var SITES = { 3 | 'facebook': { 4 | 'label': 'Facebook', 5 | 'icon': 'fa fa-facebook', 6 | 'onClick': function(e) { 7 | e.preventDefault(); 8 | window.open('http://www.facebook.com/sharer/sharer.php?s=100&p[url]='+encodeURIComponent(location.href)); 9 | } 10 | }, 11 | 'twitter': { 12 | 'label': 'Twitter', 13 | 'icon': 'fa fa-twitter', 14 | 'onClick': function(e) { 15 | e.preventDefault(); 16 | window.open('http://twitter.com/home?status='+encodeURIComponent(document.title+' '+location.href)); 17 | } 18 | }, 19 | 'google': { 20 | 'label': 'Google+', 21 | 'icon': 'fa fa-google-plus', 22 | 'onClick': function(e) { 23 | e.preventDefault(); 24 | window.open('https://plus.google.com/share?url='+encodeURIComponent(location.href)); 25 | } 26 | }, 27 | 'weibo': { 28 | 'label': 'Weibo', 29 | 'icon': 'fa fa-weibo', 30 | 'onClick': function(e) { 31 | e.preventDefault(); 32 | window.open('http://service.weibo.com/share/share.php?content=utf-8&url='+encodeURIComponent(location.href)+'&title='+encodeURIComponent(document.title)); 33 | } 34 | }, 35 | 'instapaper': { 36 | 'label': 'Instapaper', 37 | 'icon': 'fa fa-instapaper', 38 | 'onClick': function(e) { 39 | e.preventDefault(); 40 | window.open('http://www.instapaper.com/text?u='+encodeURIComponent(location.href)); 41 | } 42 | }, 43 | 'vk': { 44 | 'label': 'VK', 45 | 'icon': 'fa fa-vk', 46 | 'onClick': function(e) { 47 | e.preventDefault(); 48 | window.open('http://vkontakte.ru/share.php?url='+encodeURIComponent(location.href)); 49 | } 50 | } 51 | }; 52 | 53 | 54 | 55 | gitbook.events.bind('start', function(e, config) { 56 | var opts = config.sharing; 57 | 58 | // Create dropdown menu 59 | var menu = $.map(opts.all, function(id) { 60 | var site = SITES[id]; 61 | 62 | return { 63 | text: site.label, 64 | onClick: site.onClick 65 | }; 66 | }); 67 | 68 | // Create main button with dropdown 69 | if (menu.length > 0) { 70 | gitbook.toolbar.createButton({ 71 | icon: 'fa fa-share-alt', 72 | label: 'Share', 73 | position: 'right', 74 | dropdown: [menu] 75 | }); 76 | } 77 | 78 | // Direct actions to share 79 | $.each(SITES, function(sideId, site) { 80 | if (!opts[sideId]) return; 81 | 82 | gitbook.toolbar.createButton({ 83 | icon: site.icon, 84 | label: site.text, 85 | position: 'right', 86 | onClick: site.onClick 87 | }); 88 | }); 89 | }); 90 | }); 91 | -------------------------------------------------------------------------------- /gitbook/images/apple-touch-icon-precomposed-152.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderyi/iOSSourceCodeAnalyze/e776f12e7a08d9538d92fd53d39ecf60fb4a196f/gitbook/images/apple-touch-icon-precomposed-152.png -------------------------------------------------------------------------------- /gitbook/images/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/coderyi/iOSSourceCodeAnalyze/e776f12e7a08d9538d92fd53d39ecf60fb4a196f/gitbook/images/favicon.ico -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | iOS开源库源码分析 · iOS开源库源码分析 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 |

            68 |
            69 | 70 | 71 | 74 | 75 | 76 | 247 | 248 | 249 |
            250 | 251 |
            252 | 253 |
            254 | 255 | 256 | 257 | 266 | 267 | 268 | 269 | 270 |
            271 |
            272 | 273 |
            274 |
            275 | 276 |
            277 | 278 |

            iOS开源库源码分析

            279 |

            作者

            280 |

            @coderyihttps://github.com/coderyi

            281 |

            内容

            282 |

            读源码是一个很有效的提升技术的方式,本书就是记录下源码阅读过程中的一些心得。

            283 |

            本书会分析iOS流行的开源库,剖析出源码的主要逻辑,核心原理,设计思路,涉及的知识点。

            284 |

            本书涉及的内容AFNetworking,ReactiveCocoa,SDWebImage,FLEX,react-native等

            285 |

            面向初中级iOS开发者,关于本书的任何问题可以随时联系我

            286 |

            署名-非商业性使用-相同方式共享 4.0 (CC BY-NC-SA 4.0)

            287 | 288 | 289 |
            290 | 291 |
            292 |
            293 |
            294 | 295 |

            results matching ""

            296 |
              297 | 298 |
              299 |
              300 | 301 |

              No results matching ""

              302 | 303 |
              304 |
              305 |
              306 | 307 |
              308 |
              309 | 310 |
              311 | 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 |
              322 | 323 | 329 |
              330 | 331 | 332 | 333 | 334 | 335 | 336 | 337 | 338 | 339 | 340 | 341 | 342 | 343 | 344 | 345 | 346 | 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | --------------------------------------------------------------------------------