diff options
| -rw-r--r-- | js/clipboard.js | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/js/clipboard.js b/js/clipboard.js index a7dc8f6..2c32d12 100644 --- a/js/clipboard.js +++ b/js/clipboard.js @@ -271,7 +271,7 @@ var clipboard = (function () { function fetch_url(url, f, type){ type = type || 'arraybuffer' url = "/cgi-bin/proxy?" + url - // url = "http://198.199.72.134/cors/" + url + //url = "http://198.199.72.134/cors/" + url var xhr = new XMLHttpRequest() xhr.open('GET', url, true) xhr.responseType = type @@ -294,11 +294,20 @@ var clipboard = (function () { clipboard.import_colorcode(itxt.data, true) } } - + + function sally_url_convert(url){ + var png_regex = /https?:\/\/jollo\.org\/den\/sallies\/([0-9]+)\/([^.]+)\.png/ + var matches = url.match(png_regex) + if (!matches) return url + return 'https://jollo.org/den/sallies/' + matches[1] + '/raw-' + matches[2] + '?.txt' + // txt suffix to force asdf proxy + } + exports.load_from_location = function(){ var params = parse_url_search_params(window.location + '') if (!params.url) return var url = params.url + url = sally_url_convert(url) var type = get_filetype(url) switch (type){ case 'txt': |
