This commit is contained in:
2020-10-06 14:27:47 +07:00
commit 586be80cf6
16613 changed files with 3274099 additions and 0 deletions

15
vendor/bower-asset/yii2-pjax/.eslintrc vendored Normal file
View File

@@ -0,0 +1,15 @@
{ "extends": "eslint:recommended",
"env": {
"browser": true,
"jquery": true
},
"rules": {
"eqeqeq": "warn",
"no-eval": "error",
"no-extra-parens": "error",
"no-implicit-globals": "error",
"no-trailing-spaces": "error",
"no-unused-expressions": "error",
"semi": ["error", "never"]
}
}

19
vendor/bower-asset/yii2-pjax/.gitignore vendored Normal file
View File

@@ -0,0 +1,19 @@
# phpstorm project files
.idea
# netbeans project files
nbproject
# zend studio for eclipse project files
.buildpath
.project
.settings
# windows thumbnail cache
Thumbs.db
# Mac DS_Store Files
.DS_Store
# NodeJS deps
node_modules/

View File

@@ -0,0 +1,7 @@
sudo: false
language: node_js
node_js: "6"
before_script: script/bootstrap
notifications:
email: false

View File

@@ -0,0 +1,48 @@
yii-pjax Change Log
===================
v2.0.7.1 under development
------------------------
- Bug #61: Restore the last semicolon for Yii asset/compress (tanakahisateru)
2.0.7 Sep 27, 2017
-----------------
- Bug #46: Allow "data-pjax" attribute with no value in `handleClick` function (arogachev)
- Bug #52: Fixed form submit handling to prevent submit when event result is `false` (derekisbusy)
- Bug #52: Fixed PJAX initialization to prevent multiple PJAX handlers attachment on the same element (derekisbusy, silverfire)
- Bug #54: Fixed PJAX initialization not to modify history, when it is disabled (silverfire)
- Enh #57: jQuery 3.x compatibility (a761208, silverfire)
- Enh #51: Added `scrollOffset` option, updated `scrollTo` to support callback (derekisbusy)
- Bug: Fixed stylesheets loading to prevent styles override (voskobovich, silverfire)
- Merged updates from upstream. The update contains backward-incompatible changes, see [changes list](https://github.com/yiisoft/jquery-pjax/issues/55#issuecomment-310109608) to adjust your application accordingly. (silverfire)
2.0.6 Mar 4, 2016
-----------------
- Bug #15: Fixed duplication of `_pjax` GET variable (Alex-Code)
- Bug #21: Fixed non-persistence of `cache` option after backward navigation (nkovacs)
- Bug #23: Fixed loading of scripts in pjax containers (nkovacs, silverfire)
- Bug #37: Added `X-Ie-Redirect-Compatibility` header for IE. Fixes error on 302 redirect without `Location` header (silverfire)
- Enh #25: Blur the focused element if it's inside Pjax container (GeorgeGardiner)
- Enh #27: Added `pushRedirect`, `replaceRedirectOptions` options (beowulfenator)
- Chg: JavaScripts load through PJAX will be processed by `jQuery.ajaxPrefiler` when it's configured (silverfire)
- New: Added `skipOuterContainers` option (silverfire)
2.0.3 Mar 7, 2015
-----------------
- Chg: Merged changes from upstream (samdark)
2.0.2 Dec 4, 2014
-----------------
- Chg #12: Merged changes from upstream (samdark)
2.0.1 Oct 10, 2014
------------------
- Bug #9: Fixed missing history option in default settings (tonydspaniard)
- New #11: add new option "cache" (macklay)
2.0.0 Mar 20, 2014
------------------
- Bug: Fixed avoid duplicates of _pjax parameter (tof06)
- Bug: Fixed Pjax/GridView and back button (klevron, tof06, tonydspaniard)

View File

@@ -0,0 +1,37 @@
# Contributing
For running the tests, you will need:
* Ruby 1.9.3+ with Bundler
* PhantomJS (for headless testing)
First run bootstrap to ensure necessary dependencies:
```
$ script/bootstrap
```
Then run headless tests in the console:
```
$ script/test [<test-file>]
```
To run tests in other browsers, start a server:
```
$ script/server
# now open http://localhost:4567/
```
## Test structure
There are 3 main test modules:
* `test/unit/fn_pjax.js` - Primarily tests the `$.fn.pjax` method and its options
* `test/unit/pjax.js` - Main comprehensive pjax functionality tests
* `test/unit/pjax_fallback.js` - Tests that verify same result after navigation
even if pjax is disabled (like for browsers that don't support pushState).
Each test drives a hidden test page in an `<iframe>`. See other tests to see how
they trigger pjax by using the `frame` reference and remember to do so as well.

3
vendor/bower-asset/yii2-pjax/Gemfile vendored Normal file
View File

@@ -0,0 +1,3 @@
source 'https://rubygems.org'
gem 'sinatra'

View File

@@ -0,0 +1,20 @@
GEM
remote: https://rubygems.org/
specs:
rack (1.5.2)
rack-protection (1.5.3)
rack
sinatra (1.4.5)
rack (~> 1.4)
rack-protection (~> 1.4)
tilt (~> 1.3, >= 1.3.4)
tilt (1.4.1)
PLATFORMS
ruby
DEPENDENCIES
sinatra
BUNDLED WITH
1.14.6

20
vendor/bower-asset/yii2-pjax/LICENSE vendored Normal file
View File

@@ -0,0 +1,20 @@
Copyright (c) Chris Wanstrath
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.

389
vendor/bower-asset/yii2-pjax/README.md vendored Normal file
View File

@@ -0,0 +1,389 @@
# pjax = pushState + ajax, Yii 2.0 fork with enhancements
pjax is a jQuery plugin that uses ajax and pushState to deliver a fast browsing experience with real permalinks, page titles, and a working back button.
pjax works by fetching HTML from your server via ajax and replacing the content
of a container element on your page with the loaded HTML. It then updates the
current URL in the browser using pushState. This results in faster page
navigation for two reasons:
* No page resources (JS, CSS) get re-executed or re-applied;
* If the server is configured for pjax, it can render only partial page
contents and thus avoid the potentially costly full layout render.
### Status of this project
jquery-pjax is **largely unmaintained** at this point. It might continue to
receive important bug fixes, but _its feature set is frozen_ and it's unlikely
that it will get new features or enhancements.
## Installation
pjax depends on jQuery 1.8 or higher.
### Yii 2.0
There's no need to install library manually since it comes pre-installed with Yii 2.0.
### bower
```
$ bower install yii2-pjax
```
### standalone script
Or, add `yii2-pjax` to your app's `bower.json`.
``` json
"dependencies": {
"yii2-pjax": "latest"
}
```
### standalone
pjax can be downloaded directly into your app's public directory - just be sure you've loaded jQuery first.
Download and include `jquery.pjax.js` in your web page:
```
curl -LO https://raw.github.com/yiisoft/jquery-pjax/master/jquery.pjax.js
```
## Usage
### `$.fn.pjax`
The simplest and most common use of pjax looks like this:
``` javascript
$(document).pjax('a', '#pjax-container')
```
This will enable pjax on all links on the page and designate the container as `#pjax-container`.
If you are migrating an existing site, you probably don't want to enable pjax
everywhere just yet. Instead of using a global selector like `a`, try annotating
pjaxable links with `data-pjax`, then use `'a[data-pjax]'` as your selector. Or,
try this selector that matches any `<a data-pjax href=>` links inside a `<div
data-pjax>` container:
``` javascript
$(document).pjax('[data-pjax] a, a[data-pjax]', '#pjax-container')
```
#### Server-side configuration
Ideally, your server should detect pjax requests by looking at the special
`X-PJAX` HTTP header, and render only the HTML meant to replace the contents of
the container element (`#pjax-container` in our example) without the rest of
the page layout. Here is an example of how this might be done in Ruby on Rails:
``` ruby
def index
if request.headers['X-PJAX']
render :layout => false
end
end
```
If you'd like a more automatic solution than pjax for Rails check out [Turbolinks][].
[Check if there is a pjax plugin][plugins] for your favorite server framework.
Also check out [RailsCasts #294: Playing with PJAX][railscasts].
#### Arguments
The synopsis for the `$.fn.pjax` function is:
``` javascript
$(document).pjax(selector, [container], options)
```
1. `selector` is a string to be used for click [event delegation][$.fn.on].
2. `container` is a string selector that uniquely identifies the pjax container.
3. `options` is an object with keys described below.
##### pjax options
key | default | description
----|---------|------------
`timeout` | 650 | ajax timeout in milliseconds after which a full refresh is forced
`push` | true | use [pushState][] to add a browser history entry upon navigation
`replace` | false | replace URL without adding browser history entry
`maxCacheLength` | 20 | maximum cache size for previous container contents
`version` | | a string or function returning the current pjax version
`scrollTo` | 0 | vertical position to scroll to after navigation. To avoid changing scroll position, pass `false`. If set to `true` page will scroll to the pjax container. Can also be be a callback function with context and current hash passed in as parameters. E.g. `function (context, hash) { if (!hash) return $(context).offset().top; }`
`scrollOffset` | 0 | vertical offset that gets added to `scrollTo`. Can be a callback function with the current `scrollTo` value passed as a parameter.
`type` | `"GET"` | see [$.ajax][]
`dataType` | `"html"` | see [$.ajax][]
`container` | | CSS selector for the element where content should be replaced
`url` | link.href | a string or function that returns the URL for the ajax request
`target` | link | eventually the `relatedTarget` value for [pjax events](#events)
`fragment` | | CSS selector for the fragment to extract from ajax response
`pushRedirect` | false | whether to add a browser history entry upon redirect
`replaceRedirect` | true | whether to replace URL without adding a browser history entry upon redirect
`skipOuterContainers` | false | When pjax containers are nested and this option is true, the closest pjax block will handle the event. Otherwise, the top container will handle the event
`ieRedirectCompatibility` | true | Whether to add `X-Ie-Redirect-Compatibility` header for the request on IE. Fixes IE error on 302 redirect without `Location` header
You can change the defaults globally by writing to the `$.pjax.defaults` object:
``` javascript
$.pjax.defaults.timeout = 1200
```
### `$.pjax.click`
This is a lower level function used by `$.fn.pjax` itself. It allows you to get a little more control over the pjax event handling.
This example uses the current click context to set an ancestor element as the container:
``` javascript
if ($.support.pjax) {
$(document).on('click', 'a[data-pjax]', function(event) {
var container = $(this).closest('[data-pjax-container]')
var containerSelector = '#' + container.id
$.pjax.click(event, {container: containerSelector})
})
}
```
**NOTE** Use the explicit `$.support.pjax` guard. We aren't using `$.fn.pjax` so we should avoid binding this event handler unless the browser is actually going to use pjax.
### `$.pjax.submit`
Submits a form via pjax.
``` javascript
$(document).on('submit', 'form[data-pjax]', function(event) {
$.pjax.submit(event, '#pjax-container')
})
```
### `$.pjax.reload`
Initiates a request for the current URL to the server using pjax mechanism and replaces the container with the response. Does not add a browser history entry.
``` javascript
$.pjax.reload('#pjax-container', options)
```
### `$.pjax`
Manual pjax invocation. Used mainly when you want to start a pjax request in a handler that didn't originate from a click. If you can get access to a click `event`, consider `$.pjax.click(event)` instead.
``` javascript
function applyFilters() {
var url = urlForFilters()
$.pjax({url: url, container: '#pjax-container'})
}
```
## Events
All pjax events except `pjax:click` & `pjax:clicked` are fired from the pjax
container element.
<table>
<tr>
<th>event</th>
<th>cancel</th>
<th>arguments</th>
<th>notes</th>
</tr>
<tr>
<th colspan=4>event lifecycle upon following a pjaxed link</th>
</tr>
<tr>
<td><code>pjax:click</code></td>
<td>✔︎</td>
<td><code>options</code></td>
<td>fires from a link that got activated; cancel to prevent pjax</td>
</tr>
<tr>
<td><code>pjax:beforeSend</code></td>
<td>✔︎</td>
<td><code>xhr, options</code></td>
<td>can set XHR headers</td>
</tr>
<tr>
<td><code>pjax:start</code></td>
<td></td>
<td><code>xhr, options</code></td>
<td></td>
</tr>
<tr>
<td><code>pjax:send</code></td>
<td></td>
<td><code>xhr, options</code></td>
<td></td>
</tr>
<tr>
<td><code>pjax:clicked</code></td>
<td></td>
<td><code>options</code></td>
<td>fires after pjax has started from a link that got clicked</td>
</tr>
<tr>
<td><code>pjax:beforeReplace</code></td>
<td></td>
<td><code>contents, options</code></td>
<td>before replacing HTML with content loaded from the server</td>
</tr>
<tr>
<td><code>pjax:success</code></td>
<td></td>
<td><code>data, status, xhr, options</code></td>
<td>after replacing HTML content loaded from the server</td>
</tr>
<tr>
<td><code>pjax:timeout</code></td>
<td>✔︎</td>
<td><code>xhr, options</code></td>
<td>fires after <code>options.timeout</code>; will hard refresh unless canceled</td>
</tr>
<tr>
<td><code>pjax:error</code></td>
<td>✔︎</td>
<td><code>xhr, textStatus, error, options</code></td>
<td>on ajax error; will hard refresh unless canceled</td>
</tr>
<tr>
<td><code>pjax:complete</code></td>
<td></td>
<td><code>xhr, textStatus, options</code></td>
<td>always fires after ajax, regardless of result</td>
</tr>
<tr>
<td><code>pjax:end</code></td>
<td></td>
<td><code>xhr, options</code></td>
<td></td>
</tr>
<tr>
<th colspan=4>event lifecycle on browser Back/Forward navigation</th>
</tr>
<tr>
<td><code>pjax:popstate</code></td>
<td></td>
<td></td>
<td>event <code>direction</code> property: &quot;back&quot;/&quot;forward&quot;</td>
</tr>
<tr>
<td><code>pjax:start</code></td>
<td></td>
<td><code>null, options</code></td>
<td>before replacing content</td>
</tr>
<tr>
<td><code>pjax:beforeReplace</code></td>
<td></td>
<td><code>contents, options</code></td>
<td>right before replacing HTML with content from cache</td>
</tr>
<tr>
<td><code>pjax:end</code></td>
<td></td>
<td><code>null, options</code></td>
<td>after replacing content</td>
</tr>
</table>
`pjax:send` & `pjax:complete` are a good pair of events to use if you are implementing a
loading indicator. They'll only be triggered if an actual XHR request is made,
not if the content is loaded from cache:
``` javascript
$(document).on('pjax:send', function() {
$('#loading').show()
})
$(document).on('pjax:complete', function() {
$('#loading').hide()
})
```
An example of canceling a `pjax:timeout` event would be to disable the fallback
timeout behavior if a spinner is being shown:
``` javascript
$(document).on('pjax:timeout', function(event) {
// Prevent default timeout redirection behavior
event.preventDefault()
})
```
## Advanced configuration
### Reinitializing plugins/widget on new page content
The whole point of pjax is that it fetches and inserts new content _without_
refreshing the page. However, other jQuery plugins or libraries that are set to
react on page loaded event (such as `DOMContentLoaded`) will not pick up on
these changes. Therefore, it's usually a good idea to configure these plugins to
reinitialize in the scope of the updated page content. This can be done like so:
``` js
$(document).on('ready pjax:end', function(event) {
$(event.target).initializeMyPlugin()
})
```
This will make `$.fn.initializeMyPlugin()` be called at the document level on
normal page load, and on the container level after any pjax navigation (either
after clicking on a link or going Back in the browser).
### Response types that force a reload
By default, pjax will force a full reload of the page if it receives one of the
following responses from the server:
* Page content that includes `<html>` when `fragment` selector wasn't explicitly
configured. Pjax presumes that the server's response hasn't been properly
configured for pjax. If `fragment` pjax option is given, pjax will extract the
content based on that selector.
* Page content that is blank. Pjax assumes that the server is unable to deliver
proper pjax contents.
* HTTP response code that is 4xx or 5xx, indicating some server error.
### Affecting the browser URL
If the server needs to affect the URL which will appear in the browser URL after
pjax navigation (like HTTP redirects work for normal requests), it can set the
`X-PJAX-URL` header:
``` ruby
def index
request.headers['X-PJAX-URL'] = "http://example.com/hello"
end
```
### Layout Reloading
Layouts can be forced to do a hard reload when assets or html changes.
First set the initial layout version in your header with a custom meta tag.
``` html
<meta http-equiv="x-pjax-version" content="v123">
```
Then from the server side, set the `X-PJAX-Version` header to the same.
``` ruby
if request.headers['X-PJAX']
response.headers['X-PJAX-Version'] = "v123"
end
```
Deploying a deploy, bumping the version constant to force clients to do a full reload the next request getting the new layout and assets.
[$.fn.on]: http://api.jquery.com/on/
[$.ajax]: http://api.jquery.com/jQuery.ajax/
[pushState]: https://developer.mozilla.org/en-US/docs/Web/Guide/API/DOM/Manipulating_the_browser_history#Adding_and_modifying_history_entries
[plugins]: https://gist.github.com/4283721
[turbolinks]: https://github.com/rails/turbolinks
[railscasts]: http://railscasts.com/episodes/294-playing-with-pjax

18
vendor/bower-asset/yii2-pjax/bower.json vendored Normal file
View File

@@ -0,0 +1,18 @@
{
"name": "yii2-pjax",
"version": "2.0.7.1",
"main": "./jquery.pjax.js",
"license": "MIT",
"dependencies": {
"jquery": ">=1.8"
},
"ignore": [
".travis.yml",
"Gemfile",
"Gemfile.lock",
"CONTRIBUTING.md",
"vendor/",
"script/",
"test/"
]
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,22 @@
{
"name": "yii2-pjax",
"version": "2.0.7.1",
"main": "jquery.pjax.js",
"repository": "yiisoft/jquery-pjax",
"licenses": [
{
"type": "MIT",
"url": "https://github.com/yiisoft/jquery-pjax/blob/master/LICENSE"
}
],
"files" : [
"LICENSE",
"jquery.pjax.js"
],
"devDependencies": {
"eslint": "^3.19.0"
},
"scripts": {
"test": "./script/test"
}
}

View File

@@ -0,0 +1,12 @@
#!/usr/bin/env bash
set -e
[ -n "$CI" ] || npm install
bundle install
if phantom_version="$(phantomjs --version)"; then
echo "PhantomJS $phantom_version"
else
echo "Warning: script/test will not be able to run, but you can still start" >&2
echo "script/server and open the test suite in your browser." >&2
fi

View File

@@ -0,0 +1,4 @@
#!/usr/bin/env bash
set -e
exec bundle exec ruby ./test/app.rb "$@"

View File

@@ -0,0 +1,19 @@
#!/usr/bin/env bash
set -e
./node_modules/.bin/eslint *.js
port=3999
script/server -p "$port" &>/dev/null &
pid=$!
trap "kill $pid" EXIT INT
while ! lsof -i :$port >/dev/null; do
sleep .05
done
phantomjs ./test/run-qunit.js \
"http://localhost:$port/?jquery=3.2" \
"http://localhost:$port/?jquery=2.2" \
"http://localhost:$port/?jquery=1.12"

106
vendor/bower-asset/yii2-pjax/test/app.rb vendored Normal file
View File

@@ -0,0 +1,106 @@
require 'sinatra'
require 'json'
set :public_folder, File.dirname(settings.root)
enable :static
jquery_version = '3.2'
helpers do
def pjax?
env['HTTP_X_PJAX'] && !params[:layout]
end
def title(str)
if pjax?
"<title>#{str}</title>"
else
@title = str
nil
end
end
define_method(:jquery_version) do
jquery_version
end
end
after do
if pjax?
response.headers['X-PJAX-URL'] ||= request.url
response.headers['X-PJAX-Version'] = 'v1'
end
end
get '/' do
jquery_version = params[:jquery] if params[:jquery]
erb :qunit
end
get '/env.html' do
erb :env, :layout => !pjax?
end
post '/env.html' do
erb :env, :layout => !pjax?
end
put '/env.html' do
erb :env, :layout => !pjax?
end
delete '/env.html' do
erb :env, :layout => !pjax?
end
get '/redirect.html' do
if params[:anchor]
path = "/hello.html##{params[:anchor]}"
if pjax?
response.headers['X-PJAX-URL'] = uri(path)
status 200
else
redirect path
end
else
redirect "/hello.html"
end
end
get '/timeout.html' do
if pjax?
sleep 1
erb :timeout, :layout => false
else
erb :timeout
end
end
post '/timeout.html' do
if pjax?
sleep 1
erb :timeout, :layout => false
else
status 500
erb :boom
end
end
get '/boom.html' do
status 500
erb :boom, :layout => !pjax?
end
get '/boom_sans_pjax.html' do
status 500
erb :boom_sans_pjax, :layout => false
end
get '/:page.html' do
erb :"#{params[:page]}", :layout => !pjax?
end
get '/some-&-path/hello.html' do
erb :hello, :layout => !pjax?
end

View File

@@ -0,0 +1 @@
window.externalScriptLoaded()

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

@@ -0,0 +1,87 @@
var fs = require('fs')
var suites = require('system').args.slice(1)
function print(s) {
fs.write('/dev/stdout', s, 'w')
}
var page = require('webpage').create()
page.onConsoleMessage = function(msg) {
console.log(msg)
}
page.onError = function(msg) {
console.error('ERROR: ' + msg)
}
var timeoutId = null
function deferTimeout() {
if (timeoutId) clearTimeout(timeoutId)
timeoutId = setTimeout(function() {
console.error('Timeout')
phantom.exit(1)
}, 3000)
}
var endresult = 0
function runSuite() {
var suite = suites.shift()
if (!suite) {
phantom.exit(endresult)
return
}
page.open(suite, function() {
deferTimeout()
var interval = setInterval(function() {
var tests = page.evaluate(function() {
var results = []
var els = document.getElementById('qunit-tests').children
for (var i = 0; i < els.length; i++) {
var test = els[i]
if (test.className !== 'running' && !test.recorded) {
test.recorded = true
if (test.className === 'pass') results.push('.')
else if (test.className === 'fail') results.push('F')
}
}
return results
})
for (var i = 0; i < tests.length; i++) {
deferTimeout()
print(tests[i])
}
var result = page.evaluate(function() {
var testresult = document.getElementById('qunit-testresult')
var els = document.getElementById('qunit-tests').children
if (testresult.innerText.match(/completed/)) {
console.log('')
for (var i = 0; i < els.length; i++) {
var test = els[i]
if (test.className === 'fail') {
console.error(test.innerText)
}
}
console.log(testresult.innerText)
return parseInt(testresult.getElementsByClassName('failed')[0].innerText)
}
})
if (result != null) {
endresult = result
clearInterval(interval)
runSuite()
}
}, 100)
})
}
runSuite()

View File

@@ -0,0 +1,246 @@
if ($.support.pjax) {
module("$.fn.pjax", {
setup: function() {
var self = this
stop()
window.iframeLoad = function(frame) {
self.frame = frame
window.iframeLoad = $.noop
start()
}
$("#qunit-fixture").append("<iframe src='home.html'>")
},
teardown: function() {
delete window.iframeLoad
}
})
asyncTest("pushes new url", function() {
var frame = this.frame
frame.$("#main").pjax("a", "#main").on("pjax:end", function() {
equal(frame.location.pathname, "/dinosaurs.html")
start()
})
frame.$("a[href='/dinosaurs.html']").click()
})
asyncTest("replaces container html from response data", function() {
var frame = this.frame
frame.$("#main").pjax("a", "#main").on("pjax:end", function() {
equal(frame.$("iframe").attr('title'), "YouTube video player")
start()
})
frame.$("a[href='/dinosaurs.html']").click()
})
asyncTest("sets title to response title tag", function() {
var frame = this.frame
frame.$("#main").pjax("a", "#main").on("pjax:end", function() {
equal(frame.document.title, "dinosaurs")
start()
})
frame.$("a[href='/dinosaurs.html']").trigger('click')
})
asyncTest("uses second argument as options", function() {
var frame = this.frame
frame.$("#main").pjax("a", {container: "#main", push: true}).on("pjax:end", function() {
equal(frame.location.pathname, "/dinosaurs.html")
start()
})
frame.$("a[href='/dinosaurs.html']").click()
})
asyncTest("uses second argument as container and third as options", function() {
var frame = this.frame
frame.$("body").pjax("a", "#main", {push: true}).on("pjax:end", function() {
equal(frame.location.pathname, "/dinosaurs.html")
start()
})
frame.$("a[href='/dinosaurs.html']").click()
})
asyncTest("defaults to data-pjax container", function() {
var frame = this.frame
frame.$("a").attr('data-pjax', "#main")
frame.$("body").pjax("a")
frame.$("#main").on("pjax:end", function() {
equal(frame.location.pathname, "/dinosaurs.html")
start()
})
frame.$("a[href='/dinosaurs.html']").click()
})
asyncTest("sets relatedTarget to clicked element", function() {
var frame = this.frame
frame.$("#main").pjax("a", "#main")
var link = frame.$("a[href='/dinosaurs.html']")[0]
frame.$("#main").on("pjax:end", function(event, xhr, options) {
equal(link, event.relatedTarget)
start()
})
frame.$(link).click()
})
asyncTest("doesn't ignore left click", function() {
var frame = this.frame
frame.$("#main").pjax("a", "#main")
var event = frame.$.Event('click')
event.which = 0
frame.$("a[href='/dinosaurs.html']").trigger(event)
ok(event.isDefaultPrevented())
start()
})
asyncTest("ignores middle clicks", function() {
var frame = this.frame
frame.$("#main").pjax("a", "#main")
var event = frame.$.Event('click')
event.which = 3
frame.$("a[href='/dinosaurs.html']").trigger(event)
ok(!event.isDefaultPrevented())
start()
})
asyncTest("ignores command clicks", function() {
var frame = this.frame
frame.$("#main").pjax("a")
var event = frame.$.Event('click')
event.metaKey = true
frame.$("a[href='/dinosaurs.html']").trigger(event)
ok(!event.isDefaultPrevented())
start()
})
asyncTest("ignores ctrl clicks", function() {
var frame = this.frame
frame.$("#main").pjax("a")
var event = frame.$.Event('click')
event.ctrlKey = true
frame.$("a[href='/dinosaurs.html']").trigger(event)
ok(!event.isDefaultPrevented())
start()
})
asyncTest("ignores cross origin links", function() {
var frame = this.frame
frame.$("#main").pjax("a")
var event = frame.$.Event('click')
frame.$("a[href='https://www.google.com/']").trigger(event)
notEqual(event.result, false)
start()
})
asyncTest("ignores same page anchors", function() {
var event, frame = this.frame
frame.$("#main").pjax("a")
event = frame.$.Event('click')
frame.$("a[href='#main']").trigger(event)
equal(event.isDefaultPrevented(), false)
event = frame.$.Event('click')
frame.$("a[href='#']").trigger(event)
equal(event.isDefaultPrevented(), false)
start()
})
asyncTest("ignores same page anchors from URL that has hash", function() {
var event, frame = this.frame
frame.window.location = "#foo"
frame.$("#main").pjax("a")
event = frame.$.Event('click')
frame.$("a[href='#main']").trigger(event)
equal(event.isDefaultPrevented(), false)
event = frame.$.Event('click')
frame.$("a[href='#']").trigger(event)
equal(event.isDefaultPrevented(), false)
start()
})
asyncTest("ignores event with prevented default", function() {
var frame = this.frame
var eventIgnored = true
frame.$("#main").pjax("a").on("pjax:click", function() {
eventIgnored = false
})
frame.$("a[href='/dinosaurs.html']").on("click", function(event) {
event.preventDefault()
setTimeout(function() {
ok(eventIgnored, "Event with prevented default ignored")
start()
}, 10)
})
frame.$("a[href='/dinosaurs.html']").click()
})
asyncTest("triggers pjax:click event from link", function() {
var frame = this.frame
frame.$("#main").pjax("a", "#main").on("pjax:click", function(event, options) {
ok(event)
equal(options.container, "#main")
ok(options.url.match("/dinosaurs.html"))
start()
})
frame.$("a[href='/dinosaurs.html']").click()
})
asyncTest("triggers pjax:clicked event from link", function() {
var frame = this.frame
frame.$("#main").pjax("a", "#main").on("pjax:clicked", function(event, options) {
ok(event)
equal(options.container, "#main")
ok(options.url.match("/dinosaurs.html"))
start()
})
frame.$("a[href='/dinosaurs.html']").click()
})
}

View File

@@ -0,0 +1,66 @@
// Navigation helper for the test iframe. Queues navigation actions and
// callbacks, then executes them serially with respect to async. This is to
// avoid deep nesting of callbacks in tests.
//
// If a `then`able object is returned from a callback, then the navigation will
// resume only after the promise has been resolved.
//
// After last successful navigation, asyncTest is automatically resumed.
//
// Usage:
//
// navigate(this.frame)
// .pjax(pjaxOptions, function(frame){ ... }
// .back(-1, function(frame){ ... }
//
function navigate(frame) {
var queue = []
var api = {}
api.pjax = function(options, callback) {
queue.push([options, callback])
return api
}
api.back = api.pjax
var workOff = function() {
var item = queue.shift()
if (!item) {
start()
return
}
var target = item[0], callback = item[1]
frame.$(frame.document).one("pjax:end", function() {
var promise = callback && callback(frame)
if (promise && typeof promise.then == "function") promise.then(workOff)
else setTimeout(workOff, 0)
})
if (typeof target == "number") {
frame.history.go(target)
} else {
frame.$.pjax(target)
}
}
setTimeout(workOff, 0)
return api
}
// A poor man's Promise implementation. Only resolvable promises with no
// reject/catch support.
function PoorMansPromise(setup) {
var result, callback, i = 0, callbacks = []
setup(function(_result) {
result = _result
while (callback = callbacks[i++]) callback(result)
})
this.then = function(done) {
if (i == 0) callbacks.push(done)
else setTimeout(function(){ done(result) }, 0)
return this
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,461 @@
// $.pjax fallback tests should run on both pushState and
// non-pushState compatible browsers.
$.each([true, false], function() {
var disabled = this == false
var s = disabled ? " (disabled)" : ""
var ua = navigator.userAgent
var safari = ua.match("Safari") && !ua.match("Chrome") && !ua.match("Edge")
var chrome = ua.match("Chrome") && !ua.match("Edge")
module("$.pjax fallback"+s, {
setup: function() {
var self = this
stop()
this.loaded = function(frame) {
self.frame = frame
self.loaded = $.noop
start()
}
window.iframeLoad = function(frame) {
setTimeout(function() {
if (disabled && frame.$ && frame.$.pjax) frame.$.pjax.disable()
self.loaded(frame)
}, 0)
}
$("#qunit-fixture").append("<iframe src='home.html'>")
},
teardown: function() {
delete window.iframeLoad
}
})
asyncTest("sets new url"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/hello.html")
start()
}
frame.$.pjax({
url: "hello.html",
container: "#main"
})
})
asyncTest("sets new url for function"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/hello.html")
start()
}
frame.$.pjax({
url: function() { return "hello.html" },
container: "#main"
})
})
asyncTest("updates container html"+s, function() {
var frame = this.frame
this.loaded = function(frame) {
equal(frame.$("#main p").html(), "Hello!")
start()
}
frame.$.pjax({
url: "/hello.html",
container: "#main"
})
})
asyncTest("sets title to response <title>"+s, function() {
var frame = this.frame
this.loaded = function(frame) {
equal(frame.document.title, "Hello")
start()
}
frame.$.pjax({
url: "/hello.html",
container: "#main"
})
})
asyncTest("sends correct HTTP referer"+s, function() {
var frame = this.frame
this.loaded = function(frame) {
var referer = frame.document.getElementById("referer").textContent
ok(referer.match("/home.html"), referer)
start()
}
frame.$.pjax({
url: "/referer.html",
container: "#main"
})
})
asyncTest("scrolls to top of the page"+s, function() {
var frame = this.frame
frame.window.scrollTo(0, 100)
equal(frame.window.pageYOffset, 100)
this.loaded = function(frame) {
equal(frame.window.pageYOffset, 0)
start()
}
frame.$.pjax({
url: "/long.html",
container: "#main"
})
})
asyncTest("scrolls to anchor at top page"+s, function() {
var frame = this.frame
equal(frame.window.pageYOffset, 0)
this.loaded = function(frame) {
setTimeout(function() {
equal(frame.location.pathname, "/anchor.html")
equal(frame.location.hash, "#top")
equal(frame.window.pageYOffset, 8)
start()
}, 100)
}
frame.$.pjax({
url: "/anchor.html#top",
container: "#main"
})
if (disabled) {
equal(frame.location.pathname, "/home.html")
equal(frame.location.href.indexOf("#"), -1)
} else {
equal(frame.location.pathname, "/anchor.html")
equal(frame.location.hash, "#top")
}
})
asyncTest("empty anchor doesn't scroll page"+s, function() {
var frame = this.frame
equal(frame.window.pageYOffset, 0)
this.loaded = function(frame) {
setTimeout(function() {
equal(frame.window.pageYOffset, 0)
start()
}, 10)
}
frame.$.pjax({
url: "/anchor.html#",
container: "#main"
})
})
asyncTest("scrolls to anchor at bottom page"+s, function() {
var frame = this.frame
equal(frame.window.pageYOffset, 0)
this.loaded = function(frame) {
setTimeout(function() {
equal(frame.window.pageYOffset, 10008)
start()
}, 10)
}
frame.$.pjax({
url: "/anchor.html#bottom",
container: "#main"
})
})
asyncTest("scrolls to named encoded anchor"+s, function() {
var frame = this.frame
equal(frame.window.pageYOffset, 0)
this.loaded = function(frame) {
setTimeout(function() {
equal(frame.window.pageYOffset, 10008)
start()
}, 10)
}
frame.$.pjax({
url: "/anchor.html#%62%6F%74%74%6F%6D",
container: "#main"
})
})
asyncTest("sets GET method"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/env.html")
var env = JSON.parse(frame.$("#env").text())
equal(env['REQUEST_METHOD'], "GET")
start()
}
frame.$.pjax({
type: 'GET',
url: "env.html",
container: "#main"
})
})
asyncTest("sets POST method"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/env.html")
var env = JSON.parse(frame.$("#env").text())
equal(env['REQUEST_METHOD'], "POST")
start()
}
frame.$.pjax({
type: 'POST',
url: "env.html",
container: "#main"
})
})
asyncTest("sets PUT method"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/env.html")
var env = JSON.parse(frame.$("#env").text())
equal(env['REQUEST_METHOD'], "PUT")
start()
}
frame.$.pjax({
type: 'PUT',
url: "env.html",
container: "#main"
})
})
asyncTest("sets DELETE method"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/env.html")
var env = JSON.parse(frame.$("#env").text())
equal(env['REQUEST_METHOD'], "DELETE")
start()
}
frame.$.pjax({
type: 'DELETE',
url: "env.html",
container: "#main"
})
})
asyncTest("GET with data object"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/env.html")
equal(frame.location.search, "?foo=bar")
var env = JSON.parse(frame.$("#env").text())
equal(env['REQUEST_METHOD'], "GET")
equal(env['rack.request.query_hash']['foo'], 'bar')
start()
}
frame.$.pjax({
type: 'GET',
url: "env.html",
data: {foo: 'bar'},
container: "#main"
})
})
asyncTest("POST with data object"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/env.html")
equal(frame.location.search, "")
var env = JSON.parse(frame.$("#env").text())
equal(env['REQUEST_METHOD'], "POST")
equal(env['rack.request.form_hash']['foo'], 'bar')
start()
}
frame.$.pjax({
type: 'POST',
url: "env.html",
data: {foo: 'bar'},
container: "#main"
})
})
asyncTest("GET with data array"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/env.html")
equal(frame.location.search, "?foo%5B%5D=bar&foo%5B%5D=baz")
var env = JSON.parse(frame.$("#env").text())
equal(env['REQUEST_METHOD'], "GET")
var expected = {'foo': ['bar', 'baz']}
if (!disabled) expected._pjax = "#main"
deepEqual(env['rack.request.query_hash'], expected)
start()
}
frame.$.pjax({
type: 'GET',
url: "env.html",
data: [{name: "foo[]", value: "bar"}, {name: "foo[]", value: "baz"}],
container: "#main"
})
})
asyncTest("POST with data array"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/env.html")
equal(frame.location.search, "")
var env = JSON.parse(frame.$("#env").text())
equal(env['REQUEST_METHOD'], "POST")
var expected = {'foo': ['bar', 'baz']}
if (!disabled) expected._pjax = "#main"
deepEqual(env['rack.request.form_hash'], expected)
start()
}
frame.$.pjax({
type: 'POST',
url: "env.html",
data: [{name: "foo[]", value: "bar"}, {name: "foo[]", value: "baz"}],
container: "#main"
})
})
asyncTest("GET with data string"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/env.html")
equal(frame.location.search, "?foo=bar")
var env = JSON.parse(frame.$("#env").text())
equal(env['REQUEST_METHOD'], "GET")
equal(env['rack.request.query_hash']['foo'], 'bar')
start()
}
frame.$.pjax({
type: 'GET',
url: "env.html",
data: "foo=bar",
container: "#main"
})
})
asyncTest("POST with data string"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/env.html")
equal(frame.location.search, "")
var env = JSON.parse(frame.$("#env").text())
equal(env['REQUEST_METHOD'], "POST")
equal(env['rack.request.form_hash']['foo'], 'bar')
start()
}
frame.$.pjax({
type: 'POST',
url: "env.html",
data: "foo=bar",
container: "#main"
})
})
asyncTest("handle form submit"+s, function() {
var frame = this.frame
frame.$(frame.document).on("submit", "form", function(event) {
frame.$.pjax.submit(event, "#main")
})
this.loaded = function() {
var env = JSON.parse(frame.$("#env").text())
var expected = {foo: "1", bar: "2"}
if (!disabled) expected._pjax = "#main"
deepEqual(env['rack.request.query_hash'], expected)
start()
}
frame.$("form").submit()
})
asyncTest("browser URL is correct after redirect"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/hello.html")
var expectedHash = safari && disabled ? "" : "#new"
equal(frame.location.hash, expectedHash)
start()
}
frame.$.pjax({
url: "redirect.html#new",
container: "#main"
})
})
asyncTest("server can't affect anchor after redirect"+s, function() {
var frame = this.frame
this.loaded = function() {
equal(frame.location.pathname, "/hello.html")
var expectedHash = safari && disabled ? "" : "#new"
equal(frame.location.hash, expectedHash)
start()
}
frame.$.pjax({
url: "redirect.html?anchor=server#new",
container: "#main"
})
})
})

View File

@@ -0,0 +1,11 @@
<%= title 'aliens' %>
<ul>
<li><a href="/home.html">home</a></li>
<li><a href="/dinosaurs.html">dinosaurs</a></li>
<li>aliens</li>
</ul>
<img src="/img/aliens.jpg" title="aliens">
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

@@ -0,0 +1,4 @@
<%= title 'Anchor' %>
<div id="top" style="width:500px;height:10000px;"></div>
<a name="bottom" style="width:500px;height:10000px;display:block;"></a>
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

@@ -0,0 +1 @@
<p>500</p>

View File

@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>500 sans pjax</title>
</head>
<body>
<div id="main">
<p>500 sans pjax</p>
</div>
</body>
</html>

View File

@@ -0,0 +1,11 @@
<%= title 'dinosaurs' %>
<ul>
<li><a href="/home.html">home</a></li>
<li>dinosaurs</li>
<li><a href="/aliens.html">aliens</a></li>
</ul>
<iframe title="YouTube video player" width="480" height="390" src="http://www.youtube.com/embed/GcjxwXCxBBU" frameborder="0" allowfullscreen></iframe>
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

@@ -0,0 +1,3 @@
<%= title 'Hello' %>
<p><title>World!</title> Hello!</p>
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

View File

@@ -0,0 +1,2 @@
<div id="env"><%= Rack::Utils.escape_html JSON.generate(request.env) %></div>
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

@@ -0,0 +1,7 @@
<div id="foo" title="Foo">
<p>Foo</p>
</div>
<div id="bar" data-title="Bar">
<p>Bar</p>
</div>

View File

@@ -0,0 +1,4 @@
<%= title 'Hello' %>
<p>Hello!</p>
How's it going?
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

@@ -0,0 +1,19 @@
<%= title 'Home' %>
<ul>
<li>home</li>
<li><a href="/dinosaurs.html">dinosaurs</a></li>
<li><a href="/aliens.html">aliens</a></li>
<li><a href="https://www.google.com/">Google</a></li>
<li><a href="#main">Main</a></li>
<li><a href="#">Empty</a></li>
</ul>
<form action="env.html" method="GET">
<input name="foo" value="1">
<input name="bar" value="2">
</form>
<div style="width:500px;height:10000px;"></div>
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><%= @title %></title>
<script type="text/javascript" src="/vendor/jquery-<%= jquery_version %>.js"></script>
<script type="text/javascript" src="/jquery.pjax.js"></script>
</head>
<body>
<div id="main">
<%= yield %>
</div>
</body>
</html>

View File

@@ -0,0 +1,4 @@
<%= title 'Long' %>
<p>Long Page</p>
<div style="width:500px;height:10000px;"></div>
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

@@ -0,0 +1,2 @@
<p><%= title 'Hello' %> Hello!</p>
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="/vendor/qunit.css">
<meta name="viewport" content="initial-scale=1.0,width=device-width">
<script type="text/javascript" src="/vendor/jquery-<%= jquery_version %>.js"></script>
<script type="text/javascript" src="/vendor/qunit.js"></script>
<script type="text/javascript">QUnit.config.testTimeout = 2000</script>
<script type="text/javascript" src="/jquery.pjax.js"></script>
<script type="text/javascript" src="/test/unit/helpers.js"></script>
<script type="text/javascript" src="/test/unit/pjax.js"></script>
<script type="text/javascript" src="/test/unit/fn_pjax.js"></script>
<script type="text/javascript" src="/test/unit/pjax_fallback.js"></script>
</head>
<body>
<div id="qunit"></div>
<ol id="qunit-fixture"></ol>
</body>
</html>

View File

@@ -0,0 +1,2 @@
<p id="referer"><%= request.referer %></p>
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

@@ -0,0 +1,8 @@
<p>Got some script tags here</p>
<script type="text/javascript" src="/test/evaled.js?1"></script>
<script src="/test/evaled.js?2"></script>
<script type="text/javascript">
window.evaledInlineLog = window.evaledInlineLog || []
window.evaledInlineLog.push('<%= params[:name] %>')
</script>
<script type="text/javascript">window.parent.iframeLoad(window)</script>

View File

@@ -0,0 +1,5 @@
<%= title 'Timeout!' %>
<p>SLOW DOWN!</p>
<script type="text/javascript">window.parent.iframeLoad(window)</script>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,244 @@
/**
* QUnit v1.11.0 - A JavaScript Unit Testing Framework
*
* http://qunitjs.com
*
* Copyright 2012 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*/
/** Font Family and Sizes */
#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
}
#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
#qunit-tests { font-size: smaller; }
/** Resets */
#qunit-tests, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
margin: 0;
padding: 0;
}
/** Header */
#qunit-header {
padding: 0.5em 0 0.5em 1em;
color: #8699a4;
background-color: #0d3349;
font-size: 1.5em;
line-height: 1em;
font-weight: normal;
border-radius: 5px 5px 0 0;
-moz-border-radius: 5px 5px 0 0;
-webkit-border-top-right-radius: 5px;
-webkit-border-top-left-radius: 5px;
}
#qunit-header a {
text-decoration: none;
color: #c2ccd1;
}
#qunit-header a:hover,
#qunit-header a:focus {
color: #fff;
}
#qunit-testrunner-toolbar label {
display: inline-block;
padding: 0 .5em 0 .1em;
}
#qunit-banner {
height: 5px;
}
#qunit-testrunner-toolbar {
padding: 0.5em 0 0.5em 2em;
color: #5E740B;
background-color: #eee;
overflow: hidden;
}
#qunit-userAgent {
padding: 0.5em 0 0.5em 2.5em;
background-color: #2b81af;
color: #fff;
text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
}
#qunit-modulefilter-container {
float: right;
}
/** Tests: Pass/Fail */
#qunit-tests {
list-style-position: inside;
}
#qunit-tests li {
padding: 0.4em 0.5em 0.4em 2.5em;
border-bottom: 1px solid #fff;
list-style-position: inside;
}
#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running {
display: none;
}
#qunit-tests li strong {
cursor: pointer;
}
#qunit-tests li a {
padding: 0.5em;
color: #c2ccd1;
text-decoration: none;
}
#qunit-tests li a:hover,
#qunit-tests li a:focus {
color: #000;
}
#qunit-tests li .runtime {
float: right;
font-size: smaller;
}
.qunit-assert-list {
margin-top: 0.5em;
padding: 0.5em;
background-color: #fff;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
}
.qunit-collapsed {
display: none;
}
#qunit-tests table {
border-collapse: collapse;
margin-top: .2em;
}
#qunit-tests th {
text-align: right;
vertical-align: top;
padding: 0 .5em 0 0;
}
#qunit-tests td {
vertical-align: top;
}
#qunit-tests pre {
margin: 0;
white-space: pre-wrap;
word-wrap: break-word;
}
#qunit-tests del {
background-color: #e0f2be;
color: #374e0c;
text-decoration: none;
}
#qunit-tests ins {
background-color: #ffcaca;
color: #500;
text-decoration: none;
}
/*** Test Counts */
#qunit-tests b.counts { color: black; }
#qunit-tests b.passed { color: #5E740B; }
#qunit-tests b.failed { color: #710909; }
#qunit-tests li li {
padding: 5px;
background-color: #fff;
border-bottom: none;
list-style-position: inside;
}
/*** Passing Styles */
#qunit-tests li li.pass {
color: #3c510c;
background-color: #fff;
border-left: 10px solid #C6E746;
}
#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
#qunit-tests .pass .test-name { color: #366097; }
#qunit-tests .pass .test-actual,
#qunit-tests .pass .test-expected { color: #999999; }
#qunit-banner.qunit-pass { background-color: #C6E746; }
/*** Failing Styles */
#qunit-tests li li.fail {
color: #710909;
background-color: #fff;
border-left: 10px solid #EE5757;
white-space: pre;
}
#qunit-tests > li:last-child {
border-radius: 0 0 5px 5px;
-moz-border-radius: 0 0 5px 5px;
-webkit-border-bottom-right-radius: 5px;
-webkit-border-bottom-left-radius: 5px;
}
#qunit-tests .fail { color: #000000; background-color: #EE5757; }
#qunit-tests .fail .test-name,
#qunit-tests .fail .module-name { color: #000000; }
#qunit-tests .fail .test-actual { color: #EE5757; }
#qunit-tests .fail .test-expected { color: green; }
#qunit-banner.qunit-fail { background-color: #EE5757; }
/** Result */
#qunit-testresult {
padding: 0.5em 0.5em 0.5em 2.5em;
color: #2b81af;
background-color: #D2E0E6;
border-bottom: 1px solid white;
}
#qunit-testresult .module-name {
font-weight: bold;
}
/** Fixture */
#qunit-fixture {
position: absolute;
top: -10000px;
left: -10000px;
width: 1000px;
height: 1000px;
}

File diff suppressed because it is too large Load Diff