Skip to content
This repository has been archived by the owner on Nov 5, 2023. It is now read-only.

Commit

Permalink
Trim trailing slash the right way
Browse files Browse the repository at this point in the history
  • Loading branch information
curtgrimes committed Oct 10, 2017
1 parent 31cf4ce commit 4f49f24
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/js/send-to-vmix.js
Expand Up @@ -26,7 +26,7 @@ $(function(){
$('#vmixWebControllerAddress').val(window._wc.vmix.address);

$('#saveVmixButton').on('click', function() {
window._wc.vmix.address = $('#vmixWebControllerAddress').val().trim().trim('/');
window._wc.vmix.address = $('#vmixWebControllerAddress').val().trim().replace(/\/$/, "");

var settings = JSON.parse(window.localStorage.getItem("webcaptioner-settings")) || {};
settings.vmix = window._wc.vmix;
Expand Down Expand Up @@ -142,7 +142,7 @@ function testVmixConnection(initialCheck) {
chrome.runtime.sendMessage(
chromeExtensionId,
{
path: $('#vmixWebControllerAddress').val().trim().trim('/') + '/API',
path: $('#vmixWebControllerAddress').val().trim().replace(/\/$/, "") + '/API',
},
function(response) {
if (response && response.success && response.code && response.code == 200) {
Expand Down Expand Up @@ -201,7 +201,7 @@ function sendVmixMessage(message, initialCheckTest) {
chrome.runtime.sendMessage(
chromeExtensionId,
{
path: $('#vmixWebControllerAddress').val().trim().trim('/') + '/API/?Function=SetText&Input='+ window._wc_cached_vmix_guid +'&SelectedName=WebCaptionerCaptions&Value='+encodeURIComponent(message),
path: $('#vmixWebControllerAddress').val().trim().replace(/\/$/, "") + '/API/?Function=SetText&Input='+ window._wc_cached_vmix_guid +'&SelectedName=WebCaptionerCaptions&Value='+encodeURIComponent(message),
},
function(response) {
if (response && response.success) {
Expand Down

0 comments on commit 4f49f24

Please sign in to comment.