postscribe 2.0.4 → 2.0.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.npmignore +1 -0
- package/LICENSE +2 -1
- package/README.md +17 -4
- package/dist/postscribe.js +493 -470
- package/dist/postscribe.js.map +1 -0
- package/dist/postscribe.max.js +493 -470
- package/dist/postscribe.min.js +2 -2
- package/package.json +37 -40
- package/bower.json +0 -20
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov-report/base.css +0 -212
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov-report/index.html +0 -97
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov-report/prettify.css +0 -1
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov-report/prettify.js +0 -1
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov-report/sort-arrow-sprite.png +0 -0
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov-report/sorter.js +0 -158
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov-report/src/index.html +0 -123
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov-report/src/postscribe.js.html +0 -666
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov-report/src/utils.js.html +0 -453
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov-report/src/write-stream.js.html +0 -1896
- package/dist/test-reports/coverage/PhantomJS 2.1.1 (Linux 0.0.0)/lcov.info +0 -649
package/.npmignore
CHANGED
package/LICENSE
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
Copyright (c)
|
1
|
+
Copyright (c) 2016 Postscribe Authors and Contributors
|
2
|
+
Copyright (c) 2016 Krux Digital, Inc.
|
2
3
|
|
3
4
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
5
|
of this software and associated documentation files (the "Software"), to
|
package/README.md
CHANGED
@@ -8,6 +8,7 @@
|
|
8
8
|
[](./package.json)
|
9
9
|
[](http://commitizen.github.io/cz-cli/)
|
10
10
|
[](https://github.com/semantic-release/semantic-release)
|
11
|
+
[](https://gitter.im/krux/postscribe)
|
11
12
|
|
12
13
|
Remote scripts, especially ads, block the page from doing anything else while they load. They contribute a large % to load times which
|
13
14
|
[affects your bottom line](http://devnet.kentico.com/Blogs/Thomas-Robbins/September-2012/How-loading-time-affects-your-bottom-line-Infograp.aspx).
|
@@ -39,7 +40,7 @@ PostScribe overrides `document.write`. It is best and safest to use PostScribe a
|
|
39
40
|
If you just want to use the script without installing anything, use the following to load the script from *cdnjs*:
|
40
41
|
|
41
42
|
```html
|
42
|
-
<script src="https://cdnjs.cloudflare.com/ajax/libs/postscribe/2.0.
|
43
|
+
<script src="https://cdnjs.cloudflare.com/ajax/libs/postscribe/2.0.6/postscribe.min.js"></script>
|
43
44
|
```
|
44
45
|
|
45
46
|
### NPM
|
@@ -55,12 +56,14 @@ Postscribe runs in browsers, so this assumes you're using a module bundler like
|
|
55
56
|
|
56
57
|
### Bower
|
57
58
|
|
58
|
-
You can include `postscribe` using *bower
|
59
|
+
You can include `postscribe` using *bower* by installing from the CDN URL:
|
59
60
|
|
60
61
|
```console
|
61
|
-
bower install --save postscribe
|
62
|
+
bower install --save https://cdnjs.cloudflare.com/ajax/libs/postscribe/2.0.6/postscribe.min.js
|
62
63
|
```
|
63
64
|
|
65
|
+
The library will exist at `<components_folder>/postscribe/index.js`.
|
66
|
+
|
64
67
|
## Accessing
|
65
68
|
|
66
69
|
### ES6/ES2015
|
@@ -100,7 +103,17 @@ postscribe(element, html, options);
|
|
100
103
|
* *element:* a DOM Element, jQuery object, or id selector (e.g. "#mydiv")
|
101
104
|
* *html:* an html string or a function that takes a DOM Document and writes to it.
|
102
105
|
* *options:* a hash of options
|
103
|
-
* *
|
106
|
+
* *afterAsync*: a callback called when an async script has loaded
|
107
|
+
* *afterDequeue*: a callback called immediately before removing from the write queue
|
108
|
+
* *afterStreamStart*: a callback called sync after a stream's first thread release
|
109
|
+
* *afterWrite*: a callback called after writing buffered document.write calls
|
110
|
+
* *done:* a callback that will be called when writing is finished
|
111
|
+
* *autoFix*: a boolean that allows disabling the autoFix feature of prescribe
|
112
|
+
* *beforeEnqueue*: a callback called immediately before adding to the write queue
|
113
|
+
* *beforeWriteToken*: a callback called before writing a token
|
114
|
+
* *beforeWrite*: a callback called before writing buffered document.write calls
|
115
|
+
* *error*: a function that throws the error by default, but could be overwritten
|
116
|
+
* *releaseAsync*: a boolean whether to let scripts w/ async attribute set fall out of the queue
|
104
117
|
|
105
118
|
If you just want to mess around, include the js files at the top of an html page that contains the following:
|
106
119
|
|