postscribe 2.0.4 → 2.0.8

Sign up to get free protection for your applications and to get access to all the features.
package/.npmignore CHANGED
@@ -11,3 +11,4 @@ src/**
11
11
  test/**
12
12
  webpack.config.babel.js
13
13
  *.iml
14
+ build/
package/LICENSE CHANGED
@@ -1,4 +1,5 @@
1
- Copyright (c) 2014 Postscribe Contributors
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
  [![Dependencies](https://img.shields.io/david/dev/krux/postscribe.svg)](./package.json)
9
9
  [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
10
10
  [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
11
+ [![Gitter](https://badges.gitter.im/krux/postscribe.svg)](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.0/postscribe.min.js"></script>
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
- * *done:* a callback that will be called when writing is finished.
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