Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
myapps:agent-callback [2022/02/20 20:27] – [Sample URL for createCallback] gerardorourkemyapps:agent-callback [2022/02/21 18:25] (current) – [XML Code for createCallback] gerardorourke
Line 215: Line 215:
 </code> </code>
  
 +==== JS Code for createCallback====
 <code JavaScript> <code JavaScript>
 // Author: Gerry O'Rourke // Author: Gerry O'Rourke
Line 460: Line 461:
  generateTableHead(table, data);  generateTableHead(table, data);
  generateTable(table, callbackTableValues);  generateTable(table, callbackTableValues);
- + 
  //Clear Name and Description Fields after successful Callback Creation.  //Clear Name and Description Fields after successful Callback Creation.
  document.getElementById('name').value = "";  document.getElementById('name').value = "";
Line 533: Line 534:
     _createCallback = function() {     _createCallback = function() {
         _clientLogger.log ("_createCallback(): --------");         _clientLogger.log ("_createCallback(): --------");
- + 
  const RadioCallbackExpiryButtons = document.querySelectorAll('input[name="RadioCallbackExpiry"]');  const RadioCallbackExpiryButtons = document.querySelectorAll('input[name="RadioCallbackExpiry"]');
  for (const RadioCallbackExpiryButton of RadioCallbackExpiryButtons) {  for (const RadioCallbackExpiryButton of RadioCallbackExpiryButtons) {
Line 570: Line 571:
  document.getElementById('name').value = "";  document.getElementById('name').value = "";
  document.getElementById('description').value = "";  document.getElementById('description').value = "";
 + 
             _getCallbacks();             _getCallbacks();
         },         },
Line 643: Line 644:
     };     };
 }(jQuery)); }(jQuery));
 +</code>
 +
 +==== XML Code for createCallback====
 +<code xml>
 +<?xml version="1.0" encoding="UTF-8"?>
 +<Module>
 + <ModulePrefs title="Agent Callback Gadget" description="Agent Callback Gadget" scrolling="auto">
 + <Require feature="settitle"/>
 + <Require feature="dynamic-height"/>
 + <Require feature="pubsub-2"/>
 + <Require feature="setprefs"/>
 + <Require feature="loadingindicator">
 + <Param name="manual-dismiss">false</Param>
 + <Param name="loading-timeout">10</Param>
 + </Require>
 + </ModulePrefs>
 + <!--Uncomment the below 3 lines if NOT hosting on Finesse server. -->
 + <UserPref name="scheme"
 +           display_name="scheme"
 +           default_value=""/>
 + <UserPref name="host"
 +           display_name="host"
 +           default_value=""/>
 + <UserPref name="hostPort"
 +           display_name="hostPort"
 +           default_value=""/>
 + <Content type="html">
 +<![CDATA[
 +            <!DOCTYPE html>
 +            <head>
 +                <!-- Styling -->
 +                <link rel="stylesheet" href="./bootstrap-4.6.1-dist/css/bootstrap.min.css" type="text/css" />
 +                <link rel="stylesheet" href="./AgentCallback.css" type="text/css" />
 +
 + <!-- jQuery - uncomment if NOT hosting on Finesse server -->
 + <script type="text/javascript" src="__UP_scheme__://__UP_host__:__UP_hostPort__/desktop/assets/js/jquery.min.js"></script>
 +
 + <!-- Finesse Library - uncomment if NOT hosting on Finesse server -->
 + <script type="text/javascript" src="__UP_scheme__://__UP_host__:__UP_hostPort__/desktop/assets/js/finesse.js"></script>
 +
 +                <!-- Bootstrap - Must appear After jQuery JS-->
 +                <script type="text/javascript" src="./bootstrap-4.6.1-dist/js/bootstrap.min.js"></script>
 +
 +            
 +                <!-- Gadget Business Logic -->
 +                <script type="text/javascript" src="./AgentCallback.js"></script>
 +            </head>
 +
 +            <body class="claro">
 +
 + <div class="container">
 +
 + <div id="errorMsg" class="alert alert-warning alert-dismissible fade show" role="alert" style="display: none">
 +   <div><strong><span id="errorMsgHeader"></span></strong></div>
 +   <div><strong>Error Code:&nbsp;</strong><span id="errorMsgCode"></span></div>
 +   <div><strong>Error Message:&nbsp;</strong><span id="errorMsgMessage"></span></div>
 +   <button type="button" class="close" data-hide="alert" aria-label="Close" onclick="$('#errorMsg').hide();gadgets.window.adjustHeight(800);">
 + <span aria-hidden="true">&times;</span>
 +   </button>
 + </div>
 +
 + <div class="alert alert-primary" role="alert">
 + <strong>Agent Callback Number:</strong> 01 555 1234
 + </div>
 + <form>
 +
 + <div class="row">
 + <div class="col">
 + <label for="name"><strong>Name</strong></label>
 + </div>
 + <div class="col">
 + <label for="description"><strong>Description</strong></label>
 + </div>
 + </div>
 + <div class="row">
 + <div class="col">
 + <input type="text" class="form-control" id="name" placeholder="Enter the customer's name" maxlength="40">
 + </div>
 + <div class="col">
 + <input type="text" class="form-control" id="description" placeholder="Enter a description" maxlength="40">
 + </div>
 + </div>
 +
 + <div>&nbsp;</div>
 +
 + <div class="custom-control custom-radio custom-control-inline">
 + <input class="form-check-input" type="radio" name="RadioCallbackExpiry" id="RadioButton1" value="1" checked>
 + <label class="form-check-label" for="RadioButton1">
 + 1 hour
 + </label>
 + </div>
 + <div class="custom-control custom-radio custom-control-inline">
 + <input class="form-check-input" type="radio" name="RadioCallbackExpiry" id="RadioButton2" value="24">
 + <label class="form-check-label" for="RadioButton2">
 + 1 day
 + </label>
 + </div>
 + <div class="custom-control custom-radio custom-control-inline">
 + <input class="form-check-input" type="radio" name="RadioCallbackExpiry" id="RadioButton3" value="168">
 + <label class="form-check-label" for="RadioButton3">
 + 1 week
 + </label>
 + </div>
 +
 + <div class="custom-control custom-radio custom-control-inline" style="width: 200px;">
 + <button type="button" class="btn btn-outline-success" id="createCallback" onClick="finesse.modules.AgentCallbackGadget.createCallback()">Create</button>
 + <button type="button" class="btn btn-outline-secondary" id="refreshCallbacks" onClick="finesse.modules.AgentCallbackGadget.refreshCallbacks()">Refresh</button>
 + <button type="button" class="btn btn-outline-info" id="copyToClipboard" onClick="finesse.modules.AgentCallbackGadget.copyToClipboard()">Copy</button>
 + </div>
 +
 + </form>
 +
 + <hr>
 +
 + <div class="table-responsive" style="height: 500px;">
 + <table class="table" id="CallbackTable">
 + </table>
 + </div>
 + </div>
 +            </body>
 +            <script type="text/javascript"> gadgets.HubSettings.onConnect = function () {finesse.modules.AgentCallbackGadget.init();};</script>
 +        ]]></Content>
 +</Module>
 </code> </code>
  • myapps/agent-callback.1645388866.txt.gz
  • Last modified: 2022/02/20 20:27
  • by gerardorourke