.noConflict(): this
#Methods
#Access
#noConflict
If an
Access
object already exists in the global object of the current
page, the Access.js
library will be renamed to PooolAccess
and the original
Access
object will be restored.#init
.init(appId: String): PaywallFactory
Creates a new Access instance (required to display paywalls) using your app ID.
#PaywallFactory
#createPaywall
.createPaywall(options: PaywallOptions): Paywall
Creates a new Paywall instance.
#Options
#target
- Type: String|Element
- Default: '#poool-widget'
Selector to the element (or the element itself) in which the paywall will be
displayed.
#content
- Type: String|Element
- Default: '[data-poool]'
Selector to the element (or the element itself) in which the content to be locked
is present.
#pageType
- Type: String
- Default: 'page'
The type of content inside the current page. Paywalls can be displayed on either
'premium'
or 'free'
, or 'page'
pages.#mode
- Type: String
- Default: 'excerpt'
The method used to lock the content. See the
mode
configuration option documentation
for more information on the different modes.#percent
- Type: Number
- Default: 80
The percentage of text to be hidden/locked. See the
percent
configuration option documentation
for more information.#config
.config(optionName: String, optionValue: Any, readOnly?: Boolean): this
.config(options: Object, readOnly?: Boolean): this
Allows to set some configuration options. See the
configuration options documentation.
#texts
.texts(keyName: String, text: String, readOnly?: Boolean, locale?: String): this
.texts(options: Object, readOnly?: Boolean, locale?: String): this
Allows to set custom texts all over the paywall. See the
texts documentation.
#styles
.styles(optionName: String, optionValue: String, readOnly?: Boolean): this
.styles(options: Object, readOnly?: Boolean): this
Allows to set custom styles for the default appearance. See the
styles documentation.
#variables
.variable(name: String, value: Any): this
.variable(options: Object): this
Allows to set custom variables to be replaced inside some text keys. See the
variables documentation.
#on
.on(name: String, callback: Function): this
Allows to set a callback to be called when a specific event is triggered. See
the events documentation.
#once
.once(name: String, callback: Function): this
Same as
.on()
but the callback will be called only once and removed afterwards.#off
.off(name: String, callback: Function): this
Allows to remove an event callback previously set with
.on()
or .once()
.#destroy
.destroy(): Promise<void>
Destroys the current paywall.