浏览代码

Merge pull request #5 from blink1073/create-example

Create example
Dave Willmer 9 年之前
父节点
当前提交
40981a1482
共有 32 个文件被更改,包括 660 次插入1044 次删除
  1. 1 0
      .travis.yml
  2. 0 0
      examples/lab/index.d.ts
  3. 0 21
      examples/lab/index.js
  4. 15 19
      examples/lab/index.ts
  5. 67 0
      examples/lab/plugin.ts
  6. 1 0
      examples/lab/tsconfig.json
  7. 1 1
      examples/lab/webpack.conf.js
  8. 2 3
      package.json
  9. 1 0
      scripts/tdoptions.json
  10. 1 1
      scripts/travis_script.sh
  11. 15 19
      src/editor/index.ts
  12. 37 44
      src/editor/plugin.ts
  13. 3 3
      src/filebrowser/index.ts
  14. 14 11
      src/filebrowser/plugin.ts
  15. 3 3
      src/services/index.ts
  16. 11 8
      src/services/plugin.ts
  17. 3 3
      src/terminal/index.ts
  18. 6 6
      src/terminal/plugin.ts
  19. 0 212
      test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/base.css
  20. 0 80
      test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/index.html
  21. 0 212
      test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/lcov-report/base.css
  22. 0 80
      test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/lcov-report/index.html
  23. 0 1
      test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/lcov-report/prettify.css
  24. 0 0
      test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/lcov-report/prettify.js
  25. 二进制
      test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/lcov-report/sort-arrow-sprite.png
  26. 0 158
      test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/lcov-report/sorter.js
  27. 0 0
      test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/lcov.info
  28. 0 1
      test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/prettify.css
  29. 0 0
      test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/prettify.js
  30. 二进制
      test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/sort-arrow-sprite.png
  31. 0 158
      test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/sorter.js
  32. 479 0
      typings/moment/moment.d.ts

+ 1 - 0
.travis.yml

@@ -7,6 +7,7 @@ env:
   - GROUP=
   global:
   - GH_REF: github.com/jupyter/jupyter-js-plugins.git
+  - secure: UwfNcdwPGuWRY6A0kjeEC0Py7OEuSOO14aSypr779D1jabGkXLVPtmXQzy3kRQuMRVse/OVC88wNzYDnTEikwrWHOguANlYyTjJCmeG+YVWjpDN6OzAWYJ/RCacPyY7+mkQKizzKBfgJy39AXMRTp17kYePVo4yTfvkQpaZfFVQqVhL1v6Qz4rI3IG5DlCJFn6le9uhv5tJan+a2iQQBNHNAyrFoTujGz/PVDmuQ/EUF/RuC3OYGOBfkZgsiOeB9eFHSa5sweFnn+57a1Y0YOJM7TqpOwDzWrEbNnev08I5YTH2RJ1hMhLXOUmHAI8vW42IxMWo6B/b6n0/0x2lCbQTNKl6So4esu+G2di5VsSMvyXkVH7ahJRmR/iHAhb7vBR0eJ90vKp2xcVRsWFEKy/MNXECAPnqqPLsCFb8My3ecxDpNiSnTrB54at5OoR5cD7q5ZGDQ7wU+tePVWXZHiiL9j+OcqyjrvcMEp1sbRGriOwhzkJsFW4/SJ1yrcmX/PnMiZBTbxuxjYMaO5+pr49mKCs220keukN0MxiK/1WHQMiNxY7bePA6JPk1SMWyan64D9O6KmoelaIYO6vOWV8ndpQfBez2D1db4VCArJBJqHC1BRWS6/akkFMbsV6YXBi94rsfNAEx2m0d6X++cioqnuw2t3PvK2Bxnxc6TMrU=
 install:
 - bash ./scripts/travis_install.sh
 script:

+ 0 - 0
examples/lab/index.d.ts


+ 0 - 21
examples/lab/index.js

@@ -1,21 +0,0 @@
-// Copyright (c) Jupyter Development Team.
-// Distributed under the terms of the Modified BSD License.
-'use strict';
-
-var phosphide = require('phosphide');
-var di = require('phosphor-di');
-
-
-function main() {
-   phosphide.loadPlugins(new di.Container(), [
-    require('phosphide/lib/appshell/plugin'),
-    require('../lib/terminal/plugin'),
-    require('../lib/editor/plugin'),
-    require('../lib/filebrowser/plugin'),
-    require('../lib/services/plugin')
-  ]).then(function() {
-    console.log('loading finished');
-  });
-}
-
-window.onload = main;

+ 15 - 19
examples/lab/index.ts

@@ -1,26 +1,22 @@
-/*-----------------------------------------------------------------------------
-| Copyright (c) 2014-2015, PhosphorJS Contributors
-|
-| Distributed under the terms of the BSD 3-Clause License.
-|
-| The full license is in the file LICENSE, distributed with this software.
-|----------------------------------------------------------------------------*/
+// Copyright (c) Jupyter Development Team.
+// Distributed under the terms of the Modified BSD License.
 'use strict';
 
-import {
-  EditorModel, CodeMirrorWidget
-} from '../lib/index';
+var phosphide = require('phosphide');
+var di = require('phosphor-di');
 
 
-function main(): void {
-  var model = new EditorModel();
-  var view = new CodeMirrorWidget(model);
-
-  view.attach(document.getElementById('main'));
-  model.filename = 'test.js'
-  view.update();
-
-  window.onresize = () => view.update();
+function main() {
+   phosphide.loadPlugins(new di.Container(), [
+    require('phosphide/lib/appshell/plugin'),
+    require('../lib/terminal/plugin'),
+    require('../lib/editor/plugin'),
+    require('../lib/filebrowser/plugin'),
+    require('../lib/services/plugin'),
+    require('./plugin')
+  ]).then(function() {
+    console.log('loading finished');
+  });
 }
 
 window.onload = main;

+ 67 - 0
examples/lab/plugin.ts

@@ -0,0 +1,67 @@
+// Copyright (c) Jupyter Development Team.
+// Distributed under the terms of the Modified BSD License.
+'use strict';
+
+import {
+  IAppShell
+} from 'phosphide';
+
+import {
+  Container, Token
+} from 'phosphor-di';
+
+import {
+  ITerminalProvider
+} from '../lib';
+
+
+/**
+ * Register the plugin contributions.
+ *
+ * @param container - The di container for type registration.
+ *
+ * #### Notes
+ * This is called automatically when the plugin is loaded.
+ */
+export
+function resolve(container: Container): void {
+  container.resolve(DefaultHandler).then(handler => { handler.run(); });
+}
+
+
+/**
+ * The default plugin for the example.
+ */
+class DefaultHandler {
+
+  /**
+   * The dependencies required by the default plugin.
+   */
+  static requires: Token<any>[] = [IAppShell, ITerminalProvider];
+
+  /**
+   * Create a default plugin instance..
+   */
+  static create(shell: IAppShell, term: ITerminalProvider): DefaultHandler {
+    return new DefaultHandler(shell, term);
+  }
+
+  /**
+   * Construct a new default plugin.
+   */
+  constructor(shell: IAppShell, term: ITerminalProvider) {
+    this._shell = shell;
+    this._term = term;
+  }
+
+  /**
+   * Create a terminal and add it to the main shell area.
+   */
+  run() {
+    let term = this._term.createTerminal();
+    this._shell.addToMainArea(term);
+  }
+
+  private _term: ITerminalProvider = null;
+  private _shell: IAppShell = null;
+}

+ 1 - 0
examples/lab/tsconfig.json

@@ -8,6 +8,7 @@
     "target": "ES5"
   },
   "files": [
+    "../typings/es6-promise.d.ts",
     "../typings/codemirror/codemirror.d.ts",
     "../typings/requirejs/requirejs.d.ts",
     "index.ts"

+ 1 - 1
examples/lab/webpack.conf.js

@@ -1,6 +1,6 @@
 
 module.exports = {
-  entry: './example/index.js',
+  entry: './example/index.ts',
   output: {
     path: './example/build',
     filename: 'bundle.js'

+ 2 - 3
package.json

@@ -35,9 +35,8 @@
     "webpack": "^1.12.9"
   },
   "scripts": {
-    "clean:example": "rimraf example/bundle.js",
-    "clean:test": "rimraf test/build && rimraf test/coverage",
-    "clean": "rimraf docs/api && rimraf lib && npm run clean:test",
+    "clean:example": "rimraf example/build",
+    "clean": "rimraf docs/api && rimraf lib && rimraf test/coverage",
     "build:example": "webpack --config example/webpack.conf.js",
     "build": "tsc --project src && node scripts/copycss.js",
     "docs": "typedoc --options scripts/tdoptions.json",

+ 1 - 0
scripts/tdoptions.json

@@ -7,6 +7,7 @@
   "out": "docs",
   "src": [
     "src/index.ts",
+    "typings/codemirror/codemirror.d.ts",
     "typings/es6-promise.d.ts",
     "typings/moment/moment.d.ts"
   ]

+ 1 - 1
scripts/travis_script.sh

@@ -8,5 +8,5 @@ npm run build
 npm test
 npm run test:coverage
 export PATH="$HOME/miniconda/bin:$PATH"
-
+npm run build:example
 npm run docs

+ 15 - 19
src/editor/index.ts

@@ -14,53 +14,49 @@ import {
 } from 'phosphor-di';
 
 
-
 /**
- * The interface for a jupyter editor widget.
+ * A handler for creating and manipulating Jupyter editors.
  */
 export
-interface IEditor extends CodeMirrorWidget {
+interface IEditorHandler {
 
   /**
-   * A convenience property to get/set the text on the editor.
+   * Create a new IEditor instance.
    */
-  text: string;
+  createEditor(options?: CodeMirror.EditorConfiguration): CodeMirrorWidget;
 
   /**
    * Set the editor mode by name.  This will lode the mode file
    * as needed.
    */
-  setModeByName(mode: string): void;
+  setModeByName(widget: CodeMirrorWidget, mode: string): void;
 
   /**
    * Set the editor mode by file name.  This will lode the mode file
    * as needed.
    */
-  setModeByFileName(filename: string): void;
+  setModeByFileName(widget: CodeMirrorWidget, filename: string): void;
 
   /**
    * Set the editor mode by mime type.  This will lode the mode file
    * as needed.
    */
-  setModeByMIMEType(mime: string): void;
-}
+  setModeByMIMEType(widget: CodeMirrorWidget, mime: string): void;
 
-
-/**
- * A factory for creating a Jupyter editor.
- */
-export
-interface IEditorFactory {
+  /**
+   * A convenience method to get the text from the editor.
+   */
+  getText(widget: CodeMirrorWidget, text: string): string;
 
   /**
-   * Create a new IEditor instance.
+   * A convenience method to set the text on the editor.
    */
-  createEditor(options?: CodeMirror.EditorConfiguration): IEditor;
+  setText(widget: CodeMirrorWidget, text: string): void;
 }
 
 
 /**
- * The dependency token for the `IEditorFactory` interface.
+ * The dependency token for the `IEditorHandler` interface.
  */
 export
-const IEditorFactory = new Token<IEditorFactory>('jupyter-js-plugins.IEditorFactory');
+const IEditorHandler = new Token<IEditorHandler>('jupyter-js-plugins.IEditorHandler');

+ 37 - 44
src/editor/plugin.ts

@@ -18,7 +18,7 @@ import {
 } from 'phosphor-di';
 
 import {
-  IEditor, IEditorFactory
+  IEditorHandler
 } from './index';
 
 import './plugin.css';
@@ -46,63 +46,56 @@ import './codemirror-ipython';
  */
 export
 function register(container: Container): void {
-  container.register(IEditorFactory, EditorFactory);
+  container.register(IEditorHandler, EditorHandler);
 }
 
 
 /**
- * An implemenation of an IEditorFactory.
+ * An implemenation of an IEditorHandler.
  */
-class EditorFactory implements IEditorFactory {
+class EditorHandler implements IEditorHandler {
 
   /**
-   * The dependencies required by the editor factory.
+   * The dependencies required by the editor handler.
    */
   static requires: Token<any>[] = [];
 
   /**
-   * Create a new editor factory instance.
+   * Create a new editor handler instance.
    */
-  static create(): IEditorFactory {
-    return new EditorFactory();
+  static create(): IEditorHandler {
+    return new EditorHandler();
   }
 
   /**
    * Create a new IEditor instance.
    */
-  createEditor(options?: CodeMirror.EditorConfiguration): IEditor {
-    return new Editor(options);
+  createEditor(options?: CodeMirror.EditorConfiguration): CodeMirrorWidget {
+    return new CodeMirrorWidget(options);
   }
-}
-
-
-/**
- * A default implementation of the jupyter editor widget.
- */
-class Editor extends CodeMirrorWidget {
 
   /**
-   * Get the text from the editor.
+   * A convenience method to get the text from the editor.
    */
-  get text(): string {
-    return this.editor.getDoc().getValue();
+  getText(widget: CodeMirrorWidget, text: string): string {
+    return widget.editor.getDoc().getValue();
   }
 
   /**
-   * Set the text on the editor.
+   * A convenience method to set the text on the editor.
    */
-  set text(value: string) {
-    this.editor.getDoc().setValue(value);
+  setText(widget: CodeMirrorWidget, text: string): void {
+    widget.editor.getDoc().setValue(text);
   }
 
   /**
    * Set the editor mode by name.  This will lode the mode file
    * as needed.
    */
-  setModeByName(mode: string): void {
+  setModeByName(widget: CodeMirrorWidget, mode: string): void {
     let info = CodeMirror.findModeByName(mode);
     if (info) {
-      this.loadCodeMirrorMode(info.mode, info.mime);
+      loadCodeMirrorMode(widget.editor, info.mode, info.mime);
     }
   }
 
@@ -110,10 +103,10 @@ class Editor extends CodeMirrorWidget {
    * Set the editor mode by file name.  This will lode the mode file
    * as needed.
    */
-  setModeByFileName(filename: string): void {
+  setModeByFileName(widget: CodeMirrorWidget, filename: string): void {
     let info = CodeMirror.findModeByFileName(filename);
     if (info) {
-      this.loadCodeMirrorMode(info.mode, info.mime);
+      loadCodeMirrorMode(widget.editor, info.mode, info.mime);
     }
   }
 
@@ -121,27 +114,27 @@ class Editor extends CodeMirrorWidget {
    * Set the editor mode by mime type.  This will lode the mode file
    * as needed.
    */
-  setModeByMIMEType(mime: string): void {
+  setModeByMIMEType(widget: CodeMirrorWidget, mime: string): void {
     let info = CodeMirror.findModeByMIME(mime);
     if (info) {
-      this.loadCodeMirrorMode(info.mode, info.mime);
+      loadCodeMirrorMode(widget.editor, info.mode, info.mime);
     }
   }
+}
 
-  /**
-   * Load and set a CodeMirror mode.
-   *
-   * #### Notes
-   * This assumes WebPack as the module loader.
-   */
-  protected loadCodeMirrorMode(mode: string, mime: string): void {
-    if (CodeMirror.modes.hasOwnProperty(mode)) {
-      this.editor.setOption('mode', mime);
-    } else {
-      // Load the full codemirror mode bundle.
-      require([`codemirror/mode/${mode}/${mode}.js`], () => {
-        this.editor.setOption('mode', mime);
-      });
-    }
+/**
+ * Load and set a CodeMirror mode.
+ *
+ * #### Notes
+ * This assumes WebPack as the module loader.
+ */
+function loadCodeMirrorMode(editor: CodeMirror.Editor, mode: string, mime: string): void {
+  if (CodeMirror.modes.hasOwnProperty(mode)) {
+    editor.setOption('mode', mime);
+  } else {
+    // Load the full codemirror mode bundle.
+    require([`codemirror/mode/${mode}/${mode}.js`], () => {
+      editor.setOption('mode', mime);
+    });
   }
 }

+ 3 - 3
src/filebrowser/index.ts

@@ -15,13 +15,13 @@ import {
  * A singleton FileBrowser provider.
  */
 export
-interface IFileBrowser {
+interface IFileBrowserProvider {
   fileBrowser: FileBrowser;
 }
 
 
 /**
- * The dependency token for the `IFileBrowser` interface.
+ * The dependency token for the `IFileBrowserHandler` interface.
  */
 export
-const IFileBrowser = new Token<IFileBrowser>('jupyter-js-plugins.IFileBrowser');
+const IFileBrowserProvider = new Token<IFileBrowserProvider>('jupyter-js-plugins.IFileBrowserProvider');

+ 14 - 11
src/filebrowser/plugin.ts

@@ -15,11 +15,11 @@ import {
 } from 'phosphor-di';
 
 import {
-  IFileBrowser
+  IFileBrowserProvider
 } from './index';
 
 import {
-  IEditorFactory, IServicesFactory
+  IEditorHandler, IServicesProvider
 } from '../index';
 
 import './plugin.css';
@@ -35,10 +35,13 @@ import './plugin.css';
  */
 export
 function register(container: Container): void {
-  container.register(IFileBrowser, FileBrowserProvider);
+  container.register(IFileBrowserProvider, FileBrowserProvider);
 }
 
 
+/**
+ * Resolve the default file provider.
+ */
 export
 function resolve(container: Container): Promise<void> {
   return container.resolve(FileBrowserProvider).then(() => { return; });
@@ -46,26 +49,26 @@ function resolve(container: Container): Promise<void> {
 
 
 /**
- * An implementation of the IFileBrowser provider.
+ * An implementation of the FileBrowserProvider provider.
  */
-class FileBrowserProvider implements IFileBrowser {
+class FileBrowserProvider implements IFileBrowserProvider {
 
   /**
    * The dependencies required by the application shell.
    */
-  static requires: Token<any>[] = [IAppShell, IServicesFactory, IEditorFactory];
+  static requires: Token<any>[] = [IAppShell, IServicesProvider, IEditorHandler];
 
   /**
    * Create a new application shell instance.
    */
-  static create(shell: IAppShell, services: IServicesFactory, editor: IEditorFactory): IFileBrowser {
+  static create(shell: IAppShell, services: IServicesProvider, editor: IEditorHandler): IFileBrowserProvider {
     return new FileBrowserProvider(shell, services, editor);
   }
 
   /**
    * Construct a new filebrowser provider instance.
    */
-  constructor(shell: IAppShell, services: IServicesFactory, editor: IEditorFactory) {
+  constructor(shell: IAppShell, services: IServicesProvider, editor: IEditorHandler) {
     this._shell = shell;
     this._editor = editor;
     let contents = services.createContentsManager();
@@ -77,8 +80,8 @@ class FileBrowserProvider implements IFileBrowser {
     model.changed.connect((instance, change) => {
       if (change.name === 'open' && change.newValue.type === 'file') {
         let newEditor = editor.createEditor();
-        newEditor.setModeByFileName(change.newValue.name);
-        newEditor.text = change.newValue.content;
+        editor.setModeByFileName(newEditor, change.newValue.name);
+        editor.setText(newEditor, change.newValue.content);
         newEditor.title.text = change.newValue.name;
         this._shell.addToMainArea(newEditor);
       }
@@ -96,7 +99,7 @@ class FileBrowserProvider implements IFileBrowser {
   }
 
   private _shell: IAppShell = null;
-  private _editor: IEditorFactory = null;
+  private _editor: IEditorHandler = null;
   private _browser: FileBrowser = null;
 
 }

+ 3 - 3
src/services/index.ts

@@ -13,10 +13,10 @@ import {
 
 
 /**
- * A factory for creating Jupyter service managers.
+ * A provider for creating Jupyter service managers.
  */
 export
-interface IServicesFactory {
+interface IServicesProvider {
 
   /**
    * Create a new kernel manager instance.
@@ -39,4 +39,4 @@ interface IServicesFactory {
  * The dependency token for the `IServicesFactory` interface.
  */
 export
-const IServicesFactory = new Token<IServicesFactory>('jupyter-js-plugins.IServicesFactory');
+const IServicesProvider = new Token<IServicesProvider>('jupyter-js-plugins.IServicesProvider');

+ 11 - 8
src/services/plugin.ts

@@ -16,7 +16,7 @@ import {
 } from 'phosphor-di';
 
 import {
-  IServicesFactory
+  IServicesProvider
 } from './index';
 
 
@@ -30,26 +30,29 @@ import {
  */
 export
 function register(container: Container): void {
-  container.register(IServicesFactory, ServicesFactory);
+  container.register(IServicesProvider, ServicesProvider);
 }
 
 
-class ServicesFactory implements IServicesFactory {
+/**
+ * An implementation of a services provider.
+ */
+class ServicesProvider implements IServicesProvider {
 
   /**
-   * The dependencies required by the application shell.
+   * The dependencies required by the services provider.
    */
   static requires: Token<any>[] = [];
 
   /**
-   * Create a new application shell instance.
+   * Create a new services provider instance.
    */
-  static create(): IServicesFactory {
-    return new ServicesFactory();
+  static create(): IServicesProvider {
+    return new ServicesProvider();
   }
 
   /**
-   * Construct a new services factory.
+   * Construct a new services provider.
    */
   constructor() {
     this._baseUrl = getConfigOption('baseUrl');

+ 3 - 3
src/terminal/index.ts

@@ -16,7 +16,7 @@ import {
  * A factory for creating a Jupyter editor.
  */
 export
-interface ITerminalFactory {
+interface ITerminalProvider {
 
   /**
    * Create a new Terminal instance.
@@ -26,7 +26,7 @@ interface ITerminalFactory {
 
 
 /**
- * The dependency token for the `ITerminalFactory` interface.
+ * The dependency token for the `ITerminalProvider` interface.
  */
 export
-const ITerminalFactory = new Token<ITerminalFactory>('jupyter-js-plugins.ITerminalFactory');
+const ITerminalProvider = new Token<ITerminalProvider>('jupyter-js-plugins.ITerminalProvider');

+ 6 - 6
src/terminal/plugin.ts

@@ -11,7 +11,7 @@ import {
 } from 'phosphor-di';
 
 import {
-  ITerminalFactory
+  ITerminalProvider
 } from './index';
 
 import './plugin.css';
@@ -27,14 +27,14 @@ import './plugin.css';
  */
 export
 function register(container: Container): void {
-  container.register(ITerminalFactory, TerminalFactory);
+  container.register(ITerminalProvider, TerminalProvider);
 }
 
 
 /**
- * An implementation of an ITerminalFactory.
+ * An implementation of an ITerminalProvider.
  */
-class TerminalFactory implements ITerminalFactory {
+class TerminalProvider implements ITerminalProvider {
 
   /**
    * The dependencies required by the editor factory.
@@ -44,8 +44,8 @@ class TerminalFactory implements ITerminalFactory {
   /**
    * Create a new editor factory instance.
    */
-  static create(): ITerminalFactory {
-    return new TerminalFactory();
+  static create(): ITerminalProvider {
+    return new TerminalProvider();
   }
 
   /**

+ 0 - 212
test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/base.css

@@ -1,212 +0,0 @@
-body, html {
-  margin:0; padding: 0;
-  height: 100%;
-}
-body {
-    font-family: Helvetica Neue, Helvetica, Arial;
-    font-size: 14px;
-    color:#333;
-}
-.small { font-size: 12px;; }
-*, *:after, *:before {
-  -webkit-box-sizing:border-box;
-     -moz-box-sizing:border-box;
-          box-sizing:border-box;
-  }
-h1 { font-size: 20px; margin: 0;}
-h2 { font-size: 14px; }
-pre {
-    font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
-    margin: 0;
-    padding: 0;
-    -moz-tab-size: 2;
-    -o-tab-size:  2;
-    tab-size: 2;
-}
-a { color:#0074D9; text-decoration:none; }
-a:hover { text-decoration:underline; }
-.strong { font-weight: bold; }
-.space-top1 { padding: 10px 0 0 0; }
-.pad2y { padding: 20px 0; }
-.pad1y { padding: 10px 0; }
-.pad2x { padding: 0 20px; }
-.pad2 { padding: 20px; }
-.pad1 { padding: 10px; }
-.space-left2 { padding-left:55px; }
-.space-right2 { padding-right:20px; }
-.center { text-align:center; }
-.clearfix { display:block; }
-.clearfix:after {
-  content:'';
-  display:block;
-  height:0;
-  clear:both;
-  visibility:hidden;
-  }
-.fl { float: left; }
-@media only screen and (max-width:640px) {
-  .col3 { width:100%; max-width:100%; }
-  .hide-mobile { display:none!important; }
-}
-
-.quiet {
-  color: #7f7f7f;
-  color: rgba(0,0,0,0.5);
-}
-.quiet a { opacity: 0.7; }
-
-.fraction {
-  font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
-  font-size: 10px;
-  color: #555;
-  background: #E8E8E8;
-  padding: 4px 5px;
-  border-radius: 3px;
-  vertical-align: middle;
-}
-
-div.path a:link, div.path a:visited { color: #333; }
-table.coverage {
-  border-collapse: collapse;
-  margin: 10px 0 0 0;
-  padding: 0;
-}
-
-table.coverage td {
-  margin: 0;
-  padding: 0;
-  vertical-align: top;
-}
-table.coverage td.line-count {
-    text-align: right;
-    padding: 0 5px 0 20px;
-}
-table.coverage td.line-coverage {
-    text-align: right;
-    padding-right: 10px;
-    min-width:20px;
-}
-
-table.coverage td span.cline-any {
-    display: inline-block;
-    padding: 0 5px;
-    width: 100%;
-}
-.missing-if-branch {
-    display: inline-block;
-    margin-right: 5px;
-    border-radius: 3px;
-    position: relative;
-    padding: 0 4px;
-    background: #333;
-    color: yellow;
-}
-
-.skip-if-branch {
-    display: none;
-    margin-right: 10px;
-    position: relative;
-    padding: 0 4px;
-    background: #ccc;
-    color: white;
-}
-.missing-if-branch .typ, .skip-if-branch .typ {
-    color: inherit !important;
-}
-.coverage-summary {
-  border-collapse: collapse;
-  width: 100%;
-}
-.coverage-summary tr { border-bottom: 1px solid #bbb; }
-.keyline-all { border: 1px solid #ddd; }
-.coverage-summary td, .coverage-summary th { padding: 10px; }
-.coverage-summary tbody { border: 1px solid #bbb; }
-.coverage-summary td { border-right: 1px solid #bbb; }
-.coverage-summary td:last-child { border-right: none; }
-.coverage-summary th {
-  text-align: left;
-  font-weight: normal;
-  white-space: nowrap;
-}
-.coverage-summary th.file { border-right: none !important; }
-.coverage-summary th.pct { }
-.coverage-summary th.pic,
-.coverage-summary th.abs,
-.coverage-summary td.pct,
-.coverage-summary td.abs { text-align: right; }
-.coverage-summary td.file { white-space: nowrap;  }
-.coverage-summary td.pic { min-width: 120px !important;  }
-.coverage-summary tfoot td { }
-
-.coverage-summary .sorter {
-    height: 10px;
-    width: 7px;
-    display: inline-block;
-    margin-left: 0.5em;
-    background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
-}
-.coverage-summary .sorted .sorter {
-    background-position: 0 -20px;
-}
-.coverage-summary .sorted-desc .sorter {
-    background-position: 0 -10px;
-}
-.status-line {  height: 10px; }
-/* dark red */
-.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
-.low .chart { border:1px solid #C21F39 }
-/* medium red */
-.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
-/* light red */
-.low, .cline-no { background:#FCE1E5 }
-/* light green */
-.high, .cline-yes { background:rgb(230,245,208) }
-/* medium green */
-.cstat-yes { background:rgb(161,215,106) }
-/* dark green */
-.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
-.high .chart { border:1px solid rgb(77,146,33) }
-
-
-.medium .chart { border:1px solid #666; }
-.medium .cover-fill { background: #666; }
-
-.cbranch-no { background:  yellow !important; color: #111; }
-
-.cstat-skip { background: #ddd; color: #111; }
-.fstat-skip { background: #ddd; color: #111 !important; }
-.cbranch-skip { background: #ddd !important; color: #111; }
-
-span.cline-neutral { background: #eaeaea; }
-.medium { background: #eaeaea; }
-
-.cover-fill, .cover-empty {
-  display:inline-block;
-  height: 12px;
-}
-.chart {
-  line-height: 0;
-}
-.cover-empty {
-    background: white;
-}
-.cover-full {
-    border-right: none !important;
-}
-pre.prettyprint {
-    border: none !important;
-    padding: 0 !important;
-    margin: 0 !important;
-}
-.com { color: #999 !important; }
-.ignore-none { color: #999; font-weight: normal; }
-
-.wrapper {
-  min-height: 100%;
-  height: auto !important;
-  height: 100%;
-  margin: 0 auto -48px;
-}
-.footer, .push {
-  height: 48px;
-}

+ 0 - 80
test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/index.html

@@ -1,80 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
-    <title>Code coverage report for All files</title>
-    <meta charset="utf-8" />
-    <link rel="stylesheet" href="prettify.css" />
-    <link rel="stylesheet" href="base.css" />
-    <meta name="viewport" content="width=device-width, initial-scale=1">
-    <style type='text/css'>
-        .coverage-summary .sorter {
-            background-image: url(sort-arrow-sprite.png);
-        }
-    </style>
-</head>
-<body>
-<div class='wrapper'>
-  <div class='pad1'>
-    <h1>
-      /
-    </h1>
-    <div class='clearfix'>
-      <div class='fl pad1y space-right2'>
-        <span class="strong">100% </span>
-        <span class="quiet">Statements</span>
-        <span class='fraction'>0/0</span>
-      </div>
-      <div class='fl pad1y space-right2'>
-        <span class="strong">100% </span>
-        <span class="quiet">Branches</span>
-        <span class='fraction'>0/0</span>
-      </div>
-      <div class='fl pad1y space-right2'>
-        <span class="strong">100% </span>
-        <span class="quiet">Functions</span>
-        <span class='fraction'>0/0</span>
-      </div>
-      <div class='fl pad1y space-right2'>
-        <span class="strong">100% </span>
-        <span class="quiet">Lines</span>
-        <span class='fraction'>0/0</span>
-      </div>
-    </div>
-  </div>
-  <div class='status-line high'></div>
-<div class="pad1">
-<table class="coverage-summary">
-<thead>
-<tr>
-   <th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
-   <th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
-   <th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
-   <th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
-   <th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
-   <th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
-   <th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
-   <th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
-   <th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
-   <th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
-</tr>
-</thead>
-<tbody></tbody>
-</table>
-</div><div class='push'></div><!-- for sticky footer -->
-</div><!-- /wrapper -->
-<div class='footer quiet pad2 space-top1 center small'>
-  Code coverage
-  generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Dec 09 2015 13:45:08 GMT-0600 (CST)
-</div>
-</div>
-<script src="prettify.js"></script>
-<script>
-window.onload = function () {
-        if (typeof prettyPrint === 'function') {
-            prettyPrint();
-        }
-};
-</script>
-<script src="sorter.js"></script>
-</body>
-</html>

+ 0 - 212
test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/lcov-report/base.css

@@ -1,212 +0,0 @@
-body, html {
-  margin:0; padding: 0;
-  height: 100%;
-}
-body {
-    font-family: Helvetica Neue, Helvetica, Arial;
-    font-size: 14px;
-    color:#333;
-}
-.small { font-size: 12px;; }
-*, *:after, *:before {
-  -webkit-box-sizing:border-box;
-     -moz-box-sizing:border-box;
-          box-sizing:border-box;
-  }
-h1 { font-size: 20px; margin: 0;}
-h2 { font-size: 14px; }
-pre {
-    font: 12px/1.4 Consolas, "Liberation Mono", Menlo, Courier, monospace;
-    margin: 0;
-    padding: 0;
-    -moz-tab-size: 2;
-    -o-tab-size:  2;
-    tab-size: 2;
-}
-a { color:#0074D9; text-decoration:none; }
-a:hover { text-decoration:underline; }
-.strong { font-weight: bold; }
-.space-top1 { padding: 10px 0 0 0; }
-.pad2y { padding: 20px 0; }
-.pad1y { padding: 10px 0; }
-.pad2x { padding: 0 20px; }
-.pad2 { padding: 20px; }
-.pad1 { padding: 10px; }
-.space-left2 { padding-left:55px; }
-.space-right2 { padding-right:20px; }
-.center { text-align:center; }
-.clearfix { display:block; }
-.clearfix:after {
-  content:'';
-  display:block;
-  height:0;
-  clear:both;
-  visibility:hidden;
-  }
-.fl { float: left; }
-@media only screen and (max-width:640px) {
-  .col3 { width:100%; max-width:100%; }
-  .hide-mobile { display:none!important; }
-}
-
-.quiet {
-  color: #7f7f7f;
-  color: rgba(0,0,0,0.5);
-}
-.quiet a { opacity: 0.7; }
-
-.fraction {
-  font-family: Consolas, 'Liberation Mono', Menlo, Courier, monospace;
-  font-size: 10px;
-  color: #555;
-  background: #E8E8E8;
-  padding: 4px 5px;
-  border-radius: 3px;
-  vertical-align: middle;
-}
-
-div.path a:link, div.path a:visited { color: #333; }
-table.coverage {
-  border-collapse: collapse;
-  margin: 10px 0 0 0;
-  padding: 0;
-}
-
-table.coverage td {
-  margin: 0;
-  padding: 0;
-  vertical-align: top;
-}
-table.coverage td.line-count {
-    text-align: right;
-    padding: 0 5px 0 20px;
-}
-table.coverage td.line-coverage {
-    text-align: right;
-    padding-right: 10px;
-    min-width:20px;
-}
-
-table.coverage td span.cline-any {
-    display: inline-block;
-    padding: 0 5px;
-    width: 100%;
-}
-.missing-if-branch {
-    display: inline-block;
-    margin-right: 5px;
-    border-radius: 3px;
-    position: relative;
-    padding: 0 4px;
-    background: #333;
-    color: yellow;
-}
-
-.skip-if-branch {
-    display: none;
-    margin-right: 10px;
-    position: relative;
-    padding: 0 4px;
-    background: #ccc;
-    color: white;
-}
-.missing-if-branch .typ, .skip-if-branch .typ {
-    color: inherit !important;
-}
-.coverage-summary {
-  border-collapse: collapse;
-  width: 100%;
-}
-.coverage-summary tr { border-bottom: 1px solid #bbb; }
-.keyline-all { border: 1px solid #ddd; }
-.coverage-summary td, .coverage-summary th { padding: 10px; }
-.coverage-summary tbody { border: 1px solid #bbb; }
-.coverage-summary td { border-right: 1px solid #bbb; }
-.coverage-summary td:last-child { border-right: none; }
-.coverage-summary th {
-  text-align: left;
-  font-weight: normal;
-  white-space: nowrap;
-}
-.coverage-summary th.file { border-right: none !important; }
-.coverage-summary th.pct { }
-.coverage-summary th.pic,
-.coverage-summary th.abs,
-.coverage-summary td.pct,
-.coverage-summary td.abs { text-align: right; }
-.coverage-summary td.file { white-space: nowrap;  }
-.coverage-summary td.pic { min-width: 120px !important;  }
-.coverage-summary tfoot td { }
-
-.coverage-summary .sorter {
-    height: 10px;
-    width: 7px;
-    display: inline-block;
-    margin-left: 0.5em;
-    background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
-}
-.coverage-summary .sorted .sorter {
-    background-position: 0 -20px;
-}
-.coverage-summary .sorted-desc .sorter {
-    background-position: 0 -10px;
-}
-.status-line {  height: 10px; }
-/* dark red */
-.red.solid, .status-line.low, .low .cover-fill { background:#C21F39 }
-.low .chart { border:1px solid #C21F39 }
-/* medium red */
-.cstat-no, .fstat-no, .cbranch-no, .cbranch-no { background:#F6C6CE }
-/* light red */
-.low, .cline-no { background:#FCE1E5 }
-/* light green */
-.high, .cline-yes { background:rgb(230,245,208) }
-/* medium green */
-.cstat-yes { background:rgb(161,215,106) }
-/* dark green */
-.status-line.high, .high .cover-fill { background:rgb(77,146,33) }
-.high .chart { border:1px solid rgb(77,146,33) }
-
-
-.medium .chart { border:1px solid #666; }
-.medium .cover-fill { background: #666; }
-
-.cbranch-no { background:  yellow !important; color: #111; }
-
-.cstat-skip { background: #ddd; color: #111; }
-.fstat-skip { background: #ddd; color: #111 !important; }
-.cbranch-skip { background: #ddd !important; color: #111; }
-
-span.cline-neutral { background: #eaeaea; }
-.medium { background: #eaeaea; }
-
-.cover-fill, .cover-empty {
-  display:inline-block;
-  height: 12px;
-}
-.chart {
-  line-height: 0;
-}
-.cover-empty {
-    background: white;
-}
-.cover-full {
-    border-right: none !important;
-}
-pre.prettyprint {
-    border: none !important;
-    padding: 0 !important;
-    margin: 0 !important;
-}
-.com { color: #999 !important; }
-.ignore-none { color: #999; font-weight: normal; }
-
-.wrapper {
-  min-height: 100%;
-  height: auto !important;
-  height: 100%;
-  margin: 0 auto -48px;
-}
-.footer, .push {
-  height: 48px;
-}

+ 0 - 80
test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/lcov-report/index.html

@@ -1,80 +0,0 @@
-<!doctype html>
-<html lang="en">
-<head>
-    <title>Code coverage report for All files</title>
-    <meta charset="utf-8" />
-    <link rel="stylesheet" href="prettify.css" />
-    <link rel="stylesheet" href="base.css" />
-    <meta name="viewport" content="width=device-width, initial-scale=1">
-    <style type='text/css'>
-        .coverage-summary .sorter {
-            background-image: url(sort-arrow-sprite.png);
-        }
-    </style>
-</head>
-<body>
-<div class='wrapper'>
-  <div class='pad1'>
-    <h1>
-      /
-    </h1>
-    <div class='clearfix'>
-      <div class='fl pad1y space-right2'>
-        <span class="strong">100% </span>
-        <span class="quiet">Statements</span>
-        <span class='fraction'>0/0</span>
-      </div>
-      <div class='fl pad1y space-right2'>
-        <span class="strong">100% </span>
-        <span class="quiet">Branches</span>
-        <span class='fraction'>0/0</span>
-      </div>
-      <div class='fl pad1y space-right2'>
-        <span class="strong">100% </span>
-        <span class="quiet">Functions</span>
-        <span class='fraction'>0/0</span>
-      </div>
-      <div class='fl pad1y space-right2'>
-        <span class="strong">100% </span>
-        <span class="quiet">Lines</span>
-        <span class='fraction'>0/0</span>
-      </div>
-    </div>
-  </div>
-  <div class='status-line high'></div>
-<div class="pad1">
-<table class="coverage-summary">
-<thead>
-<tr>
-   <th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
-   <th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
-   <th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
-   <th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
-   <th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
-   <th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
-   <th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
-   <th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
-   <th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
-   <th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
-</tr>
-</thead>
-<tbody></tbody>
-</table>
-</div><div class='push'></div><!-- for sticky footer -->
-</div><!-- /wrapper -->
-<div class='footer quiet pad2 space-top1 center small'>
-  Code coverage
-  generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Wed Dec 09 2015 13:45:08 GMT-0600 (CST)
-</div>
-</div>
-<script src="prettify.js"></script>
-<script>
-window.onload = function () {
-        if (typeof prettyPrint === 'function') {
-            prettyPrint();
-        }
-};
-</script>
-<script src="sorter.js"></script>
-</body>
-</html>

+ 0 - 1
test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/lcov-report/prettify.css

@@ -1 +0,0 @@
-.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}

文件差异内容过多而无法显示
+ 0 - 0
test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/lcov-report/prettify.js


二进制
test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/lcov-report/sort-arrow-sprite.png


+ 0 - 158
test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/lcov-report/sorter.js

@@ -1,158 +0,0 @@
-var addSorting = (function () {
-    "use strict";
-    var cols,
-        currentSort = {
-            index: 0,
-            desc: false
-        };
-
-    // returns the summary table element
-    function getTable() { return document.querySelector('.coverage-summary'); }
-    // returns the thead element of the summary table
-    function getTableHeader() { return getTable().querySelector('thead tr'); }
-    // returns the tbody element of the summary table
-    function getTableBody() { return getTable().querySelector('tbody'); }
-    // returns the th element for nth column
-    function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; }
-
-    // loads all columns
-    function loadColumns() {
-        var colNodes = getTableHeader().querySelectorAll('th'),
-            colNode,
-            cols = [],
-            col,
-            i;
-
-        for (i = 0; i < colNodes.length; i += 1) {
-            colNode = colNodes[i];
-            col = {
-                key: colNode.getAttribute('data-col'),
-                sortable: !colNode.getAttribute('data-nosort'),
-                type: colNode.getAttribute('data-type') || 'string'
-            };
-            cols.push(col);
-            if (col.sortable) {
-                col.defaultDescSort = col.type === 'number';
-                colNode.innerHTML = colNode.innerHTML + '<span class="sorter"></span>';
-            }
-        }
-        return cols;
-    }
-    // attaches a data attribute to every tr element with an object
-    // of data values keyed by column name
-    function loadRowData(tableRow) {
-        var tableCols = tableRow.querySelectorAll('td'),
-            colNode,
-            col,
-            data = {},
-            i,
-            val;
-        for (i = 0; i < tableCols.length; i += 1) {
-            colNode = tableCols[i];
-            col = cols[i];
-            val = colNode.getAttribute('data-value');
-            if (col.type === 'number') {
-                val = Number(val);
-            }
-            data[col.key] = val;
-        }
-        return data;
-    }
-    // loads all row data
-    function loadData() {
-        var rows = getTableBody().querySelectorAll('tr'),
-            i;
-
-        for (i = 0; i < rows.length; i += 1) {
-            rows[i].data = loadRowData(rows[i]);
-        }
-    }
-    // sorts the table using the data for the ith column
-    function sortByIndex(index, desc) {
-        var key = cols[index].key,
-            sorter = function (a, b) {
-                a = a.data[key];
-                b = b.data[key];
-                return a < b ? -1 : a > b ? 1 : 0;
-            },
-            finalSorter = sorter,
-            tableBody = document.querySelector('.coverage-summary tbody'),
-            rowNodes = tableBody.querySelectorAll('tr'),
-            rows = [],
-            i;
-
-        if (desc) {
-            finalSorter = function (a, b) {
-                return -1 * sorter(a, b);
-            };
-        }
-
-        for (i = 0; i < rowNodes.length; i += 1) {
-            rows.push(rowNodes[i]);
-            tableBody.removeChild(rowNodes[i]);
-        }
-
-        rows.sort(finalSorter);
-
-        for (i = 0; i < rows.length; i += 1) {
-            tableBody.appendChild(rows[i]);
-        }
-    }
-    // removes sort indicators for current column being sorted
-    function removeSortIndicators() {
-        var col = getNthColumn(currentSort.index),
-            cls = col.className;
-
-        cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
-        col.className = cls;
-    }
-    // adds sort indicators for current column being sorted
-    function addSortIndicators() {
-        getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted';
-    }
-    // adds event listeners for all sorter widgets
-    function enableUI() {
-        var i,
-            el,
-            ithSorter = function ithSorter(i) {
-                var col = cols[i];
-
-                return function () {
-                    var desc = col.defaultDescSort;
-
-                    if (currentSort.index === i) {
-                        desc = !currentSort.desc;
-                    }
-                    sortByIndex(i, desc);
-                    removeSortIndicators();
-                    currentSort.index = i;
-                    currentSort.desc = desc;
-                    addSortIndicators();
-                };
-            };
-        for (i =0 ; i < cols.length; i += 1) {
-            if (cols[i].sortable) {
-                // add the click event handler on the th so users
-                // dont have to click on those tiny arrows
-                el = getNthColumn(i).querySelector('.sorter').parentElement;
-                if (el.addEventListener) {
-                    el.addEventListener('click', ithSorter(i));
-                } else {
-                    el.attachEvent('onclick', ithSorter(i));
-                }
-            }
-        }
-    }
-    // adds sorting functionality to the UI
-    return function () {
-        if (!getTable()) {
-            return;
-        }
-        cols = loadColumns();
-        loadData(cols);
-        addSortIndicators();
-        enableUI();
-    };
-})();
-
-window.addEventListener('load', addSorting);

+ 0 - 0
test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/lcov.info


+ 0 - 1
test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/prettify.css

@@ -1 +0,0 @@
-.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}

文件差异内容过多而无法显示
+ 0 - 0
test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/prettify.js


二进制
test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/sort-arrow-sprite.png


+ 0 - 158
test/coverage/Firefox 42.0.0 (Mac OS X 10.10.0)/sorter.js

@@ -1,158 +0,0 @@
-var addSorting = (function () {
-    "use strict";
-    var cols,
-        currentSort = {
-            index: 0,
-            desc: false
-        };
-
-    // returns the summary table element
-    function getTable() { return document.querySelector('.coverage-summary'); }
-    // returns the thead element of the summary table
-    function getTableHeader() { return getTable().querySelector('thead tr'); }
-    // returns the tbody element of the summary table
-    function getTableBody() { return getTable().querySelector('tbody'); }
-    // returns the th element for nth column
-    function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; }
-
-    // loads all columns
-    function loadColumns() {
-        var colNodes = getTableHeader().querySelectorAll('th'),
-            colNode,
-            cols = [],
-            col,
-            i;
-
-        for (i = 0; i < colNodes.length; i += 1) {
-            colNode = colNodes[i];
-            col = {
-                key: colNode.getAttribute('data-col'),
-                sortable: !colNode.getAttribute('data-nosort'),
-                type: colNode.getAttribute('data-type') || 'string'
-            };
-            cols.push(col);
-            if (col.sortable) {
-                col.defaultDescSort = col.type === 'number';
-                colNode.innerHTML = colNode.innerHTML + '<span class="sorter"></span>';
-            }
-        }
-        return cols;
-    }
-    // attaches a data attribute to every tr element with an object
-    // of data values keyed by column name
-    function loadRowData(tableRow) {
-        var tableCols = tableRow.querySelectorAll('td'),
-            colNode,
-            col,
-            data = {},
-            i,
-            val;
-        for (i = 0; i < tableCols.length; i += 1) {
-            colNode = tableCols[i];
-            col = cols[i];
-            val = colNode.getAttribute('data-value');
-            if (col.type === 'number') {
-                val = Number(val);
-            }
-            data[col.key] = val;
-        }
-        return data;
-    }
-    // loads all row data
-    function loadData() {
-        var rows = getTableBody().querySelectorAll('tr'),
-            i;
-
-        for (i = 0; i < rows.length; i += 1) {
-            rows[i].data = loadRowData(rows[i]);
-        }
-    }
-    // sorts the table using the data for the ith column
-    function sortByIndex(index, desc) {
-        var key = cols[index].key,
-            sorter = function (a, b) {
-                a = a.data[key];
-                b = b.data[key];
-                return a < b ? -1 : a > b ? 1 : 0;
-            },
-            finalSorter = sorter,
-            tableBody = document.querySelector('.coverage-summary tbody'),
-            rowNodes = tableBody.querySelectorAll('tr'),
-            rows = [],
-            i;
-
-        if (desc) {
-            finalSorter = function (a, b) {
-                return -1 * sorter(a, b);
-            };
-        }
-
-        for (i = 0; i < rowNodes.length; i += 1) {
-            rows.push(rowNodes[i]);
-            tableBody.removeChild(rowNodes[i]);
-        }
-
-        rows.sort(finalSorter);
-
-        for (i = 0; i < rows.length; i += 1) {
-            tableBody.appendChild(rows[i]);
-        }
-    }
-    // removes sort indicators for current column being sorted
-    function removeSortIndicators() {
-        var col = getNthColumn(currentSort.index),
-            cls = col.className;
-
-        cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
-        col.className = cls;
-    }
-    // adds sort indicators for current column being sorted
-    function addSortIndicators() {
-        getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted';
-    }
-    // adds event listeners for all sorter widgets
-    function enableUI() {
-        var i,
-            el,
-            ithSorter = function ithSorter(i) {
-                var col = cols[i];
-
-                return function () {
-                    var desc = col.defaultDescSort;
-
-                    if (currentSort.index === i) {
-                        desc = !currentSort.desc;
-                    }
-                    sortByIndex(i, desc);
-                    removeSortIndicators();
-                    currentSort.index = i;
-                    currentSort.desc = desc;
-                    addSortIndicators();
-                };
-            };
-        for (i =0 ; i < cols.length; i += 1) {
-            if (cols[i].sortable) {
-                // add the click event handler on the th so users
-                // dont have to click on those tiny arrows
-                el = getNthColumn(i).querySelector('.sorter').parentElement;
-                if (el.addEventListener) {
-                    el.addEventListener('click', ithSorter(i));
-                } else {
-                    el.attachEvent('onclick', ithSorter(i));
-                }
-            }
-        }
-    }
-    // adds sorting functionality to the UI
-    return function () {
-        if (!getTable()) {
-            return;
-        }
-        cols = loadColumns();
-        loadData(cols);
-        addSortIndicators();
-        enableUI();
-    };
-})();
-
-window.addEventListener('load', addSorting);

+ 479 - 0
typings/moment/moment.d.ts

@@ -0,0 +1,479 @@
+// Type definitions for Moment.js 2.8.0
+// Project: https://github.com/timrwood/moment
+// Definitions by: Michael Lakerveld <https://github.com/Lakerfield>, Aaron King <https://github.com/kingdango>, Hiroki Horiuchi <https://github.com/horiuchi>, Dick van den Brink <https://github.com/DickvdBrink>, Adi Dahiya <https://github.com/adidahiya>, Matt Brooks <https://github.com/EnableSoftware>
+// Definitions: https://github.com/borisyankov/DefinitelyTyped
+
+declare module moment {
+
+    interface MomentInput {
+        /** Year */
+        years?: number;
+        /** Year */
+        year?: number;
+        /** Year */
+        y?: number;
+
+        /** Month */
+        months?: number;
+        /** Month */
+        month?: number;
+        /** Month */
+        M?: number;
+
+        /** Week */
+        weeks?: number;
+        /** Week */
+        week?: number;
+        /** Week */
+        w?: number;
+
+        /** Day/Date */
+        days?: number;
+        /** Day/Date */
+        day?: number;
+        /** Day/Date */
+        date?: number;
+        /** Day/Date */
+        d?: number;
+
+        /** Hour */
+        hours?: number;
+        /** Hour */
+        hour?: number;
+        /** Hour */
+        h?: number;
+
+        /** Minute */
+        minutes?: number;
+        /** Minute */
+        minute?: number;
+        /** Minute */
+        m?: number;
+
+        /** Second */
+        seconds?: number;
+        /** Second */
+        second?: number;
+        /** Second */
+        s?: number;
+
+        /** Millisecond */
+        milliseconds?: number;
+        /** Millisecond */
+        millisecond?: number;
+        /** Millisecond */
+        ms?: number;
+    }
+
+    interface Duration {
+        humanize(withSuffix?: boolean): string;
+
+        as(units: string): number;
+
+        milliseconds(): number;
+        asMilliseconds(): number;
+
+        seconds(): number;
+        asSeconds(): number;
+
+        minutes(): number;
+        asMinutes(): number;
+
+        hours(): number;
+        asHours(): number;
+
+        days(): number;
+        asDays(): number;
+
+        months(): number;
+        asMonths(): number;
+
+        years(): number;
+        asYears(): number;
+
+        add(n: number, p: string): Duration;
+        add(n: number): Duration;
+        add(d: Duration): Duration;
+
+        subtract(n: number, p: string): Duration;
+        subtract(n: number): Duration;
+        subtract(d: Duration): Duration;
+
+        toISOString(): string;
+        toJSON(): string;
+    }
+
+    interface Moment {
+        format(format: string): string;
+        format(): string;
+
+        fromNow(withoutSuffix?: boolean): string;
+
+        startOf(unitOfTime: string): Moment;
+        endOf(unitOfTime: string): Moment;
+
+        /**
+         * Mutates the original moment by adding time. (deprecated in 2.8.0)
+         *
+         * @param unitOfTime the unit of time you want to add (eg "years" / "hours" etc)
+         * @param amount the amount you want to add
+         */
+        add(unitOfTime: string, amount: number): Moment;
+        /**
+         * Mutates the original moment by adding time.
+         *
+         * @param amount the amount you want to add
+         * @param unitOfTime the unit of time you want to add (eg "years" / "hours" etc)
+         */
+        add(amount: number, unitOfTime: string): Moment;
+        /**
+         * Mutates the original moment by adding time. Note that the order of arguments can be flipped.
+         *
+         * @param amount the amount you want to add
+         * @param unitOfTime the unit of time you want to add (eg "years" / "hours" etc)
+         */
+        add(amount: string, unitOfTime: string): Moment;
+        /**
+         * Mutates the original moment by adding time.
+         *
+         * @param objectLiteral an object literal that describes multiple time units {days:7,months:1}
+         */
+        add(objectLiteral: MomentInput): Moment;
+        /**
+         * Mutates the original moment by adding time.
+         *
+         * @param duration a length of time
+         */
+        add(duration: Duration): Moment;
+
+        /**
+         * Mutates the original moment by subtracting time. (deprecated in 2.8.0)
+         *
+         * @param unitOfTime the unit of time you want to subtract (eg "years" / "hours" etc)
+         * @param amount the amount you want to subtract
+         */
+        subtract(unitOfTime: string, amount: number): Moment;
+        /**
+         * Mutates the original moment by subtracting time.
+         *
+         * @param unitOfTime the unit of time you want to subtract (eg "years" / "hours" etc)
+         * @param amount the amount you want to subtract
+         */
+        subtract(amount: number, unitOfTime: string): Moment;
+        /**
+         * Mutates the original moment by subtracting time. Note that the order of arguments can be flipped.
+         *
+         * @param amount the amount you want to add
+         * @param unitOfTime the unit of time you want to subtract (eg "years" / "hours" etc)
+         */
+        subtract(amount: string, unitOfTime: string): Moment;
+        /**
+         * Mutates the original moment by subtracting time.
+         *
+         * @param objectLiteral an object literal that describes multiple time units {days:7,months:1}
+         */
+        subtract(objectLiteral: MomentInput): Moment;
+        /**
+         * Mutates the original moment by subtracting time.
+         *
+         * @param duration a length of time
+         */
+        subtract(duration: Duration): Moment;
+
+        calendar(): string;
+        calendar(start: Moment): string;
+        calendar(start: Moment, formats: MomentCalendar): string;
+
+        clone(): Moment;
+
+        /**
+         * @return Unix timestamp, or milliseconds since the epoch.
+         */
+        valueOf(): number;
+
+        local(): Moment; // current date/time in local mode
+
+        utc(): Moment; // current date/time in UTC mode
+
+        isValid(): boolean;
+        invalidAt(): number;
+
+        year(y: number): Moment;
+        year(): number;
+        quarter(): number;
+        quarter(q: number): Moment;
+        month(M: number): Moment;
+        month(M: string): Moment;
+        month(): number;
+        day(d: number): Moment;
+        day(d: string): Moment;
+        day(): number;
+        date(d: number): Moment;
+        date(): number;
+        hour(h: number): Moment;
+        hour(): number;
+        hours(h: number): Moment;
+        hours(): number;
+        minute(m: number): Moment;
+        minute(): number;
+        minutes(m: number): Moment;
+        minutes(): number;
+        second(s: number): Moment;
+        second(): number;
+        seconds(s: number): Moment;
+        seconds(): number;
+        millisecond(ms: number): Moment;
+        millisecond(): number;
+        milliseconds(ms: number): Moment;
+        milliseconds(): number;
+        weekday(): number;
+        weekday(d: number): Moment;
+        isoWeekday(): number;
+        isoWeekday(d: number): Moment;
+        weekYear(): number;
+        weekYear(d: number): Moment;
+        isoWeekYear(): number;
+        isoWeekYear(d: number): Moment;
+        week(): number;
+        week(d: number): Moment;
+        weeks(): number;
+        weeks(d: number): Moment;
+        isoWeek(): number;
+        isoWeek(d: number): Moment;
+        isoWeeks(): number;
+        isoWeeks(d: number): Moment;
+        weeksInYear(): number;
+        isoWeeksInYear(): number;
+        dayOfYear(): number;
+        dayOfYear(d: number): Moment;
+
+        from(f: Moment|string|number|Date|number[], suffix?: boolean): string;
+        to(f: Moment|string|number|Date|number[], suffix?: boolean): string;
+        toNow(withoutPrefix?: boolean): string;
+
+        diff(b: Moment): number;
+        diff(b: Moment, unitOfTime: string): number;
+        diff(b: Moment, unitOfTime: string, round: boolean): number;
+
+        toArray(): number[];
+        toDate(): Date;
+        toISOString(): string;
+        toJSON(): string;
+        unix(): number;
+
+        isLeapYear(): boolean;
+        zone(): number;
+        zone(b: number): Moment;
+        zone(b: string): Moment;
+        utcOffset(): number;
+        utcOffset(b: number): Moment;
+        utcOffset(b: string): Moment;
+        daysInMonth(): number;
+        isDST(): boolean;
+
+        isBefore(): boolean;
+        isBefore(b: Moment|string|number|Date|number[], granularity?: string): boolean;
+
+        isAfter(): boolean;
+        isAfter(b: Moment|string|number|Date|number[], granularity?: string): boolean;
+
+        isSame(b: Moment|string|number|Date|number[], granularity?: string): boolean;
+        isBetween(a: Moment|string|number|Date|number[], b: Moment|string|number|Date|number[], granularity?: string): boolean;
+
+        // Deprecated as of 2.8.0.
+        lang(language: string): Moment;
+        lang(reset: boolean): Moment;
+        lang(): MomentLanguage;
+
+        locale(language: string): Moment;
+        locale(reset: boolean): Moment;
+        locale(): string;
+
+        localeData(language: string): Moment;
+        localeData(reset: boolean): Moment;
+        localeData(): MomentLanguage;
+
+        // Deprecated as of 2.7.0.
+        max(date: Moment|string|number|Date|any[]): Moment;
+        max(date: string, format: string): Moment;
+
+        // Deprecated as of 2.7.0.
+        min(date: Moment|string|number|Date|any[]): Moment;
+        min(date: string, format: string): Moment;
+
+        get(unit: string): number;
+        set(unit: string, value: number): Moment;
+        set(objectLiteral: MomentInput): Moment;
+    }
+
+    type formatFunction = () => string;
+
+    interface MomentCalendar {
+      lastDay?: string | formatFunction;
+      sameDay?: string | formatFunction;
+      nextDay?: string | formatFunction;
+      lastWeek?: string | formatFunction;
+      nextWeek?: string | formatFunction;
+      sameElse?: string | formatFunction;
+    }
+
+    interface BaseMomentLanguage {
+        months ?: any;
+        monthsShort ?: any;
+        weekdays ?: any;
+        weekdaysShort ?: any;
+        weekdaysMin ?: any;
+        relativeTime ?: MomentRelativeTime;
+        meridiem ?: (hour: number, minute: number, isLowercase: boolean) => string;
+        calendar ?: MomentCalendar;
+        ordinal ?: (num: number) => string;
+    }
+
+    interface MomentLanguage extends BaseMomentLanguage {
+      longDateFormat?: MomentLongDateFormat;
+    }
+
+    interface MomentLanguageData extends BaseMomentLanguage {
+        /**
+         * @param formatType should be L, LL, LLL, LLLL.
+         */
+        longDateFormat(formatType: string): string;
+    }
+
+    interface MomentLongDateFormat {
+      L: string;
+      LL: string;
+      LLL: string;
+      LLLL: string;
+      LT: string;
+      LTS: string;
+      l?: string;
+      ll?: string;
+      lll?: string;
+      llll?: string;
+      lt?: string;
+      lts?: string;
+    }
+
+    interface MomentRelativeTime {
+      future: any;
+      past: any;
+      s: any;
+      m: any;
+      mm: any;
+      h: any;
+      hh: any;
+      d: any;
+      dd: any;
+      M: any;
+      MM: any;
+      y: any;
+      yy: any;
+    }
+
+    interface MomentStatic {
+        version: string;
+        fn: Moment;
+
+        (): Moment;
+        (date: number): Moment;
+        (date: number[]): Moment;
+        (date: string, format?: string, strict?: boolean): Moment;
+        (date: string, format?: string, language?: string, strict?: boolean): Moment;
+        (date: string, formats: string[], strict?: boolean): Moment;
+        (date: string, formats: string[], language?: string, strict?: boolean): Moment;
+        (date: string, specialFormat: () => void, strict?: boolean): Moment;
+        (date: string, specialFormat: () => void, language?: string, strict?: boolean): Moment;
+        (date: string, formatsIncludingSpecial: any[], strict?: boolean): Moment;
+        (date: string, formatsIncludingSpecial: any[], language?: string, strict?: boolean): Moment;
+        (date: Date): Moment;
+        (date: Moment): Moment;
+        (date: Object): Moment;
+
+        utc(): Moment;
+        utc(date: number): Moment;
+        utc(date: number[]): Moment;
+        utc(date: string, format?: string, strict?: boolean): Moment;
+        utc(date: string, format?: string, language?: string, strict?: boolean): Moment;
+        utc(date: string, formats: string[], strict?: boolean): Moment;
+        utc(date: string, formats: string[], language?: string, strict?: boolean): Moment;
+        utc(date: Date): Moment;
+        utc(date: Moment): Moment;
+        utc(date: Object): Moment;
+
+        unix(timestamp: number): Moment;
+
+        invalid(parsingFlags?: Object): Moment;
+        isMoment(): boolean;
+        isMoment(m: any): boolean;
+        isDate(m: any): boolean;
+        isDuration(): boolean;
+        isDuration(d: any): boolean;
+
+        // Deprecated in 2.8.0.
+        lang(language?: string): string;
+        lang(language?: string, definition?: MomentLanguage): string;
+
+        locale(language?: string): string;
+        locale(language?: string[]): string;
+        locale(language?: string, definition?: MomentLanguage): string;
+
+        localeData(language?: string): MomentLanguageData;
+
+        longDateFormat: any;
+        relativeTime: any;
+        meridiem: (hour: number, minute: number, isLowercase: boolean) => string;
+        calendar: any;
+        ordinal: (num: number) => string;
+
+        duration(milliseconds: Number): Duration;
+        duration(num: Number, unitOfTime: string): Duration;
+        duration(input: MomentInput): Duration;
+        duration(object: any): Duration;
+        duration(): Duration;
+
+        parseZone(date: string): Moment;
+
+        months(): string[];
+        months(index: number): string;
+        months(format: string): string[];
+        months(format: string, index: number): string;
+        monthsShort(): string[];
+        monthsShort(index: number): string;
+        monthsShort(format: string): string[];
+        monthsShort(format: string, index: number): string;
+
+        weekdays(): string[];
+        weekdays(index: number): string;
+        weekdays(format: string): string[];
+        weekdays(format: string, index: number): string;
+        weekdaysShort(): string[];
+        weekdaysShort(index: number): string;
+        weekdaysShort(format: string): string[];
+        weekdaysShort(format: string, index: number): string;
+        weekdaysMin(): string[];
+        weekdaysMin(index: number): string;
+        weekdaysMin(format: string): string[];
+        weekdaysMin(format: string, index: number): string;
+
+        min(...moments: Moment[]): Moment;
+        max(...moments: Moment[]): Moment;
+
+        normalizeUnits(unit: string): string;
+        relativeTimeThreshold(threshold: string): number|boolean;
+        relativeTimeThreshold(threshold: string, limit:number): boolean;
+
+        /**
+         * Constant used to enable explicit ISO_8601 format parsing.
+         */
+        ISO_8601(): void;
+
+        defaultFormat: string;
+    }
+
+}
+
+declare module 'moment' {
+    var moment: moment.MomentStatic;
+    export = moment;
+}

部分文件因为文件数量过多而无法显示