fix(wp): 🐛 Standard embed when window is loaded
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "wordpress",
|
||||
"version": "2.1.8",
|
||||
"version": "2.1.9",
|
||||
"main": "index.js",
|
||||
"repository": "https://github.com/baptisteArno/typebot.io",
|
||||
"author": "baptisteArno",
|
||||
@ -10,7 +10,7 @@
|
||||
},
|
||||
"scripts": {
|
||||
"deploy": "yarn copy && yarn commit",
|
||||
"copy": "svn copy ./trunk ./tags/2.1.8",
|
||||
"commit": "svn ci -m 'Fix proactive message bug'"
|
||||
"copy": "svn copy ./trunk ./tags/2.1.9",
|
||||
"commit": "svn ci -m 'Fix standard embed when window loaded'"
|
||||
}
|
||||
}
|
||||
|
@ -2,10 +2,10 @@
|
||||
Contributors: baptisteArno
|
||||
Tags: typebot, forms, surveys, quizzes, form builder, survey builder, quiz builder, custom forms, mobile forms, payment forms, order forms, feedback forms, enquiry forms, stripe, dropbox, google sheets, mailchimp, salesforce, hubspot, activecampaign, infusionsoft, asana, hipchat, slack, trello, zendesk
|
||||
Requires at least: 5.0
|
||||
Tested up to: 5.9.1
|
||||
Tested up to: 6.0
|
||||
License: GPL 2.0
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
||||
Stable Tag: 2.1.8
|
||||
Stable Tag: 2.1.9
|
||||
|
||||
Build beautiful conversational forms
|
||||
|
||||
@ -26,6 +26,9 @@ This plugin relies on Typebot which is a tool that allows you to create conversa
|
||||
3. Activate your Typebot with the "Typebot" admin button located in the sidebar
|
||||
|
||||
== Changelog ==
|
||||
= 2.1.9 =
|
||||
* Fix standard embed when window is already loaded
|
||||
|
||||
= 2.1.8 =
|
||||
* Fix bubble not displayed with proactive message
|
||||
|
||||
|
@ -263,6 +263,16 @@ class Typebot_Public
|
||||
}
|
||||
$container_id = 'typebot-container-' . $this->generateRandomString(4);
|
||||
|
||||
$bot_initializer =
|
||||
'var typebot = Typebot.initContainer("' .
|
||||
$container_id .
|
||||
'",{
|
||||
hiddenVariables: typebotWpUser,
|
||||
url: "' .
|
||||
$url .
|
||||
'",
|
||||
})';
|
||||
|
||||
return '<script>' .
|
||||
$this->parse_wp_user() .
|
||||
'</script>' .
|
||||
@ -279,15 +289,17 @@ class Typebot_Public
|
||||
'"
|
||||
></div>
|
||||
<script>
|
||||
if(document.readyState == "complete"){
|
||||
' .
|
||||
$bot_initializer .
|
||||
'
|
||||
} else {
|
||||
window.addEventListener("load",(event) => {
|
||||
var typebot = Typebot.initContainer("' .
|
||||
$container_id .
|
||||
'",{
|
||||
hiddenVariables: typebotWpUser,
|
||||
url: "' .
|
||||
$url .
|
||||
'",
|
||||
})})
|
||||
' .
|
||||
$bot_initializer .
|
||||
'
|
||||
})
|
||||
}
|
||||
</script>';
|
||||
}
|
||||
|
||||
|
@ -3,7 +3,7 @@
|
||||
/**
|
||||
* Plugin Name: Typebot
|
||||
* Description: Convert more with conversational forms
|
||||
* Version: 2.1.8
|
||||
* Version: 2.1.9
|
||||
* Author: Typebot
|
||||
* Author URI: http://typebot.io/
|
||||
* License: GPL-2.0+
|
||||
@ -16,7 +16,7 @@ if (!defined('WPINC')) {
|
||||
die();
|
||||
}
|
||||
|
||||
define('TYPEBOT_VERSION', '2.1.8');
|
||||
define('TYPEBOT_VERSION', '2.1.9');
|
||||
|
||||
function activate_typebot()
|
||||
{
|
||||
|
Reference in New Issue
Block a user