From 8f11843250dfc7ddc33ce71cd77c5e02d70c43ef Mon Sep 17 00:00:00 2001 From: mDuo13 Date: Fri, 7 Jun 2019 17:39:14 -0700 Subject: [PATCH] Remove unused ripple-txt-validator files --- assets/css/ripple-txt-validator.css | 17 ---- assets/js/ripple-txt-validator.js | 117 ------------------------ tool/template-ripple-txt-validator.html | 31 ------- 3 files changed, 165 deletions(-) delete mode 100644 assets/css/ripple-txt-validator.css delete mode 100644 assets/js/ripple-txt-validator.js delete mode 100644 tool/template-ripple-txt-validator.html diff --git a/assets/css/ripple-txt-validator.css b/assets/css/ripple-txt-validator.css deleted file mode 100644 index 8c8ca176e3..0000000000 --- a/assets/css/ripple-txt-validator.css +++ /dev/null @@ -1,17 +0,0 @@ -input#domain { - padding: 10px 20px; - margin-bottom: 16px; - width: 100%; -} - -.result-title { - display: none; -} - -span.red { - color: red; -} - -span.green { - color: green; -} diff --git a/assets/js/ripple-txt-validator.js b/assets/js/ripple-txt-validator.js deleted file mode 100644 index 088ae8da55..0000000000 --- a/assets/js/ripple-txt-validator.js +++ /dev/null @@ -1,117 +0,0 @@ -function VerificationError(message, tips) { - this.name = "VerificationError"; - this.message = message || ""; - this.tips = tips || ""; -} -VerificationError.prototype = Error.prototype; - -function makeLogEntry(text) { - var log = $('
  • ').text(text).appendTo('#log'); - log.resolve = function(text) { - return $('').html(text).appendTo(log); - }; - return log; -} - -$('#domain-entry').submit(function(e) { - e.preventDefault(); - - var domain = $('#domain').val(), - txtdata; - - $('.result-title').show(); - $('#result').show(); - $('#log').empty(); - - async.waterfall([ - function(callback) { - var urls = [ - //'http://www.'+domain+'/ripple.txt', - 'https://www.' + domain + '/ripple.txt', - //'http://'+domain+'/ripple.txt', - 'https://' + domain + '/ripple.txt', - 'https://ripple.' + domain + '/ripple.txt' - ].reverse(); - - function next(xhr, status) { - if (this instanceof $) { - var err; - switch (status) { - case 'timeout': - err = 'TIMEOUT'; - break; - case 'abort': - err = 'ABORTED'; - break; - case 'error': - err = 'ERROR'; - break; - default: - err = 'UNKNOWN'; - } - $('').text(err).addClass('red').appendTo(this); - } - if (!urls.length) { - var tips = 'Check if the file is actually hosted at one of the URLs above and make sure your server provides the required CORS header.'; - callback(new VerificationError('No ripple.txt found!', tips)); - return; - } - var url = urls.pop(); - var log = makeLogEntry('Checking ' + url + '...'); - $.ajax({ - url: url, - dataType: 'text', - success: function(data) { - $('').text('FOUND').addClass('green').appendTo(log); - txtdata = data; - callback(); - }, - error: $.proxy(next, log) - }); - } - next(); - }, - function() { - txtdata = txtdata.replace('\r\n', '\n'); - txtdata = txtdata.replace('\r', '\n'); - txtdata = txtdata.split('\n'); - - var currentSection = "", - sections = {}; - for (var i = 0, l = txtdata.length; i < l; i++) { - var line = txtdata[i].replace(/^\s+|\s+$/g, ''); - if (!line.length || line[0] === '#') { - continue; - } else if (line[0] === '[' && line[line.length - 1] === ']') { - currentSection = line.slice(1, line.length - 1); - sections[currentSection] = []; - } else { - line = line.replace(/^\s+|\s+$/g, ''); - if (sections[currentSection]) { - sections[currentSection].push(line); - } - } - } - - var log; - - log = makeLogEntry('Domain should match [domain]...'); - if (sections.domain && sections.domain.length && sections.domain[0] === domain) { - log.resolve('VALID').addClass('green'); - } else if (sections.domain && sections.domain.length) { - log.resolve('MISMATCH').addClass('red'); - } else { - log.resolve('MISSING').addClass('red'); - } - } - ], function(err, result) { - if (err instanceof VerificationError) { - var log = makeLogEntry(""); - log.resolve(err.message).addClass('red'); - $('
    ').appendTo(log); - $('

    ').html(err.tips).appendTo(log); - } else if (err) { - makeLogEntry(err).addClass('red'); - } - }); -}); diff --git a/tool/template-ripple-txt-validator.html b/tool/template-ripple-txt-validator.html deleted file mode 100644 index 56a05232fd..0000000000 --- a/tool/template-ripple-txt-validator.html +++ /dev/null @@ -1,31 +0,0 @@ -{% extends "template-base.html" %} - -{% block main %} -
    -

    ripple.txt Validator

    - -

    If you run a business that connects to the XRP Ledger, serving a ripple.txt file from your domain can help clarify which XRP Ledger addresses you own and use, and which validating server(s) you run.

    - -

    This tool allows you to verify that your ripple.txt is syntactically - correct and deployed properly.


    -
    -
    -
    - -
    -
    -
    -
    Result
    -
      -
    -
    -
    -{% endblock %} - -{% block endbody %} - - - -{% endblock %}