mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-30 19:19:03 +01:00 
			
		
		
		
	Merge branch 'master' into patch-1
This commit is contained in:
		
						commit
						d3d4c88b47
					
				| @ -1,4 +1,4 @@ | |||||||
| Copyright (c) 2019 Nathan Cahill | Copyright (c) 2020 Nathan Cahill | ||||||
| 
 | 
 | ||||||
| Permission is hereby granted, free of charge, to any person obtaining a copy | Permission is hereby granted, free of charge, to any person obtaining a copy | ||||||
| of this software and associated documentation files (the "Software"), to deal | of this software and associated documentation files (the "Software"), to deal | ||||||
|  | |||||||
| @ -2,9 +2,9 @@ | |||||||
| <img alt="Split.js" title="Split.js" src="https://rawcdn.githack.com/nathancahill/split/df1873f0c74d2da60f42e1774040651d6191b9bb/packages/splitjs/logo.svg?sanitize=true" width="430"> | <img alt="Split.js" title="Split.js" src="https://rawcdn.githack.com/nathancahill/split/df1873f0c74d2da60f42e1774040651d6191b9bb/packages/splitjs/logo.svg?sanitize=true" width="430"> | ||||||
| <br><br> | <br><br> | ||||||
| <a href="https://circleci.com/gh/nathancahill/split"><img src="https://img.shields.io/circleci/project/github/nathancahill/split/master.svg" alt="Build Status"></a> | <a href="https://circleci.com/gh/nathancahill/split"><img src="https://img.shields.io/circleci/project/github/nathancahill/split/master.svg" alt="Build Status"></a> | ||||||
| <img src="https://img.badgesize.io/https://unpkg.com/split.js/dist/split.min.js?compression=gzip&label=size&v=1.5.11" alt="File Size"> | <img src="https://img.badgesize.io/https://unpkg.com/split.js/dist/split.min.js?compression=gzip&label=size&v=1.6.0" alt="File Size"> | ||||||
| <img src="https://badge.fury.io/js/split.js.svg" alt="npm version"> | <img src="https://badge.fury.io/js/split.js.svg" alt="npm version"> | ||||||
| <img src="https://david-dm.org/nathancahill/split/status.svg" alt="Dependencies"> | <img src="https://img.shields.io/badge/dependencies-0-brightgreen" alt="Dependencies"> | ||||||
| <img src = "https://opencollective.com/splitjs/backers/badge.svg" alt="Backers on Open Collective"/> | <img src = "https://opencollective.com/splitjs/backers/badge.svg" alt="Backers on Open Collective"/> | ||||||
| <img src = "https://opencollective.com/splitjs/sponsors/badge.svg" alt="Sponsors on Open Collective"/> | <img src = "https://opencollective.com/splitjs/sponsors/badge.svg" alt="Sponsors on Open Collective"/> | ||||||
| </p> | </p> | ||||||
| @ -17,7 +17,7 @@ | |||||||
| -   **Tiny:** Weights 2kb gzipped. | -   **Tiny:** Weights 2kb gzipped. | ||||||
| -   **Fast:** No overhead or attached window event listeners, uses pure CSS for resizing. | -   **Fast:** No overhead or attached window event listeners, uses pure CSS for resizing. | ||||||
| -   **Unopinionated:** Plays nicely with `float`, `flex` and other layouts. | -   **Unopinionated:** Plays nicely with `float`, `flex` and other layouts. | ||||||
| -   **Compatible:** Works great in IE9, and _even loads in IE8_ with polyfills. Early Firefox/Chrome/Safari/Opera supported too. | -   **Compatible:** Works great in IE9, early Firefox/Chrome/Safari/Opera supported too. | ||||||
| 
 | 
 | ||||||
| ## Table of Contents | ## Table of Contents | ||||||
| 
 | 
 | ||||||
| @ -68,7 +68,7 @@ The [UMD](https://github.com/umdjs/umd) build is also available on [unpkg](http: | |||||||
| or [cdnjs](https://cdnjs.com/): | or [cdnjs](https://cdnjs.com/): | ||||||
| 
 | 
 | ||||||
| ```html | ```html | ||||||
| <script src="https://cdnjs.cloudflare.com/ajax/libs/split.js/1.5.11/split.min.js"></script> | <script src="https://cdnjs.cloudflare.com/ajax/libs/split.js/1.6.0/split.min.js"></script> | ||||||
| ``` | ``` | ||||||
| 
 | 
 | ||||||
| You can find the library on `window.Split`. | You can find the library on `window.Split`. | ||||||
| @ -535,14 +535,6 @@ This library uses [CSS calc()](https://developer.mozilla.org/en-US/docs/Web/CSS/ | |||||||
| | :-------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------- | | | :-------------------------------------------------------------------------------------: | :--------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------------------: | :------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------: | :-------------------------------------------------------------------------------------------------- | | ||||||
| |                                          22+ ✔                                          |                                           6+ ✔                                           |                                                9+ ✔                                                |                                         15+ ✔                                          |                                         6.2+ ✔                                          | Sponsored ✔                                                                                         | | |                                          22+ ✔                                          |                                           6+ ✔                                           |                                                9+ ✔                                                |                                         15+ ✔                                          |                                         6.2+ ✔                                          | Sponsored ✔                                                                                         | | ||||||
| 
 | 
 | ||||||
| Gracefully falls back in IE 8 and below to only setting the initial widths/heights and not allowing dragging. IE 8 requires polyfills for `Array.isArray()`, `Array.forEach`, `Array.map`, `Array.filter`, `Object.keys()` and `getComputedStyle`. This script from [Polyfill.io](https://polyfill.io/) includes all of these, adding 1.91 kb to the gzipped size. |  | ||||||
| 
 |  | ||||||
| This is **ONLY NEEDED** if you are supporting **IE8:** |  | ||||||
| 
 |  | ||||||
| ```html |  | ||||||
| <script src="///polyfill.io/v2/polyfill.min.js?features=Array.isArray,Array.prototype.forEach,Array.prototype.map,Object.keys,Array.prototype.filter,getComputedStyle"></script> |  | ||||||
| ``` |  | ||||||
| 
 |  | ||||||
| Cross-browser Testing Platform and Open Source <3 Provided by [Sauce Labs](https://saucelabs.com). | Cross-browser Testing Platform and Open Source <3 Provided by [Sauce Labs](https://saucelabs.com). | ||||||
| 
 | 
 | ||||||
| ## Credits | ## Credits | ||||||
|  | |||||||
							
								
								
									
										52
									
								
								packages/splitjs/index.d.ts
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										52
									
								
								packages/splitjs/index.d.ts
									
									
									
									
										vendored
									
									
								
							| @ -1,48 +1,48 @@ | |||||||
| // Type definitions for split.js 1.4
 | // Type definitions for Split.js
 | ||||||
| // Project: https://github.com/nathancahill/Split.js
 | // Project: https://github.com/nathancahill/split/tree/master/packages/splitjs
 | ||||||
| // Definitions by: Ilia Choly <https://github.com/icholy>
 | // Definitions by: Ilia Choly <https://github.com/icholy>
 | ||||||
| // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
 | // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
 | ||||||
| // TypeScript Version: 2.1
 | // TypeScript Version: 2.1
 | ||||||
| 
 | 
 | ||||||
| // Global variable outside module loader
 | // Global variable outside module loader
 | ||||||
| export as namespace Split; | export as namespace Split | ||||||
| 
 | 
 | ||||||
| // Module loader
 | // Module loader
 | ||||||
| export = Split; | export = Split | ||||||
| 
 | 
 | ||||||
| declare function Split( | declare function Split( | ||||||
|     elements: Array<string | HTMLElement>, |     elements: Array<string | HTMLElement>, | ||||||
|   options?: Split.Options |     options?: Split.Options, | ||||||
| ): Split.Instance; | ): Split.Instance | ||||||
| 
 | 
 | ||||||
| declare namespace Split { | declare namespace Split { | ||||||
|   type Partial<T> = {[P in keyof T]?: T[P]}; |     type Partial<T> = { [P in keyof T]?: T[P] } | ||||||
|   type CSSStyleDeclarationPartial = Partial<CSSStyleDeclaration>; |     type CSSStyleDeclarationPartial = Partial<CSSStyleDeclaration> | ||||||
| 
 | 
 | ||||||
|     interface Options { |     interface Options { | ||||||
|         // Initial sizes of each element in percents or CSS values.
 |         // Initial sizes of each element in percents or CSS values.
 | ||||||
|     sizes?: number[]; |         sizes?: number[] | ||||||
| 
 | 
 | ||||||
|         // Minimum size of each element.
 |         // Minimum size of each element.
 | ||||||
|     minSize?: number | number[]; |         minSize?: number | number[] | ||||||
| 
 | 
 | ||||||
|     expandToMin?: boolean; |         expandToMin?: boolean | ||||||
| 
 | 
 | ||||||
|         // Gutter size in pixels.
 |         // Gutter size in pixels.
 | ||||||
|     gutterSize?: number; |         gutterSize?: number | ||||||
| 
 | 
 | ||||||
|     gutterAlign?: string; |         gutterAlign?: string | ||||||
| 
 | 
 | ||||||
|         // Snap to minimum size offset in pixels.
 |         // Snap to minimum size offset in pixels.
 | ||||||
|     snapOffset?: number; |         snapOffset?: number | ||||||
| 
 | 
 | ||||||
|     dragInterval?: number; |         dragInterval?: number | ||||||
| 
 | 
 | ||||||
|         // Direction to split: horizontal or vertical.
 |         // Direction to split: horizontal or vertical.
 | ||||||
|     direction?: 'horizontal' | 'vertical'; |         direction?: 'horizontal' | 'vertical' | ||||||
| 
 | 
 | ||||||
|         // Cursor to display while dragging.
 |         // Cursor to display while dragging.
 | ||||||
|     cursor?: 'col-resize' | 'row-resize'; |         cursor?: string | ||||||
| 
 | 
 | ||||||
|         // Callback on drag.
 |         // Callback on drag.
 | ||||||
|         onDrag?(sizes: number[]): void; |         onDrag?(sizes: number[]): void; | ||||||
| @ -56,8 +56,8 @@ declare namespace Split { | |||||||
|         // Called to create each gutter element
 |         // Called to create each gutter element
 | ||||||
|         gutter?( |         gutter?( | ||||||
|             index: number, |             index: number, | ||||||
|       direction: 'horizontal' | 'vertical' |             direction: 'horizontal' | 'vertical', | ||||||
|     ): HTMLElement; |         ): HTMLElement | ||||||
| 
 | 
 | ||||||
|         // Called to set the style of each element.
 |         // Called to set the style of each element.
 | ||||||
|         elementStyle?( |         elementStyle?( | ||||||
| @ -65,32 +65,30 @@ declare namespace Split { | |||||||
|             elementSize: number, |             elementSize: number, | ||||||
|             gutterSize: number, |             gutterSize: number, | ||||||
|             index: number, |             index: number, | ||||||
|     ): CSSStyleDeclarationPartial; |         ): CSSStyleDeclarationPartial | ||||||
| 
 | 
 | ||||||
|         // Called to set the style of the gutter.
 |         // Called to set the style of the gutter.
 | ||||||
|         gutterStyle?( |         gutterStyle?( | ||||||
|             dimension: 'width' | 'height', |             dimension: 'width' | 'height', | ||||||
|             gutterSize: number, |             gutterSize: number, | ||||||
|             index: number, |             index: number, | ||||||
|     ): CSSStyleDeclarationPartial; |         ): CSSStyleDeclarationPartial | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     interface Instance { |     interface Instance { | ||||||
|         // setSizes behaves the same as the sizes configuration option, passing an array of percents or CSS values.
 |         // setSizes behaves the same as the sizes configuration option, passing an array of percents or CSS values.
 | ||||||
|         // It updates the sizes of the elements in the split.
 |         // It updates the sizes of the elements in the split.
 | ||||||
|     setSizes(sizes: number[]): void; |         setSizes(sizes: number[]): void | ||||||
| 
 | 
 | ||||||
|         // getSizes returns an array of percents, suitable for using with setSizes or creation.
 |         // getSizes returns an array of percents, suitable for using with setSizes or creation.
 | ||||||
|     // Not supported in IE8.
 |         getSizes(): number[] | ||||||
|     getSizes(): number[]; |  | ||||||
| 
 | 
 | ||||||
|         // collapse changes the size of element at index to 0.
 |         // collapse changes the size of element at index to 0.
 | ||||||
|         // Every element except the last is collapsed towards the front (left or top).
 |         // Every element except the last is collapsed towards the front (left or top).
 | ||||||
|         // The last is collapsed towards the back.
 |         // The last is collapsed towards the back.
 | ||||||
|     // Not supported in IE8.
 |         collapse(index: number): void | ||||||
|     collapse(index: number): void; |  | ||||||
| 
 | 
 | ||||||
|         // Destroy the instance. It removes the gutter elements, and the size CSS styles Split.js set.
 |         // Destroy the instance. It removes the gutter elements, and the size CSS styles Split.js set.
 | ||||||
|     destroy(preserveStyles?: boolean, preserveGutters?: boolean): void; |         destroy(preserveStyles?: boolean, preserveGutters?: boolean): void | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  | |||||||
| @ -1,62 +1,47 @@ | |||||||
| module.exports = config => { | module.exports = config => { | ||||||
|     config.set({ |     config.set({ | ||||||
|         customLaunchers: { |         customLaunchers: { | ||||||
|  |             // latest firefox, chrome, safari
 | ||||||
|             sl_firefox_latest: { |             sl_firefox_latest: { | ||||||
|                 base: 'SauceLabs', |                 base: 'SauceLabs', | ||||||
|                 browserName: 'firefox', |                 browserName: 'firefox', | ||||||
|                 platform: 'macOS 10.13', |                 platform: 'Windows 10', | ||||||
|                 version: '63.0', |                 version: 'latest', | ||||||
|             }, |             }, | ||||||
|             sl_chrome_latest: { |             sl_chrome_latest: { | ||||||
|                 base: 'SauceLabs', |                 base: 'SauceLabs', | ||||||
|                 browserName: 'chrome', |                 browserName: 'chrome', | ||||||
|                 platform: 'macOS 10.13', |                 platform: 'Windows 10', | ||||||
|                 version: '70.0', |                 version: 'latest', | ||||||
|             }, |             }, | ||||||
|             sl_safari: { |             sl_safari: { | ||||||
|                 base: 'SauceLabs', |                 base: 'SauceLabs', | ||||||
|                 browserName: 'safari', |                 browserName: 'safari', | ||||||
|                 platform: 'macOS 10.13', |                 platform: 'macOS 10.15', | ||||||
|                 version: '12.1', |                 version: 'latest', | ||||||
|             }, |  | ||||||
| 
 |  | ||||||
|             sl_firefox: { |  | ||||||
|                 base: 'SauceLabs', |  | ||||||
|                 browserName: 'firefox', |  | ||||||
|                 platform: 'Windows 7', |  | ||||||
|                 version: '6.0', |  | ||||||
|             }, |  | ||||||
|             sl_chrome: { |  | ||||||
|                 base: 'SauceLabs', |  | ||||||
|                 browserName: 'chrome', |  | ||||||
|                 platform: 'Windows 7', |  | ||||||
|                 version: '26.0', |  | ||||||
|             }, |             }, | ||||||
| 
 | 
 | ||||||
|  |             // latest edge
 | ||||||
|             sl_edge: { |             sl_edge: { | ||||||
|                 base: 'SauceLabs', |                 base: 'SauceLabs', | ||||||
|                 browserName: 'MicrosoftEdge', |                 browserName: 'MicrosoftEdge', | ||||||
|                 platform: 'Windows 10', |                 platform: 'Windows 10', | ||||||
|                 version: '14.14393', |                 version: 'latest', | ||||||
|             }, |             }, | ||||||
|  |             // ie 11
 | ||||||
|             sl_ie_11: { |             sl_ie_11: { | ||||||
|                 base: 'SauceLabs', |                 base: 'SauceLabs', | ||||||
|                 browserName: 'internet explorer', |                 browserName: 'internet explorer', | ||||||
|                 platform: 'Windows 7', |                 platform: 'Windows 10', | ||||||
|                 version: '11.0', |                 version: 'latest', | ||||||
|             }, |             }, | ||||||
|  |             // ie 10
 | ||||||
|             sl_ie_10: { |             sl_ie_10: { | ||||||
|                 base: 'SauceLabs', |                 base: 'SauceLabs', | ||||||
|                 browserName: 'internet explorer', |                 browserName: 'internet explorer', | ||||||
|                 platform: 'Windows 7', |                 platform: 'Windows 7', | ||||||
|                 version: '10.0', |                 version: '10.0', | ||||||
|             }, |             }, | ||||||
|             sl_ie_9: { |  | ||||||
|                 base: 'SauceLabs', |  | ||||||
|                 browserName: 'internet explorer', |  | ||||||
|                 platform: 'Windows 7', |  | ||||||
|                 version: '9.0', |  | ||||||
|             }, |  | ||||||
|         }, |         }, | ||||||
|         frameworks: ['jasmine'], |         frameworks: ['jasmine'], | ||||||
|         browsers: ['FirefoxHeadless', 'ChromeHeadless'], |         browsers: ['FirefoxHeadless', 'ChromeHeadless'], | ||||||
|  | |||||||
| @ -1,33 +1,40 @@ | |||||||
| { | { | ||||||
|     "name": "split.js", |     "name": "split.js", | ||||||
|   "version": "1.5.11", |     "version": "1.6.0", | ||||||
|     "description": "2kb unopinionated utility for resizeable split views", |     "description": "2kb unopinionated utility for resizeable split views", | ||||||
|     "main": "dist/split.js", |     "main": "dist/split.js", | ||||||
|     "minified:main": "dist/split.min.js", |     "minified:main": "dist/split.min.js", | ||||||
|   "typings": "index.d.ts", |     "module": "dist/split.mjs", | ||||||
|   "module": "dist/split.es.js", |     "types": "index.d.ts", | ||||||
|     "repository": "https://github.com/nathancahill/split", |     "repository": "https://github.com/nathancahill/split", | ||||||
|   "keywords": ["css", "split", "flexbox", "tiny", "split-layout"], |     "keywords": [ | ||||||
|  |         "css", | ||||||
|  |         "split", | ||||||
|  |         "flexbox", | ||||||
|  |         "tiny", | ||||||
|  |         "split-layout" | ||||||
|  |     ], | ||||||
|     "author": "Nathan Cahill <nathan@nathancahill.com>", |     "author": "Nathan Cahill <nathan@nathancahill.com>", | ||||||
|     "license": "MIT", |     "license": "MIT", | ||||||
|     "homepage": "https://split.js.org/", |     "homepage": "https://split.js.org/", | ||||||
|     "scripts": { |     "scripts": { | ||||||
|     "lint": "eslint src", |  | ||||||
|         "test": "karma start", |         "test": "karma start", | ||||||
|         "prepublish": "rollup -c", |         "prepublish": "rollup -c", | ||||||
|         "build": "rollup -c && npm run size", |         "build": "rollup -c && npm run size", | ||||||
|         "watch": "rollup -cw", |         "watch": "rollup -cw", | ||||||
|         "size": "echo \"gzip size: $(gzip-size --raw $npm_package_minified_main) bytes\"", |         "size": "echo \"gzip size: $(gzip-size --raw $npm_package_minified_main) bytes\"", | ||||||
|     "saucelabs": "yarn run test --browsers sl_firefox_latest,sl_chrome_latest,sl_safari,sl_firefox,sl_chrome,sl_edge,sl_ie_11,sl_ie_10,sl_ie_9" |         "saucelabs": "yarn run test --browsers sl_firefox_latest,sl_chrome_latest,sl_safari,sl_edge,sl_ie_11,sl_ie_10" | ||||||
|     }, |     }, | ||||||
|   "files": ["dist"], |     "files": [ | ||||||
|  |         "index.d.ts", | ||||||
|  |         "dist" | ||||||
|  |     ], | ||||||
|     "browserslist": [ |     "browserslist": [ | ||||||
|         "Chrome >= 22", |         "Chrome >= 22", | ||||||
|         "Firefox >= 6", |         "Firefox >= 6", | ||||||
|         "Opera >= 15", |         "Opera >= 15", | ||||||
|         "Safari >= 6.2", |         "Safari >= 6.2", | ||||||
|     "IE >= 9", |         "IE >= 9" | ||||||
|     "IE 8" |  | ||||||
|     ], |     ], | ||||||
|     "collective": { |     "collective": { | ||||||
|         "type": "opencollective", |         "type": "opencollective", | ||||||
|  | |||||||
| @ -1,5 +1,5 @@ | |||||||
| import buble from 'rollup-plugin-buble' | import buble from '@rollup/plugin-buble' | ||||||
| import { uglify } from 'rollup-plugin-uglify' | import { terser } from 'rollup-plugin-terser' | ||||||
| 
 | 
 | ||||||
| const pkg = require('./package.json') | const pkg = require('./package.json') | ||||||
| 
 | 
 | ||||||
| @ -31,13 +31,6 @@ export default [ | |||||||
|             sourcemap: true, |             sourcemap: true, | ||||||
|             file: pkg['minified:main'], |             file: pkg['minified:main'], | ||||||
|         }, |         }, | ||||||
|         plugins: [ |         plugins: [buble(), terser()], | ||||||
|             buble(), |  | ||||||
|             uglify({ |  | ||||||
|                 output: { |  | ||||||
|                     comments: /^!/, |  | ||||||
|                 }, |  | ||||||
|             }), |  | ||||||
|         ], |  | ||||||
|     }, |     }, | ||||||
| ] | ] | ||||||
|  | |||||||
| @ -1,9 +1,10 @@ | |||||||
| // The programming goals of Split.js are to deliver readable, understandable and
 | // The programming goals of Split.js are to deliver readable, understandable and
 | ||||||
| // maintainable code, while at the same time manually optimizing for tiny minified file size,
 | // maintainable code, while at the same time manually optimizing for tiny minified file size,
 | ||||||
| // browser compatibility without additional requirements, graceful fallback (IE8 is supported)
 | // browser compatibility without additional requirements
 | ||||||
| // and very few assumptions about the user's page layout.
 | // and very few assumptions about the user's page layout.
 | ||||||
| const global = window | const global = typeof window !== 'undefined' ? window : null | ||||||
| const { document } = global | const ssr = global === null | ||||||
|  | const document = !ssr ? global.document : undefined | ||||||
| 
 | 
 | ||||||
| // Save a couple long function names that are used frequently.
 | // Save a couple long function names that are used frequently.
 | ||||||
| // This optimization saves around 400 bytes.
 | // This optimization saves around 400 bytes.
 | ||||||
| @ -16,16 +17,14 @@ const bGutterSize = '_c' | |||||||
| const HORIZONTAL = 'horizontal' | const HORIZONTAL = 'horizontal' | ||||||
| const NOOP = () => false | const NOOP = () => false | ||||||
| 
 | 
 | ||||||
| // Figure out if we're in IE8 or not. IE8 will still render correctly,
 |  | ||||||
| // but will be static instead of draggable.
 |  | ||||||
| const isIE8 = global.attachEvent && !global[addEventListener] |  | ||||||
| 
 |  | ||||||
| // Helper function determines which prefixes of CSS calc we need.
 | // Helper function determines which prefixes of CSS calc we need.
 | ||||||
| // We only need to do this once on startup, when this anonymous function is called.
 | // We only need to do this once on startup, when this anonymous function is called.
 | ||||||
| //
 | //
 | ||||||
| // Tests -webkit, -moz and -o prefixes. Modified from StackOverflow:
 | // Tests -webkit, -moz and -o prefixes. Modified from StackOverflow:
 | ||||||
| // http://stackoverflow.com/questions/16625140/js-feature-detection-to-detect-the-usage-of-webkit-calc-over-calc/16625167#16625167
 | // http://stackoverflow.com/questions/16625140/js-feature-detection-to-detect-the-usage-of-webkit-calc-over-calc/16625167#16625167
 | ||||||
| const calc = `${['', '-webkit-', '-moz-', '-o-'] | const calc = ssr | ||||||
|  |     ? 'calc' | ||||||
|  |     : `${['', '-webkit-', '-moz-', '-o-'] | ||||||
|           .filter(prefix => { |           .filter(prefix => { | ||||||
|               const el = document.createElement('div') |               const el = document.createElement('div') | ||||||
|               el.style.cssText = `width:${prefix}calc(9px)` |               el.style.cssText = `width:${prefix}calc(9px)` | ||||||
| @ -92,11 +91,7 @@ const defaultElementStyleFn = (dim, size, gutSize) => { | |||||||
|     const style = {} |     const style = {} | ||||||
| 
 | 
 | ||||||
|     if (!isString(size)) { |     if (!isString(size)) { | ||||||
|         if (!isIE8) { |  | ||||||
|         style[dim] = `${calc}(${size}% - ${gutSize}px)` |         style[dim] = `${calc}(${size}% - ${gutSize}px)` | ||||||
|         } else { |  | ||||||
|             style[dim] = `${size}%` |  | ||||||
|         } |  | ||||||
|     } else { |     } else { | ||||||
|         style[dim] = size |         style[dim] = size | ||||||
|     } |     } | ||||||
| @ -134,6 +129,8 @@ const defaultGutterStyleFn = (dim, gutSize) => ({ [dim]: `${gutSize}px` }) | |||||||
| //    `pair` object and a gutter.
 | //    `pair` object and a gutter.
 | ||||||
| // 5. Actually size the pair elements, insert gutters and attach event listeners.
 | // 5. Actually size the pair elements, insert gutters and attach event listeners.
 | ||||||
| const Split = (idsOption, options = {}) => { | const Split = (idsOption, options = {}) => { | ||||||
|  |     if (ssr) return {} | ||||||
|  | 
 | ||||||
|     let ids = idsOption |     let ids = idsOption | ||||||
|     let dimension |     let dimension | ||||||
|     let clientAxis |     let clientAxis | ||||||
| @ -623,8 +620,6 @@ const Split = (idsOption, options = {}) => { | |||||||
|         // staticly assigning sizes without draggable gutters. Assigns a string
 |         // staticly assigning sizes without draggable gutters. Assigns a string
 | ||||||
|         // to `size`.
 |         // to `size`.
 | ||||||
|         //
 |         //
 | ||||||
|         // IE9 and above
 |  | ||||||
|         if (!isIE8) { |  | ||||||
|         // Create gutter elements for each pair.
 |         // Create gutter elements for each pair.
 | ||||||
|         if (i > 0) { |         if (i > 0) { | ||||||
|             const gutterElement = gutter(i, direction, element.element) |             const gutterElement = gutter(i, direction, element.element) | ||||||
| @ -647,7 +642,6 @@ const Split = (idsOption, options = {}) => { | |||||||
| 
 | 
 | ||||||
|             pair.gutter = gutterElement |             pair.gutter = gutterElement | ||||||
|         } |         } | ||||||
|         } |  | ||||||
| 
 | 
 | ||||||
|         setElementSize( |         setElementSize( | ||||||
|             element.element, |             element.element, | ||||||
| @ -744,13 +738,6 @@ const Split = (idsOption, options = {}) => { | |||||||
|         }) |         }) | ||||||
|     } |     } | ||||||
| 
 | 
 | ||||||
|     if (isIE8) { |  | ||||||
|         return { |  | ||||||
|             setSizes, |  | ||||||
|             destroy, |  | ||||||
|         } |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     return { |     return { | ||||||
|         setSizes, |         setSizes, | ||||||
|         getSizes, |         getSizes, | ||||||
|  | |||||||
| @ -2,14 +2,14 @@ | |||||||
| <html> | <html> | ||||||
| <head> | <head> | ||||||
|   <meta charset="utf-8"> |   <meta charset="utf-8"> | ||||||
|   <title>Jasmine Spec Runner v2.6.4</title> |   <title>Jasmine Spec Runner v3.5.0</title> | ||||||
| 
 | 
 | ||||||
|   <link rel="shortcut icon" type="image/png" href="lib/jasmine-2.6.4/jasmine_favicon.png"> |   <link rel="shortcut icon" type="image/png" href="lib/jasmine-3.5.0/jasmine_favicon.png"> | ||||||
|   <link rel="stylesheet" href="lib/jasmine-2.6.4/jasmine.css"> |   <link rel="stylesheet" href="lib/jasmine-3.5.0/jasmine.css"> | ||||||
| 
 | 
 | ||||||
|   <script src="lib/jasmine-2.6.4/jasmine.js"></script> |   <script src="lib/jasmine-3.5.0/jasmine.js"></script> | ||||||
|   <script src="lib/jasmine-2.6.4/jasmine-html.js"></script> |   <script src="lib/jasmine-3.5.0/jasmine-html.js"></script> | ||||||
|   <script src="lib/jasmine-2.6.4/boot.js"></script> |   <script src="lib/jasmine-3.5.0/boot.js"></script> | ||||||
| 
 | 
 | ||||||
|   <script src="../dist/split.js"></script> |   <script src="../dist/split.js"></script> | ||||||
|   <script src="split.spec.js"></script> |   <script src="split.spec.js"></script> | ||||||
|  | |||||||
| @ -1,43 +0,0 @@ | |||||||
| { |  | ||||||
|     "exit_with_fail": true, |  | ||||||
|     "test_framework": "jasmine2", |  | ||||||
|     "test_path": "test/SpecRunner.html", |  | ||||||
|     "browsers": [ |  | ||||||
|         { |  | ||||||
|             "browser": "chrome", |  | ||||||
|             "browser_version": "22", |  | ||||||
|             "os": "OS X", |  | ||||||
|             "os_version": "Mountain Lion" |  | ||||||
|         }, |  | ||||||
|         { |  | ||||||
|             "browser": "firefox", |  | ||||||
|             "browser_version": "6", |  | ||||||
|             "os": "OS X", |  | ||||||
|             "os_version": "Mountain Lion" |  | ||||||
|         }, |  | ||||||
|         { |  | ||||||
|             "browser": "ie", |  | ||||||
|             "browser_version": "10", |  | ||||||
|             "os": "Windows", |  | ||||||
|             "os_version": "7" |  | ||||||
|         }, |  | ||||||
|         { |  | ||||||
|             "browser": "ie", |  | ||||||
|             "browser_version": "11", |  | ||||||
|             "os": "Windows", |  | ||||||
|             "os_version": "7" |  | ||||||
|         }, |  | ||||||
|         { |  | ||||||
|             "browser": "opera", |  | ||||||
|             "browser_version": "16", |  | ||||||
|             "os": "OS X", |  | ||||||
|             "os_version": "Mountain Lion" |  | ||||||
|         }, |  | ||||||
|         { |  | ||||||
|             "browser": "safari", |  | ||||||
|             "browser_version": "6.2", |  | ||||||
|             "os": "OS X", |  | ||||||
|             "os_version": "Mountain Lion" |  | ||||||
|         } |  | ||||||
|     ] |  | ||||||
| } |  | ||||||
| @ -1,21 +0,0 @@ | |||||||
| <!DOCTYPE html> |  | ||||||
| <html> |  | ||||||
| <head> |  | ||||||
|   <meta charset="utf-8"> |  | ||||||
|   <title>Jasmine Spec Runner v2.6.4</title> |  | ||||||
| 
 |  | ||||||
|   <link rel="shortcut icon" type="image/png" href="../lib/jasmine-2.6.4/jasmine_favicon.png"> |  | ||||||
|   <link rel="stylesheet" href="../lib/jasmine-2.6.4/jasmine.css"> |  | ||||||
| 
 |  | ||||||
|   <script src="../lib/jasmine-2.6.4/jasmine.js"></script> |  | ||||||
|   <script src="../lib/jasmine-2.6.4/jasmine-html.js"></script> |  | ||||||
|   <script src="../lib/jasmine-2.6.4/boot.js"></script> |  | ||||||
| 
 |  | ||||||
|   <script src="polyfills.js"></script> |  | ||||||
|   <script src="../../dist/split.js"></script> |  | ||||||
|   <script src="split.spec.js"></script> |  | ||||||
| </head> |  | ||||||
| 
 |  | ||||||
| <body> |  | ||||||
| </body> |  | ||||||
| </html> |  | ||||||
| @ -1,13 +0,0 @@ | |||||||
| { |  | ||||||
|     "exit_with_fail": true, |  | ||||||
|     "test_framework": "jasmine2", |  | ||||||
|     "test_path": "test/ie8/SpecRunner.html", |  | ||||||
|     "browsers": [ |  | ||||||
|         { |  | ||||||
|             "browser": "ie", |  | ||||||
|             "browser_version": "8", |  | ||||||
|             "os": "Windows", |  | ||||||
|             "os_version": "7" |  | ||||||
|         } |  | ||||||
|     ] |  | ||||||
| } |  | ||||||
| @ -1,342 +0,0 @@ | |||||||
| /* Polyfill service v3.18.1 |  | ||||||
|  * For detailed credits and licence information see https://github.com/financial-times/polyfill-service.
 |  | ||||||
|  *  |  | ||||||
|  * UA detected: firefox/53.0.0 |  | ||||||
|  * Features requested: Array.isArray,Array.prototype.filter,Array.prototype.forEach,Array.prototype.map,Object.keys,getComputedStyle |  | ||||||
|  *  |  | ||||||
|  * - Object.defineProperty, License: CC0 (required by "Array.isArray") |  | ||||||
|  * - Array.isArray, License: CC0 |  | ||||||
|  * - Array.prototype.filter, License: CC0 |  | ||||||
|  * - Array.prototype.forEach, License: CC0 |  | ||||||
|  * - Array.prototype.map, License: CC0 |  | ||||||
|  * - Object.keys, License: CC0 |  | ||||||
|  * - Window, License: CC0 (required by "getComputedStyle") |  | ||||||
|  * - getComputedStyle, License: CC0 */ |  | ||||||
| 
 |  | ||||||
| (function(undefined) { |  | ||||||
| 
 |  | ||||||
| // Object.defineProperty
 |  | ||||||
| (function (nativeDefineProperty) { |  | ||||||
| 
 |  | ||||||
| 	var supportsAccessors = Object.prototype.hasOwnProperty('__defineGetter__'); |  | ||||||
| 	var ERR_ACCESSORS_NOT_SUPPORTED = 'Getters & setters cannot be defined on this javascript engine'; |  | ||||||
| 	var ERR_VALUE_ACCESSORS = 'A property cannot both have accessors and be writable or have a value'; |  | ||||||
| 
 |  | ||||||
| 	Object.defineProperty = function defineProperty(object, property, descriptor) { |  | ||||||
| 
 |  | ||||||
| 		// Where native support exists, assume it
 |  | ||||||
| 		if (nativeDefineProperty && (object === window || object === document || object === Element.prototype || object instanceof Element)) { |  | ||||||
| 			return nativeDefineProperty(object, property, descriptor); |  | ||||||
| 		} |  | ||||||
| 
 |  | ||||||
| 		if (object === null || !(object instanceof Object || typeof object === 'object')) { |  | ||||||
| 			throw new TypeError('Object.defineProperty called on non-object'); |  | ||||||
| 		} |  | ||||||
| 
 |  | ||||||
| 		if (!(descriptor instanceof Object)) { |  | ||||||
| 			throw new TypeError('Property description must be an object'); |  | ||||||
| 		} |  | ||||||
| 
 |  | ||||||
| 		var propertyString = String(property); |  | ||||||
| 		var hasValueOrWritable = 'value' in descriptor || 'writable' in descriptor; |  | ||||||
| 		var getterType = 'get' in descriptor && typeof descriptor.get; |  | ||||||
| 		var setterType = 'set' in descriptor && typeof descriptor.set; |  | ||||||
| 
 |  | ||||||
| 		// handle descriptor.get
 |  | ||||||
| 		if (getterType) { |  | ||||||
| 			if (getterType !== 'function') { |  | ||||||
| 				throw new TypeError('Getter must be a function'); |  | ||||||
| 			} |  | ||||||
| 			if (!supportsAccessors) { |  | ||||||
| 				throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED); |  | ||||||
| 			} |  | ||||||
| 			if (hasValueOrWritable) { |  | ||||||
| 				throw new TypeError(ERR_VALUE_ACCESSORS); |  | ||||||
| 			} |  | ||||||
| 			object.__defineGetter__(propertyString, descriptor.get); |  | ||||||
| 		} else { |  | ||||||
| 			object[propertyString] = descriptor.value; |  | ||||||
| 		} |  | ||||||
| 
 |  | ||||||
| 		// handle descriptor.set
 |  | ||||||
| 		if (setterType) { |  | ||||||
| 			if (setterType !== 'function') { |  | ||||||
| 				throw new TypeError('Setter must be a function'); |  | ||||||
| 			} |  | ||||||
| 			if (!supportsAccessors) { |  | ||||||
| 				throw new TypeError(ERR_ACCESSORS_NOT_SUPPORTED); |  | ||||||
| 			} |  | ||||||
| 			if (hasValueOrWritable) { |  | ||||||
| 				throw new TypeError(ERR_VALUE_ACCESSORS); |  | ||||||
| 			} |  | ||||||
| 			object.__defineSetter__(propertyString, descriptor.set); |  | ||||||
| 		} |  | ||||||
| 
 |  | ||||||
| 		// OK to define value unconditionally - if a getter has been specified as well, an error would be thrown above
 |  | ||||||
| 		if ('value' in descriptor) { |  | ||||||
| 			object[propertyString] = descriptor.value; |  | ||||||
| 		} |  | ||||||
| 
 |  | ||||||
| 		return object; |  | ||||||
| 	}; |  | ||||||
| }(Object.defineProperty)); |  | ||||||
| 
 |  | ||||||
| // Array.isArray
 |  | ||||||
| (function (toString) { |  | ||||||
| 	Object.defineProperty(Array, 'isArray', { |  | ||||||
| 		configurable: true, |  | ||||||
| 		value: function isArray(object) { |  | ||||||
| 			return toString.call(object) === '[object Array]'; |  | ||||||
| 		}, |  | ||||||
| 		writable: true |  | ||||||
| 	}); |  | ||||||
| }(Object.prototype.toString)); |  | ||||||
| 
 |  | ||||||
| // Array.prototype.filter
 |  | ||||||
| Array.prototype.filter = function filter(callback) { |  | ||||||
| 	if (this === undefined || this === null) { |  | ||||||
| 		throw new TypeError(this + ' is not an object'); |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	if (!(callback instanceof Function)) { |  | ||||||
| 		throw new TypeError(callback + ' is not a function'); |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	var |  | ||||||
| 	object = Object(this), |  | ||||||
| 	scope = arguments[1], |  | ||||||
| 	arraylike = object instanceof String ? object.split('') : object, |  | ||||||
| 	length = Math.max(Math.min(arraylike.length, 9007199254740991), 0) || 0, |  | ||||||
| 	index = -1, |  | ||||||
| 	result = [], |  | ||||||
| 	element; |  | ||||||
| 
 |  | ||||||
| 	while (++index < length) { |  | ||||||
| 		element = arraylike[index]; |  | ||||||
| 
 |  | ||||||
| 		if (index in arraylike && callback.call(scope, element, index, object)) { |  | ||||||
| 			result.push(element); |  | ||||||
| 		} |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	return result; |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| // Array.prototype.forEach
 |  | ||||||
| Array.prototype.forEach = function forEach(callback) { |  | ||||||
| 	if (this === undefined || this === null) { |  | ||||||
| 		throw new TypeError(this + ' is not an object'); |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	if (!(callback instanceof Function)) { |  | ||||||
| 		throw new TypeError(callback + ' is not a function'); |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	var |  | ||||||
| 	object = Object(this), |  | ||||||
| 	scope = arguments[1], |  | ||||||
| 	arraylike = object instanceof String ? object.split('') : object, |  | ||||||
| 	length = Math.max(Math.min(arraylike.length, 9007199254740991), 0) || 0, |  | ||||||
| 	index = -1; |  | ||||||
| 
 |  | ||||||
| 	while (++index < length) { |  | ||||||
| 		if (index in arraylike) { |  | ||||||
| 			callback.call(scope, arraylike[index], index, object); |  | ||||||
| 		} |  | ||||||
| 	} |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| // Array.prototype.map
 |  | ||||||
| Array.prototype.map = function map(callback) { |  | ||||||
| 	if (this === undefined || this === null) { |  | ||||||
| 		throw new TypeError(this + ' is not an object'); |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	if (!(callback instanceof Function)) { |  | ||||||
| 		throw new TypeError(callback + ' is not a function'); |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	var |  | ||||||
| 	object = Object(this), |  | ||||||
| 	scope = arguments[1], |  | ||||||
| 	arraylike = object instanceof String ? object.split('') : object, |  | ||||||
| 	length = Math.max(Math.min(arraylike.length, 9007199254740991), 0) || 0, |  | ||||||
| 	index = -1, |  | ||||||
| 	result = []; |  | ||||||
| 
 |  | ||||||
| 	while (++index < length) { |  | ||||||
| 		if (index in arraylike) { |  | ||||||
| 			result[index] = callback.call(scope, arraylike[index], index, object); |  | ||||||
| 		} |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	return result; |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| // Object.keys
 |  | ||||||
| Object.keys = (function() { |  | ||||||
| 	'use strict'; |  | ||||||
| 	var hasOwnProperty = Object.prototype.hasOwnProperty, |  | ||||||
| 	hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString'), |  | ||||||
| 	dontEnums = [ |  | ||||||
| 		'toString', |  | ||||||
| 		'toLocaleString', |  | ||||||
| 		'valueOf', |  | ||||||
| 		'hasOwnProperty', |  | ||||||
| 		'isPrototypeOf', |  | ||||||
| 		'propertyIsEnumerable', |  | ||||||
| 		'constructor' |  | ||||||
| 	], |  | ||||||
| 	dontEnumsLength = dontEnums.length; |  | ||||||
| 
 |  | ||||||
| 	return function(obj) { |  | ||||||
| 		if (typeof obj !== 'object' && (typeof obj !== 'function' || obj === null)) { |  | ||||||
| 			throw new TypeError('Object.keys called on non-object'); |  | ||||||
| 		} |  | ||||||
| 
 |  | ||||||
| 		var result = [], prop, i; |  | ||||||
| 
 |  | ||||||
| 		for (prop in obj) { |  | ||||||
| 			if (hasOwnProperty.call(obj, prop)) { |  | ||||||
| 				result.push(prop); |  | ||||||
| 			} |  | ||||||
| 		} |  | ||||||
| 
 |  | ||||||
| 		if (hasDontEnumBug) { |  | ||||||
| 			for (i = 0; i < dontEnumsLength; i++) { |  | ||||||
| 				if (hasOwnProperty.call(obj, dontEnums[i])) { |  | ||||||
| 					result.push(dontEnums[i]); |  | ||||||
| 				} |  | ||||||
| 			} |  | ||||||
| 		} |  | ||||||
| 		return result; |  | ||||||
| 	}; |  | ||||||
| }()); |  | ||||||
| 
 |  | ||||||
| // Window
 |  | ||||||
| (function(global) { |  | ||||||
| 	if (global.constructor) { |  | ||||||
| 		global.Window = global.constructor; |  | ||||||
| 	} else { |  | ||||||
| 		(global.Window = global.constructor = new Function('return function Window() {}')()).prototype = this; |  | ||||||
| 	} |  | ||||||
| }(this)); |  | ||||||
| 
 |  | ||||||
| // getComputedStyle
 |  | ||||||
| (function (global) { |  | ||||||
| 	function getComputedStylePixel(element, property, fontSize) { |  | ||||||
| 		var |  | ||||||
| 		// Internet Explorer sometimes struggles to read currentStyle until the element's document is accessed.
 |  | ||||||
| 		value = element.document && element.currentStyle[property].match(/([\d\.]+)(%|cm|em|in|mm|pc|pt|)/) || [0, 0, ''], |  | ||||||
| 		size = value[1], |  | ||||||
| 		suffix = value[2], |  | ||||||
| 		rootSize; |  | ||||||
| 
 |  | ||||||
| 		fontSize = !fontSize ? fontSize : /%|em/.test(suffix) && element.parentElement ? getComputedStylePixel(element.parentElement, 'fontSize', null) : 16; |  | ||||||
| 		rootSize = property == 'fontSize' ? fontSize : /width/i.test(property) ? element.clientWidth : element.clientHeight; |  | ||||||
| 
 |  | ||||||
| 		return suffix == '%' ? size / 100 * rootSize : |  | ||||||
| 		       suffix == 'cm' ? size * 0.3937 * 96 : |  | ||||||
| 		       suffix == 'em' ? size * fontSize : |  | ||||||
| 		       suffix == 'in' ? size * 96 : |  | ||||||
| 		       suffix == 'mm' ? size * 0.3937 * 96 / 10 : |  | ||||||
| 		       suffix == 'pc' ? size * 12 * 96 / 72 : |  | ||||||
| 		       suffix == 'pt' ? size * 96 / 72 : |  | ||||||
| 		       size; |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	function setShortStyleProperty(style, property) { |  | ||||||
| 		var |  | ||||||
| 		borderSuffix = property == 'border' ? 'Width' : '', |  | ||||||
| 		t = property + 'Top' + borderSuffix, |  | ||||||
| 		r = property + 'Right' + borderSuffix, |  | ||||||
| 		b = property + 'Bottom' + borderSuffix, |  | ||||||
| 		l = property + 'Left' + borderSuffix; |  | ||||||
| 
 |  | ||||||
| 		style[property] = (style[t] == style[r] && style[t] == style[b] && style[t] == style[l] ? [ style[t] ] : |  | ||||||
| 		                   style[t] == style[b] && style[l] == style[r] ? [ style[t], style[r] ] : |  | ||||||
| 		                   style[l] == style[r] ? [ style[t], style[r], style[b] ] : |  | ||||||
| 		                   [ style[t], style[r], style[b], style[l] ]).join(' '); |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	// <CSSStyleDeclaration>
 |  | ||||||
| 	function CSSStyleDeclaration(element) { |  | ||||||
| 		var |  | ||||||
| 		style = this, |  | ||||||
| 		currentStyle = element.currentStyle, |  | ||||||
| 		fontSize = getComputedStylePixel(element, 'fontSize'), |  | ||||||
| 		unCamelCase = function (match) { |  | ||||||
| 			return '-' + match.toLowerCase(); |  | ||||||
| 		}, |  | ||||||
| 		property; |  | ||||||
| 
 |  | ||||||
| 		for (property in currentStyle) { |  | ||||||
| 			Array.prototype.push.call(style, property == 'styleFloat' ? 'float' : property.replace(/[A-Z]/, unCamelCase)); |  | ||||||
| 
 |  | ||||||
| 			if (property == 'width') { |  | ||||||
| 				style[property] = element.offsetWidth + 'px'; |  | ||||||
| 			} else if (property == 'height') { |  | ||||||
| 				style[property] = element.offsetHeight + 'px'; |  | ||||||
| 			} else if (property == 'styleFloat') { |  | ||||||
| 				style.float = currentStyle[property]; |  | ||||||
| 			} else if (/margin.|padding.|border.+W/.test(property) && style[property] != 'auto') { |  | ||||||
| 				style[property] = Math.round(getComputedStylePixel(element, property, fontSize)) + 'px'; |  | ||||||
| 			} else if (/^outline/.test(property)) { |  | ||||||
| 				// errors on checking outline
 |  | ||||||
| 				try { |  | ||||||
| 					style[property] = currentStyle[property]; |  | ||||||
| 				} catch (error) { |  | ||||||
| 					style.outlineColor = currentStyle.color; |  | ||||||
| 					style.outlineStyle = style.outlineStyle || 'none'; |  | ||||||
| 					style.outlineWidth = style.outlineWidth || '0px'; |  | ||||||
| 					style.outline = [style.outlineColor, style.outlineWidth, style.outlineStyle].join(' '); |  | ||||||
| 				} |  | ||||||
| 			} else { |  | ||||||
| 				style[property] = currentStyle[property]; |  | ||||||
| 			} |  | ||||||
| 		} |  | ||||||
| 
 |  | ||||||
| 		setShortStyleProperty(style, 'margin'); |  | ||||||
| 		setShortStyleProperty(style, 'padding'); |  | ||||||
| 		setShortStyleProperty(style, 'border'); |  | ||||||
| 
 |  | ||||||
| 		style.fontSize = Math.round(fontSize) + 'px'; |  | ||||||
| 	} |  | ||||||
| 
 |  | ||||||
| 	CSSStyleDeclaration.prototype = { |  | ||||||
| 		constructor: CSSStyleDeclaration, |  | ||||||
| 		// <CSSStyleDeclaration>.getPropertyPriority
 |  | ||||||
| 		getPropertyPriority: function () { |  | ||||||
| 			throw new Error('NotSupportedError: DOM Exception 9'); |  | ||||||
| 		}, |  | ||||||
| 		// <CSSStyleDeclaration>.getPropertyValue
 |  | ||||||
| 		getPropertyValue: function (property) { |  | ||||||
| 			return this[property.replace(/-\w/g, function (match) { |  | ||||||
| 				return match[1].toUpperCase(); |  | ||||||
| 			})]; |  | ||||||
| 		}, |  | ||||||
| 		// <CSSStyleDeclaration>.item
 |  | ||||||
| 		item: function (index) { |  | ||||||
| 			return this[index]; |  | ||||||
| 		}, |  | ||||||
| 		// <CSSStyleDeclaration>.removeProperty
 |  | ||||||
| 		removeProperty: function () { |  | ||||||
| 			throw new Error('NoModificationAllowedError: DOM Exception 7'); |  | ||||||
| 		}, |  | ||||||
| 		// <CSSStyleDeclaration>.setProperty
 |  | ||||||
| 		setProperty: function () { |  | ||||||
| 			throw new Error('NoModificationAllowedError: DOM Exception 7'); |  | ||||||
| 		}, |  | ||||||
| 		// <CSSStyleDeclaration>.getPropertyCSSValue
 |  | ||||||
| 		getPropertyCSSValue: function () { |  | ||||||
| 			throw new Error('NotSupportedError: DOM Exception 9'); |  | ||||||
| 		} |  | ||||||
| 	}; |  | ||||||
| 
 |  | ||||||
| 	// <Global>.getComputedStyle
 |  | ||||||
| 	global.getComputedStyle = function getComputedStyle(element) { |  | ||||||
| 		return new CSSStyleDeclaration(element); |  | ||||||
| 	}; |  | ||||||
| }(this)); |  | ||||||
| }) |  | ||||||
| .call('object' === typeof window && window || 'object' === typeof self && self || 'object' === typeof global && global || {}); |  | ||||||
| @ -1,141 +0,0 @@ | |||||||
| /* eslint-env jasmine */ |  | ||||||
| /* global Split */ |  | ||||||
| /* eslint-disable no-var, func-names, prefer-arrow-callback, object-shorthand, prefer-template */ |  | ||||||
| 
 |  | ||||||
| describe('Split', function() { |  | ||||||
|     beforeEach(function() { |  | ||||||
|         document.body.style.width = '800px' |  | ||||||
|         document.body.style.height = '600px' |  | ||||||
| 
 |  | ||||||
|         this.a = document.createElement('div') |  | ||||||
|         this.b = document.createElement('div') |  | ||||||
|         this.c = document.createElement('div') |  | ||||||
| 
 |  | ||||||
|         this.a.id = 'a' |  | ||||||
|         this.b.id = 'b' |  | ||||||
|         this.c.id = 'c' |  | ||||||
| 
 |  | ||||||
|         document.body.appendChild(this.a) |  | ||||||
|         document.body.appendChild(this.b) |  | ||||||
|         document.body.appendChild(this.c) |  | ||||||
|     }) |  | ||||||
| 
 |  | ||||||
|     afterEach(function() { |  | ||||||
|         document.body.removeChild(this.a) |  | ||||||
|         document.body.removeChild(this.b) |  | ||||||
|         document.body.removeChild(this.c) |  | ||||||
|     }) |  | ||||||
| 
 |  | ||||||
|     it('splits in two when given two elements', function() { |  | ||||||
|         Split(['#a', '#b']) |  | ||||||
| 
 |  | ||||||
|         expect(this.a.style.width).toBe('50%') |  | ||||||
|         expect(this.b.style.width).toBe('50%') |  | ||||||
|     }) |  | ||||||
| 
 |  | ||||||
|     it('splits in three when given three elements', function() { |  | ||||||
|         Split(['#a', '#b', '#c']) |  | ||||||
| 
 |  | ||||||
|         expect(this.a.style.width).toBe('33.33%') |  | ||||||
|         expect(this.b.style.width).toBe('33.33%') |  | ||||||
|         expect(this.c.style.width).toBe('33.33%') |  | ||||||
|     }) |  | ||||||
| 
 |  | ||||||
|     it('splits vertically when direction is vertical', function() { |  | ||||||
|         Split(['#a', '#b'], { |  | ||||||
|             direction: 'vertical', |  | ||||||
|         }) |  | ||||||
| 
 |  | ||||||
|         expect(this.a.style.height).toBe('50%') |  | ||||||
|         expect(this.b.style.height).toBe('50%') |  | ||||||
|     }) |  | ||||||
| 
 |  | ||||||
|     it('splits in percentages when given sizes', function() { |  | ||||||
|         Split(['#a', '#b'], { |  | ||||||
|             sizes: [25, 75], |  | ||||||
|         }) |  | ||||||
| 
 |  | ||||||
|         expect(this.a.style.width).toBe('25%') |  | ||||||
|         expect(this.b.style.width).toBe('75%') |  | ||||||
|     }) |  | ||||||
| 
 |  | ||||||
|     it('splits in percentages when given sizes', function() { |  | ||||||
|         Split(['#a', '#b'], { |  | ||||||
|             sizes: [25, 75], |  | ||||||
|         }) |  | ||||||
| 
 |  | ||||||
|         expect(this.a.style.width).toBe('25%') |  | ||||||
|         expect(this.b.style.width).toBe('75%') |  | ||||||
|     }) |  | ||||||
| 
 |  | ||||||
|     it('accounts for gutter size', function() { |  | ||||||
|         Split(['#a', '#b'], { |  | ||||||
|             gutterSize: 20, |  | ||||||
|         }) |  | ||||||
| 
 |  | ||||||
|         expect(this.a.style.width).toBe('50%') |  | ||||||
|         expect(this.b.style.width).toBe('50%') |  | ||||||
|     }) |  | ||||||
| 
 |  | ||||||
|     it('accounts for gutter size with more than two elements', function() { |  | ||||||
|         Split(['#a', '#b', '#c'], { |  | ||||||
|             gutterSize: 20, |  | ||||||
|         }) |  | ||||||
| 
 |  | ||||||
|         expect(this.a.style.width).toBe('33.33%') |  | ||||||
|         expect(this.b.style.width).toBe('33.33%') |  | ||||||
|         expect(this.c.style.width).toBe('33.33%') |  | ||||||
|     }) |  | ||||||
| 
 |  | ||||||
|     it('accounts for gutter size when direction is vertical', function() { |  | ||||||
|         Split(['#a', '#b'], { |  | ||||||
|             direction: 'vertical', |  | ||||||
|             gutterSize: 20, |  | ||||||
|         }) |  | ||||||
| 
 |  | ||||||
|         expect(this.a.style.height).toBe('50%') |  | ||||||
|         expect(this.b.style.height).toBe('50%') |  | ||||||
|     }) |  | ||||||
| 
 |  | ||||||
|     it('accounts for gutter size with more than two elements when direction is vertical', function() { |  | ||||||
|         Split(['#a', '#b', '#c'], { |  | ||||||
|             direction: 'vertical', |  | ||||||
|             gutterSize: 20, |  | ||||||
|         }) |  | ||||||
| 
 |  | ||||||
|         expect(this.a.style.height).toBe('33.33%') |  | ||||||
|         expect(this.b.style.height).toBe('33.33%') |  | ||||||
|         expect(this.c.style.height).toBe('33.33%') |  | ||||||
|     }) |  | ||||||
| 
 |  | ||||||
|     it('set size directly when given css values', function() { |  | ||||||
|         Split(['#a', '#b'], { |  | ||||||
|             sizes: ['150px', '640px'], |  | ||||||
|         }) |  | ||||||
| 
 |  | ||||||
|         expect(this.a.style.width).toBe('150px') |  | ||||||
|         expect(this.b.style.width).toBe('640px') |  | ||||||
|     }) |  | ||||||
| 
 |  | ||||||
|     it('adjusts sizes using setSizes', function() { |  | ||||||
|         var split = Split(['#a', '#b']) |  | ||||||
| 
 |  | ||||||
|         split.setSizes([70, 30]) |  | ||||||
| 
 |  | ||||||
|         expect(this.a.style.width).toBe('70%') |  | ||||||
|         expect(this.b.style.width).toBe('30%') |  | ||||||
|     }) |  | ||||||
| 
 |  | ||||||
|     it('sets element styles using the elementStyle function', function() { |  | ||||||
|         Split(['#a', '#b'], { |  | ||||||
|             elementStyle: function(dimension, size) { |  | ||||||
|                 return { |  | ||||||
|                     width: size + '%', |  | ||||||
|                 } |  | ||||||
|             }, |  | ||||||
|         }) |  | ||||||
| 
 |  | ||||||
|         expect(this.a.style.width).toBe('50%') |  | ||||||
|         expect(this.b.style.width).toBe('50%') |  | ||||||
|     }) |  | ||||||
| }) |  | ||||||
							
								
								
									
										190
									
								
								packages/splitjs/test/lib/jasmine-2.6.4/console.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										190
									
								
								packages/splitjs/test/lib/jasmine-2.6.4/console.js
									
									
									
									
										vendored
									
									
								
							| @ -1,190 +0,0 @@ | |||||||
| /* |  | ||||||
| Copyright (c) 2008-2017 Pivotal Labs |  | ||||||
| 
 |  | ||||||
| Permission is hereby granted, free of charge, to any person obtaining |  | ||||||
| a copy of this software and associated documentation files (the |  | ||||||
| "Software"), to deal in the Software without restriction, including |  | ||||||
| without limitation the rights to use, copy, modify, merge, publish, |  | ||||||
| distribute, sublicense, and/or sell copies of the Software, and to |  | ||||||
| permit persons to whom the Software is furnished to do so, subject to |  | ||||||
| the following conditions: |  | ||||||
| 
 |  | ||||||
| The above copyright notice and this permission notice shall be |  | ||||||
| included in all copies or substantial portions of the Software. |  | ||||||
| 
 |  | ||||||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |  | ||||||
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |  | ||||||
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |  | ||||||
| NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |  | ||||||
| LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |  | ||||||
| OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |  | ||||||
| WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |  | ||||||
| */ |  | ||||||
| function getJasmineRequireObj() { |  | ||||||
|   if (typeof module !== 'undefined' && module.exports) { |  | ||||||
|     return exports; |  | ||||||
|   } else { |  | ||||||
|     window.jasmineRequire = window.jasmineRequire || {}; |  | ||||||
|     return window.jasmineRequire; |  | ||||||
|   } |  | ||||||
| } |  | ||||||
| 
 |  | ||||||
| getJasmineRequireObj().console = function(jRequire, j$) { |  | ||||||
|   j$.ConsoleReporter = jRequire.ConsoleReporter(); |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| getJasmineRequireObj().ConsoleReporter = function() { |  | ||||||
| 
 |  | ||||||
|   var noopTimer = { |  | ||||||
|     start: function(){}, |  | ||||||
|     elapsed: function(){ return 0; } |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   function ConsoleReporter(options) { |  | ||||||
|     var print = options.print, |  | ||||||
|       showColors = options.showColors || false, |  | ||||||
|       onComplete = options.onComplete || function() {}, |  | ||||||
|       timer = options.timer || noopTimer, |  | ||||||
|       specCount, |  | ||||||
|       failureCount, |  | ||||||
|       failedSpecs = [], |  | ||||||
|       pendingCount, |  | ||||||
|       ansi = { |  | ||||||
|         green: '\x1B[32m', |  | ||||||
|         red: '\x1B[31m', |  | ||||||
|         yellow: '\x1B[33m', |  | ||||||
|         none: '\x1B[0m' |  | ||||||
|       }, |  | ||||||
|       failedSuites = []; |  | ||||||
| 
 |  | ||||||
|     print('ConsoleReporter is deprecated and will be removed in a future version.'); |  | ||||||
| 
 |  | ||||||
|     this.jasmineStarted = function() { |  | ||||||
|       specCount = 0; |  | ||||||
|       failureCount = 0; |  | ||||||
|       pendingCount = 0; |  | ||||||
|       print('Started'); |  | ||||||
|       printNewline(); |  | ||||||
|       timer.start(); |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     this.jasmineDone = function() { |  | ||||||
|       printNewline(); |  | ||||||
|       for (var i = 0; i < failedSpecs.length; i++) { |  | ||||||
|         specFailureDetails(failedSpecs[i]); |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       if(specCount > 0) { |  | ||||||
|         printNewline(); |  | ||||||
| 
 |  | ||||||
|         var specCounts = specCount + ' ' + plural('spec', specCount) + ', ' + |  | ||||||
|           failureCount + ' ' + plural('failure', failureCount); |  | ||||||
| 
 |  | ||||||
|         if (pendingCount) { |  | ||||||
|           specCounts += ', ' + pendingCount + ' pending ' + plural('spec', pendingCount); |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         print(specCounts); |  | ||||||
|       } else { |  | ||||||
|         print('No specs found'); |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       printNewline(); |  | ||||||
|       var seconds = timer.elapsed() / 1000; |  | ||||||
|       print('Finished in ' + seconds + ' ' + plural('second', seconds)); |  | ||||||
|       printNewline(); |  | ||||||
| 
 |  | ||||||
|       for(i = 0; i < failedSuites.length; i++) { |  | ||||||
|         suiteFailureDetails(failedSuites[i]); |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       onComplete(failureCount === 0); |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     this.specDone = function(result) { |  | ||||||
|       specCount++; |  | ||||||
| 
 |  | ||||||
|       if (result.status == 'pending') { |  | ||||||
|         pendingCount++; |  | ||||||
|         print(colored('yellow', '*')); |  | ||||||
|         return; |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       if (result.status == 'passed') { |  | ||||||
|         print(colored('green', '.')); |  | ||||||
|         return; |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       if (result.status == 'failed') { |  | ||||||
|         failureCount++; |  | ||||||
|         failedSpecs.push(result); |  | ||||||
|         print(colored('red', 'F')); |  | ||||||
|       } |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     this.suiteDone = function(result) { |  | ||||||
|       if (result.failedExpectations && result.failedExpectations.length > 0) { |  | ||||||
|         failureCount++; |  | ||||||
|         failedSuites.push(result); |  | ||||||
|       } |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     return this; |  | ||||||
| 
 |  | ||||||
|     function printNewline() { |  | ||||||
|       print('\n'); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     function colored(color, str) { |  | ||||||
|       return showColors ? (ansi[color] + str + ansi.none) : str; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     function plural(str, count) { |  | ||||||
|       return count == 1 ? str : str + 's'; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     function repeat(thing, times) { |  | ||||||
|       var arr = []; |  | ||||||
|       for (var i = 0; i < times; i++) { |  | ||||||
|         arr.push(thing); |  | ||||||
|       } |  | ||||||
|       return arr; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     function indent(str, spaces) { |  | ||||||
|       var lines = (str || '').split('\n'); |  | ||||||
|       var newArr = []; |  | ||||||
|       for (var i = 0; i < lines.length; i++) { |  | ||||||
|         newArr.push(repeat(' ', spaces).join('') + lines[i]); |  | ||||||
|       } |  | ||||||
|       return newArr.join('\n'); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     function specFailureDetails(result) { |  | ||||||
|       printNewline(); |  | ||||||
|       print(result.fullName); |  | ||||||
| 
 |  | ||||||
|       for (var i = 0; i < result.failedExpectations.length; i++) { |  | ||||||
|         var failedExpectation = result.failedExpectations[i]; |  | ||||||
|         printNewline(); |  | ||||||
|         print(indent(failedExpectation.message, 2)); |  | ||||||
|         print(indent(failedExpectation.stack, 2)); |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       printNewline(); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     function suiteFailureDetails(result) { |  | ||||||
|       for (var i = 0; i < result.failedExpectations.length; i++) { |  | ||||||
|         printNewline(); |  | ||||||
|         print(colored('red', 'An error was thrown in an afterAll')); |  | ||||||
|         printNewline(); |  | ||||||
|         print(colored('red', 'AfterAll ' + result.failedExpectations[i].message)); |  | ||||||
| 
 |  | ||||||
|       } |  | ||||||
|       printNewline(); |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   return ConsoleReporter; |  | ||||||
| }; |  | ||||||
| @ -1,499 +0,0 @@ | |||||||
| /* |  | ||||||
| Copyright (c) 2008-2017 Pivotal Labs |  | ||||||
| 
 |  | ||||||
| Permission is hereby granted, free of charge, to any person obtaining |  | ||||||
| a copy of this software and associated documentation files (the |  | ||||||
| "Software"), to deal in the Software without restriction, including |  | ||||||
| without limitation the rights to use, copy, modify, merge, publish, |  | ||||||
| distribute, sublicense, and/or sell copies of the Software, and to |  | ||||||
| permit persons to whom the Software is furnished to do so, subject to |  | ||||||
| the following conditions: |  | ||||||
| 
 |  | ||||||
| The above copyright notice and this permission notice shall be |  | ||||||
| included in all copies or substantial portions of the Software. |  | ||||||
| 
 |  | ||||||
| THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, |  | ||||||
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF |  | ||||||
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND |  | ||||||
| NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE |  | ||||||
| LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION |  | ||||||
| OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION |  | ||||||
| WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |  | ||||||
| */ |  | ||||||
| jasmineRequire.html = function(j$) { |  | ||||||
|   j$.ResultsNode = jasmineRequire.ResultsNode(); |  | ||||||
|   j$.HtmlReporter = jasmineRequire.HtmlReporter(j$); |  | ||||||
|   j$.QueryString = jasmineRequire.QueryString(); |  | ||||||
|   j$.HtmlSpecFilter = jasmineRequire.HtmlSpecFilter(); |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| jasmineRequire.HtmlReporter = function(j$) { |  | ||||||
| 
 |  | ||||||
|   var noopTimer = { |  | ||||||
|     start: function() {}, |  | ||||||
|     elapsed: function() { return 0; } |  | ||||||
|   }; |  | ||||||
| 
 |  | ||||||
|   function HtmlReporter(options) { |  | ||||||
|     var env = options.env || {}, |  | ||||||
|       getContainer = options.getContainer, |  | ||||||
|       createElement = options.createElement, |  | ||||||
|       createTextNode = options.createTextNode, |  | ||||||
|       onRaiseExceptionsClick = options.onRaiseExceptionsClick || function() {}, |  | ||||||
|       onThrowExpectationsClick = options.onThrowExpectationsClick || function() {}, |  | ||||||
|       onRandomClick = options.onRandomClick || function() {}, |  | ||||||
|       addToExistingQueryString = options.addToExistingQueryString || defaultQueryString, |  | ||||||
|       filterSpecs = options.filterSpecs, |  | ||||||
|       timer = options.timer || noopTimer, |  | ||||||
|       results = [], |  | ||||||
|       specsExecuted = 0, |  | ||||||
|       failureCount = 0, |  | ||||||
|       pendingSpecCount = 0, |  | ||||||
|       htmlReporterMain, |  | ||||||
|       symbols, |  | ||||||
|       failedSuites = []; |  | ||||||
| 
 |  | ||||||
|     this.initialize = function() { |  | ||||||
|       clearPrior(); |  | ||||||
|       htmlReporterMain = createDom('div', {className: 'jasmine_html-reporter'}, |  | ||||||
|         createDom('div', {className: 'jasmine-banner'}, |  | ||||||
|           createDom('a', {className: 'jasmine-title', href: 'http://jasmine.github.io/', target: '_blank'}), |  | ||||||
|           createDom('span', {className: 'jasmine-version'}, j$.version) |  | ||||||
|         ), |  | ||||||
|         createDom('ul', {className: 'jasmine-symbol-summary'}), |  | ||||||
|         createDom('div', {className: 'jasmine-alert'}), |  | ||||||
|         createDom('div', {className: 'jasmine-results'}, |  | ||||||
|           createDom('div', {className: 'jasmine-failures'}) |  | ||||||
|         ) |  | ||||||
|       ); |  | ||||||
|       getContainer().appendChild(htmlReporterMain); |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     var totalSpecsDefined; |  | ||||||
|     this.jasmineStarted = function(options) { |  | ||||||
|       totalSpecsDefined = options.totalSpecsDefined || 0; |  | ||||||
|       timer.start(); |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     var summary = createDom('div', {className: 'jasmine-summary'}); |  | ||||||
| 
 |  | ||||||
|     var topResults = new j$.ResultsNode({}, '', null), |  | ||||||
|       currentParent = topResults; |  | ||||||
| 
 |  | ||||||
|     this.suiteStarted = function(result) { |  | ||||||
|       currentParent.addChild(result, 'suite'); |  | ||||||
|       currentParent = currentParent.last(); |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     this.suiteDone = function(result) { |  | ||||||
|       if (result.status == 'failed') { |  | ||||||
|         failedSuites.push(result); |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       if (currentParent == topResults) { |  | ||||||
|         return; |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       currentParent = currentParent.parent; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     this.specStarted = function(result) { |  | ||||||
|       currentParent.addChild(result, 'spec'); |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     var failures = []; |  | ||||||
|     this.specDone = function(result) { |  | ||||||
|       if(noExpectations(result) && typeof console !== 'undefined' && typeof console.error !== 'undefined') { |  | ||||||
|         console.error('Spec \'' + result.fullName + '\' has no expectations.'); |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       if (result.status != 'disabled') { |  | ||||||
|         specsExecuted++; |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       if (!symbols){ |  | ||||||
|         symbols = find('.jasmine-symbol-summary'); |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       symbols.appendChild(createDom('li', { |  | ||||||
|           className: noExpectations(result) ? 'jasmine-empty' : 'jasmine-' + result.status, |  | ||||||
|           id: 'spec_' + result.id, |  | ||||||
|           title: result.fullName |  | ||||||
|         } |  | ||||||
|       )); |  | ||||||
| 
 |  | ||||||
|       if (result.status == 'failed') { |  | ||||||
|         failureCount++; |  | ||||||
| 
 |  | ||||||
|         var failure = |  | ||||||
|           createDom('div', {className: 'jasmine-spec-detail jasmine-failed'}, |  | ||||||
|             createDom('div', {className: 'jasmine-description'}, |  | ||||||
|               createDom('a', {title: result.fullName, href: specHref(result)}, result.fullName) |  | ||||||
|             ), |  | ||||||
|             createDom('div', {className: 'jasmine-messages'}) |  | ||||||
|           ); |  | ||||||
|         var messages = failure.childNodes[1]; |  | ||||||
| 
 |  | ||||||
|         for (var i = 0; i < result.failedExpectations.length; i++) { |  | ||||||
|           var expectation = result.failedExpectations[i]; |  | ||||||
|           messages.appendChild(createDom('div', {className: 'jasmine-result-message'}, expectation.message)); |  | ||||||
|           messages.appendChild(createDom('div', {className: 'jasmine-stack-trace'}, expectation.stack)); |  | ||||||
|         } |  | ||||||
| 
 |  | ||||||
|         failures.push(failure); |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       if (result.status == 'pending') { |  | ||||||
|         pendingSpecCount++; |  | ||||||
|       } |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     this.jasmineDone = function(doneResult) { |  | ||||||
|       var banner = find('.jasmine-banner'); |  | ||||||
|       var alert = find('.jasmine-alert'); |  | ||||||
|       var order = doneResult && doneResult.order; |  | ||||||
|       alert.appendChild(createDom('span', {className: 'jasmine-duration'}, 'finished in ' + timer.elapsed() / 1000 + 's')); |  | ||||||
| 
 |  | ||||||
|       banner.appendChild( |  | ||||||
|         createDom('div', { className: 'jasmine-run-options' }, |  | ||||||
|           createDom('span', { className: 'jasmine-trigger' }, 'Options'), |  | ||||||
|           createDom('div', { className: 'jasmine-payload' }, |  | ||||||
|             createDom('div', { className: 'jasmine-exceptions' }, |  | ||||||
|               createDom('input', { |  | ||||||
|                 className: 'jasmine-raise', |  | ||||||
|                 id: 'jasmine-raise-exceptions', |  | ||||||
|                 type: 'checkbox' |  | ||||||
|               }), |  | ||||||
|               createDom('label', { className: 'jasmine-label', 'for': 'jasmine-raise-exceptions' }, 'raise exceptions')), |  | ||||||
|             createDom('div', { className: 'jasmine-throw-failures' }, |  | ||||||
|               createDom('input', { |  | ||||||
|                 className: 'jasmine-throw', |  | ||||||
|                 id: 'jasmine-throw-failures', |  | ||||||
|                 type: 'checkbox' |  | ||||||
|               }), |  | ||||||
|               createDom('label', { className: 'jasmine-label', 'for': 'jasmine-throw-failures' }, 'stop spec on expectation failure')), |  | ||||||
|             createDom('div', { className: 'jasmine-random-order' }, |  | ||||||
|               createDom('input', { |  | ||||||
|                 className: 'jasmine-random', |  | ||||||
|                 id: 'jasmine-random-order', |  | ||||||
|                 type: 'checkbox' |  | ||||||
|               }), |  | ||||||
|               createDom('label', { className: 'jasmine-label', 'for': 'jasmine-random-order' }, 'run tests in random order')) |  | ||||||
|           ) |  | ||||||
|         )); |  | ||||||
| 
 |  | ||||||
|       var raiseCheckbox = find('#jasmine-raise-exceptions'); |  | ||||||
| 
 |  | ||||||
|       raiseCheckbox.checked = !env.catchingExceptions(); |  | ||||||
|       raiseCheckbox.onclick = onRaiseExceptionsClick; |  | ||||||
| 
 |  | ||||||
|       var throwCheckbox = find('#jasmine-throw-failures'); |  | ||||||
|       throwCheckbox.checked = env.throwingExpectationFailures(); |  | ||||||
|       throwCheckbox.onclick = onThrowExpectationsClick; |  | ||||||
| 
 |  | ||||||
|       var randomCheckbox = find('#jasmine-random-order'); |  | ||||||
|       randomCheckbox.checked = env.randomTests(); |  | ||||||
|       randomCheckbox.onclick = onRandomClick; |  | ||||||
| 
 |  | ||||||
|       var optionsMenu = find('.jasmine-run-options'), |  | ||||||
|           optionsTrigger = optionsMenu.querySelector('.jasmine-trigger'), |  | ||||||
|           optionsPayload = optionsMenu.querySelector('.jasmine-payload'), |  | ||||||
|           isOpen = /\bjasmine-open\b/; |  | ||||||
| 
 |  | ||||||
|       optionsTrigger.onclick = function() { |  | ||||||
|         if (isOpen.test(optionsPayload.className)) { |  | ||||||
|           optionsPayload.className = optionsPayload.className.replace(isOpen, ''); |  | ||||||
|         } else { |  | ||||||
|           optionsPayload.className += ' jasmine-open'; |  | ||||||
|         } |  | ||||||
|       }; |  | ||||||
| 
 |  | ||||||
|       if (specsExecuted < totalSpecsDefined) { |  | ||||||
|         var skippedMessage = 'Ran ' + specsExecuted + ' of ' + totalSpecsDefined + ' specs - run all'; |  | ||||||
|         var skippedLink = order && order.random ? '?random=true' : '?'; |  | ||||||
|         alert.appendChild( |  | ||||||
|           createDom('span', {className: 'jasmine-bar jasmine-skipped'}, |  | ||||||
|             createDom('a', {href: skippedLink, title: 'Run all specs'}, skippedMessage) |  | ||||||
|           ) |  | ||||||
|         ); |  | ||||||
|       } |  | ||||||
|       var statusBarMessage = ''; |  | ||||||
|       var statusBarClassName = 'jasmine-bar '; |  | ||||||
| 
 |  | ||||||
|       if (totalSpecsDefined > 0) { |  | ||||||
|         statusBarMessage += pluralize('spec', specsExecuted) + ', ' + pluralize('failure', failureCount); |  | ||||||
|         if (pendingSpecCount) { statusBarMessage += ', ' + pluralize('pending spec', pendingSpecCount); } |  | ||||||
|         statusBarClassName += (failureCount > 0) ? 'jasmine-failed' : 'jasmine-passed'; |  | ||||||
|       } else { |  | ||||||
|         statusBarClassName += 'jasmine-skipped'; |  | ||||||
|         statusBarMessage += 'No specs found'; |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       var seedBar; |  | ||||||
|       if (order && order.random) { |  | ||||||
|         seedBar = createDom('span', {className: 'jasmine-seed-bar'}, |  | ||||||
|           ', randomized with seed ', |  | ||||||
|           createDom('a', {title: 'randomized with seed ' + order.seed, href: seedHref(order.seed)}, order.seed) |  | ||||||
|         ); |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       alert.appendChild(createDom('span', {className: statusBarClassName}, statusBarMessage, seedBar)); |  | ||||||
| 
 |  | ||||||
|       var errorBarClassName = 'jasmine-bar jasmine-errored'; |  | ||||||
|       var errorBarMessagePrefix = 'AfterAll '; |  | ||||||
| 
 |  | ||||||
|       for(var i = 0; i < failedSuites.length; i++) { |  | ||||||
|         var failedSuite = failedSuites[i]; |  | ||||||
|         for(var j = 0; j < failedSuite.failedExpectations.length; j++) { |  | ||||||
|           alert.appendChild(createDom('span', {className: errorBarClassName}, errorBarMessagePrefix + failedSuite.failedExpectations[j].message)); |  | ||||||
|         } |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       var globalFailures = (doneResult && doneResult.failedExpectations) || []; |  | ||||||
|       for(i = 0; i < globalFailures.length; i++) { |  | ||||||
|         var failure = globalFailures[i]; |  | ||||||
|         alert.appendChild(createDom('span', {className: errorBarClassName}, errorBarMessagePrefix + failure.message)); |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       var results = find('.jasmine-results'); |  | ||||||
|       results.appendChild(summary); |  | ||||||
| 
 |  | ||||||
|       summaryList(topResults, summary); |  | ||||||
| 
 |  | ||||||
|       function summaryList(resultsTree, domParent) { |  | ||||||
|         var specListNode; |  | ||||||
|         for (var i = 0; i < resultsTree.children.length; i++) { |  | ||||||
|           var resultNode = resultsTree.children[i]; |  | ||||||
|           if (filterSpecs && !hasActiveSpec(resultNode)) { |  | ||||||
|             continue; |  | ||||||
|           } |  | ||||||
|           if (resultNode.type == 'suite') { |  | ||||||
|             var suiteListNode = createDom('ul', {className: 'jasmine-suite', id: 'suite-' + resultNode.result.id}, |  | ||||||
|               createDom('li', {className: 'jasmine-suite-detail'}, |  | ||||||
|                 createDom('a', {href: specHref(resultNode.result)}, resultNode.result.description) |  | ||||||
|               ) |  | ||||||
|             ); |  | ||||||
| 
 |  | ||||||
|             summaryList(resultNode, suiteListNode); |  | ||||||
|             domParent.appendChild(suiteListNode); |  | ||||||
|           } |  | ||||||
|           if (resultNode.type == 'spec') { |  | ||||||
|             if (domParent.getAttribute('class') != 'jasmine-specs') { |  | ||||||
|               specListNode = createDom('ul', {className: 'jasmine-specs'}); |  | ||||||
|               domParent.appendChild(specListNode); |  | ||||||
|             } |  | ||||||
|             var specDescription = resultNode.result.description; |  | ||||||
|             if(noExpectations(resultNode.result)) { |  | ||||||
|               specDescription = 'SPEC HAS NO EXPECTATIONS ' + specDescription; |  | ||||||
|             } |  | ||||||
|             if(resultNode.result.status === 'pending' && resultNode.result.pendingReason !== '') { |  | ||||||
|               specDescription = specDescription + ' PENDING WITH MESSAGE: ' + resultNode.result.pendingReason; |  | ||||||
|             } |  | ||||||
|             specListNode.appendChild( |  | ||||||
|               createDom('li', { |  | ||||||
|                   className: 'jasmine-' + resultNode.result.status, |  | ||||||
|                   id: 'spec-' + resultNode.result.id |  | ||||||
|                 }, |  | ||||||
|                 createDom('a', {href: specHref(resultNode.result)}, specDescription) |  | ||||||
|               ) |  | ||||||
|             ); |  | ||||||
|           } |  | ||||||
|         } |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       if (failures.length) { |  | ||||||
|         alert.appendChild( |  | ||||||
|           createDom('span', {className: 'jasmine-menu jasmine-bar jasmine-spec-list'}, |  | ||||||
|             createDom('span', {}, 'Spec List | '), |  | ||||||
|             createDom('a', {className: 'jasmine-failures-menu', href: '#'}, 'Failures'))); |  | ||||||
|         alert.appendChild( |  | ||||||
|           createDom('span', {className: 'jasmine-menu jasmine-bar jasmine-failure-list'}, |  | ||||||
|             createDom('a', {className: 'jasmine-spec-list-menu', href: '#'}, 'Spec List'), |  | ||||||
|             createDom('span', {}, ' | Failures '))); |  | ||||||
| 
 |  | ||||||
|         find('.jasmine-failures-menu').onclick = function() { |  | ||||||
|           setMenuModeTo('jasmine-failure-list'); |  | ||||||
|         }; |  | ||||||
|         find('.jasmine-spec-list-menu').onclick = function() { |  | ||||||
|           setMenuModeTo('jasmine-spec-list'); |  | ||||||
|         }; |  | ||||||
| 
 |  | ||||||
|         setMenuModeTo('jasmine-failure-list'); |  | ||||||
| 
 |  | ||||||
|         var failureNode = find('.jasmine-failures'); |  | ||||||
|         for (i = 0; i < failures.length; i++) { |  | ||||||
|           failureNode.appendChild(failures[i]); |  | ||||||
|         } |  | ||||||
|       } |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     return this; |  | ||||||
| 
 |  | ||||||
|     function find(selector) { |  | ||||||
|       return getContainer().querySelector('.jasmine_html-reporter ' + selector); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     function clearPrior() { |  | ||||||
|       // return the reporter
 |  | ||||||
|       var oldReporter = find(''); |  | ||||||
| 
 |  | ||||||
|       if(oldReporter) { |  | ||||||
|         getContainer().removeChild(oldReporter); |  | ||||||
|       } |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     function createDom(type, attrs, childrenVarArgs) { |  | ||||||
|       var el = createElement(type); |  | ||||||
| 
 |  | ||||||
|       for (var i = 2; i < arguments.length; i++) { |  | ||||||
|         var child = arguments[i]; |  | ||||||
| 
 |  | ||||||
|         if (typeof child === 'string') { |  | ||||||
|           el.appendChild(createTextNode(child)); |  | ||||||
|         } else { |  | ||||||
|           if (child) { |  | ||||||
|             el.appendChild(child); |  | ||||||
|           } |  | ||||||
|         } |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       for (var attr in attrs) { |  | ||||||
|         if (attr == 'className') { |  | ||||||
|           el[attr] = attrs[attr]; |  | ||||||
|         } else { |  | ||||||
|           el.setAttribute(attr, attrs[attr]); |  | ||||||
|         } |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       return el; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     function pluralize(singular, count) { |  | ||||||
|       var word = (count == 1 ? singular : singular + 's'); |  | ||||||
| 
 |  | ||||||
|       return '' + count + ' ' + word; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     function specHref(result) { |  | ||||||
|       return addToExistingQueryString('spec', result.fullName); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     function seedHref(seed) { |  | ||||||
|       return addToExistingQueryString('seed', seed); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     function defaultQueryString(key, value) { |  | ||||||
|       return '?' + key + '=' + value; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     function setMenuModeTo(mode) { |  | ||||||
|       htmlReporterMain.setAttribute('class', 'jasmine_html-reporter ' + mode); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     function noExpectations(result) { |  | ||||||
|       return (result.failedExpectations.length + result.passedExpectations.length) === 0 && |  | ||||||
|         result.status === 'passed'; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     function hasActiveSpec(resultNode) { |  | ||||||
|       if (resultNode.type == 'spec' && resultNode.result.status != 'disabled') { |  | ||||||
|         return true; |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       if (resultNode.type == 'suite') { |  | ||||||
|         for (var i = 0, j = resultNode.children.length; i < j; i++) { |  | ||||||
|           if (hasActiveSpec(resultNode.children[i])) { |  | ||||||
|             return true; |  | ||||||
|           } |  | ||||||
|         } |  | ||||||
|       } |  | ||||||
|     } |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   return HtmlReporter; |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| jasmineRequire.HtmlSpecFilter = function() { |  | ||||||
|   function HtmlSpecFilter(options) { |  | ||||||
|     var filterString = options && options.filterString() && options.filterString().replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); |  | ||||||
|     var filterPattern = new RegExp(filterString); |  | ||||||
| 
 |  | ||||||
|     this.matches = function(specName) { |  | ||||||
|       return filterPattern.test(specName); |  | ||||||
|     }; |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   return HtmlSpecFilter; |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| jasmineRequire.ResultsNode = function() { |  | ||||||
|   function ResultsNode(result, type, parent) { |  | ||||||
|     this.result = result; |  | ||||||
|     this.type = type; |  | ||||||
|     this.parent = parent; |  | ||||||
| 
 |  | ||||||
|     this.children = []; |  | ||||||
| 
 |  | ||||||
|     this.addChild = function(result, type) { |  | ||||||
|       this.children.push(new ResultsNode(result, type, this)); |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     this.last = function() { |  | ||||||
|       return this.children[this.children.length - 1]; |  | ||||||
|     }; |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   return ResultsNode; |  | ||||||
| }; |  | ||||||
| 
 |  | ||||||
| jasmineRequire.QueryString = function() { |  | ||||||
|   function QueryString(options) { |  | ||||||
| 
 |  | ||||||
|     this.navigateWithNewParam = function(key, value) { |  | ||||||
|       options.getWindowLocation().search = this.fullStringWithNewParam(key, value); |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     this.fullStringWithNewParam = function(key, value) { |  | ||||||
|       var paramMap = queryStringToParamMap(); |  | ||||||
|       paramMap[key] = value; |  | ||||||
|       return toQueryString(paramMap); |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     this.getParam = function(key) { |  | ||||||
|       return queryStringToParamMap()[key]; |  | ||||||
|     }; |  | ||||||
| 
 |  | ||||||
|     return this; |  | ||||||
| 
 |  | ||||||
|     function toQueryString(paramMap) { |  | ||||||
|       var qStrPairs = []; |  | ||||||
|       for (var prop in paramMap) { |  | ||||||
|         qStrPairs.push(encodeURIComponent(prop) + '=' + encodeURIComponent(paramMap[prop])); |  | ||||||
|       } |  | ||||||
|       return '?' + qStrPairs.join('&'); |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|     function queryStringToParamMap() { |  | ||||||
|       var paramStr = options.getWindowLocation().search.substring(1), |  | ||||||
|         params = [], |  | ||||||
|         paramMap = {}; |  | ||||||
| 
 |  | ||||||
|       if (paramStr.length > 0) { |  | ||||||
|         params = paramStr.split('&'); |  | ||||||
|         for (var i = 0; i < params.length; i++) { |  | ||||||
|           var p = params[i].split('='); |  | ||||||
|           var value = decodeURIComponent(p[1]); |  | ||||||
|           if (value === 'true' || value === 'false') { |  | ||||||
|             value = JSON.parse(value); |  | ||||||
|           } |  | ||||||
|           paramMap[decodeURIComponent(p[0])] = value; |  | ||||||
|         } |  | ||||||
|       } |  | ||||||
| 
 |  | ||||||
|       return paramMap; |  | ||||||
|     } |  | ||||||
| 
 |  | ||||||
|   } |  | ||||||
| 
 |  | ||||||
|   return QueryString; |  | ||||||
| }; |  | ||||||
							
								
								
									
										5001
									
								
								packages/splitjs/test/lib/jasmine-2.6.4/jasmine.js
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										5001
									
								
								packages/splitjs/test/lib/jasmine-2.6.4/jasmine.js
									
									
									
									
										vendored
									
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| @ -51,18 +51,21 @@ | |||||||
| 
 | 
 | ||||||
|   var filterSpecs = !!queryString.getParam("spec"); |   var filterSpecs = !!queryString.getParam("spec"); | ||||||
| 
 | 
 | ||||||
|   var catchingExceptions = queryString.getParam("catch"); |   var config = { | ||||||
|   env.catchExceptions(typeof catchingExceptions === "undefined" ? true : catchingExceptions); |     failFast: queryString.getParam("failFast"), | ||||||
| 
 |     oneFailurePerSpec: queryString.getParam("oneFailurePerSpec"), | ||||||
|   var throwingExpectationFailures = queryString.getParam("throwFailures"); |     hideDisabled: queryString.getParam("hideDisabled") | ||||||
|   env.throwOnExpectationFailure(throwingExpectationFailures); |   }; | ||||||
| 
 | 
 | ||||||
|   var random = queryString.getParam("random"); |   var random = queryString.getParam("random"); | ||||||
|   env.randomizeTests(random); | 
 | ||||||
|  |   if (random !== undefined && random !== "") { | ||||||
|  |     config.random = random; | ||||||
|  |   } | ||||||
| 
 | 
 | ||||||
|   var seed = queryString.getParam("seed"); |   var seed = queryString.getParam("seed"); | ||||||
|   if (seed) { |   if (seed) { | ||||||
|     env.seed(seed); |     config.seed = seed; | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   /** |   /** | ||||||
| @ -71,9 +74,7 @@ | |||||||
|    */ |    */ | ||||||
|   var htmlReporter = new jasmine.HtmlReporter({ |   var htmlReporter = new jasmine.HtmlReporter({ | ||||||
|     env: env, |     env: env, | ||||||
|     onRaiseExceptionsClick: function() { queryString.navigateWithNewParam("catch", !env.catchingExceptions()); }, |     navigateWithNewParam: function(key, value) { return queryString.navigateWithNewParam(key, value); }, | ||||||
|     onThrowExpectationsClick: function() { queryString.navigateWithNewParam("throwFailures", !env.throwingExpectationFailures()); }, |  | ||||||
|     onRandomClick: function() { queryString.navigateWithNewParam("random", !env.randomTests()); }, |  | ||||||
|     addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); }, |     addToExistingQueryString: function(key, value) { return queryString.fullStringWithNewParam(key, value); }, | ||||||
|     getContainer: function() { return document.body; }, |     getContainer: function() { return document.body; }, | ||||||
|     createElement: function() { return document.createElement.apply(document, arguments); }, |     createElement: function() { return document.createElement.apply(document, arguments); }, | ||||||
| @ -95,10 +96,12 @@ | |||||||
|     filterString: function() { return queryString.getParam("spec"); } |     filterString: function() { return queryString.getParam("spec"); } | ||||||
|   }); |   }); | ||||||
| 
 | 
 | ||||||
|   env.specFilter = function(spec) { |   config.specFilter = function(spec) { | ||||||
|     return specFilter.matches(spec.getFullName()); |     return specFilter.matches(spec.getFullName()); | ||||||
|   }; |   }; | ||||||
| 
 | 
 | ||||||
|  |   env.configure(config); | ||||||
|  | 
 | ||||||
|   /** |   /** | ||||||
|    * Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack. |    * Setting up timing functions to be able to be overridden. Certain browsers (Safari, IE 8, phantomjs) require this hack. | ||||||
|    */ |    */ | ||||||
							
								
								
									
										817
									
								
								packages/splitjs/test/lib/jasmine-3.5.0/jasmine-html.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										817
									
								
								packages/splitjs/test/lib/jasmine-3.5.0/jasmine-html.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @ -0,0 +1,817 @@ | |||||||
|  | /* | ||||||
|  | Copyright (c) 2008-2019 Pivotal Labs | ||||||
|  | 
 | ||||||
|  | Permission is hereby granted, free of charge, to any person obtaining | ||||||
|  | a copy of this software and associated documentation files (the | ||||||
|  | "Software"), to deal in the Software without restriction, including | ||||||
|  | without limitation the rights to use, copy, modify, merge, publish, | ||||||
|  | distribute, sublicense, and/or sell copies of the Software, and to | ||||||
|  | permit persons to whom the Software is furnished to do so, subject to | ||||||
|  | the following conditions: | ||||||
|  | 
 | ||||||
|  | The above copyright notice and this permission notice shall be | ||||||
|  | included in all copies or substantial portions of the Software. | ||||||
|  | 
 | ||||||
|  | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||||||
|  | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF | ||||||
|  | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||||||
|  | NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE | ||||||
|  | LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION | ||||||
|  | OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION | ||||||
|  | WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. | ||||||
|  | */ | ||||||
|  | jasmineRequire.html = function(j$) { | ||||||
|  |   j$.ResultsNode = jasmineRequire.ResultsNode(); | ||||||
|  |   j$.HtmlReporter = jasmineRequire.HtmlReporter(j$); | ||||||
|  |   j$.QueryString = jasmineRequire.QueryString(); | ||||||
|  |   j$.HtmlSpecFilter = jasmineRequire.HtmlSpecFilter(); | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | jasmineRequire.HtmlReporter = function(j$) { | ||||||
|  |   function ResultsStateBuilder() { | ||||||
|  |     this.topResults = new j$.ResultsNode({}, '', null); | ||||||
|  |     this.currentParent = this.topResults; | ||||||
|  |     this.specsExecuted = 0; | ||||||
|  |     this.failureCount = 0; | ||||||
|  |     this.pendingSpecCount = 0; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   ResultsStateBuilder.prototype.suiteStarted = function(result) { | ||||||
|  |     this.currentParent.addChild(result, 'suite'); | ||||||
|  |     this.currentParent = this.currentParent.last(); | ||||||
|  |   }; | ||||||
|  | 
 | ||||||
|  |   ResultsStateBuilder.prototype.suiteDone = function(result) { | ||||||
|  |     this.currentParent.updateResult(result); | ||||||
|  |     if (this.currentParent !== this.topResults) { | ||||||
|  |       this.currentParent = this.currentParent.parent; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     if (result.status === 'failed') { | ||||||
|  |       this.failureCount++; | ||||||
|  |     } | ||||||
|  |   }; | ||||||
|  | 
 | ||||||
|  |   ResultsStateBuilder.prototype.specStarted = function(result) {}; | ||||||
|  | 
 | ||||||
|  |   ResultsStateBuilder.prototype.specDone = function(result) { | ||||||
|  |     this.currentParent.addChild(result, 'spec'); | ||||||
|  | 
 | ||||||
|  |     if (result.status !== 'excluded') { | ||||||
|  |       this.specsExecuted++; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     if (result.status === 'failed') { | ||||||
|  |       this.failureCount++; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     if (result.status == 'pending') { | ||||||
|  |       this.pendingSpecCount++; | ||||||
|  |     } | ||||||
|  |   }; | ||||||
|  | 
 | ||||||
|  |   function HtmlReporter(options) { | ||||||
|  |     var config = function() { | ||||||
|  |         return (options.env && options.env.configuration()) || {}; | ||||||
|  |       }, | ||||||
|  |       getContainer = options.getContainer, | ||||||
|  |       createElement = options.createElement, | ||||||
|  |       createTextNode = options.createTextNode, | ||||||
|  |       navigateWithNewParam = options.navigateWithNewParam || function() {}, | ||||||
|  |       addToExistingQueryString = | ||||||
|  |         options.addToExistingQueryString || defaultQueryString, | ||||||
|  |       filterSpecs = options.filterSpecs, | ||||||
|  |       htmlReporterMain, | ||||||
|  |       symbols, | ||||||
|  |       deprecationWarnings = []; | ||||||
|  | 
 | ||||||
|  |     this.initialize = function() { | ||||||
|  |       clearPrior(); | ||||||
|  |       htmlReporterMain = createDom( | ||||||
|  |         'div', | ||||||
|  |         { className: 'jasmine_html-reporter' }, | ||||||
|  |         createDom( | ||||||
|  |           'div', | ||||||
|  |           { className: 'jasmine-banner' }, | ||||||
|  |           createDom('a', { | ||||||
|  |             className: 'jasmine-title', | ||||||
|  |             href: 'http://jasmine.github.io/', | ||||||
|  |             target: '_blank' | ||||||
|  |           }), | ||||||
|  |           createDom('span', { className: 'jasmine-version' }, j$.version) | ||||||
|  |         ), | ||||||
|  |         createDom('ul', { className: 'jasmine-symbol-summary' }), | ||||||
|  |         createDom('div', { className: 'jasmine-alert' }), | ||||||
|  |         createDom( | ||||||
|  |           'div', | ||||||
|  |           { className: 'jasmine-results' }, | ||||||
|  |           createDom('div', { className: 'jasmine-failures' }) | ||||||
|  |         ) | ||||||
|  |       ); | ||||||
|  |       getContainer().appendChild(htmlReporterMain); | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     var totalSpecsDefined; | ||||||
|  |     this.jasmineStarted = function(options) { | ||||||
|  |       totalSpecsDefined = options.totalSpecsDefined || 0; | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     var summary = createDom('div', { className: 'jasmine-summary' }); | ||||||
|  | 
 | ||||||
|  |     var stateBuilder = new ResultsStateBuilder(); | ||||||
|  | 
 | ||||||
|  |     this.suiteStarted = function(result) { | ||||||
|  |       stateBuilder.suiteStarted(result); | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     this.suiteDone = function(result) { | ||||||
|  |       stateBuilder.suiteDone(result); | ||||||
|  | 
 | ||||||
|  |       if (result.status === 'failed') { | ||||||
|  |         failures.push(failureDom(result)); | ||||||
|  |       } | ||||||
|  |       addDeprecationWarnings(result); | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     this.specStarted = function(result) { | ||||||
|  |       stateBuilder.specStarted(result); | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     var failures = []; | ||||||
|  |     this.specDone = function(result) { | ||||||
|  |       stateBuilder.specDone(result); | ||||||
|  | 
 | ||||||
|  |       if (noExpectations(result)) { | ||||||
|  |         var noSpecMsg = "Spec '" + result.fullName + "' has no expectations."; | ||||||
|  |         if (result.status === 'failed') { | ||||||
|  |           console.error(noSpecMsg); | ||||||
|  |         } else { | ||||||
|  |           console.warn(noSpecMsg); | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       if (!symbols) { | ||||||
|  |         symbols = find('.jasmine-symbol-summary'); | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       symbols.appendChild( | ||||||
|  |         createDom('li', { | ||||||
|  |           className: this.displaySpecInCorrectFormat(result), | ||||||
|  |           id: 'spec_' + result.id, | ||||||
|  |           title: result.fullName | ||||||
|  |         }) | ||||||
|  |       ); | ||||||
|  | 
 | ||||||
|  |       if (result.status === 'failed') { | ||||||
|  |         failures.push(failureDom(result)); | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       addDeprecationWarnings(result); | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     this.displaySpecInCorrectFormat = function(result) { | ||||||
|  |       return noExpectations(result) && result.status === 'passed' | ||||||
|  |         ? 'jasmine-empty' | ||||||
|  |         : this.resultStatus(result.status); | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     this.resultStatus = function(status) { | ||||||
|  |       if (status === 'excluded') { | ||||||
|  |         return config().hideDisabled | ||||||
|  |           ? 'jasmine-excluded-no-display' | ||||||
|  |           : 'jasmine-excluded'; | ||||||
|  |       } | ||||||
|  |       return 'jasmine-' + status; | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     this.jasmineDone = function(doneResult) { | ||||||
|  |       var banner = find('.jasmine-banner'); | ||||||
|  |       var alert = find('.jasmine-alert'); | ||||||
|  |       var order = doneResult && doneResult.order; | ||||||
|  |       var i; | ||||||
|  |       alert.appendChild( | ||||||
|  |         createDom( | ||||||
|  |           'span', | ||||||
|  |           { className: 'jasmine-duration' }, | ||||||
|  |           'finished in ' + doneResult.totalTime / 1000 + 's' | ||||||
|  |         ) | ||||||
|  |       ); | ||||||
|  | 
 | ||||||
|  |       banner.appendChild(optionsMenu(config())); | ||||||
|  | 
 | ||||||
|  |       if (stateBuilder.specsExecuted < totalSpecsDefined) { | ||||||
|  |         var skippedMessage = | ||||||
|  |           'Ran ' + | ||||||
|  |           stateBuilder.specsExecuted + | ||||||
|  |           ' of ' + | ||||||
|  |           totalSpecsDefined + | ||||||
|  |           ' specs - run all'; | ||||||
|  |         var skippedLink = addToExistingQueryString('spec', ''); | ||||||
|  |         alert.appendChild( | ||||||
|  |           createDom( | ||||||
|  |             'span', | ||||||
|  |             { className: 'jasmine-bar jasmine-skipped' }, | ||||||
|  |             createDom( | ||||||
|  |               'a', | ||||||
|  |               { href: skippedLink, title: 'Run all specs' }, | ||||||
|  |               skippedMessage | ||||||
|  |             ) | ||||||
|  |           ) | ||||||
|  |         ); | ||||||
|  |       } | ||||||
|  |       var statusBarMessage = ''; | ||||||
|  |       var statusBarClassName = 'jasmine-overall-result jasmine-bar '; | ||||||
|  |       var globalFailures = (doneResult && doneResult.failedExpectations) || []; | ||||||
|  |       var failed = stateBuilder.failureCount + globalFailures.length > 0; | ||||||
|  | 
 | ||||||
|  |       if (totalSpecsDefined > 0 || failed) { | ||||||
|  |         statusBarMessage += | ||||||
|  |           pluralize('spec', stateBuilder.specsExecuted) + | ||||||
|  |           ', ' + | ||||||
|  |           pluralize('failure', stateBuilder.failureCount); | ||||||
|  |         if (stateBuilder.pendingSpecCount) { | ||||||
|  |           statusBarMessage += | ||||||
|  |             ', ' + pluralize('pending spec', stateBuilder.pendingSpecCount); | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       if (doneResult.overallStatus === 'passed') { | ||||||
|  |         statusBarClassName += ' jasmine-passed '; | ||||||
|  |       } else if (doneResult.overallStatus === 'incomplete') { | ||||||
|  |         statusBarClassName += ' jasmine-incomplete '; | ||||||
|  |         statusBarMessage = | ||||||
|  |           'Incomplete: ' + | ||||||
|  |           doneResult.incompleteReason + | ||||||
|  |           ', ' + | ||||||
|  |           statusBarMessage; | ||||||
|  |       } else { | ||||||
|  |         statusBarClassName += ' jasmine-failed '; | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       var seedBar; | ||||||
|  |       if (order && order.random) { | ||||||
|  |         seedBar = createDom( | ||||||
|  |           'span', | ||||||
|  |           { className: 'jasmine-seed-bar' }, | ||||||
|  |           ', randomized with seed ', | ||||||
|  |           createDom( | ||||||
|  |             'a', | ||||||
|  |             { | ||||||
|  |               title: 'randomized with seed ' + order.seed, | ||||||
|  |               href: seedHref(order.seed) | ||||||
|  |             }, | ||||||
|  |             order.seed | ||||||
|  |           ) | ||||||
|  |         ); | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       alert.appendChild( | ||||||
|  |         createDom( | ||||||
|  |           'span', | ||||||
|  |           { className: statusBarClassName }, | ||||||
|  |           statusBarMessage, | ||||||
|  |           seedBar | ||||||
|  |         ) | ||||||
|  |       ); | ||||||
|  | 
 | ||||||
|  |       var errorBarClassName = 'jasmine-bar jasmine-errored'; | ||||||
|  |       var afterAllMessagePrefix = 'AfterAll '; | ||||||
|  | 
 | ||||||
|  |       for (i = 0; i < globalFailures.length; i++) { | ||||||
|  |         alert.appendChild( | ||||||
|  |           createDom( | ||||||
|  |             'span', | ||||||
|  |             { className: errorBarClassName }, | ||||||
|  |             globalFailureMessage(globalFailures[i]) | ||||||
|  |           ) | ||||||
|  |         ); | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       function globalFailureMessage(failure) { | ||||||
|  |         if (failure.globalErrorType === 'load') { | ||||||
|  |           var prefix = 'Error during loading: ' + failure.message; | ||||||
|  | 
 | ||||||
|  |           if (failure.filename) { | ||||||
|  |             return ( | ||||||
|  |               prefix + ' in ' + failure.filename + ' line ' + failure.lineno | ||||||
|  |             ); | ||||||
|  |           } else { | ||||||
|  |             return prefix; | ||||||
|  |           } | ||||||
|  |         } else { | ||||||
|  |           return afterAllMessagePrefix + failure.message; | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       addDeprecationWarnings(doneResult); | ||||||
|  | 
 | ||||||
|  |       var warningBarClassName = 'jasmine-bar jasmine-warning'; | ||||||
|  |       for (i = 0; i < deprecationWarnings.length; i++) { | ||||||
|  |         var warning = deprecationWarnings[i]; | ||||||
|  |         alert.appendChild( | ||||||
|  |           createDom( | ||||||
|  |             'span', | ||||||
|  |             { className: warningBarClassName }, | ||||||
|  |             'DEPRECATION: ' + warning | ||||||
|  |           ) | ||||||
|  |         ); | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       var results = find('.jasmine-results'); | ||||||
|  |       results.appendChild(summary); | ||||||
|  | 
 | ||||||
|  |       summaryList(stateBuilder.topResults, summary); | ||||||
|  | 
 | ||||||
|  |       if (failures.length) { | ||||||
|  |         alert.appendChild( | ||||||
|  |           createDom( | ||||||
|  |             'span', | ||||||
|  |             { className: 'jasmine-menu jasmine-bar jasmine-spec-list' }, | ||||||
|  |             createDom('span', {}, 'Spec List | '), | ||||||
|  |             createDom( | ||||||
|  |               'a', | ||||||
|  |               { className: 'jasmine-failures-menu', href: '#' }, | ||||||
|  |               'Failures' | ||||||
|  |             ) | ||||||
|  |           ) | ||||||
|  |         ); | ||||||
|  |         alert.appendChild( | ||||||
|  |           createDom( | ||||||
|  |             'span', | ||||||
|  |             { className: 'jasmine-menu jasmine-bar jasmine-failure-list' }, | ||||||
|  |             createDom( | ||||||
|  |               'a', | ||||||
|  |               { className: 'jasmine-spec-list-menu', href: '#' }, | ||||||
|  |               'Spec List' | ||||||
|  |             ), | ||||||
|  |             createDom('span', {}, ' | Failures ') | ||||||
|  |           ) | ||||||
|  |         ); | ||||||
|  | 
 | ||||||
|  |         find('.jasmine-failures-menu').onclick = function() { | ||||||
|  |           setMenuModeTo('jasmine-failure-list'); | ||||||
|  |         }; | ||||||
|  |         find('.jasmine-spec-list-menu').onclick = function() { | ||||||
|  |           setMenuModeTo('jasmine-spec-list'); | ||||||
|  |         }; | ||||||
|  | 
 | ||||||
|  |         setMenuModeTo('jasmine-failure-list'); | ||||||
|  | 
 | ||||||
|  |         var failureNode = find('.jasmine-failures'); | ||||||
|  |         for (i = 0; i < failures.length; i++) { | ||||||
|  |           failureNode.appendChild(failures[i]); | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     return this; | ||||||
|  | 
 | ||||||
|  |     function failureDom(result) { | ||||||
|  |       var failure = createDom( | ||||||
|  |         'div', | ||||||
|  |         { className: 'jasmine-spec-detail jasmine-failed' }, | ||||||
|  |         failureDescription(result, stateBuilder.currentParent), | ||||||
|  |         createDom('div', { className: 'jasmine-messages' }) | ||||||
|  |       ); | ||||||
|  |       var messages = failure.childNodes[1]; | ||||||
|  | 
 | ||||||
|  |       for (var i = 0; i < result.failedExpectations.length; i++) { | ||||||
|  |         var expectation = result.failedExpectations[i]; | ||||||
|  |         messages.appendChild( | ||||||
|  |           createDom( | ||||||
|  |             'div', | ||||||
|  |             { className: 'jasmine-result-message' }, | ||||||
|  |             expectation.message | ||||||
|  |           ) | ||||||
|  |         ); | ||||||
|  |         messages.appendChild( | ||||||
|  |           createDom( | ||||||
|  |             'div', | ||||||
|  |             { className: 'jasmine-stack-trace' }, | ||||||
|  |             expectation.stack | ||||||
|  |           ) | ||||||
|  |         ); | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       if (result.failedExpectations.length === 0) { | ||||||
|  |         messages.appendChild( | ||||||
|  |           createDom( | ||||||
|  |             'div', | ||||||
|  |             { className: 'jasmine-result-message' }, | ||||||
|  |             'Spec has no expectations' | ||||||
|  |           ) | ||||||
|  |         ); | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       return failure; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function summaryList(resultsTree, domParent) { | ||||||
|  |       var specListNode; | ||||||
|  |       for (var i = 0; i < resultsTree.children.length; i++) { | ||||||
|  |         var resultNode = resultsTree.children[i]; | ||||||
|  |         if (filterSpecs && !hasActiveSpec(resultNode)) { | ||||||
|  |           continue; | ||||||
|  |         } | ||||||
|  |         if (resultNode.type === 'suite') { | ||||||
|  |           var suiteListNode = createDom( | ||||||
|  |             'ul', | ||||||
|  |             { className: 'jasmine-suite', id: 'suite-' + resultNode.result.id }, | ||||||
|  |             createDom( | ||||||
|  |               'li', | ||||||
|  |               { | ||||||
|  |                 className: | ||||||
|  |                   'jasmine-suite-detail jasmine-' + resultNode.result.status | ||||||
|  |               }, | ||||||
|  |               createDom( | ||||||
|  |                 'a', | ||||||
|  |                 { href: specHref(resultNode.result) }, | ||||||
|  |                 resultNode.result.description | ||||||
|  |               ) | ||||||
|  |             ) | ||||||
|  |           ); | ||||||
|  | 
 | ||||||
|  |           summaryList(resultNode, suiteListNode); | ||||||
|  |           domParent.appendChild(suiteListNode); | ||||||
|  |         } | ||||||
|  |         if (resultNode.type === 'spec') { | ||||||
|  |           if (domParent.getAttribute('class') !== 'jasmine-specs') { | ||||||
|  |             specListNode = createDom('ul', { className: 'jasmine-specs' }); | ||||||
|  |             domParent.appendChild(specListNode); | ||||||
|  |           } | ||||||
|  |           var specDescription = resultNode.result.description; | ||||||
|  |           if (noExpectations(resultNode.result)) { | ||||||
|  |             specDescription = 'SPEC HAS NO EXPECTATIONS ' + specDescription; | ||||||
|  |           } | ||||||
|  |           if ( | ||||||
|  |             resultNode.result.status === 'pending' && | ||||||
|  |             resultNode.result.pendingReason !== '' | ||||||
|  |           ) { | ||||||
|  |             specDescription = | ||||||
|  |               specDescription + | ||||||
|  |               ' PENDING WITH MESSAGE: ' + | ||||||
|  |               resultNode.result.pendingReason; | ||||||
|  |           } | ||||||
|  |           specListNode.appendChild( | ||||||
|  |             createDom( | ||||||
|  |               'li', | ||||||
|  |               { | ||||||
|  |                 className: 'jasmine-' + resultNode.result.status, | ||||||
|  |                 id: 'spec-' + resultNode.result.id | ||||||
|  |               }, | ||||||
|  |               createDom( | ||||||
|  |                 'a', | ||||||
|  |                 { href: specHref(resultNode.result) }, | ||||||
|  |                 specDescription | ||||||
|  |               ) | ||||||
|  |             ) | ||||||
|  |           ); | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function optionsMenu(config) { | ||||||
|  |       var optionsMenuDom = createDom( | ||||||
|  |         'div', | ||||||
|  |         { className: 'jasmine-run-options' }, | ||||||
|  |         createDom('span', { className: 'jasmine-trigger' }, 'Options'), | ||||||
|  |         createDom( | ||||||
|  |           'div', | ||||||
|  |           { className: 'jasmine-payload' }, | ||||||
|  |           createDom( | ||||||
|  |             'div', | ||||||
|  |             { className: 'jasmine-stop-on-failure' }, | ||||||
|  |             createDom('input', { | ||||||
|  |               className: 'jasmine-fail-fast', | ||||||
|  |               id: 'jasmine-fail-fast', | ||||||
|  |               type: 'checkbox' | ||||||
|  |             }), | ||||||
|  |             createDom( | ||||||
|  |               'label', | ||||||
|  |               { className: 'jasmine-label', for: 'jasmine-fail-fast' }, | ||||||
|  |               'stop execution on spec failure' | ||||||
|  |             ) | ||||||
|  |           ), | ||||||
|  |           createDom( | ||||||
|  |             'div', | ||||||
|  |             { className: 'jasmine-throw-failures' }, | ||||||
|  |             createDom('input', { | ||||||
|  |               className: 'jasmine-throw', | ||||||
|  |               id: 'jasmine-throw-failures', | ||||||
|  |               type: 'checkbox' | ||||||
|  |             }), | ||||||
|  |             createDom( | ||||||
|  |               'label', | ||||||
|  |               { className: 'jasmine-label', for: 'jasmine-throw-failures' }, | ||||||
|  |               'stop spec on expectation failure' | ||||||
|  |             ) | ||||||
|  |           ), | ||||||
|  |           createDom( | ||||||
|  |             'div', | ||||||
|  |             { className: 'jasmine-random-order' }, | ||||||
|  |             createDom('input', { | ||||||
|  |               className: 'jasmine-random', | ||||||
|  |               id: 'jasmine-random-order', | ||||||
|  |               type: 'checkbox' | ||||||
|  |             }), | ||||||
|  |             createDom( | ||||||
|  |               'label', | ||||||
|  |               { className: 'jasmine-label', for: 'jasmine-random-order' }, | ||||||
|  |               'run tests in random order' | ||||||
|  |             ) | ||||||
|  |           ), | ||||||
|  |           createDom( | ||||||
|  |             'div', | ||||||
|  |             { className: 'jasmine-hide-disabled' }, | ||||||
|  |             createDom('input', { | ||||||
|  |               className: 'jasmine-disabled', | ||||||
|  |               id: 'jasmine-hide-disabled', | ||||||
|  |               type: 'checkbox' | ||||||
|  |             }), | ||||||
|  |             createDom( | ||||||
|  |               'label', | ||||||
|  |               { className: 'jasmine-label', for: 'jasmine-hide-disabled' }, | ||||||
|  |               'hide disabled tests' | ||||||
|  |             ) | ||||||
|  |           ) | ||||||
|  |         ) | ||||||
|  |       ); | ||||||
|  | 
 | ||||||
|  |       var failFastCheckbox = optionsMenuDom.querySelector('#jasmine-fail-fast'); | ||||||
|  |       failFastCheckbox.checked = config.failFast; | ||||||
|  |       failFastCheckbox.onclick = function() { | ||||||
|  |         navigateWithNewParam('failFast', !config.failFast); | ||||||
|  |       }; | ||||||
|  | 
 | ||||||
|  |       var throwCheckbox = optionsMenuDom.querySelector( | ||||||
|  |         '#jasmine-throw-failures' | ||||||
|  |       ); | ||||||
|  |       throwCheckbox.checked = config.oneFailurePerSpec; | ||||||
|  |       throwCheckbox.onclick = function() { | ||||||
|  |         navigateWithNewParam('throwFailures', !config.oneFailurePerSpec); | ||||||
|  |       }; | ||||||
|  | 
 | ||||||
|  |       var randomCheckbox = optionsMenuDom.querySelector( | ||||||
|  |         '#jasmine-random-order' | ||||||
|  |       ); | ||||||
|  |       randomCheckbox.checked = config.random; | ||||||
|  |       randomCheckbox.onclick = function() { | ||||||
|  |         navigateWithNewParam('random', !config.random); | ||||||
|  |       }; | ||||||
|  | 
 | ||||||
|  |       var hideDisabled = optionsMenuDom.querySelector('#jasmine-hide-disabled'); | ||||||
|  |       hideDisabled.checked = config.hideDisabled; | ||||||
|  |       hideDisabled.onclick = function() { | ||||||
|  |         navigateWithNewParam('hideDisabled', !config.hideDisabled); | ||||||
|  |       }; | ||||||
|  | 
 | ||||||
|  |       var optionsTrigger = optionsMenuDom.querySelector('.jasmine-trigger'), | ||||||
|  |         optionsPayload = optionsMenuDom.querySelector('.jasmine-payload'), | ||||||
|  |         isOpen = /\bjasmine-open\b/; | ||||||
|  | 
 | ||||||
|  |       optionsTrigger.onclick = function() { | ||||||
|  |         if (isOpen.test(optionsPayload.className)) { | ||||||
|  |           optionsPayload.className = optionsPayload.className.replace( | ||||||
|  |             isOpen, | ||||||
|  |             '' | ||||||
|  |           ); | ||||||
|  |         } else { | ||||||
|  |           optionsPayload.className += ' jasmine-open'; | ||||||
|  |         } | ||||||
|  |       }; | ||||||
|  | 
 | ||||||
|  |       return optionsMenuDom; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function failureDescription(result, suite) { | ||||||
|  |       var wrapper = createDom( | ||||||
|  |         'div', | ||||||
|  |         { className: 'jasmine-description' }, | ||||||
|  |         createDom( | ||||||
|  |           'a', | ||||||
|  |           { title: result.description, href: specHref(result) }, | ||||||
|  |           result.description | ||||||
|  |         ) | ||||||
|  |       ); | ||||||
|  |       var suiteLink; | ||||||
|  | 
 | ||||||
|  |       while (suite && suite.parent) { | ||||||
|  |         wrapper.insertBefore(createTextNode(' > '), wrapper.firstChild); | ||||||
|  |         suiteLink = createDom( | ||||||
|  |           'a', | ||||||
|  |           { href: suiteHref(suite) }, | ||||||
|  |           suite.result.description | ||||||
|  |         ); | ||||||
|  |         wrapper.insertBefore(suiteLink, wrapper.firstChild); | ||||||
|  | 
 | ||||||
|  |         suite = suite.parent; | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       return wrapper; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function suiteHref(suite) { | ||||||
|  |       var els = []; | ||||||
|  | 
 | ||||||
|  |       while (suite && suite.parent) { | ||||||
|  |         els.unshift(suite.result.description); | ||||||
|  |         suite = suite.parent; | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       return addToExistingQueryString('spec', els.join(' ')); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function addDeprecationWarnings(result) { | ||||||
|  |       if (result && result.deprecationWarnings) { | ||||||
|  |         for (var i = 0; i < result.deprecationWarnings.length; i++) { | ||||||
|  |           var warning = result.deprecationWarnings[i].message; | ||||||
|  |           if (!j$.util.arrayContains(warning)) { | ||||||
|  |             deprecationWarnings.push(warning); | ||||||
|  |           } | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function find(selector) { | ||||||
|  |       return getContainer().querySelector('.jasmine_html-reporter ' + selector); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function clearPrior() { | ||||||
|  |       // return the reporter
 | ||||||
|  |       var oldReporter = find(''); | ||||||
|  | 
 | ||||||
|  |       if (oldReporter) { | ||||||
|  |         getContainer().removeChild(oldReporter); | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function createDom(type, attrs, childrenVarArgs) { | ||||||
|  |       var el = createElement(type); | ||||||
|  | 
 | ||||||
|  |       for (var i = 2; i < arguments.length; i++) { | ||||||
|  |         var child = arguments[i]; | ||||||
|  | 
 | ||||||
|  |         if (typeof child === 'string') { | ||||||
|  |           el.appendChild(createTextNode(child)); | ||||||
|  |         } else { | ||||||
|  |           if (child) { | ||||||
|  |             el.appendChild(child); | ||||||
|  |           } | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       for (var attr in attrs) { | ||||||
|  |         if (attr == 'className') { | ||||||
|  |           el[attr] = attrs[attr]; | ||||||
|  |         } else { | ||||||
|  |           el.setAttribute(attr, attrs[attr]); | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       return el; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function pluralize(singular, count) { | ||||||
|  |       var word = count == 1 ? singular : singular + 's'; | ||||||
|  | 
 | ||||||
|  |       return '' + count + ' ' + word; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function specHref(result) { | ||||||
|  |       return addToExistingQueryString('spec', result.fullName); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function seedHref(seed) { | ||||||
|  |       return addToExistingQueryString('seed', seed); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function defaultQueryString(key, value) { | ||||||
|  |       return '?' + key + '=' + value; | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function setMenuModeTo(mode) { | ||||||
|  |       htmlReporterMain.setAttribute('class', 'jasmine_html-reporter ' + mode); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function noExpectations(result) { | ||||||
|  |       var allExpectations = | ||||||
|  |         result.failedExpectations.length + result.passedExpectations.length; | ||||||
|  | 
 | ||||||
|  |       return ( | ||||||
|  |         allExpectations === 0 && | ||||||
|  |         (result.status === 'passed' || result.status === 'failed') | ||||||
|  |       ); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function hasActiveSpec(resultNode) { | ||||||
|  |       if (resultNode.type == 'spec' && resultNode.result.status != 'excluded') { | ||||||
|  |         return true; | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       if (resultNode.type == 'suite') { | ||||||
|  |         for (var i = 0, j = resultNode.children.length; i < j; i++) { | ||||||
|  |           if (hasActiveSpec(resultNode.children[i])) { | ||||||
|  |             return true; | ||||||
|  |           } | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   return HtmlReporter; | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | jasmineRequire.HtmlSpecFilter = function() { | ||||||
|  |   function HtmlSpecFilter(options) { | ||||||
|  |     var filterString = | ||||||
|  |       options && | ||||||
|  |       options.filterString() && | ||||||
|  |       options.filterString().replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&'); | ||||||
|  |     var filterPattern = new RegExp(filterString); | ||||||
|  | 
 | ||||||
|  |     this.matches = function(specName) { | ||||||
|  |       return filterPattern.test(specName); | ||||||
|  |     }; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   return HtmlSpecFilter; | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | jasmineRequire.ResultsNode = function() { | ||||||
|  |   function ResultsNode(result, type, parent) { | ||||||
|  |     this.result = result; | ||||||
|  |     this.type = type; | ||||||
|  |     this.parent = parent; | ||||||
|  | 
 | ||||||
|  |     this.children = []; | ||||||
|  | 
 | ||||||
|  |     this.addChild = function(result, type) { | ||||||
|  |       this.children.push(new ResultsNode(result, type, this)); | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     this.last = function() { | ||||||
|  |       return this.children[this.children.length - 1]; | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     this.updateResult = function(result) { | ||||||
|  |       this.result = result; | ||||||
|  |     }; | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   return ResultsNode; | ||||||
|  | }; | ||||||
|  | 
 | ||||||
|  | jasmineRequire.QueryString = function() { | ||||||
|  |   function QueryString(options) { | ||||||
|  |     this.navigateWithNewParam = function(key, value) { | ||||||
|  |       options.getWindowLocation().search = this.fullStringWithNewParam( | ||||||
|  |         key, | ||||||
|  |         value | ||||||
|  |       ); | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     this.fullStringWithNewParam = function(key, value) { | ||||||
|  |       var paramMap = queryStringToParamMap(); | ||||||
|  |       paramMap[key] = value; | ||||||
|  |       return toQueryString(paramMap); | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     this.getParam = function(key) { | ||||||
|  |       return queryStringToParamMap()[key]; | ||||||
|  |     }; | ||||||
|  | 
 | ||||||
|  |     return this; | ||||||
|  | 
 | ||||||
|  |     function toQueryString(paramMap) { | ||||||
|  |       var qStrPairs = []; | ||||||
|  |       for (var prop in paramMap) { | ||||||
|  |         qStrPairs.push( | ||||||
|  |           encodeURIComponent(prop) + '=' + encodeURIComponent(paramMap[prop]) | ||||||
|  |         ); | ||||||
|  |       } | ||||||
|  |       return '?' + qStrPairs.join('&'); | ||||||
|  |     } | ||||||
|  | 
 | ||||||
|  |     function queryStringToParamMap() { | ||||||
|  |       var paramStr = options.getWindowLocation().search.substring(1), | ||||||
|  |         params = [], | ||||||
|  |         paramMap = {}; | ||||||
|  | 
 | ||||||
|  |       if (paramStr.length > 0) { | ||||||
|  |         params = paramStr.split('&'); | ||||||
|  |         for (var i = 0; i < params.length; i++) { | ||||||
|  |           var p = params[i].split('='); | ||||||
|  |           var value = decodeURIComponent(p[1]); | ||||||
|  |           if (value === 'true' || value === 'false') { | ||||||
|  |             value = JSON.parse(value); | ||||||
|  |           } | ||||||
|  |           paramMap[decodeURIComponent(p[0])] = value; | ||||||
|  |         } | ||||||
|  |       } | ||||||
|  | 
 | ||||||
|  |       return paramMap; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | 
 | ||||||
|  |   return QueryString; | ||||||
|  | }; | ||||||
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							
							
								
								
									
										8218
									
								
								packages/splitjs/test/lib/jasmine-3.5.0/jasmine.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										8218
									
								
								packages/splitjs/test/lib/jasmine-3.5.0/jasmine.js
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							| Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB | 
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 PG Herveou
						PG Herveou