diff --git a/cloud/endagaweb/static/js/dashboard/sms-broadcast.js b/cloud/endagaweb/static/js/dashboard/sms-broadcast.js new file mode 100644 index 00000000..b58e21dd --- /dev/null +++ b/cloud/endagaweb/static/js/dashboard/sms-broadcast.js @@ -0,0 +1,98 @@ +/* + * Copyright (c) 2016-present, Facebook, Inc. + * All rights reserved. + * + * This source code is licensed under the BSD-style license found in the + * LICENSE file in the root directory of this source tree. An additional grant + * of patent rights can be found in the PATENTS file in the same directory. + */ + function broadcastSms() { + var data = { + sendto: $('input[type=radio][name="send_to"]:checked').val(), + network_id: $('#network_id').val(), + tower_id: $('#bts_id').val(), + imsi: $('#imsi').val(), + message: $('#message').val(), + csrfmiddlewaretoken: $('#token').val(), + }; + $.post('/dashboard/broadcast', data, function(response) { + if (response['status'] == 'ok') { + // Show that it was successful and then reload the page. + // Clear out any old messages and show the div again. + $('#messages-container').html(); + $('#messages-container').css('opacity', 1); + var html = ''; + response['messages'].map(function(message) { + html += '