Skip to content

Instantly share code, notes, and snippets.

@nickarthur
Last active December 28, 2015 21:49
Show Gist options
  • Save nickarthur/7567636 to your computer and use it in GitHub Desktop.
Save nickarthur/7567636 to your computer and use it in GitHub Desktop.
HTML DIALOG CUSTOM CLOSE BUTTON cloudparty CLOUDPARTY
var htmlText = '<div id="body">\
<div id=btnGrp>\
<button id="btnClose">Close the Dialog</button><br>\
</div></div>';
function clickStart() {
controllerHTMLCreate({
ent: getMessageEnt(),
title: 'the winow title',
html: htmlText,
listeners: [
{id: 'btnClose', message:'close', command:'close'}
],
messagers: [
{id:'btnClose', message:'close'}]
});
}
handlerCreate({
name: 'clickStart',
channel: 'direct',
message: 'clickStart'
});
handlerCreate({
name: 'closeClick',
channel: 'controller',
message: 'close'
});var htmlText = '<div id="body">\
<div id=btnGrp>\
<button id="btnClose">Close the Dialog</button><br>\
</div></div>';
function clickStart() {
controllerHTMLCreate({
ent: getMessageEnt(),
title: 'the winow title',
html: htmlText,
listeners: [
{id: 'btnClose', message:'close', command:'close'}
],
messagers: [
{id:'btnClose', message:'close'}]
});
}
handlerCreate({
name: 'clickStart',
channel: 'direct',
message: 'clickStart'
});
handlerCreate({
name: 'closeClick',
channel: 'controller',
message: 'close'
});
function closeClick() {
say('Close clicked. Attempting to Close Dialog');
//send the controller message to close the window
controllerMessage({ent: getMessageEnt(), message: 'close', text: 'close'});
}
function closeClick() {
say('Close clicked. Attempting to Close Dialog');
//send the controller message to close the window
controllerMessage({ent: getMessageEnt(), message: 'close', text: 'close'});
}var htmlText = '<div id="body">\
<div id=btnGrp>\
<button id="btnClose">Close the Dialog</button><br>\
</div></div>';
function clickStart() {
controllerHTMLCreate({
ent: getMessageEnt(),
title: 'the winow title',
html: htmlText,
listeners: [
{id: 'btnClose', message:'close', command:'close'}
],
messagers: [
{id:'btnClose', message:'close'}]
});
}
handlerCreate({
name: 'clickStart',
channel: 'direct',
message: 'clickStart'
});
handlerCreate({
name: 'closeClick',
channel: 'controller',
message: 'close'
});
function closeClick() {
say('Close clicked. Attempting to Close Dialog');
//send the controller message to close the window
controllerMessage({ent: getMessageEnt(), message: 'close', text: 'close'});
}
@nickarthur
Copy link
Author

This gist shows how to setup a close button in a cloudparty html controller

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment