summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authortimb <opuscule@gmail.com>2015-08-18 19:01:03 -0700
committertimb <opuscule@gmail.com>2015-08-18 19:01:03 -0700
commit7c644c07e6f4ecc78f5a9faec3bbd88b6f9602e8 (patch)
tree00fd51b13b19f45744c35531e803a5976af5b40b /js
parent8752354fa9b2b8c03b47b33a75e0ca95e8335d97 (diff)
try to load pngs from sally into editor properly
Diffstat (limited to 'js')
-rw-r--r--js/clipboard.js13
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':