Skip to content

Commit 27c09e2

Browse files
committed
Update demo-view.html
1 parent 2537c7c commit 27c09e2

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

www/xtensions/custom-data/demo-view.html

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ <h3>Page 2 - Microphone and chat output</h3>
2929
<div id="sepiaFW-frames-nav-bar-page-indicator"><div>&nbsp;</div><div>&nbsp;</div></div>
3030
</div>
3131
<script>
32+
//NOTE: this is a more basic version of "<assist_server>/views/custom-view-demo.html"
33+
3234
$('#sepiaFW-frame-carousel').find('[data-localize]').each(function(){
3335
$(this).html(SepiaFW.local.g(this.dataset.localize));
3436
});
@@ -50,7 +52,7 @@ <h3>Page 2 - Microphone and chat output</h3>
5052
$('#sepiaFW-frame-page-2 #sepiaFW-frame-c-stt-data').val(JSON.stringify(data, "", 2));
5153
//modify text to include custom tag (can be used to redirect all input to a custom service for example)
5254
if (data.text && data.isFinal){
53-
var textWithPrefix = "customdemo " + data.text;
55+
var textWithPrefix = SepiaFW.frames.currentScope.nluPrefix? (SepiaFW.frames.currentScope.nluPrefix + " " + data.text) : data.text;
5456
return textWithPrefix; //<-- return the data to actually modify it
5557
}
5658
},
@@ -61,8 +63,10 @@ <h3>Page 2 - Microphone and chat output</h3>
6163
onAnimationStateChange: function(animState){
6264
$('#sepiaFW-frames-mic').attr('class', 'entry state-' + animState);
6365
},
64-
//Custom action handler
65-
actionHandler: function(customAction){}
66+
//Custom actions
67+
actionHandler: function(action){
68+
console.error(action);
69+
}
6670

6771
//Use this action in your service to trigger the demo frame:
6872
//Action name: "open_frames_view";

0 commit comments

Comments
 (0)