Skip to content

Commit 2d5cee3

Browse files
committed
Merge branch 'develop'
2 parents 589a276 + 5dd80b9 commit 2d5cee3

File tree

10 files changed

+32
-36
lines changed

10 files changed

+32
-36
lines changed

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
The MIT License (MIT)
22

3-
Copyright (c) 2013-2016 SPACE10
3+
Copyright (c) 2013-2018 SPACE10
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
66

bower.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "conversational-form",
3-
"version": "0.9.80",
3+
"version": "0.9.81",
44
"authors": [
55
{
66
"name" : "Daniel Friis",

dist/conversational-form.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4707,6 +4707,8 @@ var cf;
47074707
// now set it
47084708
if (this.isRobotResponse) {
47094709
this.textEl.innerHTML = "";
4710+
if (!this.uiOptions)
4711+
this.uiOptions = this.cfReference.uiOptions; // On edit uiOptions are empty, so this mitigates the problem. Not ideal.
47104712
var robotInitResponseTime = this.uiOptions.robot.robotResponseTime;
47114713
if (robotInitResponseTime != 0) {
47124714
this.setToThinking();
@@ -4733,9 +4735,10 @@ var cf;
47334735
_this.onReadyCallback();
47344736
// reset, as it can be called again
47354737
_this.onReadyCallback = null;
4736-
if (_this._tag.skipUserInput === true) {
4738+
if (_this._tag && _this._tag.skipUserInput === true) {
47374739
setTimeout(function () {
47384740
_this._tag.flowManager.nextStep();
4741+
_this._tag.skipUserInput = false; // to avoid nextStep being fired again as this would make the flow jump too far when editing a response
47394742
}, _this.uiOptions.robot.chainedResponseTime);
47404743
}
47414744
}, robotInitResponseTime + (chainedResponses.length * this.uiOptions.robot.chainedResponseTime));
@@ -4767,6 +4770,8 @@ var cf;
47674770
ChatResponse.prototype.scrollTo = function () {
47684771
var y = this.el.offsetTop;
47694772
var h = this.el.offsetHeight;
4773+
if (!this.container && this.el)
4774+
this.container = this.el; // On edit this.container is empty so this is a fix to reassign it. Not ideal, but...
47704775
this.container.scrollTop = y + h + this.container.scrollTop;
47714776
};
47724777
ChatResponse.prototype.checkForEditMode = function () {
@@ -5432,7 +5437,7 @@ var cf;
54325437
(function (cf_1) {
54335438
var ConversationalForm = /** @class */ (function () {
54345439
function ConversationalForm(options) {
5435-
this.version = "0.9.80";
5440+
this.version = "0.9.81";
54365441
this.cdnPath = "https://cdn.jsdelivr.net/gh/space10-community/conversational-form@{version}/dist/";
54375442
this.isDevelopment = false;
54385443
this.loadExternalStyleSheet = true;

dist/conversational-form.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/0.9.80/getting-started/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -134,7 +134,7 @@ <h1 id="getting-started">Getting Started</h1>
134134
<p>Turning web forms into conversations. Conversational Form is an open-source concept by <a href="https://space10.io/" target="_blank">SPACE10</a> to easily turn any form element on a web page into a conversational form interface. It features conversational replacement of all input elements, reusable variables from previous questions and complete customization and control over the styling.</p>
135135

136136
<h2 id="include-conversationalform-in-your-page">Include ConversationalForm in your page</h2>
137-
<pre><code class="language-html" data-lang="html">&lt;script type="text/javascript" src="https://cdn.jsdelivr.net/gh/space10-community/conversational-form@0.9.80/dist/conversational-form.min.js" crossorigin></script></code></pre>
137+
<pre><code class="language-html" data-lang="html">&lt;script type="text/javascript" src="https://cdn.jsdelivr.net/gh/space10-community/conversational-form@0.9.80/dist/conversational-form.min.js" crossorigin>&lt;/script></code></pre>
138138

139139
<p>ConversationalForm will automatically look through the DOM for a form element with the attibute cf-form, and auto-instantiate.</p>
140140
<pre><code class="language-html" data-lang="html">&lt;form id="my-form-element" cf-form ...></code></pre>

docs/0.9.80/src/pages/getting-started/index.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<p>Turning web forms into conversations. Conversational Form is an open-source concept by <a href="https://space10.io/" target="_blank">SPACE10</a> to easily turn any form element on a web page into a conversational form interface. It features conversational replacement of all input elements, reusable variables from previous questions and complete customization and control over the styling.</p>
99

1010
<h2 id="include-conversationalform-in-your-page">Include ConversationalForm in your page</h2>
11-
<pre><code class="language-html" data-lang="html">&lt;script type="text/javascript" src="https://cdn.jsdelivr.net/gh/space10-community/conversational-form@{{nextVersion}}/dist/conversational-form.min.js" crossorigin></script></code></pre>
11+
<pre><code class="language-html" data-lang="html">&lt;script type="text/javascript" src="https://cdn.jsdelivr.net/gh/space10-community/conversational-form@{{nextVersion}}/dist/conversational-form.min.js" crossorigin>&lt;/script></code></pre>
1212

1313
<p>ConversationalForm will automatically look through the DOM for a form element with the attibute cf-form, and auto-instantiate.</p>
1414
<pre><code class="language-html" data-lang="html">&lt;form id="my-form-element" cf-form ...></code></pre>

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "conversational-form",
3-
"version": "0.9.80",
3+
"version": "0.9.81",
44
"description": "Turning web forms into conversations",
55
"main": "dist/conversational-form.js",
66
"directories": {

src/development-cf-robot-message.html

Lines changed: 10 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -189,31 +189,16 @@
189189
<body>
190190

191191
<form id="cf-form">
192-
193-
<input cf-questions="red or blue pill" type="text" name="pill">
194-
195-
<cf-robot-message cf-conditional-pill="blue" cf-questions="GREAT. YOU ARE ON THE BLUE PILL!!!!!!!!!!"></cf-robot-message>
196-
197-
<cf-robot-message cf-questions="Welcome to this form&&It will take around 20 seconds to complete it."></cf-robot-message>
198-
<cf-robot-message cf-questions="Buckle up||Let's do this"></cf-robot-message>
199-
200-
<fieldset>
201-
<label>
202-
<input cf-questions="Checkboxes, not required." type="checkbox" name="checkboxes" id="checkboxes-1" value="developer">
203-
Developer
204-
</label>
205-
<label>
206-
<input type="checkbox" name="checkboxes" id="checkboxes-2" value="designer">
207-
Designer
208-
</label>
209-
</div>
210-
<label>
211-
<input type="checkbox" name="checkboxes" id="checkboxes-3" value="curious-mind">
212-
Curious mind
213-
</label>
214-
</fieldset>
215-
216-
<cf-robot-message cf-questions="Thank you for playing along."></cf-robot-message>
192+
<input type="text" name="CHEESE" value="comte" cf-questions="What is your fave cheese?">
193+
<!-- <label for="radio">
194+
<input cf-questions="Hi friend. Ready to signup for our demo newsletter?" cf-label="Yes, let's begin!" type="radio" value="0">
195+
Start
196+
</label> -->
197+
<cf-robot-message cf-questions="this is just a test message to show that the next question will be skipped when trying to edit the first question."></cf-robot-message>
198+
<input type="text" name="FNAME" cf-questions="What is your firstname?">
199+
<input type="text" name="LNAME" cf-questions="What is your lastname?">
200+
<input type="text" name="EMAIL" cf-questions="What is your email?">
201+
217202
</form>
218203

219204
<div id="cf-context" role="cf-context" cf-context style="height: 600px; width: 400px; border: 1px solid #999;">

src/scripts/cf/ConversationalForm.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ namespace cf {
8484
}
8585

8686
export class ConversationalForm{
87-
public version: string = "0.9.80";
87+
public version: string = "0.9.81";
8888

8989
public static animationsEnabled: boolean = true;
9090
public static illustrateAppFlow: boolean = true;

src/scripts/cf/ui/chat/ChatResponse.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,6 +207,8 @@ namespace cf {
207207
if(this.isRobotResponse){
208208
this.textEl.innerHTML = "";
209209

210+
if(!this.uiOptions) this.uiOptions = this.cfReference.uiOptions; // On edit uiOptions are empty, so this mitigates the problem. Not ideal.
211+
210212
let robotInitResponseTime: number = this.uiOptions.robot.robotResponseTime;
211213
if(robotInitResponseTime != 0){
212214
this.setToThinking();
@@ -235,9 +237,10 @@ namespace cf {
235237
// reset, as it can be called again
236238
this.onReadyCallback = null;
237239

238-
if(this._tag.skipUserInput === true){
240+
if(this._tag && this._tag.skipUserInput === true){
239241
setTimeout(() =>{
240242
this._tag.flowManager.nextStep()
243+
this._tag.skipUserInput = false; // to avoid nextStep being fired again as this would make the flow jump too far when editing a response
241244
},this.uiOptions.robot.chainedResponseTime);
242245
}
243246

@@ -277,6 +280,9 @@ namespace cf {
277280
public scrollTo(){
278281
const y: number = this.el.offsetTop;
279282
const h: number = this.el.offsetHeight;
283+
284+
if(!this.container && this.el) this.container = this.el; // On edit this.container is empty so this is a fix to reassign it. Not ideal, but...
285+
280286
this.container.scrollTop = y + h + this.container.scrollTop;
281287
}
282288

0 commit comments

Comments
 (0)