From dfc94867c2f78145a7a3a4cdcecabc2b938c306f Mon Sep 17 00:00:00 2001 From: NoriSte Date: Thu, 2 May 2019 11:25:59 +0200 Subject: [PATCH] Fix a typo --- MailUpExample/index.html | 14 +++++++------- MailUpExample/mailupclient.js | 30 +++++++++++++++--------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/MailUpExample/index.html b/MailUpExample/index.html index e06c078..ea4ceaa 100644 --- a/MailUpExample/index.html +++ b/MailUpExample/index.html @@ -62,7 +62,7 @@

MailUp Demo Client

var param = params[i].split("="); if (param[0]=="code") { // We have code returned from MailUp var code = param[1]; - mailUp.retreiveAccessTokenWithCode(code, function(token) { + mailUp.retrieveAccessTokenWithCode(code, function(token) { authorized(token); isToken(token); expireTimer(); @@ -74,7 +74,7 @@

MailUp Demo Client

function Init(){ var opt = document.getElementById("lstEndpoint").options; - var getToken = mailUp.getAccessToken1(); + var getToken = mailUp.getAccessToken1(); opt[1].value = mailUp.getMailstatisticsEndpoint(); opt[0].value = mailUp.getConsoleEndpoint(); if (getToken == "") { @@ -199,7 +199,7 @@

MailUp Demo Client

if (accessTokenExpire) { timer = (accessTokenExpire - (new Date()).getTime()) / 1000; if (refreshInterval != 0) { - clearInterval(refreshInterval); + clearInterval(refreshInterval); } startTimer(timer, document.querySelector('#expiresInTimer')); } else { @@ -247,7 +247,7 @@

MailUp Demo Client

var url4 = "/Console/Import/" + importId; messageResult = "Check the import result"; mailUp.callMethod(mailUp.getConsoleEndpoint() + url4, "GET", null, "JSON", function(body, data) { - + errorResult = "Example methods completed successfully"; $(".example1").append(jQuery.validator.format(answer, messageResult, "GET", "JSON", "Console", url4, body? body : "", data)); $(".example1").append(jQuery.validator.format(successfullyAnswer, errorResult)); @@ -318,7 +318,7 @@

MailUp Demo Client

function runExample2() { var messageResult = ""; var errorResult = ""; - var imgId = "img2"; + var imgId = "img2"; showImage(imgId, false); $(".example2").children().not(".btn-success, .img").remove(); // Request for recipient in a group @@ -534,7 +534,7 @@

MailUp Demo Client

var url3 = "/Console/List/"+LIST_ID+"/Email/" + emailId + "/Attachment/1"; messageResult = "Add an attachment"; mailUp.callMethod(mailUp.getConsoleEndpoint() + url3, "POST", attachmentRequest, "JSON", function(body, data) { - + $(".example5").append(jQuery.validator.format(answer, messageResult, "POST", "JSON", "Console", url3, body? body : "", data)); // Retrieve message details @@ -659,7 +659,7 @@

MailUp Demo Client

mailUp.callMethod(mailUp.getConsoleEndpoint() + url1, "POST", null, "JSON", function(body, data) { errorResult = "Example methods completed successfully"; - $(".example7").append(jQuery.validator.format(answer, messageResult, "POST", "JSON", "Console", url1, body? body : "", data)); + $(".example7").append(jQuery.validator.format(answer, messageResult, "POST", "JSON", "Console", url1, body? body : "", data)); $(".example7").append(jQuery.validator.format(successfullyAnswer, errorResult)); showImage(imgId, true); diff --git a/MailUpExample/mailupclient.js b/MailUpExample/mailupclient.js index 4b35dc9..d75b8e7 100644 --- a/MailUpExample/mailupclient.js +++ b/MailUpExample/mailupclient.js @@ -6,7 +6,7 @@ function MailUpClient(inClientId, inClientSecret, inCallbackUri) { this.tokenEndpoint = "https://services.mailup.com/Authorization/OAuth/Token"; this.consoleEndpoint = "https://services.mailup.com/API/v1.1/Rest/ConsoleService.svc"; this.mailstatisticsEndpoint = "https://services.mailup.com/API/v1.1/Rest/MailStatisticsService.svc"; - + this.clientId = inClientId; this.clientSecret = inClientSecret; this.callbackUri = inCallbackUri; @@ -63,43 +63,43 @@ MailUpClient.prototype.getAjax = function() { } else if (window.XMLHttpRequest) return new XMLHttpRequest(); else return false; } - + MailUpClient.prototype.getLogonEndpoint = function() { return this.logonEndpoint; } - + MailUpClient.prototype.setLogonEndpoint = function(value) { return this.logonEndpoint = value; } - + MailUpClient.prototype.getAuthorizationEndpoint = function() { return this.authorizationEndpoint; } - + MailUpClient.prototype.setAuthorizationEndpoint = function(value) { return this.authorizationEndpoint = value; } - + MailUpClient.prototype.getTokenEndpoint = function() { return this.tokenEndpoint; } - + MailUpClient.prototype.setTokenEndpoint = function(value) { return this.tokenEndpoint = value; } - + MailUpClient.prototype.getConsoleEndpoint = function() { return this.consoleEndpoint; } - + MailUpClient.prototype.setConsoleEndpoint = function(value) { return this.consoleEndpoint = value; } - + MailUpClient.prototype.getMailstatisticsEndpoint = function() { return this.mailstatisticsEndpoint; } - + MailUpClient.prototype.setMailstatisticsEndpoint = function(value) { return this.mailstatisticsEndpoint = value; } @@ -131,10 +131,10 @@ MailUpClient.prototype.logOn = function() { } MailUpClient.prototype.logOnWithUsernamePassword = function(username,password,onSuccess,onError) { - this.retreiveAccessToken(username,password,onSuccess,onError); + this.retrieveAccessToken(username,password,onSuccess,onError); } -MailUpClient.prototype.retreiveAccessTokenWithCode = function(code, onSuccess, onError) { +MailUpClient.prototype.retrieveAccessTokenWithCode = function(code, onSuccess, onError) { var url = this.getTokenEndpoint() + "?code=" + code + "&grant_type=authorization_code"; var request = this.getAjax(); var m = this; @@ -156,7 +156,7 @@ MailUpClient.prototype.retreiveAccessTokenWithCode = function(code, onSuccess, o request.send(null); } -MailUpClient.prototype.retreiveAccessToken = function(login, password, onSuccess, onError) { +MailUpClient.prototype.retrieveAccessToken = function(login, password, onSuccess, onError) { var url = this.getTokenEndpoint(); var body = "grant_type=password&client_id=" + this.clientId + "&client_secret=" + this.clientSecret + "&username=" + encodeURIComponent(login) + "&password=" + encodeURIComponent(password); var request = this.getAjax(); @@ -183,7 +183,7 @@ MailUpClient.prototype.retreiveAccessToken = function(login, password, onSuccess } else { request.send(null); } - + } MailUpClient.prototype.refreshAccessToken = function(onSuccess, onError) {