2
0

fix(wp): 🐛 Standard embed when window is loaded

This commit is contained in:
Baptiste Arnaud
2022-05-18 12:30:51 -07:00
parent ac278b9916
commit ad69cc5264
4 changed files with 30 additions and 15 deletions

View File

@ -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'"
}
}

View File

@ -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

View File

@ -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>';
}

View File

@ -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()
{