Browse Source

Flush DTMF submodule

pull/4/head
Vladimir Barkasov 6 years ago
parent
commit
2855e0bb37
6 changed files with 137 additions and 1 deletions
  1. +1
    -0
      src/apps/callflows/app.js
  2. +11
    -1
      src/apps/callflows/i18n/en-US.json
  3. +1
    -0
      src/apps/callflows/style/app.css
  4. +7
    -0
      src/apps/callflows/submodules/flushdtmf/flushdtmf.css
  5. +90
    -0
      src/apps/callflows/submodules/flushdtmf/flushdtmf.js
  6. +27
    -0
      src/apps/callflows/submodules/flushdtmf/views/dialogEdit.html

+ 1
- 0
src/apps/callflows/app.js View File

@ -18,6 +18,7 @@ define(function(require) {
'faxbox',
'faxdetect',
'featurecodes',
'flushdtmf',
'groups',
'media',
'menu',


+ 11
- 1
src/apps/callflows/i18n/en-US.json View File

@ -1342,7 +1342,17 @@
"help": "You can force the eavesdropper to be a specific user/device/group by selecting an endpoint in this list."
}
},
"flush_dtmf": {
"flush_dtmf": "Flush DTMF",
"tooltip": "Flush collected DTMF in a named key",
"edit_dialog": {
"title": "Flush DTMF",
"collection_name": {
"label": "Collection Name",
"tooltip": "Flush collected DTMF in a named key"
}
}
},
"__comment": "UI-431: adding intercept to adv. callflows",
"__version": "v4.1",
"intercept": {


+ 1
- 0
src/apps/callflows/style/app.css View File

@ -17,6 +17,7 @@
@import url('../submodules/checkcid/checkcid.css');
@import url('../submodules/cidlistmatch/cidlistmatch.css');
@import url('../submodules/faxdetect/faxdetect.css');
@import url('../submodules/flushdtmf/flushdtmf.css');
@import url('../../../css/vendor/bootstrap-tour.css');
/* style.css */
#ws_callflow > .callflow {


+ 7
- 0
src/apps/callflows/submodules/flushdtmf/flushdtmf.css View File

@ -0,0 +1,7 @@
.flush-dtmf-form {
margin: 15px 0 0;
}
.callflows-port .flush-dtmf-form label:not(.monster-invalid) {
width: 140px;
}

+ 90
- 0
src/apps/callflows/submodules/flushdtmf/flushdtmf.js View File

@ -0,0 +1,90 @@
define(function(require) {
var $ = require('jquery'),
monster = require('monster');
var useAbsoluteMode;
var app = {
requests: {},
subscribe: {
'callflows.fetchActions': 'flushdtmfDefineActions'
},
flushdtmfDefineActions: function(args) {
var self = this,
callflow_nodes = args.actions,
i18n = self.i18n.active().callflows.flush_dtmf;
$.extend(callflow_nodes, {
'flush_dtmf[]': {
name: i18n.flush_dtmf,
icon: 'phone',
category: self.i18n.active().oldCallflows.advanced_cat,
module: 'flush_dtmf',
tip: i18n.tooltip,
data: {},
rules: [{
type: 'quantity',
maxSize: 1
}],
isUsable: 'true',
weight: 48,
caption: function(node, caption_map) {
return node.getMetadata('collection_name') || '';
},
edit: function(node, callback) {
self.flushdtmfShowEditDialog(node, callback);
}
}
});
},
flushdtmfShowEditDialog: function (node, callback) {
var self = this,
$dialogHtml,
$dialog,
i18n = self.i18n.active().callflows.flush_dtmf,
collectionName = node.getMetadata('collection_name') || '';
$dialogHtml = $(self.getTemplate({
name: 'dialogEdit',
data: {
collectionName: collectionName
},
submodule: 'flushdtmf'
}));
$dialog = monster.ui.dialog($dialogHtml, {
title: i18n.edit_dialog.title,
minHeight: '0',
width: 450,
beforeClose: function() {
if (typeof callback === 'function') {
callback();
}
}
});
monster.ui.tooltips($dialogHtml);
$dialogHtml.find('.js-save').click(function() {
var collectionName = $('#flush-dtmf_collection-name', $dialog).val();
if(collectionName) {
node.setMetadata('collection_name', collectionName);
} else {
node.deleteMetadata('collection_name');
}
node.caption = collectionName;
if (typeof callback === 'function') {
callback();
}
$dialog.dialog('close');
});
}
};
return app;
});

+ 27
- 0
src/apps/callflows/submodules/flushdtmf/views/dialogEdit.html View File

@ -0,0 +1,27 @@
<div class="dialog_popup callflows-port flush-dtmf-dialog">
<form method="post" action="#" class="flush-dtmf-form">
<div class="form_content">
<div class="popup_field clear">
<label for="flush-dtmf_collection-name">
{{ i18n.callflows.flush_dtmf.edit_dialog.collection_name.label }}
<i class="help-popover fa fa-question-circle"
data-original-title="{{ i18n.callflows.flush_dtmf.edit_dialog.collection_name.tooltip }}"
data-placement="right"
data-toggle="tooltip"></i>
</label>
<div class="field_wrapper">
<input name="collection_name"
type="text"
value="{{ collectionName }}"
id="flush-dtmf_collection-name"/>
</div>
</div>
</div>
</form>
<div class="buttons-center">
<button class="monster-button monster-button-primary js-save">
{{ i18n.save }}
</button>
</div>
</div>

Loading…
Cancel
Save